The ARRAY_SIZE macro is convenient, yet mostly unused. Switch lots of

code to use it. That makes the code more readable and also less
error-prone.

Abuild tested.

Signed-off-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net>
Acked-by: Peter Stuge <peter@stuge.se>


git-svn-id: svn://svn.coreboot.org/coreboot/trunk@3624 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1
This commit is contained in:
Carl-Daniel Hailfinger 2008-10-01 12:52:52 +00:00
parent dc65196f8f
commit 2ee6779a64
166 changed files with 326 additions and 208 deletions

View File

@ -44,7 +44,7 @@ void acpi_add_table(acpi_rsdt_t *rsdt, void *table)
{
int i;
int entries_num = sizeof(rsdt->entry)/sizeof(rsdt->entry[0]);
int entries_num = ARRAY_SIZE(rsdt->entry);
for (i=0; i<entries_num; i++) {
if(rsdt->entry[i]==0) {

View File

@ -184,7 +184,7 @@ void lb_strings(struct lb_header *header)
{ LB_TAG_ASSEMBLER, coreboot_assembler, },
};
unsigned int i;
for(i = 0; i < sizeof(strings)/sizeof(strings[0]); i++) {
for(i = 0; i < ARRAY_SIZE(strings); i++) {
struct lb_string *rec;
size_t len;
rec = (struct lb_string *)lb_new_record(header);

View File

@ -123,7 +123,7 @@ static const char *cpu_vendor_name(int vendor)
{
const char *name;
name = "<invalid cpu vendor>";
if ((vendor < (sizeof(x86_vendor_name)/sizeof(x86_vendor_name[0]))) &&
if ((vendor < (ARRAY_SIZE(x86_vendor_name))) &&
(x86_vendor_name[vendor] != 0))
{
name = x86_vendor_name[vendor];
@ -185,7 +185,7 @@ static void identify_cpu(struct device *cpu)
}
}
cpu->vendor = X86_VENDOR_UNKNOWN;
for(i = 0; i < sizeof(x86_vendors)/sizeof(x86_vendors[0]); i++) {
for(i = 0; i < ARRAY_SIZE(x86_vendors); i++) {
if (memcmp(vendor_name, x86_vendors[i].name, 12) == 0) {
cpu->vendor = x86_vendors[i].vendor;
break;

View File

@ -377,7 +377,7 @@ void x86_exception(struct eregs *info)
gdb_stub_registers[CS] = info->cs;
gdb_stub_registers[PS] = info->eflags;
signo = GDB_UNKNOWN;
if (info->vector < sizeof(exception_to_signal)/sizeof(exception_to_signal[0])) {
if (info->vector < ARRAY_SIZE(exception_to_signal)) {
signo = exception_to_signal[info->vector];
}

View File

@ -67,7 +67,7 @@ void setup_ioapic(void)
l[0] = 0x03;
l[4] = 1;
#endif /* i786 */
for (i = 0; i < sizeof(ioapicregvalues) / sizeof(ioapicregvalues[0]);
for (i = 0; i < ARRAY_SIZE(ioapicregvalues);
i++, a++) {
l[0] = (a->reg * 2) + 0x10;
l[4] = a->value_low;

View File

@ -116,7 +116,7 @@ void lb_strings(struct lb_header *header)
{ LB_TAG_ASSEMBLER, coreboot_assembler, },
};
unsigned int i;
for(i = 0; i < sizeof(strings)/sizeof(strings[0]); i++) {
for(i = 0; i < ARRAY_SIZE(strings); i++) {
struct lb_string *rec;
size_t len;
rec = (struct lb_string *)lb_new_record(header);

View File

@ -522,7 +522,7 @@ static void setup_remote_node(u8 node)
printk_debug("setup_remote_node: %02x", node);
/* copy the default resource map from node 0 */
for(i = 0; i < sizeof(pci_reg)/sizeof(pci_reg[0]); i++) {
for(i = 0; i < ARRAY_SIZE(pci_reg); i++) {
u32 value;
u16 reg;
reg = pci_reg[i];
@ -852,7 +852,7 @@ void cpuSetAMDMSR(void)
revision = mctGetLogicalCPUID(0xFF);
platform = get_platform_type();
for(i = 0; i < sizeof(fam10_msr_default)/sizeof(fam10_msr_default[0]); i++) {
for(i = 0; i < ARRAY_SIZE(fam10_msr_default); i++) {
if ((fam10_msr_default[i].revision & revision) &&
(fam10_msr_default[i].platform & platform)) {
msr = rdmsr(fam10_msr_default[i].msr);
@ -889,7 +889,7 @@ void cpuSetAMDPCI(u8 node)
AMD_SetupPSIVID_d(platform, node); /* Set PSIVID offset which is not table driven */
for(i = 0; i < sizeof(fam10_pci_default)/sizeof(fam10_pci_default[0]); i++) {
for(i = 0; i < ARRAY_SIZE(fam10_pci_default); i++) {
if ((fam10_pci_default[i].revision & revision) &&
(fam10_pci_default[i].platform & platform)) {
val = pci_read_config32(NODE_PCI(node,
@ -903,7 +903,7 @@ void cpuSetAMDPCI(u8 node)
}
}
for(i = 0; i < sizeof(fam10_htphy_default)/sizeof(fam10_htphy_default[0]); i++) {
for(i = 0; i < ARRAY_SIZE(fam10_htphy_default); i++) {
if ((fam10_htphy_default[i].revision & revision) &&
(fam10_htphy_default[i].platform & platform)) {
/* HT Phy settings either apply to both sublinks or have

View File

@ -151,7 +151,7 @@ static void pci_domain_set_resources(device_t dev)
// int i;
int idx;
#if 0
for(rambits = 0, i = 0; i < sizeof(ramregs)/sizeof(ramregs[0]); i++) {
for(rambits = 0, i = 0; i < ARRAY_SIZE(ramregs); i++) {
unsigned char reg;
reg = pci_read_config8(mc_dev, ramregs[i]);
/* these are ENDING addresses, not sizes.

View File

@ -80,7 +80,7 @@ static void pci_domain_set_resources(device_t dev)
unsigned char rambits;
int i, idx;
for(rambits = 0, i = 0; i < sizeof(ramregs)/sizeof(ramregs[0]); i++) {
for(rambits = 0, i = 0; i < ARRAY_SIZE(ramregs); i++) {
unsigned char reg;
reg = pci_read_config8(mc_dev, ramregs[i]);
/* these are ENDING addresses, not sizes.

View File

@ -281,7 +281,7 @@ static int atyfb_xl_init(struct fb_info_aty *info)
aty_st_le32(0xEC, 0x00000000, info);
aty_st_le32(0xFC, 0x00000000, info);
for (i=0; i<sizeof(lcd_tbl)/sizeof(lcd_tbl_t); i++) {
for (i=0; i<ARRAY_SIZE(lcd_tbl); i++) {
aty_st_lcd(lcd_tbl[i].lcd_reg, lcd_tbl[i].val, info);
}
@ -547,7 +547,7 @@ static void ati_ragexl_init(device_t dev)
chip_id = aty_ld_le32(CONFIG_CHIP_ID, info);
type = chip_id & CFG_CHIP_TYPE;
rev = (chip_id & CFG_CHIP_REV)>>24;
for (j = 0; j < (sizeof(aty_chips)/sizeof(*aty_chips)); j++)
for (j = 0; j < ARRAY_SIZE(aty_chips); j++)
if (type == aty_chips[j].chip_type &&
(rev & aty_chips[j].rev_mask) == aty_chips[j].rev_val) {
chipname = aty_chips[j].name;

View File

@ -26,6 +26,7 @@
#include <device/pnp_def.h>
#include <arch/romcc_io.h>
#include <arch/hlt.h>
#include <stdlib.h>
#include "pc80/serial.c"
#include "arch/i386/lib/console.c"
#include "ram/ramtest.c"
@ -67,6 +68,6 @@ static void main(unsigned long bist)
report_bist_failure(bist);
enable_smbus();
/* dump_spd_registers(&memctrl[0]); */
sdram_initialize(sizeof(memctrl) / sizeof(memctrl[0]), memctrl);
sdram_initialize(ARRAY_SIZE(memctrl), memctrl);
/* ram_check(0, 640 * 1024); */
}

View File

@ -6,6 +6,7 @@
#include <arch/romcc_io.h>
#include <cpu/x86/lapic.h>
#include <arch/cpu.h>
#include <stdlib.h>
#include "option_table.h"
#include "pc80/mc146818rtc_early.c"
#include "pc80/serial.c"
@ -171,7 +172,7 @@ static void main(unsigned long bist)
enable_smbus();
memreset_setup();
sdram_initialize(sizeof(cpu)/sizeof(cpu[0]), cpu);
sdram_initialize(ARRAY_SIZE(cpu), cpu);
#if 0
/* Check the first 1M */

View File

@ -3,6 +3,7 @@
#include <device/pci_ids.h>
#include <string.h>
#include <stdint.h>
#include <stdlib.h>
#if CONFIG_LOGICAL_CPUS==1
#include <cpu/amd/dualcore.h>
#endif
@ -62,7 +63,7 @@ void get_bus_conf(void)
get_bus_conf_done = 1;
hc_possible_num = sizeof(pci1234) / sizeof(pci1234[0]);
hc_possible_num = ARRAY_SIZE(pci1234);
get_sblk_pci1234();

View File

@ -265,7 +265,7 @@ static void setup_aruma_resource_map(void)
};
int max;
max = sizeof(register_values)/sizeof(register_values[0]);
max = ARRAY_SIZE(register_values);
setup_resource_map(register_values, max);
}

View File

@ -22,6 +22,7 @@
#include <device/pci_ids.h>
#include <string.h>
#include <stdint.h>
#include <stdlib.h>
#if CONFIG_LOGICAL_CPUS==1
#include <cpu/amd/dualcore.h>
#endif
@ -72,7 +73,7 @@ void get_bus_conf(void)
return; /* do it only once */
get_bus_conf_done = 1;
sysconf.hc_possible_num = sizeof(pci1234x) / sizeof(pci1234x[0]);
sysconf.hc_possible_num = ARRAY_SIZE(pci1234x);
for (i = 0; i < sysconf.hc_possible_num; i++) {
sysconf.pci1234[i] = pci1234x[i];
sysconf.hcdn[i] = hcdnx[i];

View File

@ -273,6 +273,6 @@ static void setup_dbm690t_resource_map(void)
};
int max;
max = sizeof(register_values) / sizeof(register_values[0]);
max = ARRAY_SIZE(register_values);
setup_resource_map(register_values, max);
}

View File

@ -9,6 +9,7 @@
#include <cpu/amd/amdk8_sysconf.h>
#include <stdlib.h>
#include "mb_sysconf.h"
// Global variables for MB layouts and these will be shared by irqtable mptable and acpi_tables
@ -90,7 +91,7 @@ void get_bus_conf(void)
m = sysconf.mb;
sysconf.hc_possible_num = sizeof(pci1234x)/sizeof(pci1234x[0]);
sysconf.hc_possible_num = ARRAY_SIZE(pci1234x);
for(i=0;i<sysconf.hc_possible_num; i++) {
sysconf.pci1234[i] = pci1234x[i];
sysconf.hcdn[i] = hcdnx[i];

View File

@ -258,7 +258,7 @@ static void setup_mb_resource_map(void)
};
int max;
max = sizeof(register_values)/sizeof(register_values[0]);
max = ARRAY_SIZE(register_values);
setup_resource_map(register_values, max);
}

View File

@ -28,6 +28,7 @@
#include <cpu/amd/amdfam10_sysconf.h>
#include <stdlib.h>
#include "mb_sysconf.h"
/* Global variables for MB layouts and these will be shared by irqtable mptable and acpi_tables */
@ -111,7 +112,7 @@ void get_bus_conf(void)
m->bus_type[i] = 0;
}
sysconf.hc_possible_num = sizeof(pci1234x)/sizeof(pci1234x[0]);
sysconf.hc_possible_num = ARRAY_SIZE(pci1234x);
for(i=0;i<sysconf.hc_possible_num; i++) {
sysconf.pci1234[i] = pci1234x[i];
sysconf.hcdn[i] = hcdnx[i];

View File

@ -275,7 +275,7 @@ static void setup_mb_resource_map(void)
};
int max;
max = sizeof(register_values)/sizeof(register_values[0]);
max = ARRAY_SIZE(register_values);
setup_resource_map(register_values, max);
}

View File

@ -6,6 +6,7 @@
#include <arch/romcc_io.h>
#include <cpu/x86/lapic.h>
#include <arch/cpu.h>
#include <stdlib.h>
#include "option_table.h"
#include "pc80/mc146818rtc_early.c"
#include "pc80/serial.c"
@ -157,11 +158,11 @@ static void main(unsigned long bist)
#endif
enable_smbus();
#if 0
dump_spd_registers(sizeof(cpu)/sizeof(cpu[0]), cpu);
dump_spd_registers(ARRAY_SIZE(cpu), cpu);
#endif
memreset_setup();
sdram_initialize(sizeof(cpu)/sizeof(cpu[0]), cpu);
sdram_initialize(ARRAY_SIZE(cpu), cpu);
#if 0
dump_pci_devices();

View File

@ -7,6 +7,7 @@
#include <device/pnp_def.h>
#include <arch/romcc_io.h>
#include <cpu/x86/lapic.h>
#include <stdlib.h>
#include "option_table.h"
#include "pc80/mc146818rtc_early.c"
#include "pc80/serial.c"
@ -215,7 +216,7 @@ void real_main(unsigned long bist, unsigned long cpu_init_detectedx)
enable_smbus();
memreset_setup();
sdram_initialize(sizeof(cpu)/sizeof(cpu[0]), cpu);
sdram_initialize(ARRAY_SIZE(cpu), cpu);
post_cache_as_ram();

View File

@ -26,6 +26,7 @@
#include <device/pnp_def.h>
#include <arch/romcc_io.h>
#include <arch/hlt.h>
#include <stdlib.h>
#include "pc80/serial.c"
#include "arch/i386/lib/console.c"
#include "ram/ramtest.c"
@ -51,7 +52,7 @@ static int spd_read_byte(unsigned device, unsigned address)
int i;
if (device == DIMM0){
for (i=0; i < (sizeof spd_table/sizeof spd_table[0]); i++){
for (i=0; i < (ARRAY_SIZE(spd_table)); i++){
if (spd_table[i].address == address){
return spd_table[i].data;
}

View File

@ -31,6 +31,7 @@
#include <cpu/amd/dualcore.h>
#endif
#include <cpu/amd/amdk8_sysconf.h>
#include <stdlib.h>
/*
* Global variables for MB layouts and these will be shared by irqtable,

View File

@ -26,6 +26,7 @@
#include <device/pnp_def.h>
#include <arch/romcc_io.h>
#include <arch/hlt.h>
#include <stdlib.h>
#include "pc80/serial.c"
#include "arch/i386/lib/console.c"
#include "ram/ramtest.c"
@ -77,7 +78,7 @@ static void main(unsigned long bist)
/* dump_spd_registers(&memctrl[0]); */
/* sdram_initialize() runs out of registers. */
/* sdram_initialize(sizeof(memctrl) / sizeof(memctrl[0]), memctrl); */
/* sdram_initialize(ARRAY_SIZE(memctrl), memctrl); */
sdram_set_registers(memctrl);
sdram_set_spd_registers(memctrl);

View File

@ -26,6 +26,7 @@
#include <device/pnp_def.h>
#include <arch/romcc_io.h>
#include <arch/hlt.h>
#include <stdlib.h>
#include "pc80/serial.c"
#include "arch/i386/lib/console.c"
#include "ram/ramtest.c"
@ -70,6 +71,6 @@ static void main(unsigned long bist)
report_bist_failure(bist);
enable_smbus();
/* dump_spd_registers(&memctrl[0]); */
sdram_initialize(sizeof(memctrl) / sizeof(memctrl[0]), memctrl);
sdram_initialize(ARRAY_SIZE(memctrl), memctrl);
/* ram_check(0, 640 * 1024); */
}

View File

@ -26,6 +26,7 @@
#include <device/pnp_def.h>
#include <arch/romcc_io.h>
#include <arch/hlt.h>
#include <stdlib.h>
#include "pc80/serial.c"
#include "arch/i386/lib/console.c"
#include "ram/ramtest.c"
@ -67,6 +68,6 @@ static void main(unsigned long bist)
report_bist_failure(bist);
enable_smbus();
/* dump_spd_registers(&memctrl[0]); */
sdram_initialize(sizeof(memctrl) / sizeof(memctrl[0]), memctrl);
sdram_initialize(ARRAY_SIZE(memctrl), memctrl);
/* ram_check(0, 640 * 1024); */
}

View File

@ -26,6 +26,7 @@
#include <device/pnp_def.h>
#include <arch/romcc_io.h>
#include <arch/hlt.h>
#include <stdlib.h>
#include "pc80/serial.c"
#include "arch/i386/lib/console.c"
#include "ram/ramtest.c"
@ -70,6 +71,6 @@ static void main(unsigned long bist)
report_bist_failure(bist);
enable_smbus();
/* dump_spd_registers(&memctrl[0]); */
sdram_initialize(sizeof(memctrl) / sizeof(memctrl[0]), memctrl);
sdram_initialize(ARRAY_SIZE(memctrl), memctrl);
/* ram_check(0, 640 * 1024); */
}

View File

@ -26,6 +26,7 @@
#include <device/pnp_def.h>
#include <arch/romcc_io.h>
#include <arch/hlt.h>
#include <stdlib.h>
#include "pc80/serial.c"
#include "arch/i386/lib/console.c"
#include "ram/ramtest.c"
@ -70,6 +71,6 @@ static void main(unsigned long bist)
report_bist_failure(bist);
enable_smbus();
/* dump_spd_registers(&memctrl[0]); */
sdram_initialize(sizeof(memctrl) / sizeof(memctrl[0]), memctrl);
sdram_initialize(ARRAY_SIZE(memctrl), memctrl);
/* ram_check(0, 640 * 1024); */
}

View File

@ -26,6 +26,7 @@
#include <device/pnp_def.h>
#include <arch/romcc_io.h>
#include <arch/hlt.h>
#include <stdlib.h>
#include "pc80/serial.c"
#include "arch/i386/lib/console.c"
#include "ram/ramtest.c"
@ -67,6 +68,6 @@ static void main(unsigned long bist)
report_bist_failure(bist);
enable_smbus();
/* dump_spd_registers(&memctrl[0]); */
sdram_initialize(sizeof(memctrl) / sizeof(memctrl[0]), memctrl);
sdram_initialize(ARRAY_SIZE(memctrl), memctrl);
/* ram_check(0, 640 * 1024); */
}

View File

@ -8,6 +8,7 @@
#endif
#include <cpu/amd/amdk8_sysconf.h>
#include <stdlib.h>
// Global variables for MB layouts and these will be shared by irqtable mptable and acpi_tables
@ -61,7 +62,7 @@ void get_bus_conf(void)
get_bus_conf_done = 1;
sysconf.hc_possible_num = sizeof(pci1234x)/sizeof(pci1234x[0]);
sysconf.hc_possible_num = ARRAY_SIZE(pci1234x);
for(i=0;i<sysconf.hc_possible_num; i++) {
sysconf.pci1234[i] = pci1234x[i];
sysconf.hcdn[i] = hcdnx[i];

View File

@ -259,7 +259,7 @@ static void setup_blast_resource_map(void)
};
int max;
max = sizeof(register_values)/sizeof(register_values[0]);
max = ARRAY_SIZE(register_values);
setup_resource_map(register_values, max);
}

View File

@ -26,6 +26,7 @@
#include <device/pnp_def.h>
#include <arch/romcc_io.h>
#include <arch/hlt.h>
#include <stdlib.h>
#include "pc80/serial.c"
#include "arch/i386/lib/console.c"
#include "ram/ramtest.c"
@ -70,6 +71,6 @@ static void main(unsigned long bist)
report_bist_failure(bist);
enable_smbus();
/* dump_spd_registers(&memctrl[0]); */
sdram_initialize(sizeof(memctrl) / sizeof(memctrl[0]), memctrl);
sdram_initialize(ARRAY_SIZE(memctrl), memctrl);
/* ram_check(0, 640 * 1024); */
}

View File

@ -5,6 +5,7 @@
#include <device/pnp_def.h>
#include <arch/romcc_io.h>
#include <cpu/x86/lapic.h>
#include <stdlib.h>
#include "option_table.h"
#include "pc80/mc146818rtc_early.c"
#include "pc80/serial.c"
@ -139,7 +140,7 @@ static void main(unsigned long bist)
// dump_ipmi_registers();
mainboard_set_e7520_leds();
// memreset_setup();
sdram_initialize(sizeof(mch)/sizeof(mch[0]), mch);
sdram_initialize(ARRAY_SIZE(mch), mch);
#if 0
dump_pci_devices();
#endif

View File

@ -10,6 +10,7 @@
#endif
#include <arch/hlt.h>
//#include "option_table.h"
#include <stdlib.h>
#include "pc80/mc146818rtc_early.c"
#include "pc80/serial.c"
#include "arch/i386/lib/console.c"
@ -100,7 +101,7 @@ static void main(unsigned long bist)
memreset_setup();
sdram_initialize(sizeof(memctrl)/sizeof(memctrl[0]), memctrl);
sdram_initialize(ARRAY_SIZE(memctrl), memctrl);
}
#if 0

View File

@ -6,6 +6,7 @@
#include <device/pnp_def.h>
#include <arch/romcc_io.h>
#include <arch/hlt.h>
#include <stdlib.h>
#include "pc80/serial.c"
#include "arch/i386/lib/console.c"
#include "ram/ramtest.c"
@ -48,7 +49,7 @@ static void main(unsigned long bist)
#endif
};
int i;
for(i = 0; i < sizeof(check_addrs)/sizeof(check_addrs[0]); i++) {
for(i = 0; i < ARRAY_SIZE(check_addrs); i++) {
ram_check(check_addrs[i].lo, check_addrs[i].hi);
}
#endif

View File

@ -26,6 +26,7 @@
#include <device/pnp_def.h>
#include <arch/romcc_io.h>
#include <arch/hlt.h>
#include <stdlib.h>
#include "pc80/serial.c"
#include "arch/i386/lib/console.c"
#include "ram/ramtest.c"
@ -67,6 +68,6 @@ static void main(unsigned long bist)
report_bist_failure(bist);
enable_smbus();
/* dump_spd_registers(&memctrl[0]); */
sdram_initialize(sizeof(memctrl) / sizeof(memctrl[0]), memctrl);
sdram_initialize(ARRAY_SIZE(memctrl), memctrl);
/* ram_check(0, 640 * 1024); */
}

View File

@ -31,6 +31,7 @@
#endif
#include <cpu/amd/amdk8_sysconf.h>
#include <stdlib.h>
// Global variables for MB layouts and these will be shared by irqtable mptable and acpi_tables
@ -82,7 +83,7 @@ void get_bus_conf(void)
get_bus_conf_done = 1;
sysconf.hc_possible_num = sizeof(pci1234x)/sizeof(pci1234x[0]);
sysconf.hc_possible_num = ARRAY_SIZE(pci1234x);
for(i=0;i<sysconf.hc_possible_num; i++) {
sysconf.pci1234[i] = pci1234x[i];
sysconf.hcdn[i] = hcdnx[i];

View File

@ -277,7 +277,7 @@ static void setup_mb_resource_map(void)
};
int max;
max = sizeof(register_values)/sizeof(register_values[0]);
max = ARRAY_SIZE(register_values);
setup_resource_map(register_values, max);
}

View File

@ -1,4 +1,5 @@
#include <arch/io.h>
#include <stdlib.h>
static void write_index(uint16_t port_base, uint8_t reg, uint8_t value)
{
@ -67,15 +68,13 @@ static const struct {
{ 0x13, 0x77}
};
#define ARRAYSIZE(x) sizeof x/sizeof *x
/*
* Called from superio.c
*/
void init_ec(uint16_t base)
{
int i;
for (i=0; i<ARRAYSIZE(sequence); i++) {
for (i=0; i<ARRAY_SIZE(sequence); i++) {
write_index(base, sequence[i].index, sequence[i].value);
}
}

View File

@ -29,6 +29,7 @@
#endif
#include <cpu/amd/amdk8_sysconf.h>
#include <stdlib.h>
// Global variables for MB layouts and these will be shared by irqtable mptable and acpi_tables
@ -80,7 +81,7 @@ void get_bus_conf(void)
get_bus_conf_done = 1;
sysconf.hc_possible_num = sizeof(pci1234x)/sizeof(pci1234x[0]);
sysconf.hc_possible_num = ARRAY_SIZE(pci1234x);
for(i=0;i<sysconf.hc_possible_num; i++) {
sysconf.pci1234[i] = pci1234x[i];
sysconf.hcdn[i] = hcdnx[i];

View File

@ -277,7 +277,7 @@ static void setup_mb_resource_map(void)
};
int max;
max = sizeof(register_values)/sizeof(register_values[0]);
max = ARRAY_SIZE(register_values);
setup_resource_map(register_values, max);
}

View File

@ -8,6 +8,7 @@
#include <arch/romcc_io.h>
#include <cpu/x86/lapic.h>
#include <arch/cpu.h>
#include <stdlib.h>
#include "option_table.h"
#include "pc80/mc146818rtc_early.c"
#include "pc80/serial.c"
@ -163,7 +164,7 @@ static void main(unsigned long bist)
#endif
memreset_setup();
sdram_initialize(sizeof(cpu)/sizeof(cpu[0]), cpu);
sdram_initialize(ARRAY_SIZE(cpu), cpu);
#if 0
dump_pci_devices();

View File

@ -7,6 +7,7 @@
#include <device/pnp_def.h>
#include <arch/romcc_io.h>
#include <cpu/x86/lapic.h>
#include <stdlib.h>
#include "option_table.h"
#include "pc80/mc146818rtc_early.c"
#include "pc80/serial.c"
@ -211,7 +212,7 @@ void real_main(unsigned long bist, unsigned long cpu_init_detectedx)
enable_smbus();
memreset_setup();
sdram_initialize(sizeof(cpu)/sizeof(cpu[0]), cpu);
sdram_initialize(ARRAY_SIZE(cpu), cpu);
post_cache_as_ram();

View File

@ -266,6 +266,6 @@ static void setup_ibm_e325_resource_map(void)
PCI_ADDR(0, 0x18, 1, 0xec), 0x0000FC88, 0,
};
int max;
max = sizeof(register_values)/sizeof(register_values[0]);
max = ARRAY_SIZE(register_values);
setup_resource_map(register_values, max);
}

View File

@ -8,6 +8,7 @@
#include <arch/romcc_io.h>
#include <cpu/x86/lapic.h>
#include <arch/cpu.h>
#include <stdlib.h>
#include "option_table.h"
#include "pc80/mc146818rtc_early.c"
#include "pc80/serial.c"
@ -163,7 +164,7 @@ static void main(unsigned long bist)
#endif
memreset_setup();
sdram_initialize(sizeof(cpu)/sizeof(cpu[0]), cpu);
sdram_initialize(ARRAY_SIZE(cpu), cpu);
#if 0
dump_pci_devices();

View File

@ -7,6 +7,7 @@
#include <device/pnp_def.h>
#include <arch/romcc_io.h>
#include <cpu/x86/lapic.h>
#include <stdlib.h>
#include "option_table.h"
#include "pc80/mc146818rtc_early.c"
#include "pc80/serial.c"
@ -211,7 +212,7 @@ void real_main(unsigned long bist, unsigned long cpu_init_detectedx)
enable_smbus();
memreset_setup();
sdram_initialize(sizeof(cpu)/sizeof(cpu[0]), cpu);
sdram_initialize(ARRAY_SIZE(cpu), cpu);
post_cache_as_ram();

View File

@ -266,6 +266,6 @@ static void setup_ibm_e326_resource_map(void)
PCI_ADDR(0, 0x18, 1, 0xec), 0x0000FC88, 0,
};
int max;
max = sizeof(register_values)/sizeof(register_values[0]);
max = ARRAY_SIZE(register_values);
setup_resource_map(register_values, max);
}

View File

@ -5,6 +5,7 @@
#include <device/pnp_def.h>
#include <arch/romcc_io.h>
#include <cpu/x86/lapic.h>
#include <stdlib.h>
#include "option_table.h"
#include "pc80/mc146818rtc_early.c"
#include "pc80/serial.c"
@ -120,7 +121,7 @@ static void main(unsigned long bist)
power_down_reset_check();
// dump_ipmi_registers();
mainboard_set_e7520_leds();
sdram_initialize(sizeof(mch)/sizeof(mch[0]), mch);
sdram_initialize(ARRAY_SIZE(mch), mch);
ich5_watchdog_on();
#if 0
dump_pci_devices();

View File

@ -7,6 +7,7 @@
#include <arch/romcc_io.h>
#include <cpu/x86/lapic.h>
#include <arch/cpu.h>
#include <stdlib.h>
#include "option_table.h"
#include "pc80/mc146818rtc_early.c"
#include "pc80/serial.c"
@ -83,7 +84,7 @@ static void main(unsigned long bist)
// dump_smbus_registers();
// memreset_setup(); No-op for this chipset
sdram_initialize(sizeof(memctrl)/sizeof(memctrl[0]), memctrl);
sdram_initialize(ARRAY_SIZE(memctrl), memctrl);
}
// NOTE: ROMCC dies with an internal compiler error

View File

@ -9,6 +9,7 @@
#include <cpu/amd/amdk8_sysconf.h>
#include <stdlib.h>
#include "mb_sysconf.h"
// Global variables for MB layouts and these will be shared by irqtable mptable and acpi_tables
@ -90,7 +91,7 @@ void get_bus_conf(void)
m = sysconf.mb;
sysconf.hc_possible_num = sizeof(pci1234x)/sizeof(pci1234x[0]);
sysconf.hc_possible_num = ARRAY_SIZE(pci1234x);
for(i=0;i<sysconf.hc_possible_num; i++) {
sysconf.pci1234[i] = pci1234x[i];
sysconf.hcdn[i] = hcdnx[i];

View File

@ -258,7 +258,7 @@ static void setup_mb_resource_map(void)
};
int max;
max = sizeof(register_values)/sizeof(register_values[0]);
max = ARRAY_SIZE(register_values);
setup_resource_map(register_values, max);
}

View File

@ -6,6 +6,7 @@
#include <arch/romcc_io.h>
#include <cpu/x86/lapic.h>
#include <arch/cpu.h>
#include <stdlib.h>
#include "option_table.h"
#include "pc80/mc146818rtc_early.c"
#include "pc80/serial.c"
@ -149,7 +150,7 @@ static void main(unsigned long bist)
#endif
memreset_setup();
sdram_initialize(sizeof(cpu)/sizeof(cpu[0]), cpu);
sdram_initialize(ARRAY_SIZE(cpu), cpu);
#if 0
dump_pci_devices();

View File

@ -6,6 +6,7 @@
#include <arch/romcc_io.h>
#include <cpu/x86/lapic.h>
#include <arch/cpu.h>
#include <stdlib.h>
#include "option_table.h"
#include "pc80/mc146818rtc_early.c"
#include "pc80/serial.c"
@ -148,7 +149,7 @@ static void main(unsigned long bist)
#endif
memreset_setup();
sdram_initialize(sizeof(cpu)/sizeof(cpu[0]), cpu);
sdram_initialize(ARRAY_SIZE(cpu), cpu);
#if 1
dump_pci_devices();
@ -181,7 +182,7 @@ static void main(unsigned long bist)
#endif
};
int i;
for(i = 0; i < sizeof(check_addrs)/sizeof(check_addrs[0]); i++) {
for(i = 0; i < ARRAY_SIZE(check_addrs); i++) {
ram_check(check_addrs[i].lo, check_addrs[i].hi);
}
#endif

View File

@ -26,6 +26,7 @@
#include <device/pnp_def.h>
#include <arch/romcc_io.h>
#include <arch/hlt.h>
#include <stdlib.h>
#include "pc80/serial.c"
#include "arch/i386/lib/console.c"
#include "ram/ramtest.c"
@ -65,6 +66,6 @@ static void main(unsigned long bist)
console_init();
report_bist_failure(bist);
/* dump_spd_registers(&memctrl[0]); */
sdram_initialize(sizeof(memctrl) / sizeof(memctrl[0]), memctrl);
sdram_initialize(ARRAY_SIZE(memctrl), memctrl);
/* ram_check(0, 640 * 1024); */
}

View File

@ -32,6 +32,7 @@
#endif
#include <cpu/amd/amdk8_sysconf.h>
#include <stdlib.h>
/* Global variables for MB layouts and these will be shared by irqtable,
* mptable and acpi_tables.
@ -67,8 +68,8 @@ void get_bus_conf(void)
get_bus_conf_done = 1;
sysconf.hc_possible_num = sizeof(pci1234x) / sizeof(pci1234x[0]);
sysconf.hc_possible_num = sizeof(pci1234x) / sizeof(pci1234x[0]);
sysconf.hc_possible_num = ARRAY_SIZE(pci1234x);
sysconf.hc_possible_num = ARRAY_SIZE(pci1234x);
for (i = 0; i < sysconf.hc_possible_num; i++) {
sysconf.pci1234[i] = pci1234x[i];
sysconf.hcdn[i] = hcdnx[i];

View File

@ -28,6 +28,7 @@
#include <cpu/amd/dualcore.h>
#endif
#include <cpu/amd/amdk8_sysconf.h>
#include <stdlib.h>
/* Global variables for MB layouts (shared by irqtable/mptable/acpi_table). */
// busnum is default.
@ -81,7 +82,7 @@ void get_bus_conf(void)
get_bus_conf_done = 1;
sysconf.hc_possible_num = sizeof(pci1234x) / sizeof(pci1234x[0]);
sysconf.hc_possible_num = ARRAY_SIZE(pci1234x);
for (i = 0; i < sysconf.hc_possible_num; i++) {
sysconf.pci1234[i] = pci1234x[i];
sysconf.hcdn[i] = hcdnx[i];

View File

@ -278,6 +278,6 @@ static void setup_mb_resource_map(void)
};
int max = sizeof(register_values) / sizeof(register_values[0]);
int max = ARRAY_SIZE(register_values);
setup_resource_map(register_values, max);
}

View File

@ -32,6 +32,7 @@
#include <cpu/amd/amdk8_sysconf.h>
#include <stdlib.h>
#include "mb_sysconf.h"
// Global variables for MB layouts and these will be shared by irqtable mptable and acpi_tables
@ -82,7 +83,7 @@ void get_bus_conf(void)
m = sysconf.mb;
sysconf.hc_possible_num = sizeof(pci1234x)/sizeof(pci1234x[0]);
sysconf.hc_possible_num = ARRAY_SIZE(pci1234x);
for(i=0;i<sysconf.hc_possible_num; i++) {
sysconf.pci1234[i] = pci1234x[i];

View File

@ -285,7 +285,7 @@ static void setup_ms9185_resource_map(void)
};
int max;
max = sizeof(register_values)/sizeof(register_values[0]);
max = ARRAY_SIZE(register_values);
setup_resource_map(register_values, max);
}

View File

@ -33,6 +33,7 @@
#include <cpu/amd/amdk8_sysconf.h>
#include <stdlib.h>
#include "mb_sysconf.h"
// Global variables for MB layouts and these will be shared by irqtable mptable and acpi_tables
@ -110,7 +111,7 @@ void get_bus_conf(void)
m = sysconf.mb;
memset(m, 0, sizeof(struct mb_sysconf_t));
sysconf.hc_possible_num = sizeof(pci1234x)/sizeof(pci1234x[0]);
sysconf.hc_possible_num = ARRAY_SIZE(pci1234x);
for(i=0;i<sysconf.hc_possible_num; i++) {
sysconf.pci1234[i] = pci1234x[i];
sysconf.hcdn[i] = hcdnx[i];

View File

@ -293,7 +293,7 @@ static void setup_ms9282_resource_map(void)
};
int max;
max = sizeof(register_values)/sizeof(register_values[0]);
max = ARRAY_SIZE(register_values);
setup_resource_map(register_values, max);
}

