├── .gitattributes
├── .gitmodules
├── .gitignore
├── contrib
├── gnu-efi.vcxproj.user
├── uefi-simple.vcxproj.filters
├── uefi-simple.vcxproj.user
├── gnu-efi.vcxproj.filters
├── uefi-simple.vcxproj
└── gnu-efi.vcxproj
├── Includes
├── IndustryStandard
│ ├── Acpi.h
│ ├── AcpiAml.h
│ ├── Acpi20.h
│ ├── Acpi10.h
│ ├── Acpi30.h
│ └── Acpi40.h
└── Base.h
├── COPYING
├── README.md
├── AcpiPatcher.sln
├── debug.vbs
├── src
└── main.c
└── Makefile
/.gitattributes:
--------------------------------------------------------------------------------
1 | *.sh eol=lf
2 | Makefile eol=lf
3 |
--------------------------------------------------------------------------------
/.gitmodules:
--------------------------------------------------------------------------------
1 | [submodule "gnu-efi"]
2 | path = gnu-efi
3 | url = git://git.code.sf.net/p/gnu-efi/code
4 | ignore = dirty
5 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | *.o
2 | *.efi
3 | *.vhd
4 | *.sdf
5 | *.suo
6 | *.opensdf
7 | *.opendb
8 | *.fd
9 | *.db*
10 | arm
11 | aa64
12 | x86_64
13 | x86_32
14 | image
15 | .vs
16 | build
--------------------------------------------------------------------------------
/contrib/gnu-efi.vcxproj.user:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/Includes/IndustryStandard/Acpi.h:
--------------------------------------------------------------------------------
1 | /** @file
2 | This file contains the latest ACPI definitions that are
3 | consumed by drivers that do not care about ACPI versions.
4 |
5 | Copyright (c) 2006 - 2017, Intel Corporation. All rights reserved.
6 | 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 | #include
20 |
21 | #endif
22 |
--------------------------------------------------------------------------------
/COPYING:
--------------------------------------------------------------------------------
1 | 1. The library code used by this project (the gnu-efi library part), is covered by
2 | the following agreement:
3 |
4 | Copyright (c) 1998-2000 Intel Corporation
5 |
6 | Redistribution and use in source and binary forms, with or without modification,
7 | are permitted provided that the following conditions are met:
8 |
9 | Redistributions of source code must retain the above copyright notice, this list
10 | of conditions and the following disclaimer.
11 |
12 | Redistributions in binary form must reproduce the above copyright notice, this
13 | list of conditions and the following disclaimer in the documentation and/or
14 | other materials provided with the distribution.
15 |
16 | THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
17 | INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
18 | FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL INTEL BE
19 | LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
20 | CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
21 | SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
22 | INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
23 | CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
24 | ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
25 | POSSIBILITY OF SUCH DAMAGE. THE EFI SPECIFICATION AND ALL OTHER INFORMATION
26 | ON THIS WEB SITE ARE PROVIDED "AS IS" WITH NO WARRANTIES, AND ARE SUBJECT
27 | TO CHANGE WITHOUT NOTICE.
28 |
29 | 2. The rest of the code, including the project files and makefiles, is set to
30 | public domain.
--------------------------------------------------------------------------------
/Includes/Base.h:
--------------------------------------------------------------------------------
1 | #pragma once
2 |
3 | #ifdef __CC_ARM
4 | //
5 | // Older RVCT ARM compilers don't fully support #pragma pack and require __packed
6 | // as a prefix for the structure.
7 | //
8 | #define PACKED __packed
9 | #else
10 | #define PACKED
11 | #endif
12 |
13 | /**
14 | Returns a 16-bit signature built from 2 ASCII characters.
15 |
16 | This macro returns a 16-bit value built from the two ASCII characters specified
17 | by A and B.
18 |
19 | @param A The first ASCII character.
20 | @param B The second ASCII character.
21 |
22 | @return A 16-bit value built from the two ASCII characters specified by A and B.
23 |
24 | **/
25 | #define SIGNATURE_16(A, B) ((A) | (B << 8))
26 |
27 | /**
28 | Returns a 32-bit signature built from 4 ASCII characters.
29 |
30 | This macro returns a 32-bit value built from the four ASCII characters specified
31 | by A, B, C, and D.
32 |
33 | @param A The first ASCII character.
34 | @param B The second ASCII character.
35 | @param C The third ASCII character.
36 | @param D The fourth ASCII character.
37 |
38 | @return A 32-bit value built from the two ASCII characters specified by A, B,
39 | C and D.
40 |
41 | **/
42 | #define SIGNATURE_32(A, B, C, D) (SIGNATURE_16 (A, B) | (SIGNATURE_16 (C, D) << 16))
43 |
44 | /**
45 | Returns a 64-bit signature built from 8 ASCII characters.
46 |
47 | This macro returns a 64-bit value built from the eight ASCII characters specified
48 | by A, B, C, D, E, F, G,and H.
49 |
50 | @param A The first ASCII character.
51 | @param B The second ASCII character.
52 | @param C The third ASCII character.
53 | @param D The fourth ASCII character.
54 | @param E The fifth ASCII character.
55 | @param F The sixth ASCII character.
56 | @param G The seventh ASCII character.
57 | @param H The eighth ASCII character.
58 |
59 | @return A 64-bit value built from the two ASCII characters specified by A, B,
60 | C, D, E, F, G and H.
61 |
62 | **/
63 | #define SIGNATURE_64(A, B, C, D, E, F, G, H) \
64 | (SIGNATURE_32 (A, B, C, D) | ((UINT64) (SIGNATURE_32 (E, F, G, H)) << 32))
65 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | ACPIPatcher: S0ix disabler
2 | =======================================
3 |
4 | ## This EFI application lets you to disable Windows Modern Standby / Connected Standby / S0 Sleep on ANY platform.
5 |
6 | ## Dell's Modern Standby SUCKS!
7 |
8 | This repo does exactly the **opposite** to the original repo. Great thanks to @imbushuo.
9 |
10 | This simple UEFI application patches your ACPI table to force disable S0 Low Power State
11 | (aka. [Connected Standby](https://docs.microsoft.com/en-us/windows-hardware/design/device-experiences/modern-standby))
12 | regardless of platform configuration. Currently you have to run
13 | it every time before booting into Windows.
14 |
15 | ## Notes
16 |
17 | Microsoft reported that
18 | ```
19 | Please note that Windows do not support seamless transition between ACPI S3 and S0ix. A fresh installation is required.
20 | ```
21 | But, before `Win 10 20H1` update, you can simply disable S0 and use S3 by setting `CsEnabled=0` in the register editor.
22 | Microsoft has removed it since `Win 10 20H1` update, and setting the register will not take any effect.
23 | After Windows 11 is released, Microsoft quietly added this option back, but renamed it into `PlatformAoAcOverride`.
24 |
25 | Therefore, unless you are sticking with Windows 10, you should first play the registry hack, since it's much easier than
26 | using this project. Please let me know if you find a situation where this project is especially desired and useful.
27 |
28 | ## Prerequisites
29 |
30 | * [Visual Studio 2017](https://www.visualstudio.com/vs/community/) or gcc/make
31 | * git
32 |
33 | ## Sub-Module initialization
34 |
35 | For convenience, the project relies on the gnu-efi library, so you need to initialize the git
36 | submodule either through git commandline with:
37 | ```
38 | git submodule init
39 | git submodule update
40 | ```
41 | Or, if using a UI client (such as TortoiseGit) by selecting _Submodule Update_ in the context menu.
42 |
43 | ## Compilation and testing
44 |
45 | Just build project in Visual Studio.
46 |
47 | ## Visual Studio 2017 and ARM/ARM64 support
48 |
49 | Please be mindful that, to enable ARM or ARM64 compilation support in Visual Studio
50 | 2017, you __MUST__ go to the _Individual components_ screen in the setup application
51 | and select the ARM/ARM64 compilers and libraries there, as they do __NOT__ appear in
52 | the default _Workloads_ screen:
53 |
54 | 
55 |
56 | You also need to ensure that you have Windows SDK 10.0.14393.0 or later installed,
57 | as this is the minimum version with support for ARM64.
58 |
59 | ## Usage
60 |
61 | First, you need to install [rEFInd](https://www.rodsbooks.com/refind/).
62 |
63 | Then, put the binary to `/EFI/refind/drivers_{arch}` and it should work.
64 |
65 | ## Known issues
66 |
67 | Secure boot no longer works.
68 |
--------------------------------------------------------------------------------
/contrib/uefi-simple.vcxproj.filters:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | {4FC737F1-C7A5-4376-A066-2A32D752A2FF}
6 | cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx
7 |
8 |
9 | {93995380-89BD-4b04-88EB-625FBE52EBFB}
10 | h;hh;hpp;hxx;hm;inl;inc;xsd
11 |
12 |
13 | {9559aac2-5d32-43e6-a280-85a7b26cd759}
14 |
15 |
16 | {bcdd33c9-6cdf-427e-a1c1-91c066a93c3c}
17 |
18 |
19 | {805e6ccb-a846-4626-803c-249779602785}
20 |
21 |
22 | {b1c3b304-e868-4b07-988c-36ad7bc57300}
23 |
24 |
25 |
26 |
27 | Resource Files
28 |
29 |
30 |
31 |
32 | Header Files\IndustryStandard\Acpi
33 |
34 |
35 | Header Files\IndustryStandard\Acpi
36 |
37 |
38 | Header Files\IndustryStandard\Acpi
39 |
40 |
41 | Header Files\IndustryStandard\Acpi
42 |
43 |
44 | Header Files\IndustryStandard\Acpi
45 |
46 |
47 | Header Files\IndustryStandard\Acpi
48 |
49 |
50 | Header Files\IndustryStandard\Acpi
51 |
52 |
53 | Header Files\IndustryStandard\Acpi
54 |
55 |
56 | Header Files\Edk2
57 |
58 |
59 |
60 |
61 | Source Files
62 |
63 |
64 |
--------------------------------------------------------------------------------
/contrib/uefi-simple.vcxproj.user:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | $(SystemRoot)\System32\wscript
5 | //d debug.vbs "$(TargetPath)" "$(PlatformShortName)"
6 | WindowsLocalDebugger
7 | $(SolutionDir)
8 |
9 |
10 | $(SystemRoot)\System32\wscript
11 | //d debug.vbs "$(TargetPath)" "$(PlatformShortName)"
12 | WindowsLocalDebugger
13 | $(SolutionDir)
14 |
15 |
16 | $(SystemRoot)\System32\wscript
17 | //d debug.vbs "$(TargetPath)" "$(PlatformShortName)"
18 | WindowsLocalDebugger
19 | $(SolutionDir)
20 |
21 |
22 | $(SystemRoot)\System32\wscript
23 | //d debug.vbs "$(TargetPath)" "$(PlatformShortName)"
24 | WindowsLocalDebugger
25 | $(SolutionDir)
26 |
27 |
28 | $(SystemRoot)\System32\wscript
29 | //d debug.vbs "$(TargetPath)" "$(PlatformShortName)"
30 | WindowsLocalDebugger
31 | $(SolutionDir)
32 |
33 |
34 | $(SystemRoot)\System32\wscript
35 | //d debug.vbs "$(TargetPath)" "$(PlatformShortName)"
36 | WindowsLocalDebugger
37 | $(SolutionDir)
38 |
39 |
40 | $(SystemRoot)\System32\wscript
41 | //d debug.vbs "$(TargetPath)" "$(PlatformShortName)"
42 | WindowsLocalDebugger
43 | $(SolutionDir)
44 |
45 |
46 | $(SystemRoot)\System32\wscript
47 | //d debug.vbs "$(TargetPath)" "$(PlatformShortName)"
48 | WindowsLocalDebugger
49 | $(SolutionDir)
50 |
51 |
--------------------------------------------------------------------------------
/AcpiPatcher.sln:
--------------------------------------------------------------------------------
1 |
2 | Microsoft Visual Studio Solution File, Format Version 12.00
3 | # Visual Studio 15
4 | VisualStudioVersion = 15.0.27004.2006
5 | MinimumVisualStudioVersion = 10.0.40219.1
6 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "uefi-simple", "contrib\uefi-simple.vcxproj", "{DFA0BA98-D0BA-4176-9A34-B5BA6355B1DE}"
7 | ProjectSection(ProjectDependencies) = postProject
8 | {3135D563-9596-4584-9ED6-616ADEC52974} = {3135D563-9596-4584-9ED6-616ADEC52974}
9 | EndProjectSection
10 | EndProject
11 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "gnu-efi", "contrib\gnu-efi.vcxproj", "{3135D563-9596-4584-9ED6-616ADEC52974}"
12 | EndProject
13 | Global
14 | GlobalSection(SolutionConfigurationPlatforms) = preSolution
15 | Debug|arm = Debug|arm
16 | Debug|aa64 = Debug|aa64
17 | Debug|ia32 = Debug|ia32
18 | Debug|x64 = Debug|x64
19 | Release|arm = Release|arm
20 | Release|aa64 = Release|aa64
21 | Release|ia32 = Release|ia32
22 | Release|x64 = Release|x64
23 | EndGlobalSection
24 | GlobalSection(ProjectConfigurationPlatforms) = postSolution
25 | {DFA0BA98-D0BA-4176-9A34-B5BA6355B1DE}.Debug|arm.ActiveCfg = Debug|ARM
26 | {DFA0BA98-D0BA-4176-9A34-B5BA6355B1DE}.Debug|arm.Build.0 = Debug|ARM
27 | {DFA0BA98-D0BA-4176-9A34-B5BA6355B1DE}.Debug|aa64.ActiveCfg = Debug|ARM64
28 | {DFA0BA98-D0BA-4176-9A34-B5BA6355B1DE}.Debug|aa64.Build.0 = Debug|ARM64
29 | {DFA0BA98-D0BA-4176-9A34-B5BA6355B1DE}.Debug|ia32.ActiveCfg = Debug|Win32
30 | {DFA0BA98-D0BA-4176-9A34-B5BA6355B1DE}.Debug|ia32.Build.0 = Debug|Win32
31 | {DFA0BA98-D0BA-4176-9A34-B5BA6355B1DE}.Debug|x64.ActiveCfg = Debug|x64
32 | {DFA0BA98-D0BA-4176-9A34-B5BA6355B1DE}.Debug|x64.Build.0 = Debug|x64
33 | {DFA0BA98-D0BA-4176-9A34-B5BA6355B1DE}.Release|arm.ActiveCfg = Release|ARM
34 | {DFA0BA98-D0BA-4176-9A34-B5BA6355B1DE}.Release|arm.Build.0 = Release|ARM
35 | {DFA0BA98-D0BA-4176-9A34-B5BA6355B1DE}.Release|aa64.ActiveCfg = Release|ARM64
36 | {DFA0BA98-D0BA-4176-9A34-B5BA6355B1DE}.Release|aa64.Build.0 = Release|ARM64
37 | {DFA0BA98-D0BA-4176-9A34-B5BA6355B1DE}.Release|ia32.ActiveCfg = Release|Win32
38 | {DFA0BA98-D0BA-4176-9A34-B5BA6355B1DE}.Release|ia32.Build.0 = Release|Win32
39 | {DFA0BA98-D0BA-4176-9A34-B5BA6355B1DE}.Release|x64.ActiveCfg = Release|x64
40 | {DFA0BA98-D0BA-4176-9A34-B5BA6355B1DE}.Release|x64.Build.0 = Release|x64
41 | {3135D563-9596-4584-9ED6-616ADEC52974}.Debug|arm.ActiveCfg = Debug|ARM
42 | {3135D563-9596-4584-9ED6-616ADEC52974}.Debug|arm.Build.0 = Debug|ARM
43 | {3135D563-9596-4584-9ED6-616ADEC52974}.Debug|aa64.ActiveCfg = Debug|ARM64
44 | {3135D563-9596-4584-9ED6-616ADEC52974}.Debug|aa64.Build.0 = Debug|ARM64
45 | {3135D563-9596-4584-9ED6-616ADEC52974}.Debug|ia32.ActiveCfg = Debug|Win32
46 | {3135D563-9596-4584-9ED6-616ADEC52974}.Debug|ia32.Build.0 = Debug|Win32
47 | {3135D563-9596-4584-9ED6-616ADEC52974}.Debug|x64.ActiveCfg = Debug|x64
48 | {3135D563-9596-4584-9ED6-616ADEC52974}.Debug|x64.Build.0 = Debug|x64
49 | {3135D563-9596-4584-9ED6-616ADEC52974}.Release|arm.ActiveCfg = Release|ARM
50 | {3135D563-9596-4584-9ED6-616ADEC52974}.Release|arm.Build.0 = Release|ARM
51 | {3135D563-9596-4584-9ED6-616ADEC52974}.Release|aa64.ActiveCfg = Release|ARM64
52 | {3135D563-9596-4584-9ED6-616ADEC52974}.Release|aa64.Build.0 = Release|ARM64
53 | {3135D563-9596-4584-9ED6-616ADEC52974}.Release|ia32.ActiveCfg = Release|Win32
54 | {3135D563-9596-4584-9ED6-616ADEC52974}.Release|ia32.Build.0 = Release|Win32
55 | {3135D563-9596-4584-9ED6-616ADEC52974}.Release|x64.ActiveCfg = Release|x64
56 | {3135D563-9596-4584-9ED6-616ADEC52974}.Release|x64.Build.0 = Release|x64
57 | EndGlobalSection
58 | GlobalSection(SolutionProperties) = preSolution
59 | HideSolutionNode = FALSE
60 | EndGlobalSection
61 | GlobalSection(ExtensibilityGlobals) = postSolution
62 | SolutionGuid = {376E6530-5878-4CF4-AFB7-123F799056A2}
63 | EndGlobalSection
64 | EndGlobal
65 |
--------------------------------------------------------------------------------
/contrib/gnu-efi.vcxproj.filters:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | {4FC737F1-C7A5-4376-A066-2A32D752A2FF}
6 | cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx
7 |
8 |
9 | {93995380-89BD-4b04-88EB-625FBE52EBFB}
10 | h;hh;hpp;hxx;hm;inl;inc;xsd
11 |
12 |
13 | {20c8e9bd-0fa8-46d3-b825-e3eebd64ab3d}
14 |
15 |
16 | {87122940-e80f-416d-a840-5e32f703f3ff}
17 |
18 |
19 | {e6e3d25a-4fce-4036-bef9-3cfbafc4baaf}
20 |
21 |
22 | {cf7e7031-77e5-4827-9aa6-f996fc4b3d06}
23 |
24 |
25 |
26 |
27 | Source Files
28 |
29 |
30 | Source Files
31 |
32 |
33 | Source Files
34 |
35 |
36 | Source Files
37 |
38 |
39 | Source Files
40 |
41 |
42 | Source Files
43 |
44 |
45 | Source Files
46 |
47 |
48 | Source Files
49 |
50 |
51 | Source Files
52 |
53 |
54 | Source Files
55 |
56 |
57 | Source Files
58 |
59 |
60 | Source Files
61 |
62 |
63 | Source Files
64 |
65 |
66 | Source Files
67 |
68 |
69 | Source Files
70 |
71 |
72 | Source Files
73 |
74 |
75 | Source Files
76 |
77 |
78 | Source Files
79 |
80 |
81 | Source Files
82 |
83 |
84 | Source Files
85 |
86 |
87 | Source Files\aarch64
88 |
89 |
90 | Source Files\aarch64
91 |
92 |
93 | Source Files\ia32
94 |
95 |
96 | Source Files\ia32
97 |
98 |
99 | Source Files\x86_64
100 |
101 |
102 | Source Files\x86_64
103 |
104 |
105 | Source Files\arm
106 |
107 |
108 | Source Files\arm
109 |
110 |
111 | Source Files
112 |
113 |
114 | Source Files
115 |
116 |
117 | Source Files
118 |
119 |
120 | Source Files
121 |
122 |
123 | Source Files
124 |
125 |
126 |
127 |
128 | Source Files
129 |
130 |
131 |
--------------------------------------------------------------------------------
/debug.vbs:
--------------------------------------------------------------------------------
1 | ' Visual Studio QEMU debugging script.
2 | '
3 | ' I like invoking vbs as much as anyone else, but we need to download and unzip our
4 | ' firmware file, as well as launch QEMU, and neither Powershell or a standard batch
5 | ' can do that without having an extra console appearing.
6 | '
7 | ' Note: You may get a prompt from the firewall when trying to download the BIOS file
8 |
9 | ' Modify these variables as needed
10 | QEMU_PATH = "C:\Program Files\qemu\"
11 | ' You can add something like "-S -gdb tcp:127.0.0.1:1234" if you plan to use gdb to debug
12 | QEMU_OPTS = "-net none -monitor none -parallel none"
13 | ' Set to True if you need to download a file that might be cached locally
14 | NO_CACHE = False
15 |
16 | ' You shouldn't have to modify anything below this
17 | TARGET = WScript.Arguments(1)
18 |
19 | If (TARGET = "x86") Then
20 | UEFI_EXT = "ia32"
21 | QEMU_ARCH = "i386"
22 | FW_BASE = "OVMF"
23 | ElseIf (TARGET = "x64") Then
24 | UEFI_EXT = "x64"
25 | QEMU_ARCH = "x86_64"
26 | FW_BASE = "OVMF"
27 | ElseIf (TARGET = "ARM") Then
28 | UEFI_EXT = "arm"
29 | QEMU_ARCH = "arm"
30 | FW_BASE = "QEMU_EFI"
31 | ' You can also add '-device VGA' to the options below, to get graphics output.
32 | ' But if you do, be mindful that the keyboard input may not work... :(
33 | QEMU_OPTS = "-M virt -cpu cortex-a15 " & QEMU_OPTS
34 | ElseIf (TARGET = "ARM64") Then
35 | UEFI_EXT = "aa64"
36 | QEMU_ARCH = "aarch64"
37 | FW_BASE = "QEMU_EFI"
38 | QEMU_OPTS = "-M virt -cpu cortex-a57 " & QEMU_OPTS
39 | Else
40 | MsgBox("Unsupported debug target: " & TARGET)
41 | Call WScript.Quit(1)
42 | End If
43 | BOOT_NAME = "boot" & UEFI_EXT & ".efi"
44 | QEMU_EXE = "qemu-system-" & QEMU_ARCH & "w.exe"
45 |
46 | FW_ARCH = UCase(UEFI_EXT)
47 | FW_DIR = "https://efi.akeo.ie/" & FW_BASE & "/"
48 | FW_ZIP = FW_BASE & "-" & FW_ARCH & ".zip"
49 | FW_FILE = FW_BASE & "_" & FW_ARCH & ".fd"
50 | FW_URL = FW_DIR & FW_ZIP
51 |
52 | ' Globals
53 | Set fso = CreateObject("Scripting.FileSystemObject")
54 | Set shell = CreateObject("WScript.Shell")
55 |
56 | ' Download a file from FTP
57 | Sub DownloadFtp(Server, Path)
58 | Set file = fso.CreateTextFile("ftp.txt", True)
59 | Call file.Write("open " & Server & vbCrLf &_
60 | "anonymous" & vbCrLf & "user" & vbCrLf & "bin" & vbCrLf &_
61 | "get " & Path & vbCrLf & "bye" & vbCrLf)
62 | Call file.Close()
63 | Call shell.Run("%comspec% /c ftp -s:ftp.txt > NUL", 0, True)
64 | Call fso.DeleteFile("ftp.txt")
65 | End Sub
66 |
67 | ' Download a file from HTTP
68 | Sub DownloadHttp(Url, File)
69 | Const BINARY = 1
70 | Const OVERWRITE = 2
71 | Set xHttp = createobject("Microsoft.XMLHTTP")
72 | Set bStrm = createobject("Adodb.Stream")
73 | Call xHttp.Open("GET", Url, False)
74 | If NO_CACHE = True Then
75 | Call xHttp.SetRequestHeader("If-None-Match", "some-random-string")
76 | Call xHttp.SetRequestHeader("Cache-Control", "no-cache,max-age=0")
77 | Call xHttp.SetRequestHeader("Pragma", "no-cache")
78 | End If
79 | Call xHttp.Send()
80 | If Not xHttp.Status = 200 Then
81 | Call WScript.Echo("Unable to access file - Error " & xHttp.Status)
82 | Call WScript.Quit(1)
83 | End If
84 | With bStrm
85 | .type = BINARY
86 | .open
87 | .write xHttp.responseBody
88 | .savetofile File, OVERWRITE
89 | End With
90 | End Sub
91 |
92 | ' Unzip a specific file from an archive
93 | Sub Unzip(Archive, File)
94 | Const NOCONFIRMATION = &H10&
95 | Const NOERRORUI = &H400&
96 | Const SIMPLEPROGRESS = &H100&
97 | unzipFlags = NOCONFIRMATION + NOERRORUI + SIMPLEPROGRESS
98 | Set objShell = CreateObject("Shell.Application")
99 | Set objSource = objShell.NameSpace(fso.GetAbsolutePathName(Archive)).Items()
100 | Set objTarget = objShell.NameSpace(fso.GetAbsolutePathName("."))
101 | ' Only extract the file we are interested in
102 | For i = 0 To objSource.Count - 1
103 | If objSource.Item(i).Name = File Then
104 | Call objTarget.CopyHere(objSource.Item(i), unzipFlags)
105 | End If
106 | Next
107 | End Sub
108 |
109 |
110 | ' Check that QEMU is available
111 | If Not fso.FileExists(QEMU_PATH & QEMU_EXE) Then
112 | Call WScript.Echo("'" & QEMU_PATH & QEMU_EXE & "' was not found." & vbCrLf &_
113 | "Please make sure QEMU is installed or edit the path in '.msvc\debug.vbs'.")
114 | Call WScript.Quit(1)
115 | End If
116 |
117 | ' Fetch the UEFI firmware and unzip it
118 | If Not fso.FileExists(FW_FILE) Then
119 | Call WScript.Echo("The UEFI firmware file, needed for QEMU, " &_
120 | "will be downloaded from: " & FW_URL & vbCrLf & vbCrLf &_
121 | "Note: Unless you delete the file, this should only happen once.")
122 | Call DownloadHttp(FW_URL, FW_ZIP)
123 | End If
124 | If Not fso.FileExists(FW_ZIP) And Not fso.FileExists(FW_FILE) Then
125 | Call WScript.Echo("There was a problem downloading the QEMU UEFI firmware.")
126 | Call WScript.Quit(1)
127 | End If
128 | If fso.FileExists(FW_ZIP) Then
129 | Call Unzip(FW_ZIP, FW_BASE & ".fd")
130 | Call fso.MoveFile(FW_BASE & ".fd", FW_FILE)
131 | Call fso.DeleteFile(FW_ZIP)
132 | End If
133 | If Not fso.FileExists(FW_FILE) Then
134 | Call WScript.Echo("There was a problem unzipping the QEMU UEFI firmware.")
135 | Call WScript.Quit(1)
136 | End If
137 |
138 | ' Copy the app file as boot application and run it in QEMU
139 | Call shell.Run("%COMSPEC% /c mkdir ""image\efi\boot""", 0, True)
140 | Call fso.CopyFile(WScript.Arguments(0), "image\efi\boot\" & BOOT_NAME, True)
141 | Call shell.Run("""" & QEMU_PATH & QEMU_EXE & """ " & QEMU_OPTS & " -L . -bios " & FW_FILE & " -hda fat:rw:image", 1, True)
142 |
--------------------------------------------------------------------------------
/src/main.c:
--------------------------------------------------------------------------------
1 | /*
2 | * AcpiPatcher: Patches FADT table to enable S0ix on supported platforms.
3 | *
4 | * Copyright 2018, Bingxing Wang. All rights reserved.
5 | * Portions copyright 2014-2018 Pete Batard .
6 | *
7 | * This program and the accompanying materials
8 | * are licensed and made available under the terms and conditions of the BSD License
9 | * which accompanies this 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 | #include
18 | #include
19 | #include
20 |
21 | UINT8 SumBytes(const UINT8* arr, UINTN size)
22 | {
23 | UINT8 sum = 0;
24 | for (UINTN i = 0; i < size; ++i)
25 | {
26 | sum += arr[i];
27 | }
28 | return sum;
29 | }
30 |
31 | int VerifyAcpiRsdp2Checksums(const void* data)
32 | {
33 | const UINT8* arr = data;
34 | UINTN size = *(const UINT32*) &arr[20];
35 | return SumBytes(arr, 20) == 0 && SumBytes(arr, size) == 0;
36 | }
37 |
38 | int VerifyAcpiSdtChecksum(const void* data)
39 | {
40 | const UINT8* arr = data;
41 | UINTN size = *(const UINT32*)&arr[4];
42 | return SumBytes(arr, size) == 0;
43 | }
44 |
45 | void SetAcpiSdtChecksum(void* data)
46 | {
47 | UINT8* arr = data;
48 | UINTN size = *(const UINT32*)&arr[4];
49 | arr[9] = 0;
50 | arr[9] = -SumBytes(arr, size);
51 | }
52 |
53 | // Application entrypoint (must be set to 'efi_main' for gnu-efi crt0 compatibility)
54 | EFI_STATUS efi_main(EFI_HANDLE ImageHandle, EFI_SYSTEM_TABLE *SystemTable)
55 | {
56 | UINTN Event;
57 | EFI_GUID Acpi20TableGuid = ACPI_20_TABLE_GUID;
58 | EFI_ACPI_2_0_ROOT_SYSTEM_DESCRIPTION_POINTER* Rsdp = NULL;
59 | EFI_ACPI_DESCRIPTION_HEADER* XsdtHeader = NULL;
60 | EFI_ACPI_5_0_FIXED_ACPI_DESCRIPTION_TABLE* Fadt = NULL;
61 |
62 | #if defined(_GNU_EFI)
63 | InitializeLib(ImageHandle, SystemTable);
64 | #endif
65 |
66 | /*
67 | * In addition to the standard %-based flags, Print() supports the following:
68 | * %N Set output attribute to normal
69 | * %H Set output attribute to highlight
70 | * %E Set output attribute to error
71 | * %B Set output attribute to blue color
72 | * %V Set output attribute to green color
73 | * %r Human readable version of a status code
74 | */
75 | Print(L"\n%HAcpiPatcher 1.0.0%N\n\n");
76 |
77 | /* Check ACPI table's existence */
78 | for (UINTN i = 0; i < gST->NumberOfTableEntries; i++)
79 | {
80 | EFI_GUID* VendorGuid = &gST->ConfigurationTable[i].VendorGuid;
81 | if (!CompareGuid(VendorGuid, &AcpiTableGuid) && !CompareGuid(VendorGuid, &Acpi20TableGuid))
82 | {
83 | Print(L"%d: Not ACPI table \n", i);
84 | continue;
85 | }
86 |
87 | Rsdp = (EFI_ACPI_2_0_ROOT_SYSTEM_DESCRIPTION_POINTER *) gST->ConfigurationTable[i].VendorTable;
88 | if (Rsdp->Signature != EFI_ACPI_2_0_ROOT_SYSTEM_DESCRIPTION_POINTER_SIGNATURE ||
89 | Rsdp->Revision < EFI_ACPI_2_0_ROOT_SYSTEM_DESCRIPTION_POINTER_REVISION ||
90 | !VerifyAcpiRsdp2Checksums(Rsdp))
91 | {
92 | Print(L"%d: Invalid ACPI RSDP table \n", i);
93 | Rsdp = NULL;
94 | continue;
95 | }
96 |
97 | Print(L"%d: RSDP Rev = %d \n", i, Rsdp->Revision);
98 | XsdtHeader = (EFI_ACPI_DESCRIPTION_HEADER*) (UINTN) Rsdp->XsdtAddress;
99 |
100 | if (XsdtHeader->Signature != EFI_ACPI_2_0_EXTENDED_SYSTEM_DESCRIPTION_TABLE_SIGNATURE ||
101 | !VerifyAcpiSdtChecksum(XsdtHeader))
102 | {
103 | Print(L"%d: Invalid ACPI XSDT table \n", i);
104 | XsdtHeader = NULL;
105 | continue;
106 | }
107 |
108 | // Finished iteration
109 | break;
110 | }
111 |
112 | if (Rsdp != NULL && XsdtHeader != NULL)
113 | {
114 | UINT64* EntryAddress = (UINT64*)&XsdtHeader[1];
115 | UINT32 EntryArraySize = (XsdtHeader->Length - sizeof(*XsdtHeader)) / sizeof(UINT64);
116 |
117 | Print(L"XSDT: Count = %d\n", EntryArraySize);
118 | for (UINT32 j = 0; j < EntryArraySize; j++)
119 | {
120 | EFI_ACPI_DESCRIPTION_HEADER* Entry = (EFI_ACPI_DESCRIPTION_HEADER*)((UINTN)EntryAddress[j]);
121 | if (Entry->Signature != EFI_ACPI_2_0_FIXED_ACPI_DESCRIPTION_TABLE_SIGNATURE)
122 | {
123 | Print(L"%d: Not FADT table \n", j);
124 | continue;
125 | }
126 |
127 | if (Entry->Revision < EFI_ACPI_5_0_FIXED_ACPI_DESCRIPTION_TABLE_REVISION)
128 | {
129 | Print(L"%d: FADT revision is below ACPI 5.0 \n", j);
130 | continue;
131 | }
132 |
133 | Print(L"FADT table located. \n");
134 |
135 | // Iteration completed
136 | Fadt = (EFI_ACPI_5_0_FIXED_ACPI_DESCRIPTION_TABLE*) Entry;
137 | break;
138 | }
139 | }
140 |
141 | if (Fadt != NULL)
142 | {
143 | Print(L"FADT Flags: 0x%x \n", Fadt->Flags);
144 |
145 | if ((Fadt->Flags >> 21) & 1U)
146 | {
147 | Print(L"S0 Low Power Idle State Flag is enabled on this platform \n");
148 |
149 | Print(L"Setting S0 Low Power Idle State Flag \n");
150 |
151 | // Low Power S0 Idle (V5) is bit 21, disable it
152 | Fadt->Flags &= ~(1UL<< 21);
153 |
154 | // Re-calc checksum
155 | Print(L"Setting new checksum \n");
156 | SetAcpiSdtChecksum(Fadt);
157 |
158 | Print(L"FADT patch completed. \n");
159 | Print(L"FADT Flags after patch: 0x%x \n", Fadt->Flags);
160 | }
161 | else
162 | {
163 | Print(L"S0 Low Power Idle State Flag is already disabled on this platform \n");
164 | }
165 | }
166 |
167 | Print(L"%EPress any key to exit.%N\n");
168 | SystemTable->ConIn->Reset(SystemTable->ConIn, FALSE);
169 | SystemTable->BootServices->WaitForEvent(1, &SystemTable->ConIn->WaitForKey, &Event);
170 |
171 | return EFI_SUCCESS;
172 | }
173 |
--------------------------------------------------------------------------------
/Makefile:
--------------------------------------------------------------------------------
1 | ARCH = x64
2 | # You can alter the subsystem according to your EFI binary target:
3 | # 10 = EFI application
4 | # 11 = EFI boot service driver
5 | # 12 = EFI runtime driver
6 | SUBSYSTEM = 10
7 |
8 | # Try to auto-detect the target ARCH
9 | ifeq ($(shell uname -o),Msys)
10 | IS_MINGW32 = $(findstring MINGW32,$(shell uname -s))
11 | IS_MINGW64 = $(findstring MINGW64,$(shell uname -s))
12 | ifeq ($(IS_MINGW32),MINGW32)
13 | ARCH = ia32
14 | endif
15 | ifeq ($(IS_MINGW64),MINGW64)
16 | ARCH = x64
17 | endif
18 | else
19 | ifeq ($(shell uname -m),x86_64)
20 | ARCH = x64
21 | else ifeq ($(shell uname -m),arm)
22 | ARCH = arm
23 | CROSS_COMPILE =
24 | else ifeq ($(shell uname -m),aarch64)
25 | ARCH = aa64
26 | CROSS_COMPILE =
27 | else
28 | ARCH = ia32
29 | endif
30 | endif
31 |
32 | # Auto-detect the host arch for MinGW
33 | ifeq ($(shell uname -m),x86_64)
34 | MINGW_HOST = w64
35 | else
36 | MINGW_HOST = w32
37 | endif
38 |
39 | ifeq ($(ARCH),x64)
40 | GNUEFI_ARCH = x86_64
41 | GCC_ARCH = x86_64
42 | QEMU_ARCH = x86_64
43 | FW_BASE = OVMF
44 | CROSS_COMPILE = $(GCC_ARCH)-$(MINGW_HOST)-mingw32-
45 | EP_PREFIX =
46 | CFLAGS = -m64 -mno-red-zone
47 | LDFLAGS = -Wl,-dll -Wl,--subsystem,$(SUBSYSTEM)
48 | else ifeq ($(ARCH),ia32)
49 | GNUEFI_ARCH = ia32
50 | GCC_ARCH = i686
51 | QEMU_ARCH = i386
52 | FW_BASE = OVMF
53 | CROSS_COMPILE = $(GCC_ARCH)-$(MINGW_HOST)-mingw32-
54 | EP_PREFIX = _
55 | CFLAGS = -m32 -mno-red-zone
56 | LDFLAGS = -Wl,-dll -Wl,--subsystem,$(SUBSYSTEM)
57 | else ifeq ($(ARCH),arm)
58 | GNUEFI_ARCH = arm
59 | GCC_ARCH = arm
60 | QEMU_ARCH = arm
61 | FW_BASE = QEMU_EFI
62 | CROSS_COMPILE = $(GCC_ARCH)-linux-gnueabihf-
63 | EP_PREFIX =
64 | CFLAGS = -marm -fpic -fshort-wchar
65 | LDFLAGS = -Wl,--no-wchar-size-warning -Wl,--defsym=EFI_SUBSYSTEM=$(SUBSYSTEM)
66 | CRT0_LIBS = -lgnuefi
67 | QEMU_OPTS = -M virt -cpu cortex-a15
68 | else ifeq ($(ARCH),aa64)
69 | GNUEFI_ARCH = aarch64
70 | GCC_ARCH = aarch64
71 | QEMU_ARCH = aarch64
72 | FW_BASE = QEMU_EFI
73 | CROSS_COMPILE = $(GCC_ARCH)-linux-gnu-
74 | EP_PREFIX =
75 | CFLAGS = -fpic -fshort-wchar
76 | LDFLAGS = -Wl,--no-wchar-size-warning -Wl,--defsym=EFI_SUBSYSTEM=$(SUBSYSTEM)
77 | CRT0_LIBS = -lgnuefi
78 | QEMU_OPTS = -M virt -cpu cortex-a57
79 | endif
80 | FW_ARCH = $(shell echo $(ARCH) | tr a-z A-Z)
81 | FW_ZIP = $(FW_BASE)-$(FW_ARCH).zip
82 | GNUEFI_DIR = $(CURDIR)/gnu-efi
83 | GNUEFI_LIBS = lib
84 |
85 | # If the compiler produces an elf binary, we need to fiddle with a PE crt0
86 | ifneq ($(CRT0_LIBS),)
87 | CRT0_DIR = $(GNUEFI_DIR)/$(GNUEFI_ARCH)/gnuefi
88 | LDFLAGS += -L$(CRT0_DIR) -T $(GNUEFI_DIR)/gnuefi/elf_$(GNUEFI_ARCH)_efi.lds $(CRT0_DIR)/crt0-efi-$(GNUEFI_ARCH).o
89 | GNUEFI_LIBS += gnuefi
90 | endif
91 |
92 | # SYSTEMROOT is only defined on Windows systems
93 | ifneq ($(SYSTEMROOT),)
94 | QEMU = "/c/Program Files/qemu/qemu-system-$(QEMU_ARCH)w.exe"
95 | # MinGW on Windows doesn't use (tuple)-ar but (tuple)-gcc-ar
96 | # so we remove the cross compiler tuple altogether
97 | CROSS_COMPILE =
98 | else
99 | QEMU = qemu-system-$(QEMU_ARCH) -nographic
100 | endif
101 |
102 | CC := $(CROSS_COMPILE)gcc
103 | OBJCOPY := $(CROSS_COMPILE)objcopy
104 | CFLAGS += -fno-stack-protector -Wshadow -Wall -Wunused -Werror-implicit-function-declaration
105 | CFLAGS += -I$(GNUEFI_DIR)/inc -I$(GNUEFI_DIR)/inc/$(GNUEFI_ARCH) -I$(GNUEFI_DIR)/inc/protocol
106 | CFLAGS += -DCONFIG_$(GNUEFI_ARCH) -D__MAKEWITH_GNUEFI -DGNU_EFI_USE_MS_ABI
107 | LDFLAGS += -L$(GNUEFI_DIR)/$(GNUEFI_ARCH)/lib -e $(EP_PREFIX)efi_main
108 | LDFLAGS += -s -Wl,-Bsymbolic -nostdlib -shared
109 | LIBS = -lefi $(CRT0_LIBS)
110 |
111 | ifeq (, $(shell which $(CC)))
112 | $(error The selected compiler ($(CC)) was not found)
113 | endif
114 |
115 | GCCVERSION := $(shell $(CC) -dumpversion | cut -f1 -d.)
116 | GCCMINOR := $(shell $(CC) -dumpversion | cut -f2 -d.)
117 | GCCMACHINE := $(shell $(CC) -dumpmachine)
118 | GCCNEWENOUGH := $(shell ( [ $(GCCVERSION) -gt "4" ] \
119 | || ( [ $(GCCVERSION) -eq "4" ] \
120 | && [ $(GCCMINOR) -ge "7" ] ) ) \
121 | && echo 1)
122 | ifneq ($(GCCNEWENOUGH),1)
123 | $(error You need GCC 4.7 or later)
124 | endif
125 |
126 | ifneq ($(GCC_ARCH),$(findstring $(GCC_ARCH), $(GCCMACHINE)))
127 | $(error The selected compiler ($(CC)) is not set for $(ARCH))
128 | endif
129 |
130 | .PHONY: all clean superclean
131 | all: $(GNUEFI_DIR)/$(GNUEFI_ARCH)/lib/libefi.a main.efi
132 |
133 | $(GNUEFI_DIR)/$(GNUEFI_ARCH)/lib/libefi.a:
134 | $(MAKE) -C$(GNUEFI_DIR) CROSS_COMPILE=$(CROSS_COMPILE) ARCH=$(GNUEFI_ARCH) $(GNUEFI_LIBS)
135 |
136 | %.efi: %.o
137 | @echo [LD] $(notdir $@)
138 | ifeq ($(CRT0_LIBS),)
139 | @$(CC) $(LDFLAGS) $< -o $@ $(LIBS)
140 | else
141 | @$(CC) $(LDFLAGS) $< -o $*.elf $(LIBS)
142 | @$(OBJCOPY) -j .text -j .sdata -j .data -j .dynamic -j .dynsym -j .rel* \
143 | -j .rela* -j .reloc -j .eh_frame -O binary $*.elf $@
144 | @rm -f $*.elf
145 | endif
146 |
147 | %.o: %.c
148 | @echo [CC] $(notdir $@)
149 | @$(CC) $(CFLAGS) -ffreestanding -c $<
150 |
151 | qemu: CFLAGS += -D_DEBUG
152 | qemu: all $(FW_BASE)_$(FW_ARCH).fd image/efi/boot/boot$(ARCH).efi
153 | $(QEMU) $(QEMU_OPTS) -bios ./$(FW_BASE)_$(FW_ARCH).fd -net none -hda fat:rw:image
154 |
155 | image/efi/boot/boot$(ARCH).efi: main.efi
156 | mkdir -p image/efi/boot
157 | cp -f $< $@
158 |
159 | $(FW_BASE)_$(FW_ARCH).fd:
160 | wget https://efi.akeo.ie/$(FW_BASE)/$(FW_ZIP)
161 | unzip $(FW_ZIP) $(FW_BASE).fd
162 | mv $(FW_BASE).fd $(FW_BASE)_$(FW_ARCH).fd
163 | rm $(FW_ZIP)
164 |
165 | clean:
166 | rm -f main.efi *.o
167 | rm -rf image
168 |
169 | superclean: clean
170 | $(MAKE) -C$(GNUEFI_DIR) ARCH=$(GNUEFI_ARCH) clean
171 | rm -f *.fd
172 |
--------------------------------------------------------------------------------
/Includes/IndustryStandard/AcpiAml.h:
--------------------------------------------------------------------------------
1 | /** @file
2 | This file contains AML code definition in the latest ACPI spec.
3 |
4 | Copyright (c) 2011, Intel Corporation. All rights reserved.
5 | This program and the accompanying materials
6 | are licensed and made available under the terms and conditions of the BSD License
7 | which accompanies this distribution. The full text of the license may be found at
8 | http://opensource.org/licenses/bsd-license.php
9 |
10 | THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
11 | WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
12 |
13 | **/
14 |
15 | #ifndef _ACPI_AML_H_
16 | #define _ACPI_AML_H_
17 |
18 | //
19 | // ACPI AML definition
20 | //
21 |
22 | //
23 | // Primary OpCode
24 | //
25 | #define AML_ZERO_OP 0x00
26 | #define AML_ONE_OP 0x01
27 | #define AML_ALIAS_OP 0x06
28 | #define AML_NAME_OP 0x08
29 | #define AML_BYTE_PREFIX 0x0a
30 | #define AML_WORD_PREFIX 0x0b
31 | #define AML_DWORD_PREFIX 0x0c
32 | #define AML_STRING_PREFIX 0x0d
33 | #define AML_QWORD_PREFIX 0x0e
34 | #define AML_SCOPE_OP 0x10
35 | #define AML_BUFFER_OP 0x11
36 | #define AML_PACKAGE_OP 0x12
37 | #define AML_VAR_PACKAGE_OP 0x13
38 | #define AML_METHOD_OP 0x14
39 | #define AML_DUAL_NAME_PREFIX 0x2e
40 | #define AML_MULTI_NAME_PREFIX 0x2f
41 | #define AML_NAME_CHAR_A 0x41
42 | #define AML_NAME_CHAR_B 0x42
43 | #define AML_NAME_CHAR_C 0x43
44 | #define AML_NAME_CHAR_D 0x44
45 | #define AML_NAME_CHAR_E 0x45
46 | #define AML_NAME_CHAR_F 0x46
47 | #define AML_NAME_CHAR_G 0x47
48 | #define AML_NAME_CHAR_H 0x48
49 | #define AML_NAME_CHAR_I 0x49
50 | #define AML_NAME_CHAR_J 0x4a
51 | #define AML_NAME_CHAR_K 0x4b
52 | #define AML_NAME_CHAR_L 0x4c
53 | #define AML_NAME_CHAR_M 0x4d
54 | #define AML_NAME_CHAR_N 0x4e
55 | #define AML_NAME_CHAR_O 0x4f
56 | #define AML_NAME_CHAR_P 0x50
57 | #define AML_NAME_CHAR_Q 0x51
58 | #define AML_NAME_CHAR_R 0x52
59 | #define AML_NAME_CHAR_S 0x53
60 | #define AML_NAME_CHAR_T 0x54
61 | #define AML_NAME_CHAR_U 0x55
62 | #define AML_NAME_CHAR_V 0x56
63 | #define AML_NAME_CHAR_W 0x57
64 | #define AML_NAME_CHAR_X 0x58
65 | #define AML_NAME_CHAR_Y 0x59
66 | #define AML_NAME_CHAR_Z 0x5a
67 | #define AML_ROOT_CHAR 0x5c
68 | #define AML_PARENT_PREFIX_CHAR 0x5e
69 | #define AML_NAME_CHAR__ 0x5f
70 | #define AML_LOCAL0 0x60
71 | #define AML_LOCAL1 0x61
72 | #define AML_LOCAL2 0x62
73 | #define AML_LOCAL3 0x63
74 | #define AML_LOCAL4 0x64
75 | #define AML_LOCAL5 0x65
76 | #define AML_LOCAL6 0x66
77 | #define AML_LOCAL7 0x67
78 | #define AML_ARG0 0x68
79 | #define AML_ARG1 0x69
80 | #define AML_ARG2 0x6a
81 | #define AML_ARG3 0x6b
82 | #define AML_ARG4 0x6c
83 | #define AML_ARG5 0x6d
84 | #define AML_ARG6 0x6e
85 | #define AML_STORE_OP 0x70
86 | #define AML_REF_OF_OP 0x71
87 | #define AML_ADD_OP 0x72
88 | #define AML_CONCAT_OP 0x73
89 | #define AML_SUBTRACT_OP 0x74
90 | #define AML_INCREMENT_OP 0x75
91 | #define AML_DECREMENT_OP 0x76
92 | #define AML_MULTIPLY_OP 0x77
93 | #define AML_DIVIDE_OP 0x78
94 | #define AML_SHIFT_LEFT_OP 0x79
95 | #define AML_SHIFT_RIGHT_OP 0x7a
96 | #define AML_AND_OP 0x7b
97 | #define AML_NAND_OP 0x7c
98 | #define AML_OR_OP 0x7d
99 | #define AML_NOR_OP 0x7e
100 | #define AML_XOR_OP 0x7f
101 | #define AML_NOT_OP 0x80
102 | #define AML_FIND_SET_LEFT_BIT_OP 0x81
103 | #define AML_FIND_SET_RIGHT_BIT_OP 0x82
104 | #define AML_DEREF_OF_OP 0x83
105 | #define AML_CONCAT_RES_OP 0x84
106 | #define AML_MOD_OP 0x85
107 | #define AML_NOTIFY_OP 0x86
108 | #define AML_SIZE_OF_OP 0x87
109 | #define AML_INDEX_OP 0x88
110 | #define AML_MATCH_OP 0x89
111 | #define AML_CREATE_DWORD_FIELD_OP 0x8a
112 | #define AML_CREATE_WORD_FIELD_OP 0x8b
113 | #define AML_CREATE_BYTE_FIELD_OP 0x8c
114 | #define AML_CREATE_BIT_FIELD_OP 0x8d
115 | #define AML_OBJECT_TYPE_OP 0x8e
116 | #define AML_CREATE_QWORD_FIELD_OP 0x8f
117 | #define AML_LAND_OP 0x90
118 | #define AML_LOR_OP 0x91
119 | #define AML_LNOT_OP 0x92
120 | #define AML_LEQUAL_OP 0x93
121 | #define AML_LGREATER_OP 0x94
122 | #define AML_LLESS_OP 0x95
123 | #define AML_TO_BUFFER_OP 0x96
124 | #define AML_TO_DEC_STRING_OP 0x97
125 | #define AML_TO_HEX_STRING_OP 0x98
126 | #define AML_TO_INTEGER_OP 0x99
127 | #define AML_TO_STRING_OP 0x9c
128 | #define AML_COPY_OBJECT_OP 0x9d
129 | #define AML_MID_OP 0x9e
130 | #define AML_CONTINUE_OP 0x9f
131 | #define AML_IF_OP 0xa0
132 | #define AML_ELSE_OP 0xa1
133 | #define AML_WHILE_OP 0xa2
134 | #define AML_NOOP_OP 0xa3
135 | #define AML_RETURN_OP 0xa4
136 | #define AML_BREAK_OP 0xa5
137 | #define AML_BREAK_POINT_OP 0xcc
138 | #define AML_ONES_OP 0xff
139 |
140 | //
141 | // Extended OpCode
142 | //
143 | #define AML_EXT_OP 0x5b
144 |
145 | #define AML_EXT_MUTEX_OP 0x01
146 | #define AML_EXT_EVENT_OP 0x02
147 | #define AML_EXT_COND_REF_OF_OP 0x12
148 | #define AML_EXT_CREATE_FIELD_OP 0x13
149 | #define AML_EXT_LOAD_TABLE_OP 0x1f
150 | #define AML_EXT_LOAD_OP 0x20
151 | #define AML_EXT_STALL_OP 0x21
152 | #define AML_EXT_SLEEP_OP 0x22
153 | #define AML_EXT_ACQUIRE_OP 0x23
154 | #define AML_EXT_SIGNAL_OP 0x24
155 | #define AML_EXT_WAIT_OP 0x25
156 | #define AML_EXT_RESET_OP 0x26
157 | #define AML_EXT_RELEASE_OP 0x27
158 | #define AML_EXT_FROM_BCD_OP 0x28
159 | #define AML_EXT_TO_BCD_OP 0x29
160 | #define AML_EXT_UNLOAD_OP 0x2a
161 | #define AML_EXT_REVISION_OP 0x30
162 | #define AML_EXT_DEBUG_OP 0x31
163 | #define AML_EXT_FATAL_OP 0x32
164 | #define AML_EXT_TIMER_OP 0x33
165 | #define AML_EXT_REGION_OP 0x80
166 | #define AML_EXT_FIELD_OP 0x81
167 | #define AML_EXT_DEVICE_OP 0x82
168 | #define AML_EXT_PROCESSOR_OP 0x83
169 | #define AML_EXT_POWER_RES_OP 0x84
170 | #define AML_EXT_THERMAL_ZONE_OP 0x85
171 | #define AML_EXT_INDEX_FIELD_OP 0x86
172 | #define AML_EXT_BANK_FIELD_OP 0x87
173 | #define AML_EXT_DATA_REGION_OP 0x88
174 |
175 | #endif
176 |
--------------------------------------------------------------------------------
/Includes/IndustryStandard/Acpi20.h:
--------------------------------------------------------------------------------
1 | /** @file
2 | ACPI 2.0 definitions from the ACPI Specification, revision 2.0
3 |
4 | Copyright (c) 2006 - 2011, Intel Corporation. All rights reserved.
5 | This program and the accompanying materials
6 | are licensed and made available under the terms and conditions of the BSD License
7 | which accompanies this distribution. The full text of the license may be found at
8 | http://opensource.org/licenses/bsd-license.php
9 |
10 | THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
11 | WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
12 | **/
13 |
14 | #ifndef _ACPI_2_0_H_
15 | #define _ACPI_2_0_H_
16 |
17 | #include
18 |
19 | //
20 | // Define for Desriptor
21 | //
22 | #define ACPI_LARGE_GENERIC_REGISTER_DESCRIPTOR_NAME 0x02
23 |
24 | #define ACPI_GENERIC_REGISTER_DESCRIPTOR 0x82
25 |
26 | //
27 | // Ensure proper structure formats
28 | //
29 | #pragma pack(1)
30 |
31 | ///
32 | /// Generic Register Descriptor
33 | ///
34 | typedef PACKED struct {
35 | ACPI_LARGE_RESOURCE_HEADER Header;
36 | UINT8 AddressSpaceId;
37 | UINT8 RegisterBitWidth;
38 | UINT8 RegisterBitOffset;
39 | UINT8 AddressSize;
40 | UINT64 RegisterAddress;
41 | } EFI_ACPI_GENERIC_REGISTER_DESCRIPTOR;
42 |
43 | #pragma pack()
44 |
45 | //
46 | // Ensure proper structure formats
47 | //
48 | #pragma pack(1)
49 |
50 | ///
51 | /// ACPI 2.0 Generic Address Space definition
52 | ///
53 | typedef struct {
54 | UINT8 AddressSpaceId;
55 | UINT8 RegisterBitWidth;
56 | UINT8 RegisterBitOffset;
57 | UINT8 Reserved;
58 | UINT64 Address;
59 | } EFI_ACPI_2_0_GENERIC_ADDRESS_STRUCTURE;
60 |
61 | //
62 | // Generic Address Space Address IDs
63 | //
64 | #define EFI_ACPI_2_0_SYSTEM_MEMORY 0
65 | #define EFI_ACPI_2_0_SYSTEM_IO 1
66 | #define EFI_ACPI_2_0_PCI_CONFIGURATION_SPACE 2
67 | #define EFI_ACPI_2_0_EMBEDDED_CONTROLLER 3
68 | #define EFI_ACPI_2_0_SMBUS 4
69 | #define EFI_ACPI_2_0_FUNCTIONAL_FIXED_HARDWARE 0x7F
70 |
71 | //
72 | // ACPI 2.0 table structures
73 | //
74 |
75 | ///
76 | /// Root System Description Pointer Structure
77 | ///
78 | typedef struct {
79 | UINT64 Signature;
80 | UINT8 Checksum;
81 | UINT8 OemId[6];
82 | UINT8 Revision;
83 | UINT32 RsdtAddress;
84 | UINT32 Length;
85 | UINT64 XsdtAddress;
86 | UINT8 ExtendedChecksum;
87 | UINT8 Reserved[3];
88 | } EFI_ACPI_2_0_ROOT_SYSTEM_DESCRIPTION_POINTER;
89 |
90 | ///
91 | /// RSD_PTR Revision (as defined in ACPI 2.0 spec.)
92 | ///
93 | #define EFI_ACPI_2_0_ROOT_SYSTEM_DESCRIPTION_POINTER_REVISION 0x02
94 |
95 | ///
96 | /// Common table header, this prefaces all ACPI tables, including FACS, but
97 | /// excluding the RSD PTR structure
98 | ///
99 | typedef struct {
100 | UINT32 Signature;
101 | UINT32 Length;
102 | } EFI_ACPI_2_0_COMMON_HEADER;
103 |
104 | //
105 | // Root System Description Table
106 | // No definition needed as it is a common description table header, the same with
107 | // EFI_ACPI_DESCRIPTION_HEADER, followed by a variable number of UINT32 table pointers.
108 | //
109 |
110 | ///
111 | /// RSDT Revision (as defined in ACPI 2.0 spec.)
112 | ///
113 | #define EFI_ACPI_2_0_ROOT_SYSTEM_DESCRIPTION_TABLE_REVISION 0x01
114 |
115 | //
116 | // Extended System Description Table
117 | // No definition needed as it is a common description table header, the same with
118 | // EFI_ACPI_DESCRIPTION_HEADER, followed by a variable number of UINT64 table pointers.
119 | //
120 |
121 | ///
122 | /// XSDT Revision (as defined in ACPI 2.0 spec.)
123 | ///
124 | #define EFI_ACPI_2_0_EXTENDED_SYSTEM_DESCRIPTION_TABLE_REVISION 0x01
125 |
126 | ///
127 | /// Fixed ACPI Description Table Structure (FADT)
128 | ///
129 | typedef struct {
130 | EFI_ACPI_DESCRIPTION_HEADER Header;
131 | UINT32 FirmwareCtrl;
132 | UINT32 Dsdt;
133 | UINT8 Reserved0;
134 | UINT8 PreferredPmProfile;
135 | UINT16 SciInt;
136 | UINT32 SmiCmd;
137 | UINT8 AcpiEnable;
138 | UINT8 AcpiDisable;
139 | UINT8 S4BiosReq;
140 | UINT8 PstateCnt;
141 | UINT32 Pm1aEvtBlk;
142 | UINT32 Pm1bEvtBlk;
143 | UINT32 Pm1aCntBlk;
144 | UINT32 Pm1bCntBlk;
145 | UINT32 Pm2CntBlk;
146 | UINT32 PmTmrBlk;
147 | UINT32 Gpe0Blk;
148 | UINT32 Gpe1Blk;
149 | UINT8 Pm1EvtLen;
150 | UINT8 Pm1CntLen;
151 | UINT8 Pm2CntLen;
152 | UINT8 PmTmrLen;
153 | UINT8 Gpe0BlkLen;
154 | UINT8 Gpe1BlkLen;
155 | UINT8 Gpe1Base;
156 | UINT8 CstCnt;
157 | UINT16 PLvl2Lat;
158 | UINT16 PLvl3Lat;
159 | UINT16 FlushSize;
160 | UINT16 FlushStride;
161 | UINT8 DutyOffset;
162 | UINT8 DutyWidth;
163 | UINT8 DayAlrm;
164 | UINT8 MonAlrm;
165 | UINT8 Century;
166 | UINT16 IaPcBootArch;
167 | UINT8 Reserved1;
168 | UINT32 Flags;
169 | EFI_ACPI_2_0_GENERIC_ADDRESS_STRUCTURE ResetReg;
170 | UINT8 ResetValue;
171 | UINT8 Reserved2[3];
172 | UINT64 XFirmwareCtrl;
173 | UINT64 XDsdt;
174 | EFI_ACPI_2_0_GENERIC_ADDRESS_STRUCTURE XPm1aEvtBlk;
175 | EFI_ACPI_2_0_GENERIC_ADDRESS_STRUCTURE XPm1bEvtBlk;
176 | EFI_ACPI_2_0_GENERIC_ADDRESS_STRUCTURE XPm1aCntBlk;
177 | EFI_ACPI_2_0_GENERIC_ADDRESS_STRUCTURE XPm1bCntBlk;
178 | EFI_ACPI_2_0_GENERIC_ADDRESS_STRUCTURE XPm2CntBlk;
179 | EFI_ACPI_2_0_GENERIC_ADDRESS_STRUCTURE XPmTmrBlk;
180 | EFI_ACPI_2_0_GENERIC_ADDRESS_STRUCTURE XGpe0Blk;
181 | EFI_ACPI_2_0_GENERIC_ADDRESS_STRUCTURE XGpe1Blk;
182 | } EFI_ACPI_2_0_FIXED_ACPI_DESCRIPTION_TABLE;
183 |
184 | ///
185 | /// FADT Version (as defined in ACPI 2.0 spec.)
186 | ///
187 | #define EFI_ACPI_2_0_FIXED_ACPI_DESCRIPTION_TABLE_REVISION 0x03
188 |
189 | //
190 | // Fixed ACPI Description Table Preferred Power Management Profile
191 | //
192 | #define EFI_ACPI_2_0_PM_PROFILE_UNSPECIFIED 0
193 | #define EFI_ACPI_2_0_PM_PROFILE_DESKTOP 1
194 | #define EFI_ACPI_2_0_PM_PROFILE_MOBILE 2
195 | #define EFI_ACPI_2_0_PM_PROFILE_WORKSTATION 3
196 | #define EFI_ACPI_2_0_PM_PROFILE_ENTERPRISE_SERVER 4
197 | #define EFI_ACPI_2_0_PM_PROFILE_SOHO_SERVER 5
198 | #define EFI_ACPI_2_0_PM_PROFILE_APPLIANCE_PC 6
199 |
200 | //
201 | // Fixed ACPI Description Table Boot Architecture Flags
202 | // All other bits are reserved and must be set to 0.
203 | //
204 | #define EFI_ACPI_2_0_LEGACY_DEVICES BIT0
205 | #define EFI_ACPI_2_0_8042 BIT1
206 |
207 | //
208 | // Fixed ACPI Description Table Fixed Feature Flags
209 | // All other bits are reserved and must be set to 0.
210 | //
211 | #define EFI_ACPI_2_0_WBINVD BIT0
212 | #define EFI_ACPI_2_0_WBINVD_FLUSH BIT1
213 | #define EFI_ACPI_2_0_PROC_C1 BIT2
214 | #define EFI_ACPI_2_0_P_LVL2_UP BIT3
215 | #define EFI_ACPI_2_0_PWR_BUTTON BIT4
216 | #define EFI_ACPI_2_0_SLP_BUTTON BIT5
217 | #define EFI_ACPI_2_0_FIX_RTC BIT6
218 | #define EFI_ACPI_2_0_RTC_S4 BIT7
219 | #define EFI_ACPI_2_0_TMR_VAL_EXT BIT8
220 | #define EFI_ACPI_2_0_DCK_CAP BIT9
221 | #define EFI_ACPI_2_0_RESET_REG_SUP BIT10
222 | #define EFI_ACPI_2_0_SEALED_CASE BIT11
223 | #define EFI_ACPI_2_0_HEADLESS BIT12
224 | #define EFI_ACPI_2_0_CPU_SW_SLP BIT13
225 |
226 | ///
227 | /// Firmware ACPI Control Structure
228 | ///
229 | typedef struct {
230 | UINT32 Signature;
231 | UINT32 Length;
232 | UINT32 HardwareSignature;
233 | UINT32 FirmwareWakingVector;
234 | UINT32 GlobalLock;
235 | UINT32 Flags;
236 | UINT64 XFirmwareWakingVector;
237 | UINT8 Version;
238 | UINT8 Reserved[31];
239 | } EFI_ACPI_2_0_FIRMWARE_ACPI_CONTROL_STRUCTURE;
240 |
241 | ///
242 | /// FACS Version (as defined in ACPI 2.0 spec.)
243 | ///
244 | #define EFI_ACPI_2_0_FIRMWARE_ACPI_CONTROL_STRUCTURE_VERSION 0x01
245 |
246 | ///
247 | /// Firmware Control Structure Feature Flags
248 | /// All other bits are reserved and must be set to 0.
249 | ///
250 | #define EFI_ACPI_2_0_S4BIOS_F BIT0
251 |
252 | ///
253 | /// Multiple APIC Description Table header definition. The rest of the table
254 | /// must be defined in a platform specific manner.
255 | ///
256 | typedef struct {
257 | EFI_ACPI_DESCRIPTION_HEADER Header;
258 | UINT32 LocalApicAddress;
259 | UINT32 Flags;
260 | } EFI_ACPI_2_0_MULTIPLE_APIC_DESCRIPTION_TABLE_HEADER;
261 |
262 | ///
263 | /// MADT Revision (as defined in ACPI 2.0 spec.)
264 | ///
265 | #define EFI_ACPI_2_0_MULTIPLE_APIC_DESCRIPTION_TABLE_REVISION 0x01
266 |
267 | ///
268 | /// Multiple APIC Flags
269 | /// All other bits are reserved and must be set to 0.
270 | ///
271 | #define EFI_ACPI_2_0_PCAT_COMPAT BIT0
272 |
273 | //
274 | // Multiple APIC Description Table APIC structure types
275 | // All other values between 0x09 an 0xFF are reserved and
276 | // will be ignored by OSPM.
277 | //
278 | #define EFI_ACPI_2_0_PROCESSOR_LOCAL_APIC 0x00
279 | #define EFI_ACPI_2_0_IO_APIC 0x01
280 | #define EFI_ACPI_2_0_INTERRUPT_SOURCE_OVERRIDE 0x02
281 | #define EFI_ACPI_2_0_NON_MASKABLE_INTERRUPT_SOURCE 0x03
282 | #define EFI_ACPI_2_0_LOCAL_APIC_NMI 0x04
283 | #define EFI_ACPI_2_0_LOCAL_APIC_ADDRESS_OVERRIDE 0x05
284 | #define EFI_ACPI_2_0_IO_SAPIC 0x06
285 | #define EFI_ACPI_2_0_PROCESSOR_LOCAL_SAPIC 0x07
286 | #define EFI_ACPI_2_0_PLATFORM_INTERRUPT_SOURCES 0x08
287 |
288 | //
289 | // APIC Structure Definitions
290 | //
291 |
292 | ///
293 | /// Processor Local APIC Structure Definition
294 | ///
295 | typedef struct {
296 | UINT8 Type;
297 | UINT8 Length;
298 | UINT8 AcpiProcessorId;
299 | UINT8 ApicId;
300 | UINT32 Flags;
301 | } EFI_ACPI_2_0_PROCESSOR_LOCAL_APIC_STRUCTURE;
302 |
303 | ///
304 | /// Local APIC Flags. All other bits are reserved and must be 0.
305 | ///
306 | #define EFI_ACPI_2_0_LOCAL_APIC_ENABLED BIT0
307 |
308 | ///
309 | /// IO APIC Structure
310 | ///
311 | typedef struct {
312 | UINT8 Type;
313 | UINT8 Length;
314 | UINT8 IoApicId;
315 | UINT8 Reserved;
316 | UINT32 IoApicAddress;
317 | UINT32 GlobalSystemInterruptBase;
318 | } EFI_ACPI_2_0_IO_APIC_STRUCTURE;
319 |
320 | ///
321 | /// Interrupt Source Override Structure
322 | ///
323 | typedef struct {
324 | UINT8 Type;
325 | UINT8 Length;
326 | UINT8 Bus;
327 | UINT8 Source;
328 | UINT32 GlobalSystemInterrupt;
329 | UINT16 Flags;
330 | } EFI_ACPI_2_0_INTERRUPT_SOURCE_OVERRIDE_STRUCTURE;
331 |
332 | ///
333 | /// Non-Maskable Interrupt Source Structure
334 | ///
335 | typedef struct {
336 | UINT8 Type;
337 | UINT8 Length;
338 | UINT16 Flags;
339 | UINT32 GlobalSystemInterrupt;
340 | } EFI_ACPI_2_0_NON_MASKABLE_INTERRUPT_SOURCE_STRUCTURE;
341 |
342 | ///
343 | /// Local APIC NMI Structure
344 | ///
345 | typedef struct {
346 | UINT8 Type;
347 | UINT8 Length;
348 | UINT8 AcpiProcessorId;
349 | UINT16 Flags;
350 | UINT8 LocalApicLint;
351 | } EFI_ACPI_2_0_LOCAL_APIC_NMI_STRUCTURE;
352 |
353 | ///
354 | /// Local APIC Address Override Structure
355 | ///
356 | typedef struct {
357 | UINT8 Type;
358 | UINT8 Length;
359 | UINT16 Reserved;
360 | UINT64 LocalApicAddress;
361 | } EFI_ACPI_2_0_LOCAL_APIC_ADDRESS_OVERRIDE_STRUCTURE;
362 |
363 | ///
364 | /// IO SAPIC Structure
365 | ///
366 | typedef struct {
367 | UINT8 Type;
368 | UINT8 Length;
369 | UINT8 IoApicId;
370 | UINT8 Reserved;
371 | UINT32 GlobalSystemInterruptBase;
372 | UINT64 IoSapicAddress;
373 | } EFI_ACPI_2_0_IO_SAPIC_STRUCTURE;
374 |
375 | ///
376 | /// Local SAPIC Structure
377 | ///
378 | typedef struct {
379 | UINT8 Type;
380 | UINT8 Length;
381 | UINT8 AcpiProcessorId;
382 | UINT8 LocalSapicId;
383 | UINT8 LocalSapicEid;
384 | UINT8 Reserved[3];
385 | UINT32 Flags;
386 | } EFI_ACPI_2_0_PROCESSOR_LOCAL_SAPIC_STRUCTURE;
387 |
388 | ///
389 | /// Platform Interrupt Sources Structure
390 | ///
391 | typedef struct {
392 | UINT8 Type;
393 | UINT8 Length;
394 | UINT16 Flags;
395 | UINT8 InterruptType;
396 | UINT8 ProcessorId;
397 | UINT8 ProcessorEid;
398 | UINT8 IoSapicVector;
399 | UINT32 GlobalSystemInterrupt;
400 | UINT32 Reserved;
401 | } EFI_ACPI_2_0_PLATFORM_INTERRUPT_SOURCES_STRUCTURE;
402 |
403 | ///
404 | /// Smart Battery Description Table (SBST)
405 | ///
406 | typedef struct {
407 | EFI_ACPI_DESCRIPTION_HEADER Header;
408 | UINT32 WarningEnergyLevel;
409 | UINT32 LowEnergyLevel;
410 | UINT32 CriticalEnergyLevel;
411 | } EFI_ACPI_2_0_SMART_BATTERY_DESCRIPTION_TABLE;
412 |
413 | ///
414 | /// SBST Version (as defined in ACPI 2.0 spec.)
415 | ///
416 | #define EFI_ACPI_2_0_SMART_BATTERY_DESCRIPTION_TABLE_REVISION 0x01
417 |
418 | ///
419 | /// Embedded Controller Boot Resources Table (ECDT)
420 | /// The table is followed by a null terminated ASCII string that contains
421 | /// a fully qualified reference to the name space object.
422 | ///
423 | typedef struct {
424 | EFI_ACPI_DESCRIPTION_HEADER Header;
425 | EFI_ACPI_2_0_GENERIC_ADDRESS_STRUCTURE EcControl;
426 | EFI_ACPI_2_0_GENERIC_ADDRESS_STRUCTURE EcData;
427 | UINT32 Uid;
428 | UINT8 GpeBit;
429 | } EFI_ACPI_2_0_EMBEDDED_CONTROLLER_BOOT_RESOURCES_TABLE;
430 |
431 | ///
432 | /// ECDT Version (as defined in ACPI 2.0 spec.)
433 | ///
434 | #define EFI_ACPI_2_0_EMBEDDED_CONTROLLER_BOOT_RESOURCES_TABLE_REVISION 0x01
435 |
436 | //
437 | // Known table signatures
438 | //
439 |
440 | ///
441 | /// "RSD PTR " Root System Description Pointer
442 | ///
443 | #define EFI_ACPI_2_0_ROOT_SYSTEM_DESCRIPTION_POINTER_SIGNATURE SIGNATURE_64('R', 'S', 'D', ' ', 'P', 'T', 'R', ' ')
444 |
445 | ///
446 | /// "SPIC" Multiple SAPIC Description Table
447 | ///
448 | /// BUGBUG: Don't know where this came from except SR870BN4 uses it.
449 | /// #define EFI_ACPI_2_0_MULTIPLE_SAPIC_DESCRIPTION_TABLE_SIGNATURE 0x43495053
450 | ///
451 | #define EFI_ACPI_2_0_MULTIPLE_SAPIC_DESCRIPTION_TABLE_SIGNATURE SIGNATURE_32('A', 'P', 'I', 'C')
452 |
453 | ///
454 | /// "BOOT" MS Simple Boot Spec
455 | ///
456 | #define EFI_ACPI_2_0_SIMPLE_BOOT_FLAG_TABLE_SIGNATURE SIGNATURE_32('B', 'O', 'O', 'T')
457 |
458 | ///
459 | /// "DBGP" MS Bebug Port Spec
460 | ///
461 | #define EFI_ACPI_2_0_DEBUG_PORT_TABLE_SIGNATURE SIGNATURE_32('D', 'B', 'G', 'P')
462 |
463 | ///
464 | /// "DSDT" Differentiated System Description Table
465 | ///
466 | #define EFI_ACPI_2_0_DIFFERENTIATED_SYSTEM_DESCRIPTION_TABLE_SIGNATURE SIGNATURE_32('D', 'S', 'D', 'T')
467 |
468 | ///
469 | /// "ECDT" Embedded Controller Boot Resources Table
470 | ///
471 | #define EFI_ACPI_2_0_EMBEDDED_CONTROLLER_BOOT_RESOURCES_TABLE_SIGNATURE SIGNATURE_32('E', 'C', 'D', 'T')
472 |
473 | ///
474 | /// "ETDT" Event Timer Description Table
475 | ///
476 | #define EFI_ACPI_2_0_EVENT_TIMER_DESCRIPTION_TABLE_SIGNATURE SIGNATURE_32('E', 'T', 'D', 'T')
477 |
478 | ///
479 | /// "FACS" Firmware ACPI Control Structure
480 | ///
481 | #define EFI_ACPI_2_0_FIRMWARE_ACPI_CONTROL_STRUCTURE_SIGNATURE SIGNATURE_32('F', 'A', 'C', 'S')
482 |
483 | ///
484 | /// "FACP" Fixed ACPI Description Table
485 | ///
486 | #define EFI_ACPI_2_0_FIXED_ACPI_DESCRIPTION_TABLE_SIGNATURE SIGNATURE_32('F', 'A', 'C', 'P')
487 |
488 | ///
489 | /// "APIC" Multiple APIC Description Table
490 | ///
491 | #define EFI_ACPI_2_0_MULTIPLE_APIC_DESCRIPTION_TABLE_SIGNATURE SIGNATURE_32('A', 'P', 'I', 'C')
492 |
493 | ///
494 | /// "PSDT" Persistent System Description Table
495 | ///
496 | #define EFI_ACPI_2_0_PERSISTENT_SYSTEM_DESCRIPTION_TABLE_SIGNATURE SIGNATURE_32('P', 'S', 'D', 'T')
497 |
498 | ///
499 | /// "RSDT" Root System Description Table
500 | ///
501 | #define EFI_ACPI_2_0_ROOT_SYSTEM_DESCRIPTION_TABLE_SIGNATURE SIGNATURE_32('R', 'S', 'D', 'T')
502 |
503 | ///
504 | /// "SBST" Smart Battery Specification Table
505 | ///
506 | #define EFI_ACPI_2_0_SMART_BATTERY_SPECIFICATION_TABLE_SIGNATURE SIGNATURE_32('S', 'B', 'S', 'T')
507 |
508 | ///
509 | /// "SLIT" System Locality Information Table
510 | ///
511 | #define EFI_ACPI_2_0_SYSTEM_LOCALITY_INFORMATION_TABLE_SIGNATURE SIGNATURE_32('S', 'L', 'I', 'T')
512 |
513 | ///
514 | /// "SPCR" Serial Port Concole Redirection Table
515 | ///
516 | #define EFI_ACPI_2_0_SERIAL_PORT_CONSOLE_REDIRECTION_TABLE_SIGNATURE SIGNATURE_32('S', 'P', 'C', 'R')
517 |
518 | ///
519 | /// "SRAT" Static Resource Affinity Table
520 | ///
521 | #define EFI_ACPI_2_0_STATIC_RESOURCE_AFFINITY_TABLE_SIGNATURE SIGNATURE_32('S', 'R', 'A', 'T')
522 |
523 | ///
524 | /// "SSDT" Secondary System Description Table
525 | ///
526 | #define EFI_ACPI_2_0_SECONDARY_SYSTEM_DESCRIPTION_TABLE_SIGNATURE SIGNATURE_32('S', 'S', 'D', 'T')
527 |
528 | ///
529 | /// "SPMI" Server Platform Management Interface Table
530 | ///
531 | #define EFI_ACPI_2_0_SERVER_PLATFORM_MANAGEMENT_INTERFACE_SIGNATURE SIGNATURE_32('S', 'P', 'M', 'I')
532 |
533 | ///
534 | /// "XSDT" Extended System Description Table
535 | ///
536 | #define EFI_ACPI_2_0_EXTENDED_SYSTEM_DESCRIPTION_TABLE_SIGNATURE SIGNATURE_32('X', 'S', 'D', 'T')
537 |
538 | ///
539 | /// "MCFG" PCI Express Memory Mapped Configuration Space Base Address Description Table
540 | ///
541 | #define EFI_ACPI_2_0_MEMORY_MAPPED_CONFIGURATION_BASE_ADDRESS_TABLE_SIGNATURE SIGNATURE_32('M', 'C', 'F', 'G')
542 |
543 | #pragma pack()
544 |
545 | #endif
546 |
--------------------------------------------------------------------------------
/Includes/IndustryStandard/Acpi10.h:
--------------------------------------------------------------------------------
1 | /** @file
2 | ACPI 1.0b definitions from the ACPI Specification, revision 1.0b
3 |
4 | Copyright (c) 2006 - 2011, Intel Corporation. All rights reserved.
5 | This program and the accompanying materials are licensed and made available under
6 | the terms and conditions of the BSD License that accompanies this distribution.
7 | The full text of the license may be found at
8 | http://opensource.org/licenses/bsd-license.php.
9 |
10 | THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
11 | WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
12 | **/
13 |
14 | #ifndef _ACPI_1_0_H_
15 | #define _ACPI_1_0_H_
16 |
17 | #include
18 | #include
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 | #pragma pack(1)
30 | ///
31 | /// The common ACPI description table header. This structure prefaces most ACPI tables.
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 | #pragma pack()
45 |
46 | //
47 | // Define for Desriptor
48 | //
49 | #define ACPI_SMALL_ITEM_FLAG 0x00
50 | #define ACPI_LARGE_ITEM_FLAG 0x01
51 |
52 | //
53 | // Small Item Descriptor Name
54 | //
55 | #define ACPI_SMALL_IRQ_DESCRIPTOR_NAME 0x04
56 | #define ACPI_SMALL_DMA_DESCRIPTOR_NAME 0x05
57 | #define ACPI_SMALL_START_DEPENDENT_DESCRIPTOR_NAME 0x06
58 | #define ACPI_SMALL_END_DEPENDENT_DESCRIPTOR_NAME 0x07
59 | #define ACPI_SMALL_IO_PORT_DESCRIPTOR_NAME 0x08
60 | #define ACPI_SMALL_FIXED_IO_PORT_DESCRIPTOR_NAME 0x09
61 | #define ACPI_SMALL_VENDOR_DEFINED_DESCRIPTOR_NAME 0x0E
62 | #define ACPI_SMALL_END_TAG_DESCRIPTOR_NAME 0x0F
63 |
64 | //
65 | // Large Item Descriptor Name
66 | //
67 | #define ACPI_LARGE_24_BIT_MEMORY_RANGE_DESCRIPTOR_NAME 0x01
68 | #define ACPI_LARGE_VENDOR_DEFINED_DESCRIPTOR_NAME 0x04
69 | #define ACPI_LARGE_32_BIT_MEMORY_RANGE_DESCRIPTOR_NAME 0x05
70 | #define ACPI_LARGE_32_BIT_FIXED_MEMORY_RANGE_DESCRIPTOR_NAME 0x06
71 | #define ACPI_LARGE_DWORD_ADDRESS_SPACE_DESCRIPTOR_NAME 0x07
72 | #define ACPI_LARGE_WORD_ADDRESS_SPACE_DESCRIPTOR_NAME 0x08
73 | #define ACPI_LARGE_EXTENDED_IRQ_DESCRIPTOR_NAME 0x09
74 | #define ACPI_LARGE_QWORD_ADDRESS_SPACE_DESCRIPTOR_NAME 0x0A
75 |
76 | //
77 | // Small Item Descriptor Value
78 | //
79 | #define ACPI_IRQ_NOFLAG_DESCRIPTOR 0x22
80 | #define ACPI_IRQ_DESCRIPTOR 0x23
81 | #define ACPI_DMA_DESCRIPTOR 0x2A
82 | #define ACPI_START_DEPENDENT_DESCRIPTOR 0x30
83 | #define ACPI_START_DEPENDENT_EX_DESCRIPTOR 0x31
84 | #define ACPI_END_DEPENDENT_DESCRIPTOR 0x38
85 | #define ACPI_IO_PORT_DESCRIPTOR 0x47
86 | #define ACPI_FIXED_LOCATION_IO_PORT_DESCRIPTOR 0x4B
87 | #define ACPI_END_TAG_DESCRIPTOR 0x79
88 |
89 | //
90 | // Large Item Descriptor Value
91 | //
92 | #define ACPI_24_BIT_MEMORY_RANGE_DESCRIPTOR 0x81
93 | #define ACPI_32_BIT_MEMORY_RANGE_DESCRIPTOR 0x85
94 | #define ACPI_32_BIT_FIXED_MEMORY_RANGE_DESCRIPTOR 0x86
95 | #define ACPI_DWORD_ADDRESS_SPACE_DESCRIPTOR 0x87
96 | #define ACPI_WORD_ADDRESS_SPACE_DESCRIPTOR 0x88
97 | #define ACPI_EXTENDED_INTERRUPT_DESCRIPTOR 0x89
98 | #define ACPI_QWORD_ADDRESS_SPACE_DESCRIPTOR 0x8A
99 | #define ACPI_ADDRESS_SPACE_DESCRIPTOR 0x8A
100 |
101 | //
102 | // Resource Type
103 | //
104 | #define ACPI_ADDRESS_SPACE_TYPE_MEM 0x00
105 | #define ACPI_ADDRESS_SPACE_TYPE_IO 0x01
106 | #define ACPI_ADDRESS_SPACE_TYPE_BUS 0x02
107 |
108 | ///
109 | /// Power Management Timer frequency is fixed at 3.579545MHz.
110 | ///
111 | #define ACPI_TIMER_FREQUENCY 3579545
112 |
113 | //
114 | // Ensure proper structure formats
115 | //
116 | #pragma pack(1)
117 |
118 | ///
119 | /// The commond definition of QWORD, DWORD, and WORD
120 | /// Address Space Descriptors.
121 | ///
122 | typedef PACKED struct {
123 | UINT8 Desc;
124 | UINT16 Len;
125 | UINT8 ResType;
126 | UINT8 GenFlag;
127 | UINT8 SpecificFlag;
128 | UINT64 AddrSpaceGranularity;
129 | UINT64 AddrRangeMin;
130 | UINT64 AddrRangeMax;
131 | UINT64 AddrTranslationOffset;
132 | UINT64 AddrLen;
133 | } EFI_ACPI_ADDRESS_SPACE_DESCRIPTOR;
134 |
135 | typedef PACKED union {
136 | UINT8 Byte;
137 | PACKED struct {
138 | UINT8 Length : 3;
139 | UINT8 Name : 4;
140 | UINT8 Type : 1;
141 | } Bits;
142 | } ACPI_SMALL_RESOURCE_HEADER;
143 |
144 | typedef PACKED struct {
145 | PACKED union {
146 | UINT8 Byte;
147 | PACKED struct {
148 | UINT8 Name : 7;
149 | UINT8 Type : 1;
150 | }Bits;
151 | } Header;
152 | UINT16 Length;
153 | } ACPI_LARGE_RESOURCE_HEADER;
154 |
155 | ///
156 | /// IRQ Descriptor.
157 | ///
158 | typedef PACKED struct {
159 | ACPI_SMALL_RESOURCE_HEADER Header;
160 | UINT16 Mask;
161 | } EFI_ACPI_IRQ_NOFLAG_DESCRIPTOR;
162 |
163 | ///
164 | /// IRQ Descriptor.
165 | ///
166 | typedef PACKED struct {
167 | ACPI_SMALL_RESOURCE_HEADER Header;
168 | UINT16 Mask;
169 | UINT8 Information;
170 | } EFI_ACPI_IRQ_DESCRIPTOR;
171 |
172 | ///
173 | /// DMA Descriptor.
174 | ///
175 | typedef PACKED struct {
176 | ACPI_SMALL_RESOURCE_HEADER Header;
177 | UINT8 ChannelMask;
178 | UINT8 Information;
179 | } EFI_ACPI_DMA_DESCRIPTOR;
180 |
181 | ///
182 | /// I/O Port Descriptor
183 | ///
184 | typedef PACKED struct {
185 | ACPI_SMALL_RESOURCE_HEADER Header;
186 | UINT8 Information;
187 | UINT16 BaseAddressMin;
188 | UINT16 BaseAddressMax;
189 | UINT8 Alignment;
190 | UINT8 Length;
191 | } EFI_ACPI_IO_PORT_DESCRIPTOR;
192 |
193 | ///
194 | /// Fixed Location I/O Port Descriptor.
195 | ///
196 | typedef PACKED struct {
197 | ACPI_SMALL_RESOURCE_HEADER Header;
198 | UINT16 BaseAddress;
199 | UINT8 Length;
200 | } EFI_ACPI_FIXED_LOCATION_IO_PORT_DESCRIPTOR;
201 |
202 | ///
203 | /// 24-Bit Memory Range Descriptor
204 | ///
205 | typedef PACKED struct {
206 | ACPI_LARGE_RESOURCE_HEADER Header;
207 | UINT8 Information;
208 | UINT16 BaseAddressMin;
209 | UINT16 BaseAddressMax;
210 | UINT16 Alignment;
211 | UINT16 Length;
212 | } EFI_ACPI_24_BIT_MEMORY_RANGE_DESCRIPTOR;
213 |
214 | ///
215 | /// 32-Bit Memory Range Descriptor
216 | ///
217 | typedef PACKED struct {
218 | ACPI_LARGE_RESOURCE_HEADER Header;
219 | UINT8 Information;
220 | UINT32 BaseAddressMin;
221 | UINT32 BaseAddressMax;
222 | UINT32 Alignment;
223 | UINT32 Length;
224 | } EFI_ACPI_32_BIT_MEMORY_RANGE_DESCRIPTOR;
225 |
226 | ///
227 | /// Fixed 32-Bit Fixed Memory Range Descriptor
228 | ///
229 | typedef PACKED struct {
230 | ACPI_LARGE_RESOURCE_HEADER Header;
231 | UINT8 Information;
232 | UINT32 BaseAddress;
233 | UINT32 Length;
234 | } EFI_ACPI_32_BIT_FIXED_MEMORY_RANGE_DESCRIPTOR;
235 |
236 | ///
237 | /// QWORD Address Space Descriptor
238 | ///
239 | typedef PACKED struct {
240 | ACPI_LARGE_RESOURCE_HEADER Header;
241 | UINT8 ResType;
242 | UINT8 GenFlag;
243 | UINT8 SpecificFlag;
244 | UINT64 AddrSpaceGranularity;
245 | UINT64 AddrRangeMin;
246 | UINT64 AddrRangeMax;
247 | UINT64 AddrTranslationOffset;
248 | UINT64 AddrLen;
249 | } EFI_ACPI_QWORD_ADDRESS_SPACE_DESCRIPTOR;
250 |
251 | ///
252 | /// DWORD Address Space Descriptor
253 | ///
254 | typedef PACKED struct {
255 | ACPI_LARGE_RESOURCE_HEADER Header;
256 | UINT8 ResType;
257 | UINT8 GenFlag;
258 | UINT8 SpecificFlag;
259 | UINT32 AddrSpaceGranularity;
260 | UINT32 AddrRangeMin;
261 | UINT32 AddrRangeMax;
262 | UINT32 AddrTranslationOffset;
263 | UINT32 AddrLen;
264 | } EFI_ACPI_DWORD_ADDRESS_SPACE_DESCRIPTOR;
265 |
266 | ///
267 | /// WORD Address Space Descriptor
268 | ///
269 | typedef PACKED struct {
270 | ACPI_LARGE_RESOURCE_HEADER Header;
271 | UINT8 ResType;
272 | UINT8 GenFlag;
273 | UINT8 SpecificFlag;
274 | UINT16 AddrSpaceGranularity;
275 | UINT16 AddrRangeMin;
276 | UINT16 AddrRangeMax;
277 | UINT16 AddrTranslationOffset;
278 | UINT16 AddrLen;
279 | } EFI_ACPI_WORD_ADDRESS_SPACE_DESCRIPTOR;
280 |
281 | ///
282 | /// Extended Interrupt Descriptor
283 | ///
284 | typedef PACKED struct {
285 | ACPI_LARGE_RESOURCE_HEADER Header;
286 | UINT8 InterruptVectorFlags;
287 | UINT8 InterruptTableLength;
288 | UINT32 InterruptNumber[1];
289 | } EFI_ACPI_EXTENDED_INTERRUPT_DESCRIPTOR;
290 |
291 | #pragma pack()
292 |
293 | ///
294 | /// The End tag identifies an end of resource data.
295 | ///
296 | typedef struct {
297 | UINT8 Desc;
298 | UINT8 Checksum;
299 | } EFI_ACPI_END_TAG_DESCRIPTOR;
300 |
301 | //
302 | // General use definitions
303 | //
304 | #define EFI_ACPI_RESERVED_BYTE 0x00
305 | #define EFI_ACPI_RESERVED_WORD 0x0000
306 | #define EFI_ACPI_RESERVED_DWORD 0x00000000
307 | #define EFI_ACPI_RESERVED_QWORD 0x0000000000000000
308 |
309 | //
310 | // Resource Type Specific Flags
311 | // Ref ACPI specification 6.4.3.5.5
312 | //
313 | // Bit [0] : Write Status, _RW
314 | //
315 | #define EFI_ACPI_MEMORY_RESOURCE_SPECIFIC_FLAG_READ_WRITE (1 << 0)
316 | #define EFI_ACPI_MEMORY_RESOURCE_SPECIFIC_FLAG_READ_ONLY (0 << 0)
317 | //
318 | // Bit [2:1] : Memory Attributes, _MEM
319 | //
320 | #define EFI_ACPI_MEMORY_RESOURCE_SPECIFIC_FLAG_NON_CACHEABLE (0 << 1)
321 | #define EFI_ACPI_MEMORY_RESOURCE_SPECIFIC_FLAG_CACHEABLE (1 << 1)
322 | #define EFI_ACPI_MEMORY_RESOURCE_SPECIFIC_FLAG_CACHEABLE_WRITE_COMBINING (2 << 1)
323 | #define EFI_ACPI_MEMORY_RESOURCE_SPECIFIC_FLAG_CACHEABLE_PREFETCHABLE (3 << 1)
324 | //
325 | // Bit [4:3] : Memory Attributes, _MTP
326 | //
327 | #define EFI_ACPI_MEMORY_RESOURCE_SPECIFIC_FLAG_ADDRESS_RANGE_MEMORY (0 << 3)
328 | #define EFI_ACPI_MEMORY_RESOURCE_SPECIFIC_FLAG_ADDRESS_RANGE_RESERVED (1 << 3)
329 | #define EFI_ACPI_MEMORY_RESOURCE_SPECIFIC_FLAG_ADDRESS_RANGE_ACPI (2 << 3)
330 | #define EFI_APCI_MEMORY_RESOURCE_SPECIFIC_FLAG_ADDRESS_RANGE_NVS (3 << 3)
331 | //
332 | // Bit [5] : Memory to I/O Translation, _TTP
333 | //
334 | #define EFI_ACPI_MEMORY_RESOURCE_SPECIFIC_FLAG_TYPE_TRANSLATION (1 << 5)
335 | #define EFI_ACPI_MEMORY_RESOURCE_SPECIFIC_FLAG_TYPE_STATIC (0 << 5)
336 |
337 | //
338 | // IRQ Information
339 | // Ref ACPI specification 6.4.2.1
340 | //
341 | #define EFI_ACPI_IRQ_SHARABLE_MASK 0x10
342 | #define EFI_ACPI_IRQ_SHARABLE 0x10
343 |
344 | #define EFI_ACPI_IRQ_POLARITY_MASK 0x08
345 | #define EFI_ACPI_IRQ_HIGH_TRUE 0x00
346 | #define EFI_ACPI_IRQ_LOW_FALSE 0x08
347 |
348 | #define EFI_ACPI_IRQ_MODE 0x01
349 | #define EFI_ACPI_IRQ_LEVEL_TRIGGERED 0x00
350 | #define EFI_ACPI_IRQ_EDGE_TRIGGERED 0x01
351 |
352 | //
353 | // DMA Information
354 | // Ref ACPI specification 6.4.2.2
355 | //
356 | #define EFI_ACPI_DMA_SPEED_TYPE_MASK 0x60
357 | #define EFI_ACPI_DMA_SPEED_TYPE_COMPATIBILITY 0x00
358 | #define EFI_ACPI_DMA_SPEED_TYPE_A 0x20
359 | #define EFI_ACPI_DMA_SPEED_TYPE_B 0x40
360 | #define EFI_ACPI_DMA_SPEED_TYPE_F 0x60
361 |
362 | #define EFI_ACPI_DMA_BUS_MASTER_MASK 0x04
363 | #define EFI_ACPI_DMA_BUS_MASTER 0x04
364 |
365 | #define EFI_ACPI_DMA_TRANSFER_TYPE_MASK 0x03
366 | #define EFI_ACPI_DMA_TRANSFER_TYPE_8_BIT 0x00
367 | #define EFI_ACPI_DMA_TRANSFER_TYPE_8_BIT_AND_16_BIT 0x01
368 | #define EFI_ACPI_DMA_TRANSFER_TYPE_16_BIT 0x10
369 |
370 | //
371 | // IO Information
372 | // Ref ACPI specification 6.4.2.5
373 | //
374 | #define EFI_ACPI_IO_DECODE_MASK 0x01
375 | #define EFI_ACPI_IO_DECODE_16_BIT 0x01
376 | #define EFI_ACPI_IO_DECODE_10_BIT 0x00
377 |
378 | //
379 | // Memory Information
380 | // Ref ACPI specification 6.4.3.4
381 | //
382 | #define EFI_ACPI_MEMORY_WRITE_STATUS_MASK 0x01
383 | #define EFI_ACPI_MEMORY_WRITABLE 0x01
384 | #define EFI_ACPI_MEMORY_NON_WRITABLE 0x00
385 |
386 | //
387 | // Ensure proper structure formats
388 | //
389 | #pragma pack(1)
390 | //
391 | // ACPI 1.0b table structures
392 | //
393 |
394 | ///
395 | /// Root System Description Pointer Structure.
396 | ///
397 | typedef struct {
398 | UINT64 Signature;
399 | UINT8 Checksum;
400 | UINT8 OemId[6];
401 | UINT8 Reserved;
402 | UINT32 RsdtAddress;
403 | } EFI_ACPI_1_0_ROOT_SYSTEM_DESCRIPTION_POINTER;
404 |
405 | //
406 | // Root System Description Table
407 | // No definition needed as it is a common description table header, the same with
408 | // EFI_ACPI_DESCRIPTION_HEADER, followed by a variable number of UINT32 table pointers.
409 | //
410 |
411 | ///
412 | /// RSDT Revision (as defined in ACPI 1.0b specification).
413 | ///
414 | #define EFI_ACPI_1_0_ROOT_SYSTEM_DESCRIPTION_TABLE_REVISION 0x01
415 |
416 | ///
417 | /// Fixed ACPI Description Table Structure (FADT).
418 | ///
419 | typedef struct {
420 | EFI_ACPI_DESCRIPTION_HEADER Header;
421 | UINT32 FirmwareCtrl;
422 | UINT32 Dsdt;
423 | UINT8 IntModel;
424 | UINT8 Reserved1;
425 | UINT16 SciInt;
426 | UINT32 SmiCmd;
427 | UINT8 AcpiEnable;
428 | UINT8 AcpiDisable;
429 | UINT8 S4BiosReq;
430 | UINT8 Reserved2;
431 | UINT32 Pm1aEvtBlk;
432 | UINT32 Pm1bEvtBlk;
433 | UINT32 Pm1aCntBlk;
434 | UINT32 Pm1bCntBlk;
435 | UINT32 Pm2CntBlk;
436 | UINT32 PmTmrBlk;
437 | UINT32 Gpe0Blk;
438 | UINT32 Gpe1Blk;
439 | UINT8 Pm1EvtLen;
440 | UINT8 Pm1CntLen;
441 | UINT8 Pm2CntLen;
442 | UINT8 PmTmLen;
443 | UINT8 Gpe0BlkLen;
444 | UINT8 Gpe1BlkLen;
445 | UINT8 Gpe1Base;
446 | UINT8 Reserved3;
447 | UINT16 PLvl2Lat;
448 | UINT16 PLvl3Lat;
449 | UINT16 FlushSize;
450 | UINT16 FlushStride;
451 | UINT8 DutyOffset;
452 | UINT8 DutyWidth;
453 | UINT8 DayAlrm;
454 | UINT8 MonAlrm;
455 | UINT8 Century;
456 | UINT8 Reserved4;
457 | UINT8 Reserved5;
458 | UINT8 Reserved6;
459 | UINT32 Flags;
460 | } EFI_ACPI_1_0_FIXED_ACPI_DESCRIPTION_TABLE;
461 |
462 | ///
463 | /// FADT Version (as defined in ACPI 1.0b specification).
464 | ///
465 | #define EFI_ACPI_1_0_FIXED_ACPI_DESCRIPTION_TABLE_REVISION 0x01
466 |
467 | #define EFI_ACPI_1_0_INT_MODE_DUAL_PIC 0
468 | #define EFI_ACPI_1_0_INT_MODE_MULTIPLE_APIC 1
469 |
470 | //
471 | // Fixed ACPI Description Table Fixed Feature Flags
472 | // All other bits are reserved and must be set to 0.
473 | //
474 | #define EFI_ACPI_1_0_WBINVD BIT0
475 | #define EFI_ACPI_1_0_WBINVD_FLUSH BIT1
476 | #define EFI_ACPI_1_0_PROC_C1 BIT2
477 | #define EFI_ACPI_1_0_P_LVL2_UP BIT3
478 | #define EFI_ACPI_1_0_PWR_BUTTON BIT4
479 | #define EFI_ACPI_1_0_SLP_BUTTON BIT5
480 | #define EFI_ACPI_1_0_FIX_RTC BIT6
481 | #define EFI_ACPI_1_0_RTC_S4 BIT7
482 | #define EFI_ACPI_1_0_TMR_VAL_EXT BIT8
483 | #define EFI_ACPI_1_0_DCK_CAP BIT9
484 |
485 | ///
486 | /// Firmware ACPI Control Structure.
487 | ///
488 | typedef struct {
489 | UINT32 Signature;
490 | UINT32 Length;
491 | UINT32 HardwareSignature;
492 | UINT32 FirmwareWakingVector;
493 | UINT32 GlobalLock;
494 | UINT32 Flags;
495 | UINT8 Reserved[40];
496 | } EFI_ACPI_1_0_FIRMWARE_ACPI_CONTROL_STRUCTURE;
497 |
498 | ///
499 | /// Firmware Control Structure Feature Flags.
500 | /// All other bits are reserved and must be set to 0.
501 | ///
502 | #define EFI_ACPI_1_0_S4BIOS_F BIT0
503 |
504 | ///
505 | /// Multiple APIC Description Table header definition. The rest of the table
506 | /// must be defined in a platform-specific manner.
507 | ///
508 | typedef struct {
509 | EFI_ACPI_DESCRIPTION_HEADER Header;
510 | UINT32 LocalApicAddress;
511 | UINT32 Flags;
512 | } EFI_ACPI_1_0_MULTIPLE_APIC_DESCRIPTION_TABLE_HEADER;
513 |
514 | ///
515 | /// MADT Revision (as defined in ACPI 1.0b specification).
516 | ///
517 | #define EFI_ACPI_1_0_MULTIPLE_APIC_DESCRIPTION_TABLE_REVISION 0x01
518 |
519 | ///
520 | /// Multiple APIC Flags
521 | /// All other bits are reserved and must be set to 0.
522 | ///
523 | #define EFI_ACPI_1_0_PCAT_COMPAT BIT0
524 |
525 | //
526 | // Multiple APIC Description Table APIC structure types
527 | // All other values between 0x05 an 0xFF are reserved and
528 | // will be ignored by OSPM.
529 | //
530 | #define EFI_ACPI_1_0_PROCESSOR_LOCAL_APIC 0x00
531 | #define EFI_ACPI_1_0_IO_APIC 0x01
532 | #define EFI_ACPI_1_0_INTERRUPT_SOURCE_OVERRIDE 0x02
533 | #define EFI_ACPI_1_0_NON_MASKABLE_INTERRUPT_SOURCE 0x03
534 | #define EFI_ACPI_1_0_LOCAL_APIC_NMI 0x04
535 |
536 | //
537 | // APIC Structure Definitions
538 | //
539 |
540 | ///
541 | /// Processor Local APIC Structure Definition.
542 | ///
543 | typedef struct {
544 | UINT8 Type;
545 | UINT8 Length;
546 | UINT8 AcpiProcessorId;
547 | UINT8 ApicId;
548 | UINT32 Flags;
549 | } EFI_ACPI_1_0_PROCESSOR_LOCAL_APIC_STRUCTURE;
550 |
551 | ///
552 | /// Local APIC Flags. All other bits are reserved and must be 0.
553 | ///
554 | #define EFI_ACPI_1_0_LOCAL_APIC_ENABLED BIT0
555 |
556 | ///
557 | /// IO APIC Structure.
558 | ///
559 | typedef struct {
560 | UINT8 Type;
561 | UINT8 Length;
562 | UINT8 IoApicId;
563 | UINT8 Reserved;
564 | UINT32 IoApicAddress;
565 | UINT32 SystemVectorBase;
566 | } EFI_ACPI_1_0_IO_APIC_STRUCTURE;
567 |
568 | ///
569 | /// Interrupt Source Override Structure.
570 | ///
571 | typedef struct {
572 | UINT8 Type;
573 | UINT8 Length;
574 | UINT8 Bus;
575 | UINT8 Source;
576 | UINT32 GlobalSystemInterruptVector;
577 | UINT16 Flags;
578 | } EFI_ACPI_1_0_INTERRUPT_SOURCE_OVERRIDE_STRUCTURE;
579 |
580 | ///
581 | /// Non-Maskable Interrupt Source Structure.
582 | ///
583 | typedef struct {
584 | UINT8 Type;
585 | UINT8 Length;
586 | UINT16 Flags;
587 | UINT32 GlobalSystemInterruptVector;
588 | } EFI_ACPI_1_0_NON_MASKABLE_INTERRUPT_SOURCE_STRUCTURE;
589 |
590 | ///
591 | /// Local APIC NMI Structure.
592 | ///
593 | typedef struct {
594 | UINT8 Type;
595 | UINT8 Length;
596 | UINT8 AcpiProcessorId;
597 | UINT16 Flags;
598 | UINT8 LocalApicInti;
599 | } EFI_ACPI_1_0_LOCAL_APIC_NMI_STRUCTURE;
600 |
601 | ///
602 | /// Smart Battery Description Table (SBST)
603 | ///
604 | typedef struct {
605 | EFI_ACPI_DESCRIPTION_HEADER Header;
606 | UINT32 WarningEnergyLevel;
607 | UINT32 LowEnergyLevel;
608 | UINT32 CriticalEnergyLevel;
609 | } EFI_ACPI_1_0_SMART_BATTERY_DESCRIPTION_TABLE;
610 |
611 | //
612 | // Known table signatures
613 | //
614 |
615 | ///
616 | /// "RSD PTR " Root System Description Pointer.
617 | ///
618 | #define EFI_ACPI_1_0_ROOT_SYSTEM_DESCRIPTION_POINTER_SIGNATURE SIGNATURE_64('R', 'S', 'D', ' ', 'P', 'T', 'R', ' ')
619 |
620 | ///
621 | /// "APIC" Multiple APIC Description Table.
622 | ///
623 | #define EFI_ACPI_1_0_APIC_SIGNATURE SIGNATURE_32('A', 'P', 'I', 'C')
624 |
625 | ///
626 | /// "DSDT" Differentiated System Description Table.
627 | ///
628 | #define EFI_ACPI_1_0_DIFFERENTIATED_SYSTEM_DESCRIPTION_TABLE_SIGNATURE SIGNATURE_32('D', 'S', 'D', 'T')
629 |
630 | ///
631 | /// "FACS" Firmware ACPI Control Structure.
632 | ///
633 | #define EFI_ACPI_1_0_FIRMWARE_ACPI_CONTROL_STRUCTURE_SIGNATURE SIGNATURE_32('F', 'A', 'C', 'S')
634 |
635 | ///
636 | /// "FACP" Fixed ACPI Description Table.
637 | ///
638 | #define EFI_ACPI_1_0_FIXED_ACPI_DESCRIPTION_TABLE_SIGNATURE SIGNATURE_32('F', 'A', 'C', 'P')
639 |
640 | ///
641 | /// "PSDT" Persistent System Description Table.
642 | ///
643 | #define EFI_ACPI_1_0_PERSISTENT_SYSTEM_DESCRIPTION_TABLE_SIGNATURE SIGNATURE_32('P', 'S', 'D', 'T')
644 |
645 | ///
646 | /// "RSDT" Root System Description Table.
647 | ///
648 | #define EFI_ACPI_1_0_ROOT_SYSTEM_DESCRIPTION_TABLE_SIGNATURE SIGNATURE_32('R', 'S', 'D', 'T')
649 |
650 | ///
651 | /// "SBST" Smart Battery Specification Table.
652 | ///
653 | #define EFI_ACPI_1_0_SMART_BATTERY_SPECIFICATION_TABLE_SIGNATURE SIGNATURE_32('S', 'B', 'S', 'T')
654 |
655 | ///
656 | /// "SSDT" Secondary System Description Table.
657 | ///
658 | #define EFI_ACPI_1_0_SECONDARY_SYSTEM_DESCRIPTION_TABLE_SIGNATURE SIGNATURE_32('S', 'S', 'D', 'T')
659 |
660 | #pragma pack()
661 |
662 | #endif
663 |
--------------------------------------------------------------------------------
/contrib/uefi-simple.vcxproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | Debug
6 | ARM
7 |
8 |
9 | Debug
10 | ARM64
11 |
12 |
13 | Debug
14 | Win32
15 |
16 |
17 | Debug
18 | x64
19 |
20 |
21 | Release
22 | ARM
23 |
24 |
25 | Release
26 | ARM64
27 |
28 |
29 | Release
30 | Win32
31 |
32 |
33 | Release
34 | x64
35 |
36 |
37 |
38 | {DFA0BA98-D0BA-4176-9A34-B5BA6355B1DE}
39 | uefi-simple
40 | 10.0.15063.0
41 | AcpiPatcher
42 |
43 |
44 |
45 | x64
46 |
47 |
48 | Application
49 | true
50 | v141
51 | Unicode
52 |
53 |
54 | Application
55 | true
56 | v141
57 | Unicode
58 |
59 |
60 | Application
61 | true
62 | v141
63 | Unicode
64 | true
65 |
66 |
67 | Application
68 | true
69 | v141
70 | Unicode
71 | true
72 |
73 |
74 | Application
75 | false
76 | v141
77 | Unicode
78 |
79 |
80 | Application
81 | false
82 | v141
83 | Unicode
84 |
85 |
86 | Application
87 | false
88 | v141
89 | Unicode
90 | true
91 |
92 |
93 | Application
94 | false
95 | v141
96 | Unicode
97 | true
98 |
99 |
100 |
101 | .efi
102 | false
103 | false
104 | $(SolutionDir)build\production\$(ProjectName)\$(Platform)\$(Configuration)\
105 | $(SolutionDir)build\intermediate\$(ProjectName)\$(Platform)\$(Configuration)\
106 | AcpiPatcher
107 |
108 |
109 | .efi
110 | false
111 | false
112 | $(SolutionDir)build\production\$(ProjectName)\$(Platform)\$(Configuration)\
113 | $(SolutionDir)build\intermediate\$(ProjectName)\$(Platform)\$(Configuration)\
114 | AcpiPatcher
115 |
116 |
117 | .efi
118 | false
119 | false
120 | $(SolutionDir)build\production\$(ProjectName)\$(Platform)\$(Configuration)\
121 | $(SolutionDir)build\intermediate\$(ProjectName)\$(Platform)\$(Configuration)\
122 | AcpiPatcher
123 |
124 |
125 | .efi
126 | false
127 | false
128 | $(SolutionDir)build\production\$(ProjectName)\$(Platform)\$(Configuration)\
129 | $(SolutionDir)build\intermediate\$(ProjectName)\$(Platform)\$(Configuration)\
130 | AcpiPatcher
131 |
132 |
133 | .efi
134 | false
135 | false
136 | $(SolutionDir)build\production\$(ProjectName)\$(Platform)\$(Configuration)\
137 | $(SolutionDir)build\intermediate\$(ProjectName)\$(Platform)\$(Configuration)\
138 | AcpiPatcher
139 |
140 |
141 | .efi
142 | false
143 | false
144 | $(SolutionDir)build\production\$(ProjectName)\$(Platform)\$(Configuration)\
145 | $(SolutionDir)build\intermediate\$(ProjectName)\$(Platform)\$(Configuration)\
146 | AcpiPatcher
147 |
148 |
149 | .efi
150 | false
151 | false
152 | $(SolutionDir)build\production\$(ProjectName)\$(Platform)\$(Configuration)\
153 | $(SolutionDir)build\intermediate\$(ProjectName)\$(Platform)\$(Configuration)\
154 | AcpiPatcher
155 |
156 |
157 | .efi
158 | false
159 | false
160 | $(SolutionDir)build\production\$(ProjectName)\$(Platform)\$(Configuration)\
161 | $(SolutionDir)build\intermediate\$(ProjectName)\$(Platform)\$(Configuration)\
162 | AcpiPatcher
163 |
164 |
165 |
166 | $(SolutionDir)gnu-efi\inc;$(SolutionDir)gnu-efi\inc\x86_64;$(SolutionDir)Includes
167 | _UNICODE;UNICODE;HAVE_USE_MS_ABI;GNU_EFI_USE_EXTERNAL_STDARG;%(PreprocessorDefinitions)
168 | false
169 | CompileAsC
170 | Level3
171 | 4091
172 | ProgramDatabase
173 | Default
174 | false
175 | /Oi- %(AdditionalOptions)
176 |
177 |
178 | EFI Application
179 |
180 |
181 | true
182 |
183 |
184 | gnu-efi.lib;libcmtd.lib;%(AdditionalDependencies)
185 | false
186 | true
187 | efi_main
188 | EFI Application
189 | $(SolutionDir)build\production\gnu-efi\$(Platform)\$(Configuration)\;%(AdditionalLibraryDirectories)
190 | true
191 |
192 |
193 |
194 |
195 |
196 | $(SolutionDir)\gnu-efi\inc;$(SolutionDir)\gnu-efi\inc\ia32;$(SolutionDir)Includes
197 | _UNICODE;UNICODE;HAVE_USE_MS_ABI;GNU_EFI_USE_EXTERNAL_STDARG;%(PreprocessorDefinitions)
198 | false
199 | CompileAsC
200 | Level3
201 | ProgramDatabase
202 | 4091
203 | Default
204 | false
205 | /Oi- %(AdditionalOptions)
206 |
207 |
208 | EFI Application
209 |
210 |
211 | true
212 |
213 |
214 | gnu-efi.lib;libcmtd.lib;%(AdditionalDependencies)
215 | false
216 | true
217 | efi_main
218 | EFI Application
219 | $(SolutionDir)build\production\gnu-efi\$(Platform)\$(Configuration)\;%(AdditionalLibraryDirectories)
220 | true
221 | MachineX86
222 |
223 |
224 |
225 |
226 |
227 | $(SolutionDir)gnu-efi\inc;$(SolutionDir)gnu-efi\inc\arm;$(SolutionDir)Includes
228 | _UNICODE;UNICODE;HAVE_USE_MS_ABI;GNU_EFI_USE_EXTERNAL_STDARG;%(PreprocessorDefinitions)
229 | false
230 | CompileAsC
231 | Level3
232 | ProgramDatabase
233 | 4091
234 | Default
235 | false
236 | /Oi- %(AdditionalOptions)
237 |
238 |
239 | EFI Application
240 |
241 |
242 | true
243 |
244 |
245 | gnu-efi.lib;libcmtd.lib;%(AdditionalDependencies)
246 | false
247 | true
248 | efi_main
249 | EFI Application
250 | $(SolutionDir)build\production\gnu-efi\$(Platform)\$(Configuration)\;%(AdditionalLibraryDirectories)
251 | true
252 |
253 |
254 |
255 |
256 |
257 | $(SolutionDir)\gnu-efi\inc;$(SolutionDir)\gnu-efi\inc\aarch64;$(SolutionDir)Includes
258 | _UNICODE;UNICODE;HAVE_USE_MS_ABI;GNU_EFI_USE_EXTERNAL_STDARG;%(PreprocessorDefinitions)
259 | false
260 | CompileAsC
261 | Level3
262 | ProgramDatabase
263 | 4091
264 | Default
265 | false
266 | /Oi- %(AdditionalOptions)
267 |
268 |
269 | EFI Application
270 |
271 |
272 | true
273 |
274 |
275 | gnu-efi.lib;libcmtd.lib;%(AdditionalDependencies)
276 | false
277 | true
278 | efi_main
279 | EFI Application
280 | $(SolutionDir)build\production\gnu-efi\$(Platform)\$(Configuration)\;%(AdditionalLibraryDirectories)
281 | true
282 |
283 |
284 |
285 |
286 |
287 | $(SolutionDir)\gnu-efi\inc;$(SolutionDir)\gnu-efi\inc\x86_64;$(SolutionDir)Includes
288 | _UNICODE;UNICODE;HAVE_USE_MS_ABI;GNU_EFI_USE_EXTERNAL_STDARG;%(PreprocessorDefinitions)
289 | false
290 | CompileAsC
291 | Level3
292 | 4091
293 | false
294 | /Oi- %(AdditionalOptions)
295 |
296 |
297 | EFI Application
298 |
299 |
300 | true
301 |
302 |
303 | false
304 | true
305 | efi_main
306 | EFI Application
307 | gnu-efi.lib;libcmt.lib;%(AdditionalDependencies)
308 | $(SolutionDir)build\production\gnu-efi\$(Platform)\$(Configuration)\;%(AdditionalLibraryDirectories)
309 | true
310 |
311 |
312 |
313 |
314 |
315 | $(SolutionDir)\gnu-efi\inc;$(SolutionDir)\gnu-efi\inc\ia32;$(SolutionDir)Includes
316 | _UNICODE;UNICODE;HAVE_USE_MS_ABI;GNU_EFI_USE_EXTERNAL_STDARG;%(PreprocessorDefinitions)
317 | false
318 | CompileAsC
319 | Level3
320 | 4091
321 | false
322 | /Oi- %(AdditionalOptions)
323 |
324 |
325 | EFI Application
326 |
327 |
328 | true
329 |
330 |
331 | false
332 | true
333 | efi_main
334 | EFI Application
335 | gnu-efi.lib;libcmt.lib;%(AdditionalDependencies)
336 | $(SolutionDir)build\production\gnu-efi\$(Platform)\$(Configuration)\;%(AdditionalLibraryDirectories)
337 | true
338 |
339 |
340 |
341 |
342 |
343 | $(SolutionDir)\gnu-efi\inc;$(SolutionDir)\gnu-efi\inc\arm;$(SolutionDir)Includes
344 | _UNICODE;UNICODE;HAVE_USE_MS_ABI;GNU_EFI_USE_EXTERNAL_STDARG;%(PreprocessorDefinitions)
345 | false
346 | CompileAsC
347 | Level3
348 | 4091
349 | false
350 | /Oi- %(AdditionalOptions)
351 |
352 |
353 | EFI Application
354 |
355 |
356 | true
357 |
358 |
359 | false
360 | true
361 | efi_main
362 | EFI Application
363 | gnu-efi.lib;libcmt.lib;%(AdditionalDependencies)
364 | $(SolutionDir)build\production\gnu-efi\$(Platform)\$(Configuration)\;%(AdditionalLibraryDirectories)
365 | true
366 |
367 |
368 |
369 |
370 |
371 | $(SolutionDir)\gnu-efi\inc;$(SolutionDir)\gnu-efi\inc\aarch64;$(SolutionDir)Includes
372 | _UNICODE;UNICODE;HAVE_USE_MS_ABI;GNU_EFI_USE_EXTERNAL_STDARG;%(PreprocessorDefinitions)
373 | false
374 | CompileAsC
375 | Level3
376 | 4091
377 | false
378 | /Oi- %(AdditionalOptions)
379 |
380 |
381 | EFI Application
382 |
383 |
384 | true
385 |
386 |
387 | false
388 | true
389 | efi_main
390 | EFI Application
391 | gnu-efi.lib;libcmt.lib;%(AdditionalDependencies)
392 | $(SolutionDir)build\production\gnu-efi\$(Platform)\$(Configuration)\;%(AdditionalLibraryDirectories)
393 | true
394 |
395 |
396 |
397 |
398 |
399 |
400 |
401 |
402 |
403 |
404 |
405 |
406 |
407 |
408 |
409 |
410 |
411 |
412 |
413 |
414 |
415 |
416 |
417 |
--------------------------------------------------------------------------------
/Includes/IndustryStandard/Acpi30.h:
--------------------------------------------------------------------------------
1 | /** @file
2 | ACPI 3.0 definitions from the ACPI Specification Revision 3.0b October 10, 2006
3 |
4 | Copyright (c) 2006 - 2011, Intel Corporation. All rights reserved.
5 | This program and the accompanying materials
6 | are licensed and made available under the terms and conditions of the BSD License
7 | which accompanies this distribution. The full text of the license may be found at
8 | http://opensource.org/licenses/bsd-license.php
9 |
10 | THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
11 | WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
12 | **/
13 |
14 | #ifndef _ACPI_3_0_H_
15 | #define _ACPI_3_0_H_
16 |
17 | #include
18 |
19 | //
20 | // Define for Desriptor
21 | //
22 | #define ACPI_LARGE_EXTENDED_ADDRESS_SPACE_DESCRIPTOR_NAME 0x0B
23 |
24 | #define ACPI_EXTENDED_ADDRESS_SPACE_DESCRIPTOR 0x8B
25 |
26 | //
27 | // Ensure proper structure formats
28 | //
29 | #pragma pack(1)
30 |
31 | ///
32 | /// Extended Address Space Descriptor
33 | ///
34 | typedef PACKED struct {
35 | ACPI_LARGE_RESOURCE_HEADER Header;
36 | UINT8 ResType;
37 | UINT8 GenFlag;
38 | UINT8 SpecificFlag;
39 | UINT8 RevisionId;
40 | UINT8 Reserved;
41 | UINT64 AddrSpaceGranularity;
42 | UINT64 AddrRangeMin;
43 | UINT64 AddrRangeMax;
44 | UINT64 AddrTranslationOffset;
45 | UINT64 AddrLen;
46 | UINT64 TypeSpecificAttribute;
47 | } EFI_ACPI_EXTENDED_ADDRESS_SPACE_DESCRIPTOR;
48 |
49 | #pragma pack()
50 |
51 | //
52 | // Memory Type Specific Flags
53 | //
54 | #define EFI_ACPI_MEMORY_TYPE_SPECIFIC_ATTRIBUTES_UC 0x0000000000000001
55 | #define EFI_ACPI_MEMORY_TYPE_SPECIFIC_ATTRIBUTES_WC 0x0000000000000002
56 | #define EFI_ACPI_MEMORY_TYPE_SPECIFIC_ATTRIBUTES_WT 0x0000000000000004
57 | #define EFI_ACPI_MEMORY_TYPE_SPECIFIC_ATTRIBUTES_WB 0x0000000000000008
58 | #define EFI_ACPI_MEMORY_TYPE_SPECIFIC_ATTRIBUTES_UCE 0x0000000000000010
59 | #define EFI_ACPI_MEMORY_TYPE_SPECIFIC_ATTRIBUTES_NV 0x0000000000008000
60 |
61 | //
62 | // Ensure proper structure formats
63 | //
64 | #pragma pack(1)
65 |
66 | ///
67 | /// ACPI 3.0 Generic Address Space definition
68 | ///
69 | typedef struct {
70 | UINT8 AddressSpaceId;
71 | UINT8 RegisterBitWidth;
72 | UINT8 RegisterBitOffset;
73 | UINT8 AccessSize;
74 | UINT64 Address;
75 | } EFI_ACPI_3_0_GENERIC_ADDRESS_STRUCTURE;
76 |
77 | //
78 | // Generic Address Space Address IDs
79 | //
80 | #define EFI_ACPI_3_0_SYSTEM_MEMORY 0
81 | #define EFI_ACPI_3_0_SYSTEM_IO 1
82 | #define EFI_ACPI_3_0_PCI_CONFIGURATION_SPACE 2
83 | #define EFI_ACPI_3_0_EMBEDDED_CONTROLLER 3
84 | #define EFI_ACPI_3_0_SMBUS 4
85 | #define EFI_ACPI_3_0_FUNCTIONAL_FIXED_HARDWARE 0x7F
86 |
87 | //
88 | // Generic Address Space Access Sizes
89 | //
90 | #define EFI_ACPI_3_0_UNDEFINED 0
91 | #define EFI_ACPI_3_0_BYTE 1
92 | #define EFI_ACPI_3_0_WORD 2
93 | #define EFI_ACPI_3_0_DWORD 3
94 | #define EFI_ACPI_3_0_QWORD 4
95 |
96 | //
97 | // ACPI 3.0 table structures
98 | //
99 |
100 | ///
101 | /// Root System Description Pointer Structure
102 | ///
103 | typedef struct {
104 | UINT64 Signature;
105 | UINT8 Checksum;
106 | UINT8 OemId[6];
107 | UINT8 Revision;
108 | UINT32 RsdtAddress;
109 | UINT32 Length;
110 | UINT64 XsdtAddress;
111 | UINT8 ExtendedChecksum;
112 | UINT8 Reserved[3];
113 | } EFI_ACPI_3_0_ROOT_SYSTEM_DESCRIPTION_POINTER;
114 |
115 | ///
116 | /// RSD_PTR Revision (as defined in ACPI 3.0b spec.)
117 | ///
118 | #define EFI_ACPI_3_0_ROOT_SYSTEM_DESCRIPTION_POINTER_REVISION 0x02 ///< ACPISpec (Revision 3.0b) says current value is 2
119 |
120 | ///
121 | /// Common table header, this prefaces all ACPI tables, including FACS, but
122 | /// excluding the RSD PTR structure
123 | ///
124 | typedef struct {
125 | UINT32 Signature;
126 | UINT32 Length;
127 | } EFI_ACPI_3_0_COMMON_HEADER;
128 |
129 | //
130 | // Root System Description Table
131 | // No definition needed as it is a common description table header, the same with
132 | // EFI_ACPI_DESCRIPTION_HEADER, followed by a variable number of UINT32 table pointers.
133 | //
134 |
135 | ///
136 | /// RSDT Revision (as defined in ACPI 3.0 spec.)
137 | ///
138 | #define EFI_ACPI_3_0_ROOT_SYSTEM_DESCRIPTION_TABLE_REVISION 0x01
139 |
140 | //
141 | // Extended System Description Table
142 | // No definition needed as it is a common description table header, the same with
143 | // EFI_ACPI_DESCRIPTION_HEADER, followed by a variable number of UINT64 table pointers.
144 | //
145 |
146 | ///
147 | /// XSDT Revision (as defined in ACPI 3.0 spec.)
148 | ///
149 | #define EFI_ACPI_3_0_EXTENDED_SYSTEM_DESCRIPTION_TABLE_REVISION 0x01
150 |
151 | ///
152 | /// Fixed ACPI Description Table Structure (FADT)
153 | ///
154 | typedef struct {
155 | EFI_ACPI_DESCRIPTION_HEADER Header;
156 | UINT32 FirmwareCtrl;
157 | UINT32 Dsdt;
158 | UINT8 Reserved0;
159 | UINT8 PreferredPmProfile;
160 | UINT16 SciInt;
161 | UINT32 SmiCmd;
162 | UINT8 AcpiEnable;
163 | UINT8 AcpiDisable;
164 | UINT8 S4BiosReq;
165 | UINT8 PstateCnt;
166 | UINT32 Pm1aEvtBlk;
167 | UINT32 Pm1bEvtBlk;
168 | UINT32 Pm1aCntBlk;
169 | UINT32 Pm1bCntBlk;
170 | UINT32 Pm2CntBlk;
171 | UINT32 PmTmrBlk;
172 | UINT32 Gpe0Blk;
173 | UINT32 Gpe1Blk;
174 | UINT8 Pm1EvtLen;
175 | UINT8 Pm1CntLen;
176 | UINT8 Pm2CntLen;
177 | UINT8 PmTmrLen;
178 | UINT8 Gpe0BlkLen;
179 | UINT8 Gpe1BlkLen;
180 | UINT8 Gpe1Base;
181 | UINT8 CstCnt;
182 | UINT16 PLvl2Lat;
183 | UINT16 PLvl3Lat;
184 | UINT16 FlushSize;
185 | UINT16 FlushStride;
186 | UINT8 DutyOffset;
187 | UINT8 DutyWidth;
188 | UINT8 DayAlrm;
189 | UINT8 MonAlrm;
190 | UINT8 Century;
191 | UINT16 IaPcBootArch;
192 | UINT8 Reserved1;
193 | UINT32 Flags;
194 | EFI_ACPI_3_0_GENERIC_ADDRESS_STRUCTURE ResetReg;
195 | UINT8 ResetValue;
196 | UINT8 Reserved2[3];
197 | UINT64 XFirmwareCtrl;
198 | UINT64 XDsdt;
199 | EFI_ACPI_3_0_GENERIC_ADDRESS_STRUCTURE XPm1aEvtBlk;
200 | EFI_ACPI_3_0_GENERIC_ADDRESS_STRUCTURE XPm1bEvtBlk;
201 | EFI_ACPI_3_0_GENERIC_ADDRESS_STRUCTURE XPm1aCntBlk;
202 | EFI_ACPI_3_0_GENERIC_ADDRESS_STRUCTURE XPm1bCntBlk;
203 | EFI_ACPI_3_0_GENERIC_ADDRESS_STRUCTURE XPm2CntBlk;
204 | EFI_ACPI_3_0_GENERIC_ADDRESS_STRUCTURE XPmTmrBlk;
205 | EFI_ACPI_3_0_GENERIC_ADDRESS_STRUCTURE XGpe0Blk;
206 | EFI_ACPI_3_0_GENERIC_ADDRESS_STRUCTURE XGpe1Blk;
207 | } EFI_ACPI_3_0_FIXED_ACPI_DESCRIPTION_TABLE;
208 |
209 | ///
210 | /// FADT Version (as defined in ACPI 3.0 spec.)
211 | ///
212 | #define EFI_ACPI_3_0_FIXED_ACPI_DESCRIPTION_TABLE_REVISION 0x04
213 |
214 | //
215 | // Fixed ACPI Description Table Preferred Power Management Profile
216 | //
217 | #define EFI_ACPI_3_0_PM_PROFILE_UNSPECIFIED 0
218 | #define EFI_ACPI_3_0_PM_PROFILE_DESKTOP 1
219 | #define EFI_ACPI_3_0_PM_PROFILE_MOBILE 2
220 | #define EFI_ACPI_3_0_PM_PROFILE_WORKSTATION 3
221 | #define EFI_ACPI_3_0_PM_PROFILE_ENTERPRISE_SERVER 4
222 | #define EFI_ACPI_3_0_PM_PROFILE_SOHO_SERVER 5
223 | #define EFI_ACPI_3_0_PM_PROFILE_APPLIANCE_PC 6
224 | #define EFI_ACPI_3_0_PM_PROFILE_PERFORMANCE_SERVER 7
225 |
226 | //
227 | // Fixed ACPI Description Table Boot Architecture Flags
228 | // All other bits are reserved and must be set to 0.
229 | //
230 | #define EFI_ACPI_3_0_LEGACY_DEVICES BIT0
231 | #define EFI_ACPI_3_0_8042 BIT1
232 | #define EFI_ACPI_3_0_VGA_NOT_PRESENT BIT2
233 | #define EFI_ACPI_3_0_MSI_NOT_SUPPORTED BIT3
234 | #define EFI_ACPI_3_0_PCIE_ASPM_CONTROLS BIT4
235 |
236 | //
237 | // Fixed ACPI Description Table Fixed Feature Flags
238 | // All other bits are reserved and must be set to 0.
239 | //
240 | #define EFI_ACPI_3_0_WBINVD BIT0
241 | #define EFI_ACPI_3_0_WBINVD_FLUSH BIT1
242 | #define EFI_ACPI_3_0_PROC_C1 BIT2
243 | #define EFI_ACPI_3_0_P_LVL2_UP BIT3
244 | #define EFI_ACPI_3_0_PWR_BUTTON BIT4
245 | #define EFI_ACPI_3_0_SLP_BUTTON BIT5
246 | #define EFI_ACPI_3_0_FIX_RTC BIT6
247 | #define EFI_ACPI_3_0_RTC_S4 BIT7
248 | #define EFI_ACPI_3_0_TMR_VAL_EXT BIT8
249 | #define EFI_ACPI_3_0_DCK_CAP BIT9
250 | #define EFI_ACPI_3_0_RESET_REG_SUP BIT10
251 | #define EFI_ACPI_3_0_SEALED_CASE BIT11
252 | #define EFI_ACPI_3_0_HEADLESS BIT12
253 | #define EFI_ACPI_3_0_CPU_SW_SLP BIT13
254 | #define EFI_ACPI_3_0_PCI_EXP_WAK BIT14
255 | #define EFI_ACPI_3_0_USE_PLATFORM_CLOCK BIT15
256 | #define EFI_ACPI_3_0_S4_RTC_STS_VALID BIT16
257 | #define EFI_ACPI_3_0_REMOTE_POWER_ON_CAPABLE BIT17
258 | #define EFI_ACPI_3_0_FORCE_APIC_CLUSTER_MODEL BIT18
259 | #define EFI_ACPI_3_0_FORCE_APIC_PHYSICAL_DESTINATION_MODE BIT19
260 |
261 | ///
262 | /// Firmware ACPI Control Structure
263 | ///
264 | typedef struct {
265 | UINT32 Signature;
266 | UINT32 Length;
267 | UINT32 HardwareSignature;
268 | UINT32 FirmwareWakingVector;
269 | UINT32 GlobalLock;
270 | UINT32 Flags;
271 | UINT64 XFirmwareWakingVector;
272 | UINT8 Version;
273 | UINT8 Reserved[31];
274 | } EFI_ACPI_3_0_FIRMWARE_ACPI_CONTROL_STRUCTURE;
275 |
276 | ///
277 | /// FACS Version (as defined in ACPI 3.0 spec.)
278 | ///
279 | #define EFI_ACPI_3_0_FIRMWARE_ACPI_CONTROL_STRUCTURE_VERSION 0x01
280 |
281 | ///
282 | /// Firmware Control Structure Feature Flags
283 | /// All other bits are reserved and must be set to 0.
284 | ///
285 | #define EFI_ACPI_3_0_S4BIOS_F BIT0
286 |
287 | //
288 | // Differentiated System Description Table,
289 | // Secondary System Description Table
290 | // and Persistent System Description Table,
291 | // no definition needed as they are common description table header, the same with
292 | // EFI_ACPI_DESCRIPTION_HEADER, followed by a definition block.
293 | //
294 | #define EFI_ACPI_3_0_DIFFERENTIATED_SYSTEM_DESCRIPTION_TABLE_REVISION 0x02
295 | #define EFI_ACPI_3_0_SECONDARY_SYSTEM_DESCRIPTION_TABLE_REVISION 0x02
296 |
297 | ///
298 | /// Multiple APIC Description Table header definition. The rest of the table
299 | /// must be defined in a platform specific manner.
300 | ///
301 | typedef struct {
302 | EFI_ACPI_DESCRIPTION_HEADER Header;
303 | UINT32 LocalApicAddress;
304 | UINT32 Flags;
305 | } EFI_ACPI_3_0_MULTIPLE_APIC_DESCRIPTION_TABLE_HEADER;
306 |
307 | ///
308 | /// MADT Revision (as defined in ACPI 3.0 spec.)
309 | ///
310 | #define EFI_ACPI_3_0_MULTIPLE_APIC_DESCRIPTION_TABLE_REVISION 0x02
311 |
312 | ///
313 | /// Multiple APIC Flags
314 | /// All other bits are reserved and must be set to 0.
315 | ///
316 | #define EFI_ACPI_3_0_PCAT_COMPAT BIT0
317 |
318 | //
319 | // Multiple APIC Description Table APIC structure types
320 | // All other values between 0x09 an 0xFF are reserved and
321 | // will be ignored by OSPM.
322 | //
323 | #define EFI_ACPI_3_0_PROCESSOR_LOCAL_APIC 0x00
324 | #define EFI_ACPI_3_0_IO_APIC 0x01
325 | #define EFI_ACPI_3_0_INTERRUPT_SOURCE_OVERRIDE 0x02
326 | #define EFI_ACPI_3_0_NON_MASKABLE_INTERRUPT_SOURCE 0x03
327 | #define EFI_ACPI_3_0_LOCAL_APIC_NMI 0x04
328 | #define EFI_ACPI_3_0_LOCAL_APIC_ADDRESS_OVERRIDE 0x05
329 | #define EFI_ACPI_3_0_IO_SAPIC 0x06
330 | #define EFI_ACPI_3_0_LOCAL_SAPIC 0x07
331 | #define EFI_ACPI_3_0_PLATFORM_INTERRUPT_SOURCES 0x08
332 |
333 | //
334 | // APIC Structure Definitions
335 | //
336 |
337 | ///
338 | /// Processor Local APIC Structure Definition
339 | ///
340 | typedef struct {
341 | UINT8 Type;
342 | UINT8 Length;
343 | UINT8 AcpiProcessorId;
344 | UINT8 ApicId;
345 | UINT32 Flags;
346 | } EFI_ACPI_3_0_PROCESSOR_LOCAL_APIC_STRUCTURE;
347 |
348 | ///
349 | /// Local APIC Flags. All other bits are reserved and must be 0.
350 | ///
351 | #define EFI_ACPI_3_0_LOCAL_APIC_ENABLED BIT0
352 |
353 | ///
354 | /// IO APIC Structure
355 | ///
356 | typedef struct {
357 | UINT8 Type;
358 | UINT8 Length;
359 | UINT8 IoApicId;
360 | UINT8 Reserved;
361 | UINT32 IoApicAddress;
362 | UINT32 GlobalSystemInterruptBase;
363 | } EFI_ACPI_3_0_IO_APIC_STRUCTURE;
364 |
365 | ///
366 | /// Interrupt Source Override Structure
367 | ///
368 | typedef struct {
369 | UINT8 Type;
370 | UINT8 Length;
371 | UINT8 Bus;
372 | UINT8 Source;
373 | UINT32 GlobalSystemInterrupt;
374 | UINT16 Flags;
375 | } EFI_ACPI_3_0_INTERRUPT_SOURCE_OVERRIDE_STRUCTURE;
376 |
377 | ///
378 | /// Platform Interrupt Sources Structure Definition
379 | ///
380 | typedef struct {
381 | UINT8 Type;
382 | UINT8 Length;
383 | UINT16 Flags;
384 | UINT8 InterruptType;
385 | UINT8 ProcessorId;
386 | UINT8 ProcessorEid;
387 | UINT8 IoSapicVector;
388 | UINT32 GlobalSystemInterrupt;
389 | UINT32 PlatformInterruptSourceFlags;
390 | UINT8 CpeiProcessorOverride;
391 | UINT8 Reserved[31];
392 | } EFI_ACPI_3_0_PLATFORM_INTERRUPT_APIC_STRUCTURE;
393 |
394 | //
395 | // MPS INTI flags.
396 | // All other bits are reserved and must be set to 0.
397 | //
398 | #define EFI_ACPI_3_0_POLARITY (3 << 0)
399 | #define EFI_ACPI_3_0_TRIGGER_MODE (3 << 2)
400 |
401 | ///
402 | /// Non-Maskable Interrupt Source Structure
403 | ///
404 | typedef struct {
405 | UINT8 Type;
406 | UINT8 Length;
407 | UINT16 Flags;
408 | UINT32 GlobalSystemInterrupt;
409 | } EFI_ACPI_3_0_NON_MASKABLE_INTERRUPT_SOURCE_STRUCTURE;
410 |
411 | ///
412 | /// Local APIC NMI Structure
413 | ///
414 | typedef struct {
415 | UINT8 Type;
416 | UINT8 Length;
417 | UINT8 AcpiProcessorId;
418 | UINT16 Flags;
419 | UINT8 LocalApicLint;
420 | } EFI_ACPI_3_0_LOCAL_APIC_NMI_STRUCTURE;
421 |
422 | ///
423 | /// Local APIC Address Override Structure
424 | ///
425 | typedef struct {
426 | UINT8 Type;
427 | UINT8 Length;
428 | UINT16 Reserved;
429 | UINT64 LocalApicAddress;
430 | } EFI_ACPI_3_0_LOCAL_APIC_ADDRESS_OVERRIDE_STRUCTURE;
431 |
432 | ///
433 | /// IO SAPIC Structure
434 | ///
435 | typedef struct {
436 | UINT8 Type;
437 | UINT8 Length;
438 | UINT8 IoApicId;
439 | UINT8 Reserved;
440 | UINT32 GlobalSystemInterruptBase;
441 | UINT64 IoSapicAddress;
442 | } EFI_ACPI_3_0_IO_SAPIC_STRUCTURE;
443 |
444 | ///
445 | /// Local SAPIC Structure
446 | /// This struct followed by a null-terminated ASCII string - ACPI Processor UID String
447 | ///
448 | typedef struct {
449 | UINT8 Type;
450 | UINT8 Length;
451 | UINT8 AcpiProcessorId;
452 | UINT8 LocalSapicId;
453 | UINT8 LocalSapicEid;
454 | UINT8 Reserved[3];
455 | UINT32 Flags;
456 | UINT32 ACPIProcessorUIDValue;
457 | } EFI_ACPI_3_0_PROCESSOR_LOCAL_SAPIC_STRUCTURE;
458 |
459 | ///
460 | /// Platform Interrupt Sources Structure
461 | ///
462 | typedef struct {
463 | UINT8 Type;
464 | UINT8 Length;
465 | UINT16 Flags;
466 | UINT8 InterruptType;
467 | UINT8 ProcessorId;
468 | UINT8 ProcessorEid;
469 | UINT8 IoSapicVector;
470 | UINT32 GlobalSystemInterrupt;
471 | UINT32 PlatformInterruptSourceFlags;
472 | } EFI_ACPI_3_0_PLATFORM_INTERRUPT_SOURCES_STRUCTURE;
473 |
474 | ///
475 | /// Platform Interrupt Source Flags.
476 | /// All other bits are reserved and must be set to 0.
477 | ///
478 | #define EFI_ACPI_3_0_CPEI_PROCESSOR_OVERRIDE BIT0
479 |
480 | ///
481 | /// Smart Battery Description Table (SBST)
482 | ///
483 | typedef struct {
484 | EFI_ACPI_DESCRIPTION_HEADER Header;
485 | UINT32 WarningEnergyLevel;
486 | UINT32 LowEnergyLevel;
487 | UINT32 CriticalEnergyLevel;
488 | } EFI_ACPI_3_0_SMART_BATTERY_DESCRIPTION_TABLE;
489 |
490 | ///
491 | /// SBST Version (as defined in ACPI 3.0 spec.)
492 | ///
493 | #define EFI_ACPI_3_0_SMART_BATTERY_DESCRIPTION_TABLE_REVISION 0x01
494 |
495 | ///
496 | /// Embedded Controller Boot Resources Table (ECDT)
497 | /// The table is followed by a null terminated ASCII string that contains
498 | /// a fully qualified reference to the name space object.
499 | ///
500 | typedef struct {
501 | EFI_ACPI_DESCRIPTION_HEADER Header;
502 | EFI_ACPI_3_0_GENERIC_ADDRESS_STRUCTURE EcControl;
503 | EFI_ACPI_3_0_GENERIC_ADDRESS_STRUCTURE EcData;
504 | UINT32 Uid;
505 | UINT8 GpeBit;
506 | } EFI_ACPI_3_0_EMBEDDED_CONTROLLER_BOOT_RESOURCES_TABLE;
507 |
508 | ///
509 | /// ECDT Version (as defined in ACPI 3.0 spec.)
510 | ///
511 | #define EFI_ACPI_3_0_EMBEDDED_CONTROLLER_BOOT_RESOURCES_TABLE_REVISION 0x01
512 |
513 | ///
514 | /// System Resource Affinity Table (SRAT. The rest of the table
515 | /// must be defined in a platform specific manner.
516 | ///
517 | typedef struct {
518 | EFI_ACPI_DESCRIPTION_HEADER Header;
519 | UINT32 Reserved1; ///< Must be set to 1
520 | UINT64 Reserved2;
521 | } EFI_ACPI_3_0_SYSTEM_RESOURCE_AFFINITY_TABLE_HEADER;
522 |
523 | ///
524 | /// SRAT Version (as defined in ACPI 3.0 spec.)
525 | ///
526 | #define EFI_ACPI_3_0_SYSTEM_RESOURCE_AFFINITY_TABLE_REVISION 0x02
527 |
528 | //
529 | // SRAT structure types.
530 | // All other values between 0x02 an 0xFF are reserved and
531 | // will be ignored by OSPM.
532 | //
533 | #define EFI_ACPI_3_0_PROCESSOR_LOCAL_APIC_SAPIC_AFFINITY 0x00
534 | #define EFI_ACPI_3_0_MEMORY_AFFINITY 0x01
535 |
536 | ///
537 | /// Processor Local APIC/SAPIC Affinity Structure Definition
538 | ///
539 | typedef struct {
540 | UINT8 Type;
541 | UINT8 Length;
542 | UINT8 ProximityDomain7To0;
543 | UINT8 ApicId;
544 | UINT32 Flags;
545 | UINT8 LocalSapicEid;
546 | UINT8 ProximityDomain31To8[3];
547 | UINT8 Reserved[4];
548 | } EFI_ACPI_3_0_PROCESSOR_LOCAL_APIC_SAPIC_AFFINITY_STRUCTURE;
549 |
550 | ///
551 | /// Local APIC/SAPIC Flags. All other bits are reserved and must be 0.
552 | ///
553 | #define EFI_ACPI_3_0_PROCESSOR_LOCAL_APIC_SAPIC_ENABLED (1 << 0)
554 |
555 | ///
556 | /// Memory Affinity Structure Definition
557 | ///
558 | typedef struct {
559 | UINT8 Type;
560 | UINT8 Length;
561 | UINT32 ProximityDomain;
562 | UINT16 Reserved1;
563 | UINT32 AddressBaseLow;
564 | UINT32 AddressBaseHigh;
565 | UINT32 LengthLow;
566 | UINT32 LengthHigh;
567 | UINT32 Reserved2;
568 | UINT32 Flags;
569 | UINT64 Reserved3;
570 | } EFI_ACPI_3_0_MEMORY_AFFINITY_STRUCTURE;
571 |
572 | //
573 | // Memory Flags. All other bits are reserved and must be 0.
574 | //
575 | #define EFI_ACPI_3_0_MEMORY_ENABLED (1 << 0)
576 | #define EFI_ACPI_3_0_MEMORY_HOT_PLUGGABLE (1 << 1)
577 | #define EFI_ACPI_3_0_MEMORY_NONVOLATILE (1 << 2)
578 |
579 | ///
580 | /// System Locality Distance Information Table (SLIT).
581 | /// The rest of the table is a matrix.
582 | ///
583 | typedef struct {
584 | EFI_ACPI_DESCRIPTION_HEADER Header;
585 | UINT64 NumberOfSystemLocalities;
586 | } EFI_ACPI_3_0_SYSTEM_LOCALITY_DISTANCE_INFORMATION_TABLE_HEADER;
587 |
588 | ///
589 | /// SLIT Version (as defined in ACPI 3.0 spec.)
590 | ///
591 | #define EFI_ACPI_3_0_SYSTEM_LOCALITY_DISTANCE_INFORMATION_TABLE_REVISION 0x01
592 |
593 | //
594 | // Known table signatures
595 | //
596 |
597 | ///
598 | /// "RSD PTR " Root System Description Pointer
599 | ///
600 | #define EFI_ACPI_3_0_ROOT_SYSTEM_DESCRIPTION_POINTER_SIGNATURE SIGNATURE_64('R', 'S', 'D', ' ', 'P', 'T', 'R', ' ')
601 |
602 | ///
603 | /// "APIC" Multiple APIC Description Table
604 | ///
605 | #define EFI_ACPI_3_0_MULTIPLE_APIC_DESCRIPTION_TABLE_SIGNATURE SIGNATURE_32('A', 'P', 'I', 'C')
606 |
607 | ///
608 | /// "DSDT" Differentiated System Description Table
609 | ///
610 | #define EFI_ACPI_3_0_DIFFERENTIATED_SYSTEM_DESCRIPTION_TABLE_SIGNATURE SIGNATURE_32('D', 'S', 'D', 'T')
611 |
612 | ///
613 | /// "ECDT" Embedded Controller Boot Resources Table
614 | ///
615 | #define EFI_ACPI_3_0_EMBEDDED_CONTROLLER_BOOT_RESOURCES_TABLE_SIGNATURE SIGNATURE_32('E', 'C', 'D', 'T')
616 |
617 | ///
618 | /// "FACP" Fixed ACPI Description Table
619 | ///
620 | #define EFI_ACPI_3_0_FIXED_ACPI_DESCRIPTION_TABLE_SIGNATURE SIGNATURE_32('F', 'A', 'C', 'P')
621 |
622 | ///
623 | /// "FACS" Firmware ACPI Control Structure
624 | ///
625 | #define EFI_ACPI_3_0_FIRMWARE_ACPI_CONTROL_STRUCTURE_SIGNATURE SIGNATURE_32('F', 'A', 'C', 'S')
626 |
627 | ///
628 | /// "PSDT" Persistent System Description Table
629 | ///
630 | #define EFI_ACPI_3_0_PERSISTENT_SYSTEM_DESCRIPTION_TABLE_SIGNATURE SIGNATURE_32('P', 'S', 'D', 'T')
631 |
632 | ///
633 | /// "RSDT" Root System Description Table
634 | ///
635 | #define EFI_ACPI_3_0_ROOT_SYSTEM_DESCRIPTION_TABLE_SIGNATURE SIGNATURE_32('R', 'S', 'D', 'T')
636 |
637 | ///
638 | /// "SBST" Smart Battery Specification Table
639 | ///
640 | #define EFI_ACPI_3_0_SMART_BATTERY_SPECIFICATION_TABLE_SIGNATURE SIGNATURE_32('S', 'B', 'S', 'T')
641 |
642 | ///
643 | /// "SLIT" System Locality Information Table
644 | ///
645 | #define EFI_ACPI_3_0_SYSTEM_LOCALITY_INFORMATION_TABLE_SIGNATURE SIGNATURE_32('S', 'L', 'I', 'T')
646 |
647 | ///
648 | /// "SRAT" System Resource Affinity Table
649 | ///
650 | #define EFI_ACPI_3_0_SYSTEM_RESOURCE_AFFINITY_TABLE_SIGNATURE SIGNATURE_32('S', 'R', 'A', 'T')
651 |
652 | ///
653 | /// "SSDT" Secondary System Description Table
654 | ///
655 | #define EFI_ACPI_3_0_SECONDARY_SYSTEM_DESCRIPTION_TABLE_SIGNATURE SIGNATURE_32('S', 'S', 'D', 'T')
656 |
657 | ///
658 | /// "XSDT" Extended System Description Table
659 | ///
660 | #define EFI_ACPI_3_0_EXTENDED_SYSTEM_DESCRIPTION_TABLE_SIGNATURE SIGNATURE_32('X', 'S', 'D', 'T')
661 |
662 | ///
663 | /// "BOOT" MS Simple Boot Spec
664 | ///
665 | #define EFI_ACPI_3_0_SIMPLE_BOOT_FLAG_TABLE_SIGNATURE SIGNATURE_32('B', 'O', 'O', 'T')
666 |
667 | ///
668 | /// "CPEP" Corrected Platform Error Polling Table
669 | ///
670 | #define EFI_ACPI_3_0_CORRECTED_PLATFORM_ERROR_POLLING_TABLE_SIGNATURE SIGNATURE_32('C', 'P', 'E', 'P')
671 |
672 | ///
673 | /// "DBGP" MS Debug Port Spec
674 | ///
675 | #define EFI_ACPI_3_0_DEBUG_PORT_TABLE_SIGNATURE SIGNATURE_32('D', 'B', 'G', 'P')
676 |
677 | ///
678 | /// "ETDT" Event Timer Description Table
679 | ///
680 | #define EFI_ACPI_3_0_EVENT_TIMER_DESCRIPTION_TABLE_SIGNATURE SIGNATURE_32('E', 'T', 'D', 'T')
681 |
682 | ///
683 | /// "HPET" IA-PC High Precision Event Timer Table
684 | ///
685 | #define EFI_ACPI_3_0_HIGH_PRECISION_EVENT_TIMER_TABLE_SIGNATURE SIGNATURE_32('H', 'P', 'E', 'T')
686 |
687 | ///
688 | /// "MCFG" PCI Express Memory Mapped Configuration Space Base Address Description Table
689 | ///
690 | #define EFI_ACPI_3_0_PCI_EXPRESS_MEMORY_MAPPED_CONFIGURATION_SPACE_BASE_ADDRESS_DESCRIPTION_TABLE_SIGNATURE SIGNATURE_32('M', 'C', 'F', 'G')
691 |
692 | ///
693 | /// "SPCR" Serial Port Concole Redirection Table
694 | ///
695 | #define EFI_ACPI_3_0_SERIAL_PORT_CONSOLE_REDIRECTION_TABLE_SIGNATURE SIGNATURE_32('S', 'P', 'C', 'R')
696 |
697 | ///
698 | /// "SPMI" Server Platform Management Interface Table
699 | ///
700 | #define EFI_ACPI_3_0_SERVER_PLATFORM_MANAGEMENT_INTERFACE_TABLE_SIGNATURE SIGNATURE_32('S', 'P', 'M', 'I')
701 |
702 | ///
703 | /// "TCPA" Trusted Computing Platform Alliance Capabilities Table
704 | ///
705 | #define EFI_ACPI_3_0_TRUSTED_COMPUTING_PLATFORM_ALLIANCE_CAPABILITIES_TABLE_SIGNATURE SIGNATURE_32('T', 'C', 'P', 'A')
706 |
707 | ///
708 | /// "WDRT" Watchdog Resource Table
709 | ///
710 | #define EFI_ACPI_3_0_WATCHDOG_RESOURCE_TABLE_SIGNATURE SIGNATURE_32('W', 'D', 'R', 'T')
711 |
712 | ///
713 | /// "WDAT" Watchdog Action Table
714 | ///
715 | #define EFI_ACPI_3_0_WATCHDOG_ACTION_TABLE_SIGNATURE SIGNATURE_32('W', 'D', 'A', 'T')
716 |
717 | ///
718 | /// "WSPT" Windows Specific Properties Table
719 | ///
720 | #define EFI_ACPI_3_0_WINDOWS_SPECIFIC_PROPERTIES_TABLE_SIGNATURE SIGNATURE_32('W', 'S', 'P', 'T')
721 |
722 | ///
723 | /// "iBFT" iSCSI Boot Firmware Table
724 | ///
725 | #define EFI_ACPI_3_0_ISCSI_BOOT_FIRMWARE_TABLE_SIGNATURE SIGNATURE_32('i', 'B', 'F', 'T')
726 |
727 | #pragma pack()
728 |
729 | #endif
730 |
--------------------------------------------------------------------------------
/contrib/gnu-efi.vcxproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | Debug
6 | ARM
7 |
8 |
9 | Debug
10 | ARM64
11 |
12 |
13 | Debug
14 | Win32
15 |
16 |
17 | Debug
18 | x64
19 |
20 |
21 | Release
22 | ARM
23 |
24 |
25 | Release
26 | ARM64
27 |
28 |
29 | Release
30 | Win32
31 |
32 |
33 | Release
34 | x64
35 |
36 |
37 |
38 | {3135D563-9596-4584-9ED6-616ADEC52974}
39 | gnuefi
40 | 10.0.15063.0
41 |
42 |
43 |
44 | x64
45 |
46 |
47 | StaticLibrary
48 | true
49 | v141
50 | Unicode
51 |
52 |
53 | StaticLibrary
54 | true
55 | v141
56 | Unicode
57 |
58 |
59 | StaticLibrary
60 | true
61 | v141
62 | Unicode
63 | true
64 |
65 |
66 | StaticLibrary
67 | true
68 | v141
69 | Unicode
70 | true
71 |
72 |
73 | StaticLibrary
74 | false
75 | v141
76 | true
77 | Unicode
78 |
79 |
80 | StaticLibrary
81 | false
82 | v141
83 | true
84 | Unicode
85 |
86 |
87 | StaticLibrary
88 | false
89 | v141
90 | true
91 | Unicode
92 | true
93 |
94 |
95 | StaticLibrary
96 | false
97 | v141
98 | true
99 | Unicode
100 | true
101 |
102 |
103 |
104 | $(SolutionDir)build\production\$(ProjectName)\$(Platform)\$(Configuration)\
105 | $(SolutionDir)build\intermediate\$(ProjectName)\$(Platform)\$(Configuration)\
106 |
107 |
108 | $(SolutionDir)build\production\$(ProjectName)\$(Platform)\$(Configuration)\
109 | $(SolutionDir)build\intermediate\$(ProjectName)\$(Platform)\$(Configuration)\
110 |
111 |
112 | $(SolutionDir)build\production\$(ProjectName)\$(Platform)\$(Configuration)\
113 | $(SolutionDir)build\intermediate\$(ProjectName)\$(Platform)\$(Configuration)\
114 |
115 |
116 | $(SolutionDir)build\production\$(ProjectName)\$(Platform)\$(Configuration)\
117 | $(SolutionDir)build\intermediate\$(ProjectName)\$(Platform)\$(Configuration)\
118 |
119 |
120 | $(SolutionDir)build\production\$(ProjectName)\$(Platform)\$(Configuration)\
121 | $(SolutionDir)build\intermediate\$(ProjectName)\$(Platform)\$(Configuration)\
122 |
123 |
124 | $(SolutionDir)build\production\$(ProjectName)\$(Platform)\$(Configuration)\
125 | $(SolutionDir)build\intermediate\$(ProjectName)\$(Platform)\$(Configuration)\
126 |
127 |
128 | $(SolutionDir)build\production\$(ProjectName)\$(Platform)\$(Configuration)\
129 | $(SolutionDir)build\intermediate\$(ProjectName)\$(Platform)\$(Configuration)\
130 |
131 |
132 | $(SolutionDir)build\production\$(ProjectName)\$(Platform)\$(Configuration)\
133 | $(SolutionDir)build\intermediate\$(ProjectName)\$(Platform)\$(Configuration)\
134 |
135 |
136 |
137 | Level3
138 | Disabled
139 | $(SolutionDir)\gnu-efi\inc;$(SolutionDir)\gnu-efi\inc\x86_64;$(SolutionDir)\gnu-efi\inc\protocol;$(SolutionDir)\gnu-efi\lib
140 | _UNICODE;UNICODE;HAVE_USE_MS_ABI;GNU_EFI_USE_EXTERNAL_STDARG;%(PreprocessorDefinitions)
141 | false
142 | CompileAsC
143 | MultiThreadedDebug
144 | 4312
145 | ProgramDatabase
146 | Default
147 | false
148 | /Oi-
149 |
150 |
151 | true
152 |
153 |
154 | EFI Application
155 | true
156 |
157 |
158 |
159 |
160 | Level3
161 | Disabled
162 | $(SolutionDir)\gnu-efi\inc;$(SolutionDir)\gnu-efi\inc\ia32;$(SolutionDir)\gnu-efi\inc\protocol;$(SolutionDir)\gnu-efi\lib
163 | _UNICODE;UNICODE;HAVE_USE_MS_ABI;GNU_EFI_USE_EXTERNAL_STDARG;%(PreprocessorDefinitions)
164 | false
165 | CompileAsC
166 | MultiThreadedDebug
167 | ProgramDatabase
168 | 4312
169 | Default
170 | false
171 | /Oi-
172 |
173 |
174 | true
175 |
176 |
177 | EFI Application
178 | true
179 |
180 |
181 |
182 |
183 | Level3
184 | Disabled
185 | $(SolutionDir)gnu-efi\inc;$(SolutionDir)gnu-efi\inc\arm;$(SolutionDir)gnu-efi\inc\protocol;$(SolutionDir)gnu-efi\lib
186 | _UNICODE;UNICODE;HAVE_USE_MS_ABI;GNU_EFI_USE_EXTERNAL_STDARG;%(PreprocessorDefinitions)
187 | false
188 | CompileAsC
189 | MultiThreadedDebug
190 | ProgramDatabase
191 | 4312
192 | Default
193 | false
194 | /Oi-
195 |
196 |
197 | true
198 |
199 |
200 | EFI Application
201 | true
202 |
203 |
204 |
205 |
206 | Level3
207 | Disabled
208 | $(SolutionDir)\gnu-efi\inc;$(SolutionDir)\gnu-efi\inc\aarch64;$(SolutionDir)\gnu-efi\inc\protocol;$(SolutionDir)\gnu-efi\lib
209 | _UNICODE;UNICODE;HAVE_USE_MS_ABI;GNU_EFI_USE_EXTERNAL_STDARG;__SIZE_TYPE__=uint64_t;%(PreprocessorDefinitions)
210 | false
211 | CompileAsC
212 | MultiThreadedDebug
213 | ProgramDatabase
214 | 4312
215 | Default
216 | false
217 | /Oi-
218 |
219 |
220 | true
221 |
222 |
223 | EFI Application
224 | true
225 |
226 |
227 |
228 |
229 | Level3
230 | $(SolutionDir)\gnu-efi\inc;$(SolutionDir)\gnu-efi\inc\x86_64;$(SolutionDir)\gnu-efi\inc\protocol;$(SolutionDir)\gnu-efi\lib
231 | _UNICODE;UNICODE;HAVE_USE_MS_ABI;GNU_EFI_USE_EXTERNAL_STDARG;%(PreprocessorDefinitions)
232 | false
233 | CompileAsC
234 | MultiThreaded
235 | 4312
236 | false
237 | false
238 | /Oi-
239 |
240 |
241 | true
242 | true
243 | true
244 |
245 |
246 | EFI Application
247 | true
248 |
249 |
250 |
251 |
252 | Level3
253 | $(SolutionDir)\gnu-efi\inc;$(SolutionDir)\gnu-efi\inc\ia32;$(SolutionDir)\gnu-efi\inc\protocol;$(SolutionDir)\gnu-efi\lib
254 | _UNICODE;UNICODE;HAVE_USE_MS_ABI;GNU_EFI_USE_EXTERNAL_STDARG;%(PreprocessorDefinitions)
255 | false
256 | CompileAsC
257 | MultiThreaded
258 | 4312
259 | false
260 | false
261 | /Oi-
262 |
263 |
264 | true
265 | true
266 | true
267 |
268 |
269 | EFI Application
270 | true
271 |
272 |
273 |
274 |
275 | Level3
276 | $(SolutionDir)\gnu-efi\inc;$(SolutionDir)\gnu-efi\inc\arm;$(SolutionDir)\gnu-efi\inc\protocol;$(SolutionDir)\gnu-efi\lib
277 | _UNICODE;UNICODE;HAVE_USE_MS_ABI;GNU_EFI_USE_EXTERNAL_STDARG;%(PreprocessorDefinitions)
278 | false
279 | CompileAsC
280 | MultiThreaded
281 | 4312
282 | false
283 | false
284 | /Oi-
285 |
286 |
287 | true
288 | true
289 | true
290 |
291 |
292 | EFI Application
293 | true
294 |
295 |
296 |
297 |
298 | Level3
299 | $(SolutionDir)\gnu-efi\inc;$(SolutionDir)\gnu-efi\inc\aarch64;$(SolutionDir)\gnu-efi\inc\protocol;$(SolutionDir)\gnu-efi\lib
300 | _UNICODE;UNICODE;HAVE_USE_MS_ABI;GNU_EFI_USE_EXTERNAL_STDARG;__SIZE_TYPE__=uint64_t;%(PreprocessorDefinitions)
301 | false
302 | CompileAsC
303 | MultiThreaded
304 | 4312
305 | false
306 | false
307 | /Oi-
308 |
309 |
310 | true
311 | true
312 | true
313 |
314 |
315 | EFI Application
316 | true
317 |
318 |
319 |
320 |
321 | true
322 | true
323 | false
324 | false
325 | true
326 | true
327 | true
328 | true
329 |
330 |
331 | true
332 | true
333 | false
334 | false
335 | true
336 | true
337 | true
338 | true
339 |
340 |
341 | true
342 | true
343 | true
344 | true
345 | false
346 | false
347 | true
348 | true
349 |
350 |
351 | true
352 | true
353 | true
354 | true
355 | false
356 | false
357 | true
358 | true
359 |
360 |
361 |
362 |
363 |
364 |
365 |
366 |
367 |
368 |
369 |
370 |
371 |
372 |
373 |
374 | false
375 | false
376 | true
377 | true
378 | true
379 | true
380 | true
381 | true
382 |
383 |
384 | false
385 | false
386 | true
387 | true
388 | true
389 | true
390 | true
391 | true
392 |
393 |
394 |
395 |
396 |
397 |
398 |
399 |
400 |
401 |
402 |
403 |
404 |
405 |
406 | true
407 | true
408 | true
409 | true
410 | true
411 | true
412 | false
413 | false
414 |
415 |
416 | true
417 | true
418 | true
419 | true
420 | true
421 | true
422 | false
423 | false
424 |
425 |
426 |
427 |
428 |
429 |
430 |
431 |
432 |
--------------------------------------------------------------------------------
/Includes/IndustryStandard/Acpi40.h:
--------------------------------------------------------------------------------
1 | /** @file
2 | ACPI 4.0 definitions from the ACPI Specification Revision 4.0a April 5, 2010
3 |
4 | Copyright (c) 2010 - 2011, Intel Corporation. All rights reserved.
5 | This program and the accompanying materials
6 | are licensed and made available under the terms and conditions of the BSD License
7 | which accompanies this distribution. The full text of the license may be found at
8 | http://opensource.org/licenses/bsd-license.php
9 |
10 | THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
11 | WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
12 | **/
13 |
14 | #ifndef _ACPI_4_0_H_
15 | #define _ACPI_4_0_H_
16 |
17 | #include
18 |
19 | //
20 | // Ensure proper structure formats
21 | //
22 | #pragma pack(1)
23 |
24 | ///
25 | /// ACPI 4.0 Generic Address Space definition
26 | ///
27 | typedef struct {
28 | UINT8 AddressSpaceId;
29 | UINT8 RegisterBitWidth;
30 | UINT8 RegisterBitOffset;
31 | UINT8 AccessSize;
32 | UINT64 Address;
33 | } EFI_ACPI_4_0_GENERIC_ADDRESS_STRUCTURE;
34 |
35 | //
36 | // Generic Address Space Address IDs
37 | //
38 | #define EFI_ACPI_4_0_SYSTEM_MEMORY 0
39 | #define EFI_ACPI_4_0_SYSTEM_IO 1
40 | #define EFI_ACPI_4_0_PCI_CONFIGURATION_SPACE 2
41 | #define EFI_ACPI_4_0_EMBEDDED_CONTROLLER 3
42 | #define EFI_ACPI_4_0_SMBUS 4
43 | #define EFI_ACPI_4_0_FUNCTIONAL_FIXED_HARDWARE 0x7F
44 |
45 | //
46 | // Generic Address Space Access Sizes
47 | //
48 | #define EFI_ACPI_4_0_UNDEFINED 0
49 | #define EFI_ACPI_4_0_BYTE 1
50 | #define EFI_ACPI_4_0_WORD 2
51 | #define EFI_ACPI_4_0_DWORD 3
52 | #define EFI_ACPI_4_0_QWORD 4
53 |
54 | //
55 | // ACPI 4.0 table structures
56 | //
57 |
58 | ///
59 | /// Root System Description Pointer Structure
60 | ///
61 | typedef struct {
62 | UINT64 Signature;
63 | UINT8 Checksum;
64 | UINT8 OemId[6];
65 | UINT8 Revision;
66 | UINT32 RsdtAddress;
67 | UINT32 Length;
68 | UINT64 XsdtAddress;
69 | UINT8 ExtendedChecksum;
70 | UINT8 Reserved[3];
71 | } EFI_ACPI_4_0_ROOT_SYSTEM_DESCRIPTION_POINTER;
72 |
73 | ///
74 | /// RSD_PTR Revision (as defined in ACPI 4.0b spec.)
75 | ///
76 | #define EFI_ACPI_4_0_ROOT_SYSTEM_DESCRIPTION_POINTER_REVISION 0x02 ///< ACPISpec (Revision 4.0a) says current value is 2
77 |
78 | ///
79 | /// Common table header, this prefaces all ACPI tables, including FACS, but
80 | /// excluding the RSD PTR structure
81 | ///
82 | typedef struct {
83 | UINT32 Signature;
84 | UINT32 Length;
85 | } EFI_ACPI_4_0_COMMON_HEADER;
86 |
87 | //
88 | // Root System Description Table
89 | // No definition needed as it is a common description table header, the same with
90 | // EFI_ACPI_DESCRIPTION_HEADER, followed by a variable number of UINT32 table pointers.
91 | //
92 |
93 | ///
94 | /// RSDT Revision (as defined in ACPI 4.0 spec.)
95 | ///
96 | #define EFI_ACPI_4_0_ROOT_SYSTEM_DESCRIPTION_TABLE_REVISION 0x01
97 |
98 | //
99 | // Extended System Description Table
100 | // No definition needed as it is a common description table header, the same with
101 | // EFI_ACPI_DESCRIPTION_HEADER, followed by a variable number of UINT64 table pointers.
102 | //
103 |
104 | ///
105 | /// XSDT Revision (as defined in ACPI 4.0 spec.)
106 | ///
107 | #define EFI_ACPI_4_0_EXTENDED_SYSTEM_DESCRIPTION_TABLE_REVISION 0x01
108 |
109 | ///
110 | /// Fixed ACPI Description Table Structure (FADT)
111 | ///
112 | typedef struct {
113 | EFI_ACPI_DESCRIPTION_HEADER Header;
114 | UINT32 FirmwareCtrl;
115 | UINT32 Dsdt;
116 | UINT8 Reserved0;
117 | UINT8 PreferredPmProfile;
118 | UINT16 SciInt;
119 | UINT32 SmiCmd;
120 | UINT8 AcpiEnable;
121 | UINT8 AcpiDisable;
122 | UINT8 S4BiosReq;
123 | UINT8 PstateCnt;
124 | UINT32 Pm1aEvtBlk;
125 | UINT32 Pm1bEvtBlk;
126 | UINT32 Pm1aCntBlk;
127 | UINT32 Pm1bCntBlk;
128 | UINT32 Pm2CntBlk;
129 | UINT32 PmTmrBlk;
130 | UINT32 Gpe0Blk;
131 | UINT32 Gpe1Blk;
132 | UINT8 Pm1EvtLen;
133 | UINT8 Pm1CntLen;
134 | UINT8 Pm2CntLen;
135 | UINT8 PmTmrLen;
136 | UINT8 Gpe0BlkLen;
137 | UINT8 Gpe1BlkLen;
138 | UINT8 Gpe1Base;
139 | UINT8 CstCnt;
140 | UINT16 PLvl2Lat;
141 | UINT16 PLvl3Lat;
142 | UINT16 FlushSize;
143 | UINT16 FlushStride;
144 | UINT8 DutyOffset;
145 | UINT8 DutyWidth;
146 | UINT8 DayAlrm;
147 | UINT8 MonAlrm;
148 | UINT8 Century;
149 | UINT16 IaPcBootArch;
150 | UINT8 Reserved1;
151 | UINT32 Flags;
152 | EFI_ACPI_4_0_GENERIC_ADDRESS_STRUCTURE ResetReg;
153 | UINT8 ResetValue;
154 | UINT8 Reserved2[3];
155 | UINT64 XFirmwareCtrl;
156 | UINT64 XDsdt;
157 | EFI_ACPI_4_0_GENERIC_ADDRESS_STRUCTURE XPm1aEvtBlk;
158 | EFI_ACPI_4_0_GENERIC_ADDRESS_STRUCTURE XPm1bEvtBlk;
159 | EFI_ACPI_4_0_GENERIC_ADDRESS_STRUCTURE XPm1aCntBlk;
160 | EFI_ACPI_4_0_GENERIC_ADDRESS_STRUCTURE XPm1bCntBlk;
161 | EFI_ACPI_4_0_GENERIC_ADDRESS_STRUCTURE XPm2CntBlk;
162 | EFI_ACPI_4_0_GENERIC_ADDRESS_STRUCTURE XPmTmrBlk;
163 | EFI_ACPI_4_0_GENERIC_ADDRESS_STRUCTURE XGpe0Blk;
164 | EFI_ACPI_4_0_GENERIC_ADDRESS_STRUCTURE XGpe1Blk;
165 | } EFI_ACPI_4_0_FIXED_ACPI_DESCRIPTION_TABLE;
166 |
167 | ///
168 | /// FADT Version (as defined in ACPI 4.0 spec.)
169 | ///
170 | #define EFI_ACPI_4_0_FIXED_ACPI_DESCRIPTION_TABLE_REVISION 0x04
171 |
172 | //
173 | // Fixed ACPI Description Table Preferred Power Management Profile
174 | //
175 | #define EFI_ACPI_4_0_PM_PROFILE_UNSPECIFIED 0
176 | #define EFI_ACPI_4_0_PM_PROFILE_DESKTOP 1
177 | #define EFI_ACPI_4_0_PM_PROFILE_MOBILE 2
178 | #define EFI_ACPI_4_0_PM_PROFILE_WORKSTATION 3
179 | #define EFI_ACPI_4_0_PM_PROFILE_ENTERPRISE_SERVER 4
180 | #define EFI_ACPI_4_0_PM_PROFILE_SOHO_SERVER 5
181 | #define EFI_ACPI_4_0_PM_PROFILE_APPLIANCE_PC 6
182 | #define EFI_ACPI_4_0_PM_PROFILE_PERFORMANCE_SERVER 7
183 |
184 | //
185 | // Fixed ACPI Description Table Boot Architecture Flags
186 | // All other bits are reserved and must be set to 0.
187 | //
188 | #define EFI_ACPI_4_0_LEGACY_DEVICES BIT0
189 | #define EFI_ACPI_4_0_8042 BIT1
190 | #define EFI_ACPI_4_0_VGA_NOT_PRESENT BIT2
191 | #define EFI_ACPI_4_0_MSI_NOT_SUPPORTED BIT3
192 | #define EFI_ACPI_4_0_PCIE_ASPM_CONTROLS BIT4
193 |
194 | //
195 | // Fixed ACPI Description Table Fixed Feature Flags
196 | // All other bits are reserved and must be set to 0.
197 | //
198 | #define EFI_ACPI_4_0_WBINVD BIT0
199 | #define EFI_ACPI_4_0_WBINVD_FLUSH BIT1
200 | #define EFI_ACPI_4_0_PROC_C1 BIT2
201 | #define EFI_ACPI_4_0_P_LVL2_UP BIT3
202 | #define EFI_ACPI_4_0_PWR_BUTTON BIT4
203 | #define EFI_ACPI_4_0_SLP_BUTTON BIT5
204 | #define EFI_ACPI_4_0_FIX_RTC BIT6
205 | #define EFI_ACPI_4_0_RTC_S4 BIT7
206 | #define EFI_ACPI_4_0_TMR_VAL_EXT BIT8
207 | #define EFI_ACPI_4_0_DCK_CAP BIT9
208 | #define EFI_ACPI_4_0_RESET_REG_SUP BIT10
209 | #define EFI_ACPI_4_0_SEALED_CASE BIT11
210 | #define EFI_ACPI_4_0_HEADLESS BIT12
211 | #define EFI_ACPI_4_0_CPU_SW_SLP BIT13
212 | #define EFI_ACPI_4_0_PCI_EXP_WAK BIT14
213 | #define EFI_ACPI_4_0_USE_PLATFORM_CLOCK BIT15
214 | #define EFI_ACPI_4_0_S4_RTC_STS_VALID BIT16
215 | #define EFI_ACPI_4_0_REMOTE_POWER_ON_CAPABLE BIT17
216 | #define EFI_ACPI_4_0_FORCE_APIC_CLUSTER_MODEL BIT18
217 | #define EFI_ACPI_4_0_FORCE_APIC_PHYSICAL_DESTINATION_MODE BIT19
218 |
219 | ///
220 | /// Firmware ACPI Control Structure
221 | ///
222 | typedef struct {
223 | UINT32 Signature;
224 | UINT32 Length;
225 | UINT32 HardwareSignature;
226 | UINT32 FirmwareWakingVector;
227 | UINT32 GlobalLock;
228 | UINT32 Flags;
229 | UINT64 XFirmwareWakingVector;
230 | UINT8 Version;
231 | UINT8 Reserved0[3];
232 | UINT32 OspmFlags;
233 | UINT8 Reserved1[24];
234 | } EFI_ACPI_4_0_FIRMWARE_ACPI_CONTROL_STRUCTURE;
235 |
236 | ///
237 | /// FACS Version (as defined in ACPI 4.0 spec.)
238 | ///
239 | #define EFI_ACPI_4_0_FIRMWARE_ACPI_CONTROL_STRUCTURE_VERSION 0x02
240 |
241 | ///
242 | /// Firmware Control Structure Feature Flags
243 | /// All other bits are reserved and must be set to 0.
244 | ///
245 | #define EFI_ACPI_4_0_S4BIOS_F BIT0
246 | #define EFI_ACPI_4_0_64BIT_WAKE_SUPPORTED_F BIT1
247 |
248 | ///
249 | /// OSPM Enabled Firmware Control Structure Flags
250 | /// All other bits are reserved and must be set to 0.
251 | ///
252 | #define EFI_ACPI_4_0_OSPM_64BIT_WAKE__F BIT0
253 |
254 | //
255 | // Differentiated System Description Table,
256 | // Secondary System Description Table
257 | // and Persistent System Description Table,
258 | // no definition needed as they are common description table header, the same with
259 | // EFI_ACPI_DESCRIPTION_HEADER, followed by a definition block.
260 | //
261 | #define EFI_ACPI_4_0_DIFFERENTIATED_SYSTEM_DESCRIPTION_TABLE_REVISION 0x02
262 | #define EFI_ACPI_4_0_SECONDARY_SYSTEM_DESCRIPTION_TABLE_REVISION 0x02
263 |
264 | ///
265 | /// Multiple APIC Description Table header definition. The rest of the table
266 | /// must be defined in a platform specific manner.
267 | ///
268 | typedef struct {
269 | EFI_ACPI_DESCRIPTION_HEADER Header;
270 | UINT32 LocalApicAddress;
271 | UINT32 Flags;
272 | } EFI_ACPI_4_0_MULTIPLE_APIC_DESCRIPTION_TABLE_HEADER;
273 |
274 | ///
275 | /// MADT Revision (as defined in ACPI 4.0 spec.)
276 | ///
277 | #define EFI_ACPI_4_0_MULTIPLE_APIC_DESCRIPTION_TABLE_REVISION 0x03
278 |
279 | ///
280 | /// Multiple APIC Flags
281 | /// All other bits are reserved and must be set to 0.
282 | ///
283 | #define EFI_ACPI_4_0_PCAT_COMPAT BIT0
284 |
285 | //
286 | // Multiple APIC Description Table APIC structure types
287 | // All other values between 0x0B an 0xFF are reserved and
288 | // will be ignored by OSPM.
289 | //
290 | #define EFI_ACPI_4_0_PROCESSOR_LOCAL_APIC 0x00
291 | #define EFI_ACPI_4_0_IO_APIC 0x01
292 | #define EFI_ACPI_4_0_INTERRUPT_SOURCE_OVERRIDE 0x02
293 | #define EFI_ACPI_4_0_NON_MASKABLE_INTERRUPT_SOURCE 0x03
294 | #define EFI_ACPI_4_0_LOCAL_APIC_NMI 0x04
295 | #define EFI_ACPI_4_0_LOCAL_APIC_ADDRESS_OVERRIDE 0x05
296 | #define EFI_ACPI_4_0_IO_SAPIC 0x06
297 | #define EFI_ACPI_4_0_LOCAL_SAPIC 0x07
298 | #define EFI_ACPI_4_0_PLATFORM_INTERRUPT_SOURCES 0x08
299 | #define EFI_ACPI_4_0_PROCESSOR_LOCAL_X2APIC 0x09
300 | #define EFI_ACPI_4_0_LOCAL_X2APIC_NMI 0x0A
301 |
302 | //
303 | // APIC Structure Definitions
304 | //
305 |
306 | ///
307 | /// Processor Local APIC Structure Definition
308 | ///
309 | typedef struct {
310 | UINT8 Type;
311 | UINT8 Length;
312 | UINT8 AcpiProcessorId;
313 | UINT8 ApicId;
314 | UINT32 Flags;
315 | } EFI_ACPI_4_0_PROCESSOR_LOCAL_APIC_STRUCTURE;
316 |
317 | ///
318 | /// Local APIC Flags. All other bits are reserved and must be 0.
319 | ///
320 | #define EFI_ACPI_4_0_LOCAL_APIC_ENABLED BIT0
321 |
322 | ///
323 | /// IO APIC Structure
324 | ///
325 | typedef struct {
326 | UINT8 Type;
327 | UINT8 Length;
328 | UINT8 IoApicId;
329 | UINT8 Reserved;
330 | UINT32 IoApicAddress;
331 | UINT32 GlobalSystemInterruptBase;
332 | } EFI_ACPI_4_0_IO_APIC_STRUCTURE;
333 |
334 | ///
335 | /// Interrupt Source Override Structure
336 | ///
337 | typedef struct {
338 | UINT8 Type;
339 | UINT8 Length;
340 | UINT8 Bus;
341 | UINT8 Source;
342 | UINT32 GlobalSystemInterrupt;
343 | UINT16 Flags;
344 | } EFI_ACPI_4_0_INTERRUPT_SOURCE_OVERRIDE_STRUCTURE;
345 |
346 | ///
347 | /// Platform Interrupt Sources Structure Definition
348 | ///
349 | typedef struct {
350 | UINT8 Type;
351 | UINT8 Length;
352 | UINT16 Flags;
353 | UINT8 InterruptType;
354 | UINT8 ProcessorId;
355 | UINT8 ProcessorEid;
356 | UINT8 IoSapicVector;
357 | UINT32 GlobalSystemInterrupt;
358 | UINT32 PlatformInterruptSourceFlags;
359 | UINT8 CpeiProcessorOverride;
360 | UINT8 Reserved[31];
361 | } EFI_ACPI_4_0_PLATFORM_INTERRUPT_APIC_STRUCTURE;
362 |
363 | //
364 | // MPS INTI flags.
365 | // All other bits are reserved and must be set to 0.
366 | //
367 | #define EFI_ACPI_4_0_POLARITY (3 << 0)
368 | #define EFI_ACPI_4_0_TRIGGER_MODE (3 << 2)
369 |
370 | ///
371 | /// Non-Maskable Interrupt Source Structure
372 | ///
373 | typedef struct {
374 | UINT8 Type;
375 | UINT8 Length;
376 | UINT16 Flags;
377 | UINT32 GlobalSystemInterrupt;
378 | } EFI_ACPI_4_0_NON_MASKABLE_INTERRUPT_SOURCE_STRUCTURE;
379 |
380 | ///
381 | /// Local APIC NMI Structure
382 | ///
383 | typedef struct {
384 | UINT8 Type;
385 | UINT8 Length;
386 | UINT8 AcpiProcessorId;
387 | UINT16 Flags;
388 | UINT8 LocalApicLint;
389 | } EFI_ACPI_4_0_LOCAL_APIC_NMI_STRUCTURE;
390 |
391 | ///
392 | /// Local APIC Address Override Structure
393 | ///
394 | typedef struct {
395 | UINT8 Type;
396 | UINT8 Length;
397 | UINT16 Reserved;
398 | UINT64 LocalApicAddress;
399 | } EFI_ACPI_4_0_LOCAL_APIC_ADDRESS_OVERRIDE_STRUCTURE;
400 |
401 | ///
402 | /// IO SAPIC Structure
403 | ///
404 | typedef struct {
405 | UINT8 Type;
406 | UINT8 Length;
407 | UINT8 IoApicId;
408 | UINT8 Reserved;
409 | UINT32 GlobalSystemInterruptBase;
410 | UINT64 IoSapicAddress;
411 | } EFI_ACPI_4_0_IO_SAPIC_STRUCTURE;
412 |
413 | ///
414 | /// Local SAPIC Structure
415 | /// This struct followed by a null-terminated ASCII string - ACPI Processor UID String
416 | ///
417 | typedef struct {
418 | UINT8 Type;
419 | UINT8 Length;
420 | UINT8 AcpiProcessorId;
421 | UINT8 LocalSapicId;
422 | UINT8 LocalSapicEid;
423 | UINT8 Reserved[3];
424 | UINT32 Flags;
425 | UINT32 ACPIProcessorUIDValue;
426 | } EFI_ACPI_4_0_PROCESSOR_LOCAL_SAPIC_STRUCTURE;
427 |
428 | ///
429 | /// Platform Interrupt Sources Structure
430 | ///
431 | typedef struct {
432 | UINT8 Type;
433 | UINT8 Length;
434 | UINT16 Flags;
435 | UINT8 InterruptType;
436 | UINT8 ProcessorId;
437 | UINT8 ProcessorEid;
438 | UINT8 IoSapicVector;
439 | UINT32 GlobalSystemInterrupt;
440 | UINT32 PlatformInterruptSourceFlags;
441 | } EFI_ACPI_4_0_PLATFORM_INTERRUPT_SOURCES_STRUCTURE;
442 |
443 | ///
444 | /// Platform Interrupt Source Flags.
445 | /// All other bits are reserved and must be set to 0.
446 | ///
447 | #define EFI_ACPI_4_0_CPEI_PROCESSOR_OVERRIDE BIT0
448 |
449 | ///
450 | /// Processor Local x2APIC Structure Definition
451 | ///
452 | typedef struct {
453 | UINT8 Type;
454 | UINT8 Length;
455 | UINT8 Reserved[2];
456 | UINT32 X2ApicId;
457 | UINT32 Flags;
458 | UINT32 AcpiProcessorUid;
459 | } EFI_ACPI_4_0_PROCESSOR_LOCAL_X2APIC_STRUCTURE;
460 |
461 | ///
462 | /// Local x2APIC NMI Structure
463 | ///
464 | typedef struct {
465 | UINT8 Type;
466 | UINT8 Length;
467 | UINT16 Flags;
468 | UINT32 AcpiProcessorUid;
469 | UINT8 LocalX2ApicLint;
470 | UINT8 Reserved[3];
471 | } EFI_ACPI_4_0_LOCAL_X2APIC_NMI_STRUCTURE;
472 |
473 | ///
474 | /// Smart Battery Description Table (SBST)
475 | ///
476 | typedef struct {
477 | EFI_ACPI_DESCRIPTION_HEADER Header;
478 | UINT32 WarningEnergyLevel;
479 | UINT32 LowEnergyLevel;
480 | UINT32 CriticalEnergyLevel;
481 | } EFI_ACPI_4_0_SMART_BATTERY_DESCRIPTION_TABLE;
482 |
483 | ///
484 | /// SBST Version (as defined in ACPI 4.0 spec.)
485 | ///
486 | #define EFI_ACPI_4_0_SMART_BATTERY_DESCRIPTION_TABLE_REVISION 0x01
487 |
488 | ///
489 | /// Embedded Controller Boot Resources Table (ECDT)
490 | /// The table is followed by a null terminated ASCII string that contains
491 | /// a fully qualified reference to the name space object.
492 | ///
493 | typedef struct {
494 | EFI_ACPI_DESCRIPTION_HEADER Header;
495 | EFI_ACPI_4_0_GENERIC_ADDRESS_STRUCTURE EcControl;
496 | EFI_ACPI_4_0_GENERIC_ADDRESS_STRUCTURE EcData;
497 | UINT32 Uid;
498 | UINT8 GpeBit;
499 | } EFI_ACPI_4_0_EMBEDDED_CONTROLLER_BOOT_RESOURCES_TABLE;
500 |
501 | ///
502 | /// ECDT Version (as defined in ACPI 4.0 spec.)
503 | ///
504 | #define EFI_ACPI_4_0_EMBEDDED_CONTROLLER_BOOT_RESOURCES_TABLE_REVISION 0x01
505 |
506 | ///
507 | /// System Resource Affinity Table (SRAT. The rest of the table
508 | /// must be defined in a platform specific manner.
509 | ///
510 | typedef struct {
511 | EFI_ACPI_DESCRIPTION_HEADER Header;
512 | UINT32 Reserved1; ///< Must be set to 1
513 | UINT64 Reserved2;
514 | } EFI_ACPI_4_0_SYSTEM_RESOURCE_AFFINITY_TABLE_HEADER;
515 |
516 | ///
517 | /// SRAT Version (as defined in ACPI 4.0 spec.)
518 | ///
519 | #define EFI_ACPI_4_0_SYSTEM_RESOURCE_AFFINITY_TABLE_REVISION 0x03
520 |
521 | //
522 | // SRAT structure types.
523 | // All other values between 0x03 an 0xFF are reserved and
524 | // will be ignored by OSPM.
525 | //
526 | #define EFI_ACPI_4_0_PROCESSOR_LOCAL_APIC_SAPIC_AFFINITY 0x00
527 | #define EFI_ACPI_4_0_MEMORY_AFFINITY 0x01
528 | #define EFI_ACPI_4_0_PROCESSOR_LOCAL_X2APIC_AFFINITY 0x02
529 |
530 | ///
531 | /// Processor Local APIC/SAPIC Affinity Structure Definition
532 | ///
533 | typedef struct {
534 | UINT8 Type;
535 | UINT8 Length;
536 | UINT8 ProximityDomain7To0;
537 | UINT8 ApicId;
538 | UINT32 Flags;
539 | UINT8 LocalSapicEid;
540 | UINT8 ProximityDomain31To8[3];
541 | UINT32 ClockDomain;
542 | } EFI_ACPI_4_0_PROCESSOR_LOCAL_APIC_SAPIC_AFFINITY_STRUCTURE;
543 |
544 | ///
545 | /// Local APIC/SAPIC Flags. All other bits are reserved and must be 0.
546 | ///
547 | #define EFI_ACPI_4_0_PROCESSOR_LOCAL_APIC_SAPIC_ENABLED (1 << 0)
548 |
549 | ///
550 | /// Memory Affinity Structure Definition
551 | ///
552 | typedef struct {
553 | UINT8 Type;
554 | UINT8 Length;
555 | UINT32 ProximityDomain;
556 | UINT16 Reserved1;
557 | UINT32 AddressBaseLow;
558 | UINT32 AddressBaseHigh;
559 | UINT32 LengthLow;
560 | UINT32 LengthHigh;
561 | UINT32 Reserved2;
562 | UINT32 Flags;
563 | UINT64 Reserved3;
564 | } EFI_ACPI_4_0_MEMORY_AFFINITY_STRUCTURE;
565 |
566 | //
567 | // Memory Flags. All other bits are reserved and must be 0.
568 | //
569 | #define EFI_ACPI_4_0_MEMORY_ENABLED (1 << 0)
570 | #define EFI_ACPI_4_0_MEMORY_HOT_PLUGGABLE (1 << 1)
571 | #define EFI_ACPI_4_0_MEMORY_NONVOLATILE (1 << 2)
572 |
573 | ///
574 | /// Processor Local x2APIC Affinity Structure Definition
575 | ///
576 | typedef struct {
577 | UINT8 Type;
578 | UINT8 Length;
579 | UINT8 Reserved1[2];
580 | UINT32 ProximityDomain;
581 | UINT32 X2ApicId;
582 | UINT32 Flags;
583 | UINT32 ClockDomain;
584 | UINT8 Reserved2[4];
585 | } EFI_ACPI_4_0_PROCESSOR_LOCAL_X2APIC_AFFINITY_STRUCTURE;
586 |
587 | ///
588 | /// System Locality Distance Information Table (SLIT).
589 | /// The rest of the table is a matrix.
590 | ///
591 | typedef struct {
592 | EFI_ACPI_DESCRIPTION_HEADER Header;
593 | UINT64 NumberOfSystemLocalities;
594 | } EFI_ACPI_4_0_SYSTEM_LOCALITY_DISTANCE_INFORMATION_TABLE_HEADER;
595 |
596 | ///
597 | /// SLIT Version (as defined in ACPI 4.0 spec.)
598 | ///
599 | #define EFI_ACPI_4_0_SYSTEM_LOCALITY_DISTANCE_INFORMATION_TABLE_REVISION 0x01
600 |
601 | ///
602 | /// Corrected Platform Error Polling Table (CPEP)
603 | ///
604 | typedef struct {
605 | EFI_ACPI_DESCRIPTION_HEADER Header;
606 | UINT8 Reserved[8];
607 | } EFI_ACPI_4_0_CORRECTED_PLATFORM_ERROR_POLLING_TABLE_HEADER;
608 |
609 | ///
610 | /// CPEP Version (as defined in ACPI 4.0 spec.)
611 | ///
612 | #define EFI_ACPI_4_0_CORRECTED_PLATFORM_ERROR_POLLING_TABLE_REVISION 0x01
613 |
614 | //
615 | // CPEP processor structure types.
616 | //
617 | #define EFI_ACPI_4_0_CPEP_PROCESSOR_APIC_SAPIC 0x00
618 |
619 | ///
620 | /// Corrected Platform Error Polling Processor Structure Definition
621 | ///
622 | typedef struct {
623 | UINT8 Type;
624 | UINT8 Length;
625 | UINT8 ProcessorId;
626 | UINT8 ProcessorEid;
627 | UINT32 PollingInterval;
628 | } EFI_ACPI_4_0_CPEP_PROCESSOR_APIC_SAPIC_STRUCTURE;
629 |
630 | ///
631 | /// Maximum System Characteristics Table (MSCT)
632 | ///
633 | typedef struct {
634 | EFI_ACPI_DESCRIPTION_HEADER Header;
635 | UINT32 OffsetProxDomInfo;
636 | UINT32 MaximumNumberOfProximityDomains;
637 | UINT32 MaximumNumberOfClockDomains;
638 | UINT64 MaximumPhysicalAddress;
639 | } EFI_ACPI_4_0_MAXIMUM_SYSTEM_CHARACTERISTICS_TABLE_HEADER;
640 |
641 | ///
642 | /// MSCT Version (as defined in ACPI 4.0 spec.)
643 | ///
644 | #define EFI_ACPI_4_0_MAXIMUM_SYSTEM_CHARACTERISTICS_TABLE_REVISION 0x01
645 |
646 | ///
647 | /// Maximum Proximity Domain Information Structure Definition
648 | ///
649 | typedef struct {
650 | UINT8 Revision;
651 | UINT8 Length;
652 | UINT32 ProximityDomainRangeLow;
653 | UINT32 ProximityDomainRangeHigh;
654 | UINT32 MaximumProcessorCapacity;
655 | UINT64 MaximumMemoryCapacity;
656 | } EFI_ACPI_4_0_MAXIMUM_PROXIMITY_DOMAIN_INFORMATION_STRUCTURE;
657 |
658 | ///
659 | /// Boot Error Record Table (BERT)
660 | ///
661 | typedef struct {
662 | EFI_ACPI_DESCRIPTION_HEADER Header;
663 | UINT32 BootErrorRegionLength;
664 | UINT64 BootErrorRegion;
665 | } EFI_ACPI_4_0_BOOT_ERROR_RECORD_TABLE_HEADER;
666 |
667 | ///
668 | /// BERT Version (as defined in ACPI 4.0 spec.)
669 | ///
670 | #define EFI_ACPI_4_0_BOOT_ERROR_RECORD_TABLE_REVISION 0x01
671 |
672 | ///
673 | /// Boot Error Region Block Status Definition
674 | ///
675 | typedef struct {
676 | UINT32 UncorrectableErrorValid:1;
677 | UINT32 CorrectableErrorValid:1;
678 | UINT32 MultipleUncorrectableErrors:1;
679 | UINT32 MultipleCorrectableErrors:1;
680 | UINT32 ErrorDataEntryCount:10;
681 | UINT32 Reserved:18;
682 | } EFI_ACPI_4_0_ERROR_BLOCK_STATUS;
683 |
684 | ///
685 | /// Boot Error Region Definition
686 | ///
687 | typedef struct {
688 | EFI_ACPI_4_0_ERROR_BLOCK_STATUS BlockStatus;
689 | UINT32 RawDataOffset;
690 | UINT32 RawDataLength;
691 | UINT32 DataLength;
692 | UINT32 ErrorSeverity;
693 | } EFI_ACPI_4_0_BOOT_ERROR_REGION_STRUCTURE;
694 |
695 | //
696 | // Boot Error Severity types
697 | //
698 | #define EFI_ACPI_4_0_ERROR_SEVERITY_CORRECTABLE 0x00
699 | #define EFI_ACPI_4_0_ERROR_SEVERITY_FATAL 0x01
700 | #define EFI_ACPI_4_0_ERROR_SEVERITY_CORRECTED 0x02
701 | #define EFI_ACPI_4_0_ERROR_SEVERITY_NONE 0x03
702 |
703 | ///
704 | /// Generic Error Data Entry Definition
705 | ///
706 | typedef struct {
707 | UINT8 SectionType[16];
708 | UINT32 ErrorSeverity;
709 | UINT16 Revision;
710 | UINT8 ValidationBits;
711 | UINT8 Flags;
712 | UINT32 ErrorDataLength;
713 | UINT8 FruId[16];
714 | UINT8 FruText[20];
715 | } EFI_ACPI_4_0_GENERIC_ERROR_DATA_ENTRY_STRUCTURE;
716 |
717 | ///
718 | /// Generic Error Data Entry Version (as defined in ACPI 4.0 spec.)
719 | ///
720 | #define EFI_ACPI_4_0_GENERIC_ERROR_DATA_ENTRY_REVISION 0x0201
721 |
722 | ///
723 | /// HEST - Hardware Error Source Table
724 | ///
725 | typedef struct {
726 | EFI_ACPI_DESCRIPTION_HEADER Header;
727 | UINT32 ErrorSourceCount;
728 | } EFI_ACPI_4_0_HARDWARE_ERROR_SOURCE_TABLE_HEADER;
729 |
730 | ///
731 | /// HEST Version (as defined in ACPI 4.0 spec.)
732 | ///
733 | #define EFI_ACPI_4_0_HARDWARE_ERROR_SOURCE_TABLE_REVISION 0x01
734 |
735 | //
736 | // Error Source structure types.
737 | //
738 | #define EFI_ACPI_4_0_IA32_ARCHITECTURE_MACHINE_CHECK_EXCEPTION 0x00
739 | #define EFI_ACPI_4_0_IA32_ARCHITECTURE_CORRECTED_MACHINE_CHECK 0x01
740 | #define EFI_ACPI_4_0_IA32_ARCHITECTURE_NMI_ERROR 0x02
741 | #define EFI_ACPI_4_0_PCI_EXPRESS_ROOT_PORT_AER 0x06
742 | #define EFI_ACPI_4_0_PCI_EXPRESS_DEVICE_AER 0x07
743 | #define EFI_ACPI_4_0_PCI_EXPRESS_BRIDGE_AER 0x08
744 | #define EFI_ACPI_4_0_GENERIC_HARDWARE_ERROR 0x09
745 |
746 | //
747 | // Error Source structure flags.
748 | //
749 | #define EFI_ACPI_4_0_ERROR_SOURCE_FLAG_FIRMWARE_FIRST (1 << 0)
750 | #define EFI_ACPI_4_0_ERROR_SOURCE_FLAG_GLOBAL (1 << 1)
751 |
752 | ///
753 | /// IA-32 Architecture Machine Check Exception Structure Definition
754 | ///
755 | typedef struct {
756 | UINT16 Type;
757 | UINT16 SourceId;
758 | UINT8 Reserved0[2];
759 | UINT8 Flags;
760 | UINT8 Enabled;
761 | UINT32 NumberOfRecordsToPreAllocate;
762 | UINT32 MaxSectionsPerRecord;
763 | UINT64 GlobalCapabilityInitData;
764 | UINT64 GlobalControlInitData;
765 | UINT8 NumberOfHardwareBanks;
766 | UINT8 Reserved1[7];
767 | } EFI_ACPI_4_0_IA32_ARCHITECTURE_MACHINE_CHECK_EXCEPTION_STRUCTURE;
768 |
769 | ///
770 | /// IA-32 Architecture Machine Check Bank Structure Definition
771 | ///
772 | typedef struct {
773 | UINT8 BankNumber;
774 | UINT8 ClearStatusOnInitialization;
775 | UINT8 StatusDataFormat;
776 | UINT8 Reserved0;
777 | UINT32 ControlRegisterMsrAddress;
778 | UINT64 ControlInitData;
779 | UINT32 StatusRegisterMsrAddress;
780 | UINT32 AddressRegisterMsrAddress;
781 | UINT32 MiscRegisterMsrAddress;
782 | } EFI_ACPI_4_0_IA32_ARCHITECTURE_MACHINE_CHECK_ERROR_BANK_STRUCTURE;
783 |
784 | ///
785 | /// IA-32 Architecture Machine Check Bank Structure MCA data format
786 | ///
787 | #define EFI_ACPI_4_0_IA32_ARCHITECTURE_MACHINE_CHECK_ERROR_DATA_FORMAT_IA32 0x00
788 | #define EFI_ACPI_4_0_IA32_ARCHITECTURE_MACHINE_CHECK_ERROR_DATA_FORMAT_INTEL64 0x01
789 | #define EFI_ACPI_4_0_IA32_ARCHITECTURE_MACHINE_CHECK_ERROR_DATA_FORMAT_AMD64 0x02
790 |
791 | //
792 | // Hardware Error Notification types. All other values are reserved
793 | //
794 | #define EFI_ACPI_4_0_HARDWARE_ERROR_NOTIFICATION_POLLED 0x00
795 | #define EFI_ACPI_4_0_HARDWARE_ERROR_NOTIFICATION_EXTERNAL_INTERRUPT 0x01
796 | #define EFI_ACPI_4_0_HARDWARE_ERROR_NOTIFICATION_LOCAL_INTERRUPT 0x02
797 | #define EFI_ACPI_4_0_HARDWARE_ERROR_NOTIFICATION_SCI 0x03
798 | #define EFI_ACPI_4_0_HARDWARE_ERROR_NOTIFICATION_NMI 0x04
799 |
800 | ///
801 | /// Hardware Error Notification Configuration Write Enable Structure Definition
802 | ///
803 | typedef struct {
804 | UINT16 Type:1;
805 | UINT16 PollInterval:1;
806 | UINT16 SwitchToPollingThresholdValue:1;
807 | UINT16 SwitchToPollingThresholdWindow:1;
808 | UINT16 ErrorThresholdValue:1;
809 | UINT16 ErrorThresholdWindow:1;
810 | UINT16 Reserved:10;
811 | } EFI_ACPI_4_0_HARDWARE_ERROR_NOTIFICATION_CONFIGURATION_WRITE_ENABLE_STRUCTURE;
812 |
813 | ///
814 | /// Hardware Error Notification Structure Definition
815 | ///
816 | typedef struct {
817 | UINT8 Type;
818 | UINT8 Length;
819 | EFI_ACPI_4_0_HARDWARE_ERROR_NOTIFICATION_CONFIGURATION_WRITE_ENABLE_STRUCTURE ConfigurationWriteEnable;
820 | UINT32 PollInterval;
821 | UINT32 Vector;
822 | UINT32 SwitchToPollingThresholdValue;
823 | UINT32 SwitchToPollingThresholdWindow;
824 | UINT32 ErrorThresholdValue;
825 | UINT32 ErrorThresholdWindow;
826 | } EFI_ACPI_4_0_HARDWARE_ERROR_NOTIFICATION_STRUCTURE;
827 |
828 | ///
829 | /// IA-32 Architecture Corrected Machine Check Structure Definition
830 | ///
831 | typedef struct {
832 | UINT16 Type;
833 | UINT16 SourceId;
834 | UINT8 Reserved0[2];
835 | UINT8 Flags;
836 | UINT8 Enabled;
837 | UINT32 NumberOfRecordsToPreAllocate;
838 | UINT32 MaxSectionsPerRecord;
839 | EFI_ACPI_4_0_HARDWARE_ERROR_NOTIFICATION_STRUCTURE NotificationStructure;
840 | UINT8 NumberOfHardwareBanks;
841 | UINT8 Reserved1[3];
842 | } EFI_ACPI_4_0_IA32_ARCHITECTURE_CORRECTED_MACHINE_CHECK_STRUCTURE;
843 |
844 | ///
845 | /// IA-32 Architecture NMI Error Structure Definition
846 | ///
847 | typedef struct {
848 | UINT16 Type;
849 | UINT16 SourceId;
850 | UINT8 Reserved0[2];
851 | UINT32 NumberOfRecordsToPreAllocate;
852 | UINT32 MaxSectionsPerRecord;
853 | UINT32 MaxRawDataLength;
854 | } EFI_ACPI_4_0_IA32_ARCHITECTURE_NMI_ERROR_STRUCTURE;
855 |
856 | ///
857 | /// PCI Express Root Port AER Structure Definition
858 | ///
859 | typedef struct {
860 | UINT16 Type;
861 | UINT16 SourceId;
862 | UINT8 Reserved0[2];
863 | UINT8 Flags;
864 | UINT8 Enabled;
865 | UINT32 NumberOfRecordsToPreAllocate;
866 | UINT32 MaxSectionsPerRecord;
867 | UINT32 Bus;
868 | UINT16 Device;
869 | UINT16 Function;
870 | UINT16 DeviceControl;
871 | UINT8 Reserved1[2];
872 | UINT32 UncorrectableErrorMask;
873 | UINT32 UncorrectableErrorSeverity;
874 | UINT32 CorrectableErrorMask;
875 | UINT32 AdvancedErrorCapabilitiesAndControl;
876 | UINT32 RootErrorCommand;
877 | } EFI_ACPI_4_0_PCI_EXPRESS_ROOT_PORT_AER_STRUCTURE;
878 |
879 | ///
880 | /// PCI Express Device AER Structure Definition
881 | ///
882 | typedef struct {
883 | UINT16 Type;
884 | UINT16 SourceId;
885 | UINT8 Reserved0[2];
886 | UINT8 Flags;
887 | UINT8 Enabled;
888 | UINT32 NumberOfRecordsToPreAllocate;
889 | UINT32 MaxSectionsPerRecord;
890 | UINT32 Bus;
891 | UINT16 Device;
892 | UINT16 Function;
893 | UINT16 DeviceControl;
894 | UINT8 Reserved1[2];
895 | UINT32 UncorrectableErrorMask;
896 | UINT32 UncorrectableErrorSeverity;
897 | UINT32 CorrectableErrorMask;
898 | UINT32 AdvancedErrorCapabilitiesAndControl;
899 | } EFI_ACPI_4_0_PCI_EXPRESS_DEVICE_AER_STRUCTURE;
900 |
901 | ///
902 | /// PCI Express Bridge AER Structure Definition
903 | ///
904 | typedef struct {
905 | UINT16 Type;
906 | UINT16 SourceId;
907 | UINT8 Reserved0[2];
908 | UINT8 Flags;
909 | UINT8 Enabled;
910 | UINT32 NumberOfRecordsToPreAllocate;
911 | UINT32 MaxSectionsPerRecord;
912 | UINT32 Bus;
913 | UINT16 Device;
914 | UINT16 Function;
915 | UINT16 DeviceControl;
916 | UINT8 Reserved1[2];
917 | UINT32 UncorrectableErrorMask;
918 | UINT32 UncorrectableErrorSeverity;
919 | UINT32 CorrectableErrorMask;
920 | UINT32 AdvancedErrorCapabilitiesAndControl;
921 | UINT32 SecondaryUncorrectableErrorMask;
922 | UINT32 SecondaryUncorrectableErrorSeverity;
923 | UINT32 SecondaryAdvancedErrorCapabilitiesAndControl;
924 | } EFI_ACPI_4_0_PCI_EXPRESS_BRIDGE_AER_STRUCTURE;
925 |
926 | ///
927 | /// Generic Hardware Error Source Structure Definition
928 | ///
929 | typedef struct {
930 | UINT16 Type;
931 | UINT16 SourceId;
932 | UINT16 RelatedSourceId;
933 | UINT8 Flags;
934 | UINT8 Enabled;
935 | UINT32 NumberOfRecordsToPreAllocate;
936 | UINT32 MaxSectionsPerRecord;
937 | UINT32 MaxRawDataLength;
938 | EFI_ACPI_4_0_GENERIC_ADDRESS_STRUCTURE ErrorStatusAddress;
939 | EFI_ACPI_4_0_HARDWARE_ERROR_NOTIFICATION_STRUCTURE NotificationStructure;
940 | UINT32 ErrorStatusBlockLength;
941 | } EFI_ACPI_4_0_GENERIC_HARDWARE_ERROR_SOURCE_STRUCTURE;
942 |
943 | ///
944 | /// Generic Error Status Definition
945 | ///
946 | typedef struct {
947 | EFI_ACPI_4_0_ERROR_BLOCK_STATUS BlockStatus;
948 | UINT32 RawDataOffset;
949 | UINT32 RawDataLength;
950 | UINT32 DataLength;
951 | UINT32 ErrorSeverity;
952 | } EFI_ACPI_4_0_GENERIC_ERROR_STATUS_STRUCTURE;
953 |
954 | ///
955 | /// ERST - Error Record Serialization Table
956 | ///
957 | typedef struct {
958 | EFI_ACPI_DESCRIPTION_HEADER Header;
959 | UINT32 SerializationHeaderSize;
960 | UINT8 Reserved0[4];
961 | UINT32 InstructionEntryCount;
962 | } EFI_ACPI_4_0_ERROR_RECORD_SERIALIZATION_TABLE_HEADER;
963 |
964 | ///
965 | /// ERST Version (as defined in ACPI 4.0 spec.)
966 | ///
967 | #define EFI_ACPI_4_0_ERROR_RECORD_SERIALIZATION_TABLE_REVISION 0x01
968 |
969 | ///
970 | /// ERST Serialization Actions
971 | ///
972 | #define EFI_ACPI_4_0_ERST_BEGIN_WRITE_OPERATION 0x00
973 | #define EFI_ACPI_4_0_ERST_BEGIN_READ_OPERATION 0x01
974 | #define EFI_ACPI_4_0_ERST_BEGIN_CLEAR_OPERATION 0x02
975 | #define EFI_ACPI_4_0_ERST_END_OPERATION 0x03
976 | #define EFI_ACPI_4_0_ERST_SET_RECORD_OFFSET 0x04
977 | #define EFI_ACPI_4_0_ERST_EXECUTE_OPERATION 0x05
978 | #define EFI_ACPI_4_0_ERST_CHECK_BUSY_STATUS 0x06
979 | #define EFI_ACPI_4_0_ERST_GET_COMMAND_STATUS 0x07
980 | #define EFI_ACPI_4_0_ERST_GET_RECORD_IDENTIFIER 0x08
981 | #define EFI_ACPI_4_0_ERST_SET_RECORD_IDENTIFIER 0x09
982 | #define EFI_ACPI_4_0_ERST_GET_RECORD_COUNT 0x0A
983 | #define EFI_ACPI_4_0_ERST_BEGIN_DUMMY_WRITE_OPERATION 0x0B
984 | #define EFI_ACPI_4_0_ERST_GET_ERROR_LOG_ADDRESS_RANGE 0x0D
985 | #define EFI_ACPI_4_0_ERST_GET_ERROR_LOG_ADDRESS_RANGE_LENGTH 0x0E
986 | #define EFI_ACPI_4_0_ERST_GET_ERROR_LOG_ADDRESS_RANGE_ATTRIBUTES 0x0F
987 |
988 | ///
989 | /// ERST Action Command Status
990 | ///
991 | #define EFI_ACPI_4_0_EINJ_STATUS_SUCCESS 0x00
992 | #define EFI_ACPI_4_0_EINJ_STATUS_NOT_ENOUGH_SPACE 0x01
993 | #define EFI_ACPI_4_0_EINJ_STATUS_HARDWARE_NOT_AVAILABLE 0x02
994 | #define EFI_ACPI_4_0_EINJ_STATUS_FAILED 0x03
995 | #define EFI_ACPI_4_0_EINJ_STATUS_RECORD_STORE_EMPTY 0x04
996 | #define EFI_ACPI_4_0_EINJ_STATUS_RECORD_NOT_FOUND 0x05
997 |
998 | ///
999 | /// ERST Serialization Instructions
1000 | ///
1001 | #define EFI_ACPI_4_0_ERST_READ_REGISTER 0x00
1002 | #define EFI_ACPI_4_0_ERST_READ_REGISTER_VALUE 0x01
1003 | #define EFI_ACPI_4_0_ERST_WRITE_REGISTER 0x02
1004 | #define EFI_ACPI_4_0_ERST_WRITE_REGISTER_VALUE 0x03
1005 | #define EFI_ACPI_4_0_ERST_NOOP 0x04
1006 | #define EFI_ACPI_4_0_ERST_LOAD_VAR1 0x05
1007 | #define EFI_ACPI_4_0_ERST_LOAD_VAR2 0x06
1008 | #define EFI_ACPI_4_0_ERST_STORE_VAR1 0x07
1009 | #define EFI_ACPI_4_0_ERST_ADD 0x08
1010 | #define EFI_ACPI_4_0_ERST_SUBTRACT 0x09
1011 | #define EFI_ACPI_4_0_ERST_ADD_VALUE 0x0A
1012 | #define EFI_ACPI_4_0_ERST_SUBTRACT_VALUE 0x0B
1013 | #define EFI_ACPI_4_0_ERST_STALL 0x0C
1014 | #define EFI_ACPI_4_0_ERST_STALL_WHILE_TRUE 0x0D
1015 | #define EFI_ACPI_4_0_ERST_SKIP_NEXT_INSTRUCTION_IF_TRUE 0x0E
1016 | #define EFI_ACPI_4_0_ERST_GOTO 0x0F
1017 | #define EFI_ACPI_4_0_ERST_SET_SRC_ADDRESS_BASE 0x10
1018 | #define EFI_ACPI_4_0_ERST_SET_DST_ADDRESS_BASE 0x11
1019 | #define EFI_ACPI_4_0_ERST_MOVE_DATA 0x12
1020 |
1021 | ///
1022 | /// ERST Instruction Flags
1023 | ///
1024 | #define EFI_ACPI_4_0_ERST_PRESERVE_REGISTER 0x01
1025 |
1026 | ///
1027 | /// ERST Serialization Instruction Entry
1028 | ///
1029 | typedef struct {
1030 | UINT8 SerializationAction;
1031 | UINT8 Instruction;
1032 | UINT8 Flags;
1033 | UINT8 Reserved0;
1034 | EFI_ACPI_4_0_GENERIC_ADDRESS_STRUCTURE RegisterRegion;
1035 | UINT64 Value;
1036 | UINT64 Mask;
1037 | } EFI_ACPI_4_0_ERST_SERIALIZATION_INSTRUCTION_ENTRY;
1038 |
1039 | ///
1040 | /// EINJ - Error Injection Table
1041 | ///
1042 | typedef struct {
1043 | EFI_ACPI_DESCRIPTION_HEADER Header;
1044 | UINT32 InjectionHeaderSize;
1045 | UINT8 InjectionFlags;
1046 | UINT8 Reserved0[3];
1047 | UINT32 InjectionEntryCount;
1048 | } EFI_ACPI_4_0_ERROR_INJECTION_TABLE_HEADER;
1049 |
1050 | ///
1051 | /// EINJ Version (as defined in ACPI 4.0 spec.)
1052 | ///
1053 | #define EFI_ACPI_4_0_ERROR_INJECTION_TABLE_REVISION 0x01
1054 |
1055 | ///
1056 | /// EINJ Error Injection Actions
1057 | ///
1058 | #define EFI_ACPI_4_0_EINJ_BEGIN_INJECTION_OPERATION 0x00
1059 | #define EFI_ACPI_4_0_EINJ_GET_TRIGGER_ERROR_ACTION_TABLE 0x01
1060 | #define EFI_ACPI_4_0_EINJ_SET_ERROR_TYPE 0x02
1061 | #define EFI_ACPI_4_0_EINJ_GET_ERROR_TYPE 0x03
1062 | #define EFI_ACPI_4_0_EINJ_END_OPERATION 0x04
1063 | #define EFI_ACPI_4_0_EINJ_EXECUTE_OPERATION 0x05
1064 | #define EFI_ACPI_4_0_EINJ_CHECK_BUSY_STATUS 0x06
1065 | #define EFI_ACPI_4_0_EINJ_GET_COMMAND_STATUS 0x07
1066 | #define EFI_ACPI_4_0_EINJ_TRIGGER_ERROR 0xFF
1067 |
1068 | ///
1069 | /// EINJ Action Command Status
1070 | ///
1071 | #define EFI_ACPI_4_0_EINJ_STATUS_SUCCESS 0x00
1072 | #define EFI_ACPI_4_0_EINJ_STATUS_UNKNOWN_FAILURE 0x01
1073 | #define EFI_ACPI_4_0_EINJ_STATUS_INVALID_ACCESS 0x02
1074 |
1075 | ///
1076 | /// EINJ Error Type Definition
1077 | ///
1078 | #define EFI_ACPI_4_0_EINJ_ERROR_PROCESSOR_CORRECTABLE (1 << 0)
1079 | #define EFI_ACPI_4_0_EINJ_ERROR_PROCESSOR_UNCORRECTABLE_NONFATAL (1 << 1)
1080 | #define EFI_ACPI_4_0_EINJ_ERROR_PROCESSOR_UNCORRECTABLE_FATAL (1 << 2)
1081 | #define EFI_ACPI_4_0_EINJ_ERROR_MEMORY_CORRECTABLE (1 << 3)
1082 | #define EFI_ACPI_4_0_EINJ_ERROR_MEMORY_UNCORRECTABLE_NONFATAL (1 << 4)
1083 | #define EFI_ACPI_4_0_EINJ_ERROR_MEMORY_UNCORRECTABLE_FATAL (1 << 5)
1084 | #define EFI_ACPI_4_0_EINJ_ERROR_PCI_EXPRESS_CORRECTABLE (1 << 6)
1085 | #define EFI_ACPI_4_0_EINJ_ERROR_PCI_EXPRESS_UNCORRECTABLE_NONFATAL (1 << 7)
1086 | #define EFI_ACPI_4_0_EINJ_ERROR_PCI_EXPRESS_UNCORRECTABLE_FATAL (1 << 8)
1087 | #define EFI_ACPI_4_0_EINJ_ERROR_PLATFORM_CORRECTABLE (1 << 9)
1088 | #define EFI_ACPI_4_0_EINJ_ERROR_PLATFORM_UNCORRECTABLE_NONFATAL (1 << 10)
1089 | #define EFI_ACPI_4_0_EINJ_ERROR_PLATFORM_UNCORRECTABLE_FATAL (1 << 11)
1090 |
1091 | ///
1092 | /// EINJ Injection Instructions
1093 | ///
1094 | #define EFI_ACPI_4_0_EINJ_READ_REGISTER 0x00
1095 | #define EFI_ACPI_4_0_EINJ_READ_REGISTER_VALUE 0x01
1096 | #define EFI_ACPI_4_0_EINJ_WRITE_REGISTER 0x02
1097 | #define EFI_ACPI_4_0_EINJ_WRITE_REGISTER_VALUE 0x03
1098 | #define EFI_ACPI_4_0_EINJ_NOOP 0x04
1099 |
1100 | ///
1101 | /// EINJ Instruction Flags
1102 | ///
1103 | #define EFI_ACPI_4_0_EINJ_PRESERVE_REGISTER 0x01
1104 |
1105 | ///
1106 | /// EINJ Injection Instruction Entry
1107 | ///
1108 | typedef struct {
1109 | UINT8 InjectionAction;
1110 | UINT8 Instruction;
1111 | UINT8 Flags;
1112 | UINT8 Reserved0;
1113 | EFI_ACPI_4_0_GENERIC_ADDRESS_STRUCTURE RegisterRegion;
1114 | UINT64 Value;
1115 | UINT64 Mask;
1116 | } EFI_ACPI_4_0_EINJ_INJECTION_INSTRUCTION_ENTRY;
1117 |
1118 | ///
1119 | /// EINJ Trigger Action Table
1120 | ///
1121 | typedef struct {
1122 | UINT32 HeaderSize;
1123 | UINT32 Revision;
1124 | UINT32 TableSize;
1125 | UINT32 EntryCount;
1126 | } EFI_ACPI_4_0_EINJ_TRIGGER_ACTION_TABLE;
1127 |
1128 | //
1129 | // Known table signatures
1130 | //
1131 |
1132 | ///
1133 | /// "RSD PTR " Root System Description Pointer
1134 | ///
1135 | #define EFI_ACPI_4_0_ROOT_SYSTEM_DESCRIPTION_POINTER_SIGNATURE SIGNATURE_64('R', 'S', 'D', ' ', 'P', 'T', 'R', ' ')
1136 |
1137 | ///
1138 | /// "APIC" Multiple APIC Description Table
1139 | ///
1140 | #define EFI_ACPI_4_0_MULTIPLE_APIC_DESCRIPTION_TABLE_SIGNATURE SIGNATURE_32('A', 'P', 'I', 'C')
1141 |
1142 | ///
1143 | /// "BERT" Boot Error Record Table
1144 | ///
1145 | #define EFI_ACPI_4_0_BOOT_ERROR_RECORD_TABLE_SIGNATURE SIGNATURE_32('B', 'E', 'R', 'T')
1146 |
1147 | ///
1148 | /// "CPEP" Corrected Platform Error Polling Table
1149 | ///
1150 | #define EFI_ACPI_4_0_CORRECTED_PLATFORM_ERROR_POLLING_TABLE_SIGNATURE SIGNATURE_32('C', 'P', 'E', 'P')
1151 |
1152 | ///
1153 | /// "DSDT" Differentiated System Description Table
1154 | ///
1155 | #define EFI_ACPI_4_0_DIFFERENTIATED_SYSTEM_DESCRIPTION_TABLE_SIGNATURE SIGNATURE_32('D', 'S', 'D', 'T')
1156 |
1157 | ///
1158 | /// "ECDT" Embedded Controller Boot Resources Table
1159 | ///
1160 | #define EFI_ACPI_4_0_EMBEDDED_CONTROLLER_BOOT_RESOURCES_TABLE_SIGNATURE SIGNATURE_32('E', 'C', 'D', 'T')
1161 |
1162 | ///
1163 | /// "EINJ" Error Injection Table
1164 | ///
1165 | #define EFI_ACPI_4_0_ERROR_INJECTION_TABLE_SIGNATURE SIGNATURE_32('E', 'I', 'N', 'J')
1166 |
1167 | ///
1168 | /// "ERST" Error Record Serialization Table
1169 | ///
1170 | #define EFI_ACPI_4_0_ERROR_RECORD_SERIALIZATION_TABLE_SIGNATURE SIGNATURE_32('E', 'R', 'S', 'T')
1171 |
1172 | ///
1173 | /// "FACP" Fixed ACPI Description Table
1174 | ///
1175 | #define EFI_ACPI_4_0_FIXED_ACPI_DESCRIPTION_TABLE_SIGNATURE SIGNATURE_32('F', 'A', 'C', 'P')
1176 |
1177 | ///
1178 | /// "FACS" Firmware ACPI Control Structure
1179 | ///
1180 | #define EFI_ACPI_4_0_FIRMWARE_ACPI_CONTROL_STRUCTURE_SIGNATURE SIGNATURE_32('F', 'A', 'C', 'S')
1181 |
1182 | ///
1183 | /// "HEST" Hardware Error Source Table
1184 | ///
1185 | #define EFI_ACPI_4_0_HARDWARE_ERROR_SOURCE_TABLE_SIGNATURE SIGNATURE_32('H', 'E', 'S', 'T')
1186 |
1187 | ///
1188 | /// "MSCT" Maximum System Characteristics Table
1189 | ///
1190 | #define EFI_ACPI_4_0_MAXIMUM_SYSTEM_CHARACTERISTICS_TABLE_SIGNATURE SIGNATURE_32('M', 'S', 'C', 'T')
1191 |
1192 | ///
1193 | /// "PSDT" Persistent System Description Table
1194 | ///
1195 | #define EFI_ACPI_4_0_PERSISTENT_SYSTEM_DESCRIPTION_TABLE_SIGNATURE SIGNATURE_32('P', 'S', 'D', 'T')
1196 |
1197 | ///
1198 | /// "RSDT" Root System Description Table
1199 | ///
1200 | #define EFI_ACPI_4_0_ROOT_SYSTEM_DESCRIPTION_TABLE_SIGNATURE SIGNATURE_32('R', 'S', 'D', 'T')
1201 |
1202 | ///
1203 | /// "SBST" Smart Battery Specification Table
1204 | ///
1205 | #define EFI_ACPI_4_0_SMART_BATTERY_SPECIFICATION_TABLE_SIGNATURE SIGNATURE_32('S', 'B', 'S', 'T')
1206 |
1207 | ///
1208 | /// "SLIT" System Locality Information Table
1209 | ///
1210 | #define EFI_ACPI_4_0_SYSTEM_LOCALITY_INFORMATION_TABLE_SIGNATURE SIGNATURE_32('S', 'L', 'I', 'T')
1211 |
1212 | ///
1213 | /// "SRAT" System Resource Affinity Table
1214 | ///
1215 | #define EFI_ACPI_4_0_SYSTEM_RESOURCE_AFFINITY_TABLE_SIGNATURE SIGNATURE_32('S', 'R', 'A', 'T')
1216 |
1217 | ///
1218 | /// "SSDT" Secondary System Description Table
1219 | ///
1220 | #define EFI_ACPI_4_0_SECONDARY_SYSTEM_DESCRIPTION_TABLE_SIGNATURE SIGNATURE_32('S', 'S', 'D', 'T')
1221 |
1222 | ///
1223 | /// "XSDT" Extended System Description Table
1224 | ///
1225 | #define EFI_ACPI_4_0_EXTENDED_SYSTEM_DESCRIPTION_TABLE_SIGNATURE SIGNATURE_32('X', 'S', 'D', 'T')
1226 |
1227 | ///
1228 | /// "BOOT" MS Simple Boot Spec
1229 | ///
1230 | #define EFI_ACPI_4_0_SIMPLE_BOOT_FLAG_TABLE_SIGNATURE SIGNATURE_32('B', 'O', 'O', 'T')
1231 |
1232 | ///
1233 | /// "DBGP" MS Debug Port Spec
1234 | ///
1235 | #define EFI_ACPI_4_0_DEBUG_PORT_TABLE_SIGNATURE SIGNATURE_32('D', 'B', 'G', 'P')
1236 |
1237 | ///
1238 | /// "DMAR" DMA Remapping Table
1239 | ///
1240 | #define EFI_ACPI_4_0_DMA_REMAPPING_TABLE_SIGNATURE SIGNATURE_32('D', 'M', 'A', 'R')
1241 |
1242 | ///
1243 | /// "ETDT" Event Timer Description Table
1244 | ///
1245 | #define EFI_ACPI_4_0_EVENT_TIMER_DESCRIPTION_TABLE_SIGNATURE SIGNATURE_32('E', 'T', 'D', 'T')
1246 |
1247 | ///
1248 | /// "HPET" IA-PC High Precision Event Timer Table
1249 | ///
1250 | #define EFI_ACPI_4_0_HIGH_PRECISION_EVENT_TIMER_TABLE_SIGNATURE SIGNATURE_32('H', 'P', 'E', 'T')
1251 |
1252 | ///
1253 | /// "iBFT" iSCSI Boot Firmware Table
1254 | ///
1255 | #define EFI_ACPI_4_0_ISCSI_BOOT_FIRMWARE_TABLE_SIGNATURE SIGNATURE_32('i', 'B', 'F', 'T')
1256 |
1257 | ///
1258 | /// "IVRS" I/O Virtualization Reporting Structure
1259 | ///
1260 | #define EFI_ACPI_4_0_IO_VIRTUALIZATION_REPORTING_STRUCTURE_SIGNATURE SIGNATURE_32('I', 'V', 'R', 'S')
1261 |
1262 | ///
1263 | /// "MCFG" PCI Express Memory Mapped Configuration Space Base Address Description Table
1264 | ///
1265 | #define EFI_ACPI_4_0_PCI_EXPRESS_MEMORY_MAPPED_CONFIGURATION_SPACE_BASE_ADDRESS_DESCRIPTION_TABLE_SIGNATURE SIGNATURE_32('M', 'C', 'F', 'G')
1266 |
1267 | ///
1268 | /// "MCHI" Management Controller Host Interface Table
1269 | ///
1270 | #define EFI_ACPI_4_0_MANAGEMENT_CONTROLLER_HOST_INTERFACE_TABLE_SIGNATURE SIGNATURE_32('M', 'C', 'H', 'I')
1271 |
1272 | ///
1273 | /// "SPCR" Serial Port Concole Redirection Table
1274 | ///
1275 | #define EFI_ACPI_4_0_SERIAL_PORT_CONSOLE_REDIRECTION_TABLE_SIGNATURE SIGNATURE_32('S', 'P', 'C', 'R')
1276 |
1277 | ///
1278 | /// "SPMI" Server Platform Management Interface Table
1279 | ///
1280 | #define EFI_ACPI_4_0_SERVER_PLATFORM_MANAGEMENT_INTERFACE_TABLE_SIGNATURE SIGNATURE_32('S', 'P', 'M', 'I')
1281 |
1282 | ///
1283 | /// "TCPA" Trusted Computing Platform Alliance Capabilities Table
1284 | ///
1285 | #define EFI_ACPI_4_0_TRUSTED_COMPUTING_PLATFORM_ALLIANCE_CAPABILITIES_TABLE_SIGNATURE SIGNATURE_32('T', 'C', 'P', 'A')
1286 |
1287 | ///
1288 | /// "UEFI" UEFI ACPI Data Table
1289 | ///
1290 | #define EFI_ACPI_4_0_UEFI_ACPI_DATA_TABLE_SIGNATURE SIGNATURE_32('U', 'E', 'F', 'I')
1291 |
1292 | ///
1293 | /// "WAET" Windows ACPI Enlightenment Table
1294 | ///
1295 | #define EFI_ACPI_4_0_WINDOWS_ACPI_ENLIGHTENMENT_TABLE_SIGNATURE SIGNATURE_32('W', 'A', 'E', 'T')
1296 |
1297 | ///
1298 | /// "WDAT" Watchdog Action Table
1299 | ///
1300 | #define EFI_ACPI_4_0_WATCHDOG_ACTION_TABLE_SIGNATURE SIGNATURE_32('W', 'D', 'A', 'T')
1301 |
1302 | ///
1303 | /// "WDRT" Watchdog Resource Table
1304 | ///
1305 | #define EFI_ACPI_4_0_WATCHDOG_RESOURCE_TABLE_SIGNATURE SIGNATURE_32('W', 'D', 'R', 'T')
1306 |
1307 | #pragma pack()
1308 |
1309 | #endif
1310 |
--------------------------------------------------------------------------------