io_low_HLL.c
资源名称:tizos.rar [点击查看]
上传用户:qddsws
上传日期:2022-06-22
资源大小:723k
文件大小:1k
源码类别:
操作系统开发
开发平台:
C/C++
- inline unsigned char inportb(unsigned int port)
- {
- unsigned char ret;
- asm volatile ("inb %%dx,%%al":"=a" (ret):"d" (port));
- return ret;
- }
- inline void outportb(unsigned int port,unsigned char value)
- {
- asm volatile ("outb %%al,%%dx": :"d" (port), "a" (value));
- }
- inline void outportlong(unsigned int port,unsigned long value){
- asm volatile ("outl %%eax,%%dx": :"d" (port), "a" (value));
- }
- inline unsigned long inportlong(unsigned int port)
- {
- unsigned long ret;
- asm volatile ("inl %%dx,%%eax":"=a" (ret):"d" (port));
- return ret;
- }