Lines Matching refs:res
71 acpi_lookup_irq_handler(ACPI_RESOURCE *res, void *context) in acpi_lookup_irq_handler() argument
81 switch (res->Type) { in acpi_lookup_irq_handler()
83 irqnum = res->Data.Irq.InterruptCount; in acpi_lookup_irq_handler()
85 if (res->Data.Irq.Interrupts[i] == req->irq) { in acpi_lookup_irq_handler()
91 trig = res->Data.Irq.Triggering; in acpi_lookup_irq_handler()
92 pol = res->Data.Irq.Polarity; in acpi_lookup_irq_handler()
95 irqnum = res->Data.ExtendedIrq.InterruptCount; in acpi_lookup_irq_handler()
97 if (res->Data.ExtendedIrq.Interrupts[i] == req->irq) { in acpi_lookup_irq_handler()
103 trig = res->Data.ExtendedIrq.Triggering; in acpi_lookup_irq_handler()
104 pol = res->Data.ExtendedIrq.Polarity; in acpi_lookup_irq_handler()
121 bcopy(res, req->acpi_res, len); in acpi_lookup_irq_handler()
126 acpi_lookup_irq_resource(device_t dev, int rid, struct resource *res, in acpi_lookup_irq_resource() argument
133 req.irq = rman_get_start(res); in acpi_lookup_irq_resource()
146 acpi_config_intr(device_t dev, ACPI_RESOURCE *res) in acpi_config_intr() argument
151 switch (res->Type) { in acpi_config_intr()
153 KASSERT(res->Data.Irq.InterruptCount == 1, in acpi_config_intr()
155 irq = res->Data.Irq.Interrupts[0]; in acpi_config_intr()
156 trig = res->Data.Irq.Triggering; in acpi_config_intr()
157 pol = res->Data.Irq.Polarity; in acpi_config_intr()
160 KASSERT(res->Data.ExtendedIrq.InterruptCount == 1, in acpi_config_intr()
162 irq = res->Data.ExtendedIrq.Interrupts[0]; in acpi_config_intr()
163 trig = res->Data.ExtendedIrq.Triggering; in acpi_config_intr()
164 pol = res->Data.ExtendedIrq.Polarity; in acpi_config_intr()
167 panic("%s: bad resource type %u", __func__, res->Type); in acpi_config_intr()
238 acpi_parse_resource(ACPI_RESOURCE *res, void *context) in acpi_parse_resource() argument
252 switch (res->Type) { in acpi_parse_resource()
257 if (res->Data.FixedIo.AddressLength <= 0) in acpi_parse_resource()
260 res->Data.FixedIo.Address, res->Data.FixedIo.AddressLength)); in acpi_parse_resource()
261 set->set_ioport(dev, arc->context, res->Data.FixedIo.Address, in acpi_parse_resource()
262 res->Data.FixedIo.AddressLength); in acpi_parse_resource()
265 if (res->Data.Io.AddressLength <= 0) in acpi_parse_resource()
267 if (res->Data.Io.Minimum == res->Data.Io.Maximum) { in acpi_parse_resource()
269 res->Data.Io.Minimum, res->Data.Io.AddressLength)); in acpi_parse_resource()
270 set->set_ioport(dev, arc->context, res->Data.Io.Minimum, in acpi_parse_resource()
271 res->Data.Io.AddressLength); in acpi_parse_resource()
274 res->Data.Io.Minimum, res->Data.Io.Maximum, in acpi_parse_resource()
275 res->Data.Io.AddressLength)); in acpi_parse_resource()
276 set->set_iorange(dev, arc->context, res->Data.Io.Minimum, in acpi_parse_resource()
277 res->Data.Io.Maximum, res->Data.Io.AddressLength, in acpi_parse_resource()
278 res->Data.Io.Alignment); in acpi_parse_resource()
282 if (res->Data.FixedMemory32.AddressLength <= 0) in acpi_parse_resource()
285 res->Data.FixedMemory32.Address, in acpi_parse_resource()
286 res->Data.FixedMemory32.AddressLength)); in acpi_parse_resource()
287 set->set_memory(dev, arc->context, res->Data.FixedMemory32.Address, in acpi_parse_resource()
288 res->Data.FixedMemory32.AddressLength); in acpi_parse_resource()
291 if (res->Data.Memory32.AddressLength <= 0) in acpi_parse_resource()
293 if (res->Data.Memory32.Minimum == res->Data.Memory32.Maximum) { in acpi_parse_resource()
295 res->Data.Memory32.Minimum, res->Data.Memory32.AddressLength)); in acpi_parse_resource()
296 set->set_memory(dev, arc->context, res->Data.Memory32.Minimum, in acpi_parse_resource()
297 res->Data.Memory32.AddressLength); in acpi_parse_resource()
300 res->Data.Memory32.Minimum, res->Data.Memory32.Maximum, in acpi_parse_resource()
301 res->Data.Memory32.AddressLength)); in acpi_parse_resource()
302 set->set_memoryrange(dev, arc->context, res->Data.Memory32.Minimum, in acpi_parse_resource()
303 res->Data.Memory32.Maximum, res->Data.Memory32.AddressLength, in acpi_parse_resource()
304 res->Data.Memory32.Alignment); in acpi_parse_resource()
308 if (res->Data.Memory24.AddressLength <= 0) in acpi_parse_resource()
310 if (res->Data.Memory24.Minimum == res->Data.Memory24.Maximum) { in acpi_parse_resource()
312 res->Data.Memory24.Minimum, res->Data.Memory24.AddressLength)); in acpi_parse_resource()
313 set->set_memory(dev, arc->context, res->Data.Memory24.Minimum, in acpi_parse_resource()
314 res->Data.Memory24.AddressLength); in acpi_parse_resource()
317 res->Data.Memory24.Minimum, res->Data.Memory24.Maximum, in acpi_parse_resource()
318 res->Data.Memory24.AddressLength)); in acpi_parse_resource()
319 set->set_memoryrange(dev, arc->context, res->Data.Memory24.Minimum, in acpi_parse_resource()
320 res->Data.Memory24.Maximum, res->Data.Memory24.AddressLength, in acpi_parse_resource()
321 res->Data.Memory24.Alignment); in acpi_parse_resource()
330 set->set_irq(dev, arc->context, res->Data.Irq.Interrupts, in acpi_parse_resource()
331 res->Data.Irq.InterruptCount, res->Data.Irq.Triggering, in acpi_parse_resource()
332 res->Data.Irq.Polarity); in acpi_parse_resource()
340 set->set_drq(dev, arc->context, res->Data.Dma.Channels, in acpi_parse_resource()
341 res->Data.Dma.ChannelCount); in acpi_parse_resource()
346 res->Data.StartDpf.CompatibilityPriority); in acpi_parse_resource()
356 switch (res->Type) { in acpi_parse_resource()
358 gran = res->Data.Address16.Address.Granularity; in acpi_parse_resource()
359 min = res->Data.Address16.Address.Minimum; in acpi_parse_resource()
360 max = res->Data.Address16.Address.Maximum; in acpi_parse_resource()
361 length = res->Data.Address16.Address.AddressLength; in acpi_parse_resource()
367 gran = res->Data.Address32.Address.Granularity; in acpi_parse_resource()
368 min = res->Data.Address32.Address.Minimum; in acpi_parse_resource()
369 max = res->Data.Address32.Address.Maximum; in acpi_parse_resource()
370 length = res->Data.Address32.Address.AddressLength; in acpi_parse_resource()
376 gran = res->Data.Address64.Address.Granularity; in acpi_parse_resource()
377 min = res->Data.Address64.Address.Minimum; in acpi_parse_resource()
378 max = res->Data.Address64.Address.Maximum; in acpi_parse_resource()
379 length = res->Data.Address64.Address.AddressLength; in acpi_parse_resource()
385 KASSERT(res->Type == ACPI_RESOURCE_TYPE_EXTENDED_ADDRESS64, in acpi_parse_resource()
387 gran = res->Data.ExtAddress64.Address.Granularity; in acpi_parse_resource()
388 min = res->Data.ExtAddress64.Address.Minimum; in acpi_parse_resource()
389 max = res->Data.ExtAddress64.Address.Maximum; in acpi_parse_resource()
390 length = res->Data.ExtAddress64.Address.AddressLength; in acpi_parse_resource()
399 res->Data.Address.ProducerConsumer != ACPI_CONSUMER) { in acpi_parse_resource()
402 acpi_address_range_name(res->Data.Address.ResourceType))); in acpi_parse_resource()
405 if (res->Data.Address.ResourceType != ACPI_MEMORY_RANGE && in acpi_parse_resource()
406 res->Data.Address.ResourceType != ACPI_IO_RANGE) { in acpi_parse_resource()
413 if (min > ULONG_MAX || (res->Data.Address.MaxAddressFixed && max > in acpi_parse_resource()
422 if (res->Data.Address.MinAddressFixed == ACPI_ADDRESS_FIXED && in acpi_parse_resource()
423 res->Data.Address.MaxAddressFixed == ACPI_ADDRESS_FIXED) { in acpi_parse_resource()
424 if (res->Data.Address.ResourceType == ACPI_MEMORY_RANGE) { in acpi_parse_resource()
433 } else if (res->Data.Address.MinAddressFixed != ACPI_ADDRESS_FIXED && in acpi_parse_resource()
434 res->Data.Address.MaxAddressFixed != ACPI_ADDRESS_FIXED) { in acpi_parse_resource()
443 if (res->Data.Address.ResourceType == ACPI_MEMORY_RANGE) { in acpi_parse_resource()
455 if (res->Data.Address32.ResourceType == ACPI_MEMORY_RANGE) { in acpi_parse_resource()
468 if (res->Data.ExtendedIrq.ProducerConsumer != ACPI_CONSUMER) { in acpi_parse_resource()
472 set->set_ext_irq(dev, arc->context, res->Data.ExtendedIrq.Interrupts, in acpi_parse_resource()
473 res->Data.ExtendedIrq.InterruptCount, in acpi_parse_resource()
474 res->Data.ExtendedIrq.Triggering, res->Data.ExtendedIrq.Polarity); in acpi_parse_resource()