adds some more io commnads; starts work on a PCI driver
This commit is contained in:
@ -1,3 +1,5 @@
|
||||
#include <stdint.h>
|
||||
|
||||
#ifndef ARCH_IO_H
|
||||
#define ARCH_IO_H
|
||||
|
||||
@ -8,7 +10,9 @@
|
||||
* @param port The I/O port to send the data to
|
||||
* @param data The data to send to the I/O port
|
||||
*/
|
||||
void outb(unsigned short port, unsigned char data);
|
||||
void outb(unsigned short port, uint8_t data);
|
||||
void outb_16(unsigned short port, uint16_t data);
|
||||
void outb_32(unsigned short port, uint32_t data);
|
||||
|
||||
/**
|
||||
* inb:
|
||||
@ -17,7 +21,9 @@ void outb(unsigned short port, unsigned char data);
|
||||
* @param port The address of the I/O port
|
||||
* @return The read byte
|
||||
*/
|
||||
unsigned char inb(unsigned short port);
|
||||
uint8_t inb(unsigned short port);
|
||||
uint16_t inb_16(unsigned short port);
|
||||
uint32_t inb_32(unsigned short port);
|
||||
|
||||
/**
|
||||
* io_wait:
|
||||
|
13
kernel/include/kernel/x86/pci.h
Normal file
13
kernel/include/kernel/x86/pci.h
Normal file
@ -0,0 +1,13 @@
|
||||
#include <stdint.h>
|
||||
|
||||
#ifndef ARCH_PCI_H
|
||||
#define ARCH_PCI_H
|
||||
|
||||
#define PCI_CONFIG_ADDRESS (0xCF8)
|
||||
#define PCI_CONFIG_DATA (0xCFC)
|
||||
|
||||
uint16_t pci_config_read_word(uint8_t bus, uint8_t slot, uint8_t func, uint8_t offset);
|
||||
|
||||
uint16_t pci_check_vendor(uint8_t bus, uint8_t slot);
|
||||
|
||||
#endif
|
Reference in New Issue
Block a user