View File

@ -6,6 +6,7 @@
#include <arch/romcc_io.h>
#include <cpu/x86/lapic.h>
#include <arch/cpu.h>
#include <stdlib.h>
#include "option_table.h"
#include "pc80/mc146818rtc_early.c"
#include "pc80/serial.c"
@ -138,7 +139,7 @@ static void main(unsigned long bist)
dump_spd_registers(&cpu[0]);
#endif
memreset_setup();
sdram_initialize(sizeof(cpu)/sizeof(cpu[0]), cpu);
sdram_initialize(ARRAY_SIZE(cpu), cpu);
#if 0
dump_pci_devices();

View File

@ -265,7 +265,7 @@ static void setup_khepri_resource_map(void)
PCI_ADDR(0, 0x18, 1, 0xEC), 0x0000FC88, 0x00000000,
};
int max;
max = sizeof(register_values)/sizeof(register_values[0]);
max = ARRAY_SIZE(register_values);
setup_resource_map(register_values, max);
}

View File

@ -30,6 +30,7 @@
#include <cpu/amd/amdk8_sysconf.h>
#include <stdlib.h>
#include "mb_sysconf.h"
// Global variables for MB layouts and these will be shared by irqtable mptable and acpi_tables
@ -108,7 +109,7 @@ void get_bus_conf(void)
m = sysconf.mb;
memset(m, 0, sizeof(struct mb_sysconf_t));
sysconf.hc_possible_num = sizeof(pci1234x)/sizeof(pci1234x[0]);
sysconf.hc_possible_num = ARRAY_SIZE(pci1234x);
for (i = 0; i < sysconf.hc_possible_num; i++) {
sysconf.pci1234[i] = pci1234x[i];

View File

@ -277,7 +277,7 @@ static void setup_mb_resource_map(void)
};
int max;
max = sizeof(register_values)/sizeof(register_values[0]);
max = ARRAY_SIZE(register_values);
setup_resource_map(register_values, max);
}

