1 /*******************************************************************************
3 * Module Name: rsmem24 - Memory resource descriptors
5 ******************************************************************************/
8 * Copyright (C) 2000 - 2019, Intel Corp.
11 * Redistribution and use in source and binary forms, with or without
12 * modification, are permitted provided that the following conditions
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.
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.
48 #define _COMPONENT ACPI_RESOURCES
49 ACPI_MODULE_NAME ("rsmemory")
52 /*******************************************************************************
54 * AcpiRsConvertMemory24
56 ******************************************************************************/
58 ACPI_RSCONVERT_INFO AcpiRsConvertMemory24
[4] =
60 {ACPI_RSC_INITGET
, ACPI_RESOURCE_TYPE_MEMORY24
,
61 ACPI_RS_SIZE (ACPI_RESOURCE_MEMORY24
),
62 ACPI_RSC_TABLE_SIZE (AcpiRsConvertMemory24
)},
64 {ACPI_RSC_INITSET
, ACPI_RESOURCE_NAME_MEMORY24
,
65 sizeof (AML_RESOURCE_MEMORY24
),
70 {ACPI_RSC_1BITFLAG
, ACPI_RS_OFFSET (Data
.Memory24
.WriteProtect
),
71 AML_OFFSET (Memory24
.Flags
),
74 * These fields are contiguous in both the source and destination:
75 * Minimum Base Address
76 * Maximum Base Address
77 * Address Base Alignment
80 {ACPI_RSC_MOVE16
, ACPI_RS_OFFSET (Data
.Memory24
.Minimum
),
81 AML_OFFSET (Memory24
.Minimum
),
86 /*******************************************************************************
88 * AcpiRsConvertMemory32
90 ******************************************************************************/
92 ACPI_RSCONVERT_INFO AcpiRsConvertMemory32
[4] =
94 {ACPI_RSC_INITGET
, ACPI_RESOURCE_TYPE_MEMORY32
,
95 ACPI_RS_SIZE (ACPI_RESOURCE_MEMORY32
),
96 ACPI_RSC_TABLE_SIZE (AcpiRsConvertMemory32
)},
98 {ACPI_RSC_INITSET
, ACPI_RESOURCE_NAME_MEMORY32
,
99 sizeof (AML_RESOURCE_MEMORY32
),
104 {ACPI_RSC_1BITFLAG
, ACPI_RS_OFFSET (Data
.Memory32
.WriteProtect
),
105 AML_OFFSET (Memory32
.Flags
),
108 * These fields are contiguous in both the source and destination:
109 * Minimum Base Address
110 * Maximum Base Address
111 * Address Base Alignment
114 {ACPI_RSC_MOVE32
, ACPI_RS_OFFSET (Data
.Memory32
.Minimum
),
115 AML_OFFSET (Memory32
.Minimum
),
120 /*******************************************************************************
122 * AcpiRsConvertFixedMemory32
124 ******************************************************************************/
126 ACPI_RSCONVERT_INFO AcpiRsConvertFixedMemory32
[4] =
128 {ACPI_RSC_INITGET
, ACPI_RESOURCE_TYPE_FIXED_MEMORY32
,
129 ACPI_RS_SIZE (ACPI_RESOURCE_FIXED_MEMORY32
),
130 ACPI_RSC_TABLE_SIZE (AcpiRsConvertFixedMemory32
)},
132 {ACPI_RSC_INITSET
, ACPI_RESOURCE_NAME_FIXED_MEMORY32
,
133 sizeof (AML_RESOURCE_FIXED_MEMORY32
),
138 {ACPI_RSC_1BITFLAG
, ACPI_RS_OFFSET (Data
.FixedMemory32
.WriteProtect
),
139 AML_OFFSET (FixedMemory32
.Flags
),
142 * These fields are contiguous in both the source and destination:
146 {ACPI_RSC_MOVE32
, ACPI_RS_OFFSET (Data
.FixedMemory32
.Address
),
147 AML_OFFSET (FixedMemory32
.Address
),
152 /*******************************************************************************
154 * AcpiRsGetVendorSmall
156 ******************************************************************************/
158 ACPI_RSCONVERT_INFO AcpiRsGetVendorSmall
[3] =
160 {ACPI_RSC_INITGET
, ACPI_RESOURCE_TYPE_VENDOR
,
161 ACPI_RS_SIZE (ACPI_RESOURCE_VENDOR
),
162 ACPI_RSC_TABLE_SIZE (AcpiRsGetVendorSmall
)},
164 /* Length of the vendor data (byte count) */
166 {ACPI_RSC_COUNT16
, ACPI_RS_OFFSET (Data
.Vendor
.ByteLength
),
172 {ACPI_RSC_MOVE8
, ACPI_RS_OFFSET (Data
.Vendor
.ByteData
[0]),
173 sizeof (AML_RESOURCE_SMALL_HEADER
),
178 /*******************************************************************************
180 * AcpiRsGetVendorLarge
182 ******************************************************************************/
184 ACPI_RSCONVERT_INFO AcpiRsGetVendorLarge
[3] =
186 {ACPI_RSC_INITGET
, ACPI_RESOURCE_TYPE_VENDOR
,
187 ACPI_RS_SIZE (ACPI_RESOURCE_VENDOR
),
188 ACPI_RSC_TABLE_SIZE (AcpiRsGetVendorLarge
)},
190 /* Length of the vendor data (byte count) */
192 {ACPI_RSC_COUNT16
, ACPI_RS_OFFSET (Data
.Vendor
.ByteLength
),
198 {ACPI_RSC_MOVE8
, ACPI_RS_OFFSET (Data
.Vendor
.ByteData
[0]),
199 sizeof (AML_RESOURCE_LARGE_HEADER
),
204 /*******************************************************************************
208 ******************************************************************************/
210 ACPI_RSCONVERT_INFO AcpiRsSetVendor
[7] =
212 /* Default is a small vendor descriptor */
214 {ACPI_RSC_INITSET
, ACPI_RESOURCE_NAME_VENDOR_SMALL
,
215 sizeof (AML_RESOURCE_SMALL_HEADER
),
216 ACPI_RSC_TABLE_SIZE (AcpiRsSetVendor
)},
218 /* Get the length and copy the data */
220 {ACPI_RSC_COUNT16
, ACPI_RS_OFFSET (Data
.Vendor
.ByteLength
),
224 {ACPI_RSC_MOVE8
, ACPI_RS_OFFSET (Data
.Vendor
.ByteData
[0]),
225 sizeof (AML_RESOURCE_SMALL_HEADER
),
229 * All done if the Vendor byte length is 7 or less, meaning that it will
230 * fit within a small descriptor
232 {ACPI_RSC_EXIT_LE
, 0, 0, 7},
234 /* Must create a large vendor descriptor */
236 {ACPI_RSC_INITSET
, ACPI_RESOURCE_NAME_VENDOR_LARGE
,
237 sizeof (AML_RESOURCE_LARGE_HEADER
),
240 {ACPI_RSC_COUNT16
, ACPI_RS_OFFSET (Data
.Vendor
.ByteLength
),
244 {ACPI_RSC_MOVE8
, ACPI_RS_OFFSET (Data
.Vendor
.ByteData
[0]),
245 sizeof (AML_RESOURCE_LARGE_HEADER
),