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