Mail Archives: djgpp/2016/03/16/10:30:10
>> Thanks. Weird that there is no _go32_dpmi_unlock_code/data.
> You can use '__dpmi_unlock_linear_region()'.
Yes, I've modified _go32_dpmi_lock_data to use unlock_linear_region, like
this:
==============
int _go32_dpmi_unlock_data( void *lockaddr, unsigned long locksize )
{
unsigned long baseaddr;
__dpmi_meminfo memregion;
if( __dpmi_get_segment_base_address( _go32_my_ds(), &baseaddr) == -1 )
return( -1 );
memset( &memregion, 0, sizeof(memregion) );
memregion.address = baseaddr + (unsigned long) lockaddr;
memregion.size = locksize;
if( __dpmi_unlock_linear_region( &memregion ) == -1 ) return( -1 );
return( 0 );
}
int _go32_dpmi_unlock_code( void *lockaddr, unsigned long locksize )
{
unsigned long baseaddr;
__dpmi_meminfo memregion;
if( __dpmi_get_segment_base_address( _go32_my_cs(), &baseaddr) == -1 )
return( -1 );
memset( &memregion, 0, sizeof(memregion) );
memregion.address = baseaddr + (unsigned long) lockaddr;
memregion.size = locksize;
if( __dpmi_unlock_linear_region( &memregion ) == -1 ) return( -1 );
return( 0 );
}
==============
Seems to work, but it's a bit inconvenient because the project is in Ada,
and this is now the only .c file.
Any reason why it's not in libc?
--
Wiktor S.
- Raw text -