On 20 April 2012 15:20, Stas Sergeev <s...@list.ru> wrote:
> 20.04.2012 06:34, bartolde...@users.sourceforge.net wrote:
>>
>> (as done for non-zero base). The only place where the scratch mmap
>> reservation
>> is necessary is inside mapshm.c, because mremap doesn't support hint
>> addresses.
>

>>    result = alloc_mapping(MAPPING_INIT_LOWRAM, LOWMEM_SIZE + HMASIZE, 0);
>> +  result = alias_mapping(MAPPING_INIT_LOWRAM, NULL, LOWMEM_SIZE +
>> HMASIZE,
>> +                        PROT_READ | PROT_WRITE | PROT_EXEC, result);
>>
> Given the above changelog, do you still need 2 mmaps here?

alloc_mapping call smalloc but doesn't call mmap  for mapshm/mapfile.
So the mmap is done in alias_mapping.

Mostly I was trying (like you) to get rid of some of the confusing
magic in mapping.c: alias_mapping should be a wrapper around
mappingdriver.alias, and alloc_mapping a wrapper around
mappingdriver.alloc.

> Btw, and what about the rest of the cleanups?

I'm still reviewing and thinking about those. I think the SCRATCH
mmaps could just stay in mmap_mapping (that's then just a simple
wrapper around mmap(..., MAP_PRIVATE|MAP_ANON,-1,0) with some debug
printfs). The KMEM stuff: maybe some of it (where it actually opens
/dev/mem and maps areas of this file) should be in open_mapping,
alloc_mapping could give you the right pointer in this area given an
offset in /dev/mem, and alias_mapping maps the DOS address to this
pointer.

There could be one function that combines alloc/alias mapping, but
then again, you want the Unix pointer (i.e. the result of
alloc_mapping) visible for EMS, so it seems better to have them as
separate calls that do separate things.

Bart

------------------------------------------------------------------------------
For Developers, A Lot Can Happen In A Second.
Boundary is the first to Know...and Tell You.
Monitor Your Applications in Ultra-Fine Resolution. Try it FREE!
http://p.sf.net/sfu/Boundary-d2dvs2
_______________________________________________
Dosemu-devel mailing list
Dosemu-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/dosemu-devel

Reply via email to