From 6025efa3472f38d719d850d2143dae0b215db0f3 Mon Sep 17 00:00:00 2001 From: Kyösti Mälkki Date: Mon, 5 May 2014 13:20:56 +0300 Subject: AGESA: Use common GetBiosCallout() MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: I9c8f7cc98c65102486e17ec49fa2246211dffc4f Signed-off-by: Kyösti Mälkki Reviewed-on: http://review.coreboot.org/5688 Tested-by: build bot (Jenkins) Reviewed-by: Edward O'Callaghan Reviewed-by: Patrick Georgi --- src/mainboard/lippert/toucan-af/BiosCallOuts.c | 26 +++----------------------- 1 file changed, 3 insertions(+), 23 deletions(-) (limited to 'src/mainboard/lippert/toucan-af/BiosCallOuts.c') diff --git a/src/mainboard/lippert/toucan-af/BiosCallOuts.c b/src/mainboard/lippert/toucan-af/BiosCallOuts.c index bd229b1e01..3d1a3fc758 100644 --- a/src/mainboard/lippert/toucan-af/BiosCallOuts.c +++ b/src/mainboard/lippert/toucan-af/BiosCallOuts.c @@ -22,6 +22,7 @@ #include "BiosCallOuts.h" #include "heapManager.h" #include +#include /* Should AGESA_GNB_PCIE_SLOT_RESET use agesa_NoopSuccess? * @@ -31,7 +32,7 @@ static AGESA_STATUS board_BeforeDramInit (UINT32 Func, UINT32 Data, VOID *ConfigPtr); -STATIC BIOS_CALLOUT_STRUCT BiosCallouts[] = +const BIOS_CALLOUT_STRUCT BiosCallouts[] = { {AGESA_ALLOCATE_BUFFER, BiosAllocateBuffer }, {AGESA_DEALLOCATE_BUFFER, BiosDeallocateBuffer }, @@ -46,28 +47,7 @@ STATIC BIOS_CALLOUT_STRUCT BiosCallouts[] = {AGESA_HOOKBEFORE_DQS_TRAINING, agesa_NoopSuccess }, {AGESA_HOOKBEFORE_EXIT_SELF_REF, agesa_NoopSuccess }, }; - -AGESA_STATUS GetBiosCallout (UINT32 Func, UINT32 Data, VOID *ConfigPtr) -{ - UINTN i; - AGESA_STATUS CalloutStatus; - UINTN CallOutCount = sizeof (BiosCallouts) / sizeof (BiosCallouts [0]); - - /* - * printk(BIOS_SPEW,"%s function: %x\n", __func__, (u32) Func); - */ - - CalloutStatus = AGESA_UNSUPPORTED; - - for (i = 0; i < CallOutCount; i++) { - if (BiosCallouts[i].CalloutName == Func) { - CalloutStatus = BiosCallouts[i].CalloutPtr (Func, Data, ConfigPtr); - return CalloutStatus; - } - } - - return CalloutStatus; -} +const int BiosCalloutsLen = ARRAY_SIZE(BiosCallouts); /* Call the host environment interface to provide a user hook opportunity. */ static AGESA_STATUS board_BeforeDramInit (UINT32 Func, UINT32 Data, VOID *ConfigPtr) -- cgit v1.2.3