Gain access to a device's registers
#include <stdint.h> #include <sys/mman.h> uintptr_t mmap_device_io( size_t len, uint64_t io );
- The number of bytes of device I/O memory that you want to access. It can't be 0.
- The address of the area that you want to access.
Use the -l c option to qcc to link against this library. This library is usually included automatically.
In order to map physical memory, your process must have the PROCMGR_AID_MEM_PHYS ability enabled. For more information, see procmgr_ability() .
A handle to the device's I/O memory, or MAP_DEVICE_FAILED if an error occurs ( errno is set).
- Invalid flags type, or len is 0.
- The address range requested is outside of the allowed process address range, or there wasn't enough memory to satisfy the request.
- The address from io for len bytes is invalid.
- The calling process doesn't have the required permission; see procmgr_ability() .
Last modified: 2013-12-23