Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Macros | Functions
fdt_rw.c File Reference
#include "libfdt_env.h"
#include <fdt.h>
#include <libfdt.h>
#include "libfdt_internal.h"

Go to the source code of this file.

Macros

#define FDT_RW_CHECK_HEADER(fdt)
 

Functions

int fdt_add_mem_rsv (void *fdt, uint64_t address, uint64_t size)
 
int fdt_del_mem_rsv (void *fdt, int n)
 
int fdt_set_name (void *fdt, int nodeoffset, const char *name)
 
int fdt_setprop (void *fdt, int nodeoffset, const char *name, const void *val, int len)
 
int fdt_appendprop (void *fdt, int nodeoffset, const char *name, const void *val, int len)
 
int fdt_delprop (void *fdt, int nodeoffset, const char *name)
 
int fdt_add_subnode_namelen (void *fdt, int parentoffset, const char *name, int namelen)
 
int fdt_add_subnode (void *fdt, int parentoffset, const char *name)
 
int fdt_del_node (void *fdt, int nodeoffset)
 
int fdt_open_into (const void *fdt, void *buf, int bufsize)
 
int fdt_pack (void *fdt)
 

Macro Definition Documentation

#define FDT_RW_CHECK_HEADER (   fdt)
Value:
{ \
int err; \
if ((err = _fdt_rw_check_header(fdt)) != 0) \
return err; \
}

Definition at line 85 of file fdt_rw.c.

Function Documentation

int fdt_add_mem_rsv ( void fdt,
uint64_t  address,
uint64_t  size 
)

fdt_add_mem_rsv - add one memory reserve map entry : pointer to the device tree blob , : 64-bit values (native endian)

Adds a reserve map entry to the given blob reserving a region at address address of length size.

This function will insert data into the reserve map and will therefore change the indexes of some entries in the table.

returns: 0, on success -FDT_ERR_NOSPACE, there is insufficient free space in the blob to contain the new reservation entry -FDT_ERR_BADMAGIC, -FDT_ERR_BADVERSION, -FDT_ERR_BADSTATE, -FDT_ERR_BADSTRUCTURE, -FDT_ERR_BADLAYOUT, -FDT_ERR_TRUNCATED, standard meanings

Definition at line 172 of file fdt_rw.c.

int fdt_add_subnode ( void fdt,
int  parentoffset,
const char name 
)

Definition at line 375 of file fdt_rw.c.

int fdt_add_subnode_namelen ( void fdt,
int  parentoffset,
const char name,
int  namelen 
)

Definition at line 334 of file fdt_rw.c.

int fdt_appendprop ( void fdt,
int  nodeoffset,
const char name,
const void val,
int  len 
)

Definition at line 292 of file fdt_rw.c.

int fdt_del_mem_rsv ( void fdt,
int  n 
)

fdt_del_mem_rsv - remove a memory reserve map entry : pointer to the device tree blob
: entry to remove

fdt_del_mem_rsv() removes the n-th memory reserve map entry from the blob.

This function will delete data from the reservation table and will therefore change the indexes of some entries in the table.

returns: 0, on success -FDT_ERR_NOTFOUND, there is no entry of the given index (i.e. there are less than n+1 reserve map entries) -FDT_ERR_BADMAGIC, -FDT_ERR_BADVERSION, -FDT_ERR_BADSTATE, -FDT_ERR_BADSTRUCTURE, -FDT_ERR_BADLAYOUT, -FDT_ERR_TRUNCATED, standard meanings

Definition at line 189 of file fdt_rw.c.

int fdt_del_node ( void fdt,
int  nodeoffset 
)

fdt_del_node - delete a node (subtree) : pointer to the device tree blob : offset of the node to nop

fdt_del_node() will remove the given node, including all its subnodes if any, from the blob.

This function will delete data from the blob, and will therefore change the offsets of some existing nodes.

returns: 0, on success -FDT_ERR_BADOFFSET, nodeoffset did not point to FDT_BEGIN_NODE tag -FDT_ERR_BADLAYOUT, -FDT_ERR_BADMAGIC, -FDT_ERR_BADVERSION, -FDT_ERR_BADSTATE, -FDT_ERR_BADSTRUCTURE, -FDT_ERR_TRUNCATED, standard meanings

Definition at line 380 of file fdt_rw.c.

int fdt_delprop ( void fdt,
int  nodeoffset,
const char name 
)

Definition at line 319 of file fdt_rw.c.

int fdt_open_into ( const void fdt,
void buf,
int  bufsize 
)

Definition at line 416 of file fdt_rw.c.

int fdt_pack ( void fdt)

Definition at line 480 of file fdt_rw.c.

int fdt_set_name ( void fdt,
int  nodeoffset,
const char name 
)

Definition at line 251 of file fdt_rw.c.

int fdt_setprop ( void fdt,
int  nodeoffset,
const char name,
const void val,
int  len 
)

Definition at line 274 of file fdt_rw.c.