diff options
author | Laszlo Ersek <lersek@redhat.com> | 2015-07-26 08:02:35 +0000 |
---|---|---|
committer | jljusten <jljusten@Edk2> | 2015-07-26 08:02:35 +0000 |
commit | a136af45d9446e6d4d4b09992c37984f1ff02bf8 (patch) | |
tree | e31983327eca1083ccb904a887133650bcde915d /OvmfPkg/SmbiosPlatformDxe | |
parent | ca82d563d2c1e5ef4daca0e76f1b1dfc220206dd (diff) | |
download | edk2-a136af45d9446e6d4d4b09992c37984f1ff02bf8.tar.gz edk2-a136af45d9446e6d4d4b09992c37984f1ff02bf8.tar.bz2 edk2-a136af45d9446e6d4d4b09992c37984f1ff02bf8.zip |
OvmfPkg: SmbiosPlatformDxe: move IsEntryPointStructureValid() to Xen.c
This function is only called from Xen.c, so it should be defined in Xen.c
and have internal linkage (ie. STATIC).
Cc: Jordan Justen <jordan.l.justen@intel.com>
Cc: Wei Liu <wei.liu2@citrix.com>
Cc: Gabriel Somlo <somlo@cmu.edu>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Wei Liu <wei.liu2@citrix.com>
Acked-by: Gabriel Somlo <somlo@cmu.edu>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18039 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'OvmfPkg/SmbiosPlatformDxe')
-rw-r--r-- | OvmfPkg/SmbiosPlatformDxe/SmbiosPlatformDxe.c | 35 | ||||
-rw-r--r-- | OvmfPkg/SmbiosPlatformDxe/SmbiosPlatformDxe.h | 15 | ||||
-rw-r--r-- | OvmfPkg/SmbiosPlatformDxe/Xen.c | 35 |
3 files changed, 35 insertions, 50 deletions
diff --git a/OvmfPkg/SmbiosPlatformDxe/SmbiosPlatformDxe.c b/OvmfPkg/SmbiosPlatformDxe/SmbiosPlatformDxe.c index f70db2ff2b..29948a4b42 100644 --- a/OvmfPkg/SmbiosPlatformDxe/SmbiosPlatformDxe.c +++ b/OvmfPkg/SmbiosPlatformDxe/SmbiosPlatformDxe.c @@ -65,41 +65,6 @@ STATIC CONST OVMF_TYPE0 mOvmfDefaultType0 = { /**
- Validates the SMBIOS entry point structure
-
- @param EntryPointStructure SMBIOS entry point structure
-
- @retval TRUE The entry point structure is valid
- @retval FALSE The entry point structure is not valid
-
-**/
-BOOLEAN
-IsEntryPointStructureValid (
- IN SMBIOS_TABLE_ENTRY_POINT *EntryPointStructure
- )
-{
- UINTN Index;
- UINT8 Length;
- UINT8 Checksum;
- UINT8 *BytePtr;
-
- BytePtr = (UINT8*) EntryPointStructure;
- Length = EntryPointStructure->EntryPointLength;
- Checksum = 0;
-
- for (Index = 0; Index < Length; Index++) {
- Checksum = Checksum + (UINT8) BytePtr[Index];
- }
-
- if (Checksum != 0) {
- return FALSE;
- } else {
- return TRUE;
- }
-}
-
-
-/**
Get SMBIOS record length.
@param SmbiosTable SMBIOS pointer.
diff --git a/OvmfPkg/SmbiosPlatformDxe/SmbiosPlatformDxe.h b/OvmfPkg/SmbiosPlatformDxe/SmbiosPlatformDxe.h index e2606e1de8..6210a56f75 100644 --- a/OvmfPkg/SmbiosPlatformDxe/SmbiosPlatformDxe.h +++ b/OvmfPkg/SmbiosPlatformDxe/SmbiosPlatformDxe.h @@ -51,19 +51,4 @@ GetQemuSmbiosTables ( VOID
);
-
-/**
- Validates the SMBIOS entry point structure
-
- @param EntryPointStructure SMBIOS entry point structure
-
- @retval TRUE The entry point structure is valid
- @retval FALSE The entry point structure is not valid
-
-**/
-BOOLEAN
-IsEntryPointStructureValid (
- IN SMBIOS_TABLE_ENTRY_POINT *EntryPointStructure
- );
-
#endif
diff --git a/OvmfPkg/SmbiosPlatformDxe/Xen.c b/OvmfPkg/SmbiosPlatformDxe/Xen.c index 6a5c3f8b28..3f018d6f5c 100644 --- a/OvmfPkg/SmbiosPlatformDxe/Xen.c +++ b/OvmfPkg/SmbiosPlatformDxe/Xen.c @@ -22,6 +22,41 @@ #define XEN_SMBIOS_PHYSICAL_END 0x000F0000 /** + Validates the SMBIOS entry point structure + + @param EntryPointStructure SMBIOS entry point structure + + @retval TRUE The entry point structure is valid + @retval FALSE The entry point structure is not valid + +**/ +STATIC +BOOLEAN +IsEntryPointStructureValid ( + IN SMBIOS_TABLE_ENTRY_POINT *EntryPointStructure + ) +{ + UINTN Index; + UINT8 Length; + UINT8 Checksum; + UINT8 *BytePtr; + + BytePtr = (UINT8*) EntryPointStructure; + Length = EntryPointStructure->EntryPointLength; + Checksum = 0; + + for (Index = 0; Index < Length; Index++) { + Checksum = Checksum + (UINT8) BytePtr[Index]; + } + + if (Checksum != 0) { + return FALSE; + } else { + return TRUE; + } +} + +/** Locates the Xen SMBIOS data if it exists @return SMBIOS_TABLE_ENTRY_POINT Address of Xen SMBIOS data |