QNX中mmap_device_io() 和 mmap_device_memory()函数

来源于QNX IDE

1、mmap_device_io() 

1)函数定义 

#include <stdint.h>
#include <sys/mman.h>

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 <hw/inout.h>.

2、mmap_device_memory()

1)函数定义

#include <sys/mman.h>

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().

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值