/**************************************************************************************
Copyright (c) 2002
The UbixOS Project
$Id$
**************************************************************************************/
/* Input One Byte From A Port */
inline unsigned char inportByte(unsigned int port) {
unsigned char retVal;
asm volatile(
"inb %%dx,%%al"
: "=a" (retVal)
: "d" (port)
);
return(retVal);
}
/* Input One Word From A Port */
inline unsigned char inportWord(unsigned int port) {
unsigned char retVal;
asm volatile(
"inw %%dx,%%ax"
: "=a" (retVal)
: "d" (port)
);
return(retVal);
}
/* Output One Byte To A Port */
inline void outportByte(unsigned int port,unsigned char value) {
asm volatile(
"outb %%al,%%dx"
:
: "d" (port), "a" (value)
);
}
/* Output On Word To A Port */
inline void outportWord(unsigned int port,unsigned int value) {
asm volatile(
"outw %%ax,%%dx"
:
: "d" (port), "a" (value)
);
}