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