Paul Menzel (paulepanter@users.sourceforge.net) just uploaded a new patch set to gerrit, which you can find at http://review.coreboot.org/2049
-gerrit
commit 22f934e4147a7dbd12c15ada5c0f19f8e86b4a35 Author: Aladyshev Konstantin aladyshev@nicevt.ru Date: Wed Dec 19 00:58:35 2012 +0400
BiosCallOuts: Replace REQUIRED_CALLOUTS define with flexible variable
Size of BiosCallouts[] struct can be calculated as:
CallOutCount = sizeof (BiosCallouts) / sizeof (BiosCallouts [0]);
There is no longer need for REQUIRED_CALLOUTS define.
Originally that change was done for AMD Persimmon in
commit d7a696d0f229abccc95ff411f28d91b9b796ab74 Author: efdesign98 efdesign98@gmail.com Date: Thu Sep 15 15:24:26 2011 -0600
Persimmon updates for AMD F14 rev C0
without deleting the define. This was ported to some of the other boards and for some the define was not removed.
The AMD Inagua, Parmer and Thatcher boards were already adapted but the define was left in. So just remove it for those.
Tested on Supermicro H8QGI.
Change-Id: Ia09795579a1170fa20ab94a30feb1af6821153d2 Signed-off-by: Aladyshev Konstantin aladyshev@nicevt.ru --- src/mainboard/amd/inagua/BiosCallOuts.h | 1 - src/mainboard/amd/parmer/BiosCallOuts.h | 1 - src/mainboard/amd/thatcher/BiosCallOuts.h | 1 - src/mainboard/asrock/e350m1/BiosCallOuts.c | 17 +++++++++-------- src/mainboard/asrock/e350m1/BiosCallOuts.h | 1 - src/mainboard/supermicro/h8qgi/BiosCallOuts.c | 7 ++++--- src/mainboard/supermicro/h8qgi/BiosCallOuts.h | 1 - src/mainboard/supermicro/h8scm/BiosCallOuts.c | 7 ++++--- src/mainboard/supermicro/h8scm/BiosCallOuts.h | 1 - src/mainboard/tyan/s8226/BiosCallOuts.c | 7 ++++--- src/mainboard/tyan/s8226/BiosCallOuts.h | 1 - 11 files changed, 21 insertions(+), 24 deletions(-)
diff --git a/src/mainboard/amd/inagua/BiosCallOuts.h b/src/mainboard/amd/inagua/BiosCallOuts.h index e713ac3..66d3d15 100644 --- a/src/mainboard/amd/inagua/BiosCallOuts.h +++ b/src/mainboard/amd/inagua/BiosCallOuts.h @@ -23,7 +23,6 @@ #include "Porting.h" #include "AGESA.h"
-#define REQUIRED_CALLOUTS 12 #define BIOS_HEAP_START_ADDRESS 0x00010000 #define BIOS_HEAP_SIZE 0x20000 /* 64MB */
diff --git a/src/mainboard/amd/parmer/BiosCallOuts.h b/src/mainboard/amd/parmer/BiosCallOuts.h index b7b9eaf..b449c68 100644 --- a/src/mainboard/amd/parmer/BiosCallOuts.h +++ b/src/mainboard/amd/parmer/BiosCallOuts.h @@ -23,7 +23,6 @@ #include "Porting.h" #include "AGESA.h"
-#define REQUIRED_CALLOUTS 12 #define BIOS_HEAP_START_ADDRESS 0x010000000 #define BIOS_HEAP_SIZE 0x30000 #define BSP_STACK_BASE_ADDR 0x30000 diff --git a/src/mainboard/amd/thatcher/BiosCallOuts.h b/src/mainboard/amd/thatcher/BiosCallOuts.h index b7b9eaf..b449c68 100644 --- a/src/mainboard/amd/thatcher/BiosCallOuts.h +++ b/src/mainboard/amd/thatcher/BiosCallOuts.h @@ -23,7 +23,6 @@ #include "Porting.h" #include "AGESA.h"
-#define REQUIRED_CALLOUTS 12 #define BIOS_HEAP_START_ADDRESS 0x010000000 #define BIOS_HEAP_SIZE 0x30000 #define BSP_STACK_BASE_ADDR 0x30000 diff --git a/src/mainboard/asrock/e350m1/BiosCallOuts.c b/src/mainboard/asrock/e350m1/BiosCallOuts.c index a0d64a7..2d6c9e0 100644 --- a/src/mainboard/asrock/e350m1/BiosCallOuts.c +++ b/src/mainboard/asrock/e350m1/BiosCallOuts.c @@ -23,12 +23,7 @@ #include "heapManager.h" #include "SB800.h"
-AGESA_STATUS GetBiosCallout (UINT32 Func, UINT32 Data, VOID *ConfigPtr) -{ - UINTN i; - AGESA_STATUS CalloutStatus; - -CONST BIOS_CALLOUT_STRUCT BiosCallouts[REQUIRED_CALLOUTS] = +CONST BIOS_CALLOUT_STRUCT BiosCallouts[] = { {AGESA_ALLOCATE_BUFFER, BiosAllocateBuffer @@ -73,7 +68,13 @@ CONST BIOS_CALLOUT_STRUCT BiosCallouts[REQUIRED_CALLOUTS] = }, };
- for (i = 0; i < REQUIRED_CALLOUTS; i++) +AGESA_STATUS GetBiosCallout (UINT32 Func, UINT32 Data, VOID *ConfigPtr) +{ + UINTN i; + AGESA_STATUS CalloutStatus; + UINTN CallOutCount = sizeof (BiosCallouts) / sizeof (BiosCallouts [0]); + + for (i = 0; i < CallOutCount; i++) { if (BiosCallouts[i].CalloutName == Func) { @@ -81,7 +82,7 @@ CONST BIOS_CALLOUT_STRUCT BiosCallouts[REQUIRED_CALLOUTS] = } }
- if(i >= REQUIRED_CALLOUTS) + if(i >= CallOutCount) { return AGESA_UNSUPPORTED; } diff --git a/src/mainboard/asrock/e350m1/BiosCallOuts.h b/src/mainboard/asrock/e350m1/BiosCallOuts.h index 4efe15f..71d8fa4 100644 --- a/src/mainboard/asrock/e350m1/BiosCallOuts.h +++ b/src/mainboard/asrock/e350m1/BiosCallOuts.h @@ -23,7 +23,6 @@ #include "Porting.h" #include "AGESA.h"
-#define REQUIRED_CALLOUTS 12 #define BIOS_HEAP_START_ADDRESS 0x00010000 #define BIOS_HEAP_SIZE 0x20000 /* 64MB */
diff --git a/src/mainboard/supermicro/h8qgi/BiosCallOuts.c b/src/mainboard/supermicro/h8qgi/BiosCallOuts.c index b7f0124..7c9c7bd 100644 --- a/src/mainboard/supermicro/h8qgi/BiosCallOuts.c +++ b/src/mainboard/supermicro/h8qgi/BiosCallOuts.c @@ -24,7 +24,7 @@ #include "OptionsIds.h" #include "heapManager.h"
-STATIC BIOS_CALLOUT_STRUCT BiosCallouts[REQUIRED_CALLOUTS] = +STATIC BIOS_CALLOUT_STRUCT BiosCallouts[] = { { AGESA_ALLOCATE_BUFFER, @@ -87,14 +87,15 @@ AGESA_STATUS GetBiosCallout (UINT32 Func, UINT32 Data, VOID *ConfigPtr) { UINTN i; AGESA_STATUS CalloutStatus; + UINTN CallOutCount = sizeof (BiosCallouts) / sizeof (BiosCallouts [0]);
- for (i = 0; i < REQUIRED_CALLOUTS; i++) { + for (i = 0; i < CallOutCount; i++) { if (BiosCallouts[i].CalloutName == Func) { break; } }
- if(i >= REQUIRED_CALLOUTS) { + if(i >= CallOutCount) { return AGESA_UNSUPPORTED; }
diff --git a/src/mainboard/supermicro/h8qgi/BiosCallOuts.h b/src/mainboard/supermicro/h8qgi/BiosCallOuts.h index 24a05fb..88eddc5 100644 --- a/src/mainboard/supermicro/h8qgi/BiosCallOuts.h +++ b/src/mainboard/supermicro/h8qgi/BiosCallOuts.h @@ -23,7 +23,6 @@ #include "Porting.h" #include "AGESA.h"
-#define REQUIRED_CALLOUTS 12 #define BIOS_HEAP_START_ADDRESS 0x00010000 #define BIOS_HEAP_SIZE 0x20000 /* 64MB */
diff --git a/src/mainboard/supermicro/h8scm/BiosCallOuts.c b/src/mainboard/supermicro/h8scm/BiosCallOuts.c index b7f0124..7c9c7bd 100644 --- a/src/mainboard/supermicro/h8scm/BiosCallOuts.c +++ b/src/mainboard/supermicro/h8scm/BiosCallOuts.c @@ -24,7 +24,7 @@ #include "OptionsIds.h" #include "heapManager.h"
-STATIC BIOS_CALLOUT_STRUCT BiosCallouts[REQUIRED_CALLOUTS] = +STATIC BIOS_CALLOUT_STRUCT BiosCallouts[] = { { AGESA_ALLOCATE_BUFFER, @@ -87,14 +87,15 @@ AGESA_STATUS GetBiosCallout (UINT32 Func, UINT32 Data, VOID *ConfigPtr) { UINTN i; AGESA_STATUS CalloutStatus; + UINTN CallOutCount = sizeof (BiosCallouts) / sizeof (BiosCallouts [0]);
- for (i = 0; i < REQUIRED_CALLOUTS; i++) { + for (i = 0; i < CallOutCount; i++) { if (BiosCallouts[i].CalloutName == Func) { break; } }
- if(i >= REQUIRED_CALLOUTS) { + if(i >= CallOutCount) { return AGESA_UNSUPPORTED; }
diff --git a/src/mainboard/supermicro/h8scm/BiosCallOuts.h b/src/mainboard/supermicro/h8scm/BiosCallOuts.h index c524174..8343748 100644 --- a/src/mainboard/supermicro/h8scm/BiosCallOuts.h +++ b/src/mainboard/supermicro/h8scm/BiosCallOuts.h @@ -23,7 +23,6 @@ #include "Porting.h" #include "AGESA.h"
-#define REQUIRED_CALLOUTS 12 #define BIOS_HEAP_START_ADDRESS 0x00010000 #define BIOS_HEAP_SIZE 0x20000 /* 64MB */
diff --git a/src/mainboard/tyan/s8226/BiosCallOuts.c b/src/mainboard/tyan/s8226/BiosCallOuts.c index b7f0124..7c9c7bd 100644 --- a/src/mainboard/tyan/s8226/BiosCallOuts.c +++ b/src/mainboard/tyan/s8226/BiosCallOuts.c @@ -24,7 +24,7 @@ #include "OptionsIds.h" #include "heapManager.h"
-STATIC BIOS_CALLOUT_STRUCT BiosCallouts[REQUIRED_CALLOUTS] = +STATIC BIOS_CALLOUT_STRUCT BiosCallouts[] = { { AGESA_ALLOCATE_BUFFER, @@ -87,14 +87,15 @@ AGESA_STATUS GetBiosCallout (UINT32 Func, UINT32 Data, VOID *ConfigPtr) { UINTN i; AGESA_STATUS CalloutStatus; + UINTN CallOutCount = sizeof (BiosCallouts) / sizeof (BiosCallouts [0]);
- for (i = 0; i < REQUIRED_CALLOUTS; i++) { + for (i = 0; i < CallOutCount; i++) { if (BiosCallouts[i].CalloutName == Func) { break; } }
- if(i >= REQUIRED_CALLOUTS) { + if(i >= CallOutCount) { return AGESA_UNSUPPORTED; }
diff --git a/src/mainboard/tyan/s8226/BiosCallOuts.h b/src/mainboard/tyan/s8226/BiosCallOuts.h index 24a05fb..88eddc5 100644 --- a/src/mainboard/tyan/s8226/BiosCallOuts.h +++ b/src/mainboard/tyan/s8226/BiosCallOuts.h @@ -23,7 +23,6 @@ #include "Porting.h" #include "AGESA.h"
-#define REQUIRED_CALLOUTS 12 #define BIOS_HEAP_START_ADDRESS 0x00010000 #define BIOS_HEAP_SIZE 0x20000 /* 64MB */