]> git.lizzy.rs Git - plan9front.git/commit
pc, pc64: new memory map code
authorcinap_lenrek <cinap_lenrek@felloff.net>
Sat, 4 Apr 2020 14:48:37 +0000 (16:48 +0200)
committercinap_lenrek <cinap_lenrek@felloff.net>
Sat, 4 Apr 2020 14:48:37 +0000 (16:48 +0200)
commit5f1b70f437ed4f598f9439e201f1f7644f5ce7b5
tree7eede785ac28d6d2ed770274e7957e5deeb6d5c9
parent8debb0736ea5578a195ab663bf9565d6e52ad83b
pc, pc64: new memory map code

This replaces the memory map code for both pc and pc64
kernels with a unified implementation using the new
portable memory map code.

The main motivation is to be robust against broken
e820 memory maps by the bios and delay the Conf.mem[]
allocation after archinit(), so mp and acpi tables
can be reserved and excluded from user memory.

There are a few changes:

new memreserve() function has been added for archinit()
to reserve bios and acpi tables.

upareserve() has been replaced by upaalloc(), which now
has an address argument.

umbrwmalloc() and umbmalloc() have been replaced by
umballoc().

both upaalloc() and umballoc() return physical addresses
or -1 on error. the physical address -1 is now used as
a sentinel value instead of 0 when dealing with physical
addresses.

archmp and archacpi now always use vmap() to access
the bios tables and reserve the ranges. more overflow
checks have been added.

ramscan() has been rewritten using vmap().

to handle the population of kernel memory, pc and pc64
now have pmap() and punmap() functions to do permanent
mappings.
20 files changed:
sys/src/9/pc/archacpi.c
sys/src/9/pc/archmp.c
sys/src/9/pc/bootargs.c
sys/src/9/pc/devi82365.c
sys/src/9/pc/devpccard.c
sys/src/9/pc/ether8003.c
sys/src/9/pc/fns.h
sys/src/9/pc/main.c
sys/src/9/pc/mem.h
sys/src/9/pc/memory.c
sys/src/9/pc/mkfile
sys/src/9/pc/mmu.c
sys/src/9/pc/pci.c
sys/src/9/pc/screen.c
sys/src/9/pc64/fns.h
sys/src/9/pc64/main.c
sys/src/9/pc64/mem.h
sys/src/9/pc64/memory.c [deleted file]
sys/src/9/pc64/mkfile
sys/src/9/pc64/mmu.c