1/*
2 * Copyright 2006, Ingo Weinhold <bonefish@cs.tu-berlin.de>.
3 * All rights reserved. Distributed under the terms of the MIT License.
4 */
5
6#ifndef PCI_BUS_MANAGER_PPC_OPEN_FIRMWARE_PRIV_H
7#define PCI_BUS_MANAGER_PPC_OPEN_FIRMWARE_PRIV_H
8
9#include <stdlib.h>
10#include <string.h>
11
12#include <SupportDefs.h>
13
14
15struct StringArrayPropertyValue;
16
17
18// implementations
19
20status_t	ppc_openfirmware_probe_uninorth(int deviceNode,
21				const StringArrayPropertyValue &compatibleValue);
22status_t	ppc_openfirmware_probe_grackle(int deviceNode,
23				const StringArrayPropertyValue &compatibleValue);
24
25
26// property support
27
28struct PropertyValue {
29	PropertyValue()
30		: value(NULL)
31	{
32	}
33
34	~PropertyValue()
35	{
36		free(value);
37	}
38
39	char	*value;
40	int		length;
41};
42
43struct StringArrayPropertyValue : PropertyValue {
44
45	char *NextElement(int &cookie) const;
46	bool ContainsElement(const char *value) const;
47};
48
49status_t	openfirmware_get_property(int package, const char *propertyName,
50				PropertyValue &value);
51
52#endif	// PCI_BUS_MANAGER_PPC_OPEN_FIRMWARE_PRIV_H
53