View File

@ -7,6 +7,7 @@
#include <arch/romcc_io.h>
#include <cpu/x86/lapic.h>
#include <arch/cpu.h>
#include <stdlib.h>
#include "option_table.h"
#include "pc80/mc146818rtc_early.c"
#include "pc80/serial.c"
@ -191,7 +192,7 @@ static void main(unsigned long bist)
enable_smbus();
memreset_setup();
sdram_initialize(sizeof(cpu)/sizeof(cpu[0]), cpu);
sdram_initialize(ARRAY_SIZE(cpu), cpu);
}

View File

@ -6,6 +6,7 @@
#if CONFIG_LOGICAL_CPUS==1
#include <cpu/amd/dualcore.h>
#endif
#include <stdlib.h>
// Global variables for MB layouts and these will be shared by irqtable mptable and acpi_tables
@ -75,7 +76,7 @@ void get_bus_conf(void)
get_bus_conf_done = 1;
hc_possible_num = sizeof(pci1234)/sizeof(pci1234[0]);
hc_possible_num = ARRAY_SIZE(pci1234);
get_sblk_pci1234();

View File

@ -260,7 +260,7 @@ static void setup_ultra40_resource_map(void)
};
int max;
max = sizeof(register_values)/sizeof(register_values[0]);
max = ARRAY_SIZE(register_values);
setup_resource_map(register_values, max);
}

