ReactOS Fundraising Campaign 2012
 
€ 4,410 / € 30,000

Information | Donate

Home | Info | Community | Development | myReactOS | Contact Us

  1. Home
  2. Community
  3. Development
  4. myReactOS
  5. Fundraiser 2012

  1. Main Page
  2. Alphabetical List
  3. Data Structures
  4. Directories
  5. File List
  6. Data Fields
  7. Globals
  8. Related Pages

ReactOS Development > Doxygen

rsirq.c
Go to the documentation of this file.
00001 /*******************************************************************************
00002  *
00003  * Module Name: rsirq - IRQ resource descriptors
00004  *
00005  ******************************************************************************/
00006 
00007 /******************************************************************************
00008  *
00009  * 1. Copyright Notice
00010  *
00011  * Some or all of this work - Copyright (c) 1999 - 2011, Intel Corp.
00012  * All rights reserved.
00013  *
00014  * 2. License
00015  *
00016  * 2.1. This is your license from Intel Corp. under its intellectual property
00017  * rights.  You may have additional license terms from the party that provided
00018  * you this software, covering your right to use that party's intellectual
00019  * property rights.
00020  *
00021  * 2.2. Intel grants, free of charge, to any person ("Licensee") obtaining a
00022  * copy of the source code appearing in this file ("Covered Code") an
00023  * irrevocable, perpetual, worldwide license under Intel's copyrights in the
00024  * base code distributed originally by Intel ("Original Intel Code") to copy,
00025  * make derivatives, distribute, use and display any portion of the Covered
00026  * Code in any form, with the right to sublicense such rights; and
00027  *
00028  * 2.3. Intel grants Licensee a non-exclusive and non-transferable patent
00029  * license (with the right to sublicense), under only those claims of Intel
00030  * patents that are infringed by the Original Intel Code, to make, use, sell,
00031  * offer to sell, and import the Covered Code and derivative works thereof
00032  * solely to the minimum extent necessary to exercise the above copyright
00033  * license, and in no event shall the patent license extend to any additions
00034  * to or modifications of the Original Intel Code.  No other license or right
00035  * is granted directly or by implication, estoppel or otherwise;
00036  *
00037  * The above copyright and patent license is granted only if the following
00038  * conditions are met:
00039  *
00040  * 3. Conditions
00041  *
00042  * 3.1. Redistribution of Source with Rights to Further Distribute Source.
00043  * Redistribution of source code of any substantial portion of the Covered
00044  * Code or modification with rights to further distribute source must include
00045  * the above Copyright Notice, the above License, this list of Conditions,
00046  * and the following Disclaimer and Export Compliance provision.  In addition,
00047  * Licensee must cause all Covered Code to which Licensee contributes to
00048  * contain a file documenting the changes Licensee made to create that Covered
00049  * Code and the date of any change.  Licensee must include in that file the
00050  * documentation of any changes made by any predecessor Licensee.  Licensee
00051  * must include a prominent statement that the modification is derived,
00052  * directly or indirectly, from Original Intel Code.
00053  *
00054  * 3.2. Redistribution of Source with no Rights to Further Distribute Source.
00055  * Redistribution of source code of any substantial portion of the Covered
00056  * Code or modification without rights to further distribute source must
00057  * include the following Disclaimer and Export Compliance provision in the
00058  * documentation and/or other materials provided with distribution.  In
00059  * addition, Licensee may not authorize further sublicense of source of any
00060  * portion of the Covered Code, and must include terms to the effect that the
00061  * license from Licensee to its licensee is limited to the intellectual
00062  * property embodied in the software Licensee provides to its licensee, and
00063  * not to intellectual property embodied in modifications its licensee may
00064  * make.
00065  *
00066  * 3.3. Redistribution of Executable. Redistribution in executable form of any
00067  * substantial portion of the Covered Code or modification must reproduce the
00068  * above Copyright Notice, and the following Disclaimer and Export Compliance
00069  * provision in the documentation and/or other materials provided with the
00070  * distribution.
00071  *
00072  * 3.4. Intel retains all right, title, and interest in and to the Original
00073  * Intel Code.
00074  *
00075  * 3.5. Neither the name Intel nor any other trademark owned or controlled by
00076  * Intel shall be used in advertising or otherwise to promote the sale, use or
00077  * other dealings in products derived from or relating to the Covered Code
00078  * without prior written authorization from Intel.
00079  *
00080  * 4. Disclaimer and Export Compliance
00081  *
00082  * 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED
00083  * HERE.  ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE
00084  * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT,  ASSISTANCE,
00085  * INSTALLATION, TRAINING OR OTHER SERVICES.  INTEL WILL NOT PROVIDE ANY
00086  * UPDATES, ENHANCEMENTS OR EXTENSIONS.  INTEL SPECIFICALLY DISCLAIMS ANY
00087  * IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A
00088  * PARTICULAR PURPOSE.
00089  *
00090  * 4.2. IN NO EVENT SHALL INTEL HAVE ANY LIABILITY TO LICENSEE, ITS LICENSEES
00091  * OR ANY OTHER THIRD PARTY, FOR ANY LOST PROFITS, LOST DATA, LOSS OF USE OR
00092  * COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY INDIRECT,
00093  * SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, UNDER ANY
00094  * CAUSE OF ACTION OR THEORY OF LIABILITY, AND IRRESPECTIVE OF WHETHER INTEL
00095  * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES.  THESE LIMITATIONS
00096  * SHALL APPLY NOTWITHSTANDING THE FAILURE OF THE ESSENTIAL PURPOSE OF ANY
00097  * LIMITED REMEDY.
00098  *
00099  * 4.3. Licensee shall not export, either directly or indirectly, any of this
00100  * software or system incorporating such software without first obtaining any
00101  * required license or other approval from the U. S. Department of Commerce or
00102  * any other agency or department of the United States Government.  In the
00103  * event Licensee exports any such software from the United States or
00104  * re-exports any such software from a foreign destination, Licensee shall
00105  * ensure that the distribution and export/re-export of the software is in
00106  * compliance with all laws, regulations, orders, or other restrictions of the
00107  * U.S. Export Administration Regulations. Licensee agrees that neither it nor
00108  * any of its subsidiaries will export/re-export any technical data, process,
00109  * software, or service, directly or indirectly, to any country for which the
00110  * United States government or any agency thereof requires an export license,
00111  * other governmental approval, or letter of assurance, without first obtaining
00112  * such license, approval or letter.
00113  *
00114  *****************************************************************************/
00115 
00116 #define __RSIRQ_C__
00117 
00118 #include "acpi.h"
00119 #include "accommon.h"
00120 #include "acresrc.h"
00121 
00122 #define _COMPONENT          ACPI_RESOURCES
00123         ACPI_MODULE_NAME    ("rsirq")
00124 
00125 
00126 /*******************************************************************************
00127  *
00128  * AcpiRsGetIrq
00129  *
00130  ******************************************************************************/
00131 
00132 ACPI_RSCONVERT_INFO     AcpiRsGetIrq[8] =
00133 {
00134     {ACPI_RSC_INITGET,  ACPI_RESOURCE_TYPE_IRQ,
00135                         ACPI_RS_SIZE (ACPI_RESOURCE_IRQ),
00136                         ACPI_RSC_TABLE_SIZE (AcpiRsGetIrq)},
00137 
00138     /* Get the IRQ mask (bytes 1:2) */
00139 
00140     {ACPI_RSC_BITMASK16,ACPI_RS_OFFSET (Data.Irq.Interrupts[0]),
00141                         AML_OFFSET (Irq.IrqMask),
00142                         ACPI_RS_OFFSET (Data.Irq.InterruptCount)},
00143 
00144     /* Set default flags (others are zero) */
00145 
00146     {ACPI_RSC_SET8,     ACPI_RS_OFFSET (Data.Irq.Triggering),
00147                         ACPI_EDGE_SENSITIVE,
00148                         1},
00149 
00150     /* Get the descriptor length (2 or 3 for IRQ descriptor) */
00151 
00152     {ACPI_RSC_2BITFLAG, ACPI_RS_OFFSET (Data.Irq.DescriptorLength),
00153                         AML_OFFSET (Irq.DescriptorType),
00154                         0},
00155 
00156     /* All done if no flag byte present in descriptor */
00157 
00158     {ACPI_RSC_EXIT_NE,  ACPI_RSC_COMPARE_AML_LENGTH, 0, 3},
00159 
00160     /* Get flags: Triggering[0], Polarity[3], Sharing[4] */
00161 
00162     {ACPI_RSC_1BITFLAG, ACPI_RS_OFFSET (Data.Irq.Triggering),
00163                         AML_OFFSET (Irq.Flags),
00164                         0},
00165 
00166     {ACPI_RSC_1BITFLAG, ACPI_RS_OFFSET (Data.Irq.Polarity),
00167                         AML_OFFSET (Irq.Flags),
00168                         3},
00169 
00170     {ACPI_RSC_1BITFLAG, ACPI_RS_OFFSET (Data.Irq.Sharable),
00171                         AML_OFFSET (Irq.Flags),
00172                         4}
00173 };
00174 
00175 
00176 /*******************************************************************************
00177  *
00178  * AcpiRsSetIrq
00179  *
00180  ******************************************************************************/
00181 
00182 ACPI_RSCONVERT_INFO     AcpiRsSetIrq[13] =
00183 {
00184     /* Start with a default descriptor of length 3 */
00185 
00186     {ACPI_RSC_INITSET,  ACPI_RESOURCE_NAME_IRQ,
00187                         sizeof (AML_RESOURCE_IRQ),
00188                         ACPI_RSC_TABLE_SIZE (AcpiRsSetIrq)},
00189 
00190     /* Convert interrupt list to 16-bit IRQ bitmask */
00191 
00192     {ACPI_RSC_BITMASK16,ACPI_RS_OFFSET (Data.Irq.Interrupts[0]),
00193                         AML_OFFSET (Irq.IrqMask),
00194                         ACPI_RS_OFFSET (Data.Irq.InterruptCount)},
00195 
00196     /* Set the flags byte */
00197 
00198     {ACPI_RSC_1BITFLAG, ACPI_RS_OFFSET (Data.Irq.Triggering),
00199                         AML_OFFSET (Irq.Flags),
00200                         0},
00201 
00202     {ACPI_RSC_1BITFLAG, ACPI_RS_OFFSET (Data.Irq.Polarity),
00203                         AML_OFFSET (Irq.Flags),
00204                         3},
00205 
00206     {ACPI_RSC_1BITFLAG, ACPI_RS_OFFSET (Data.Irq.Sharable),
00207                         AML_OFFSET (Irq.Flags),
00208                         4},
00209 
00210     /*
00211      * All done if the output descriptor length is required to be 3
00212      * (i.e., optimization to 2 bytes cannot be attempted)
00213      */
00214     {ACPI_RSC_EXIT_EQ,  ACPI_RSC_COMPARE_VALUE,
00215                         ACPI_RS_OFFSET(Data.Irq.DescriptorLength),
00216                         3},
00217 
00218     /* Set length to 2 bytes (no flags byte) */
00219 
00220     {ACPI_RSC_LENGTH,   0, 0, sizeof (AML_RESOURCE_IRQ_NOFLAGS)},
00221 
00222     /*
00223      * All done if the output descriptor length is required to be 2.
00224      *
00225      * TBD: Perhaps we should check for error if input flags are not
00226      * compatible with a 2-byte descriptor.
00227      */
00228     {ACPI_RSC_EXIT_EQ,  ACPI_RSC_COMPARE_VALUE,
00229                         ACPI_RS_OFFSET(Data.Irq.DescriptorLength),
00230                         2},
00231 
00232     /* Reset length to 3 bytes (descriptor with flags byte) */
00233 
00234     {ACPI_RSC_LENGTH,   0, 0, sizeof (AML_RESOURCE_IRQ)},
00235 
00236     /*
00237      * Check if the flags byte is necessary. Not needed if the flags are:
00238      * ACPI_EDGE_SENSITIVE, ACPI_ACTIVE_HIGH, ACPI_EXCLUSIVE
00239      */
00240     {ACPI_RSC_EXIT_NE,  ACPI_RSC_COMPARE_VALUE,
00241                         ACPI_RS_OFFSET (Data.Irq.Triggering),
00242                         ACPI_EDGE_SENSITIVE},
00243 
00244     {ACPI_RSC_EXIT_NE,  ACPI_RSC_COMPARE_VALUE,
00245                         ACPI_RS_OFFSET (Data.Irq.Polarity),
00246                         ACPI_ACTIVE_HIGH},
00247 
00248     {ACPI_RSC_EXIT_NE,  ACPI_RSC_COMPARE_VALUE,
00249                         ACPI_RS_OFFSET (Data.Irq.Sharable),
00250                         ACPI_EXCLUSIVE},
00251 
00252     /* We can optimize to a 2-byte IrqNoFlags() descriptor */
00253 
00254     {ACPI_RSC_LENGTH,   0, 0, sizeof (AML_RESOURCE_IRQ_NOFLAGS)}
00255 };
00256 
00257 
00258 /*******************************************************************************
00259  *
00260  * AcpiRsConvertExtIrq
00261  *
00262  ******************************************************************************/
00263 
00264 ACPI_RSCONVERT_INFO     AcpiRsConvertExtIrq[9] =
00265 {
00266     {ACPI_RSC_INITGET,  ACPI_RESOURCE_TYPE_EXTENDED_IRQ,
00267                         ACPI_RS_SIZE (ACPI_RESOURCE_EXTENDED_IRQ),
00268                         ACPI_RSC_TABLE_SIZE (AcpiRsConvertExtIrq)},
00269 
00270     {ACPI_RSC_INITSET,  ACPI_RESOURCE_NAME_EXTENDED_IRQ,
00271                         sizeof (AML_RESOURCE_EXTENDED_IRQ),
00272                         0},
00273 
00274     /* Flag bits */
00275 
00276     {ACPI_RSC_1BITFLAG, ACPI_RS_OFFSET (Data.ExtendedIrq.ProducerConsumer),
00277                         AML_OFFSET (ExtendedIrq.Flags),
00278                         0},
00279 
00280     {ACPI_RSC_1BITFLAG, ACPI_RS_OFFSET (Data.ExtendedIrq.Triggering),
00281                         AML_OFFSET (ExtendedIrq.Flags),
00282                         1},
00283 
00284     {ACPI_RSC_1BITFLAG, ACPI_RS_OFFSET (Data.ExtendedIrq.Polarity),
00285                         AML_OFFSET (ExtendedIrq.Flags),
00286                         2},
00287 
00288     {ACPI_RSC_1BITFLAG, ACPI_RS_OFFSET (Data.ExtendedIrq.Sharable),
00289                         AML_OFFSET (ExtendedIrq.Flags),
00290                         3},
00291 
00292     /* IRQ Table length (Byte4) */
00293 
00294     {ACPI_RSC_COUNT,    ACPI_RS_OFFSET (Data.ExtendedIrq.InterruptCount),
00295                         AML_OFFSET (ExtendedIrq.InterruptCount),
00296                         sizeof (UINT32)},
00297 
00298     /* Copy every IRQ in the table, each is 32 bits */
00299 
00300     {ACPI_RSC_MOVE32,   ACPI_RS_OFFSET (Data.ExtendedIrq.Interrupts[0]),
00301                         AML_OFFSET (ExtendedIrq.Interrupts[0]),
00302                         0},
00303 
00304     /* Optional ResourceSource (Index and String) */
00305 
00306     {ACPI_RSC_SOURCEX,  ACPI_RS_OFFSET (Data.ExtendedIrq.ResourceSource),
00307                         ACPI_RS_OFFSET (Data.ExtendedIrq.Interrupts[0]),
00308                         sizeof (AML_RESOURCE_EXTENDED_IRQ)}
00309 };
00310 
00311 
00312 /*******************************************************************************
00313  *
00314  * AcpiRsConvertDma
00315  *
00316  ******************************************************************************/
00317 
00318 ACPI_RSCONVERT_INFO     AcpiRsConvertDma[6] =
00319 {
00320     {ACPI_RSC_INITGET,  ACPI_RESOURCE_TYPE_DMA,
00321                         ACPI_RS_SIZE (ACPI_RESOURCE_DMA),
00322                         ACPI_RSC_TABLE_SIZE (AcpiRsConvertDma)},
00323 
00324     {ACPI_RSC_INITSET,  ACPI_RESOURCE_NAME_DMA,
00325                         sizeof (AML_RESOURCE_DMA),
00326                         0},
00327 
00328     /* Flags: transfer preference, bus mastering, channel speed */
00329 
00330     {ACPI_RSC_2BITFLAG, ACPI_RS_OFFSET (Data.Dma.Transfer),
00331                         AML_OFFSET (Dma.Flags),
00332                         0},
00333 
00334     {ACPI_RSC_1BITFLAG, ACPI_RS_OFFSET (Data.Dma.BusMaster),
00335                         AML_OFFSET (Dma.Flags),
00336                         2},
00337 
00338     {ACPI_RSC_2BITFLAG, ACPI_RS_OFFSET (Data.Dma.Type),
00339                         AML_OFFSET (Dma.Flags),
00340                         5},
00341 
00342     /* DMA channel mask bits */
00343 
00344     {ACPI_RSC_BITMASK,  ACPI_RS_OFFSET (Data.Dma.Channels[0]),
00345                         AML_OFFSET (Dma.DmaChannelMask),
00346                         ACPI_RS_OFFSET (Data.Dma.ChannelCount)}
00347 };
00348 

Generated on Fri May 25 2012 04:25:39 for ReactOS by doxygen 1.7.6.1

ReactOS is a registered trademark or a trademark of ReactOS Foundation in the United States and other countries.