【转】linux内核中writesb(), writesw(), writesl() 宏函数

writesb(), writesw(), writesl() 宏函数

功能 :

  • writesb()    I/O 上写入 8 位数据流数据 (1字节)
  • writesw()   I/O  上写入 16 位流数据 (2字节)
  • writesl()    I/O 上写入 32 位流数据 ( 4字节 )

原型 :

引用
#include <asm/io.h> 

void   writesb (unsigned short ioaddr , void * addr , unsigned long count )
void   writesw (unsigned short ioaddr , void * addr , unsigned long count )
void   writesl (unsigned short ioaddr , void * addr , unsigned long count )



说明 :
从内存映射的 I/O 空间,把 addr 指定的内存空间数据,以 count 大小连续写入 ioaddr 指定的地址上。

变量 :

  • ioaddr   I/O 指定地址;
  • addr      内存缓存起始地址;
  • count    写入数据的量

readsb(), readsw(), readsl() 宏函数

功能 :

  • readsb()    从 I/O 读取 8 位数据流 ( 1字节 )
  • readsw()  从 I/O 读取 16位数据流 ( 2字节 )
  • readsl()  从 I/O 读取 32 位数据流 ( 4 字节 )

原型 :

引用
#include <asm/io.h> 

void readsb (unsgined short ioaddr , void * addr , unsigned long count )
void readsw (unsgined short ioaddr , void * addr , unsigned long count )
void readsl (unsgined short ioaddr , void * addr , unsigned long count )



说明 :
从内存映射的 I/O 空间,在 loadder 指定的地址上,以 count 大小连续读取数据,然后写入 addr 指定的内存空间。

变量 :

  • ioaddr   I/O地址
  • addr      内存缓存起始地址
  • count    读取数据的数量
 
 
原文地址:https://www.cnblogs.com/veryStrong/p/6182352.html