diff options
Diffstat (limited to 'kernel/pci.c')
| -rw-r--r-- | kernel/pci.c | 30 |
1 files changed, 1 insertions, 29 deletions
diff --git a/kernel/pci.c b/kernel/pci.c index 292bf1b..8aa5eb9 100644 --- a/kernel/pci.c +++ b/kernel/pci.c @@ -1,37 +1,9 @@ #include "kernel.h" +#include "x86.h" #define PCI_CONFIG_DATA 0xCFC #define PCI_CONFIG_ADDRESS 0xCF8 -void OutPort(unsigned short int IO_port,char Value) -{ - asm("outb %%al,%%dx;" - : //no output data - :"d"(IO_port),"a"(Value) //input data (EDX<-IO_port; AL<-Value) - ); -} -char InPort(unsigned short int IO_port) -{ - asm("inb %%dx,%%al;" - : //output data is in al register - :"d"(IO_port) //input data (EDX<-IO_port AL<-Value) - ); -} - -x86_outl(int port, uint32_t data) -{ - __asm __volatile("outl %0,%w1" : : "a" (data), "d" (port)); -} - - - -x86_inl(int port) -{ - uint32_t data; - __asm __volatile("inl %w1,%0" : "=a" (data) : "d" (port)); - return data; -} - void pciConfigSet (uint8_t bus, uint8_t slot, uint8_t func, uint8_t offset, uint32_t data) { |