View File

@ -29,6 +29,7 @@
#endif
#include <cpu/amd/amdk8_sysconf.h>
#include <stdlib.h>
// Global variables for MB layouts and these will be shared by irqtable mptable and acpi_tables
@ -81,7 +82,7 @@ void get_bus_conf(void)
get_bus_conf_done = 1;
sysconf.hc_possible_num = sizeof(pci1234x)/sizeof(pci1234x[0]);
sysconf.hc_possible_num = ARRAY_SIZE(pci1234x);
for(i=0;i<sysconf.hc_possible_num; i++) {
sysconf.pci1234[i] = pci1234x[i];
sysconf.hcdn[i] = hcdnx[i];

View File

@ -277,7 +277,7 @@ static void setup_mb_resource_map(void)
};
int max;
max = sizeof(register_values)/sizeof(register_values[0]);
max = ARRAY_SIZE(register_values);
setup_resource_map(register_values, max);
}

View File

@ -5,6 +5,7 @@
#include <device/pnp_def.h>
#include <arch/romcc_io.h>
#include <cpu/x86/lapic.h>
#include <stdlib.h>
#include "option_table.h"
#include "pc80/mc146818rtc_early.c"
#include "pc80/serial.c"
@ -113,7 +114,7 @@ static void main(unsigned long bist)
}
#endif
disable_watchdogs();
sdram_initialize(sizeof(mch)/sizeof(mch[0]), mch);
sdram_initialize(ARRAY_SIZE(mch), mch);
#if 1
dump_pci_device(PCI_DEV(0, 0x00, 0));
// dump_bar14(PCI_DEV(0, 0x00, 0));

