Subversion Repositories Kolibri OS

Rev

Rev 1498 | Rev 1625 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
1498 serge 1
 
2
#include 
3
4
 
5
6
 
7
#define ACPI_NS_SYSTEM_BUS      "_SB_"
8
9
 
10
	ACPI_IRQ_MODEL_PIC = 0,
11
	ACPI_IRQ_MODEL_IOAPIC,
12
	ACPI_IRQ_MODEL_IOSAPIC,
13
	ACPI_IRQ_MODEL_PLATFORM,
14
	ACPI_IRQ_MODEL_COUNT
15
};
16
17
 
18
 
19
    (addr_t)((addr_t)(addr) + (addr_t)(off))
20
21
 
22
//    (addr_t)((addr_t)(addr) + OS_BASE)
23
24
 
25
26
 
27
get_device_by_hid_callback(ACPI_HANDLE obj, u32_t depth, void* context,
28
    void** retval)
29
{
30
    static u32_t counter = 0;
31
    static char buff[256];
32
33
 
34
35
 
36
37
 
1500 serge 38
1498 serge 39
 
40
41
 
42
    buffer.Pointer = buff;
43
44
 
45
    if (status != AE_OK) {
46
        return AE_CTRL_TERMINATE;
47
    }
48
49
 
50
51
 
52
53
 
1500 serge 54
1498 serge 55
 
56
    {
57
        if (info->Valid & ACPI_VALID_HID)
1500 serge 58
            dbgprintf (" HID: %s", info->HardwareId.String);
59
60
 
1498 serge 61
62
 
63
    counter++;
64
65
 
66
}
67
68
 
69
{
70
    ACPI_PCI_ROUTING_TABLE *entry;
71
    char *prtptr;
72
73
 
74
    if (prt == NULL || prt->Pointer == NULL)
75
        return;
76
77
 
78
    prtptr = prt->Pointer;
79
    entry = (ACPI_PCI_ROUTING_TABLE *)prtptr;
80
    while (entry->Length != 0)
81
    {
82
83
 
84
                  (u32_t)entry->Address);
85
        dbgprintf("pin: %d  index: %d  source: %s\n",
86
                   entry->Pin,
87
                   entry->SourceIndex,
88
                   entry->Source);
89
90
 
91
        prtptr += entry->Length;
92
        entry = (ACPI_PCI_ROUTING_TABLE *)prtptr;
93
    }
94
}
95
96
 
97
 
98
{
99
    u32_t retval;
100
101
 
1500 serge 102
103
 
1498 serge 104
105
 
106
        return 0;
107
108
 
1500 serge 109
    if (ACPI_FAILURE(status)) {
110
        dbgprintf("Unable to reallocate ACPI tables\n");
111
        goto err;
112
    }
113
1498 serge 114
 
1500 serge 115
    if (status != AE_OK) {
116
          dbgprintf("AcpiInitializeSubsystem failed (%s)\n",
117
                     AcpiFormatException(status));
118
          goto err;
119
    }
120
1498 serge 121
 
1500 serge 122
    if (status != AE_OK) {
123
          dbgprintf("AcpiInitializeTables failed (%s)\n",
124
                     AcpiFormatException(status));
125
          goto err;
126
    }
127
1498 serge 128
 
1500 serge 129
    if (status != AE_OK) {
130
          dbgprintf("AcpiLoadTables failed (%s)\n",
131
                     AcpiFormatException(status));
132
          goto err;
133
    }
134
1498 serge 135
 
1500 serge 136
1498 serge 137
 
138
    if (status != AE_OK) {
139
        dbgprintf("AcpiEnableSubsystem failed (%s)\n",
140
            AcpiFormatException(status));
141
        goto err;
142
    }
143
144
 
145
    if (ACPI_FAILURE (status))
146
    {
147
        dbgprintf("AcpiInitializeObjects failed (%s)\n",
148
            AcpiFormatException(status));
149
        goto err;
150
    }
151
152
 
153
                      get_device_by_hid_callback, NULL, NULL, NULL);
154
155
 
156
157
 
158
    ACPI_HANDLE bus_handle;
159
    ACPI_HANDLE pci_root;
160
161
 
162
    dbgprintf("system bus handle %x\n", bus_handle);
163
164
 
165
166
 
167
        dbgprintf("AcpiGetHandle failed (%s)\n",
168
            AcpiFormatException(status));
169
        goto err;
170
    }
171
172
 
173
174
 
175
176
 
177
    prt_buffer.Pointer = NULL;
178
179
 
180
181
 
182
        dbgprintf("AcpiGetIrqRoutingTable failed (%s)\n",
183
            AcpiFormatException(status));
184
        goto err;
185
    }
186
187
 
188
189
 
190
 
191
    ACPI_OBJECT_LIST arg_list = { 1, &arg };
192
193
 
194
195
 
196
197
 
198
199
 
200
        dbgprintf("AcpiEvaluateObject failed (%s)\n",
201
            AcpiFormatException(status));
202
 //       goto err;
203
    }
204
205
 
206
 
207
208
 
209
        dbgprintf("AcpiGetIrqRoutingTable failed (%s)\n",
210
            AcpiFormatException(status));
211
        goto err;
212
    }
213
214
 
215
216
 
217
    dbgprintf("bus 0 device 31 function 1 pin %d\n", pin-1);
218
219
 
220
    dbgprintf("bus 0 device 31 function 2 pin %d\n", pin-1);
221
222
 
223
    dbgprintf("bus 0 device 31 function 3 pin %d\n", pin-1);
224
225
 
226
    dbgprintf("bus 0 device 31 function 4 pin %d\n", pin-1);
227
228
 
229
    dbgprintf("bus 0 device 31 function 5 pin %d\n", pin-1);
230
231
 
232
    dbgprintf("bus 0 device 31 function 6 pin %d\n", pin-1);
233
234
 
235
    dbgprintf("bus 0 device 31 function 7 pin %d\n", pin-1);
236
#endif
237
238
 
239
240
 
241
242
 
243