OpenCore  1.0.4
OpenCore Bootloader
Loading...
Searching...
No Matches
OcDeviceTreeLib.h File Reference

Go to the source code of this file.

Data Structures

struct  DTBootxDriverInfo_
 
struct  DTBooterKextFileInfo_
 
struct  DTMemMapEntry_
 
struct  OpaqueDTProperty_
 
struct  OpaqueDTEntry_
 
struct  DTSavedScope_
 
struct  OpaqueDTEntryIterator_
 
struct  OpaqueDTPropertyIterator_
 

Macros

#define DT_BOOTER_KEXT_PREFIX   "Driver-"
 
#define DT_BOOTER_MKEXT_PREFIX   "DriversPackage-"
 
#define DT_PATH_NAME_SEPERATOR   '/'
 0x2F
 
#define DT_MAX_PROPERTY_NAME_LENGTH   31
 Max length of Property Name (terminator not included)
 
#define DT_MAX_ENTRY_NAME_LENGTH   31
 Max length of a C-String Entry Name (terminator not included)
 
#define DT_PROPERTY_NAME_LENGTH   32
 

Typedefs

typedef struct DTBootxDriverInfo_ DTBootxDriverInfo
 
typedef struct DTBooterKextFileInfo_ DTBooterKextFileInfo
 
typedef struct DTMemMapEntry_ DTMemMapEntry
 
typedef CHAR8 DTEntryNameBuf[DT_PROPERTY_NAME_LENGTH]
 Length of DTEntryNameBuf = DT_MAX_ENTRY_NAME_LENGTH + 1.
 
typedef struct OpaqueDTEntry_ DeviceTreeNode
 
typedef DeviceTreeNodeDTEntry
 Entry.
 
typedef struct OpaqueDTProperty_ DTProperty
 
typedef struct DTSavedScope_ DTSavedScope
 
typedef DTSavedScopeDTSavedScopePtr
 
typedef struct OpaqueDTEntryIterator_ OpaqueDTEntryIterator
 
typedef OpaqueDTEntryIteratorDTEntryIterator
 
typedef struct OpaqueDTPropertyIterator_ OpaqueDTPropertyIterator
 
typedef OpaqueDTPropertyIteratorDTPropertyIterator
 

Functions

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)
 
VOID DTInit (IN VOID *Base, IN UINT32 *Length)
 
VOID DumpDeviceTree (VOID)
 
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 OPTIONAL)
 

Detailed Description

Copyright (C) 2016, 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.h.

Macro Definition Documentation

◆ DT_BOOTER_KEXT_PREFIX

#define DT_BOOTER_KEXT_PREFIX   "Driver-"

Definition at line 21 of file OcDeviceTreeLib.h.

◆ DT_BOOTER_MKEXT_PREFIX

#define DT_BOOTER_MKEXT_PREFIX   "DriversPackage-"

Definition at line 22 of file OcDeviceTreeLib.h.

◆ DT_MAX_ENTRY_NAME_LENGTH

#define DT_MAX_ENTRY_NAME_LENGTH   31

Max length of a C-String Entry Name (terminator not included)

Definition at line 65 of file OcDeviceTreeLib.h.

◆ DT_MAX_PROPERTY_NAME_LENGTH

#define DT_MAX_PROPERTY_NAME_LENGTH   31

Max length of Property Name (terminator not included)

Definition at line 64 of file OcDeviceTreeLib.h.

◆ DT_PATH_NAME_SEPERATOR

#define DT_PATH_NAME_SEPERATOR   '/'

0x2F

Definition at line 62 of file OcDeviceTreeLib.h.

◆ DT_PROPERTY_NAME_LENGTH

#define DT_PROPERTY_NAME_LENGTH   32

Definition at line 66 of file OcDeviceTreeLib.h.

Typedef Documentation

◆ DeviceTreeNode

Definition at line 70 of file OcDeviceTreeLib.h.

◆ DTBooterKextFileInfo

◆ DTBootxDriverInfo

◆ DTEntry

Entry.

Definition at line 71 of file OcDeviceTreeLib.h.

◆ DTEntryIterator

Definition at line 79 of file OcDeviceTreeLib.h.

◆ DTEntryNameBuf

typedef CHAR8 DTEntryNameBuf[DT_PROPERTY_NAME_LENGTH]

Length of DTEntryNameBuf = DT_MAX_ENTRY_NAME_LENGTH + 1.

Definition at line 68 of file OcDeviceTreeLib.h.

◆ DTMemMapEntry

typedef struct DTMemMapEntry_ DTMemMapEntry

◆ DTProperty

typedef struct OpaqueDTProperty_ DTProperty

Definition at line 73 of file OcDeviceTreeLib.h.

◆ DTPropertyIterator

Definition at line 82 of file OcDeviceTreeLib.h.

◆ DTSavedScope

typedef struct DTSavedScope_ DTSavedScope

Definition at line 75 of file OcDeviceTreeLib.h.

◆ DTSavedScopePtr

Definition at line 76 of file OcDeviceTreeLib.h.

◆ OpaqueDTEntryIterator

Definition at line 78 of file OcDeviceTreeLib.h.

◆ OpaqueDTPropertyIterator

Definition at line 81 of file OcDeviceTreeLib.h.

Function Documentation

◆ DTCreateEntryIterator()

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.

◆ DTCreatePropertyIterator()

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.

◆ DTDeleteProperty()

UINT32 DTDeleteProperty ( IN CHAR8 * NodeName,
IN CHAR8 * DeletePropertyName )
Parameters
[in]NodeName
[in]DeletePropertyName

Definition at line 598 of file OcDeviceTreeLib.c.

◆ DTDisposeEntryIterator()

EFI_STATUS DTDisposeEntryIterator ( IN DTEntryIterator Iterator)

Dispose Entry Iterator

Definition at line 262 of file OcDeviceTreeLib.c.

◆ DTEnterEntry()

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.

◆ DTExitEntry()

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.

◆ DTGetProperty()

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.

◆ DTInit()

VOID DTInit ( IN VOID * Base,
IN UINT32 * Length )

Used to initalize the device tree functions. Base is the base address of the flatened device tree.

Parameters
[in]BasePointer to the Device Tree
[in]LengthPointer to location containg the Device Tree length

Definition at line 579 of file OcDeviceTreeLib.c.

◆ DTInsertProperty()

VOID DTInsertProperty ( IN CHAR8 * NodeName,
IN CHAR8 * InsertPropertyName,
IN CHAR8 * AddPropertyName,
IN VOID * AddPropertyValue,
IN UINT32 ValueLength,
IN BOOLEAN InsertAfter  )
Parameters
[in]NodeName
[in]InsertPropertyName
[in]AddPropertyName
[in]AddPropertyValue
[in]ValueLength
[in]InsertAfter

Definition at line 661 of file OcDeviceTreeLib.c.

◆ DTIterateEntries()

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.

◆ DTIterateProperties()

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.

◆ DTLookupEntry()

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.

◆ DTRestartEntryIteration()

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.

◆ DTRestartPropertyIteration()

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.

◆ DumpDeviceTree()

VOID DumpDeviceTree ( VOID )

Definition at line 560 of file OcDeviceTreeLib.c.