View File

@ -5,6 +5,7 @@
#include <device/pnp_def.h>
#include <arch/romcc_io.h>
#include <cpu/x86/lapic.h>
#include <stdlib.h>
#include "option_table.h"
#include "pc80/mc146818rtc_early.c"
#include "pc80/serial.c"
@ -138,7 +139,7 @@ static void main(unsigned long bist)
// dump_ipmi_registers();
// mainboard_set_e7520_leds();
// memreset_setup();
sdram_initialize(sizeof(mch)/sizeof(mch[0]), mch);
sdram_initialize(ARRAY_SIZE(mch), mch);
#if 0
dump_pci_devices();
#endif

View File

@ -5,6 +5,7 @@
#include <device/pnp_def.h>
#include <arch/romcc_io.h>
#include <cpu/x86/lapic.h>
#include <stdlib.h>
#include "option_table.h"
#include "pc80/mc146818rtc_early.c"
#include "pc80/serial.c"
@ -139,7 +140,7 @@ static void main(unsigned long bist)
// dump_ipmi_registers();
// mainboard_set_e7520_leds();
// memreset_setup();
sdram_initialize(sizeof(mch)/sizeof(mch[0]), mch);
sdram_initialize(ARRAY_SIZE(mch), mch);
#if 0
dump_pci_devices();
#endif

