Chameleon

Chameleon Svn Source Tree

Root/branches/meklort/i386/libsaio/device_tree.h

Source at commit 340 created 13 years 10 months ago.
By azimutz, Ok.. as i mentioned about the "drivers" override key, this stuff is mostly based on the search algo on search_and_get_acpi_fd, acpi_patcher.c; i just added 2+2 and got 5 in return :) No need to check for ramdisk presence anymore, courtesy of Zef, rev 264. Why check the root of the ramdisk (rd) instead of /Extra? Well, rd's can be aliased as bt(0,0) or not, and the behavior is pretty diff in both situations; a "normal" rd can load "single" files and the paths to it start with rd(0,0).
1/*
2 * Copyright (c) 2005 Apple Computer, Inc. All Rights Reserved.
3 */
4
5#ifndef __DEVICE_TREE_H
6#define __DEVICE_TREE_H
7
8#include <stdbool.h>
9#include <stdint.h>
10
11typedef struct _Property {
12 const char * name;
13 uint32_t length;
14 void * value;
15
16 struct _Property * next;
17} Property;
18
19typedef struct _Node {
20 struct _Property * properties;
21 struct _Property * last_prop;
22
23 struct _Node * children;
24
25 struct _Node * next;
26} Node;
27
28
29extern Property *
30DT__AddProperty(Node *node, const char *name, uint32_t length, void *value);
31
32extern Node *
33DT__AddChild(Node *parent, const char *name);
34
35Node *
36DT__FindNode(const char *path, bool createIfMissing);
37
38extern void
39DT__FreeProperty(Property *prop);
40
41extern void
42DT__FreeNode(Node *node);
43
44extern char *
45DT__GetName(Node *node);
46
47void
48DT__Initialize(void);
49
50/*
51 * Free up memory used by in-memory representation
52 * of device tree.
53 */
54extern void
55DT__Finalize(void);
56
57void
58DT__FlattenDeviceTree(void **result, uint32_t *length);
59
60
61#endif /* __DEVICE_TREE_H */
62

Archive Download this file

Revision: 340