Address Conversion
[Memory Management]

Linux' __va()/__pa() macro replacements. More...

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.

Detailed Description

Linux' __va()/__pa() macro replacements.

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.

Todo:
error handling
Todo:
what about I/O pages?
Todo:
implement remove_region()
Todo:
introduce region names
Test:
krishna: Ouch, if "struct conv_region" is vmalloc'ed, we may get a pfault on address conversion - that IS slow.

Function Documentation

unsigned long __pa ( volatile void *  vaddr  ) 

Convert virtual to physical memory address.

Parameters:
vaddr virtual memory address
Returns:
physical address

Definition at line 117 of file address.c.

void* __va ( volatile unsigned long  paddr  ) 

Convert physical to virtual memory address.

Parameters:
paddr physical memory address
Returns:
virtual address

Definition at line 86 of file address.c.


Linux DDE, written by Christian Helmuth  © 2003 Technische Universitaet Dresden