summaryrefslogtreecommitdiff
path: root/sys/src/9/pc64/fns.h
diff options
context:
space:
mode:
authorcinap_lenrek <cinap_lenrek@felloff.net>2020-04-04 16:48:37 +0200
committercinap_lenrek <cinap_lenrek@felloff.net>2020-04-04 16:48:37 +0200
commit5f1b70f437ed4f598f9439e201f1f7644f5ce7b5 (patch)
tree7eede785ac28d6d2ed770274e7957e5deeb6d5c9 /sys/src/9/pc64/fns.h
parent8debb0736ea5578a195ab663bf9565d6e52ad83b (diff)
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.
Diffstat (limited to 'sys/src/9/pc64/fns.h')
-rw-r--r--sys/src/9/pc64/fns.h17
1 files changed, 8 insertions, 9 deletions
diff --git a/sys/src/9/pc64/fns.h b/sys/src/9/pc64/fns.h
index f4da48240..1fb982c64 100644
--- a/sys/src/9/pc64/fns.h
+++ b/sys/src/9/pc64/fns.h
@@ -103,7 +103,8 @@ void mathinit(void);
void mb386(void);
void mb586(void);
void meminit(void);
-void memorysummary(void);
+void meminit0(void);
+void memreserve(uintptr, uintptr);
void mfence(void);
#define mmuflushtlb() putcr3(getcr3())
void mmuinit(void);
@@ -157,7 +158,8 @@ int (*_pcmspecial)(char *, ISAConf *);
void pcmspecialclose(int);
void (*_pcmspecialclose)(int);
void pcmunmap(int, PCMmap*);
-void pmap(uintptr *, uintptr, uintptr, vlong);
+void pmap(uintptr, uintptr, vlong);
+void punmap(uintptr, vlong);
void preallocpages(void);
void procrestore(Proc*);
void procsave(Proc*);
@@ -187,13 +189,10 @@ void trapinit(void);
void trapinit0(void);
int tas(void*);
uvlong tscticks(uvlong*);
-uintptr umbmalloc(uintptr, int, int);
-void umbfree(uintptr, int);
-uintptr umbrwmalloc(uintptr, int, int);
-void umbrwfree(uintptr, int);
-uintptr upaalloc(int, int);
-void upafree(uintptr, int);
-void upareserve(uintptr, int);
+ulong umballoc(ulong, ulong, ulong);
+void umbfree(ulong, ulong);
+ulong upaalloc(ulong, ulong, ulong);
+void upafree(ulong, ulong);
void vectortable(void);
void vmxprocrestore(Proc *);
void vmxshutdown(void);