Sag*_*ain 2 function linux-kernel gpio hardware-port
有人可以解释一下的意思吗
outb(0x10,short_base+2);
Run Code Online (Sandbox Code Playgroud)
我试图通过谷歌搜索来弄清楚,但没有用。
小智 7
回答你的问题:
outb是同名汇编指令的函数包装器,用于与端口映射设备通信,例如 I/O 地址范围 0x60-0x6F 用于 IBM PC 兼容计算机中的键盘。
现在,什么是端口映射 IO?
一种 CPU 到外设的通信方法,当处理器使用不同的地址总线与设备和内存通信时使用,因此需要特殊指令。
内存映射 I/O 是当今另一种也是最常见的方法,不需要特殊指令,因为所有内容都位于相同的地址空间中。
系统调用在手册页的第 2 节中描述: man 2 outb
void outb(unsigned char value, unsigned short int port);
DESCRIPTION
This family of functions is used to do low-level port input and output.
The out* functions do port output, the in* functions do port input; the
b-suffix functions are byte-width and the w-suffix functions word-width;
the _p-suffix functions pause until the I/O completes.
Run Code Online (Sandbox Code Playgroud)