View File

@ -5,6 +5,7 @@
#include <device/pnp_def.h>
#include <arch/romcc_io.h>
#include <cpu/x86/lapic.h>
#include <stdlib.h>
#include "option_table.h"
#include "pc80/mc146818rtc_early.c"
#include "pc80/serial.c"
@ -139,7 +140,7 @@ static void main(unsigned long bist)
// dump_ipmi_registers();
// mainboard_set_e7520_leds();
// memreset_setup();
sdram_initialize(sizeof(mch)/sizeof(mch[0]), mch);
sdram_initialize(ARRAY_SIZE(mch), mch);
#if 0
dump_pci_devices();
#endif

View File

@ -5,6 +5,7 @@
#include <device/pnp_def.h>
#include <arch/romcc_io.h>
#include <cpu/x86/lapic.h>
#include <stdlib.h>
#include "option_table.h"
#include "pc80/mc146818rtc_early.c"
#include "pc80/serial.c"
@ -139,7 +140,7 @@ static void main(unsigned long bist)
// dump_ipmi_registers();
mainboard_set_e7520_leds();
// memreset_setup();
sdram_initialize(sizeof(mch)/sizeof(mch[0]), mch);
sdram_initialize(ARRAY_SIZE(mch), mch);
#if 1
dump_pci_devices();
#endif

