diff options
author | Aladyshev Konstantin <aladyshev@nicevt.ru> | 2012-12-19 00:58:35 +0400 |
---|---|---|
committer | Marc Jones <marcj303@gmail.com> | 2012-12-28 21:19:42 +0100 |
commit | 3d63b0a9656d5982dd0e9eef652c6cc1e8f8eaa3 (patch) | |
tree | 432ddc7e77e8d3f6b3fe50fd2045dd03a43a5efa /src/mainboard/supermicro | |
parent | b01097e0fe03b7dc81eadd898ff380b57f291852 (diff) | |
download | coreboot-3d63b0a9656d5982dd0e9eef652c6cc1e8f8eaa3.tar.xz |
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>
Reviewed-on: http://review.coreboot.org/2049
Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net>
Tested-by: build bot (Jenkins)
Reviewed-by: Martin Roth <martin@se-eng.com>
Reviewed-by: Marc Jones <marcj303@gmail.com>
Diffstat (limited to 'src/mainboard/supermicro')
-rw-r--r-- | src/mainboard/supermicro/h8qgi/BiosCallOuts.c | 7 | ||||
-rw-r--r-- | src/mainboard/supermicro/h8qgi/BiosCallOuts.h | 1 | ||||
-rw-r--r-- | src/mainboard/supermicro/h8scm/BiosCallOuts.c | 7 | ||||
-rw-r--r-- | src/mainboard/supermicro/h8scm/BiosCallOuts.h | 1 |
4 files changed, 8 insertions, 8 deletions
diff --git a/src/mainboard/supermicro/h8qgi/BiosCallOuts.c b/src/mainboard/supermicro/h8qgi/BiosCallOuts.c index b7f0124034..7c9c7bd321 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 24a05fb868..88eddc5f75 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 b7f0124034..7c9c7bd321 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 c52417401e..834374881d 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 */ |