]> git.proxmox.com Git - mirror_edk2.git/blob - MdePkg/Include/IndustryStandard/Acpi.h
Add specific flag definition according to ACPI specification.
[mirror_edk2.git] / MdePkg / Include / IndustryStandard / Acpi.h
1 /** @file
2 This file contains some basic ACPI definitions that are consumed by drivers
3 that do not care about ACPI versions.
4
5 Copyright (c) 2006, Intel Corporation
6 All rights reserved. This program and the accompanying materials
7 are licensed and made available under the terms and conditions of the BSD License
8 which accompanies this distribution. The full text of the license may be found at
9 http://opensource.org/licenses/bsd-license.php
10
11 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
12 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
13
14 Module Name: Acpi.h
15
16 **/
17
18 #ifndef _ACPI_H_
19 #define _ACPI_H_
20
21 //
22 // Common table header, this prefaces all ACPI tables, including FACS, but
23 // excluding the RSD PTR structure
24 //
25 typedef struct {
26 UINT32 Signature;
27 UINT32 Length;
28 } EFI_ACPI_COMMON_HEADER;
29
30 //
31 // Common ACPI description table header. This structure prefaces most ACPI tables.
32 //
33 #pragma pack(1)
34
35 typedef struct {
36 UINT32 Signature;
37 UINT32 Length;
38 UINT8 Revision;
39 UINT8 Checksum;
40 UINT8 OemId[6];
41 UINT64 OemTableId;
42 UINT32 OemRevision;
43 UINT32 CreatorId;
44 UINT32 CreatorRevision;
45 } EFI_ACPI_DESCRIPTION_HEADER;
46
47 #pragma pack()
48 //
49 // Define for Pci Host Bridge Resource Allocation
50 //
51 #define ACPI_ADDRESS_SPACE_DESCRIPTOR 0x8A
52 #define ACPI_END_TAG_DESCRIPTOR 0x79
53
54 #define ACPI_ADDRESS_SPACE_TYPE_MEM 0x00
55 #define ACPI_ADDRESS_SPACE_TYPE_IO 0x01
56 #define ACPI_ADDRESS_SPACE_TYPE_BUS 0x02
57
58 //
59 // Make sure structures match spec
60 //
61 #pragma pack(1)
62
63 typedef struct {
64 UINT8 Desc;
65 UINT16 Len;
66 UINT8 ResType;
67 UINT8 GenFlag;
68 UINT8 SpecificFlag;
69 UINT64 AddrSpaceGranularity;
70 UINT64 AddrRangeMin;
71 UINT64 AddrRangeMax;
72 UINT64 AddrTranslationOffset;
73 UINT64 AddrLen;
74 } EFI_ACPI_ADDRESS_SPACE_DESCRIPTOR;
75
76 typedef struct {
77 UINT8 Desc;
78 UINT8 Checksum;
79 } EFI_ACPI_END_TAG_DESCRIPTOR;
80
81 //
82 // General use definitions
83 //
84 #define EFI_ACPI_RESERVED_BYTE 0x00
85 #define EFI_ACPI_RESERVED_WORD 0x0000
86 #define EFI_ACPI_RESERVED_DWORD 0x00000000
87 #define EFI_ACPI_RESERVED_QWORD 0x0000000000000000
88
89 //
90 // Resource Type Specific Flags
91 // Ref ACPI specification 6.4.3.5.5
92 //
93 // Bit [0] : Write Status, _RW
94 //
95 #define EFI_ACPI_MEMORY_RESOURCE_SPECIFIC_FLAG_READ_WRITE (1 << 0)
96 #define EFI_ACPI_MEMORY_RESOURCE_SPECIFIC_FLAG_READ_ONLY (0 << 0)
97 //
98 // Bit [2:1] : Memory Attributes, _MEM
99 //
100 #define EFI_ACPI_MEMORY_RESOURCE_SPECIFIC_FLAG_NON_CACHEABLE (0 << 1)
101 #define EFI_ACPI_MEMORY_RESOURCE_SPECIFIC_FLAG_CACHEABLE (1 << 1)
102 #define EFI_ACPI_MEMORY_RESOURCE_SPECIFIC_FLAG_CACHEABLE_WRITE_COMBINING (2 << 1)
103 #define EFI_ACPI_MEMORY_RESOURCE_SPECIFIC_FLAG_CACHEABLE_PREFETCHABLE (3 << 1)
104 //
105 // Bit [4:3] : Memory Attributes, _MTP
106 //
107 #define EFI_ACPI_MEMORY_RESOURCE_SPECIFIC_FLAG_ADDRESS_RANGE_MEMORY (0 << 3)
108 #define EFI_ACPI_MEMORY_RESOURCE_SPECIFIC_FLAG_ADDRESS_RANGE_RESERVED (1 << 3)
109 #define EFI_ACPI_MEMORY_RESOURCE_SPECIFIC_FLAG_ADDRESS_RANGE_ACPI (2 << 3)
110 #define EFI_APCI_MEMORY_RESOURCE_SPECIFIC_FLAG_ADDRESS_RANGE_NVS (3 << 3)
111 //
112 // Bit [5] : Memory to I/O Translation, _TTP
113 //
114 #define EFI_ACPI_MEMORY_RESOURCE_SPECIFIC_FLAG_TYPE_TRANSLATION (1 << 5)
115 #define EFI_ACPI_MEMORY_RESOURCE_SPECIFIC_FLAG_TYPE_STATIC (0 << 5)
116
117 #pragma pack()
118
119 #endif