int osenv_mem_map_phys(oskit_addr_t pa, oskit_size_t length, void **kaddr, int flags);
Component OS, Blocking
Allocate kernel virtual memory and map the caller supplied physical addresses into it. The address and length must be aligned on a page boundary.This function is intended to provide device drivers access to memory-mapped devices.
An osenv_mem_unmap_phys interface will likely be added in the future.
XXX: While this is defined as blocking, the current glue code cannot yet handle this blocking, as it is not prepared for another request to enter the component. This will be fixed.
Flags:
- PHYS_MEM_NOCACHE
- Inhibit cache of data in the specified memory.
- PHYS_MEM_WRITETHROUGH
- Data cached from the specified memory must be synchronously written back on writes.
- pa
- Starting physical address.
- length
- Amount of memory to map.
- kaddr
- Kernel virtual address allocated and returned by the kernel that maps the specified memory.
- flags
- Memory mapping attributes, as described above.
Returns 0 on success, non-zero on error.