]> git.proxmox.com Git - mirror_edk2.git/blob - BaseTools/Source/C/Include/IndustryStandard/Acpi.h
Check In tool source code based on Build tool project revision r1655.
[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, Intel Corporation All rights reserved.
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 File Name: Acpi.h
16
17 **/
18
19 #ifndef _ACPI_H_
20 #define _ACPI_H_
21
22 //
23 // Common table header, this prefaces all ACPI tables, including FACS, but
24 // excluding the RSD PTR structure
25 //
26 typedef struct {
27 UINT32 Signature;
28 UINT32 Length;
29 } EFI_ACPI_COMMON_HEADER;
30
31 //
32 // Common ACPI description table header. This structure prefaces most ACPI tables.
33 //
34 #pragma pack(1)
35
36 typedef struct {
37 UINT32 Signature;
38 UINT32 Length;
39 UINT8 Revision;
40 UINT8 Checksum;
41 UINT8 OemId[6];
42 UINT64 OemTableId;
43 UINT32 OemRevision;
44 UINT32 CreatorId;
45 UINT32 CreatorRevision;
46 } EFI_ACPI_DESCRIPTION_HEADER;
47
48 #pragma pack()
49 //
50 // Define for Pci Host Bridge Resource Allocation
51 //
52 #define ACPI_ADDRESS_SPACE_DESCRIPTOR 0x8A
53 #define ACPI_END_TAG_DESCRIPTOR 0x79
54
55 #define ACPI_ADDRESS_SPACE_TYPE_MEM 0x00
56 #define ACPI_ADDRESS_SPACE_TYPE_IO 0x01
57 #define ACPI_ADDRESS_SPACE_TYPE_BUS 0x02
58
59 //
60 // Power Management Timer frequency is fixed at 3.579545MHz
61 //
62 #define ACPI_TIMER_FREQUENCY 3579545
63
64 //
65 // Make sure structures match spec
66 //
67 #pragma pack(1)
68
69 typedef struct {
70 UINT8 Desc;
71 UINT16 Len;
72 UINT8 ResType;
73 UINT8 GenFlag;
74 UINT8 SpecificFlag;
75 UINT64 AddrSpaceGranularity;
76 UINT64 AddrRangeMin;
77 UINT64 AddrRangeMax;
78 UINT64 AddrTranslationOffset;
79 UINT64 AddrLen;
80 } EFI_ACPI_ADDRESS_SPACE_DESCRIPTOR;
81
82 typedef struct {
83 UINT8 Desc;
84 UINT8 Checksum;
85 } EFI_ACPI_END_TAG_DESCRIPTOR;
86
87 //
88 // General use definitions
89 //
90 #define EFI_ACPI_RESERVED_BYTE 0x00
91 #define EFI_ACPI_RESERVED_WORD 0x0000
92 #define EFI_ACPI_RESERVED_DWORD 0x00000000
93 #define EFI_ACPI_RESERVED_QWORD 0x0000000000000000
94
95 //
96 // Resource Type Specific Flags
97 // Ref ACPI specification 6.4.3.5.5
98 //
99 // Bit [0] : Write Status, _RW
100 //
101 #define EFI_ACPI_MEMORY_RESOURCE_SPECIFIC_FLAG_READ_WRITE (1 << 0)
102 #define EFI_ACPI_MEMORY_RESOURCE_SPECIFIC_FLAG_READ_ONLY (0 << 0)
103 //
104 // Bit [2:1] : Memory Attributes, _MEM
105 //
106 #define EFI_ACPI_MEMORY_RESOURCE_SPECIFIC_FLAG_NON_CACHEABLE (0 << 1)
107 #define EFI_ACPI_MEMORY_RESOURCE_SPECIFIC_FLAG_CACHEABLE (1 << 1)
108 #define EFI_ACPI_MEMORY_RESOURCE_SPECIFIC_FLAG_CACHEABLE_WRITE_COMBINING (2 << 1)
109 #define EFI_ACPI_MEMORY_RESOURCE_SPECIFIC_FLAG_CACHEABLE_PREFETCHABLE (3 << 1)
110 //
111 // Bit [4:3] : Memory Attributes, _MTP
112 //
113 #define EFI_ACPI_MEMORY_RESOURCE_SPECIFIC_FLAG_ADDRESS_RANGE_MEMORY (0 << 3)
114 #define EFI_ACPI_MEMORY_RESOURCE_SPECIFIC_FLAG_ADDRESS_RANGE_RESERVED (1 << 3)
115 #define EFI_ACPI_MEMORY_RESOURCE_SPECIFIC_FLAG_ADDRESS_RANGE_ACPI (2 << 3)
116 #define EFI_APCI_MEMORY_RESOURCE_SPECIFIC_FLAG_ADDRESS_RANGE_NVS (3 << 3)
117 //
118 // Bit [5] : Memory to I/O Translation, _TTP
119 //
120 #define EFI_ACPI_MEMORY_RESOURCE_SPECIFIC_FLAG_TYPE_TRANSLATION (1 << 5)
121 #define EFI_ACPI_MEMORY_RESOURCE_SPECIFIC_FLAG_TYPE_STATIC (0 << 5)
122
123 #pragma pack()
124
125 #endif