1
0
Fork 0
mirror of https://github.com/tailix/kernel.git synced 2024-11-20 11:16:10 -05:00

Rename IO functions

This commit is contained in:
Braiden Vasco 2017-11-03 04:04:14 +00:00
parent 38e9e650b7
commit 81fa5a95a1
2 changed files with 14 additions and 14 deletions

View file

@ -1,46 +1,46 @@
#ifndef KERNELMQ_INCLUDED_ASM #ifndef KERNELMQ_INCLUDED_ASM
#define KERNELMQ_INCLUDED_ASM 1 #define KERNELMQ_INCLUDED_ASM 1
inline static unsigned char inb(unsigned short port); inline static unsigned char inportb(unsigned short port);
inline static unsigned short inw(unsigned short port); inline static unsigned short inportw(unsigned short port);
inline static unsigned int ind(unsigned short port); inline static unsigned int inportd(unsigned short port);
inline static void outb(unsigned short port, unsigned char value); inline static void outportb(unsigned short port, unsigned char value);
inline static void outw(unsigned short port, unsigned short value); inline static void outportw(unsigned short port, unsigned short value);
inline static void outd(unsigned short port, unsigned int value); inline static void outportd(unsigned short port, unsigned int value);
unsigned char inb(unsigned short port) unsigned char inportb(unsigned short port)
{ {
register unsigned char result; register unsigned char result;
asm volatile("inb %1, %0" : "=a" (result) : "dN" (port)); asm volatile("inb %1, %0" : "=a" (result) : "dN" (port));
return result; return result;
} }
unsigned short inw(unsigned short port) unsigned short inportw(unsigned short port)
{ {
register unsigned short result; register unsigned short result;
asm volatile("inw %1, %0" : "=a" (result) : "dN" (port)); asm volatile("inw %1, %0" : "=a" (result) : "dN" (port));
return result; return result;
} }
unsigned int ind(unsigned short port) unsigned int inportd(unsigned short port)
{ {
register unsigned int result; register unsigned int result;
asm volatile("ind %1, %0" : "=a" (result) : "dN" (port)); asm volatile("ind %1, %0" : "=a" (result) : "dN" (port));
return result; return result;
} }
void outb(unsigned short port, unsigned char value) void outportb(unsigned short port, unsigned char value)
{ {
asm volatile("outb %1, %0" : : "dN" (port), "a" (value)); asm volatile("outb %1, %0" : : "dN" (port), "a" (value));
} }
void outw(unsigned short port, unsigned short value) void outportw(unsigned short port, unsigned short value)
{ {
asm volatile("outw %1, %0" : : "dN" (port), "a" (value)); asm volatile("outw %1, %0" : : "dN" (port), "a" (value));
} }
void outd(unsigned short port, unsigned int value) void outportd(unsigned short port, unsigned int value)
{ {
asm volatile("outd %1, %0" : : "dN" (port), "a" (value)); asm volatile("outd %1, %0" : : "dN" (port), "a" (value));
} }

View file

@ -41,11 +41,11 @@ void hwint_handler(struct IsrRegisters regs)
if (regs.int_no >= 40) { // TODO: hardcoded if (regs.int_no >= 40) { // TODO: hardcoded
// Send reset signal to slave // Send reset signal to slave
outb(0xA0, 0x20); // TODO: hardcoded outportb(0xA0, 0x20); // TODO: hardcoded
} }
// Send reset signal to master // Send reset signal to master
outb(0x20, 0x20); // TODO: hardcoded outportb(0x20, 0x20); // TODO: hardcoded
const unsigned char hwint_no = regs.int_no - INT_HWINT_FIRST; const unsigned char hwint_no = regs.int_no - INT_HWINT_FIRST;