View File

@ -5,6 +5,7 @@
#include <device/pnp_def.h>
#include <arch/romcc_io.h>
#include <cpu/x86/lapic.h>
#include <stdlib.h>
#include "option_table.h"
#include "pc80/mc146818rtc_early.c"
#include "pc80/serial.c"
@ -139,7 +140,7 @@ static void main(unsigned long bist)
// dump_ipmi_registers();
mainboard_set_e7520_leds();
// memreset_setup();
sdram_initialize(sizeof(mch)/sizeof(mch[0]), mch);
sdram_initialize(ARRAY_SIZE(mch), mch);
#if 0
dump_pci_devices();
#endif

View File

@ -26,6 +26,7 @@
#include <device/pnp_def.h>
#include <arch/romcc_io.h>
#include <arch/hlt.h>
#include <stdlib.h>
#include "pc80/serial.c"
#include "arch/i386/lib/console.c"
#include "ram/ramtest.c"
@ -67,6 +68,6 @@ static void main(unsigned long bist)
report_bist_failure(bist);
enable_smbus();
/* dump_spd_registers(&memctrl[0]); */
sdram_initialize(sizeof(memctrl) / sizeof(memctrl[0]), memctrl);
sdram_initialize(ARRAY_SIZE(memctrl), memctrl);
/* ram_check(0, 640 * 1024); */
}

View File

@ -7,6 +7,7 @@
#include <arch/romcc_io.h>
#include <cpu/x86/lapic.h>
#include <arch/cpu.h>
#include <stdlib.h>
#include "option_table.h"
#include "pc80/mc146818rtc_early.c"
#include "pc80/serial.c"
@ -96,7 +97,7 @@ static void main(unsigned long bist)
#endif
memreset_setup();
sdram_initialize(sizeof(memctrl)/sizeof(memctrl[0]), memctrl);
sdram_initialize(ARRAY_SIZE(memctrl), memctrl);
}
#if 0
else {

View File

@ -6,6 +6,7 @@
#include <arch/romcc_io.h>
#include <cpu/x86/lapic.h>
#include <arch/cpu.h>
#include <stdlib.h>
#include "option_table.h"
#include "pc80/mc146818rtc_early.c"
#include "pc80/serial.c"
@ -197,6 +198,6 @@ static void main(unsigned long bist)
enable_smbus();
memreset_setup();
sdram_initialize(sizeof(cpu) / sizeof(cpu[0]), cpu);
sdram_initialize(ARRAY_SIZE(cpu), cpu);
}

View File

@ -7,6 +7,7 @@
#include <device/pnp_def.h>
#include <arch/romcc_io.h>
#include <cpu/x86/lapic.h>
#include <stdlib.h>
#include "option_table.h"
#include "pc80/mc146818rtc_early.c"
#include "pc80/serial.c"
@ -206,7 +207,7 @@ void real_main(unsigned long bist, unsigned long cpu_init_detectedx)
enable_smbus();
memreset_setup();
sdram_initialize(sizeof(cpu)/sizeof(cpu[0]), cpu);
sdram_initialize(ARRAY_SIZE(cpu), cpu);
post_cache_as_ram();
}

View File

@ -7,6 +7,7 @@
#include <arch/romcc_io.h>
#include <cpu/x86/lapic.h>
#include <arch/cpu.h>
#include <stdlib.h>
#include "option_table.h"
#include "pc80/mc146818rtc_early.c"
#include "pc80/serial.c"
@ -167,6 +168,6 @@ static void main(unsigned long bist)
enable_smbus();
memreset_setup();
sdram_initialize(sizeof(cpu)/sizeof(cpu[0]), cpu);
sdram_initialize(ARRAY_SIZE(cpu), cpu);
}

View File

@ -7,6 +7,7 @@
#include <device/pnp_def.h>
#include <arch/romcc_io.h>
#include <cpu/x86/lapic.h>
#include <stdlib.h>
#include "option_table.h"
#include "pc80/mc146818rtc_early.c"
#include "pc80/serial.c"
@ -203,7 +204,7 @@ void real_main(unsigned long bist, unsigned long cpu_init_detectedx)
enable_smbus();
memreset_setup();
sdram_initialize(sizeof(cpu)/sizeof(cpu[0]), cpu);
sdram_initialize(ARRAY_SIZE(cpu), cpu);
post_cache_as_ram();

View File

@ -7,6 +7,7 @@
#include <device/pnp_def.h>
#include <arch/romcc_io.h>
#include <cpu/x86/lapic.h>
#include <stdlib.h>
#include "option_table.h"
#include "pc80/mc146818rtc_early.c"
#include "pc80/serial.c"
@ -205,7 +206,7 @@ void real_main(unsigned long bist, unsigned long cpu_init_detectedx)
enable_smbus();
memreset_setup();
sdram_initialize(sizeof(cpu)/sizeof(cpu[0]), cpu);
sdram_initialize(ARRAY_SIZE(cpu), cpu);
post_cache_as_ram();
}

View File

@ -7,6 +7,7 @@
#include <arch/romcc_io.h>
#include <cpu/x86/lapic.h>
#include <arch/cpu.h>
#include <stdlib.h>
#include "option_table.h"
#include "pc80/mc146818rtc_early.c"
#include "pc80/serial.c"
@ -172,6 +173,6 @@ static void main(unsigned long bist)
enable_smbus();
memreset_setup();
sdram_initialize(sizeof(cpu)/sizeof(cpu[0]), cpu);
sdram_initialize(ARRAY_SIZE(cpu), cpu);
}

View File

@ -8,6 +8,7 @@
#endif
#include <cpu/amd/amdk8_sysconf.h>
#include <stdlib.h>
// Global variables for MB layouts and these will be shared by irqtable mptable and acpi_tables
@ -63,7 +64,7 @@ void get_bus_conf(void)
get_bus_conf_done = 1;
sysconf.hc_possible_num = sizeof(pci1234x)/sizeof(pci1234x[0]);
sysconf.hc_possible_num = ARRAY_SIZE(pci1234x);
for(i=0;i<sysconf.hc_possible_num; i++) {
sysconf.pci1234[i] = pci1234x[i];
sysconf.hcdn[i] = hcdnx[i];

View File

@ -258,7 +258,7 @@ static void setup_s2881_resource_map(void)
PCI_ADDR(0, 0x18, 1, 0xEC), 0x0000FC88, 0x00000000,
};
int max;
max = sizeof(register_values)/sizeof(register_values[0]);
max = ARRAY_SIZE(register_values);
setup_resource_map(register_values, max);
}

