summaryrefslogtreecommitdiff
path: root/src/mainboard
diff options
context:
space:
mode:
Diffstat (limited to 'src/mainboard')
-rw-r--r--src/mainboard/a-trend/atc-6220/auto.c3
-rw-r--r--src/mainboard/agami/aruma/auto.c3
-rw-r--r--src/mainboard/agami/aruma/get_bus_conf.c3
-rw-r--r--src/mainboard/agami/aruma/resourcemap.c2
-rw-r--r--src/mainboard/amd/dbm690t/get_bus_conf.c3
-rw-r--r--src/mainboard/amd/dbm690t/resourcemap.c2
-rw-r--r--src/mainboard/amd/serengeti_cheetah/get_bus_conf.c3
-rw-r--r--src/mainboard/amd/serengeti_cheetah/resourcemap.c2
-rw-r--r--src/mainboard/amd/serengeti_cheetah_fam10/get_bus_conf.c3
-rw-r--r--src/mainboard/amd/serengeti_cheetah_fam10/resourcemap.c2
-rw-r--r--src/mainboard/arima/hdama/auto.c5
-rw-r--r--src/mainboard/arima/hdama/cache_as_ram_auto.c3
-rw-r--r--src/mainboard/artecgroup/dbe61/cache_as_ram_auto.c3
-rw-r--r--src/mainboard/asus/a8n_e/get_bus_conf.c1
-rw-r--r--src/mainboard/asus/mew-vm/auto.c3
-rw-r--r--src/mainboard/asus/p2b-f/auto.c3
-rw-r--r--src/mainboard/asus/p2b/auto.c3
-rw-r--r--src/mainboard/asus/p3b-f/auto.c3
-rw-r--r--src/mainboard/azza/pt-6ibd/auto.c3
-rw-r--r--src/mainboard/biostar/m6tba/auto.c3
-rw-r--r--src/mainboard/broadcom/blast/get_bus_conf.c3
-rw-r--r--src/mainboard/broadcom/blast/resourcemap.c2
-rw-r--r--src/mainboard/compaq/deskpro_en_sff_p600/auto.c3
-rw-r--r--src/mainboard/dell/s1850/auto.c3
-rw-r--r--src/mainboard/digitallogic/adl855pc/auto.c3
-rw-r--r--src/mainboard/eaglelion/5bcm/auto.c3
-rw-r--r--src/mainboard/gigabyte/ga-6bxc/auto.c3
-rw-r--r--src/mainboard/gigabyte/ga_2761gxdk/get_bus_conf.c3
-rw-r--r--src/mainboard/gigabyte/ga_2761gxdk/resourcemap.c2
-rw-r--r--src/mainboard/gigabyte/m57sli/fanctl.c5
-rw-r--r--src/mainboard/gigabyte/m57sli/get_bus_conf.c3
-rw-r--r--src/mainboard/gigabyte/m57sli/resourcemap.c2
-rw-r--r--src/mainboard/ibm/e325/auto.c3
-rw-r--r--src/mainboard/ibm/e325/cache_as_ram_auto.c3
-rw-r--r--src/mainboard/ibm/e325/resourcemap.c2
-rw-r--r--src/mainboard/ibm/e326/auto.c3
-rw-r--r--src/mainboard/ibm/e326/cache_as_ram_auto.c3
-rw-r--r--src/mainboard/ibm/e326/resourcemap.c2
-rw-r--r--src/mainboard/intel/jarrell/auto.c3
-rw-r--r--src/mainboard/intel/xe7501devkit/auto.c3
-rw-r--r--src/mainboard/iwill/dk8_htx/get_bus_conf.c3
-rw-r--r--src/mainboard/iwill/dk8_htx/resourcemap.c2
-rw-r--r--src/mainboard/iwill/dk8s2/auto.c3
-rw-r--r--src/mainboard/iwill/dk8x/auto.c5
-rw-r--r--src/mainboard/msi/ms6178/auto.c3
-rw-r--r--src/mainboard/msi/ms7135/get_bus_conf.c5
-rw-r--r--src/mainboard/msi/ms7260/get_bus_conf.c3
-rw-r--r--src/mainboard/msi/ms7260/resourcemap.c2
-rw-r--r--src/mainboard/msi/ms9185/get_bus_conf.c3
-rw-r--r--src/mainboard/msi/ms9185/resourcemap.c2
-rw-r--r--src/mainboard/msi/ms9282/get_bus_conf.c3
-rw-r--r--src/mainboard/msi/ms9282/resourcemap.c2
-rw-r--r--src/mainboard/newisys/khepri/auto.c3
-rw-r--r--src/mainboard/newisys/khepri/resourcemap.c2
-rw-r--r--src/mainboard/nvidia/l1_2pvv/get_bus_conf.c3
-rw-r--r--src/mainboard/nvidia/l1_2pvv/resourcemap.c2
-rw-r--r--src/mainboard/sunw/ultra40/auto.c3
-rw-r--r--src/mainboard/sunw/ultra40/get_bus_conf.c3
-rw-r--r--src/mainboard/sunw/ultra40/resourcemap.c2
-rw-r--r--src/mainboard/supermicro/h8dmr/get_bus_conf.c3
-rw-r--r--src/mainboard/supermicro/h8dmr/resourcemap.c2
-rw-r--r--src/mainboard/supermicro/x6dai_g/auto.c3
-rw-r--r--src/mainboard/supermicro/x6dhe_g/auto.c3
-rw-r--r--src/mainboard/supermicro/x6dhe_g2/auto.c3
-rw-r--r--src/mainboard/supermicro/x6dhe_g2/auto.updated.c3
-rw-r--r--src/mainboard/supermicro/x6dhr_ig/auto.c3
-rw-r--r--src/mainboard/supermicro/x6dhr_ig2/auto.c3
-rw-r--r--src/mainboard/tyan/s1846/auto.c3
-rw-r--r--src/mainboard/tyan/s2735/auto.c3
-rw-r--r--src/mainboard/tyan/s2850/auto.c3
-rw-r--r--src/mainboard/tyan/s2850/cache_as_ram_auto.c3
-rw-r--r--src/mainboard/tyan/s2875/auto.c3
-rw-r--r--src/mainboard/tyan/s2875/cache_as_ram_auto.c3
-rw-r--r--src/mainboard/tyan/s2880/cache_as_ram_auto.c3
-rw-r--r--src/mainboard/tyan/s2881/auto.c3
-rw-r--r--src/mainboard/tyan/s2881/get_bus_conf.c3
-rw-r--r--src/mainboard/tyan/s2881/resourcemap.c2
-rw-r--r--src/mainboard/tyan/s2882/auto.c3
-rw-r--r--src/mainboard/tyan/s2882/cache_as_ram_auto.c3
-rw-r--r--src/mainboard/tyan/s2885/auto.c3
-rw-r--r--src/mainboard/tyan/s2885/get_bus_conf.c3
-rw-r--r--src/mainboard/tyan/s2885/resourcemap.c2
-rw-r--r--src/mainboard/tyan/s2891/auto.c3
-rw-r--r--src/mainboard/tyan/s2891/get_bus_conf.c3
-rw-r--r--src/mainboard/tyan/s2891/resourcemap.c2
-rw-r--r--src/mainboard/tyan/s2892/auto.c3
-rw-r--r--src/mainboard/tyan/s2892/get_bus_conf.c3
-rw-r--r--src/mainboard/tyan/s2892/resourcemap.c2
-rw-r--r--src/mainboard/tyan/s2895/auto.c3
-rw-r--r--src/mainboard/tyan/s2895/get_bus_conf.c3
-rw-r--r--src/mainboard/tyan/s2895/resourcemap.c2
-rw-r--r--src/mainboard/tyan/s2912/get_bus_conf.c3
-rw-r--r--src/mainboard/tyan/s2912/resourcemap.c2
-rw-r--r--src/mainboard/tyan/s2912_fam10/get_bus_conf.c3
-rw-r--r--src/mainboard/tyan/s2912_fam10/resourcemap.c2
-rw-r--r--src/mainboard/tyan/s4880/auto.c3
-rw-r--r--src/mainboard/tyan/s4880/cache_as_ram_auto.c3
-rw-r--r--src/mainboard/tyan/s4880/resourcemap.c2
-rw-r--r--src/mainboard/tyan/s4882/auto.c3
-rw-r--r--src/mainboard/tyan/s4882/resourcemap.c2
-rw-r--r--src/mainboard/via/epia-m/auto.c3
-rw-r--r--src/mainboard/via/epia/auto.c5
102 files changed, 181 insertions, 107 deletions
diff --git a/src/mainboard/a-trend/atc-6220/auto.c b/src/mainboard/a-trend/atc-6220/auto.c
index ab12ab6abe..22ac2027d9 100644
--- a/src/mainboard/a-trend/atc-6220/auto.c
+++ b/src/mainboard/a-trend/atc-6220/auto.c
@@ -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); */
}
diff --git a/src/mainboard/agami/aruma/auto.c b/src/mainboard/agami/aruma/auto.c
index 48f83faadf..51954a9951 100644
--- a/src/mainboard/agami/aruma/auto.c
+++ b/src/mainboard/agami/aruma/auto.c
@@ -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 */
diff --git a/src/mainboard/agami/aruma/get_bus_conf.c b/src/mainboard/agami/aruma/get_bus_conf.c
index 3a08b7ac8d..b224aa8945 100644
--- a/src/mainboard/agami/aruma/get_bus_conf.c
+++ b/src/mainboard/agami/aruma/get_bus_conf.c
@@ -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();
diff --git a/src/mainboard/agami/aruma/resourcemap.c b/src/mainboard/agami/aruma/resourcemap.c
index 0bd40c4662..a9ae3b4068 100644
--- a/src/mainboard/agami/aruma/resourcemap.c
+++ b/src/mainboard/agami/aruma/resourcemap.c
@@ -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);
}
diff --git a/src/mainboard/amd/dbm690t/get_bus_conf.c b/src/mainboard/amd/dbm690t/get_bus_conf.c
index e94fdc3015..b776e21113 100644
--- a/src/mainboard/amd/dbm690t/get_bus_conf.c
+++ b/src/mainboard/amd/dbm690t/get_bus_conf.c
@@ -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];
diff --git a/src/mainboard/amd/dbm690t/resourcemap.c b/src/mainboard/amd/dbm690t/resourcemap.c
index 3664947052..d79e99f488 100644
--- a/src/mainboard/amd/dbm690t/resourcemap.c
+++ b/src/mainboard/amd/dbm690t/resourcemap.c
@@ -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);
}
diff --git a/src/mainboard/amd/serengeti_cheetah/get_bus_conf.c b/src/mainboard/amd/serengeti_cheetah/get_bus_conf.c
index d76b1ef2b9..f1b374ae95 100644
--- a/src/mainboard/amd/serengeti_cheetah/get_bus_conf.c
+++ b/src/mainboard/amd/serengeti_cheetah/get_bus_conf.c
@@ -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];
diff --git a/src/mainboard/amd/serengeti_cheetah/resourcemap.c b/src/mainboard/amd/serengeti_cheetah/resourcemap.c
index e5fc91b30e..9b19503360 100644
--- a/src/mainboard/amd/serengeti_cheetah/resourcemap.c
+++ b/src/mainboard/amd/serengeti_cheetah/resourcemap.c
@@ -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);
}
diff --git a/src/mainboard/amd/serengeti_cheetah_fam10/get_bus_conf.c b/src/mainboard/amd/serengeti_cheetah_fam10/get_bus_conf.c
index 68b9964edd..0eae634fd1 100644
--- a/src/mainboard/amd/serengeti_cheetah_fam10/get_bus_conf.c
+++ b/src/mainboard/amd/serengeti_cheetah_fam10/get_bus_conf.c
@@ -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];
diff --git a/src/mainboard/amd/serengeti_cheetah_fam10/resourcemap.c b/src/mainboard/amd/serengeti_cheetah_fam10/resourcemap.c
index bfc03618b8..04698d7369 100644
--- a/src/mainboard/amd/serengeti_cheetah_fam10/resourcemap.c
+++ b/src/mainboard/amd/serengeti_cheetah_fam10/resourcemap.c
@@ -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);
}
diff --git a/src/mainboard/arima/hdama/auto.c b/src/mainboard/arima/hdama/auto.c
index b37469d65b..f1046a24fa 100644
--- a/src/mainboard/arima/hdama/auto.c
+++ b/src/mainboard/arima/hdama/auto.c
@@ -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();
diff --git a/src/mainboard/arima/hdama/cache_as_ram_auto.c b/src/mainboard/arima/hdama/cache_as_ram_auto.c
index 9100d6b510..438bc306bc 100644
--- a/src/mainboard/arima/hdama/cache_as_ram_auto.c
+++ b/src/mainboard/arima/hdama/cache_as_ram_auto.c
@@ -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();
diff --git a/src/mainboard/artecgroup/dbe61/cache_as_ram_auto.c b/src/mainboard/artecgroup/dbe61/cache_as_ram_auto.c
index 29f4a4cd7b..adfe71b336 100644
--- a/src/mainboard/artecgroup/dbe61/cache_as_ram_auto.c
+++ b/src/mainboard/artecgroup/dbe61/cache_as_ram_auto.c
@@ -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;
}
diff --git a/src/mainboard/asus/a8n_e/get_bus_conf.c b/src/mainboard/asus/a8n_e/get_bus_conf.c
index 141bd50402..8e4edb4750 100644
--- a/src/mainboard/asus/a8n_e/get_bus_conf.c
+++ b/src/mainboard/asus/a8n_e/get_bus_conf.c
@@ -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,
diff --git a/src/mainboard/asus/mew-vm/auto.c b/src/mainboard/asus/mew-vm/auto.c
index 406844ce0b..133b399de2 100644
--- a/src/mainboard/asus/mew-vm/auto.c
+++ b/src/mainboard/asus/mew-vm/auto.c
@@ -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);
diff --git a/src/mainboard/asus/p2b-f/auto.c b/src/mainboard/asus/p2b-f/auto.c
index ac69617108..acb3c2fb9f 100644
--- a/src/mainboard/asus/p2b-f/auto.c
+++ b/src/mainboard/asus/p2b-f/auto.c
@@ -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); */
}
diff --git a/src/mainboard/asus/p2b/auto.c b/src/mainboard/asus/p2b/auto.c
index ab12ab6abe..22ac2027d9 100644
--- a/src/mainboard/asus/p2b/auto.c
+++ b/src/mainboard/asus/p2b/auto.c
@@ -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); */
}
diff --git a/src/mainboard/asus/p3b-f/auto.c b/src/mainboard/asus/p3b-f/auto.c
index 5c313d1ab5..5de70fb521 100644
--- a/src/mainboard/asus/p3b-f/auto.c
+++ b/src/mainboard/asus/p3b-f/auto.c
@@ -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); */
}
diff --git a/src/mainboard/azza/pt-6ibd/auto.c b/src/mainboard/azza/pt-6ibd/auto.c
index 02a80f65ca..4d9f8f787a 100644
--- a/src/mainboard/azza/pt-6ibd/auto.c
+++ b/src/mainboard/azza/pt-6ibd/auto.c
@@ -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); */
}
diff --git a/src/mainboard/biostar/m6tba/auto.c b/src/mainboard/biostar/m6tba/auto.c
index fb4084d131..48e41f8f9f 100644
--- a/src/mainboard/biostar/m6tba/auto.c
+++ b/src/mainboard/biostar/m6tba/auto.c
@@ -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); */
}
diff --git a/src/mainboard/broadcom/blast/get_bus_conf.c b/src/mainboard/broadcom/blast/get_bus_conf.c
index 95f9d12175..b11d940399 100644
--- a/src/mainboard/broadcom/blast/get_bus_conf.c
+++ b/src/mainboard/broadcom/blast/get_bus_conf.c
@@ -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];
diff --git a/src/mainboard/broadcom/blast/resourcemap.c b/src/mainboard/broadcom/blast/resourcemap.c
index 308b15d6e7..438605c701 100644
--- a/src/mainboard/broadcom/blast/resourcemap.c
+++ b/src/mainboard/broadcom/blast/resourcemap.c
@@ -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);
}
diff --git a/src/mainboard/compaq/deskpro_en_sff_p600/auto.c b/src/mainboard/compaq/deskpro_en_sff_p600/auto.c
index 71dee2c3e0..658151a86c 100644
--- a/src/mainboard/compaq/deskpro_en_sff_p600/auto.c
+++ b/src/mainboard/compaq/deskpro_en_sff_p600/auto.c
@@ -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); */
}
diff --git a/src/mainboard/dell/s1850/auto.c b/src/mainboard/dell/s1850/auto.c
index 78406138cb..627acb4ca5 100644
--- a/src/mainboard/dell/s1850/auto.c
+++ b/src/mainboard/dell/s1850/auto.c
@@ -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
diff --git a/src/mainboard/digitallogic/adl855pc/auto.c b/src/mainboard/digitallogic/adl855pc/auto.c
index f1e831e947..04cf2a359f 100644
--- a/src/mainboard/digitallogic/adl855pc/auto.c
+++ b/src/mainboard/digitallogic/adl855pc/auto.c
@@ -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
diff --git a/src/mainboard/eaglelion/5bcm/auto.c b/src/mainboard/eaglelion/5bcm/auto.c
index 9c08077388..ba7f77fcba 100644
--- a/src/mainboard/eaglelion/5bcm/auto.c
+++ b/src/mainboard/eaglelion/5bcm/auto.c
@@ -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
diff --git a/src/mainboard/gigabyte/ga-6bxc/auto.c b/src/mainboard/gigabyte/ga-6bxc/auto.c
index 0dd1129757..bfef2cc43e 100644
--- a/src/mainboard/gigabyte/ga-6bxc/auto.c
+++ b/src/mainboard/gigabyte/ga-6bxc/auto.c
@@ -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); */
}
diff --git a/src/mainboard/gigabyte/ga_2761gxdk/get_bus_conf.c b/src/mainboard/gigabyte/ga_2761gxdk/get_bus_conf.c
index 5ae3875015..08171d36a6 100644
--- a/src/mainboard/gigabyte/ga_2761gxdk/get_bus_conf.c
+++ b/src/mainboard/gigabyte/ga_2761gxdk/get_bus_conf.c
@@ -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];
diff --git a/src/mainboard/gigabyte/ga_2761gxdk/resourcemap.c b/src/mainboard/gigabyte/ga_2761gxdk/resourcemap.c
index 7754471e94..43ff3ed11a 100644
--- a/src/mainboard/gigabyte/ga_2761gxdk/resourcemap.c
+++ b/src/mainboard/gigabyte/ga_2761gxdk/resourcemap.c
@@ -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);
}
diff --git a/src/mainboard/gigabyte/m57sli/fanctl.c b/src/mainboard/gigabyte/m57sli/fanctl.c
index 952392d9ef..e411d8faee 100644
--- a/src/mainboard/gigabyte/m57sli/fanctl.c
+++ b/src/mainboard/gigabyte/m57sli/fanctl.c
@@ -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);
}
}
diff --git a/src/mainboard/gigabyte/m57sli/get_bus_conf.c b/src/mainboard/gigabyte/m57sli/get_bus_conf.c
index 5d8e1d4edf..7076960298 100644
--- a/src/mainboard/gigabyte/m57sli/get_bus_conf.c
+++ b/src/mainboard/gigabyte/m57sli/get_bus_conf.c
@@ -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];
diff --git a/src/mainboard/gigabyte/m57sli/resourcemap.c b/src/mainboard/gigabyte/m57sli/resourcemap.c
index a85b2edb77..847cd86e65 100644
--- a/src/mainboard/gigabyte/m57sli/resourcemap.c
+++ b/src/mainboard/gigabyte/m57sli/resourcemap.c
@@ -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);
}
diff --git a/src/mainboard/ibm/e325/auto.c b/src/mainboard/ibm/e325/auto.c
index ee1ce0323c..e171775d89 100644
--- a/src/mainboard/ibm/e325/auto.c
+++ b/src/mainboard/ibm/e325/auto.c
@@ -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();
diff --git a/src/mainboard/ibm/e325/cache_as_ram_auto.c b/src/mainboard/ibm/e325/cache_as_ram_auto.c
index 718358b943..e2002afa3b 100644
--- a/src/mainboard/ibm/e325/cache_as_ram_auto.c
+++ b/src/mainboard/ibm/e325/cache_as_ram_auto.c
@@ -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();
diff --git a/src/mainboard/ibm/e325/resourcemap.c b/src/mainboard/ibm/e325/resourcemap.c
index 52e85d5995..b80347eb0c 100644
--- a/src/mainboard/ibm/e325/resourcemap.c
+++ b/src/mainboard/ibm/e325/resourcemap.c
@@ -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);
}
diff --git a/src/mainboard/ibm/e326/auto.c b/src/mainboard/ibm/e326/auto.c
index 225b058b3b..f5c415d110 100644
--- a/src/mainboard/ibm/e326/auto.c
+++ b/src/mainboard/ibm/e326/auto.c
@@ -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();
diff --git a/src/mainboard/ibm/e326/cache_as_ram_auto.c b/src/mainboard/ibm/e326/cache_as_ram_auto.c
index 2f6a93adfe..0c6b9b0418 100644
--- a/src/mainboard/ibm/e326/cache_as_ram_auto.c
+++ b/src/mainboard/ibm/e326/cache_as_ram_auto.c
@@ -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();
diff --git a/src/mainboard/ibm/e326/resourcemap.c b/src/mainboard/ibm/e326/resourcemap.c
index 8a19d786b6..a37496879b 100644
--- a/src/mainboard/ibm/e326/resourcemap.c
+++ b/src/mainboard/ibm/e326/resourcemap.c
@@ -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);
}
diff --git a/src/mainboard/intel/jarrell/auto.c b/src/mainboard/intel/jarrell/auto.c
index d5e68e2343..61b066adfd 100644
--- a/src/mainboard/intel/jarrell/auto.c
+++ b/src/mainboard/intel/jarrell/auto.c
@@ -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();
diff --git a/src/mainboard/intel/xe7501devkit/auto.c b/src/mainboard/intel/xe7501devkit/auto.c
index 1bd83a3187..b106595803 100644
--- a/src/mainboard/intel/xe7501devkit/auto.c
+++ b/src/mainboard/intel/xe7501devkit/auto.c
@@ -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
diff --git a/src/mainboard/iwill/dk8_htx/get_bus_conf.c b/src/mainboard/iwill/dk8_htx/get_bus_conf.c
index 305dd2996f..d49333c261 100644
--- a/src/mainboard/iwill/dk8_htx/get_bus_conf.c
+++ b/src/mainboard/iwill/dk8_htx/get_bus_conf.c
@@ -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];
diff --git a/src/mainboard/iwill/dk8_htx/resourcemap.c b/src/mainboard/iwill/dk8_htx/resourcemap.c
index 56af68e446..992510215c 100644
--- a/src/mainboard/iwill/dk8_htx/resourcemap.c
+++ b/src/mainboard/iwill/dk8_htx/resourcemap.c
@@ -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);
}
diff --git a/src/mainboard/iwill/dk8s2/auto.c b/src/mainboard/iwill/dk8s2/auto.c
index a78b34f9f2..b302b79adc 100644
--- a/src/mainboard/iwill/dk8s2/auto.c
+++ b/src/mainboard/iwill/dk8s2/auto.c
@@ -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();
diff --git a/src/mainboard/iwill/dk8x/auto.c b/src/mainboard/iwill/dk8x/auto.c
index 4cdf57716e..2d4d6f4d15 100644
--- a/src/mainboard/iwill/dk8x/auto.c
+++ b/src/mainboard/iwill/dk8x/auto.c
@@ -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
diff --git a/src/mainboard/msi/ms6178/auto.c b/src/mainboard/msi/ms6178/auto.c
index 966eff5c26..0ae4e0a1b8 100644
--- a/src/mainboard/msi/ms6178/auto.c
+++ b/src/mainboard/msi/ms6178/auto.c
@@ -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); */
}
diff --git a/src/mainboard/msi/ms7135/get_bus_conf.c b/src/mainboard/msi/ms7135/get_bus_conf.c
index e2f868e566..90fa084217 100644
--- a/src/mainboard/msi/ms7135/get_bus_conf.c
+++ b/src/mainboard/msi/ms7135/get_bus_conf.c
@@ -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];
diff --git a/src/mainboard/msi/ms7260/get_bus_conf.c b/src/mainboard/msi/ms7260/get_bus_conf.c
index 19d80f536d..47273cdaa4 100644
--- a/src/mainboard/msi/ms7260/get_bus_conf.c
+++ b/src/mainboard/msi/ms7260/get_bus_conf.c
@@ -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];
diff --git a/src/mainboard/msi/ms7260/resourcemap.c b/src/mainboard/msi/ms7260/resourcemap.c
index 5035ac815c..d72530a3ae 100644
--- a/src/mainboard/msi/ms7260/resourcemap.c
+++ b/src/mainboard/msi/ms7260/resourcemap.c
@@ -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);
}
diff --git a/src/mainboard/msi/ms9185/get_bus_conf.c b/src/mainboard/msi/ms9185/get_bus_conf.c
index 05d8fede53..43cc42fe99 100644
--- a/src/mainboard/msi/ms9185/get_bus_conf.c
+++ b/src/mainboard/msi/ms9185/get_bus_conf.c
@@ -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];
diff --git a/src/mainboard/msi/ms9185/resourcemap.c b/src/mainboard/msi/ms9185/resourcemap.c
index cec820bb37..01bd1f3e71 100644
--- a/src/mainboard/msi/ms9185/resourcemap.c
+++ b/src/mainboard/msi/ms9185/resourcemap.c
@@ -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);
}
diff --git a/src/mainboard/msi/ms9282/get_bus_conf.c b/src/mainboard/msi/ms9282/get_bus_conf.c
index 1a4a40a319..ed5bde722e 100644
--- a/src/mainboard/msi/ms9282/get_bus_conf.c
+++ b/src/mainboard/msi/ms9282/get_bus_conf.c
@@ -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];
diff --git a/src/mainboard/msi/ms9282/resourcemap.c b/src/mainboard/msi/ms9282/resourcemap.c
index 0106797433..2099b961be 100644
--- a/src/mainboard/msi/ms9282/resourcemap.c
+++ b/src/mainboard/msi/ms9282/resourcemap.c
@@ -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);
}
diff --git a/src/mainboard/newisys/khepri/auto.c b/src/mainboard/newisys/khepri/auto.c
index a608d3a1c7..6d0a7455fc 100644
--- a/src/mainboard/newisys/khepri/auto.c
+++ b/src/mainboard/newisys/khepri/auto.c
@@ -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();
diff --git a/src/mainboard/newisys/khepri/resourcemap.c b/src/mainboard/newisys/khepri/resourcemap.c
index dcf9b4c258..d533b6357e 100644
--- a/src/mainboard/newisys/khepri/resourcemap.c
+++ b/src/mainboard/newisys/khepri/resourcemap.c
@@ -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);
}
diff --git a/src/mainboard/nvidia/l1_2pvv/get_bus_conf.c b/src/mainboard/nvidia/l1_2pvv/get_bus_conf.c
index 2dcf49321e..3a8ce918e6 100644
--- a/src/mainboard/nvidia/l1_2pvv/get_bus_conf.c
+++ b/src/mainboard/nvidia/l1_2pvv/get_bus_conf.c
@@ -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];
diff --git a/src/mainboard/nvidia/l1_2pvv/resourcemap.c b/src/mainboard/nvidia/l1_2pvv/resourcemap.c
index 4801643c93..f289ce7898 100644
--- a/src/mainboard/nvidia/l1_2pvv/resourcemap.c
+++ b/src/mainboard/nvidia/l1_2pvv/resourcemap.c
@@ -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);
}
diff --git a/src/mainboard/sunw/ultra40/auto.c b/src/mainboard/sunw/ultra40/auto.c
index 5b96d78c0a..db3de9c934 100644
--- a/src/mainboard/sunw/ultra40/auto.c
+++ b/src/mainboard/sunw/ultra40/auto.c
@@ -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);
}
diff --git a/src/mainboard/sunw/ultra40/get_bus_conf.c b/src/mainboard/sunw/ultra40/get_bus_conf.c
index 3decafb71e..7af7491243 100644
--- a/src/mainboard/sunw/ultra40/get_bus_conf.c
+++ b/src/mainboard/sunw/ultra40/get_bus_conf.c
@@ -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();
diff --git a/src/mainboard/sunw/ultra40/resourcemap.c b/src/mainboard/sunw/ultra40/resourcemap.c
index 08a0443ebe..726373093f 100644
--- a/src/mainboard/sunw/ultra40/resourcemap.c
+++ b/src/mainboard/sunw/ultra40/resourcemap.c
@@ -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);
}
diff --git a/src/mainboard/supermicro/h8dmr/get_bus_conf.c b/src/mainboard/supermicro/h8dmr/get_bus_conf.c
index fd02ae8d0f..3402d9d5f6 100644
--- a/src/mainboard/supermicro/h8dmr/get_bus_conf.c
+++ b/src/mainboard/supermicro/h8dmr/get_bus_conf.c
@@ -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];
diff --git a/src/mainboard/supermicro/h8dmr/resourcemap.c b/src/mainboard/supermicro/h8dmr/resourcemap.c
index 58c586a6c5..fa22ee337b 100644
--- a/src/mainboard/supermicro/h8dmr/resourcemap.c
+++ b/src/mainboard/supermicro/h8dmr/resourcemap.c
@@ -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);
}
diff --git a/src/mainboard/supermicro/x6dai_g/auto.c b/src/mainboard/supermicro/x6dai_g/auto.c
index 9c5fce59a3..078296df42 100644
--- a/src/mainboard/supermicro/x6dai_g/auto.c
+++ b/src/mainboard/supermicro/x6dai_g/auto.c
@@ -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));
diff --git a/src/mainboard/supermicro/x6dhe_g/auto.c b/src/mainboard/supermicro/x6dhe_g/auto.c
index fd78ab43d3..da340b73eb 100644
--- a/src/mainboard/supermicro/x6dhe_g/auto.c
+++ b/src/mainboard/supermicro/x6dhe_g/auto.c
@@ -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
diff --git a/src/mainboard/supermicro/x6dhe_g2/auto.c b/src/mainboard/supermicro/x6dhe_g2/auto.c
index afd389c03e..0622ab7ade 100644
--- a/src/mainboard/supermicro/x6dhe_g2/auto.c
+++ b/src/mainboard/supermicro/x6dhe_g2/auto.c
@@ -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
diff --git a/src/mainboard/supermicro/x6dhe_g2/auto.updated.c b/src/mainboard/supermicro/x6dhe_g2/auto.updated.c
index 934cdb4d28..fcf8b76c19 100644
--- a/src/mainboard/supermicro/x6dhe_g2/auto.updated.c
+++ b/src/mainboard/supermicro/x6dhe_g2/auto.updated.c
@@ -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
diff --git a/src/mainboard/supermicro/x6dhr_ig/auto.c b/src/mainboard/supermicro/x6dhr_ig/auto.c
index 41e85991ec..92020189d2 100644
--- a/src/mainboard/supermicro/x6dhr_ig/auto.c
+++ b/src/mainboard/supermicro/x6dhr_ig/auto.c
@@ -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
diff --git a/src/mainboard/supermicro/x6dhr_ig2/auto.c b/src/mainboard/supermicro/x6dhr_ig2/auto.c
index 70607d016b..7be6250650 100644
--- a/src/mainboard/supermicro/x6dhr_ig2/auto.c
+++ b/src/mainboard/supermicro/x6dhr_ig2/auto.c
@@ -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
diff --git a/src/mainboard/tyan/s1846/auto.c b/src/mainboard/tyan/s1846/auto.c
index 8b884a02d3..d80e23d9a2 100644
--- a/src/mainboard/tyan/s1846/auto.c
+++ b/src/mainboard/tyan/s1846/auto.c
@@ -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); */
}
diff --git a/src/mainboard/tyan/s2735/auto.c b/src/mainboard/tyan/s2735/auto.c
index 9cf5e50187..456c342b62 100644
--- a/src/mainboard/tyan/s2735/auto.c
+++ b/src/mainboard/tyan/s2735/auto.c
@@ -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 {
diff --git a/src/mainboard/tyan/s2850/auto.c b/src/mainboard/tyan/s2850/auto.c
index e0d85dbd56..bec1afabbd 100644
--- a/src/mainboard/tyan/s2850/auto.c
+++ b/src/mainboard/tyan/s2850/auto.c
@@ -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);
}
diff --git a/src/mainboard/tyan/s2850/cache_as_ram_auto.c b/src/mainboard/tyan/s2850/cache_as_ram_auto.c
index bd53a693fc..318903d227 100644
--- a/src/mainboard/tyan/s2850/cache_as_ram_auto.c
+++ b/src/mainboard/tyan/s2850/cache_as_ram_auto.c
@@ -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();
}
diff --git a/src/mainboard/tyan/s2875/auto.c b/src/mainboard/tyan/s2875/auto.c
index 3f23f5a237..e988a005e7 100644
--- a/src/mainboard/tyan/s2875/auto.c
+++ b/src/mainboard/tyan/s2875/auto.c
@@ -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);
}
diff --git a/src/mainboard/tyan/s2875/cache_as_ram_auto.c b/src/mainboard/tyan/s2875/cache_as_ram_auto.c
index e825c6ce6b..2611162714 100644
--- a/src/mainboard/tyan/s2875/cache_as_ram_auto.c
+++ b/src/mainboard/tyan/s2875/cache_as_ram_auto.c
@@ -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();
diff --git a/src/mainboard/tyan/s2880/cache_as_ram_auto.c b/src/mainboard/tyan/s2880/cache_as_ram_auto.c
index bb423673d8..de4b4895f8 100644
--- a/src/mainboard/tyan/s2880/cache_as_ram_auto.c
+++ b/src/mainboard/tyan/s2880/cache_as_ram_auto.c
@@ -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();
}
diff --git a/src/mainboard/tyan/s2881/auto.c b/src/mainboard/tyan/s2881/auto.c
index 924d7589b2..ea339fe5bd 100644
--- a/src/mainboard/tyan/s2881/auto.c
+++ b/src/mainboard/tyan/s2881/auto.c
@@ -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);
}
diff --git a/src/mainboard/tyan/s2881/get_bus_conf.c b/src/mainboard/tyan/s2881/get_bus_conf.c
index 82de11317b..d4c01675ab 100644
--- a/src/mainboard/tyan/s2881/get_bus_conf.c
+++ b/src/mainboard/tyan/s2881/get_bus_conf.c
@@ -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];
diff --git a/src/mainboard/tyan/s2881/resourcemap.c b/src/mainboard/tyan/s2881/resourcemap.c
index 22723eafad..cecb790795 100644
--- a/src/mainboard/tyan/s2881/resourcemap.c
+++ b/src/mainboard/tyan/s2881/resourcemap.c
@@ -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);
}
diff --git a/src/mainboard/tyan/s2882/auto.c b/src/mainboard/tyan/s2882/auto.c
index befd4da097..53b25a2c24 100644
--- a/src/mainboard/tyan/s2882/auto.c
+++ b/src/mainboard/tyan/s2882/auto.c
@@ -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);
}
diff --git a/src/mainboard/tyan/s2882/cache_as_ram_auto.c b/src/mainboard/tyan/s2882/cache_as_ram_auto.c
index dd3e6251e1..a4b894cd0d 100644
--- a/src/mainboard/tyan/s2882/cache_as_ram_auto.c
+++ b/src/mainboard/tyan/s2882/cache_as_ram_auto.c
@@ -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();
diff --git a/src/mainboard/tyan/s2885/auto.c b/src/mainboard/tyan/s2885/auto.c
index 7b892d0527..c926487d5a 100644
--- a/src/mainboard/tyan/s2885/auto.c
+++ b/src/mainboard/tyan/s2885/auto.c
@@ -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);
diff --git a/src/mainboard/tyan/s2885/get_bus_conf.c b/src/mainboard/tyan/s2885/get_bus_conf.c
index 68ed3d2e87..b50f671f9b 100644
--- a/src/mainboard/tyan/s2885/get_bus_conf.c
+++ b/src/mainboard/tyan/s2885/get_bus_conf.c
@@ -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];
diff --git a/src/mainboard/tyan/s2885/resourcemap.c b/src/mainboard/tyan/s2885/resourcemap.c
index bc2a8ba673..4a686020c8 100644
--- a/src/mainboard/tyan/s2885/resourcemap.c
+++ b/src/mainboard/tyan/s2885/resourcemap.c
@@ -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);
}
diff --git a/src/mainboard/tyan/s2891/auto.c b/src/mainboard/tyan/s2891/auto.c
index e264f366b1..aab040f6d2 100644
--- a/src/mainboard/tyan/s2891/auto.c
+++ b/src/mainboard/tyan/s2891/auto.c
@@ -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);
}
diff --git a/src/mainboard/tyan/s2891/get_bus_conf.c b/src/mainboard/tyan/s2891/get_bus_conf.c
index 1f8c8fe244..779f8885d0 100644
--- a/src/mainboard/tyan/s2891/get_bus_conf.c
+++ b/src/mainboard/tyan/s2891/get_bus_conf.c
@@ -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];
diff --git a/src/mainboard/tyan/s2891/resourcemap.c b/src/mainboard/tyan/s2891/resourcemap.c
index 312ce03ad7..f7929b96c0 100644
--- a/src/mainboard/tyan/s2891/resourcemap.c
+++ b/src/mainboard/tyan/s2891/resourcemap.c
@@ -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);
}
diff --git a/src/mainboard/tyan/s2892/auto.c b/src/mainboard/tyan/s2892/auto.c
index 3bd9209f09..bce2bbda4d 100644
--- a/src/mainboard/tyan/s2892/auto.c
+++ b/src/mainboard/tyan/s2892/auto.c
@@ -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);
}
diff --git a/src/mainboard/tyan/s2892/get_bus_conf.c b/src/mainboard/tyan/s2892/get_bus_conf.c
index 4f215ce9ae..4869b31c46 100644
--- a/src/mainboard/tyan/s2892/get_bus_conf.c
+++ b/src/mainboard/tyan/s2892/get_bus_conf.c
@@ -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];
diff --git a/src/mainboard/tyan/s2892/resourcemap.c b/src/mainboard/tyan/s2892/resourcemap.c
index 04d3f59edd..53482cc33e 100644
--- a/src/mainboard/tyan/s2892/resourcemap.c
+++ b/src/mainboard/tyan/s2892/resourcemap.c
@@ -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);
}
diff --git a/src/mainboard/tyan/s2895/auto.c b/src/mainboard/tyan/s2895/auto.c
index a4b86627e1..6663f23f3b 100644
--- a/src/mainboard/tyan/s2895/auto.c
+++ b/src/mainboard/tyan/s2895/auto.c
@@ -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);
}
diff --git a/src/mainboard/tyan/s2895/get_bus_conf.c b/src/mainboard/tyan/s2895/get_bus_conf.c
index c44095b2c3..04e9019355 100644
--- a/src/mainboard/tyan/s2895/get_bus_conf.c
+++ b/src/mainboard/tyan/s2895/get_bus_conf.c
@@ -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];
diff --git a/src/mainboard/tyan/s2895/resourcemap.c b/src/mainboard/tyan/s2895/resourcemap.c
index 9de9b2e107..aed892acf1 100644
--- a/src/mainboard/tyan/s2895/resourcemap.c
+++ b/src/mainboard/tyan/s2895/resourcemap.c
@@ -261,7 +261,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);
}
diff --git a/src/mainboard/tyan/s2912/get_bus_conf.c b/src/mainboard/tyan/s2912/get_bus_conf.c
index 7bb5f76788..9d6b9d7232 100644
--- a/src/mainboard/tyan/s2912/get_bus_conf.c
+++ b/src/mainboard/tyan/s2912/get_bus_conf.c
@@ -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
@@ -107,7 +108,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];
diff --git a/src/mainboard/tyan/s2912/resourcemap.c b/src/mainboard/tyan/s2912/resourcemap.c
index 4801643c93..f289ce7898 100644
--- a/src/mainboard/tyan/s2912/resourcemap.c
+++ b/src/mainboard/tyan/s2912/resourcemap.c
@@ -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);
}
diff --git a/src/mainboard/tyan/s2912_fam10/get_bus_conf.c b/src/mainboard/tyan/s2912_fam10/get_bus_conf.c
index f1bb721be5..d1cec8d815 100644
--- a/src/mainboard/tyan/s2912_fam10/get_bus_conf.c
+++ b/src/mainboard/tyan/s2912_fam10/get_bus_conf.c
@@ -30,6 +30,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
@@ -83,7 +84,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];
diff --git a/src/mainboard/tyan/s2912_fam10/resourcemap.c b/src/mainboard/tyan/s2912_fam10/resourcemap.c
index cb135a3274..60633d5ef1 100644
--- a/src/mainboard/tyan/s2912_fam10/resourcemap.c
+++ b/src/mainboard/tyan/s2912_fam10/resourcemap.c
@@ -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);
}
diff --git a/src/mainboard/tyan/s4880/auto.c b/src/mainboard/tyan/s4880/auto.c
index 7598e14199..36115f6a0d 100644
--- a/src/mainboard/tyan/s4880/auto.c
+++ b/src/mainboard/tyan/s4880/auto.c
@@ -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"
@@ -227,6 +228,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);
}
diff --git a/src/mainboard/tyan/s4880/cache_as_ram_auto.c b/src/mainboard/tyan/s4880/cache_as_ram_auto.c
index b7064778bb..2e8eb3bb48 100644
--- a/src/mainboard/tyan/s4880/cache_as_ram_auto.c
+++ b/src/mainboard/tyan/s4880/cache_as_ram_auto.c
@@ -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"
@@ -254,7 +255,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();
}
diff --git a/src/mainboard/tyan/s4880/resourcemap.c b/src/mainboard/tyan/s4880/resourcemap.c
index d9315a026a..cf45d55532 100644
--- a/src/mainboard/tyan/s4880/resourcemap.c
+++ b/src/mainboard/tyan/s4880/resourcemap.c
@@ -258,7 +258,7 @@ static void setup_s4880_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);
}
diff --git a/src/mainboard/tyan/s4882/auto.c b/src/mainboard/tyan/s4882/auto.c
index 6daa5d8a42..7576e4de26 100644
--- a/src/mainboard/tyan/s4882/auto.c
+++ b/src/mainboard/tyan/s4882/auto.c
@@ -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"
@@ -227,6 +228,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);
}
diff --git a/src/mainboard/tyan/s4882/resourcemap.c b/src/mainboard/tyan/s4882/resourcemap.c
index 8d9307c68f..0e5be61a7c 100644
--- a/src/mainboard/tyan/s4882/resourcemap.c
+++ b/src/mainboard/tyan/s4882/resourcemap.c
@@ -258,7 +258,7 @@ static void setup_s4882_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);
}
diff --git a/src/mainboard/via/epia-m/auto.c b/src/mainboard/via/epia-m/auto.c
index c82be2e111..1f444d61b7 100644
--- a/src/mainboard/via/epia-m/auto.c
+++ b/src/mainboard/via/epia-m/auto.c
@@ -10,6 +10,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"
@@ -146,7 +147,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
diff --git a/src/mainboard/via/epia/auto.c b/src/mainboard/via/epia/auto.c
index aec0dbff14..a45a32e6cf 100644
--- a/src/mainboard/via/epia/auto.c
+++ b/src/mainboard/via/epia/auto.c
@@ -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"
@@ -107,7 +108,7 @@ static void main(unsigned long bist)
/*
this is way more generic than we need.
- sdram_initialize(sizeof(cpu)/sizeof(cpu[0]), cpu);
+ sdram_initialize(ARRAY_SIZE(cpu), cpu);
*/
sdram_set_registers((const struct mem_controller *) 0);
sdram_set_spd_registers((const struct mem_controller *) 0);
@@ -129,7 +130,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