QNX中mmap_device_io() 和 mmap_device_memory()函数

来源于QNX IDE

1、mmap_device_io() 

1)函数定义 

#include 
#include 

uintptr_t mmap_device_io( size_t len,
                          uint64_t io );

len

The number of bytes of device I/O memory that you want to access. It can't be 0.

-----要访问的设备I/O内存的字节数。不能为0

io

The address of the area that you want to access.

2)返回值:

A handle to the device's I/O memory, or MAP_DEVICE_FAILED if an error occurs (errno is set).

-----返回映射设备I/O内存的句柄,如果发生错误(设置了errno)。

3)函数说明

The mmap_device_io() function maps len bytes of device I/O memory at io and makes it accessible via the in*() and out*() functions in .

2、mmap_device_memory()

1)函数定义

#include 

void * mmap_device_memory( void * addr,
                           size_t len,
                           int prot,
                           int flags,
                           uint64_t physical );

addr

NULL, or a pointer to where you want to map the object in the calling process's address space.

len

The number of bytes you want to map into the caller's address space. It can't be 0.

prot

The access capabilities that you want to use for the memory region being mapped.

flags

Specifies further information about handling the mapped region。

physical

The physical address of the memory to map into the caller's address space.

2)返回值

The address of the mapped-in object, or MAP_FAILED if an error occurs (errno is set).

3)函数说明

The mmap_device_memory() function maps len bytes of a device's physical memory address into the caller's address space at the location returned by mmap_device_memory().

你可能感兴趣的:(QNX)