XenevaOS
Loading...
Searching...
No Matches
Macros | Functions | Variables
dtb.c File Reference
#include "littleboot.h"
#include "string.h"
#include "dtb.h"
Include dependency graph for dtb.c:

Macros

#define FDT_MAGIC   0xd00dfeed
 
#define FDT_BEGIN_NODE   0x1
 
#define FDT_END_NODE   0x2
 
#define FDT_PROP   0x3
 
#define FDT_NOP   0x4
 
#define FDT_END   0x9
 

Functions

uint32_t fdt32_to_cpu (uint32_t x)
 
uint32_t swizzle (uint32_t from)
 
uint64_t swizzle64 (uint64_t from)
 
uint16_t swizzle16 (uint16_t from)
 
uint32_tfind_subnode (uint32_t *node, char *strings, const char *name, uint32_t **node_out, int(*cmp)(const char *a, const char *b))
 
uint32_tskip_node (uint32_t *node, void(*callback)(uint32_t *child))
 
uint32_tdtb_find_node (const char *name)
 
uint32_tdtb_find_node_prefix (const char *name)
 
uint32_tfind_node_int (const char *name, int(*comp)(const char *, const char *))
 
uint32_tnode_find_property_int (uint32_t *node, char *strings, const char *property, uint32_t **out)
 
uint32_tdtb_node_find_property (uint32_t *node, const char *property)
 
void LBDTBGetMemorySize (uint64_t *memaddr, size_t *physSize)
 
void LBDeviceTreeInitialize (uint64_t dtb)
 
uint32_t LBDTBGetTotalSize ()
 

Variables

uint64_tdtb_
 

Macro Definition Documentation

◆ FDT_BEGIN_NODE

#define FDT_BEGIN_NODE   0x1

◆ FDT_END

#define FDT_END   0x9

◆ FDT_END_NODE

#define FDT_END_NODE   0x2

◆ FDT_MAGIC

#define FDT_MAGIC   0xd00dfeed

◆ FDT_NOP

#define FDT_NOP   0x4

◆ FDT_PROP

#define FDT_PROP   0x3

Function Documentation

◆ dtb_find_node()

uint32_t * dtb_find_node ( const char *  name)

◆ dtb_find_node_prefix()

uint32_t * dtb_find_node_prefix ( const char *  name)

◆ dtb_node_find_property()

uint32_t * dtb_node_find_property ( uint32_t node,
const char *  property 
)

◆ fdt32_to_cpu()

uint32_t fdt32_to_cpu ( uint32_t  x)

◆ find_node_int()

uint32_t * find_node_int ( const char *  name,
int(*)(const char *, const char *)  comp 
)

◆ find_subnode()

uint32_t * find_subnode ( uint32_t node,
char *  strings,
const char *  name,
uint32_t **  node_out,
int(*)(const char *a, const char *b)  cmp 
)

◆ LBDeviceTreeInitialize()

void LBDeviceTreeInitialize ( uint64_t  dtb)

◆ LBDTBGetMemorySize()

void LBDTBGetMemorySize ( uint64_t memaddr,
size_t physSize 
)

◆ LBDTBGetTotalSize()

uint32_t LBDTBGetTotalSize ( )

◆ node_find_property_int()

uint32_t * node_find_property_int ( uint32_t node,
char *  strings,
const char *  property,
uint32_t **  out 
)

◆ skip_node()

uint32_t * skip_node ( uint32_t node,
void(*)(uint32_t *child)  callback 
)

◆ swizzle()

uint32_t swizzle ( uint32_t  from)

◆ swizzle16()

uint16_t swizzle16 ( uint16_t  from)

BSD 2-Clause License

Copyright (c) 2022-2025, Manas Kamal Choudhury All rights reserved.

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

  1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
  2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

◆ swizzle64()

uint64_t swizzle64 ( uint64_t  from)

Variable Documentation

◆ dtb_

uint64_t* dtb_

BSD 2-Clause License

Copyright (c) 2022-2025, Manas Kamal Choudhury All rights reserved.

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

  1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
  2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.