eric patch
[coreboot.git] / src / include / device / path.h
1 #ifndef DEVICE_PATH_H
2 #define DEVICE_PATH_H
3
4 enum device_path_type {
5         DEVICE_PATH_NONE = 0,
6         DEVICE_PATH_ROOT,
7         DEVICE_PATH_PCI,
8         DEVICE_PATH_PNP,
9         DEVICE_PATH_I2C,
10         DEVICE_PATH_APIC,
11         DEVICE_PATH_PCI_DOMAIN,
12         DEVICE_PATH_APIC_CLUSTER,
13         DEVICE_PATH_CPU,
14         DEVICE_PATH_CPU_BUS,
15 };
16
17 struct pci_domain_path
18 {
19         unsigned domain;
20 };
21
22 struct pci_path
23 {
24         unsigned devfn;
25 };
26
27 struct pnp_path
28 {
29         unsigned port;
30         unsigned device;
31 };
32
33 struct i2c_path
34 {
35         unsigned device;
36 };
37
38 struct apic_path
39 {
40         unsigned apic_id;
41 };
42
43 struct apic_cluster_path
44 {
45         unsigned cluster;
46 };
47
48 struct cpu_path
49 {
50         unsigned id;
51 };
52
53 struct cpu_bus_path
54 {
55         unsigned id;
56 };
57
58
59 struct device_path {
60         enum device_path_type type;
61         union {
62                 struct pci_path          pci;
63                 struct pnp_path          pnp;
64                 struct i2c_path          i2c;
65                 struct apic_path         apic;
66                 struct pci_domain_path   pci_domain;
67                 struct apic_cluster_path apic_cluster;
68                 struct cpu_path          cpu;
69                 struct cpu_bus_path      cpu_bus;
70         } u;
71 };
72
73
74 #define DEVICE_PATH_MAX 30
75 #define BUS_PATH_MAX (DEVICE_PATH_MAX+10)
76
77 extern int path_eq(struct device_path *path1, struct device_path *path2);
78
79 #endif /* DEVICE_PATH_H */