diff --git a/src/include/console/console.h b/src/include/console/console.h index 6417c2e007..199ab2307d 100644 --- a/src/include/console/console.h +++ b/src/include/console/console.h @@ -17,7 +17,7 @@ #ifndef CONSOLE_CONSOLE_H_ #define CONSOLE_CONSOLE_H_ -#include +#include #include void console_init(void); @@ -25,7 +25,7 @@ void console_tx_byte(unsigned char byte); void console_tx_flush(void); unsigned char console_rx_byte(void); int console_tst_byte(void); -void post_code(uint8_t value); +void post_code(u8 value); void die(const char *msg); struct console_driver { diff --git a/src/include/cpu/generic/i386/arch/types.h b/src/include/cpu/generic/i386/arch/types.h index b9f7c9b642..e47c61bcd1 100644 --- a/src/include/cpu/generic/i386/arch/types.h +++ b/src/include/cpu/generic/i386/arch/types.h @@ -1,6 +1,13 @@ -/* data types */ +/* + * Generic data types. + */ + +#ifndef _ARCH_TYPES_H +#define _ARCH_TYPES_H + typedef unsigned long long u64; typedef unsigned int u32; typedef unsigned short u16; typedef unsigned char u8; +#endif diff --git a/src/include/device/device.h b/src/include/device/device.h index d6acd9771f..c7f6899d49 100644 --- a/src/include/device/device.h +++ b/src/include/device/device.h @@ -17,7 +17,7 @@ #ifndef DEVICE_H #define DEVICE_H -#include +#include #include #include @@ -87,7 +87,7 @@ struct device { unsigned int on_mainboard : 1; unsigned long rom_address; - uint8_t command; + u8 command; /* Base registers for this device. I/O, MEM and Expansion ROM */ struct resource resource[MAX_RESOURCES]; diff --git a/src/include/device/pci.h b/src/include/device/pci.h index 128c5c3af6..abe3104ee0 100644 --- a/src/include/device/pci.h +++ b/src/include/device/pci.h @@ -31,6 +31,7 @@ #ifndef PCI_H #define PCI_H +#include #include #include #include @@ -45,12 +46,17 @@ struct pci_operations { /* Common pci bus operations */ struct pci_bus_operations { - uint8_t (*read8) (struct bus *pbus, unsigned char bus, int devfn, int where); - uint16_t (*read16) (struct bus *pbus, unsigned char bus, int devfn, int where); - uint32_t (*read32) (struct bus *pbus, unsigned char bus, int devfn, int where); - void (*write8) (struct bus *pbus, unsigned char bus, int devfn, int where, uint8_t val); - void (*write16) (struct bus *pbus, unsigned char bus, int devfn, int where, uint16_t val); - void (*write32) (struct bus *pbus, unsigned char bus, int devfn, int where, uint32_t val); + u8 (*read8)(struct bus *pbus, unsigned char bus, int devfn, int where); + u16 (*read16)(struct bus *pbus, unsigned char bus, int devfn, + int where); + u32 (*read32)(struct bus *pbus, unsigned char bus, int devfn, + int where); + void (*write8)(struct bus *pbus, unsigned char bus, int devfn, + int where, u8 val); + void (*write16)(struct bus *pbus, unsigned char bus, int devfn, + int where, u16 val); + void (*write32)(struct bus *pbus, unsigned char bus, int devfn, + int where, u32 val); }; struct pci_driver { @@ -81,9 +87,9 @@ unsigned int do_pci_scan_bridge(device_t bus, unsigned int max, unsigned min_devfn, unsigned max_devfn, unsigned int max)); unsigned int pci_scan_bridge(device_t bus, unsigned int max); unsigned int pci_scan_bus(struct bus *bus, unsigned min_devfn, unsigned max_devfn, unsigned int max); -uint8_t pci_moving_config8(struct device *dev, unsigned reg); -uint16_t pci_moving_config16(struct device *dev, unsigned reg); -uint32_t pci_moving_config32(struct device *dev, unsigned reg); +u8 pci_moving_config8(struct device *dev, unsigned reg); +u16 pci_moving_config16(struct device *dev, unsigned reg); +u32 pci_moving_config32(struct device *dev, unsigned reg); unsigned pci_find_next_capability(device_t dev, unsigned cap, unsigned last); unsigned pci_find_capability(device_t dev, unsigned cap); struct resource *pci_get_resource(struct device *dev, unsigned long index); diff --git a/src/include/device/pci_ops.h b/src/include/device/pci_ops.h index d9cda9961b..9f6c8b5fc7 100644 --- a/src/include/device/pci_ops.h +++ b/src/include/device/pci_ops.h @@ -17,14 +17,14 @@ #ifndef PCI_OPS_H #define PCI_OPS_H -#include +#include #include -uint8_t pci_read_config8(device_t dev, unsigned where); -uint16_t pci_read_config16(device_t dev, unsigned where); -uint32_t pci_read_config32(device_t dev, unsigned where); -void pci_write_config8(device_t dev, unsigned where, uint8_t val); -void pci_write_config16(device_t dev, unsigned where, uint16_t val); -void pci_write_config32(device_t dev, unsigned where, uint32_t val); +u8 pci_read_config8(device_t dev, unsigned where); +u16 pci_read_config16(device_t dev, unsigned where); +u32 pci_read_config32(device_t dev, unsigned where); +void pci_write_config8(device_t dev, unsigned where, u8 val); +void pci_write_config16(device_t dev, unsigned where, u16 val); +void pci_write_config32(device_t dev, unsigned where, u32 val); #endif /* PCI_OPS_H */ diff --git a/src/include/device/pci_rom.h b/src/include/device/pci_rom.h index 916d0d4d43..c5bd278ba9 100644 --- a/src/include/device/pci_rom.h +++ b/src/include/device/pci_rom.h @@ -16,37 +16,38 @@ */ #ifndef PCI_ROM_H #define PCI_ROM_H +#include #include #include #define PCI_ROM_HDR 0xAA55 -#define PCI_DATA_HDR (uint32_t) ( ('R' << 24) | ('I' << 16) | ('C' << 8) | 'P' ) +#define PCI_DATA_HDR (u32) ( ('R' << 24) | ('I' << 16) | ('C' << 8) | 'P' ) #define PCI_RAM_IMAGE_START 0xD0000 #define PCI_VGA_RAM_IMAGE_START 0xC0000 struct rom_header { - uint16_t signature; - uint8_t size; - uint8_t init[3]; - uint8_t reserved[0x12]; - uint16_t data; + u16 signature; + u8 size; + u8 init[3]; + u8 reserved[0x12]; + u16 data; }; struct pci_data { - uint32_t signature; - uint16_t vendor; - uint16_t device; - uint16_t reserved_1; - uint16_t dlen; - uint8_t drevision; - uint8_t class_lo; - uint16_t class_hi; - uint16_t ilen; - uint16_t irevision; - uint8_t type; - uint8_t indicator; - uint16_t reserved_2; + u32 signature; + u16 vendor; + u16 device; + u16 reserved_1; + u16 dlen; + u8 drevision; + u8 class_lo; + u16 class_hi; + u16 ilen; + u16 irevision; + u8 type; + u8 indicator; + u16 reserved_2; }; extern struct rom_header * pci_rom_probe(struct device *dev); diff --git a/src/include/device/resource.h b/src/include/device/resource.h index f57de0e0eb..d47bae209c 100644 --- a/src/include/device/resource.h +++ b/src/include/device/resource.h @@ -17,7 +17,7 @@ #ifndef RESOURCE_H #define RESOURCE_H -#include +#include #define IORESOURCE_BITS 0x000000ff /* Bus-specific bits */ @@ -78,7 +78,7 @@ #define IORESOURCE_MEM_EXPANSIONROM (1<<6) -typedef uint64_t resource_t; +typedef u64 resource_t; struct resource { resource_t base; /* Base address of the resource */ resource_t size; /* Size of the resource */ diff --git a/src/mainboard/emulation/qemu-i386/mainboard.c b/src/mainboard/emulation/qemu-i386/mainboard.c index 6418f50218..5b61b37786 100644 --- a/src/mainboard/emulation/qemu-i386/mainboard.c +++ b/src/mainboard/emulation/qemu-i386/mainboard.c @@ -19,7 +19,7 @@ #include #include #include -#include +#include #include "dtc.h" struct chip_operations mainboard_emulation_qemu_i386_ops = {