OpenCore
1.0.4
OpenCore Bootloader
|
#include <Uefi.h>
#include <Library/BaseLib.h>
#include <Library/DebugLib.h>
#include <Library/BaseMemoryLib.h>
#include <Library/MemoryAllocationLib.h>
#include <Library/PrintLib.h>
#include <Library/OcMiscLib.h>
#include <Library/OcStringLib.h>
#include <Library/OcDeviceTreeLib.h>
#include <Library/UefiBootServicesTableLib.h>
#include <Library/UefiLib.h>
Go to the source code of this file.
Macros | |
#define | DEVICE_TREE_GET_NEXT_PROPERTY(Prop) |
Functions | |
STATIC DTEntry | DTSkipProperties (IN DTEntry Entry) |
STATIC DTEntry | DTSkipTree (IN DTEntry Root) |
STATIC DTEntry | GetFirstChild (IN DTEntry Parent) |
STATIC DTEntry | GetNextChild (IN DTEntry Sibling) |
STATIC CONST CHAR8 * | GetNextComponent (IN CONST CHAR8 *Cp, IN CHAR8 *Bp) |
STATIC DTEntry | FindChild (IN DTEntry Cur, IN CHAR8 *Buf) |
EFI_STATUS | DTLookupEntry (IN CONST DTEntry SearchPoint, IN CONST CHAR8 *PathName, IN DTEntry *FoundEntry) |
EFI_STATUS | DTCreateEntryIterator (IN CONST DTEntry StartEntry, IN DTEntryIterator *Iterator) |
EFI_STATUS | DTDisposeEntryIterator (IN DTEntryIterator Iterator) |
EFI_STATUS | DTEnterEntry (IN DTEntryIterator Iterator, IN DTEntry ChildEntry) |
EFI_STATUS | DTExitEntry (IN DTEntryIterator Iterator, IN DTEntry *CurrentPosition) |
EFI_STATUS | DTIterateEntries (IN DTEntryIterator Iterator, IN DTEntry *NextEntry) |
EFI_STATUS | DTRestartEntryIteration (IN DTEntryIterator Iterator) |
EFI_STATUS | DTGetProperty (IN CONST DTEntry Entry, IN CHAR8 *PropertyName, IN VOID **PropertyValue, IN UINT32 *PropertySize) |
EFI_STATUS | DTCreatePropertyIterator (IN CONST DTEntry Entry, IN DTPropertyIterator Iterator) |
EFI_STATUS | DTIterateProperties (IN DTPropertyIterator Iterator, IN CHAR8 **FoundProperty) |
EFI_STATUS | DTRestartPropertyIteration (IN DTPropertyIterator Iterator) |
EFI_STATUS | DumpDeviceTreeNodeRecusively (IN DTEntry Entry) |
VOID | DumpDeviceTree (VOID) |
VOID | DTInit (IN VOID *Base, IN UINT32 *Length) |
UINT32 | DTDeleteProperty (IN CHAR8 *NodeName, IN CHAR8 *DeletePropertyName) |
VOID | DTInsertProperty (IN CHAR8 *NodeName, IN CHAR8 *InsertPropertyName, IN CHAR8 *AddPropertyName, IN VOID *AddPropertyValue, IN UINT32 ValueLength, IN BOOLEAN InsertAfter) |
Variables | |
STATIC DTEntry | mDTRootNode |
STATIC UINT32 * | mDTLength |
STATIC UINT32 | mDTNodeDepth |
STATIC OpaqueDTPropertyIterator | mOpaquePropIter |
Copyright (C) 2016 - 2017, The HermitCrabs Lab. All rights reserved.
All rights reserved.
This program and the accompanying materials are licensed and made available under the terms and conditions of the BSD License which accompanies this distribution. The full text of the license may be found at http://opensource.org/licenses/bsd-license.php
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
Definition in file OcDeviceTreeLib.c.
#define DEVICE_TREE_GET_NEXT_PROPERTY | ( | Prop | ) |
Definition at line 31 of file OcDeviceTreeLib.c.
EFI_STATUS DTCreateEntryIterator | ( | IN CONST DTEntry | StartEntry, |
IN DTEntryIterator * | Iterator ) |
An Entry Iterator maintains three variables that are of interest to clients. First is an "OutermostScope" which defines the outer boundry of the iteration. This is defined by the starting entry and includes that entry plus all of its embedded entries. Second is a "currentScope" which is the entry the iterator is currently in. And third is a "currentPosition" which is the last entry returned during an iteration.
Create Entry Iterator Create the iterator structure. The outermostScope and currentScope of the iterator are set to "startEntry". If "startEntry" = NULL, the outermostScope and currentScope are set to the root entry. The currentPosition for the iterator is set to "nil".
Definition at line 228 of file OcDeviceTreeLib.c.
EFI_STATUS DTCreatePropertyIterator | ( | IN CONST DTEntry | Entry, |
IN DTPropertyIterator | Iterator ) |
Create Property Iterator Create the property iterator structure. The target entry is defined by entry.
Definition at line 396 of file OcDeviceTreeLib.c.
UINT32 DTDeleteProperty | ( | IN CHAR8 * | NodeName, |
IN CHAR8 * | DeletePropertyName ) |
[in] | NodeName | |
[in] | DeletePropertyName |
Definition at line 598 of file OcDeviceTreeLib.c.
EFI_STATUS DTDisposeEntryIterator | ( | IN DTEntryIterator | Iterator | ) |
Dispose Entry Iterator
Definition at line 262 of file OcDeviceTreeLib.c.
EFI_STATUS DTEnterEntry | ( | IN DTEntryIterator | Iterator, |
IN DTEntry | ChildEntry ) |
Enter Child Entry Move an Entry Iterator into the scope of a specified child entry. The currentScope of the iterator is set to the entry specified in "childEntry". If "childEntry" is nil, the currentScope is set to the entry specified by the currentPosition of the iterator.
Definition at line 278 of file OcDeviceTreeLib.c.
EFI_STATUS DTExitEntry | ( | IN DTEntryIterator | Iterator, |
IN DTEntry * | CurrentPosition ) |
Exit to Parent Entry Move an Entry Iterator out of the current entry back into the scope of its parent entry. The currentPosition of the iterator is reset to the current entry (the previous currentScope), so the next iteration call will continue where it left off. This position is returned in parameter "currentPosition".
Definition at line 309 of file OcDeviceTreeLib.c.
EFI_STATUS DTGetProperty | ( | IN CONST DTEntry | Entry, |
IN CHAR8 * | PropertyName, | ||
IN VOID ** | PropertyValue, | ||
IN UINT32 * | PropertySize ) |
Get the value of the specified property for the specified entry.
Definition at line 367 of file OcDeviceTreeLib.c.
VOID DTInit | ( | IN VOID * | Base, |
IN UINT32 * | Length ) |
[in] | Base | Pointer to the Device Tree |
[in] | Length | Pointer to location containg the Device Tree length |
Definition at line 579 of file OcDeviceTreeLib.c.
VOID DTInsertProperty | ( | IN CHAR8 * | NodeName, |
IN CHAR8 * | InsertPropertyName, | ||
IN CHAR8 * | AddPropertyName, | ||
IN VOID * | AddPropertyValue, | ||
IN UINT32 | ValueLength, | ||
IN BOOLEAN InsertAfter | OPTIONAL ) |
[in] | NodeName | |
[in] | InsertPropertyName | |
[in] | AddPropertyName | |
[in] | AddPropertyValue | |
[in] | ValueLength | |
[in] | InsertAfter |
Definition at line 661 of file OcDeviceTreeLib.c.
EFI_STATUS DTIterateEntries | ( | IN DTEntryIterator | Iterator, |
IN DTEntry * | NextEntry ) |
Iterate Entries Iterate and return entries contained within the entry defined by the current scope of the iterator. Entries are returned one at a time. When int == kIterationDone, all entries have been exhausted, and the value of nextEntry will be Nil.
Definition at line 335 of file OcDeviceTreeLib.c.
EFI_STATUS DTIterateProperties | ( | IN DTPropertyIterator | Iterator, |
IN CHAR8 ** | FoundProperty ) |
Iterate Properites Iterate and return properties for given entry. EFI_END_OF_MEDIA, all properties have been exhausted.
Definition at line 409 of file OcDeviceTreeLib.c.
EFI_STATUS DTLookupEntry | ( | IN CONST DTEntry | SearchPoint, |
IN CONST CHAR8 * | PathName, | ||
IN DTEntry * | FoundEntry ) |
Lookup Entry Locates an entry given a specified subroot (searchPoint) and path name. If the searchPoint pointer is NULL, the path name is assumed to be an absolute path name rooted to the root of the device tree.
Definition at line 177 of file OcDeviceTreeLib.c.
EFI_STATUS DTRestartEntryIteration | ( | IN DTEntryIterator | Iterator | ) |
Restart Entry Iteration Restart an iteration within the current scope. The iterator is reset such that iteration of the contents of the currentScope entry can be restarted. The outermostScope and currentScope of the iterator are unchanged. The currentPosition for the iterator is set to "nil".
Definition at line 357 of file OcDeviceTreeLib.c.
EFI_STATUS DTRestartPropertyIteration | ( | IN DTPropertyIterator | Iterator | ) |
Restart Property Iteration Used to re-iterate over a list of properties. The Property Iterator is reset to the beginning of the list of properties for an entry.
Definition at line 432 of file OcDeviceTreeLib.c.
Definition at line 55 of file OcDeviceTreeLib.c.
Definition at line 76 of file OcDeviceTreeLib.c.
VOID DumpDeviceTree | ( | VOID | ) |
Definition at line 560 of file OcDeviceTreeLib.c.
EFI_STATUS DumpDeviceTreeNodeRecusively | ( | IN DTEntry | Entry | ) |
Definition at line 443 of file OcDeviceTreeLib.c.
Definition at line 136 of file OcDeviceTreeLib.c.
Definition at line 98 of file OcDeviceTreeLib.c.
Definition at line 107 of file OcDeviceTreeLib.c.
STATIC CONST CHAR8 * GetNextComponent | ( | IN CONST CHAR8 * | Cp, |
IN CHAR8 * | Bp ) |
Definition at line 116 of file OcDeviceTreeLib.c.
STATIC UINT32* mDTLength |
Definition at line 43 of file OcDeviceTreeLib.c.
STATIC UINT32 mDTNodeDepth |
Definition at line 45 of file OcDeviceTreeLib.c.
STATIC DTEntry mDTRootNode |
Definition at line 38 of file OcDeviceTreeLib.c.
STATIC OpaqueDTPropertyIterator mOpaquePropIter |
Definition at line 47 of file OcDeviceTreeLib.c.