View File

@ -7,6 +7,7 @@
#include <arch/romcc_io.h>
#include <cpu/x86/lapic.h>
#include <arch/cpu.h>
#include <stdlib.h>
#include "option_table.h"
#include "pc80/mc146818rtc_early.c"
#include "pc80/serial.c"
@ -176,6 +177,6 @@ static void main(unsigned long bist)
enable_smbus();
memreset_setup();
sdram_initialize(sizeof(cpu)/sizeof(cpu[0]), cpu);
sdram_initialize(ARRAY_SIZE(cpu), cpu);
}

View File

@ -7,6 +7,7 @@
#include <device/pnp_def.h>
#include <arch/romcc_io.h>
#include <cpu/x86/lapic.h>
#include <stdlib.h>
#include "option_table.h"
#include "pc80/mc146818rtc_early.c"
#include "pc80/serial.c"
@ -208,7 +209,7 @@ void real_main(unsigned long bist, unsigned long cpu_init_detectedx)
enable_smbus();
memreset_setup();
sdram_initialize(sizeof(cpu)/sizeof(cpu[0]), cpu);
sdram_initialize(ARRAY_SIZE(cpu), cpu);
post_cache_as_ram();

View File

@ -6,6 +6,7 @@
#include <device/pnp_def.h>
#include <arch/romcc_io.h>
#include <cpu/x86/lapic.h>
#include <stdlib.h>
#include "option_table.h"
#include "pc80/mc146818rtc_early.c"
#include "pc80/serial.c"
@ -178,7 +179,7 @@ static void main(unsigned long bist)
enable_smbus();
memreset_setup();
sdram_initialize(sizeof(cpu)/sizeof(cpu[0]), cpu);
sdram_initialize(ARRAY_SIZE(cpu), cpu);

View File

@ -8,6 +8,7 @@
#endif
#include <cpu/amd/amdk8_sysconf.h>
#include <stdlib.h>
// Global variables for MB layouts and these will be shared by irqtable mptable and acpi_tables
//busnum is default
@ -65,7 +66,7 @@ void get_bus_conf(void)
get_bus_conf_done = 1;
sysconf.hc_possible_num = sizeof(pci1234x)/sizeof(pci1234x[0]);
sysconf.hc_possible_num = ARRAY_SIZE(pci1234x);
for(i=0;i<sysconf.hc_possible_num; i++) {
sysconf.pci1234[i] = pci1234x[i];
sysconf.hcdn[i] = hcdnx[i];

View File

@ -259,7 +259,7 @@ static void setup_s2885_resource_map(void)
};
int max;
max = sizeof(register_values)/sizeof(register_values[0]);
max = ARRAY_SIZE(register_values);
setup_resource_map(register_values, max);
}

View File

@ -6,6 +6,7 @@
#include <device/pnp_def.h>
#include <arch/romcc_io.h>
#include <cpu/x86/lapic.h>
#include <stdlib.h>
#include "option_table.h"
#include "pc80/mc146818rtc_early.c"
#include "pc80/serial.c"
@ -145,6 +146,6 @@ static void main(unsigned long bist)
enable_smbus();
memreset_setup();
sdram_initialize(sizeof(cpu)/sizeof(cpu[0]), cpu);
sdram_initialize(ARRAY_SIZE(cpu), cpu);
}

View File

@ -8,6 +8,7 @@
#endif
#include <cpu/amd/amdk8_sysconf.h>
#include <stdlib.h>
// Global variables for MB layouts and these will be shared by irqtable mptable and acpi_tables
//busnum is default
@ -71,7 +72,7 @@ void get_bus_conf(void)
get_bus_conf_done = 1;
sysconf.hc_possible_num = sizeof(pci1234x)/sizeof(pci1234x[0]);
sysconf.hc_possible_num = ARRAY_SIZE(pci1234x);
for(i=0;i<sysconf.hc_possible_num; i++) {
sysconf.pci1234[i] = pci1234x[i];
sysconf.hcdn[i] = hcdnx[i];

View File

@ -260,7 +260,7 @@ static void setup_s2891_resource_map(void)
};
int max;
max = sizeof(register_values)/sizeof(register_values[0]);
max = ARRAY_SIZE(register_values);
setup_resource_map(register_values, max);
}

View File

@ -6,6 +6,7 @@
#include <device/pnp_def.h>
#include <arch/romcc_io.h>
#include <cpu/x86/lapic.h>
#include <stdlib.h>
#include "option_table.h"
#include "pc80/mc146818rtc_early.c"
#include "pc80/serial.c"
@ -147,6 +148,6 @@ static void main(unsigned long bist)
enable_smbus();
memreset_setup();
sdram_initialize(sizeof(cpu)/sizeof(cpu[0]), cpu);
sdram_initialize(ARRAY_SIZE(cpu), cpu);
}

View File

@ -8,6 +8,7 @@
#endif
#include <cpu/amd/amdk8_sysconf.h>
#include <stdlib.h>
// Global variables for MB layouts and these will be shared by irqtable mptable and acpi_tables
//busnum is default
@ -68,7 +69,7 @@ void get_bus_conf(void)
get_bus_conf_done = 1;
sysconf.hc_possible_num = sizeof(pci1234x)/sizeof(pci1234x[0]);
sysconf.hc_possible_num = ARRAY_SIZE(pci1234x);
for(i=0;i<sysconf.hc_possible_num; i++) {
sysconf.pci1234[i] = pci1234x[i];
sysconf.hcdn[i] = hcdnx[i];

View File

@ -260,7 +260,7 @@ static void setup_s2892_resource_map(void)
};
int max;
max = sizeof(register_values)/sizeof(register_values[0]);
max = ARRAY_SIZE(register_values);
setup_resource_map(register_values, max);
}

View File

@ -7,6 +7,7 @@
#include <arch/romcc_io.h>
#include <cpu/x86/lapic.h>
#include <arch/cpu.h>
#include <stdlib.h>
#include "option_table.h"
#include "pc80/mc146818rtc_early.c"
#include "pc80/serial.c"
@ -172,6 +173,6 @@ static void main(unsigned long bist)
enable_smbus();
memreset_setup();
sdram_initialize(sizeof(cpu)/sizeof(cpu[0]), cpu);
sdram_initialize(ARRAY_SIZE(cpu), cpu);
}

View File

@ -8,6 +8,7 @@
#endif
#include <cpu/amd/amdk8_sysconf.h>
#include <stdlib.h>
// Global variables for MB layouts and these will be shared by irqtable mptable and acpi_tables
//busnum is default
@ -76,7 +77,7 @@ void get_bus_conf(void)
get_bus_conf_done = 1;
sysconf.hc_possible_num = sizeof(pci1234x)/sizeof(pci1234x[0]);
sysconf.hc_possible_num = ARRAY_SIZE(pci1234x);
for(i=0;i<sysconf.hc_possible_num; i++) {
sysconf.pci1234[i] = pci1234x[i];
sysconf.hcdn[i] = hcdnx[i];

Some files were not shown because too many files have changed in this diff Show More