ReactOS 0.4.17-dev-1190-g4c812f4
default_handlers.c
Go to the documentation of this file.
6#include <uacpi/internal/io.h>
7#include <uacpi/kernel_api.h>
8#include <uacpi/uacpi.h>
9#include <uacpi/osi.h>
10
11#ifndef UACPI_BAREBONES_MODE
12
13#define PCI_ROOT_PNP_ID "PNP0A03"
14#define PCI_EXPRESS_ROOT_PNP_ID "PNP0A08"
15
16#define PCI_HEADER_SIZE 0x40
17#define PCI_HEADER_TYPE_REG 0x0E
18#define PCI_HEADER_TYPE_MASK 0x7F
19#define PCI_HEADER_TYPE_NORMAL 0x00
20#define PCI_HEADER_TYPE_PCI_BRIDGE 0x01
21#define PCI_HEADER_TYPE_CARDBUS_BRIDGE 0x02
22#define PCI_HEADER_TYPE_NO_DEVICE 0xFF
23#define PCI_SECONDARY_BUS_REG 0x19
24#define PCI_SUBSYSTEM_VENDOR_ID_REG 0x2C
25#define PCI_EXPANSION_ROM_REG 0x30
26#define PCI_INTERRUPT_LINE_REG 0x3C
27
29{
30 static const uacpi_char *pci_root_ids[] = {
34 };
36
37 while (parent != uacpi_namespace_root()) {
38 if (uacpi_device_matches_pnp_id(parent, pci_root_ids)) {
40 "found a PCI root node %.4s controlling region %.4s",
41 parent->name.text, node->name.text
42 );
43 return parent;
44 }
45
46 parent = parent->parent;
47 }
48
50 node, "unable to find PCI root controlling",
52 );
53 return node;
54}
55
61};
62
63// One of the PCI devices found on the way from the root to a region
67
68 // Only valid if is_open is set
72};
73
75 // The device the region was declared in, only used for logging
77
78 // Segment & bus of the PCI root
80
81 /*
82 * Everything between the PCI root and the region that might be a PCI
83 * device, top-down. This is the root itself if there's nothing else, or
84 * nothing at all if the root has no _ADR.
85 */
88
89 // The outcome of the last access
92};
93
95 // There's no device at this address
97
100
101 // A bridge that has no secondary bus assigned
103};
104
106 const uacpi_pci_address *lhs, const uacpi_pci_address *rhs
107)
108{
109 return lhs->segment == rhs->segment && lhs->bus == rhs->bus &&
110 lhs->device == rhs->device && lhs->function == rhs->function;
111}
112
114{
115 if (!dev->is_open)
116 return;
117
119 dev->is_open = UACPI_FALSE;
120}
121
122// The handle is kept around for as long as the device stays where it was
125)
126{
128
129 if (dev->is_open) {
130 if (pci_address_equal(&dev->address, address))
131 return UACPI_TRUE;
132
134 }
135
137 if (ret != UACPI_STATUS_OK)
138 return UACPI_FALSE;
139
140 dev->address = *address;
141 dev->is_open = UACPI_TRUE;
142 return UACPI_TRUE;
143}
144
145// The secondary bus is only returned for PCI_DEVICE_KIND_BRIDGE
148 uacpi_u8 *out_secondary_bus
149)
150{
152 uacpi_u8 header_type;
153
156
158 dev->handle, PCI_HEADER_TYPE_REG, &header_type
159 );
160 if (ret != UACPI_STATUS_OK || header_type == PCI_HEADER_TYPE_NO_DEVICE)
162
163 switch (header_type & PCI_HEADER_TYPE_MASK) {
166 break;
167 default:
169 }
170
172 dev->handle, PCI_SECONDARY_BUS_REG, out_secondary_bus
173 );
174 if (ret != UACPI_STATUS_OK || *out_secondary_bus == 0)
176
178}
179
181{
182 switch (state) {
184 return "detected";
186 return "is not present or powered off";
187 default:
188 return "is unreachable due to a missing or unconfigured bridge";
189 }
190}
191
192/*
193 * Figure out the PCI device that a region belongs to at the moment, and open
194 * it.
195 *
196 * A device is only a PCI device if it has an _ADR, and its direct parent is
197 * either the PCI root or a PCI device that is a bridge, in which case it lives
198 * on the secondary bus of that bridge. This means that e.g. a USB port below
199 * an XHCI controller is not a PCI device even though it does have an _ADR.
200 * The region then belongs to the closest PCI device at or above the device it
201 * was declared in, or to the root itself if there's none.
202 *
203 * The namespace side of this never changes, so it's only looked at once when
204 * the region is attached. The bus numbers on the other hand can change at any
205 * time since they're host writable, which is why those are read for every
206 * access.
207 *
208 * Returns the device that the access must be forwarded to, or NULL if there's
209 * no such device at the moment.
210 */
212{
213 struct pci_region_device *dev;
214 uacpi_pci_address address = ctx->root_address;
216 enum pci_device_kind kind;
218 uacpi_u8 bus;
219
220 // The region doesn't belong to any device, see pci_region_find_devices()
221 if (ctx->num_devices == 0)
222 return UACPI_NULL;
223
224 for (i = 0;; ++i) {
225 dev = &ctx->devices[i];
226
227 address.device = dev->device;
228 address.function = dev->function;
229
230 // Nothing below us, so this is the one
231 if ((i + 1) == ctx->num_devices)
232 break;
233
234 kind = pci_region_device_probe(dev, &address, &bus);
235 if (kind == PCI_DEVICE_KIND_BRIDGE) {
236 address.bus = bus;
237 continue;
238 }
239
240 // Whatever is below a normal device belongs to it, so we're done
241 if (kind != PCI_DEVICE_KIND_NORMAL)
243 break;
244 }
245
246 // Whatever is below the device we stopped at is of no use anymore
247 while (++i < ctx->num_devices)
248 pci_region_device_close(&ctx->devices[i]);
249
253
254 if (state != ctx->state || !pci_address_equal(&address, &ctx->address)) {
256 "PCI device %.4s %s at %04X:%02X:%02X:%01X", ctx->node->name.text,
258 address.device, address.function
259 );
260
261 ctx->address = address;
262 ctx->state = state;
263 }
264
266}
267
269{
271
272 for (i = 0; i < ctx->num_devices; ++i)
273 pci_region_device_close(&ctx->devices[i]);
274
275 if (ctx->devices != UACPI_NULL)
276 uacpi_free(ctx->devices, ctx->num_devices * sizeof(*ctx->devices));
277
278 uacpi_free(ctx, sizeof(*ctx));
279}
280
281/*
282 * Collect the devices below 'pci_root' that lead to 'device' for as long as
283 * they have an _ADR, see pci_region_resolve() for why. If 'out' is NULL the
284 * devices are only counted.
285 */
288 struct pci_region_device *out
289)
290{
292 uacpi_size depth = 0, count = 0, i;
295 uacpi_u64 adr;
296
297 for (node = device; node != UACPI_NULL && node != pci_root;
298 node = node->parent)
299 depth++;
300
301 // There's no root above the device, the best we can do is use its _ADR
302 if (node == UACPI_NULL)
303 depth = 1;
304
305 while (depth-- != 0) {
306 node = device;
307 for (i = 0; i < depth; ++i)
308 node = node->parent;
309
312 break;
313
314 ret = uacpi_eval_simple_integer(node, "_ADR", &adr);
315 if (ret != UACPI_STATUS_OK)
316 break;
317
318 if (out != UACPI_NULL) {
319 out[count].function = (adr >> 0) & 0xFF;
320 out[count].device = (adr >> 16) & 0xFF;
321 }
322 count++;
323 }
324
325 return count;
326}
327
329 struct pci_region_ctx *ctx, uacpi_namespace_node *pci_root,
331)
332{
336 uacpi_u64 adr;
337
339 if (count != 0) {
343
344 ctx->devices = devices;
345 ctx->num_devices = pci_region_collect_devices(
346 pci_root, device, devices
347 );
348 return UACPI_STATUS_OK;
349 }
350
351 ret = uacpi_eval_simple_integer(pci_root, "_ADR", &adr);
352 if (ret != UACPI_STATUS_OK) {
354 "unable to determine the PCI address of %.4s",
355 device->name.text
356 );
357 return UACPI_STATUS_OK;
358 }
359
363
364 devices->function = (adr >> 0) & 0xFF;
365 devices->device = (adr >> 16) & 0xFF;
366
367 ctx->devices = devices;
368 ctx->num_devices = 1;
369 return UACPI_STATUS_OK;
370}
371
373{
374 uacpi_namespace_node *node, *pci_root, *device;
375 struct pci_region_ctx *ctx;
378
379 node = data->region_node;
380 pci_root = find_pci_root(node);
381
382 /*
383 * Find the actual device object that is supposed to be controlling
384 * this operation region.
385 */
386 device = node;
387 while (device) {
389
392 return ret;
393
395 break;
396
397 device = device->parent;
398 }
399
403 node, "unable to find device responsible for", ret
404 );
405 return ret;
406 }
407
411
412 ctx->node = device;
413
414 ret = uacpi_eval_simple_integer(pci_root, "_SEG", &value);
415 if (ret == UACPI_STATUS_OK)
416 ctx->root_address.segment = value;
417
418 ret = uacpi_eval_simple_integer(pci_root, "_BBN", &value);
419 if (ret == UACPI_STATUS_OK)
420 ctx->root_address.bus = value;
421
424 uacpi_free(ctx, sizeof(*ctx));
425 return ret;
426 }
427
428 data->out_region_context = ctx;
429 return UACPI_STATUS_OK;
430}
431
433{
434 pci_region_ctx_free(data->region_context);
435 return UACPI_STATUS_OK;
436}
437
438// We intentionally only check the first port of an access, same as NT
441)
442{
444 uacpi_u8 header_type;
445
446 if (offset >= PCI_HEADER_SIZE)
447 return UACPI_FALSE;
448
450 return UACPI_TRUE;
452 return UACPI_TRUE;
453
455 dev->handle, PCI_HEADER_TYPE_REG, &header_type
456 );
458 return UACPI_TRUE;
459
460 return (header_type & PCI_HEADER_TYPE_MASK) != PCI_HEADER_TYPE_NORMAL;
461}
462
465)
466{
469 struct pci_region_device *dev;
470
471 offset = data->offset;
472 width = data->byte_width;
473
474 dev = pci_region_resolve(data->region_context);
475 if (dev == UACPI_NULL) {
477 "faking a PCI device %s access",
478 op == UACPI_REGION_OP_READ ? "read" : "write"
479 );
480
481 if (op == UACPI_REGION_OP_READ) {
482 static uacpi_u64 ffs = 0xFFFFFFFFFFFFFFFF;
483 uacpi_memcpy(&data->value, &ffs, width);
484 }
485
486 return UACPI_STATUS_OK;
487 }
488
490 return uacpi_pci_read(dev->handle, offset, width, &data->value);
491
494 "denied AML write access to protected offset 0x%02zX of PCI "
495 "device %04X:%02X:%02X:%01X", offset, dev->address.segment,
496 dev->address.bus, dev->address.device, dev->address.function
497 );
498 return UACPI_STATUS_OK;
499 }
500
501 return uacpi_pci_write(dev->handle, offset, width, data->value);
502}
503
505{
506 switch (op) {
508 return pci_region_attach(op_data);
510 return pci_region_detach(op_data);
513 return pci_region_do_rw(op, op_data);
514 default:
516 }
517}
518
523};
524
526{
527 struct memory_region_ctx *ctx;
529
530 ctx = uacpi_kernel_alloc(sizeof(*ctx));
531 if (ctx == UACPI_NULL)
533
534 ctx->size = data->generic_info.length;
535
536 // FIXME: this really shouldn't try to map everything at once
537 ctx->phys = data->generic_info.base;
538 ctx->virt = uacpi_kernel_map(ctx->phys, ctx->size);
539
540 if (uacpi_unlikely(ctx->virt == UACPI_MAP_FAILED)) {
542 uacpi_trace_region_error(data->region_node, "unable to map", ret);
543 uacpi_free(ctx, sizeof(*ctx));
544 goto out;
545 }
546
547 data->out_region_context = ctx;
548out:
549 return ret;
550}
551
553{
554 struct memory_region_ctx *ctx = data->region_context;
555
556 uacpi_kernel_unmap(ctx->virt, ctx->size);
557 uacpi_free(ctx, sizeof(*ctx));
558 return UACPI_STATUS_OK;
559}
560
564};
565
567{
568 struct io_region_ctx *ctx;
569 uacpi_generic_region_info *info = &data->generic_info;
571
572 ctx = uacpi_kernel_alloc(sizeof(*ctx));
573 if (ctx == UACPI_NULL)
575
576 ctx->base = info->base;
577
578 ret = uacpi_kernel_io_map(ctx->base, info->length, &ctx->handle);
581 data->region_node, "unable to map an IO", ret
582 );
583 uacpi_free(ctx, sizeof(*ctx));
584 return ret;
585 }
586
587 data->out_region_context = ctx;
588 return ret;
589}
590
592{
593 struct io_region_ctx *ctx = data->region_context;
594
595 uacpi_kernel_io_unmap(ctx->handle);
596 uacpi_free(ctx, sizeof(*ctx));
597 return UACPI_STATUS_OK;
598}
599
602)
603{
604 struct memory_region_ctx *ctx = data->region_context;
606
607 offset = data->address - ctx->phys;
608
609 return op == UACPI_REGION_OP_READ ?
610 uacpi_system_memory_read(ctx->virt, offset, data->byte_width, &data->value) :
611 uacpi_system_memory_write(ctx->virt, offset, data->byte_width, data->value);
612}
613
615{
616 switch (op) {
618 return memory_region_attach(op_data);
620 return memory_region_detach(op_data);
623 return memory_region_do_rw(op, op_data);
624 default:
626 }
627}
628
631)
632{
634
635 return op == UACPI_REGION_OP_READ ?
636 uacpi_system_memory_read(addr, 0, data->byte_width, &data->value) :
637 uacpi_system_memory_write(addr, 0, data->byte_width, data->value);
638}
639
641{
642 switch (op) {
645 return UACPI_STATUS_OK;
648 return table_data_region_do_rw(op, op_data);
649 default:
651 }
652}
653
656
657 // Only after AML has queried _OSI for Windows XP or anything newer
659};
660
665};
666
667/*
668 * Ports that AML can't touch. These ranges match the NT ACPI driver 1:1,
669 * verified via a traced QEMU run with injected AML. Access to these returns
670 * 0 on reads and writes are simply dropped.
671 */
673 // DMA
674 { 0x0000, 0x000F, IO_PROTECTION_KIND_XP_AND_ABOVE },
675 // PIC
676 { 0x0020, 0x0021, IO_PROTECTION_KIND_ALWAYS },
677 // PIT
678 { 0x0040, 0x0043, IO_PROTECTION_KIND_XP_AND_ABOVE },
679 // PIT (EISA)
680 { 0x0048, 0x004B, IO_PROTECTION_KIND_XP_AND_ABOVE },
681 // RTC/CMOS
682 { 0x0070, 0x0071, IO_PROTECTION_KIND_XP_AND_ABOVE },
683 // Extended CMOS
684 { 0x0074, 0x0076, IO_PROTECTION_KIND_XP_AND_ABOVE },
685 // DMA page registers
686 { 0x0081, 0x0083, IO_PROTECTION_KIND_XP_AND_ABOVE },
687 { 0x0087, 0x0087, IO_PROTECTION_KIND_XP_AND_ABOVE },
688 { 0x0089, 0x008B, IO_PROTECTION_KIND_XP_AND_ABOVE },
689 { 0x008F, 0x008F, IO_PROTECTION_KIND_XP_AND_ABOVE },
690 // Arbitration control
691 { 0x0090, 0x0091, IO_PROTECTION_KIND_XP_AND_ABOVE },
692 // System board setup
693 { 0x0093, 0x0094, IO_PROTECTION_KIND_XP_AND_ABOVE },
694 // POS channel select
695 { 0x0096, 0x0097, IO_PROTECTION_KIND_XP_AND_ABOVE },
696 // Cascaded PIC
697 { 0x00A0, 0x00A1, IO_PROTECTION_KIND_ALWAYS },
698 // ISA DMA
699 { 0x00C0, 0x00DF, IO_PROTECTION_KIND_XP_AND_ABOVE },
700 // ELCR
701 { 0x04D0, 0x04D1, IO_PROTECTION_KIND_ALWAYS },
702 /*
703 * PCI configuration mechanism #1. NT emulates this one via its own PCI
704 * accessors until Windows XP is queried. We can't afford that because
705 * we could race against the host kernel PCI configuration accesses, and
706 * rolling emulation on top of the kernel API for PCI doesn't seem worth it
707 * as this doesn't seem to be actualy used by AML from inspecting real
708 * hardware AML dumps.
709 */
710 { 0x0CF8, 0x0CFF, IO_PROTECTION_KIND_ALWAYS },
711};
712
713// We intentionally only check the first port of an access, same as NT
715{
716 const struct protected_io_range *range;
718
719 for (i = 0; i < UACPI_ARRAY_SIZE(protected_io_ranges); ++i) {
721
722 if (port < range->first || port > range->last)
723 continue;
724 if (range->kind == IO_PROTECTION_KIND_ALWAYS)
725 return UACPI_TRUE;
726
729 }
730
731 return UACPI_FALSE;
732}
733
736)
737{
738 struct io_region_ctx *ctx = data->region_context;
741
742 offset = data->offset - ctx->base;
743 width = data->byte_width;
744
745 if (io_port_is_protected(data->offset)) {
747 "denied AML %s access to protected port 0x%04"UACPI_PRIX64,
748 op == UACPI_REGION_OP_READ ? "read" : "write",
749 UACPI_FMT64(data->offset)
750 );
751
753 data->value = 0;
754
755 return UACPI_STATUS_OK;
756 }
757
758 return op == UACPI_REGION_OP_READ ?
759 uacpi_system_io_read(ctx->handle, offset, width, &data->value) :
760 uacpi_system_io_write(ctx->handle, offset, width, data->value);
761}
762
764{
765 switch (op) {
767 return io_region_attach(op_data);
769 return io_region_detach(op_data);
772 return io_region_do_rw(op, op_data);
773 default:
775 }
776}
777
779{
781
783
788 );
789
794 );
795
800 );
801
806 );
807}
808
809#endif // !UACPI_BAREBONES_MODE
static int state
Definition: maze.c:121
struct _root root
range
Definition: d3dx9_private.h:58
static uacpi_status pci_region_find_devices(struct pci_region_ctx *ctx, uacpi_namespace_node *pci_root, uacpi_namespace_node *device)
pci_device_kind
@ PCI_DEVICE_KIND_BRIDGE
@ PCI_DEVICE_KIND_NORMAL
@ PCI_DEVICE_KIND_NONE
@ PCI_DEVICE_KIND_UNCONFIGURED_BRIDGE
static uacpi_status handle_table_data_region(uacpi_region_op op, uacpi_handle op_data)
static uacpi_status io_region_detach(uacpi_region_detach_data *data)
#define PCI_EXPRESS_ROOT_PNP_ID
static uacpi_status pci_region_do_rw(uacpi_region_op op, uacpi_region_rw_data *data)
#define PCI_HEADER_TYPE_CARDBUS_BRIDGE
static uacpi_status io_region_attach(uacpi_region_attach_data *data)
static uacpi_bool io_port_is_protected(uacpi_u64 port)
static uacpi_status handle_io_region(uacpi_region_op op, uacpi_handle op_data)
static uacpi_bool pci_address_equal(const uacpi_pci_address *lhs, const uacpi_pci_address *rhs)
#define PCI_ROOT_PNP_ID
static uacpi_status pci_region_detach(uacpi_region_detach_data *data)
static void pci_region_ctx_free(struct pci_region_ctx *ctx)
#define PCI_HEADER_TYPE_NO_DEVICE
static uacpi_namespace_node * find_pci_root(uacpi_namespace_node *node)
static uacpi_bool pci_region_device_open(struct pci_region_device *dev, const uacpi_pci_address *address)
void uacpi_install_default_address_space_handlers(void)
static const uacpi_char * pci_region_state_to_string(uacpi_u8 state)
#define PCI_INTERRUPT_LINE_REG
#define PCI_HEADER_TYPE_PCI_BRIDGE
io_protection_kind
@ IO_PROTECTION_KIND_ALWAYS
@ IO_PROTECTION_KIND_XP_AND_ABOVE
static uacpi_size pci_region_collect_devices(uacpi_namespace_node *pci_root, uacpi_namespace_node *device, struct pci_region_device *out)
static uacpi_status memory_region_do_rw(uacpi_region_op op, uacpi_region_rw_data *data)
#define PCI_HEADER_SIZE
static uacpi_status handle_memory_region(uacpi_region_op op, uacpi_handle op_data)
#define PCI_EXPANSION_ROM_REG
static uacpi_bool pci_write_is_protected(struct pci_region_device *dev, uacpi_size offset)
#define PCI_HEADER_TYPE_MASK
#define PCI_HEADER_TYPE_NORMAL
static struct pci_region_device * pci_region_resolve(struct pci_region_ctx *ctx)
#define PCI_HEADER_TYPE_REG
#define PCI_SECONDARY_BUS_REG
static void pci_region_device_close(struct pci_region_device *dev)
static uacpi_status io_region_do_rw(uacpi_region_op op, uacpi_region_rw_data *data)
static uacpi_status handle_pci_region(uacpi_region_op op, uacpi_handle op_data)
pci_region_state
@ PCI_REGION_STATE_UNKNOWN
@ PCI_REGION_STATE_NOT_FOUND
@ PCI_REGION_STATE_UNREACHABLE
@ PCI_REGION_STATE_OPEN
static const struct protected_io_range protected_io_ranges[]
#define PCI_SUBSYSTEM_VENDOR_ID_REG
static uacpi_status memory_region_attach(uacpi_region_attach_data *data)
static enum pci_device_kind pci_region_device_probe(struct pci_region_device *dev, const uacpi_pci_address *address, uacpi_u8 *out_secondary_bus)
static uacpi_status table_data_region_do_rw(uacpi_region_op op, uacpi_region_rw_data *data)
static uacpi_status memory_region_detach(uacpi_region_detach_data *data)
static uacpi_status pci_region_attach(uacpi_region_attach_data *data)
UINT op
Definition: effect.c:235
USHORT port
Definition: uri.c:210
#define UACPI_ARRAY_SIZE(arr)
Definition: helpers.h:5
uacpi_status uacpi_pci_write(uacpi_handle handle, uacpi_size offset, uacpi_u8 width, uacpi_u64 in)
Definition: io.c:1282
uacpi_status uacpi_pci_read(uacpi_handle handle, uacpi_size offset, uacpi_u8 width, uacpi_u64 *out)
Definition: io.c:1250
uacpi_status uacpi_system_io_write(uacpi_handle handle, uacpi_size offset, uacpi_u8 width, uacpi_u64 in)
Definition: io.c:1223
uacpi_status uacpi_system_memory_read(void *ptr, uacpi_size offset, uacpi_u8 width, uacpi_u64 *out)
Definition: io.c:1132
uacpi_status uacpi_system_io_read(uacpi_handle handle, uacpi_size offset, uacpi_u8 width, uacpi_u64 *out)
Definition: io.c:1191
uacpi_status uacpi_system_memory_write(void *ptr, uacpi_size offset, uacpi_u8 width, uacpi_u64 in)
Definition: io.c:1158
#define uacpi_trace(...)
Definition: log.h:33
#define uacpi_kernel_alloc_zeroed
Definition: stdlib.h:127
#define uacpi_memcpy
Definition: stdlib.h:34
#define uacpi_free(mem, _)
Definition: stdlib.h:96
#define UACPI_ADDRESS_SPACE_HANDLER_DEFAULT
Definition: types.h:73
uacpi_status uacpi_namespace_node_type(const uacpi_namespace_node *node, uacpi_object_type *out_type)
Definition: namespace.c:781
uacpi_namespace_node * uacpi_namespace_root(void)
Definition: namespace.c:264
#define uacpi_unlikely(expr)
Definition: compiler.h:88
#define UACPI_PRIX64
Definition: types.h:61
size_t uacpi_size
Definition: types.h:37
bool uacpi_bool
Definition: types.h:31
#define UACPI_FALSE
Definition: types.h:30
uint64_t uacpi_u64
Definition: types.h:22
char uacpi_char
Definition: types.h:44
uint16_t uacpi_u16
Definition: types.h:20
#define UACPI_NULL
Definition: types.h:33
uint8_t uacpi_u8
Definition: types.h:19
#define UACPI_FMT64(val)
Definition: types.h:62
uacpi_uintptr uacpi_virt_addr
Definition: types.h:36
#define UACPI_TRUE
Definition: types.h:29
#define uacpi_unlikely_error(expr)
Definition: status.h:50
uacpi_status
Definition: status.h:10
@ UACPI_STATUS_INVALID_ARGUMENT
Definition: status.h:18
@ UACPI_STATUS_NOT_FOUND
Definition: status.h:17
@ UACPI_STATUS_OUT_OF_MEMORY
Definition: status.h:13
@ UACPI_STATUS_MAPPING_FAILED
Definition: status.h:12
@ UACPI_STATUS_OK
Definition: status.h:11
uacpi_u64 uacpi_io_addr
Definition: types.h:18
uacpi_u64 uacpi_phys_addr
Definition: types.h:17
uacpi_object_type
Definition: types.h:110
@ UACPI_OBJECT_DEVICE
Definition: types.h:117
uacpi_region_op
Definition: types.h:373
@ UACPI_REGION_OP_DETACH
Definition: types.h:377
@ UACPI_REGION_OP_WRITE
Definition: types.h:381
@ UACPI_REGION_OP_READ
Definition: types.h:380
@ UACPI_REGION_OP_ATTACH
Definition: types.h:375
@ UACPI_ADDRESS_SPACE_SYSTEM_MEMORY
Definition: types.h:43
@ UACPI_ADDRESS_SPACE_PCI_CONFIG
Definition: types.h:45
@ UACPI_ADDRESS_SPACE_TABLE_DATA
Definition: types.h:58
@ UACPI_ADDRESS_SPACE_SYSTEM_IO
Definition: types.h:44
return ret
Definition: mutex.c:147
r parent
Definition: btrfs.c:3010
static struct all_devices * devices
Definition: dsm_ctrl.c:48
GLint GLint GLsizei GLsizei GLsizei depth
Definition: gl.h:1546
GLuint GLuint GLsizei count
Definition: gl.h:1545
GLuint GLuint GLsizei GLenum type
Definition: gl.h:1545
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
Definition: gl.h:1950
GLint GLint GLsizei width
Definition: gl.h:1546
GLuint address
Definition: glext.h:9393
GLintptr offset
Definition: glext.h:5920
const GLint * first
Definition: glext.h:5794
GLenum const GLvoid * addr
Definition: glext.h:9621
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
uacpi_status uacpi_install_address_space_handler_with_flags(uacpi_namespace_node *device_node, enum uacpi_address_space space, uacpi_region_handler handler, uacpi_handle handler_context, uacpi_u16 flags)
Definition: opregion.c:882
void uacpi_trace_region_error(uacpi_namespace_node *node, uacpi_char *message, uacpi_status ret)
Definition: opregion.c:25
#define UACPI_VIRT_ADDR_TO_PTR(vaddr)
Definition: utilities.h:21
uacpi_status uacpi_kernel_io_map(uacpi_io_addr base, uacpi_size len, uacpi_handle *out_handle)
Definition: uacpiosl.c:165
void uacpi_kernel_pci_device_close(uacpi_handle)
Definition: uacpiosl.c:251
uacpi_status uacpi_kernel_pci_read8(uacpi_handle device, uacpi_size offset, uacpi_u8 *value)
Definition: uacpiosl.c:257
void * uacpi_kernel_alloc(uacpi_size size)
Definition: uacpiosl.c:111
#define UACPI_MAP_FAILED
Definition: kernel_api.h:13
uacpi_status uacpi_kernel_pci_device_open(uacpi_pci_address address, uacpi_handle *out_handle)
Definition: uacpiosl.c:242
void uacpi_kernel_unmap(void *addr, uacpi_size len)
Definition: uacpiosl.c:198
void * uacpi_kernel_map(uacpi_phys_addr addr, uacpi_size len)
Definition: uacpiosl.c:191
void uacpi_kernel_io_unmap(uacpi_handle handle)
Definition: uacpiosl.c:171
uacpi_vendor_interface uacpi_latest_queried_vendor_interface(void)
Definition: osi.c:136
@ UACPI_VENDOR_INTERFACE_WINDOWS_XP
Definition: osi.h:15
#define ffs
Definition: port.h:360
Definition: devices.h:37
uacpi_io_addr base
uacpi_handle handle
uacpi_phys_addr phys
uacpi_pci_address root_address
uacpi_namespace_node * node
uacpi_pci_address address
uacpi_size num_devices
struct pci_region_device * devices
uacpi_pci_address address
uacpi_handle handle
uacpi_u8 device
Definition: types.h:90
uacpi_u8 bus
Definition: types.h:89
uacpi_u8 function
Definition: types.h:91
uacpi_u16 segment
Definition: types.h:88
uacpi_status uacpi_eval_simple_integer(uacpi_namespace_node *parent, const uacpi_char *path, uacpi_u64 *out_value)
Definition: uacpi.c:924
Definition: dlist.c:348
Definition: pdh_main.c:64
uacpi_bool uacpi_device_matches_pnp_id(uacpi_namespace_node *node, const uacpi_char *const *list)
Definition: utilities.c:905
wchar_t tm const _CrtWcstime_Writes_and_advances_ptr_ count wchar_t ** out
Definition: wcsftime.cpp:383