/*******************************************************************************
*
* Module Name: rsdump - Functions to display the resource structures.
*
******************************************************************************/
/*
* Copyright (C) 2000 - 2005, R. Byron Moore
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions, and the following disclaimer,
* without modification.
* 2. Redistributions in binary form must reproduce at minimum a disclaimer
* substantially similar to the "NO WARRANTY" disclaimer below
* ("Disclaimer") and any redistribution must be conditioned upon
* including a substantially similar Disclaimer requirement for further
* binary redistribution.
* 3. Neither the names of the above-listed copyright holders nor the names
* of any contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* Alternatively, this software may be distributed under the terms of the
* GNU General Public License ("GPL") version 2 as published by the Free
* Software Foundation.
*
* NO WARRANTY
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
* STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
* IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGES.
*/
#include <acpi/acpi.h>
#include <acpi/acresrc.h>
#define _COMPONENT ACPI_RESOURCES
ACPI_MODULE_NAME ("rsdump")
#if defined(ACPI_DEBUG_OUTPUT) || defined(ACPI_DEBUGGER)
/*******************************************************************************
*
* FUNCTION: acpi_rs_dump_irq
*
* PARAMETERS: Data - pointer to the resource structure to dump.
*
* RETURN: None
*
* DESCRIPTION: Prints out the various members of the Data structure type.
*
******************************************************************************/
void
acpi_rs_dump_irq (
union acpi_resource_data *data)
{
struct acpi_resource_irq *irq_data = (struct acpi_resource_irq *) data;
u8 index = 0;
ACPI_FUNCTION_ENTRY ();
acpi_os_printf ("IRQ Resource\n");
acpi_os_printf (" %s Triggered\n",
ACPI_LEVEL_SENSITIVE == irq_data->edge_level ? "Level" : "Edge");
acpi_os_printf (" Active %s\n",
ACPI_ACTIVE_LOW == irq_data->active_high_low ? "Low" : "High");
acpi_os_printf (" %s\n",
ACPI_SHARED == irq_data->shared_exclusive ? "Shared" : "Exclusive");
acpi_os_printf (" %X Interrupts ( ", irq_data->number_of_interrupts);
for (index = 0; index < irq_data->number_of_interrupts; index++) {
acpi_os_printf ("%X ", irq_data->interrupts[index]);
}
acpi_os_printf (")\n");
return;
}
/*******************************************************************************
*
* FUNCTION: acpi_rs_dump_dma
*
* PARAMETERS: Data - pointer to the resource structure to dump.
*
* RETURN: None
*
* DESCRIPTION: Prints out the various members of the Data structure type.
*
******************************************************************************/
void
acpi_rs_dump_dma (
union acpi_resource_data *data)
{
struct acpi_resource_dma *dma_data = (struct acpi_resource_dma *) data;
u8 index = 0;
ACPI_FUNCTION_ENTRY ();
acpi_os_printf ("DMA Resource\n");
switch (dma_data->type) {
case ACPI_COMPATIBILITY:
acpi_os_printf (" Compatibility mode\n");
break;
case ACPI_TYPE_A:
acpi_os_printf (" Type A\n");
break;
case ACPI_TYPE_B:
acpi_os_printf (" Type B\n");
break;
case ACPI_TYPE_F:
acpi_os_printf (" Type F\n");
break;
default:
acpi_os_printf (" Invalid DMA type\n");
break;
}
acpi_os_printf (" %sBus Master\n",
ACPI_BUS_MASTER == dma_data->bus_master ? "" : "Not a ");
switch (dma_data->transfer) {
case ACPI_TRANSFER_8:
acpi_os_printf (" 8-bit only transfer\n");
break;
case ACPI_TRANSFER_8_16:
acpi_os_printf (" 8 and 16-bit transfer\n");
break;
case ACPI_TRANSFER_16:
acpi_os_printf (" 16 bit only transfer\n");
break;
default:
acpi_os_printf (" Invalid transfer preference\n");
break;
}
acpi_os_printf (" Number of Channels: %X ( ", dma_data->number_of_channels