Functions | |
void * | __va (volatile unsigned long paddr) |
Convert physical to virtual memory address. | |
unsigned long | __pa (volatile void *vaddr) |
Convert virtual to physical memory address. |
We look in our local table(s) to save IPC costs. If this fails nasty things are going on and we Panic.
The current implementation is slow, iteration based. Optimization is possible and should be done soon using a hashing-like scheme.
Another straight-forward solution was mentioned by Jork: configure only one big kmem region and save traversing a list. This can be done be setting KMEM_RSIZE
.
unsigned long __pa | ( | volatile void * | vaddr | ) |
void* __va | ( | volatile unsigned long | paddr | ) |