diff options
author | raywu <raywu0301@gmail.com> | 2018-06-15 00:00:50 +0800 |
---|---|---|
committer | raywu <raywu0301@gmail.com> | 2018-06-15 00:00:50 +0800 |
commit | b7c51c9cf4864df6aabb99a1ae843becd577237c (patch) | |
tree | eebe9b0d0ca03062955223097e57da84dd618b9a /Board/EM/Pfat/HandlePfatLegacy | |
download | zprj-b7c51c9cf4864df6aabb99a1ae843becd577237c.tar.xz |
Diffstat (limited to 'Board/EM/Pfat/HandlePfatLegacy')
-rw-r--r-- | Board/EM/Pfat/HandlePfatLegacy/HandlePfatLegacy.c | 148 | ||||
-rw-r--r-- | Board/EM/Pfat/HandlePfatLegacy/HandlePfatLegacy.cif | 10 | ||||
-rw-r--r-- | Board/EM/Pfat/HandlePfatLegacy/HandlePfatLegacy.mak | 71 | ||||
-rw-r--r-- | Board/EM/Pfat/HandlePfatLegacy/HandlePfatLegacy.sdl | 77 |
4 files changed, 306 insertions, 0 deletions
diff --git a/Board/EM/Pfat/HandlePfatLegacy/HandlePfatLegacy.c b/Board/EM/Pfat/HandlePfatLegacy/HandlePfatLegacy.c new file mode 100644 index 0000000..42818b4 --- /dev/null +++ b/Board/EM/Pfat/HandlePfatLegacy/HandlePfatLegacy.c @@ -0,0 +1,148 @@ +//************************************************************************* +//************************************************************************* +//** ** +//** (C)Copyright 1985-2009, American Megatrends, Inc. ** +//** ** +//** All Rights Reserved. ** +//** ** +//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 ** +//** ** +//** Phone: (770)-246-8600 ** +//** ** +//************************************************************************* +//************************************************************************* + +//********************************************************************** +// $Header: /Alaska/SOURCE/Modules/SharkBayRefCodes/IntelPfat/Pfatflashlib/HandlePfatLegacy/HandlePfatLegacy.c 2 11/08/12 3:24a Fredericko $ +// +// $Revision: 2 $ +// +// $Date: 11/08/12 3:24a $ +// +// $Log: /Alaska/SOURCE/Modules/SharkBayRefCodes/IntelPfat/Pfatflashlib/HandlePfatLegacy/HandlePfatLegacy.c $ +// +// 2 11/08/12 3:24a Fredericko +// +// 1 11/02/12 8:23p Fredericko +// [TAG] EIP105153 +// [Files] HandlePfatLegacy.cif +// HandlePfatLegacy.sdl +// HandlePfatLegacy.mak +// HandlePfatLegacy.c +// +//********************************************************************** +//<AMI_FHDR_START> +// +// Name: HandlePfatLegacy.c +// +// Description: Code listing file for HandlePfatLegacy +// +//<AMI_FHDR_END> +//********************************************************************** + +//---------------------------------------------------------------------- +// Includes +#include <efi.h> +#include "token.h" +#include <AmiDxeLib.h> + +EFI_EVENT PfatLegacyBootEvent; + +#define PFAT_VAR_GUID \ + { \ + 0x6aae75ee, 0xa4bc, 0x40c8, 0x81, 0x3b, 0x8, 0x4e, 0x28, 0x53, 0x5e, 0x79 \ + } + +//********************************************************************** +//<AMI_PHDR_START> +// +// Procedure: HandlePfatOnLegacyBoot +// +// Description: Callback on LegacyBoot Event +// +// Input: IN EFI_EVENT efiev +// IN VOID *ctx +// +// Output: EFI_STATUS +// +// Modified: +// +// Referrals: +// +// Notes: +//<AMI_PHDR_END> +//********************************************************************** +void HandlePfatOnLegacyBoot( + IN EFI_EVENT efiev, + IN VOID *ctx ) +{ + EFI_STATUS Status; + UINT32 PfatVar=0; + UINTN PfatVarSize = sizeof(UINT32); + EFI_GUID PfatVarGuid = PFAT_VAR_GUID ; + + Status = pRS->GetVariable(L"PfatVariable", &PfatVarGuid, NULL, &PfatVarSize, &PfatVar); + + PfatVar+=1; + + Status = pRS->SetVariable(L"PfatVariable", + &PfatVarGuid, + (EFI_VARIABLE_BOOTSERVICE_ACCESS | + EFI_VARIABLE_RUNTIME_ACCESS | + EFI_VARIABLE_NON_VOLATILE), + PfatVarSize, + &PfatVar); + + pBS->CloseEvent (PfatLegacyBootEvent); +} + + +//********************************************************************** +//<AMI_PHDR_START> +// +// Procedure: HandlePfatLegacyBoot +// +// Description: Entry point for subcomponent +// +// Input: IN EFI_HANDLE ImageHandle, +// IN EFI_SYSTEM_TABLE *SystemTable +// +// Output: EFI_STATUS +// +// Modified: +// +// Referrals: +// +// Notes: +// +//<AMI_PHDR_END> +//********************************************************************** +EFI_STATUS HandlePfatLegacyBoot( + IN EFI_HANDLE ImageHandle, + IN EFI_SYSTEM_TABLE *SystemTable ) +{ + EFI_STATUS Status; + + InitAmiLib( ImageHandle, SystemTable ); + + Status = CreateReadyToBootEvent( TPL_CALLBACK, + HandlePfatOnLegacyBoot, + NULL, + &PfatLegacyBootEvent ); + + return Status; +} + +//************************************************************************* +//************************************************************************* +//** ** +//** (C)Copyright 1985-2012, American Megatrends, Inc. ** +//** ** +//** All Rights Reserved. ** +//** ** +//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 ** +//** ** +//** Phone: (770)-246-8600 ** +//** ** +//************************************************************************* +//************************************************************************* diff --git a/Board/EM/Pfat/HandlePfatLegacy/HandlePfatLegacy.cif b/Board/EM/Pfat/HandlePfatLegacy/HandlePfatLegacy.cif new file mode 100644 index 0000000..ea7449d --- /dev/null +++ b/Board/EM/Pfat/HandlePfatLegacy/HandlePfatLegacy.cif @@ -0,0 +1,10 @@ +<component> + name = "HandlePfatLegacy" + category = ModulePart + LocalRoot = "Board\EM\Pfat\HandlePfatLegacy" + RefName = "HandlePfatLegacy" +[files] +"HandlePfatLegacy.sdl" +"HandlePfatLegacy.mak" +"HandlePfatLegacy.c" +<endComponent> diff --git a/Board/EM/Pfat/HandlePfatLegacy/HandlePfatLegacy.mak b/Board/EM/Pfat/HandlePfatLegacy/HandlePfatLegacy.mak new file mode 100644 index 0000000..73db816 --- /dev/null +++ b/Board/EM/Pfat/HandlePfatLegacy/HandlePfatLegacy.mak @@ -0,0 +1,71 @@ +#********************************************************************** +#********************************************************************** +#** ** +#** (C)Copyright 1985-2012, American Megatrends, Inc. ** +#** ** +#** All Rights Reserved. ** +#** ** +#** 5555 Oakbrook Pkwy, Suite 200, Norcross, GA 30093 ** +#** ** +#** Phone: (770)-246-8600 ** +#** ** +#********************************************************************** +#********************************************************************** +# $Header: /Alaska/SOURCE/Modules/SharkBayRefCodes/IntelPfat/Pfatflashlib/HandlePfatLegacy/HandlePfatLegacy.mak 1 11/02/12 8:23p Fredericko $ +# +# $Revision: 1 $ +# +# $Date: 11/02/12 8:23p $ +# +# $Log: /Alaska/SOURCE/Modules/SharkBayRefCodes/IntelPfat/Pfatflashlib/HandlePfatLegacy/HandlePfatLegacy.mak $ +# +# 1 11/02/12 8:23p Fredericko +# [TAG] EIP105153 +# [Files] HandlePfatLegacy.cif +# HandlePfatLegacy.sdl +# HandlePfatLegacy.mak +# HandlePfatLegacy.c +# +# +#********************************************************************** +#<AMI_FHDR_START> +# +# Name: HandlePfatLegacy.mak +# +# Description: Make file for HandlePfatLegacy +# +#<AMI_FHDR_END> +#********************************************************************** +all : HandlePfatLegacy + +HandlePfatLegacy : $(BUILD_DIR)\HandlePfatLegacy.mak HandlePfatLegacyBin + +#--------------------------------------------------------------------------- +# +#--------------------------------------------------------------------------- +$(BUILD_DIR)\HandlePfatLegacy.mak : $(HandlePfatLegacy_DIR)\$(@B).cif $(HandlePfatLegacy_DIR)\$(@B).mak $(BUILD_RULES) + $(CIF2MAK) $(HandlePfatLegacy_DIR)\$(@B).cif $(CIF2MAK_DEFAULTS) + +#--------------------------------------------------------------------------- +# +#--------------------------------------------------------------------------- +HandlePfatLegacyBin : $(AMIDXELIB) + $(MAKE) /$(MAKEFLAGS) $(BUILD_DEFAULTS)\ + /f $(BUILD_DIR)\HandlePfatLegacy.mak all\ + GUID=767BECBC-7E71-4c1e-B9BD-89193022E64E\ + ENTRY_POINT=HandlePfatLegacyBoot\ + TYPE=BS_DRIVER \ + COMPRESS=1\ +#----------------------------------------------------------------------- +#********************************************************************** +#** ** +#** (C)Copyright 1985-2012, American Megatrends, Inc. ** +#** ** +#** All Rights Reserved. ** +#** ** +#** 5555 Oakbrook Pkwy, Suite 200, Norcross, GA 30093 ** +#** ** +#** Phone: (770)-246-8600 ** +#** ** +#********************************************************************** +#********************************************************************** diff --git a/Board/EM/Pfat/HandlePfatLegacy/HandlePfatLegacy.sdl b/Board/EM/Pfat/HandlePfatLegacy/HandlePfatLegacy.sdl new file mode 100644 index 0000000..0c6d246 --- /dev/null +++ b/Board/EM/Pfat/HandlePfatLegacy/HandlePfatLegacy.sdl @@ -0,0 +1,77 @@ +#********************************************************************** +#********************************************************************** +#** ** +#** (C)Copyright 1985-2012, American Megatrends, Inc. ** +#** ** +#** All Rights Reserved. ** +#** ** +#** 5555 Oakbrook Pkwy, Suite 200, Norcross, GA 30093 ** +#** ** +#** Phone: (770)-246-8600 ** +#** ** +#********************************************************************** +#********************************************************************** +# $Header: /Alaska/SOURCE/Modules/SharkBayRefCodes/IntelPfat/Pfatflashlib/HandlePfatLegacy/HandlePfatLegacy.sdl 2 11/19/12 5:30p Fredericko $ +# +# $Revision: 2 $ +# +# $Date: 11/19/12 5:30p $ +# +# $Log: /Alaska/SOURCE/Modules/SharkBayRefCodes/IntelPfat/Pfatflashlib/HandlePfatLegacy/HandlePfatLegacy.sdl $ +# +# 2 11/19/12 5:30p Fredericko +# +# 1 11/02/12 8:23p Fredericko +# [TAG] EIP105153 +# [Files] HandlePfatLegacy.cif +# HandlePfatLegacy.sdl +# HandlePfatLegacy.mak +# HandlePfatLegacy.c +# +# +#********************************************************************** +#<AMI_FHDR_START> +# +# Name: HandlePfatLegacy.sdl +# +# Description: SDL file for HandlePfatLegacy +# +#<AMI_FHDR_END> +#********************************************************************** +TOKEN + Name = "HandlePfatLegacy_SUPPORT" + Value = "1" + Help = "Main switch to enable HandlePfatLegacy support in Project" + TokenType = Boolean + TargetEQU = Yes + TargetMAK = Yes + Master = Yes +End + +PATH + Name = "HandlePfatLegacy_DIR" + Help = "HandlePfatLegacy files source directory" +End + +MODULE + Help = "Includes HandlePfatLegacy.mak to Project" + File = "HandlePfatLegacy.mak" +End + +ELINK + Name = "$(BUILD_DIR)\HandlePfatLegacy.ffs" + Parent = "FV_MAIN" + InvokeOrder = AfterParent +End +#********************************************************************** +#********************************************************************** +#** ** +#** (C)Copyright 1985-2012, American Megatrends, Inc. ** +#** ** +#** All Rights Reserved. ** +#** ** +#** 5555 Oakbrook Pkwy, Suite 200, Norcross, GA 30093 ** +#** ** +#** Phone: (770)-246-8600 ** +#** ** +#**********************************************************************
\ No newline at end of file |