ata_disk_handler

This commit is contained in:
fslongjin
2022-03-21 17:13:15 +08:00
parent b28f7d9c0d
commit 046bce39a9
7 changed files with 68 additions and 18 deletions

View File

@ -279,6 +279,20 @@ void io_out32(unsigned short port, unsigned int value)
: "memory");
}
/**
* @brief 从端口读入n个word到buffer
*
*/
#define io_insw(port,buffer,nr) \
__asm__ __volatile__("cld;rep;insw;mfence;"::"d"(port),"D"(buffer),"c"(nr):"memory")
/**
* @brief 从输出buffer中的n个word到端口
*
*/
#define io_outsw(port,buffer,nr) \
__asm__ __volatile__("cld;rep;outsw;mfence;"::"d"(port),"S"(buffer),"c"(nr):"memory")
/**
* @brief 读取rsp寄存器的值存储了页目录的基地址
*