TianoCore EDK2 master
Loading...
Searching...
No Matches
Bhyve.c
1/*
2 * Copyright (c) 2020, Rebecca Cran <rebecca@bsdio.com>
3 * Copyright (c) 2014, Pluribus Networks, Inc.
4 *
5 * SPDX-License-Identifier: BSD-2-Clause-Patent
6 */
7
8#include "SmbiosPlatformDxe.h"
9
10#define BHYVE_SMBIOS_PHYSICAL_ADDRESS 0x000F0000
11#define BHYVE_SMBIOS_PHYSICAL_END 0x000FFFFF
12
20GetBhyveSmbiosTables (
21 VOID
22 )
23{
24 UINT8 *BhyveSmbiosPtr;
25 SMBIOS_TABLE_ENTRY_POINT *BhyveSmbiosEntryPointStructure;
26
27 for (BhyveSmbiosPtr = (UINT8 *)(UINTN)BHYVE_SMBIOS_PHYSICAL_ADDRESS;
28 BhyveSmbiosPtr < (UINT8 *)(UINTN)BHYVE_SMBIOS_PHYSICAL_END;
29 BhyveSmbiosPtr += 0x10)
30 {
31 BhyveSmbiosEntryPointStructure = (SMBIOS_TABLE_ENTRY_POINT *)BhyveSmbiosPtr;
32
33 if (!AsciiStrnCmp ((CHAR8 *)BhyveSmbiosEntryPointStructure->AnchorString, "_SM_", 4) &&
34 !AsciiStrnCmp ((CHAR8 *)BhyveSmbiosEntryPointStructure->IntermediateAnchorString, "_DMI_", 5) &&
35 IsEntryPointStructureValid (BhyveSmbiosEntryPointStructure))
36 {
37 return BhyveSmbiosEntryPointStructure;
38 }
39 }
40
41 return NULL;
42}
UINT64 UINTN
INTN EFIAPI AsciiStrnCmp(IN CONST CHAR8 *FirstString, IN CONST CHAR8 *SecondString, IN UINTN Length)
Definition: String.c:872
BOOLEAN IsEntryPointStructureValid(IN SMBIOS_TABLE_ENTRY_POINT *EntryPointStructure)
#define NULL
Definition: Base.h:319