EFI 架構中有許多Variable,為了可以讓像是AP, Driver 之間可以傳遞資料

GetNextVariableName()
  Summary
  GetNextVariableName() is called multiple times to retrieve the VariableName and
  VendorGuid of all variables

Prototype :
EFI_STATUS
GetNextVariableName (
  IN OUT UINTN    *VariableNameSize,
  IN OUT CHAR16    *VariableName,
  IN OUT EFI_GUID    *VendorGuid
  );

 

GetVariable()
  Summary
  Returns the value of a variable.


Prototype :
EFI_STATUS
GetVariable (
  IN CHAR16      *VariableName,
  IN EFI_GUID    *VendorGuid,
OUT UINT32     *Attributes OPTIONAL,
  IN OUT UINTN    *DataSize,
  OUT VOID      *Data
  );

 

SetVariable()

Summary
  Sets the value of a variable.  
  Prototype
 
EFI_STATUS
SetVariable (
  IN CHAR16      *VariableName,
  IN EFI_GUID    *VendorGuid,
  IN UINT32      Attributes,
  IN UINTN      DataSize,
  IN VOID      *Data
  );

Setting a data variable with no access, or zero DataSize attributes specified causes it to be
deleted.

//*******************************************************
// Variable Attributes
//*******************************************************
#define EFI_VARIABLE_NON_VOLATILE              0x0000000000000001
#define EFI_VARIABLE_BOOTSERVICE_ACCESS  0x0000000000000002
#define EFI_VARIABLE_RUNTIME_ACCESS          0x0000000000000004

 

 

Variable 的應用 : 像是boot order 就會以NV 的方式儲存

NV Variable  儲存在BIOS ROM,BS, RT 存在RAM

有NV屬性的BS, RT 會同時儲存在RAM、ROM 當中

 

 

 

創作者介紹
創作者 linch0520的部落格 的頭像
linch0520

linch0520的部落格

linch0520 發表在 痞客邦 留言(0) 人氣( 2838 )