diff --git a/device/cardbus_device.c b/device/cardbus_device.c index 7c3d53899f..4c09d24fce 100644 --- a/device/cardbus_device.c +++ b/device/cardbus_device.c @@ -89,7 +89,7 @@ void cardbus_read_resources(device_t dev) { resource_t moving_base, moving_limit, moving; unsigned long type; - uint16_t ctl; + u16 ctl; unsigned long index; /* See if needs a card control registers base address */ @@ -156,7 +156,7 @@ void cardbus_read_resources(device_t dev) void cardbus_enable_resources(device_t dev) { - uint16_t ctrl; + u16 ctrl; ctrl = pci_read_config16(dev, PCI_CB_BRIDGE_CONTROL); ctrl |= (dev->link[0].bridge_ctrl & ( PCI_BRIDGE_CTL_PARITY | @@ -185,8 +185,8 @@ unsigned int cardbus_scan_bus(struct bus *bus, unsigned int cardbus_scan_bridge(device_t dev, unsigned int max) { struct bus *bus; - uint32_t buses; - uint16_t cr; + u32 buses; + u16 cr; printk_spew("%s for %s\n", __func__, dev_path(dev)); diff --git a/device/hypertransport.c b/device/hypertransport.c index 290e25b2cc..6b9d1ef9f9 100644 --- a/device/hypertransport.c +++ b/device/hypertransport.c @@ -115,8 +115,8 @@ struct ht_link { static int ht_setup_link(struct ht_link *prev, device_t dev, unsigned pos) { - static const uint8_t link_width_to_pow2[]= { 3, 4, 0, 5, 1, 2, 0, 0 }; - static const uint8_t pow2_to_link_width[] = { 0x7, 4, 5, 0, 1, 3 }; + static const u8 link_width_to_pow2[]= { 3, 4, 0, 5, 1, 2, 0, 0 }; + static const u8 pow2_to_link_width[] = { 0x7, 4, 5, 0, 1, 3 }; struct ht_link cur[1]; unsigned present_width_cap, upstream_width_cap; unsigned present_freq_cap, upstream_freq_cap; @@ -322,7 +322,7 @@ static void ht_collapse_early_enumeration(struct bus *bus, unsigned offset_uniti /* Check if is already collapsed */ if((!offset_unitid)|| (offset_unitid && (!((HT_CHAIN_END_UNITID_BASE == 0) && (HT_CHAIN_END_UNITID_BASE 0)) { - uint16_t flags; + u16 flags; int i; device_t last_func = 0; flags = pci_read_config16(real_last_dev, real_last_pos + PCI_CAP_FLAGS); diff --git a/device/pci_device.c b/device/pci_device.c index 732fd3c530..369764b583 100644 --- a/device/pci_device.c +++ b/device/pci_device.c @@ -56,9 +56,9 @@ #include #endif -uint8_t pci_moving_config8(struct device *dev, unsigned reg) +u8 pci_moving_config8(struct device *dev, unsigned reg) { - uint8_t value, ones, zeroes; + u8 value, ones, zeroes; value = pci_read_config8(dev, reg); pci_write_config8(dev, reg, 0xff); @@ -72,9 +72,9 @@ uint8_t pci_moving_config8(struct device *dev, unsigned reg) return ones ^ zeroes; } -uint16_t pci_moving_config16(struct device *dev, unsigned reg) +u16 pci_moving_config16(struct device *dev, unsigned reg) { - uint16_t value, ones, zeroes; + u16 value, ones, zeroes; value = pci_read_config16(dev, reg); pci_write_config16(dev, reg, 0xffff); @@ -88,9 +88,9 @@ uint16_t pci_moving_config16(struct device *dev, unsigned reg) return ones ^ zeroes; } -uint32_t pci_moving_config32(struct device *dev, unsigned reg) +u32 pci_moving_config32(struct device *dev, unsigned reg) { - uint32_t value, ones, zeroes; + u32 value, ones, zeroes; value = pci_read_config32(dev, reg); pci_write_config32(dev, reg, 0xffffffff); @@ -398,11 +398,11 @@ static void pci_bridge_read_bases(struct device *dev) resource_t moving_base, moving_limit, moving; /* See if the bridge I/O resources are implemented */ - moving_base = ((uint32_t)pci_moving_config8(dev, PCI_IO_BASE)) << 8; - moving_base |= ((uint32_t)pci_moving_config16(dev, PCI_IO_BASE_UPPER16)) << 16; + moving_base = ((u32)pci_moving_config8(dev, PCI_IO_BASE)) << 8; + moving_base |= ((u32)pci_moving_config16(dev, PCI_IO_BASE_UPPER16)) << 16; - moving_limit = ((uint32_t)pci_moving_config8(dev, PCI_IO_LIMIT)) << 8; - moving_limit |= ((uint32_t)pci_moving_config16(dev, PCI_IO_LIMIT_UPPER16)) << 16; + moving_limit = ((u32)pci_moving_config8(dev, PCI_IO_LIMIT)) << 8; + moving_limit |= ((u32)pci_moving_config16(dev, PCI_IO_LIMIT_UPPER16)) << 16; moving = moving_base & moving_limit; @@ -428,8 +428,8 @@ static void pci_bridge_read_bases(struct device *dev) /* See if the bridge mem resources are implemented */ - moving_base = ((uint32_t)pci_moving_config16(dev, PCI_MEMORY_BASE)) << 16; - moving_limit = ((uint32_t)pci_moving_config16(dev, PCI_MEMORY_LIMIT)) << 16; + moving_base = ((u32)pci_moving_config16(dev, PCI_MEMORY_BASE)) << 16; + moving_limit = ((u32)pci_moving_config16(dev, PCI_MEMORY_LIMIT)) << 16; moving = moving_base & moving_limit; @@ -559,7 +559,7 @@ void pci_dev_set_resources(struct device *dev) { struct resource *resource, *last; unsigned link; - uint8_t line; + u8 line; last = &dev->resource[dev->resources]; @@ -594,7 +594,7 @@ void pci_dev_set_resources(struct device *dev) void pci_dev_enable_resources(struct device *dev) { const struct pci_operations *ops; - uint16_t command; + u16 command; /* Set the subsystem vendor and device id for mainboard devices */ ops = ops_pci(dev); @@ -619,7 +619,7 @@ void pci_dev_enable_resources(struct device *dev) void pci_bus_enable_resources(struct device *dev) { - uint16_t ctrl; + u16 ctrl; /* enable IO in command register if there is VGA card * connected with (even it does not claim IO resource) */ if (dev->link[0].bridge_ctrl & PCI_BRIDGE_CTL_VGA) @@ -899,8 +899,8 @@ static struct device *pci_scan_get_dev(struct device **list, unsigned int devfn) */ struct device * pci_probe_dev(struct device * dev, struct bus *bus, unsigned devfn) { - uint32_t id, class; - uint8_t hdr_type; + u32 id, class; + u8 hdr_type; /* Detect if a device is present */ if (!dev) { @@ -1112,8 +1112,8 @@ unsigned int do_pci_scan_bridge(struct device *dev, unsigned int max, unsigned min_devfn, unsigned max_devfn, unsigned int max)) { struct bus *bus; - uint32_t buses; - uint16_t cr; + u32 buses; + u16 cr; printk(BIOS_SPEW,"%s for %s\n", __func__, dev_path(dev)); diff --git a/device/pci_ops.c b/device/pci_ops.c index 8683b06b98..e912be97c1 100644 --- a/device/pci_ops.c +++ b/device/pci_ops.c @@ -1,19 +1,19 @@ /* - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + */ -*/ #include #include #include @@ -27,44 +27,44 @@ static struct bus *get_pbus(struct device * dev) pbus = pbus->dev->bus; } if (!pbus || !pbus->dev || !pbus->dev->ops || !pbus->dev->ops->ops_pci_bus) { - printk_alert("%s Cannot find pci bus operations", dev_path(dev)); + printk(BIOS_ALERT,"%s Cannot find pci bus operations", dev_path(dev)); die(""); for(;;); } return pbus; } -uint8_t pci_read_config8(struct device * dev, unsigned where) +u8 pci_read_config8(struct device * dev, unsigned where) { struct bus *pbus = get_pbus(dev); return ops_pci_bus(pbus)->read8(pbus, dev->bus->secondary, dev->path.u.pci.devfn, where); } -uint16_t pci_read_config16(struct device * dev, unsigned where) +u16 pci_read_config16(struct device * dev, unsigned where) { struct bus *pbus = get_pbus(dev); return ops_pci_bus(pbus)->read16(pbus, dev->bus->secondary, dev->path.u.pci.devfn, where); } -uint32_t pci_read_config32(struct device * dev, unsigned where) +u32 pci_read_config32(struct device * dev, unsigned where) { struct bus *pbus = get_pbus(dev); return ops_pci_bus(pbus)->read32(pbus, dev->bus->secondary, dev->path.u.pci.devfn, where); } -void pci_write_config8(struct device * dev, unsigned where, uint8_t val) +void pci_write_config8(struct device * dev, unsigned where, u8 val) { struct bus *pbus = get_pbus(dev); ops_pci_bus(pbus)->write8(pbus, dev->bus->secondary, dev->path.u.pci.devfn, where, val); } -void pci_write_config16(struct device * dev, unsigned where, uint16_t val) +void pci_write_config16(struct device * dev, unsigned where, u16 val) { struct bus *pbus = get_pbus(dev); ops_pci_bus(pbus)->write16(pbus, dev->bus->secondary, dev->path.u.pci.devfn, where, val); } -void pci_write_config32(struct device * dev, unsigned where, uint32_t val) +void pci_write_config32(struct device * dev, unsigned where, u32 val) { struct bus *pbus = get_pbus(dev); ops_pci_bus(pbus)->write32(pbus, dev->bus->secondary, dev->path.u.pci.devfn, where, val); diff --git a/device/pnp_device.c b/device/pnp_device.c index d595c253dc..12f4f08799 100644 --- a/device/pnp_device.c +++ b/device/pnp_device.c @@ -27,13 +27,13 @@ /* PNP fundamental operations */ -void pnp_write_config(device_t dev, uint8_t reg, uint8_t value) +void pnp_write_config(device_t dev, u8 reg, u8 value) { outb(reg, dev->path.u.pnp.port); outb(value, dev->path.u.pnp.port + 1); } -uint8_t pnp_read_config(device_t dev, uint8_t reg) +u8 pnp_read_config(device_t dev, u8 reg) { outb(reg, dev->path.u.pnp.port); return inb(dev->path.u.pnp.port + 1); diff --git a/device/smbus_ops.c b/device/smbus_ops.c index f5e441e664..35f6eeb037 100644 --- a/device/smbus_ops.c +++ b/device/smbus_ops.c @@ -74,35 +74,35 @@ int smbus_recv_byte(device_t dev) { return ops_smbus_bus(get_pbus_smbus(dev))->recv_byte(dev); } -int smbus_send_byte(device_t dev, uint8_t byte) +int smbus_send_byte(device_t dev, u8 byte) { return ops_smbus_bus(get_pbus_smbus(dev))->send_byte(dev, byte); } -int smbus_read_byte(device_t dev, uint8_t addr) +int smbus_read_byte(device_t dev, u8 addr) { return ops_smbus_bus(get_pbus_smbus(dev))->read_byte(dev, addr); } -int smbus_write_byte(device_t dev, uint8_t addr, uint8_t val) +int smbus_write_byte(device_t dev, u8 addr, u8 val) { return ops_smbus_bus(get_pbus_smbus(dev))->write_byte(dev, addr, val); } -int smbus_read_word(device_t dev, uint8_t addr) +int smbus_read_word(device_t dev, u8 addr) { return ops_smbus_bus(get_pbus_smbus(dev))->read_word(dev, addr); } -int smbus_write_word(device_t dev, uint8_t addr, uint16_t val) +int smbus_write_word(device_t dev, u8 addr, u16 val) { return ops_smbus_bus(get_pbus_smbus(dev))->write_word(dev, addr, val); } -int smbus_process_call(device_t dev, uint8_t cmd, uint16_t data) +int smbus_process_call(device_t dev, u8 cmd, u16 data) { return ops_smbus_bus(get_pbus_smbus(dev))->process_call(dev, cmd, data); } -int smbus_block_read(device_t dev, uint8_t cmd, uint8_t bytes, uint8_t *buffer) +int smbus_block_read(device_t dev, u8 cmd, u8 bytes, u8 *buffer) { return ops_smbus_bus(get_pbus_smbus(dev))->block_read(dev, cmd, bytes, buffer); } -int smbus_block_write(device_t dev, uint8_t cmd, uint8_t bytes, const uint8_t *buffer) +int smbus_block_write(device_t dev, u8 cmd, u8 bytes, const u8 *buffer) { return ops_smbus_bus(get_pbus_smbus(dev))->block_write(dev, cmd, bytes, buffer); } diff --git a/doc/design/stage1.c b/doc/design/stage1.c index d10cacf742..b8c090a96a 100644 --- a/doc/design/stage1.c +++ b/doc/design/stage1.c @@ -25,8 +25,8 @@ static void stage1_superio_setup(void) { struct property *superio; unsigned value; - uint32_t dword; - uint8_t byte; + u32 dword; + u8 byte; superio = get_property(dtb, "ck804"); /* read dev 1 , function 0, of the superio, */ diff --git a/include/console/btext.h b/include/console/btext.h deleted file mode 100644 index 075fd85cae..0000000000 --- a/include/console/btext.h +++ /dev/null @@ -1,88 +0,0 @@ -/* - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - -*/ -/* - * This file describes the structure passed from the BootX application - * (for MacOS) when it is used to boot Linux. - * - * Written by Benjamin Herrenschmidt. - * - * Move to LinuxBIOS by LYH yhlu@tyan.com - * - */ - - -#ifndef _BTEXT_H__ -#define _BTEXT_H__ - -#define u32 uint32_t -#define u16 uint16_t -#define u8 uint8_t - -/* Here are the boot informations that are passed to the bootstrap - * Note that the kernel arguments and the device tree are appended - * at the end of this structure. */ -typedef struct boot_infos -{ - - /* NEW (vers. 2) this holds the current _logical_ base addr of - the frame buffer (for use by early boot message) */ - u8* logicalDisplayBase; - - - /* Some infos about the current MacOS display */ - u32 dispDeviceRect[4]; /* left,top,right,bottom */ - u32 dispDeviceDepth; /* (8, 16 or 32) */ - u8* dispDeviceBase; /* base address (physical) */ - u32 dispDeviceRowBytes; /* rowbytes (in bytes) */ - u32 dispDeviceColorsOffset; /* Colormap (8 bits only) or 0 (*) */ - - - /* The framebuffer size (optional, currently 0) */ - u32 frameBufferSize; /* Represents a max size, can be 0. */ - - -} boot_infos_t; - -/* (*) The format of the colormap is 256 * 3 * 2 bytes. Each color index is represented - * by 3 short words containing a 16 bits (unsigned) color component. - * Later versions may contain the gamma table for direct-color devices here. - */ -#define BOOTX_COLORTABLE_SIZE (256UL*3UL*2UL) - - -/* - * Definitions for using the procedures in btext.c. - * - * Benjamin Herrenschmidt - */ - -extern void btext_clearscreen(void); - -extern boot_infos_t disp_bi; -extern u32 boot_text_mapped; - -void btext_setup_display(u32 width, u32 height, u32 depth, u32 pitch, - unsigned long address); -void map_boot_text(void); -void btext_update_display(unsigned long phys, u32 width, u32 height, - u32 depth, u32 pitch); - -void btext_drawchar(char c); -void btext_drawstring(const char *str); -void btext_drawhex(u32 v); - -#endif /* _BTEXT_H */ diff --git a/include/cpu/generic/x86/arch/pciconf.h b/include/cpu/generic/x86/arch/pciconf.h new file mode 100644 index 0000000000..5887522c8b --- /dev/null +++ b/include/cpu/generic/x86/arch/pciconf.h @@ -0,0 +1,14 @@ +#ifndef PCI_CONF_REG_INDEX + +// These are defined in the PCI spec, and hence are theoretically +// inclusive of ANYTHING that uses a PCI bus. +#define PCI_CONF_REG_INDEX 0xcf8 +#define PCI_CONF_REG_DATA 0xcfc + +#if PCI_IO_CFG_EXT == 0 +#define CONFIG_ADDR(bus,devfn,where) (((bus) << 16) | ((devfn) << 8) | (where)) +#else +#define CONFIG_ADDR(bus,devfn,where) (((bus) << 16) | ((devfn) << 8) | (where & 0xff) | ((where & 0xf00)<<16) ) +#endif + +#endif diff --git a/include/cpu/generic/x86/arch/types.h b/include/cpu/generic/x86/arch/types.h index e47c61bcd1..64243a8b53 100644 --- a/include/cpu/generic/x86/arch/types.h +++ b/include/cpu/generic/x86/arch/types.h @@ -10,4 +10,9 @@ typedef unsigned int u32; typedef unsigned short u16; typedef unsigned char u8; +typedef signed long long s64; +typedef signed int s32; +typedef signed short s16; +typedef signed char s8; + #endif diff --git a/include/device/pnp.h b/include/device/pnp.h index c06e18aeaf..c6a0b1b50b 100644 --- a/include/device/pnp.h +++ b/include/device/pnp.h @@ -22,8 +22,8 @@ #include /* Primitive pnp resource manipulation */ -void pnp_write_config(device_t dev, uint8_t reg, uint8_t value); -uint8_t pnp_read_config(device_t dev, uint8_t reg); +void pnp_write_config(device_t dev, u8 reg, u8 value); +u8 pnp_read_config(device_t dev, u8 reg); void pnp_set_logical_device(device_t dev); void pnp_set_enable(device_t dev, int enable); int pnp_read_enable(device_t dev); diff --git a/include/device/smbus.h b/include/device/smbus.h index 6b94d8eb9d..59cbf5c3a2 100644 --- a/include/device/smbus.h +++ b/include/device/smbus.h @@ -27,14 +27,14 @@ struct smbus_bus_operations { int (*quick_read) (device_t dev); int (*quick_write) (device_t dev); int (*recv_byte) (device_t dev); - int (*send_byte) (device_t dev, uint8_t value); - int (*read_byte) (device_t dev, uint8_t addr); - int (*write_byte) (device_t dev, uint8_t addr, uint8_t value); - int (*read_word) (device_t dev, uint8_t addr); - int (*write_word) (device_t dev, uint8_t addr, uint16_t value); - int (*process_call)(device_t dev, uint8_t cmd, uint16_t data); - int (*block_read) (device_t dev, uint8_t cmd, uint8_t bytes, uint8_t *buffer); - int (*block_write) (device_t dev, uint8_t cmd, uint8_t bytes, const uint8_t *buffer); + int (*send_byte) (device_t dev, u8 value); + int (*read_byte) (device_t dev, u8 addr); + int (*write_byte) (device_t dev, u8 addr, u8 value); + int (*read_word) (device_t dev, u8 addr); + int (*write_word) (device_t dev, u8 addr, u16 value); + int (*process_call)(device_t dev, u8 cmd, u16 data); + int (*block_read) (device_t dev, u8 cmd, u8 bytes, u8 *buffer); + int (*block_write) (device_t dev, u8 cmd, u8 bytes, const u8 *buffer); }; static inline const struct smbus_bus_operations *ops_smbus_bus(struct bus *bus) @@ -52,14 +52,14 @@ int smbus_set_link(device_t dev); int smbus_quick_read(device_t dev); int smbus_quick_write(device_t dev); int smbus_recv_byte(device_t dev); -int smbus_send_byte(device_t dev, uint8_t byte); -int smbus_read_byte(device_t dev, uint8_t addr); -int smbus_write_byte(device_t dev, uint8_t addr, uint8_t val); -int smbus_read_word(device_t dev, uint8_t addr); -int smbus_write_word(device_t dev, uint8_t addr, uint16_t val); -int smbus_process_call(device_t dev, uint8_t cmd, uint16_t data); -int smbus_block_read(device_t dev, uint8_t cmd, uint8_t bytes, uint8_t *buffer); -int smbus_block_write(device_t dev, uint8_t cmd, uint8_t bytes, const uint8_t *buffer); +int smbus_send_byte(device_t dev, u8 byte); +int smbus_read_byte(device_t dev, u8 addr); +int smbus_write_byte(device_t dev, u8 addr, u8 val); +int smbus_read_word(device_t dev, u8 addr); +int smbus_write_word(device_t dev, u8 addr, u16 val); +int smbus_process_call(device_t dev, u8 cmd, u16 data); +int smbus_block_read(device_t dev, u8 cmd, u8 bytes, u8 *buffer); +int smbus_block_write(device_t dev, u8 cmd, u8 bytes, const u8 *buffer); #endif /* DEVICE_SMBUS_H */ diff --git a/include/elf.h b/include/elf.h index 9ae2d172f1..76dba467db 100644 --- a/include/elf.h +++ b/include/elf.h @@ -23,45 +23,43 @@ #ifndef _ELF_H #define _ELF_H 1 +#include #include #include -#include - -__BEGIN_DECLS /* Standard ELF types. */ /* Type for a 16-bit quantity. */ -typedef uint16_t Elf32_Half; -typedef uint16_t Elf64_Half; +typedef u16 Elf32_Half; +typedef u16 Elf64_Half; /* Types for signed and unsigned 32-bit quantities. */ -typedef uint32_t Elf32_Word; -typedef int32_t Elf32_Sword; -typedef uint32_t Elf64_Word; -typedef int32_t Elf64_Sword; +typedef u32 Elf32_Word; +typedef s32 Elf32_Sword; +typedef u32 Elf64_Word; +typedef s32 Elf64_Sword; /* Types for signed and unsigned 64-bit quantities. */ -typedef uint64_t Elf32_Xword; -typedef int64_t Elf32_Sxword; -typedef uint64_t Elf64_Xword; -typedef int64_t Elf64_Sxword; +typedef u64 Elf32_Xword; +typedef s64 Elf32_Sxword; +typedef u64 Elf64_Xword; +typedef s64 Elf64_Sxword; /* Type of addresses. */ -typedef uint32_t Elf32_Addr; -typedef uint64_t Elf64_Addr; +typedef u32 Elf32_Addr; +typedef u64 Elf64_Addr; /* Type of file offsets. */ -typedef uint32_t Elf32_Off; -typedef uint64_t Elf64_Off; +typedef u32 Elf32_Off; +typedef u64 Elf64_Off; /* Type for section indices, which are 16-bit quantities. */ -typedef uint16_t Elf32_Section; -typedef uint16_t Elf64_Section; +typedef u16 Elf32_Section; +typedef u16 Elf64_Section; /* Type of symbol indices. */ -typedef uint32_t Elf32_Symndx; -typedef uint64_t Elf64_Symndx; +typedef u32 Elf32_Symndx; +typedef u64 Elf64_Symndx; /* The ELF file header. This appears at the start of every ELF file. */ diff --git a/include/elf_boot.h b/include/elf_boot.h index 6830383d1f..910611f814 100644 --- a/include/elf_boot.h +++ b/include/elf_boot.h @@ -39,9 +39,9 @@ #define ELF_HEAD_SIZE (8*1024) #define ELF_BOOT_MAGIC 0x0E1FB007 -typedef uint16_t Elf_Half; -typedef uint32_t Elf_Word; -typedef uint64_t Elf_Xword; +typedef u16 Elf_Half; +typedef u32 Elf_Word; +typedef u64 Elf_Xword; typedef struct { diff --git a/include/linuxbios_tables.h b/include/linuxbios_tables.h index a4f93c90da..be9c26f6fb 100644 --- a/include/linuxbios_tables.h +++ b/include/linuxbios_tables.h @@ -52,7 +52,7 @@ /* Since LinuxBIOS is usually compiled 32bit, gcc will align 64bit * types to 32bit boundaries. If the LinuxBIOS table is dumped on a - * 64bit system, a uint64_t would be aligned to 64bit boundaries, + * 64bit system, a u64 would be aligned to 64bit boundaries, * breaking the table format. * * lb_uint64 will keep 64bit LinuxBIOS table values aligned to 32bit @@ -63,19 +63,19 @@ */ struct lb_uint64 { - uint32_t lo; - uint32_t hi; + u32 lo; + u32 hi; }; -static inline uint64_t unpack_lb64(struct lb_uint64 value) +static inline u64 unpack_lb64(struct lb_uint64 value) { - uint64_t result; + u64 result; result = value.hi; result = (result << 32) + value.lo; return result; } -static inline struct lb_uint64 pack_lb64(uint64_t value) +static inline struct lb_uint64 pack_lb64(u64 value) { struct lb_uint64 result; result.lo = (value >> 0) & 0xffffffff; @@ -87,12 +87,12 @@ static inline struct lb_uint64 pack_lb64(uint64_t value) struct lb_header { - uint8_t signature[4]; /* LBIO */ - uint32_t header_bytes; - uint32_t header_checksum; - uint32_t table_bytes; - uint32_t table_checksum; - uint32_t table_entries; + u8 signature[4]; /* LBIO */ + u32 header_bytes; + u32 header_checksum; + u32 table_bytes; + u32 table_checksum; + u32 table_entries; }; /* Every entry in the boot enviroment list will correspond to a boot @@ -102,8 +102,8 @@ struct lb_header * forward compatibility with records not yet defined. */ struct lb_record { - uint32_t tag; /* tag ID */ - uint32_t size; /* size of record (in bytes) */ + u32 tag; /* tag ID */ + u32 size; /* size of record (in bytes) */ }; #define LB_TAG_UNUSED 0x0000 @@ -113,32 +113,32 @@ struct lb_record { struct lb_memory_range { struct lb_uint64 start; struct lb_uint64 size; - uint32_t type; + u32 type; #define LB_MEM_RAM 1 /* Memory anyone can use */ #define LB_MEM_RESERVED 2 /* Don't use this memory region */ #define LB_MEM_TABLE 16 /* Ram configuration tables are kept in */ }; struct lb_memory { - uint32_t tag; - uint32_t size; + u32 tag; + u32 size; struct lb_memory_range map[0]; }; #define LB_TAG_HWRPB 0x0002 struct lb_hwrpb { - uint32_t tag; - uint32_t size; - uint64_t hwrpb; + u32 tag; + u32 size; + u64 hwrpb; }; #define LB_TAG_MAINBOARD 0x0003 struct lb_mainboard { - uint32_t tag; - uint32_t size; - uint8_t vendor_idx; - uint8_t part_number_idx; - uint8_t strings[0]; + u32 tag; + u32 size; + u8 vendor_idx; + u8 part_number_idx; + u8 strings[0]; }; #define LB_TAG_VERSION 0x0004 @@ -152,18 +152,18 @@ struct lb_mainboard { #define LB_TAG_LINKER 0x000c #define LB_TAG_ASSEMBLER 0x000d struct lb_string { - uint32_t tag; - uint32_t size; - uint8_t string[0]; + u32 tag; + u32 size; + u8 string[0]; }; /* The following structures are for the cmos definitions table */ #define LB_TAG_CMOS_OPTION_TABLE 200 /* cmos header record */ struct cmos_option_table { - uint32_t tag; /* CMOS definitions table type */ - uint32_t size; /* size of the entire table */ - uint32_t header_length; /* length of header */ + u32 tag; /* CMOS definitions table type */ + u32 size; /* size of the entire table */ + u32 header_length; /* length of header */ }; /* cmos entry record @@ -175,14 +175,14 @@ struct cmos_option_table { */ #define LB_TAG_OPTION 201 struct cmos_entries { - uint32_t tag; /* entry type */ - uint32_t size; /* length of this record */ - uint32_t bit; /* starting bit from start of image */ - uint32_t length; /* length of field in bits */ - uint32_t config; /* e=enumeration, h=hex, r=reserved */ - uint32_t config_id; /* a number linking to an enumeration record */ + u32 tag; /* entry type */ + u32 size; /* length of this record */ + u32 bit; /* starting bit from start of image */ + u32 length; /* length of field in bits */ + u32 config; /* e=enumeration, h=hex, r=reserved */ + u32 config_id; /* a number linking to an enumeration record */ #define CMOS_MAX_NAME_LENGTH 32 - uint8_t name[CMOS_MAX_NAME_LENGTH]; /* name of entry in ascii, + u8 name[CMOS_MAX_NAME_LENGTH]; /* name of entry in ascii, variable length int aligned */ }; @@ -193,12 +193,12 @@ struct cmos_entries { */ #define LB_TAG_OPTION_ENUM 202 struct cmos_enums { - uint32_t tag; /* enumeration type */ - uint32_t size; /* length of this record */ - uint32_t config_id; /* a number identifying the config id */ - uint32_t value; /* the value associated with the text */ + u32 tag; /* enumeration type */ + u32 size; /* length of this record */ + u32 config_id; /* a number identifying the config id */ + u32 value; /* the value associated with the text */ #define CMOS_MAX_TEXT_LENGTH 32 - uint8_t text[CMOS_MAX_TEXT_LENGTH]; /* enum description in ascii, + u8 text[CMOS_MAX_TEXT_LENGTH]; /* enum description in ascii, variable length int aligned */ }; @@ -207,25 +207,25 @@ struct cmos_enums { */ #define LB_TAG_OPTION_DEFAULTS 203 struct cmos_defaults { - uint32_t tag; /* default type */ - uint32_t size; /* length of this record */ - uint32_t name_length; /* length of the following name field */ - uint8_t name[CMOS_MAX_NAME_LENGTH]; /* name identifying the default */ + u32 tag; /* default type */ + u32 size; /* length of this record */ + u32 name_length; /* length of the following name field */ + u8 name[CMOS_MAX_NAME_LENGTH]; /* name identifying the default */ #define CMOS_IMAGE_BUFFER_SIZE 128 - uint8_t default_set[CMOS_IMAGE_BUFFER_SIZE]; /* default settings */ + u8 default_set[CMOS_IMAGE_BUFFER_SIZE]; /* default settings */ }; #define LB_TAG_OPTION_CHECKSUM 204 struct cmos_checksum { - uint32_t tag; - uint32_t size; + u32 tag; + u32 size; /* In practice everything is byte aligned, but things are measured * in bits to be consistent. */ - uint32_t range_start; /* First bit that is checksummed (byte aligned) */ - uint32_t range_end; /* Last bit that is checksummed (byte aligned) */ - uint32_t location; /* First bit of the checksum (byte aligned) */ - uint32_t type; /* Checksum algorithm that is used */ + u32 range_start; /* First bit that is checksummed (byte aligned) */ + u32 range_end; /* Last bit that is checksummed (byte aligned) */ + u32 location; /* First bit of the checksum (byte aligned) */ + u32 type; /* Checksum algorithm that is used */ #define CHECKSUM_NONE 0 #define CHECKSUM_PCBIOS 1 }; diff --git a/lib/delay.c b/lib/delay.c index e93b4d814d..887daeb611 100644 --- a/lib/delay.c +++ b/lib/delay.c @@ -1,7 +1,8 @@ /* * This file is part of the LinuxBIOS project. * - * Copyright (C) FIXME GET HISTORY + * Copyright (C) 2001 Linux Networx + * Written by Eric Biederman * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -18,6 +19,7 @@ */ #include + void mdelay(unsigned msecs) { unsigned i; diff --git a/lib/elfboot.c b/lib/elfboot.c index 4bd09875a9..60e58b37d9 100644 --- a/lib/elfboot.c +++ b/lib/elfboot.c @@ -51,8 +51,8 @@ static int valid_area(struct lb_memory *mem, * have a match. */ for(i = 0; i < mem_entries; i++) { - uint64_t mstart, mend; - uint32_t mtype; + u64 mstart, mend; + u32 mtype; mtype = mem->map[i].type; mstart = unpack_lb64(mem->map[i].start); mend = mstart + unpack_lb64(mem->map[i].size); @@ -65,8 +65,8 @@ static int valid_area(struct lb_memory *mem, printk(BIOS_ERR, " [0x%016lx, 0x%016lx)\n", start, end); printk(BIOS_ERR, "Ram areas\n"); for(i = 0; i < mem_entries; i++) { - uint64_t mstart, mend; - uint32_t mtype; + u64 mstart, mend; + u32 mtype; mtype = mem->map[i].type; mstart = unpack_lb64(mem->map[i].start); mend = mstart + unpack_lb64(mem->map[i].size); diff --git a/lib/nrv2b.c b/lib/nrv2b.c index c91eda5047..a094ad4b60 100644 --- a/lib/nrv2b.c +++ b/lib/nrv2b.c @@ -17,7 +17,7 @@ (bb*=2,bb&0xffff ? (bb>>16)&1 : (ilen+=2,((bb=(src[ilen-2]+src[ilen-1]*256u)*2+1)>>16)&1)) #define GETBIT_LE32(bb, src, ilen) \ (bc > 0 ? ((bb>>--bc)&1) : (bc=31,\ - bb=*(const uint32_t *)((src)+ilen),ilen+=4,(bb>>31)&1)) + bb=*(const u32 *)((src)+ilen),ilen+=4,(bb>>31)&1)) #if ENDIAN == 0 && BITSIZE == 8 #define GETBIT(bb, src, ilen) GETBIT_8(bb, src, ilen) @@ -28,12 +28,12 @@ #if ENDIAN == 0 && BITSIZE == 32 #define GETBIT(bb, src, ilen) GETBIT_LE32(bb, src, ilen) #endif -static unsigned long unrv2b(uint8_t * src, uint8_t * dst, unsigned long *ilen_p) +static unsigned long unrv2b(u8 * src, u8 * dst, unsigned long *ilen_p) { unsigned long ilen = 0, olen = 0, last_m_off = 1; - uint32_t bb = 0; + u32 bb = 0; unsigned bc = 0; - const uint8_t *m_pos; + const u8 *m_pos; // skip length src += 4; diff --git a/northbridge/intel/i440bxemulation/i440bx.c b/northbridge/intel/i440bxemulation/i440bx.c index aa24a636c8..e0034ee71e 100644 --- a/northbridge/intel/i440bxemulation/i440bx.c +++ b/northbridge/intel/i440bxemulation/i440bx.c @@ -81,7 +81,7 @@ static void ram_resource(struct device * dev, unsigned long index, static void pci_domain_set_resources(struct device * dev) { struct device * mc_dev; - uint32_t tolmk; /* Top of low mem, Kbytes. */ + u32 tolmk; /* Top of low mem, Kbytes. */ int idx; struct northbridge_intel_i440bx_config *chip_info = dev->chip_info; tolmk = chip_info->ramsize * 1024;