Fixed compatibility of output.
[AROS.git] / arch / all-pc / acpica / source / components / resources / rsmemory.c
blob7c6ccf543aefd2809b3cd1d385975f551503ee29
1 /*******************************************************************************
3 * Module Name: rsmem24 - Memory resource descriptors
5 ******************************************************************************/
7 /*
8 * Copyright (C) 2000 - 2013, Intel Corp.
9 * All rights reserved.
11 * Redistribution and use in source and binary forms, with or without
12 * modification, are permitted provided that the following conditions
13 * are met:
14 * 1. Redistributions of source code must retain the above copyright
15 * notice, this list of conditions, and the following disclaimer,
16 * without modification.
17 * 2. Redistributions in binary form must reproduce at minimum a disclaimer
18 * substantially similar to the "NO WARRANTY" disclaimer below
19 * ("Disclaimer") and any redistribution must be conditioned upon
20 * including a substantially similar Disclaimer requirement for further
21 * binary redistribution.
22 * 3. Neither the names of the above-listed copyright holders nor the names
23 * of any contributors may be used to endorse or promote products derived
24 * from this software without specific prior written permission.
26 * Alternatively, this software may be distributed under the terms of the
27 * GNU General Public License ("GPL") version 2 as published by the Free
28 * Software Foundation.
30 * NO WARRANTY
31 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
32 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
33 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR
34 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
35 * HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
36 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
37 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
38 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
39 * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
40 * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
41 * POSSIBILITY OF SUCH DAMAGES.
44 #define __RSMEMORY_C__
46 #include "acpi.h"
47 #include "accommon.h"
48 #include "acresrc.h"
50 #define _COMPONENT ACPI_RESOURCES
51 ACPI_MODULE_NAME ("rsmemory")
54 /*******************************************************************************
56 * AcpiRsConvertMemory24
58 ******************************************************************************/
60 ACPI_RSCONVERT_INFO AcpiRsConvertMemory24[4] =
62 {ACPI_RSC_INITGET, ACPI_RESOURCE_TYPE_MEMORY24,
63 ACPI_RS_SIZE (ACPI_RESOURCE_MEMORY24),
64 ACPI_RSC_TABLE_SIZE (AcpiRsConvertMemory24)},
66 {ACPI_RSC_INITSET, ACPI_RESOURCE_NAME_MEMORY24,
67 sizeof (AML_RESOURCE_MEMORY24),
68 0},
70 /* Read/Write bit */
72 {ACPI_RSC_1BITFLAG, ACPI_RS_OFFSET (Data.Memory24.WriteProtect),
73 AML_OFFSET (Memory24.Flags),
74 0},
76 * These fields are contiguous in both the source and destination:
77 * Minimum Base Address
78 * Maximum Base Address
79 * Address Base Alignment
80 * Range Length
82 {ACPI_RSC_MOVE16, ACPI_RS_OFFSET (Data.Memory24.Minimum),
83 AML_OFFSET (Memory24.Minimum),
88 /*******************************************************************************
90 * AcpiRsConvertMemory32
92 ******************************************************************************/
94 ACPI_RSCONVERT_INFO AcpiRsConvertMemory32[4] =
96 {ACPI_RSC_INITGET, ACPI_RESOURCE_TYPE_MEMORY32,
97 ACPI_RS_SIZE (ACPI_RESOURCE_MEMORY32),
98 ACPI_RSC_TABLE_SIZE (AcpiRsConvertMemory32)},
100 {ACPI_RSC_INITSET, ACPI_RESOURCE_NAME_MEMORY32,
101 sizeof (AML_RESOURCE_MEMORY32),
104 /* Read/Write bit */
106 {ACPI_RSC_1BITFLAG, ACPI_RS_OFFSET (Data.Memory32.WriteProtect),
107 AML_OFFSET (Memory32.Flags),
110 * These fields are contiguous in both the source and destination:
111 * Minimum Base Address
112 * Maximum Base Address
113 * Address Base Alignment
114 * Range Length
116 {ACPI_RSC_MOVE32, ACPI_RS_OFFSET (Data.Memory32.Minimum),
117 AML_OFFSET (Memory32.Minimum),
122 /*******************************************************************************
124 * AcpiRsConvertFixedMemory32
126 ******************************************************************************/
128 ACPI_RSCONVERT_INFO AcpiRsConvertFixedMemory32[4] =
130 {ACPI_RSC_INITGET, ACPI_RESOURCE_TYPE_FIXED_MEMORY32,
131 ACPI_RS_SIZE (ACPI_RESOURCE_FIXED_MEMORY32),
132 ACPI_RSC_TABLE_SIZE (AcpiRsConvertFixedMemory32)},
134 {ACPI_RSC_INITSET, ACPI_RESOURCE_NAME_FIXED_MEMORY32,
135 sizeof (AML_RESOURCE_FIXED_MEMORY32),
138 /* Read/Write bit */
140 {ACPI_RSC_1BITFLAG, ACPI_RS_OFFSET (Data.FixedMemory32.WriteProtect),
141 AML_OFFSET (FixedMemory32.Flags),
144 * These fields are contiguous in both the source and destination:
145 * Base Address
146 * Range Length
148 {ACPI_RSC_MOVE32, ACPI_RS_OFFSET (Data.FixedMemory32.Address),
149 AML_OFFSET (FixedMemory32.Address),
154 /*******************************************************************************
156 * AcpiRsGetVendorSmall
158 ******************************************************************************/
160 ACPI_RSCONVERT_INFO AcpiRsGetVendorSmall[3] =
162 {ACPI_RSC_INITGET, ACPI_RESOURCE_TYPE_VENDOR,
163 ACPI_RS_SIZE (ACPI_RESOURCE_VENDOR),
164 ACPI_RSC_TABLE_SIZE (AcpiRsGetVendorSmall)},
166 /* Length of the vendor data (byte count) */
168 {ACPI_RSC_COUNT16, ACPI_RS_OFFSET (Data.Vendor.ByteLength),
170 sizeof (UINT8)},
172 /* Vendor data */
174 {ACPI_RSC_MOVE8, ACPI_RS_OFFSET (Data.Vendor.ByteData[0]),
175 sizeof (AML_RESOURCE_SMALL_HEADER),
180 /*******************************************************************************
182 * AcpiRsGetVendorLarge
184 ******************************************************************************/
186 ACPI_RSCONVERT_INFO AcpiRsGetVendorLarge[3] =
188 {ACPI_RSC_INITGET, ACPI_RESOURCE_TYPE_VENDOR,
189 ACPI_RS_SIZE (ACPI_RESOURCE_VENDOR),
190 ACPI_RSC_TABLE_SIZE (AcpiRsGetVendorLarge)},
192 /* Length of the vendor data (byte count) */
194 {ACPI_RSC_COUNT16, ACPI_RS_OFFSET (Data.Vendor.ByteLength),
196 sizeof (UINT8)},
198 /* Vendor data */
200 {ACPI_RSC_MOVE8, ACPI_RS_OFFSET (Data.Vendor.ByteData[0]),
201 sizeof (AML_RESOURCE_LARGE_HEADER),
206 /*******************************************************************************
208 * AcpiRsSetVendor
210 ******************************************************************************/
212 ACPI_RSCONVERT_INFO AcpiRsSetVendor[7] =
214 /* Default is a small vendor descriptor */
216 {ACPI_RSC_INITSET, ACPI_RESOURCE_NAME_VENDOR_SMALL,
217 sizeof (AML_RESOURCE_SMALL_HEADER),
218 ACPI_RSC_TABLE_SIZE (AcpiRsSetVendor)},
220 /* Get the length and copy the data */
222 {ACPI_RSC_COUNT16, ACPI_RS_OFFSET (Data.Vendor.ByteLength),
226 {ACPI_RSC_MOVE8, ACPI_RS_OFFSET (Data.Vendor.ByteData[0]),
227 sizeof (AML_RESOURCE_SMALL_HEADER),
231 * All done if the Vendor byte length is 7 or less, meaning that it will
232 * fit within a small descriptor
234 {ACPI_RSC_EXIT_LE, 0, 0, 7},
236 /* Must create a large vendor descriptor */
238 {ACPI_RSC_INITSET, ACPI_RESOURCE_NAME_VENDOR_LARGE,
239 sizeof (AML_RESOURCE_LARGE_HEADER),
242 {ACPI_RSC_COUNT16, ACPI_RS_OFFSET (Data.Vendor.ByteLength),
246 {ACPI_RSC_MOVE8, ACPI_RS_OFFSET (Data.Vendor.ByteData[0]),
247 sizeof (AML_RESOURCE_LARGE_HEADER),