Compare commits
213 Commits
edk2-stabl
...
edk2-stabl
Author | SHA1 | Date | |
---|---|---|---|
|
e1999b264f | ||
|
cfa6ffb113 | ||
|
1fb80369b7 | ||
|
04ae17218d | ||
|
15ee7b7689 | ||
|
4c79f9bc20 | ||
|
aecfbc81a9 | ||
|
42ec0a315b | ||
|
29e300ff81 | ||
|
1fbf5e30ae | ||
|
d2e0c473e6 | ||
|
9cd854e19d | ||
|
e0cb5e1814 | ||
|
32928415e3 | ||
|
d82c4693f8 | ||
|
eec44cdd00 | ||
|
22ac5cc9d9 | ||
|
5531fd48de | ||
|
6933c78e4d | ||
|
4e5ecdbac8 | ||
|
9301e5644c | ||
|
ef3840c1ff | ||
|
375f2d8e68 | ||
|
f297b7f200 | ||
|
8c8f49f0dc | ||
|
1e6b0394d6 | ||
|
8e7edbbf5d | ||
|
a3f12cd471 | ||
|
cc71bd9709 | ||
|
75d1a7903d | ||
|
ab957f036f | ||
|
612edbe6cd | ||
|
01c0ab90be | ||
|
7c4f05dc05 | ||
|
ec9683ec0f | ||
|
a4cf19597f | ||
|
2942cb5815 | ||
|
1cb1087749 | ||
|
f11252e9fd | ||
|
b8de64bede | ||
|
c2bd8a1a82 | ||
|
a145d5f240 | ||
|
3093c95de8 | ||
|
ecfe47968e | ||
|
d03f71dd8b | ||
|
fd9cc2052e | ||
|
cc15a619a6 | ||
|
5b90b8abb4 | ||
|
13f32d4a64 | ||
|
bbeb1bea41 | ||
|
bf2b99990e | ||
|
8d2012035d | ||
|
5396354b86 | ||
|
f2f4c6be2d | ||
|
61680cac5e | ||
|
d3b0d007a1 | ||
|
0bbc207275 | ||
|
c3dcbce26f | ||
|
64138c95db | ||
|
8c75a07208 | ||
|
a300f2a3f5 | ||
|
c8cf71ec9c | ||
|
10bf6c40f6 | ||
|
99e7e48cc7 | ||
|
9abc447b72 | ||
|
96479947bc | ||
|
063f8483b9 | ||
|
bd8efb4f8e | ||
|
1f93d0c5a3 | ||
|
84262ca3d9 | ||
|
dc6c6397b8 | ||
|
68c1868565 | ||
|
462f95ec5b | ||
|
2f2c0a8b9f | ||
|
60e49aac4e | ||
|
39b3e14c99 | ||
|
3c0c1d3fae | ||
|
f21e72135d | ||
|
152015fa65 | ||
|
74b41d5648 | ||
|
22693153d1 | ||
|
11bd8e249f | ||
|
29bf905976 | ||
|
a563c84779 | ||
|
d9f0b84c1d | ||
|
aec0ce7ca8 | ||
|
d892336899 | ||
|
ea61e597e1 | ||
|
0fc54a6a55 | ||
|
b9d4976998 | ||
|
a4d95d7cf9 | ||
|
8948fb0974 | ||
|
890e6d466c | ||
|
5a5440d0dc | ||
|
3c13938079 | ||
|
251f9b3906 | ||
|
d0bf83e1cc | ||
|
db2338af0d | ||
|
7cc8cd7b58 | ||
|
2ad22420a7 | ||
|
c055be5b82 | ||
|
037090cb7c | ||
|
83876950ab | ||
|
cc00dbcb19 | ||
|
71cdb91f31 | ||
|
c75c640512 | ||
|
51e0bd28bb | ||
|
9d6861494a | ||
|
896e689841 | ||
|
44ad51d6b1 | ||
|
29280c7084 | ||
|
16136f218d | ||
|
54211ab10f | ||
|
f8e6bcb6e7 | ||
|
4b59b22fed | ||
|
a7d8e28b29 | ||
|
2072c22a0d | ||
|
7e7b729f6c | ||
|
5eb2de2d98 | ||
|
97336fdee4 | ||
|
efa7f4df0f | ||
|
bce0328431 | ||
|
83c7f8178b | ||
|
030f71dfc4 | ||
|
1a957f17bc | ||
|
19d5bccc76 | ||
|
dc4d42302c | ||
|
38c8be123a | ||
|
9c08b3e7d5 | ||
|
4ac0296201 | ||
|
f95cdd316c | ||
|
8c89229885 | ||
|
8c10a2c014 | ||
|
32976569af | ||
|
62bad17dca | ||
|
08c65f7c4d | ||
|
3c3a0dd9d7 | ||
|
349cd45b5f | ||
|
42a492fb3e | ||
|
df79bfb87b | ||
|
25b77b5090 | ||
|
0d03ffc766 | ||
|
d2263c06c9 | ||
|
389b3b83e4 | ||
|
d4ab7201f2 | ||
|
d04b47962d | ||
|
821e042f42 | ||
|
e0df328f6f | ||
|
2b46d175cb | ||
|
2ee287b9fd | ||
|
8e03191dde | ||
|
8cb0edc689 | ||
|
991c898775 | ||
|
edc37612f7 | ||
|
e2158c4a09 | ||
|
ae25aeaf55 | ||
|
c8a5d99302 | ||
|
96afc54688 | ||
|
83d4afa4db | ||
|
98ff7e3c63 | ||
|
1c11e7a214 | ||
|
b33cf5bfcb | ||
|
fe66288873 | ||
|
4bf2a5b045 | ||
|
30691a4b40 | ||
|
aa75965349 | ||
|
f037af6ecb | ||
|
0ecdcb6142 | ||
|
3d0df0f076 | ||
|
ca31888271 | ||
|
eb07bfb09e | ||
|
87a80dc4f2 | ||
|
9fd7e88c23 | ||
|
f9c53a69ed | ||
|
ce6c2b0016 | ||
|
313d86c956 | ||
|
773b0bc283 | ||
|
030ba3097a | ||
|
e4ff3773b7 | ||
|
2e51b27fed | ||
|
66a31de7ee | ||
|
f3bdfc4186 | ||
|
f053288863 | ||
|
30c69d2cfa | ||
|
af9c77e151 | ||
|
b6d5996706 | ||
|
8ade9d425a | ||
|
15e6ae8ea4 | ||
|
2d92e052c3 | ||
|
a752dd0746 | ||
|
0cb242e336 | ||
|
4751a48aeb | ||
|
54ba08c6b6 | ||
|
edd46cd407 | ||
|
e542e05d4f | ||
|
2002e950ea | ||
|
61dc3b3399 | ||
|
3e062ea498 | ||
|
94fa95c874 | ||
|
d28a681534 | ||
|
dd6c0a0ba3 | ||
|
8c61f1934d | ||
|
2fba7d4ee4 | ||
|
e59760f87e | ||
|
b8a92fa2fe | ||
|
59a3ccb09e | ||
|
8802583c48 | ||
|
3c2dc30d1b | ||
|
e2d6833c11 | ||
|
f463dbaded | ||
|
05a757c9c6 | ||
|
7cda5d9e3a | ||
|
c5740f3606 |
@@ -51,9 +51,6 @@ steps:
|
|||||||
# Set default
|
# Set default
|
||||||
- bash: echo "##vso[task.setvariable variable=pkg_count]${{ 1 }}"
|
- bash: echo "##vso[task.setvariable variable=pkg_count]${{ 1 }}"
|
||||||
|
|
||||||
# Use altername cmocka repo
|
|
||||||
- bash: git config --global url.https://github.com/neverware-mirrors/cmocka.git.insteadOf https://git.cryptomilk.org/projects/cmocka.git
|
|
||||||
|
|
||||||
# Fetch the target branch so that pr_eval can diff them.
|
# Fetch the target branch so that pr_eval can diff them.
|
||||||
# Seems like azure pipelines/github changed checkout process in nov 2020.
|
# Seems like azure pipelines/github changed checkout process in nov 2020.
|
||||||
- script: git fetch origin $(System.PullRequest.targetBranch)
|
- script: git fetch origin $(System.PullRequest.targetBranch)
|
||||||
|
@@ -21,6 +21,9 @@ jobs:
|
|||||||
#Use matrix to speed up the build process
|
#Use matrix to speed up the build process
|
||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
|
TARGET_ARM_ARMPLATFORM:
|
||||||
|
Build.Pkgs: 'ArmPkg,ArmPlatformPkg'
|
||||||
|
Build.Targets: 'DEBUG,RELEASE,NO-TARGET,NOOPT'
|
||||||
TARGET_MDE_CPU:
|
TARGET_MDE_CPU:
|
||||||
Build.Pkgs: 'MdePkg,UefiCpuPkg'
|
Build.Pkgs: 'MdePkg,UefiCpuPkg'
|
||||||
Build.Targets: 'DEBUG,RELEASE,NO-TARGET,NOOPT'
|
Build.Targets: 'DEBUG,RELEASE,NO-TARGET,NOOPT'
|
||||||
|
@@ -31,9 +31,6 @@ steps:
|
|||||||
echo "##vso[task.setvariable variable=pkgs_to_build]${{ parameters.build_pkgs }}"
|
echo "##vso[task.setvariable variable=pkgs_to_build]${{ parameters.build_pkgs }}"
|
||||||
echo "##vso[task.setvariable variable=pkg_count]${{ 1 }}"
|
echo "##vso[task.setvariable variable=pkg_count]${{ 1 }}"
|
||||||
|
|
||||||
# Use altername cmocka repo
|
|
||||||
- bash: git config --global url.https://github.com/neverware-mirrors/cmocka.git.insteadOf https://git.cryptomilk.org/projects/cmocka.git
|
|
||||||
|
|
||||||
# Fetch the target branch so that pr_eval can diff them.
|
# Fetch the target branch so that pr_eval can diff them.
|
||||||
# Seems like azure pipelines/github changed checkout process in nov 2020.
|
# Seems like azure pipelines/github changed checkout process in nov 2020.
|
||||||
- script: git fetch origin $(System.PullRequest.targetBranch)
|
- script: git fetch origin $(System.PullRequest.targetBranch)
|
||||||
|
2
.gitmodules
vendored
2
.gitmodules
vendored
@@ -6,7 +6,7 @@
|
|||||||
url = https://github.com/ucb-bar/berkeley-softfloat-3.git
|
url = https://github.com/ucb-bar/berkeley-softfloat-3.git
|
||||||
[submodule "UnitTestFrameworkPkg/Library/CmockaLib/cmocka"]
|
[submodule "UnitTestFrameworkPkg/Library/CmockaLib/cmocka"]
|
||||||
path = UnitTestFrameworkPkg/Library/CmockaLib/cmocka
|
path = UnitTestFrameworkPkg/Library/CmockaLib/cmocka
|
||||||
url = https://git.cryptomilk.org/projects/cmocka.git
|
url = https://github.com/tianocore/edk2-cmocka.git
|
||||||
[submodule "MdeModulePkg/Universal/RegularExpressionDxe/oniguruma"]
|
[submodule "MdeModulePkg/Universal/RegularExpressionDxe/oniguruma"]
|
||||||
path = MdeModulePkg/Universal/RegularExpressionDxe/oniguruma
|
path = MdeModulePkg/Universal/RegularExpressionDxe/oniguruma
|
||||||
url = https://github.com/kkos/oniguruma
|
url = https://github.com/kkos/oniguruma
|
||||||
|
@@ -49,7 +49,9 @@ class Settings(CiBuildSettingsManager, UpdateSettingsManager, SetupSettingsManag
|
|||||||
''' return iterable of edk2 packages supported by this build.
|
''' return iterable of edk2 packages supported by this build.
|
||||||
These should be edk2 workspace relative paths '''
|
These should be edk2 workspace relative paths '''
|
||||||
|
|
||||||
return ("ArmVirtPkg",
|
return ("ArmPkg",
|
||||||
|
"ArmPlatformPkg",
|
||||||
|
"ArmVirtPkg",
|
||||||
"DynamicTablesPkg",
|
"DynamicTablesPkg",
|
||||||
"EmulatorPkg",
|
"EmulatorPkg",
|
||||||
"MdePkg",
|
"MdePkg",
|
||||||
|
@@ -4,8 +4,8 @@
|
|||||||
|
|
||||||
| Package | Windows VS2019 (IA32/X64)| Ubuntu GCC (IA32/X64/ARM/AARCH64) | Known Issues |
|
| Package | Windows VS2019 (IA32/X64)| Ubuntu GCC (IA32/X64/ARM/AARCH64) | Known Issues |
|
||||||
| :---- | :----- | :---- | :--- |
|
| :---- | :----- | :---- | :--- |
|
||||||
| ArmPkg |
|
| ArmPkg | | :heavy_check_mark: |
|
||||||
| ArmPlatformPkg |
|
| ArmPlatformPkg | | :heavy_check_mark: |
|
||||||
| ArmVirtPkg | SEE PACKAGE README | SEE PACKAGE README |
|
| ArmVirtPkg | SEE PACKAGE README | SEE PACKAGE README |
|
||||||
| CryptoPkg | :heavy_check_mark: | :heavy_check_mark: | Spell checking in audit mode
|
| CryptoPkg | :heavy_check_mark: | :heavy_check_mark: | Spell checking in audit mode
|
||||||
| DynamicTablesPkg | | :heavy_check_mark: |
|
| DynamicTablesPkg | | :heavy_check_mark: |
|
||||||
@@ -254,6 +254,16 @@ Install
|
|||||||
|
|
||||||
More cspell info: https://github.com/streetsidesoftware/cspell
|
More cspell info: https://github.com/streetsidesoftware/cspell
|
||||||
|
|
||||||
|
### License Checking - LicenseCheck
|
||||||
|
|
||||||
|
Scans all new added files in a package to make sure code is contributed under
|
||||||
|
BSD-2-Clause-Patent.
|
||||||
|
|
||||||
|
### Ecc tool - EccCheck
|
||||||
|
|
||||||
|
Run the Ecc tool on the package. The Ecc tool is available in the BaseTools
|
||||||
|
package. It checks that the code complies to the EDKII coding standard.
|
||||||
|
|
||||||
## PyTool Scopes
|
## PyTool Scopes
|
||||||
|
|
||||||
Scopes are how the PyTool ext_dep, path_env, and plugins are activated. Meaning
|
Scopes are how the PyTool ext_dep, path_env, and plugins are activated. Meaning
|
||||||
|
221
ArmPkg/ArmPkg.ci.yaml
Normal file
221
ArmPkg/ArmPkg.ci.yaml
Normal file
@@ -0,0 +1,221 @@
|
|||||||
|
## @file
|
||||||
|
# CI configuration for ArmPkg
|
||||||
|
#
|
||||||
|
# Copyright (c) 2021, Arm Limited. All rights reserved.<BR>
|
||||||
|
# SPDX-License-Identifier: BSD-2-Clause-Patent
|
||||||
|
##
|
||||||
|
{
|
||||||
|
## options defined .pytool/Plugin/LicenseCheck
|
||||||
|
"LicenseCheck": {
|
||||||
|
"IgnoreFiles": []
|
||||||
|
},
|
||||||
|
|
||||||
|
"EccCheck": {
|
||||||
|
## Exception sample looks like below:
|
||||||
|
## "ExceptionList": [
|
||||||
|
## "<ErrorID>", "<KeyWord>"
|
||||||
|
## ]
|
||||||
|
"ExceptionList": [
|
||||||
|
],
|
||||||
|
## Both file path and directory path are accepted.
|
||||||
|
"IgnoreFiles": [
|
||||||
|
"Library/ArmSoftFloatLib/berkeley-softfloat-3"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
|
||||||
|
## options defined .pytool/Plugin/CompilerPlugin
|
||||||
|
"CompilerPlugin": {
|
||||||
|
"DscPath": "ArmPkg.dsc"
|
||||||
|
},
|
||||||
|
|
||||||
|
## options defined .pytool/Plugin/HostUnitTestCompilerPlugin
|
||||||
|
"HostUnitTestCompilerPlugin": {
|
||||||
|
"DscPath": "" # Don't support this test
|
||||||
|
},
|
||||||
|
|
||||||
|
## options defined .pytool/Plugin/CharEncodingCheck
|
||||||
|
"CharEncodingCheck": {
|
||||||
|
"IgnoreFiles": []
|
||||||
|
},
|
||||||
|
|
||||||
|
## options defined .pytool/Plugin/DependencyCheck
|
||||||
|
"DependencyCheck": {
|
||||||
|
"AcceptableDependencies": [
|
||||||
|
"ArmPlatformPkg/ArmPlatformPkg.dec",
|
||||||
|
"ArmPkg/ArmPkg.dec",
|
||||||
|
"EmbeddedPkg/EmbeddedPkg.dec",
|
||||||
|
"MdeModulePkg/MdeModulePkg.dec",
|
||||||
|
"MdePkg/MdePkg.dec",
|
||||||
|
"ShellPkg/ShellPkg.dec"
|
||||||
|
],
|
||||||
|
# For host based unit tests
|
||||||
|
"AcceptableDependencies-HOST_APPLICATION":[
|
||||||
|
"UnitTestFrameworkPkg/UnitTestFrameworkPkg.dec"
|
||||||
|
],
|
||||||
|
# For UEFI shell based apps
|
||||||
|
"AcceptableDependencies-UEFI_APPLICATION":[],
|
||||||
|
"IgnoreInf": []
|
||||||
|
},
|
||||||
|
|
||||||
|
## options defined .pytool/Plugin/DscCompleteCheck
|
||||||
|
"DscCompleteCheck": {
|
||||||
|
"IgnoreInf": [],
|
||||||
|
"DscPath": "ArmPkg.dsc"
|
||||||
|
},
|
||||||
|
|
||||||
|
## options defined .pytool/Plugin/HostUnitTestDscCompleteCheck
|
||||||
|
"HostUnitTestDscCompleteCheck": {
|
||||||
|
"IgnoreInf": [""],
|
||||||
|
"DscPath": "" # Don't support this test
|
||||||
|
},
|
||||||
|
|
||||||
|
## options defined .pytool/Plugin/GuidCheck
|
||||||
|
"GuidCheck": {
|
||||||
|
"IgnoreGuidName": [],
|
||||||
|
"IgnoreGuidValue": [],
|
||||||
|
"IgnoreFoldersAndFiles": [],
|
||||||
|
"IgnoreDuplicates": [],
|
||||||
|
},
|
||||||
|
|
||||||
|
## options defined .pytool/Plugin/LibraryClassCheck
|
||||||
|
"LibraryClassCheck": {
|
||||||
|
"IgnoreHeaderFile": []
|
||||||
|
},
|
||||||
|
|
||||||
|
## options defined .pytool/Plugin/SpellCheck
|
||||||
|
"SpellCheck": {
|
||||||
|
"AuditOnly": False,
|
||||||
|
"IgnoreFiles": [
|
||||||
|
"Library/ArmSoftFloatLib/berkeley-softfloat-3/**"
|
||||||
|
], # use gitignore syntax to ignore errors
|
||||||
|
# in matching files
|
||||||
|
"ExtendWords": [
|
||||||
|
"api's",
|
||||||
|
"ackintid",
|
||||||
|
"actlr",
|
||||||
|
"aeabi",
|
||||||
|
"ashldi",
|
||||||
|
"ashrdi",
|
||||||
|
"ccidx",
|
||||||
|
"ccsidr",
|
||||||
|
"clidr",
|
||||||
|
"clrex",
|
||||||
|
"clzsi",
|
||||||
|
"cpuactlr",
|
||||||
|
"csselr",
|
||||||
|
"ctzsi",
|
||||||
|
"cygdrive",
|
||||||
|
"cygpaths",
|
||||||
|
"datas",
|
||||||
|
"dcmpeq",
|
||||||
|
"dcmpge",
|
||||||
|
"dcmpgt",
|
||||||
|
"dcmple",
|
||||||
|
"dcmplt",
|
||||||
|
"ddisable",
|
||||||
|
"divdi",
|
||||||
|
"divsi",
|
||||||
|
"dmdepkg",
|
||||||
|
"drsub",
|
||||||
|
"fcmpeq",
|
||||||
|
"fcmpge",
|
||||||
|
"fcmpgt",
|
||||||
|
"fcmple",
|
||||||
|
"fcmplt",
|
||||||
|
"ffreestanding",
|
||||||
|
"frsub",
|
||||||
|
"hisilicon",
|
||||||
|
"iccbpr",
|
||||||
|
"icciar",
|
||||||
|
"iccicr",
|
||||||
|
"icciidr",
|
||||||
|
"iccpmr",
|
||||||
|
"icdicer",
|
||||||
|
"icdicfr",
|
||||||
|
"icdictr",
|
||||||
|
"icdiser",
|
||||||
|
"icdisr",
|
||||||
|
"icdsgir",
|
||||||
|
"icenabler",
|
||||||
|
"intid",
|
||||||
|
"ipriority",
|
||||||
|
"irouter",
|
||||||
|
"isenabler",
|
||||||
|
"istatus",
|
||||||
|
"itargets",
|
||||||
|
"lable",
|
||||||
|
"ldivmod",
|
||||||
|
"ldmdb",
|
||||||
|
"ldmia",
|
||||||
|
"ldrbt",
|
||||||
|
"ldrex",
|
||||||
|
"ldrexb",
|
||||||
|
"ldrexd",
|
||||||
|
"ldrexh",
|
||||||
|
"ldrhbt",
|
||||||
|
"ldrht",
|
||||||
|
"ldrsb",
|
||||||
|
"ldrsbt",
|
||||||
|
"ldrsh",
|
||||||
|
"lshrdi",
|
||||||
|
"moddi",
|
||||||
|
"modsi",
|
||||||
|
"mpidr",
|
||||||
|
"muldi",
|
||||||
|
"mullu",
|
||||||
|
"nonshareable",
|
||||||
|
"nsacr",
|
||||||
|
"nsasedis",
|
||||||
|
"nuvia",
|
||||||
|
"oldit",
|
||||||
|
"readc",
|
||||||
|
"revsh",
|
||||||
|
"rfedb",
|
||||||
|
"sctlr",
|
||||||
|
"smccc",
|
||||||
|
"smlabb",
|
||||||
|
"smlabt",
|
||||||
|
"smlad",
|
||||||
|
"smladx",
|
||||||
|
"smlatb",
|
||||||
|
"smlatt",
|
||||||
|
"smlawb",
|
||||||
|
"smlawt",
|
||||||
|
"smlsd",
|
||||||
|
"smlsdx",
|
||||||
|
"smmla",
|
||||||
|
"smmlar",
|
||||||
|
"smmls",
|
||||||
|
"smmlsr",
|
||||||
|
"sourcery",
|
||||||
|
"srsdb",
|
||||||
|
"stmdb",
|
||||||
|
"stmia",
|
||||||
|
"strbt",
|
||||||
|
"strexb",
|
||||||
|
"strexd",
|
||||||
|
"strexh",
|
||||||
|
"strht",
|
||||||
|
"switchu",
|
||||||
|
"tpidrurw",
|
||||||
|
"ttbcr",
|
||||||
|
"typer",
|
||||||
|
"ucmpdi",
|
||||||
|
"udivdi",
|
||||||
|
"udivmoddi",
|
||||||
|
"udivsi",
|
||||||
|
"uefi's",
|
||||||
|
"uldiv",
|
||||||
|
"umoddi",
|
||||||
|
"umodsi",
|
||||||
|
"usada",
|
||||||
|
"vlpis",
|
||||||
|
"writec"
|
||||||
|
], # words to extend to the dictionary for this package
|
||||||
|
"IgnoreStandardPaths": [ # Standard Plugin defined paths that
|
||||||
|
"*.asm", "*.s" # should be ignore
|
||||||
|
],
|
||||||
|
"AdditionalIncludePaths": [] # Additional paths to spell check
|
||||||
|
# (wildcards supported)
|
||||||
|
}
|
||||||
|
}
|
@@ -2,7 +2,7 @@
|
|||||||
# ARM processor package.
|
# ARM processor package.
|
||||||
#
|
#
|
||||||
# Copyright (c) 2009 - 2010, Apple Inc. All rights reserved.<BR>
|
# Copyright (c) 2009 - 2010, Apple Inc. All rights reserved.<BR>
|
||||||
# Copyright (c) 2011 - 2018, ARM Limited. All rights reserved.
|
# Copyright (c) 2011 - 2021, ARM Limited. All rights reserved.
|
||||||
#
|
#
|
||||||
# SPDX-License-Identifier: BSD-2-Clause-Patent
|
# SPDX-License-Identifier: BSD-2-Clause-Patent
|
||||||
#
|
#
|
||||||
@@ -27,15 +27,68 @@
|
|||||||
Include # Root include for the package
|
Include # Root include for the package
|
||||||
|
|
||||||
[LibraryClasses.common]
|
[LibraryClasses.common]
|
||||||
ArmLib|Include/Library/ArmLib.h
|
## @libraryclass Convert Arm instructions to a human readable format.
|
||||||
ArmMmuLib|Include/Library/ArmMmuLib.h
|
#
|
||||||
SemihostLib|Include/Library/Semihosting.h
|
|
||||||
DefaultExceptionHandlerLib|Include/Library/DefaultExceptionHandlerLib.h
|
|
||||||
ArmDisassemblerLib|Include/Library/ArmDisassemblerLib.h
|
ArmDisassemblerLib|Include/Library/ArmDisassemblerLib.h
|
||||||
|
|
||||||
|
## @libraryclass Provides an interface to Arm generic counters.
|
||||||
|
#
|
||||||
|
ArmGenericTimerCounterLib|Include/Library/ArmGenericTimerCounterLib.h
|
||||||
|
|
||||||
|
## @libraryclass Provides an interface to initialize a
|
||||||
|
# Generic Interrupt Controller (GIC).
|
||||||
|
#
|
||||||
ArmGicArchLib|Include/Library/ArmGicArchLib.h
|
ArmGicArchLib|Include/Library/ArmGicArchLib.h
|
||||||
ArmMtlLib|ArmPlatformPkg/Include/Library/ArmMtlLib.h
|
|
||||||
|
## @libraryclass Provides a Generic Interrupt Controller (GIC)
|
||||||
|
# configuration interface.
|
||||||
|
#
|
||||||
|
ArmGicLib|Include/Library/ArmGicLib.h
|
||||||
|
|
||||||
|
## @libraryclass Provides a HyperVisor Call (HVC) interface.
|
||||||
|
#
|
||||||
|
ArmHvcLib|Include/Library/ArmHvcLib.h
|
||||||
|
|
||||||
|
## @libraryclass Provides an interface to Arm registers.
|
||||||
|
#
|
||||||
|
ArmLib|Include/Library/ArmLib.h
|
||||||
|
|
||||||
|
## @libraryclass Provides a Mmu interface.
|
||||||
|
#
|
||||||
|
ArmMmuLib|Include/Library/ArmMmuLib.h
|
||||||
|
|
||||||
|
## @libraryclass Provides a Mailbox Transport Layer (MTL) interface
|
||||||
|
# for the System Control and Management Interface (SCMI).
|
||||||
|
#
|
||||||
|
ArmMtlLib|Include/Library/ArmMtlLib.h
|
||||||
|
|
||||||
|
## @libraryclass Provides a System Monitor Call (SMC) interface.
|
||||||
|
#
|
||||||
|
ArmSmcLib|Include/Library/ArmSmcLib.h
|
||||||
|
|
||||||
|
## @libraryclass Provides a SuperVisor Call (SVC) interface.
|
||||||
|
#
|
||||||
ArmSvcLib|Include/Library/ArmSvcLib.h
|
ArmSvcLib|Include/Library/ArmSvcLib.h
|
||||||
|
|
||||||
|
## @libraryclass Provides a default exception handler.
|
||||||
|
#
|
||||||
|
DefaultExceptionHandlerLib|Include/Library/DefaultExceptionHandlerLib.h
|
||||||
|
|
||||||
|
## @libraryclass Provides an interface to query miscellaneous OEM
|
||||||
|
# information.
|
||||||
|
#
|
||||||
|
OemMiscLib|Include/Library/OemMiscLib.h
|
||||||
|
|
||||||
|
## @libraryclass Provides an OpTee interface.
|
||||||
|
#
|
||||||
OpteeLib|Include/Library/OpteeLib.h
|
OpteeLib|Include/Library/OpteeLib.h
|
||||||
|
|
||||||
|
## @libraryclass Provides a semihosting interface.
|
||||||
|
#
|
||||||
|
SemihostLib|Include/Library/SemihostLib.h
|
||||||
|
|
||||||
|
## @libraryclass Provides an interface for a StandaloneMm Mmu.
|
||||||
|
#
|
||||||
StandaloneMmMmuLib|Include/Library/StandaloneMmMmuLib.h
|
StandaloneMmMmuLib|Include/Library/StandaloneMmMmuLib.h
|
||||||
|
|
||||||
[Guids.common]
|
[Guids.common]
|
||||||
|
@@ -2,7 +2,7 @@
|
|||||||
# ARM processor package.
|
# ARM processor package.
|
||||||
#
|
#
|
||||||
# Copyright (c) 2009 - 2010, Apple Inc. All rights reserved.<BR>
|
# Copyright (c) 2009 - 2010, Apple Inc. All rights reserved.<BR>
|
||||||
# Copyright (c) 2011 - 2018, ARM Ltd. All rights reserved.<BR>
|
# Copyright (c) 2011 - 2021, Arm Limited. All rights reserved.<BR>
|
||||||
# Copyright (c) 2016, Linaro Ltd. All rights reserved.<BR>
|
# Copyright (c) 2016, Linaro Ltd. All rights reserved.<BR>
|
||||||
# Copyright (c) Microsoft Corporation.<BR>
|
# Copyright (c) Microsoft Corporation.<BR>
|
||||||
#
|
#
|
||||||
@@ -32,17 +32,22 @@
|
|||||||
[PcdsFixedAtBuild]
|
[PcdsFixedAtBuild]
|
||||||
gEfiMdePkgTokenSpaceGuid.PcdDefaultTerminalType|4
|
gEfiMdePkgTokenSpaceGuid.PcdDefaultTerminalType|4
|
||||||
|
|
||||||
|
!include MdePkg/MdeLibs.dsc.inc
|
||||||
|
|
||||||
[LibraryClasses.common]
|
[LibraryClasses.common]
|
||||||
BaseLib|MdePkg/Library/BaseLib/BaseLib.inf
|
BaseLib|MdePkg/Library/BaseLib/BaseLib.inf
|
||||||
BaseMemoryLib|MdePkg/Library/BaseMemoryLib/BaseMemoryLib.inf
|
BaseMemoryLib|MdePkg/Library/BaseMemoryLib/BaseMemoryLib.inf
|
||||||
|
BootLogoLib|MdeModulePkg/Library/BootLogoLib/BootLogoLib.inf
|
||||||
CacheMaintenanceLib|ArmPkg/Library/ArmCacheMaintenanceLib/ArmCacheMaintenanceLib.inf
|
CacheMaintenanceLib|ArmPkg/Library/ArmCacheMaintenanceLib/ArmCacheMaintenanceLib.inf
|
||||||
CapsuleLib|MdeModulePkg/Library/DxeCapsuleLibNull/DxeCapsuleLibNull.inf
|
CapsuleLib|MdeModulePkg/Library/DxeCapsuleLibNull/DxeCapsuleLibNull.inf
|
||||||
DebugLib|MdePkg/Library/BaseDebugLibNull/BaseDebugLibNull.inf
|
DebugLib|MdePkg/Library/BaseDebugLibNull/BaseDebugLibNull.inf
|
||||||
|
DxeServicesLib|MdePkg/Library/DxeServicesLib/DxeServicesLib.inf
|
||||||
HobLib|MdePkg/Library/DxeHobLib/DxeHobLib.inf
|
HobLib|MdePkg/Library/DxeHobLib/DxeHobLib.inf
|
||||||
MemoryAllocationLib|MdePkg/Library/UefiMemoryAllocationLib/UefiMemoryAllocationLib.inf
|
MemoryAllocationLib|MdePkg/Library/UefiMemoryAllocationLib/UefiMemoryAllocationLib.inf
|
||||||
PcdLib|MdePkg/Library/BasePcdLibNull/BasePcdLibNull.inf
|
PcdLib|MdePkg/Library/BasePcdLibNull/BasePcdLibNull.inf
|
||||||
PrintLib|MdePkg/Library/BasePrintLib/BasePrintLib.inf
|
PrintLib|MdePkg/Library/BasePrintLib/BasePrintLib.inf
|
||||||
TimerLib|MdePkg/Library/BaseTimerLibNullTemplate/BaseTimerLibNullTemplate.inf
|
TimerLib|MdePkg/Library/BaseTimerLibNullTemplate/BaseTimerLibNullTemplate.inf
|
||||||
|
UefiBootManagerLib|MdeModulePkg/Library/UefiBootManagerLib/UefiBootManagerLib.inf
|
||||||
UefiBootServicesTableLib|MdePkg/Library/UefiBootServicesTableLib/UefiBootServicesTableLib.inf
|
UefiBootServicesTableLib|MdePkg/Library/UefiBootServicesTableLib/UefiBootServicesTableLib.inf
|
||||||
UefiDriverEntryPoint|MdePkg/Library/UefiDriverEntryPoint/UefiDriverEntryPoint.inf
|
UefiDriverEntryPoint|MdePkg/Library/UefiDriverEntryPoint/UefiDriverEntryPoint.inf
|
||||||
UefiLib|MdePkg/Library/UefiLib/UefiLib.inf
|
UefiLib|MdePkg/Library/UefiLib/UefiLib.inf
|
||||||
@@ -50,6 +55,7 @@
|
|||||||
UefiRuntimeServicesTableLib|MdePkg/Library/UefiRuntimeServicesTableLib/UefiRuntimeServicesTableLib.inf
|
UefiRuntimeServicesTableLib|MdePkg/Library/UefiRuntimeServicesTableLib/UefiRuntimeServicesTableLib.inf
|
||||||
PeCoffLib|MdePkg/Library/BasePeCoffLib/BasePeCoffLib.inf
|
PeCoffLib|MdePkg/Library/BasePeCoffLib/BasePeCoffLib.inf
|
||||||
PeCoffGetEntryPointLib|MdePkg/Library/BasePeCoffGetEntryPointLib/BasePeCoffGetEntryPointLib.inf
|
PeCoffGetEntryPointLib|MdePkg/Library/BasePeCoffGetEntryPointLib/BasePeCoffGetEntryPointLib.inf
|
||||||
|
PeCoffExtraActionLib|MdePkg/Library/BasePeCoffExtraActionLibNull/BasePeCoffExtraActionLibNull.inf
|
||||||
|
|
||||||
UefiHiiServicesLib|MdeModulePkg/Library/UefiHiiServicesLib/UefiHiiServicesLib.inf
|
UefiHiiServicesLib|MdeModulePkg/Library/UefiHiiServicesLib/UefiHiiServicesLib.inf
|
||||||
HiiLib|MdeModulePkg/Library/UefiHiiLib/UefiHiiLib.inf
|
HiiLib|MdeModulePkg/Library/UefiHiiLib/UefiHiiLib.inf
|
||||||
@@ -150,6 +156,7 @@
|
|||||||
|
|
||||||
ArmPkg/Universal/Smbios/ProcessorSubClassDxe/ProcessorSubClassDxe.inf
|
ArmPkg/Universal/Smbios/ProcessorSubClassDxe/ProcessorSubClassDxe.inf
|
||||||
ArmPkg/Universal/Smbios/SmbiosMiscDxe/SmbiosMiscDxe.inf
|
ArmPkg/Universal/Smbios/SmbiosMiscDxe/SmbiosMiscDxe.inf
|
||||||
|
ArmPkg/Universal/Smbios/OemMiscLibNull/OemMiscLibNull.inf
|
||||||
|
|
||||||
[Components.AARCH64]
|
[Components.AARCH64]
|
||||||
ArmPkg/Drivers/MmCommunicationDxe/MmCommunication.inf
|
ArmPkg/Drivers/MmCommunicationDxe/MmCommunication.inf
|
||||||
|
@@ -6,8 +6,8 @@ SPDX-License-Identifier: BSD-2-Clause-Patent
|
|||||||
|
|
||||||
--*/
|
--*/
|
||||||
|
|
||||||
#ifndef __ARM_GIC_DXE_H__
|
#ifndef ARM_GIC_DXE_H_
|
||||||
#define __ARM_GIC_DXE_H__
|
#define ARM_GIC_DXE_H_
|
||||||
|
|
||||||
#include <Library/ArmGicLib.h>
|
#include <Library/ArmGicLib.h>
|
||||||
#include <Library/ArmLib.h>
|
#include <Library/ArmLib.h>
|
||||||
@@ -76,4 +76,4 @@ GicGetDistributorIcfgBaseAndBit (
|
|||||||
OUT UINTN *Config1Bit
|
OUT UINTN *Config1Bit
|
||||||
);
|
);
|
||||||
|
|
||||||
#endif
|
#endif // ARM_GIC_DXE_H_
|
||||||
|
@@ -1,6 +1,6 @@
|
|||||||
/** @file
|
/** @file
|
||||||
*
|
*
|
||||||
* Copyright (c) 2011-2018, ARM Limited. All rights reserved.
|
* Copyright (c) 2011-2021, Arm Limited. All rights reserved.
|
||||||
*
|
*
|
||||||
* SPDX-License-Identifier: BSD-2-Clause-Patent
|
* SPDX-License-Identifier: BSD-2-Clause-Patent
|
||||||
*
|
*
|
||||||
@@ -120,7 +120,14 @@ ArmGicGetMaxNumInterrupts (
|
|||||||
IN INTN GicDistributorBase
|
IN INTN GicDistributorBase
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
return 32 * ((MmioRead32 (GicDistributorBase + ARM_GIC_ICDICTR) & 0x1F) + 1);
|
UINTN ItLines;
|
||||||
|
|
||||||
|
ItLines = MmioRead32 (GicDistributorBase + ARM_GIC_ICDICTR) & 0x1F;
|
||||||
|
|
||||||
|
//
|
||||||
|
// Interrupt ID 1020-1023 are reserved.
|
||||||
|
//
|
||||||
|
return (ItLines == 0x1f) ? 1020 : 32 * (ItLines + 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
VOID
|
VOID
|
||||||
|
@@ -1,58 +0,0 @@
|
|||||||
/** @file
|
|
||||||
*
|
|
||||||
* Copyright (c) 2011-2014, ARM Limited. All rights reserved.
|
|
||||||
*
|
|
||||||
* SPDX-License-Identifier: BSD-2-Clause-Patent
|
|
||||||
*
|
|
||||||
**/
|
|
||||||
|
|
||||||
#include <Base.h>
|
|
||||||
#include <Library/DebugLib.h>
|
|
||||||
#include <Library/IoLib.h>
|
|
||||||
#include <Library/ArmGicLib.h>
|
|
||||||
|
|
||||||
/*
|
|
||||||
* This function configures the interrupts set by the mask to be secure.
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
VOID
|
|
||||||
EFIAPI
|
|
||||||
ArmGicSetSecureInterrupts (
|
|
||||||
IN UINTN GicDistributorBase,
|
|
||||||
IN UINTN* GicSecureInterruptMask,
|
|
||||||
IN UINTN GicSecureInterruptMaskSize
|
|
||||||
)
|
|
||||||
{
|
|
||||||
UINTN Index;
|
|
||||||
UINT32 InterruptStatus;
|
|
||||||
|
|
||||||
// We must not have more interrupts defined by the mask than the number of available interrupts
|
|
||||||
ASSERT(GicSecureInterruptMaskSize <= (ArmGicGetMaxNumInterrupts (GicDistributorBase) / 32));
|
|
||||||
|
|
||||||
// Set all the interrupts defined by the mask as Secure
|
|
||||||
for (Index = 0; Index < GicSecureInterruptMaskSize; Index++) {
|
|
||||||
InterruptStatus = MmioRead32 (GicDistributorBase + ARM_GIC_ICDISR + (Index * 4));
|
|
||||||
MmioWrite32 (GicDistributorBase + ARM_GIC_ICDISR + (Index * 4), InterruptStatus & (~GicSecureInterruptMask[Index]));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
VOID
|
|
||||||
EFIAPI
|
|
||||||
ArmGicEnableDistributor (
|
|
||||||
IN INTN GicDistributorBase
|
|
||||||
)
|
|
||||||
{
|
|
||||||
// Turn on the GIC distributor
|
|
||||||
MmioWrite32 (GicDistributorBase + ARM_GIC_ICDDCR, 1);
|
|
||||||
}
|
|
||||||
|
|
||||||
VOID
|
|
||||||
EFIAPI
|
|
||||||
ArmGicSetupNonSecure (
|
|
||||||
IN UINTN MpId,
|
|
||||||
IN INTN GicDistributorBase,
|
|
||||||
IN INTN GicInterruptInterfaceBase
|
|
||||||
)
|
|
||||||
{
|
|
||||||
ArmGicV2SetupNonSecure (MpId, GicDistributorBase, GicInterruptInterfaceBase);
|
|
||||||
}
|
|
@@ -121,7 +121,7 @@ GicV2GetInterruptSourceState (
|
|||||||
@param This Instance pointer for this protocol
|
@param This Instance pointer for this protocol
|
||||||
@param Source Hardware source of the interrupt
|
@param Source Hardware source of the interrupt
|
||||||
|
|
||||||
@retval EFI_SUCCESS Source interrupt EOI'ed.
|
@retval EFI_SUCCESS Source interrupt ended successfully.
|
||||||
@retval EFI_UNSUPPORTED Source interrupt is not supported
|
@retval EFI_UNSUPPORTED Source interrupt is not supported
|
||||||
|
|
||||||
**/
|
**/
|
||||||
|
@@ -115,7 +115,7 @@ GicV3GetInterruptSourceState (
|
|||||||
@param This Instance pointer for this protocol
|
@param This Instance pointer for this protocol
|
||||||
@param Source Hardware source of the interrupt
|
@param Source Hardware source of the interrupt
|
||||||
|
|
||||||
@retval EFI_SUCCESS Source interrupt EOI'ed.
|
@retval EFI_SUCCESS Source interrupt ended successfully.
|
||||||
@retval EFI_DEVICE_ERROR Hardware could not be programmed.
|
@retval EFI_DEVICE_ERROR Hardware could not be programmed.
|
||||||
|
|
||||||
**/
|
**/
|
||||||
|
@@ -1,6 +1,6 @@
|
|||||||
#/** @file
|
#/** @file
|
||||||
#
|
#
|
||||||
# Copyright (c) 2017-2018, Arm Limited. All rights reserved.
|
# Copyright (c) 2017-2021, Arm Limited. All rights reserved.<BR>
|
||||||
#
|
#
|
||||||
# SPDX-License-Identifier: BSD-2-Clause-Patent
|
# SPDX-License-Identifier: BSD-2-Clause-Patent
|
||||||
#
|
#
|
||||||
@@ -18,11 +18,16 @@
|
|||||||
ENTRY_POINT = ArmScmiDxeEntryPoint
|
ENTRY_POINT = ArmScmiDxeEntryPoint
|
||||||
|
|
||||||
[Sources.common]
|
[Sources.common]
|
||||||
Scmi.c
|
ArmScmiBaseProtocolPrivate.h
|
||||||
|
ArmScmiClockProtocolPrivate.h
|
||||||
|
ArmScmiPerformanceProtocolPrivate.h
|
||||||
ScmiBaseProtocol.c
|
ScmiBaseProtocol.c
|
||||||
|
Scmi.c
|
||||||
ScmiClockProtocol.c
|
ScmiClockProtocol.c
|
||||||
ScmiDxe.c
|
ScmiDxe.c
|
||||||
|
ScmiDxe.h
|
||||||
ScmiPerformanceProtocol.c
|
ScmiPerformanceProtocol.c
|
||||||
|
ScmiPrivate.h
|
||||||
|
|
||||||
[Packages]
|
[Packages]
|
||||||
ArmPkg/ArmPkg.dec
|
ArmPkg/ArmPkg.dec
|
||||||
|
@@ -1,6 +1,6 @@
|
|||||||
/** @file
|
/** @file
|
||||||
|
|
||||||
Copyright (c) 2017-2018, Arm Limited. All rights reserved.
|
Copyright (c) 2017-2021, Arm Limited. All rights reserved.
|
||||||
|
|
||||||
SPDX-License-Identifier: BSD-2-Clause-Patent
|
SPDX-License-Identifier: BSD-2-Clause-Patent
|
||||||
|
|
||||||
@@ -22,7 +22,7 @@
|
|||||||
#define NUM_REMAIN_PERF_LEVELS_SHIFT 16
|
#define NUM_REMAIN_PERF_LEVELS_SHIFT 16
|
||||||
#define NUM_REMAIN_PERF_LEVELS(Lvls) (Lvls >> NUM_REMAIN_PERF_LEVELS_SHIFT)
|
#define NUM_REMAIN_PERF_LEVELS(Lvls) (Lvls >> NUM_REMAIN_PERF_LEVELS_SHIFT)
|
||||||
|
|
||||||
/** Return values for SCMI_MESSAGE_ID_PERFORMANCE_DESCRIBE_LEVELS command.
|
/** Return values for ScmiMessageIdPerformanceDescribeLevels command.
|
||||||
SCMI Spec section 4.5.2.5
|
SCMI Spec section 4.5.2.5
|
||||||
**/
|
**/
|
||||||
typedef struct {
|
typedef struct {
|
||||||
|
@@ -95,7 +95,7 @@ ScmiCommandExecute (
|
|||||||
// Fill in message header.
|
// Fill in message header.
|
||||||
MessageHeader = SCMI_MESSAGE_HEADER (
|
MessageHeader = SCMI_MESSAGE_HEADER (
|
||||||
Command->MessageId,
|
Command->MessageId,
|
||||||
SCMI_MESSAGE_TYPE_COMMAND,
|
ScmiMessageTypeCommand,
|
||||||
Command->ProtocolId
|
Command->ProtocolId
|
||||||
);
|
);
|
||||||
|
|
||||||
@@ -123,7 +123,7 @@ ScmiCommandExecute (
|
|||||||
|
|
||||||
Response = (SCMI_MESSAGE_RESPONSE*)MtlGetChannelPayload (Channel);
|
Response = (SCMI_MESSAGE_RESPONSE*)MtlGetChannelPayload (Channel);
|
||||||
|
|
||||||
if (Response->Status != SCMI_SUCCESS) {
|
if (Response->Status != ScmiSuccess) {
|
||||||
DEBUG ((DEBUG_ERROR, "SCMI error: ProtocolId = 0x%x, MessageId = 0x%x, error = %d\n",
|
DEBUG ((DEBUG_ERROR, "SCMI error: ProtocolId = 0x%x, MessageId = 0x%x, error = %d\n",
|
||||||
Command->ProtocolId,
|
Command->ProtocolId,
|
||||||
Command->MessageId,
|
Command->MessageId,
|
||||||
@@ -195,7 +195,7 @@ ScmiGetProtocolVersion (
|
|||||||
|
|
||||||
Status = ScmiProtocolDiscoveryCommon (
|
Status = ScmiProtocolDiscoveryCommon (
|
||||||
ProtocolId,
|
ProtocolId,
|
||||||
SCMI_MESSAGE_ID_PROTOCOL_VERSION,
|
ScmiMessageIdProtocolVersion,
|
||||||
(UINT32**)&ProtocolVersion
|
(UINT32**)&ProtocolVersion
|
||||||
);
|
);
|
||||||
if (EFI_ERROR (Status)) {
|
if (EFI_ERROR (Status)) {
|
||||||
@@ -224,7 +224,7 @@ ScmiGetProtocolAttributes (
|
|||||||
{
|
{
|
||||||
return ScmiProtocolDiscoveryCommon (
|
return ScmiProtocolDiscoveryCommon (
|
||||||
ProtocolId,
|
ProtocolId,
|
||||||
SCMI_MESSAGE_ID_PROTOCOL_ATTRIBUTES,
|
ScmiMessageIdProtocolAttributes,
|
||||||
ReturnValues
|
ReturnValues
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@@ -246,7 +246,7 @@ ScmiGetProtocolMessageAttributes (
|
|||||||
{
|
{
|
||||||
return ScmiProtocolDiscoveryCommon (
|
return ScmiProtocolDiscoveryCommon (
|
||||||
ProtocolId,
|
ProtocolId,
|
||||||
SCMI_MESSAGE_ID_PROTOCOL_MESSAGE_ATTRIBUTES,
|
ScmiMessageIdProtocolMessageAttributes,
|
||||||
ReturnValues
|
ReturnValues
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
@@ -1,6 +1,6 @@
|
|||||||
/** @file
|
/** @file
|
||||||
|
|
||||||
Copyright (c) 2017-2018, Arm Limited. All rights reserved.
|
Copyright (c) 2017-2021, Arm Limited. All rights reserved.<BR>
|
||||||
|
|
||||||
SPDX-License-Identifier: BSD-2-Clause-Patent
|
SPDX-License-Identifier: BSD-2-Clause-Patent
|
||||||
|
|
||||||
@@ -34,7 +34,7 @@ BaseGetVersion (
|
|||||||
OUT UINT32 *Version
|
OUT UINT32 *Version
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
return ScmiGetProtocolVersion (SCMI_PROTOCOL_ID_BASE, Version);
|
return ScmiGetProtocolVersion (ScmiProtocolIdBase, Version);
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Return total number of SCMI protocols supported by the SCP firmware.
|
/** Return total number of SCMI protocols supported by the SCP firmware.
|
||||||
@@ -57,7 +57,7 @@ BaseGetTotalProtocols (
|
|||||||
EFI_STATUS Status;
|
EFI_STATUS Status;
|
||||||
UINT32 *ReturnValues;
|
UINT32 *ReturnValues;
|
||||||
|
|
||||||
Status = ScmiGetProtocolAttributes (SCMI_PROTOCOL_ID_BASE, &ReturnValues);
|
Status = ScmiGetProtocolAttributes (ScmiProtocolIdBase, &ReturnValues);
|
||||||
if (EFI_ERROR (Status)) {
|
if (EFI_ERROR (Status)) {
|
||||||
return Status;
|
return Status;
|
||||||
}
|
}
|
||||||
@@ -69,9 +69,9 @@ BaseGetTotalProtocols (
|
|||||||
|
|
||||||
/** Common function which returns vendor details.
|
/** Common function which returns vendor details.
|
||||||
|
|
||||||
@param[in] MessageId SCMI_MESSAGE_ID_BASE_DISCOVER_VENDOR
|
@param[in] MessageId ScmiMessageIdBaseDiscoverVendor
|
||||||
OR
|
OR
|
||||||
SCMI_MESSAGE_ID_BASE_DISCOVER_SUB_VENDOR
|
ScmiMessageIdBaseDiscoverSubVendor
|
||||||
|
|
||||||
@param[out] VendorIdentifier ASCII name of the vendor/subvendor.
|
@param[out] VendorIdentifier ASCII name of the vendor/subvendor.
|
||||||
|
|
||||||
@@ -91,7 +91,7 @@ BaseDiscoverVendorDetails (
|
|||||||
SCMI_COMMAND Cmd;
|
SCMI_COMMAND Cmd;
|
||||||
UINT32 PayloadLength;
|
UINT32 PayloadLength;
|
||||||
|
|
||||||
Cmd.ProtocolId = SCMI_PROTOCOL_ID_BASE;
|
Cmd.ProtocolId = ScmiProtocolIdBase;
|
||||||
Cmd.MessageId = MessageId;
|
Cmd.MessageId = MessageId;
|
||||||
|
|
||||||
PayloadLength = 0;
|
PayloadLength = 0;
|
||||||
@@ -133,7 +133,7 @@ BaseDiscoverVendor (
|
|||||||
)
|
)
|
||||||
{
|
{
|
||||||
return BaseDiscoverVendorDetails (
|
return BaseDiscoverVendorDetails (
|
||||||
SCMI_MESSAGE_ID_BASE_DISCOVER_VENDOR,
|
ScmiMessageIdBaseDiscoverVendor,
|
||||||
VendorIdentifier
|
VendorIdentifier
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@@ -156,7 +156,7 @@ BaseDiscoverSubVendor (
|
|||||||
)
|
)
|
||||||
{
|
{
|
||||||
return BaseDiscoverVendorDetails (
|
return BaseDiscoverVendorDetails (
|
||||||
SCMI_MESSAGE_ID_BASE_DISCOVER_SUB_VENDOR,
|
ScmiMessageIdBaseDiscoverSubVendor,
|
||||||
VendorIdentifier
|
VendorIdentifier
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@@ -183,8 +183,8 @@ BaseDiscoverImplVersion (
|
|||||||
SCMI_COMMAND Cmd;
|
SCMI_COMMAND Cmd;
|
||||||
UINT32 PayloadLength;
|
UINT32 PayloadLength;
|
||||||
|
|
||||||
Cmd.ProtocolId = SCMI_PROTOCOL_ID_BASE;
|
Cmd.ProtocolId = ScmiProtocolIdBase;
|
||||||
Cmd.MessageId = SCMI_MESSAGE_ID_BASE_DISCOVER_IMPLEMENTATION_VERSION;
|
Cmd.MessageId = ScmiMessageIdBaseDiscoverImplementationVersion;
|
||||||
|
|
||||||
PayloadLength = 0;
|
PayloadLength = 0;
|
||||||
|
|
||||||
@@ -250,8 +250,8 @@ BaseDiscoverListProtocols (
|
|||||||
return EFI_BUFFER_TOO_SMALL;
|
return EFI_BUFFER_TOO_SMALL;
|
||||||
}
|
}
|
||||||
|
|
||||||
Cmd.ProtocolId = SCMI_PROTOCOL_ID_BASE;
|
Cmd.ProtocolId = ScmiProtocolIdBase;
|
||||||
Cmd.MessageId = SCMI_MESSAGE_ID_BASE_DISCOVER_LIST_PROTOCOLS;
|
Cmd.MessageId = ScmiMessageIdBaseDiscoverListProtocols;
|
||||||
|
|
||||||
Skip = 0;
|
Skip = 0;
|
||||||
|
|
||||||
|
@@ -52,7 +52,7 @@ ClockGetVersion (
|
|||||||
OUT UINT32 *Version
|
OUT UINT32 *Version
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
return ScmiGetProtocolVersion (SCMI_PROTOCOL_ID_CLOCK, Version);
|
return ScmiGetProtocolVersion (ScmiProtocolIdClock, Version);
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Return total number of clock devices supported by the clock management
|
/** Return total number of clock devices supported by the clock management
|
||||||
@@ -76,7 +76,7 @@ ClockGetTotalClocks (
|
|||||||
EFI_STATUS Status;
|
EFI_STATUS Status;
|
||||||
UINT32 *ReturnValues;
|
UINT32 *ReturnValues;
|
||||||
|
|
||||||
Status = ScmiGetProtocolAttributes (SCMI_PROTOCOL_ID_CLOCK, &ReturnValues);
|
Status = ScmiGetProtocolAttributes (ScmiProtocolIdClock, &ReturnValues);
|
||||||
if (EFI_ERROR (Status)) {
|
if (EFI_ERROR (Status)) {
|
||||||
return Status;
|
return Status;
|
||||||
}
|
}
|
||||||
@@ -122,8 +122,8 @@ ClockGetClockAttributes (
|
|||||||
|
|
||||||
*MessageParams = ClockId;
|
*MessageParams = ClockId;
|
||||||
|
|
||||||
Cmd.ProtocolId = SCMI_PROTOCOL_ID_CLOCK;
|
Cmd.ProtocolId = ScmiProtocolIdClock;
|
||||||
Cmd.MessageId = SCMI_MESSAGE_ID_CLOCK_ATTRIBUTES;
|
Cmd.MessageId = ScmiMessageIdClockAttributes;
|
||||||
|
|
||||||
PayloadLength = sizeof (ClockId);
|
PayloadLength = sizeof (ClockId);
|
||||||
|
|
||||||
@@ -152,10 +152,10 @@ ClockGetClockAttributes (
|
|||||||
@param[in] This A pointer to SCMI_CLOCK_PROTOCOL Instance.
|
@param[in] This A pointer to SCMI_CLOCK_PROTOCOL Instance.
|
||||||
@param[in] ClockId Identifier for the clock device.
|
@param[in] ClockId Identifier for the clock device.
|
||||||
|
|
||||||
@param[out] Format SCMI_CLOCK_RATE_FORMAT_DISCRETE: Clock device
|
@param[out] Format ScmiClockRateFormatDiscrete: Clock device
|
||||||
supports range of clock rates which are non-linear.
|
supports range of clock rates which are non-linear.
|
||||||
|
|
||||||
SCMI_CLOCK_RATE_FORMAT_LINEAR: Clock device supports
|
ScmiClockRateFormatLinear: Clock device supports
|
||||||
range of linear clock rates from Min to Max in steps.
|
range of linear clock rates from Min to Max in steps.
|
||||||
|
|
||||||
@param[out] TotalRates Total number of rates.
|
@param[out] TotalRates Total number of rates.
|
||||||
@@ -203,8 +203,8 @@ ClockDescribeRates (
|
|||||||
return Status;
|
return Status;
|
||||||
}
|
}
|
||||||
|
|
||||||
Cmd.ProtocolId = SCMI_PROTOCOL_ID_CLOCK;
|
Cmd.ProtocolId = ScmiProtocolIdClock;
|
||||||
Cmd.MessageId = SCMI_MESSAGE_ID_CLOCK_DESCRIBE_RATES;
|
Cmd.MessageId = ScmiMessageIdClockDescribeRates;
|
||||||
|
|
||||||
*MessageParams++ = ClockId;
|
*MessageParams++ = ClockId;
|
||||||
|
|
||||||
@@ -236,7 +236,7 @@ ClockDescribeRates (
|
|||||||
*TotalRates = NUM_RATES (DescribeRates->NumRatesFlags)
|
*TotalRates = NUM_RATES (DescribeRates->NumRatesFlags)
|
||||||
+ NUM_REMAIN_RATES (DescribeRates->NumRatesFlags);
|
+ NUM_REMAIN_RATES (DescribeRates->NumRatesFlags);
|
||||||
|
|
||||||
if (*Format == SCMI_CLOCK_RATE_FORMAT_DISCRETE) {
|
if (*Format == ScmiClockRateFormatDiscrete) {
|
||||||
RequiredArraySize = (*TotalRates) * sizeof (UINT64);
|
RequiredArraySize = (*TotalRates) * sizeof (UINT64);
|
||||||
} else {
|
} else {
|
||||||
// We need to return triplet of 64 bit value for each rate
|
// We need to return triplet of 64 bit value for each rate
|
||||||
@@ -251,26 +251,30 @@ ClockDescribeRates (
|
|||||||
|
|
||||||
RateOffset = 0;
|
RateOffset = 0;
|
||||||
|
|
||||||
if (*Format == SCMI_CLOCK_RATE_FORMAT_DISCRETE) {
|
if (*Format == ScmiClockRateFormatDiscrete) {
|
||||||
for (RateNo = 0; RateNo < NUM_RATES (DescribeRates->NumRatesFlags); RateNo++) {
|
for (RateNo = 0; RateNo < NUM_RATES (DescribeRates->NumRatesFlags); RateNo++) {
|
||||||
Rate = &DescribeRates->Rates[RateOffset++];
|
Rate = &DescribeRates->Rates[RateOffset++];
|
||||||
// Non-linear discrete rates.
|
// Non-linear discrete rates.
|
||||||
RateArray[RateIndex++].Rate = ConvertTo64Bit (Rate->Low, Rate->High);
|
RateArray[RateIndex++].DiscreteRate.Rate =
|
||||||
|
ConvertTo64Bit (Rate->Low, Rate->High);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
for (RateNo = 0; RateNo < NUM_RATES (DescribeRates->NumRatesFlags); RateNo++) {
|
for (RateNo = 0; RateNo < NUM_RATES (DescribeRates->NumRatesFlags); RateNo++) {
|
||||||
// Linear clock rates from minimum to maximum in steps
|
// Linear clock rates from minimum to maximum in steps
|
||||||
// Minimum clock rate.
|
// Minimum clock rate.
|
||||||
Rate = &DescribeRates->Rates[RateOffset++];
|
Rate = &DescribeRates->Rates[RateOffset++];
|
||||||
RateArray[RateIndex].Min = ConvertTo64Bit (Rate->Low, Rate->High);
|
RateArray[RateIndex].ContinuousRate.Min =
|
||||||
|
ConvertTo64Bit (Rate->Low, Rate->High);
|
||||||
|
|
||||||
Rate = &DescribeRates->Rates[RateOffset++];
|
Rate = &DescribeRates->Rates[RateOffset++];
|
||||||
// Maximum clock rate.
|
// Maximum clock rate.
|
||||||
RateArray[RateIndex].Max = ConvertTo64Bit (Rate->Low, Rate->High);
|
RateArray[RateIndex].ContinuousRate.Max =
|
||||||
|
ConvertTo64Bit (Rate->Low, Rate->High);
|
||||||
|
|
||||||
Rate = &DescribeRates->Rates[RateOffset++];
|
Rate = &DescribeRates->Rates[RateOffset++];
|
||||||
// Step.
|
// Step.
|
||||||
RateArray[RateIndex++].Step = ConvertTo64Bit (Rate->Low, Rate->High);
|
RateArray[RateIndex++].ContinuousRate.Step =
|
||||||
|
ConvertTo64Bit (Rate->Low, Rate->High);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} while (NUM_REMAIN_RATES (DescribeRates->NumRatesFlags) != 0);
|
} while (NUM_REMAIN_RATES (DescribeRates->NumRatesFlags) != 0);
|
||||||
@@ -316,8 +320,8 @@ ClockRateGet (
|
|||||||
// Fill arguments for clock protocol command.
|
// Fill arguments for clock protocol command.
|
||||||
*MessageParams = ClockId;
|
*MessageParams = ClockId;
|
||||||
|
|
||||||
Cmd.ProtocolId = SCMI_PROTOCOL_ID_CLOCK;
|
Cmd.ProtocolId = ScmiProtocolIdClock;
|
||||||
Cmd.MessageId = SCMI_MESSAGE_ID_CLOCK_RATE_GET;
|
Cmd.MessageId = ScmiMessageIdClockRateGet;
|
||||||
|
|
||||||
PayloadLength = sizeof (ClockId);
|
PayloadLength = sizeof (ClockId);
|
||||||
|
|
||||||
@@ -370,8 +374,8 @@ ClockRateSet (
|
|||||||
ClockRateSetAttributes->Rate.Low = (UINT32)Rate;
|
ClockRateSetAttributes->Rate.Low = (UINT32)Rate;
|
||||||
ClockRateSetAttributes->Rate.High = (UINT32)(Rate >> 32);
|
ClockRateSetAttributes->Rate.High = (UINT32)(Rate >> 32);
|
||||||
|
|
||||||
Cmd.ProtocolId = SCMI_PROTOCOL_ID_CLOCK;
|
Cmd.ProtocolId = ScmiProtocolIdClock;
|
||||||
Cmd.MessageId = SCMI_MESSAGE_ID_CLOCK_RATE_SET;
|
Cmd.MessageId = ScmiMessageIdClockRateSet;
|
||||||
|
|
||||||
PayloadLength = sizeof (CLOCK_RATE_SET_ATTRIBUTES);
|
PayloadLength = sizeof (CLOCK_RATE_SET_ATTRIBUTES);
|
||||||
|
|
||||||
@@ -417,8 +421,8 @@ ClockEnable (
|
|||||||
ClockConfigSetAttributes->ClockId = ClockId;
|
ClockConfigSetAttributes->ClockId = ClockId;
|
||||||
ClockConfigSetAttributes->Attributes = Enable ? BIT0 : 0;
|
ClockConfigSetAttributes->Attributes = Enable ? BIT0 : 0;
|
||||||
|
|
||||||
Cmd.ProtocolId = SCMI_PROTOCOL_ID_CLOCK;
|
Cmd.ProtocolId = ScmiProtocolIdClock;
|
||||||
Cmd.MessageId = SCMI_MESSAGE_ID_CLOCK_CONFIG_SET;
|
Cmd.MessageId = ScmiMessageIdClockConfigSet;
|
||||||
|
|
||||||
PayloadLength = sizeof (CLOCK_CONFIG_SET_ATTRIBUTES);
|
PayloadLength = sizeof (CLOCK_CONFIG_SET_ATTRIBUTES);
|
||||||
|
|
||||||
|
@@ -1,12 +1,12 @@
|
|||||||
/** @file
|
/** @file
|
||||||
|
|
||||||
Copyright (c) 2017-2018, Arm Limited. All rights reserved.
|
Copyright (c) 2017-2021, Arm Limited. All rights reserved.<BR>
|
||||||
|
|
||||||
SPDX-License-Identifier: BSD-2-Clause-Patent
|
SPDX-License-Identifier: BSD-2-Clause-Patent
|
||||||
|
|
||||||
System Control and Management Interface V1.0
|
@par Specification Reference:
|
||||||
http://infocenter.arm.com/help/topic/com.arm.doc.den0056a/
|
- Arm System Control and Management Interface - Platform Design Document
|
||||||
DEN0056A_System_Control_and_Management_Interface.pdf
|
(https://developer.arm.com/documentation/den0056/)
|
||||||
**/
|
**/
|
||||||
|
|
||||||
#include <Base.h>
|
#include <Base.h>
|
||||||
@@ -24,9 +24,9 @@
|
|||||||
#include "ScmiPrivate.h"
|
#include "ScmiPrivate.h"
|
||||||
|
|
||||||
STATIC CONST SCMI_PROTOCOL_ENTRY Protocols[] = {
|
STATIC CONST SCMI_PROTOCOL_ENTRY Protocols[] = {
|
||||||
{ SCMI_PROTOCOL_ID_BASE, ScmiBaseProtocolInit },
|
{ ScmiProtocolIdBase, ScmiBaseProtocolInit },
|
||||||
{ SCMI_PROTOCOL_ID_PERFORMANCE, ScmiPerformanceProtocolInit },
|
{ ScmiProtocolIdPerformance, ScmiPerformanceProtocolInit },
|
||||||
{ SCMI_PROTOCOL_ID_CLOCK, ScmiClockProtocolInit }
|
{ ScmiProtocolIdClock, ScmiClockProtocolInit }
|
||||||
};
|
};
|
||||||
|
|
||||||
/** ARM SCMI driver entry point function.
|
/** ARM SCMI driver entry point function.
|
||||||
@@ -61,7 +61,7 @@ ArmScmiDxeEntryPoint (
|
|||||||
UINT32 SupportedListSize;
|
UINT32 SupportedListSize;
|
||||||
|
|
||||||
// Every SCMI implementation must implement the base protocol.
|
// Every SCMI implementation must implement the base protocol.
|
||||||
ASSERT (Protocols[0].Id == SCMI_PROTOCOL_ID_BASE);
|
ASSERT (Protocols[0].Id == ScmiProtocolIdBase);
|
||||||
|
|
||||||
Status = ScmiBaseProtocolInit (&ImageHandle);
|
Status = ScmiBaseProtocolInit (&ImageHandle);
|
||||||
if (EFI_ERROR (Status)) {
|
if (EFI_ERROR (Status)) {
|
||||||
@@ -86,7 +86,9 @@ ArmScmiDxeEntryPoint (
|
|||||||
return Status;
|
return Status;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (Version != BASE_PROTOCOL_VERSION) {
|
// Accept any version between SCMI v1.0 and SCMI v2.0
|
||||||
|
if ((Version < BASE_PROTOCOL_VERSION_V1) ||
|
||||||
|
(Version > BASE_PROTOCOL_VERSION_V2)) {
|
||||||
ASSERT (FALSE);
|
ASSERT (FALSE);
|
||||||
return EFI_UNSUPPORTED;
|
return EFI_UNSUPPORTED;
|
||||||
}
|
}
|
||||||
|
@@ -1,6 +1,6 @@
|
|||||||
/** @file
|
/** @file
|
||||||
|
|
||||||
Copyright (c) 2017-2018, Arm Limited. All rights reserved.
|
Copyright (c) 2017-2021, Arm Limited. All rights reserved.<BR>
|
||||||
|
|
||||||
SPDX-License-Identifier: BSD-2-Clause-Patent
|
SPDX-License-Identifier: BSD-2-Clause-Patent
|
||||||
|
|
||||||
@@ -35,7 +35,7 @@ PerformanceGetVersion (
|
|||||||
OUT UINT32 *Version
|
OUT UINT32 *Version
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
return ScmiGetProtocolVersion (SCMI_PROTOCOL_ID_PERFORMANCE, Version);
|
return ScmiGetProtocolVersion (ScmiProtocolIdPerformance, Version);
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Return protocol attributes of the performance management protocol.
|
/** Return protocol attributes of the performance management protocol.
|
||||||
@@ -59,7 +59,7 @@ PerformanceGetAttributes (
|
|||||||
UINT32* ReturnValues;
|
UINT32* ReturnValues;
|
||||||
|
|
||||||
Status = ScmiGetProtocolAttributes (
|
Status = ScmiGetProtocolAttributes (
|
||||||
SCMI_PROTOCOL_ID_PERFORMANCE,
|
ScmiProtocolIdPerformance,
|
||||||
&ReturnValues
|
&ReturnValues
|
||||||
);
|
);
|
||||||
if (EFI_ERROR (Status)) {
|
if (EFI_ERROR (Status)) {
|
||||||
@@ -107,8 +107,8 @@ PerformanceDomainAttributes (
|
|||||||
|
|
||||||
*MessageParams = DomainId;
|
*MessageParams = DomainId;
|
||||||
|
|
||||||
Cmd.ProtocolId = SCMI_PROTOCOL_ID_PERFORMANCE;
|
Cmd.ProtocolId = ScmiProtocolIdPerformance;
|
||||||
Cmd.MessageId = SCMI_MESSAGE_ID_PERFORMANCE_DOMAIN_ATTRIBUTES;
|
Cmd.MessageId = ScmiMessageIdPerformanceDomainAttributes;
|
||||||
|
|
||||||
PayloadLength = sizeof (DomainId);
|
PayloadLength = sizeof (DomainId);
|
||||||
|
|
||||||
@@ -179,8 +179,8 @@ PerformanceDescribeLevels (
|
|||||||
|
|
||||||
*MessageParams++ = DomainId;
|
*MessageParams++ = DomainId;
|
||||||
|
|
||||||
Cmd.ProtocolId = SCMI_PROTOCOL_ID_PERFORMANCE;
|
Cmd.ProtocolId = ScmiProtocolIdPerformance;
|
||||||
Cmd.MessageId = SCMI_MESSAGE_ID_PERFORMANCE_DESCRIBE_LEVELS;
|
Cmd.MessageId = ScmiMessageIdPerformanceDescribeLevels;
|
||||||
|
|
||||||
do {
|
do {
|
||||||
|
|
||||||
@@ -258,8 +258,8 @@ PerformanceLimitsSet (
|
|||||||
*MessageParams++ = Limits->RangeMax;
|
*MessageParams++ = Limits->RangeMax;
|
||||||
*MessageParams = Limits->RangeMin;
|
*MessageParams = Limits->RangeMin;
|
||||||
|
|
||||||
Cmd.ProtocolId = SCMI_PROTOCOL_ID_PERFORMANCE;
|
Cmd.ProtocolId = ScmiProtocolIdPerformance;
|
||||||
Cmd.MessageId = SCMI_MESSAGE_ID_PERFORMANCE_LIMITS_SET;
|
Cmd.MessageId = ScmiMessageIdPerformanceLimitsSet;
|
||||||
|
|
||||||
PayloadLength = sizeof (DomainId) + sizeof (SCMI_PERFORMANCE_LIMITS);
|
PayloadLength = sizeof (DomainId) + sizeof (SCMI_PERFORMANCE_LIMITS);
|
||||||
|
|
||||||
@@ -304,8 +304,8 @@ PerformanceLimitsGet (
|
|||||||
|
|
||||||
*MessageParams = DomainId;
|
*MessageParams = DomainId;
|
||||||
|
|
||||||
Cmd.ProtocolId = SCMI_PROTOCOL_ID_PERFORMANCE;
|
Cmd.ProtocolId = ScmiProtocolIdPerformance;
|
||||||
Cmd.MessageId = SCMI_MESSAGE_ID_PERFORMANCE_LIMITS_GET;
|
Cmd.MessageId = ScmiMessageIdPerformanceLimitsGet;
|
||||||
|
|
||||||
PayloadLength = sizeof (DomainId);
|
PayloadLength = sizeof (DomainId);
|
||||||
|
|
||||||
@@ -354,8 +354,8 @@ PerformanceLevelSet (
|
|||||||
*MessageParams++ = DomainId;
|
*MessageParams++ = DomainId;
|
||||||
*MessageParams = Level;
|
*MessageParams = Level;
|
||||||
|
|
||||||
Cmd.ProtocolId = SCMI_PROTOCOL_ID_PERFORMANCE;
|
Cmd.ProtocolId = ScmiProtocolIdPerformance;
|
||||||
Cmd.MessageId = SCMI_MESSAGE_ID_PERFORMANCE_LEVEL_SET;
|
Cmd.MessageId = ScmiMessageIdPerformanceLevelSet;
|
||||||
|
|
||||||
PayloadLength = sizeof (DomainId) + sizeof (Level);
|
PayloadLength = sizeof (DomainId) + sizeof (Level);
|
||||||
|
|
||||||
@@ -399,8 +399,8 @@ PerformanceLevelGet (
|
|||||||
|
|
||||||
*MessageParams = DomainId;
|
*MessageParams = DomainId;
|
||||||
|
|
||||||
Cmd.ProtocolId = SCMI_PROTOCOL_ID_PERFORMANCE;
|
Cmd.ProtocolId = ScmiProtocolIdPerformance;
|
||||||
Cmd.MessageId = SCMI_MESSAGE_ID_PERFORMANCE_LEVEL_GET;
|
Cmd.MessageId = ScmiMessageIdPerformanceLevelGet;
|
||||||
|
|
||||||
PayloadLength = sizeof (DomainId);
|
PayloadLength = sizeof (DomainId);
|
||||||
|
|
||||||
|
@@ -1,6 +1,6 @@
|
|||||||
/** @file
|
/** @file
|
||||||
|
|
||||||
Copyright (c) 2017-2018, Arm Limited. All rights reserved.
|
Copyright (c) 2017-2021, Arm Limited. All rights reserved.<BR>
|
||||||
|
|
||||||
SPDX-License-Identifier: BSD-2-Clause-Patent
|
SPDX-License-Identifier: BSD-2-Clause-Patent
|
||||||
|
|
||||||
@@ -13,41 +13,41 @@
|
|||||||
|
|
||||||
// SCMI protocol IDs.
|
// SCMI protocol IDs.
|
||||||
typedef enum {
|
typedef enum {
|
||||||
SCMI_PROTOCOL_ID_BASE = 0x10,
|
ScmiProtocolIdBase = 0x10,
|
||||||
SCMI_PROTOCOL_ID_POWER_DOMAIN = 0x11,
|
ScmiProtocolIdPowerDomain = 0x11,
|
||||||
SCMI_PROTOCOL_ID_SYSTEM_POWER = 0x12,
|
ScmiProtocolIdSystemPower = 0x12,
|
||||||
SCMI_PROTOCOL_ID_PERFORMANCE = 0x13,
|
ScmiProtocolIdPerformance = 0x13,
|
||||||
SCMI_PROTOCOL_ID_CLOCK = 0x14,
|
ScmiProtocolIdClock = 0x14,
|
||||||
SCMI_PROTOCOL_ID_SENSOR = 0x15
|
ScmiProtocolIdSensor = 0x15
|
||||||
} SCMI_PROTOCOL_ID;
|
} SCMI_PROTOCOL_ID;
|
||||||
|
|
||||||
// SCMI message types.
|
// SCMI message types.
|
||||||
typedef enum {
|
typedef enum {
|
||||||
SCMI_MESSAGE_TYPE_COMMAND = 0,
|
ScmiMessageTypeCommand = 0,
|
||||||
SCMI_MESSAGE_TYPE_DELAYED_RESPONSE = 2, // Skipping 1 is deliberate.
|
ScmiMessageTypeDelayedResponse = 2, // Skipping 1 is deliberate.
|
||||||
SCMI_MESSAGE_TYPE_NOTIFICATION = 3
|
ScmiMessageTypeNotification = 3
|
||||||
} SCMI_MESSAGE_TYPE;
|
} SCMI_MESSAGE_TYPE;
|
||||||
|
|
||||||
// SCMI response error codes.
|
// SCMI response error codes.
|
||||||
typedef enum {
|
typedef enum {
|
||||||
SCMI_SUCCESS = 0,
|
ScmiSuccess = 0,
|
||||||
SCMI_NOT_SUPPORTED = -1,
|
ScmiNotSupported = -1,
|
||||||
SCMI_INVALID_PARAMETERS = -2,
|
ScmiInvalidParameters = -2,
|
||||||
SCMI_DENIED = -3,
|
ScmiDenied = -3,
|
||||||
SCMI_NOT_FOUND = -4,
|
ScmiNotFound = -4,
|
||||||
SCMI_OUT_OF_RANGE = -5,
|
ScmiOutOfRange = -5,
|
||||||
SCMI_BUSY = -6,
|
ScmiBusy = -6,
|
||||||
SCMI_COMMS_ERROR = -7,
|
ScmiCommsError = -7,
|
||||||
SCMI_GENERIC_ERROR = -8,
|
ScmiGenericError = -8,
|
||||||
SCMI_HARDWARE_ERROR = -9,
|
ScmiHardwareError = -9,
|
||||||
SCMI_PROTOCOL_ERROR = -10
|
ScmiProtocolError = -10
|
||||||
} SCMI_STATUS;
|
} SCMI_STATUS;
|
||||||
|
|
||||||
// SCMI message IDs common to all protocols.
|
// SCMI message IDs common to all protocols.
|
||||||
typedef enum {
|
typedef enum {
|
||||||
SCMI_MESSAGE_ID_PROTOCOL_VERSION = 0x0,
|
ScmiMessageIdProtocolVersion = 0x0,
|
||||||
SCMI_MESSAGE_ID_PROTOCOL_ATTRIBUTES = 0x1,
|
ScmiMessageIdProtocolAttributes = 0x1,
|
||||||
SCMI_MESSAGE_ID_PROTOCOL_MESSAGE_ATTRIBUTES = 0x2
|
ScmiMessageIdProtocolMessageAttributes = 0x2
|
||||||
} SCMI_MESSAGE_ID;
|
} SCMI_MESSAGE_ID;
|
||||||
|
|
||||||
// Not defined in SCMI specification but will help to identify a message.
|
// Not defined in SCMI specification but will help to identify a message.
|
||||||
|
@@ -345,7 +345,7 @@ EfiAttributeToArmAttribute (
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case EFI_MEMORY_WC:
|
case EFI_MEMORY_WC:
|
||||||
// Map to normal non-cachable
|
// Map to normal non-cacheable
|
||||||
ArmAttributes = TT_DESCRIPTOR_SECTION_CACHE_POLICY_NON_CACHEABLE; // TEX [2:0]= 001 = 0x2, B=0, C=0
|
ArmAttributes = TT_DESCRIPTOR_SECTION_CACHE_POLICY_NON_CACHEABLE; // TEX [2:0]= 001 = 0x2, B=0, C=0
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
@@ -7,8 +7,8 @@
|
|||||||
|
|
||||||
**/
|
**/
|
||||||
|
|
||||||
#ifndef __CPU_DXE_ARM_EXCEPTION_H__
|
#ifndef CPU_DXE_H_
|
||||||
#define __CPU_DXE_ARM_EXCEPTION_H__
|
#define CPU_DXE_H_
|
||||||
|
|
||||||
#include <Uefi.h>
|
#include <Uefi.h>
|
||||||
|
|
||||||
@@ -143,4 +143,4 @@ SetGcdMemorySpaceAttributes (
|
|||||||
IN UINT64 Attributes
|
IN UINT64 Attributes
|
||||||
);
|
);
|
||||||
|
|
||||||
#endif // __CPU_DXE_ARM_EXCEPTION_H__
|
#endif // CPU_DXE_H_
|
||||||
|
@@ -1,6 +1,6 @@
|
|||||||
/** @file
|
/** @file
|
||||||
*
|
*
|
||||||
* Copyright (c) 2011-2014, ARM Limited. All rights reserved.
|
* Copyright (c) 2011-2021, Arm Limited. All rights reserved.<BR>
|
||||||
*
|
*
|
||||||
* SPDX-License-Identifier: BSD-2-Clause-Patent
|
* SPDX-License-Identifier: BSD-2-Clause-Patent
|
||||||
*
|
*
|
||||||
@@ -32,7 +32,7 @@ ARM_PROCESSOR_TABLE mArmProcessorTableTemplate = {
|
|||||||
};
|
};
|
||||||
|
|
||||||
/** Publish ARM Processor Data table in UEFI SYSTEM Table.
|
/** Publish ARM Processor Data table in UEFI SYSTEM Table.
|
||||||
* @param: HobStart Pointer to the beginning of the HOB List from PEI.
|
* @param HobStart Pointer to the beginning of the HOB List from PEI.
|
||||||
*
|
*
|
||||||
* Description : This function iterates through HOB list and finds ARM processor Table Entry HOB.
|
* Description : This function iterates through HOB list and finds ARM processor Table Entry HOB.
|
||||||
* If the ARM processor Table Entry HOB is found, the HOB data is copied to run-time memory
|
* If the ARM processor Table Entry HOB is found, the HOB data is copied to run-time memory
|
||||||
|
@@ -5,8 +5,8 @@
|
|||||||
* SPDX-License-Identifier: BSD-2-Clause-Patent
|
* SPDX-License-Identifier: BSD-2-Clause-Patent
|
||||||
*
|
*
|
||||||
**/
|
**/
|
||||||
#ifndef __GENERIC_WATCHDOG_H__
|
#ifndef GENERIC_WATCHDOG_H_
|
||||||
#define __GENERIC_WATCHDOG_H__
|
#define GENERIC_WATCHDOG_H_
|
||||||
|
|
||||||
// Refresh Frame:
|
// Refresh Frame:
|
||||||
#define GENERIC_WDOG_REFRESH_REG ((UINTN)FixedPcdGet64 (PcdGenericWatchdogRefreshBase) + 0x000)
|
#define GENERIC_WDOG_REFRESH_REG ((UINTN)FixedPcdGet64 (PcdGenericWatchdogRefreshBase) + 0x000)
|
||||||
@@ -21,4 +21,4 @@
|
|||||||
#define GENERIC_WDOG_ENABLED 1
|
#define GENERIC_WDOG_ENABLED 1
|
||||||
#define GENERIC_WDOG_DISABLED 0
|
#define GENERIC_WDOG_DISABLED 0
|
||||||
|
|
||||||
#endif // __GENERIC_WATCHDOG_H__
|
#endif // GENERIC_WATCHDOG_H_
|
||||||
|
@@ -1,5 +1,5 @@
|
|||||||
#
|
#
|
||||||
# Copyright (c) 2013-2017, ARM Limited. All rights reserved.
|
# Copyright (c) 2013-2021, Arm Limited. All rights reserved.<BR>
|
||||||
#
|
#
|
||||||
# SPDX-License-Identifier: BSD-2-Clause-Patent
|
# SPDX-License-Identifier: BSD-2-Clause-Patent
|
||||||
#
|
#
|
||||||
@@ -13,6 +13,7 @@
|
|||||||
ENTRY_POINT = GenericWatchdogEntry
|
ENTRY_POINT = GenericWatchdogEntry
|
||||||
|
|
||||||
[Sources.common]
|
[Sources.common]
|
||||||
|
GenericWatchdog.h
|
||||||
GenericWatchdogDxe.c
|
GenericWatchdogDxe.c
|
||||||
|
|
||||||
[Packages]
|
[Packages]
|
||||||
|
@@ -1,13 +1,13 @@
|
|||||||
/** @file
|
/** @file
|
||||||
|
|
||||||
Copyright (c) 2016-2018, ARM Limited. All rights reserved.
|
Copyright (c) 2016-2021, Arm Limited. All rights reserved.<BR>
|
||||||
|
|
||||||
SPDX-License-Identifier: BSD-2-Clause-Patent
|
SPDX-License-Identifier: BSD-2-Clause-Patent
|
||||||
|
|
||||||
**/
|
**/
|
||||||
|
|
||||||
#if !defined _MM_COMMUNICATE_H_
|
#ifndef MM_COMMUNICATE_H_
|
||||||
#define _MM_COMMUNICATE_H_
|
#define MM_COMMUNICATE_H_
|
||||||
|
|
||||||
#define MM_MAJOR_VER_MASK 0xEFFF0000
|
#define MM_MAJOR_VER_MASK 0xEFFF0000
|
||||||
#define MM_MINOR_VER_MASK 0x0000FFFF
|
#define MM_MINOR_VER_MASK 0x0000FFFF
|
||||||
@@ -19,4 +19,4 @@
|
|||||||
#define MM_CALLER_MAJOR_VER 0x1UL
|
#define MM_CALLER_MAJOR_VER 0x1UL
|
||||||
#define MM_CALLER_MINOR_VER 0x0
|
#define MM_CALLER_MINOR_VER 0x0
|
||||||
|
|
||||||
#endif /* _MM_COMMUNICATE_H_ */
|
#endif /* MM_COMMUNICATE_H_ */
|
||||||
|
@@ -2,7 +2,7 @@
|
|||||||
#
|
#
|
||||||
# DXE MM Communicate driver
|
# DXE MM Communicate driver
|
||||||
#
|
#
|
||||||
# Copyright (c) 2016 - 2019, ARM Limited. All rights reserved.
|
# Copyright (c) 2016 - 2021, Arm Limited. All rights reserved.<BR>
|
||||||
#
|
#
|
||||||
# SPDX-License-Identifier: BSD-2-Clause-Patent
|
# SPDX-License-Identifier: BSD-2-Clause-Patent
|
||||||
#
|
#
|
||||||
@@ -24,6 +24,7 @@
|
|||||||
#
|
#
|
||||||
|
|
||||||
[Sources.AARCH64]
|
[Sources.AARCH64]
|
||||||
|
MmCommunicate.h
|
||||||
MmCommunication.c
|
MmCommunication.c
|
||||||
|
|
||||||
[Packages]
|
[Packages]
|
||||||
|
@@ -51,7 +51,7 @@ EFI_FILE gSemihostFsFile = {
|
|||||||
};
|
};
|
||||||
|
|
||||||
//
|
//
|
||||||
// Device path for semi-hosting. It contains our autogened Caller ID GUID.
|
// Device path for semi-hosting. It contains our auto-generated Caller ID GUID.
|
||||||
//
|
//
|
||||||
typedef struct {
|
typedef struct {
|
||||||
VENDOR_DEVICE_PATH Guid;
|
VENDOR_DEVICE_PATH Guid;
|
||||||
|
@@ -7,8 +7,8 @@
|
|||||||
|
|
||||||
**/
|
**/
|
||||||
|
|
||||||
#ifndef __SEMIHOST_FS_H__
|
#ifndef SEMIHOST_FS_H_
|
||||||
#define __SEMIHOST_FS_H__
|
#define SEMIHOST_FS_H_
|
||||||
|
|
||||||
EFI_STATUS
|
EFI_STATUS
|
||||||
VolumeOpen (
|
VolumeOpen (
|
||||||
@@ -242,5 +242,5 @@ FileFlush (
|
|||||||
IN EFI_FILE *File
|
IN EFI_FILE *File
|
||||||
);
|
);
|
||||||
|
|
||||||
#endif // __SEMIHOST_FS_H__
|
#endif // SEMIHOST_FS_H_
|
||||||
|
|
||||||
|
@@ -10,8 +10,8 @@
|
|||||||
**/
|
**/
|
||||||
|
|
||||||
|
|
||||||
#ifndef __MACRO_IO_LIB_H__
|
#ifndef ASM_MACRO_IO_LIB_H_
|
||||||
#define __MACRO_IO_LIB_H__
|
#define ASM_MACRO_IO_LIB_H_
|
||||||
|
|
||||||
#define _ASM_FUNC(Name, Section) \
|
#define _ASM_FUNC(Name, Section) \
|
||||||
.global Name ; \
|
.global Name ; \
|
||||||
@@ -36,4 +36,4 @@
|
|||||||
movt Reg, #:upper16:(Sym) - (. + 12) ; \
|
movt Reg, #:upper16:(Sym) - (. + 12) ; \
|
||||||
ldr Reg, [pc, Reg]
|
ldr Reg, [pc, Reg]
|
||||||
|
|
||||||
#endif
|
#endif // ASM_MACRO_IO_LIB_H_
|
||||||
|
@@ -10,8 +10,8 @@
|
|||||||
**/
|
**/
|
||||||
|
|
||||||
|
|
||||||
#ifndef __MACRO_IO_LIBV8_H__
|
#ifndef ASM_MACRO_IO_LIBV8_H_
|
||||||
#define __MACRO_IO_LIBV8_H__
|
#define ASM_MACRO_IO_LIBV8_H_
|
||||||
|
|
||||||
// CurrentEL : 0xC = EL3; 8 = EL2; 4 = EL1
|
// CurrentEL : 0xC = EL3; 8 = EL2; 4 = EL1
|
||||||
// This only selects between EL1 and EL2, else we die.
|
// This only selects between EL1 and EL2, else we die.
|
||||||
@@ -54,4 +54,4 @@
|
|||||||
movk Reg, ((Val) >> 16) & 0xffff, lsl #16 ; \
|
movk Reg, ((Val) >> 16) & 0xffff, lsl #16 ; \
|
||||||
movk Reg, (Val) & 0xffff
|
movk Reg, (Val) & 0xffff
|
||||||
|
|
||||||
#endif // __MACRO_IO_LIBV8_H__
|
#endif // ASM_MACRO_IO_LIBV8_H_
|
||||||
|
@@ -1,14 +1,14 @@
|
|||||||
/** @file
|
/** @file
|
||||||
|
|
||||||
Copyright (c) 2008 - 2009, Apple Inc. All rights reserved.<BR>
|
Copyright (c) 2008 - 2009, Apple Inc. All rights reserved.<BR>
|
||||||
Copyright (c) 2011 - 2017, ARM Ltd. All rights reserved.<BR>
|
Copyright (c) 2011 - 2021, Arm Limited. All rights reserved.<BR>
|
||||||
|
|
||||||
SPDX-License-Identifier: BSD-2-Clause-Patent
|
SPDX-License-Identifier: BSD-2-Clause-Patent
|
||||||
|
|
||||||
**/
|
**/
|
||||||
|
|
||||||
#ifndef __AARCH64_H__
|
#ifndef AARCH64_H_
|
||||||
#define __AARCH64_H__
|
#define AARCH64_H_
|
||||||
|
|
||||||
#include <Chipset/AArch64Mmu.h>
|
#include <Chipset/AArch64Mmu.h>
|
||||||
|
|
||||||
@@ -39,7 +39,7 @@
|
|||||||
// MIDR - Main ID Register definitions
|
// MIDR - Main ID Register definitions
|
||||||
#define ARM_CPU_TYPE_SHIFT 4
|
#define ARM_CPU_TYPE_SHIFT 4
|
||||||
#define ARM_CPU_TYPE_MASK 0xFFF
|
#define ARM_CPU_TYPE_MASK 0xFFF
|
||||||
#define ARM_CPU_TYPE_AEMv8 0xD0F
|
#define ARM_CPU_TYPE_AEMV8 0xD0F
|
||||||
#define ARM_CPU_TYPE_A53 0xD03
|
#define ARM_CPU_TYPE_A53 0xD03
|
||||||
#define ARM_CPU_TYPE_A57 0xD07
|
#define ARM_CPU_TYPE_A57 0xD07
|
||||||
#define ARM_CPU_TYPE_A72 0xD08
|
#define ARM_CPU_TYPE_A72 0xD08
|
||||||
@@ -97,10 +97,10 @@
|
|||||||
#define ARM_VECTOR_CUR_SP0_FIQ 0x100
|
#define ARM_VECTOR_CUR_SP0_FIQ 0x100
|
||||||
#define ARM_VECTOR_CUR_SP0_SERR 0x180
|
#define ARM_VECTOR_CUR_SP0_SERR 0x180
|
||||||
|
|
||||||
#define ARM_VECTOR_CUR_SPx_SYNC 0x200
|
#define ARM_VECTOR_CUR_SPX_SYNC 0x200
|
||||||
#define ARM_VECTOR_CUR_SPx_IRQ 0x280
|
#define ARM_VECTOR_CUR_SPX_IRQ 0x280
|
||||||
#define ARM_VECTOR_CUR_SPx_FIQ 0x300
|
#define ARM_VECTOR_CUR_SPX_FIQ 0x300
|
||||||
#define ARM_VECTOR_CUR_SPx_SERR 0x380
|
#define ARM_VECTOR_CUR_SPX_SERR 0x380
|
||||||
|
|
||||||
#define ARM_VECTOR_LOW_A64_SYNC 0x400
|
#define ARM_VECTOR_LOW_A64_SYNC 0x400
|
||||||
#define ARM_VECTOR_LOW_A64_IRQ 0x480
|
#define ARM_VECTOR_LOW_A64_IRQ 0x480
|
||||||
@@ -238,4 +238,4 @@ ArmWriteCntHctl (
|
|||||||
IN UINT32 CntHctl
|
IN UINT32 CntHctl
|
||||||
);
|
);
|
||||||
|
|
||||||
#endif // __AARCH64_H__
|
#endif // AARCH64_H_
|
||||||
|
@@ -1,13 +1,13 @@
|
|||||||
/** @file
|
/** @file
|
||||||
*
|
*
|
||||||
* Copyright (c) 2011-2013, ARM Limited. All rights reserved.
|
* Copyright (c) 2011-2021, Arm Limited. All rights reserved.<BR>
|
||||||
*
|
*
|
||||||
* SPDX-License-Identifier: BSD-2-Clause-Patent
|
* SPDX-License-Identifier: BSD-2-Clause-Patent
|
||||||
*
|
*
|
||||||
**/
|
**/
|
||||||
|
|
||||||
#ifndef __AARCH64_MMU_H_
|
#ifndef AARCH64_MMU_H_
|
||||||
#define __AARCH64_MMU_H_
|
#define AARCH64_MMU_H_
|
||||||
|
|
||||||
//
|
//
|
||||||
// Memory Attribute Indirection register Definitions
|
// Memory Attribute Indirection register Definitions
|
||||||
@@ -190,9 +190,9 @@
|
|||||||
|
|
||||||
// The value written to the T*SZ fields are defined as 2^(64-T*SZ). So a 39Bit
|
// The value written to the T*SZ fields are defined as 2^(64-T*SZ). So a 39Bit
|
||||||
// Virtual address range for 512GB of virtual space sets T*SZ to 25
|
// Virtual address range for 512GB of virtual space sets T*SZ to 25
|
||||||
#define INPUT_ADDRESS_SIZE_TO_TxSZ(a) (64 - a)
|
#define INPUT_ADDRESS_SIZE_TO_TXSZ(a) (64 - a)
|
||||||
|
|
||||||
// Uses LPAE Page Table format
|
// Uses LPAE Page Table format
|
||||||
|
|
||||||
#endif // __AARCH64_MMU_H_
|
#endif // AARCH64_MMU_H_
|
||||||
|
|
||||||
|
@@ -1,13 +1,13 @@
|
|||||||
/** @file
|
/** @file
|
||||||
|
|
||||||
Copyright (c) 2012-2014, ARM Limited. All rights reserved.
|
Copyright (c) 2012 - 2021, Arm Limited. All rights reserved.<BR>
|
||||||
|
|
||||||
SPDX-License-Identifier: BSD-2-Clause-Patent
|
SPDX-License-Identifier: BSD-2-Clause-Patent
|
||||||
|
|
||||||
**/
|
**/
|
||||||
|
|
||||||
#ifndef __ARM_CORTEX_A5x_H__
|
#ifndef ARM_CORTEX_A5X_H_
|
||||||
#define __ARM_CORTEX_A5x_H__
|
#define ARM_CORTEX_A5X_H_
|
||||||
|
|
||||||
//
|
//
|
||||||
// Cortex A5x feature bit definitions
|
// Cortex A5x feature bit definitions
|
||||||
@@ -41,4 +41,4 @@ ArmUnsetCpuExCrBit (
|
|||||||
IN UINT64 Bits
|
IN UINT64 Bits
|
||||||
);
|
);
|
||||||
|
|
||||||
#endif
|
#endif // ARM_CORTEX_A5X_H_
|
||||||
|
@@ -6,8 +6,8 @@
|
|||||||
|
|
||||||
**/
|
**/
|
||||||
|
|
||||||
#ifndef __ARM_CORTEX_A9_H__
|
#ifndef ARM_CORTEX_A9_H_
|
||||||
#define __ARM_CORTEX_A9_H__
|
#define ARM_CORTEX_A9_H_
|
||||||
|
|
||||||
#include <Chipset/ArmV7.h>
|
#include <Chipset/ArmV7.h>
|
||||||
|
|
||||||
@@ -55,5 +55,5 @@ ArmGetScuBaseAddress (
|
|||||||
VOID
|
VOID
|
||||||
);
|
);
|
||||||
|
|
||||||
#endif
|
#endif // ARM_CORTEX_A9_H_
|
||||||
|
|
||||||
|
@@ -1,14 +1,14 @@
|
|||||||
/** @file
|
/** @file
|
||||||
|
|
||||||
Copyright (c) 2008 - 2009, Apple Inc. All rights reserved.<BR>
|
Copyright (c) 2008 - 2009, Apple Inc. All rights reserved.<BR>
|
||||||
Copyright (c) 2011-2015, ARM Ltd. All rights reserved.<BR>
|
Copyright (c) 2011-2021, Arm Limited. All rights reserved.<BR>
|
||||||
|
|
||||||
SPDX-License-Identifier: BSD-2-Clause-Patent
|
SPDX-License-Identifier: BSD-2-Clause-Patent
|
||||||
|
|
||||||
**/
|
**/
|
||||||
|
|
||||||
#ifndef __ARM_V7_H__
|
#ifndef ARM_V7_H_
|
||||||
#define __ARM_V7_H__
|
#define ARM_V7_H_
|
||||||
|
|
||||||
#include <Chipset/ArmV7Mmu.h>
|
#include <Chipset/ArmV7Mmu.h>
|
||||||
|
|
||||||
@@ -70,7 +70,7 @@
|
|||||||
// MIDR - Main ID Register definitions
|
// MIDR - Main ID Register definitions
|
||||||
#define ARM_CPU_TYPE_SHIFT 4
|
#define ARM_CPU_TYPE_SHIFT 4
|
||||||
#define ARM_CPU_TYPE_MASK 0xFFF
|
#define ARM_CPU_TYPE_MASK 0xFFF
|
||||||
#define ARM_CPU_TYPE_AEMv8 0xD0F
|
#define ARM_CPU_TYPE_AEMV8 0xD0F
|
||||||
#define ARM_CPU_TYPE_A53 0xD03
|
#define ARM_CPU_TYPE_A53 0xD03
|
||||||
#define ARM_CPU_TYPE_A57 0xD07
|
#define ARM_CPU_TYPE_A57 0xD07
|
||||||
#define ARM_CPU_TYPE_A15 0xC0F
|
#define ARM_CPU_TYPE_A15 0xC0F
|
||||||
@@ -120,4 +120,4 @@ ArmWriteNsacr (
|
|||||||
IN UINT32 Nsacr
|
IN UINT32 Nsacr
|
||||||
);
|
);
|
||||||
|
|
||||||
#endif // __ARM_V7_H__
|
#endif // ARM_V7_H_
|
||||||
|
@@ -6,8 +6,8 @@
|
|||||||
*
|
*
|
||||||
**/
|
**/
|
||||||
|
|
||||||
#ifndef __ARMV7_MMU_H_
|
#ifndef ARMV7_MMU_H_
|
||||||
#define __ARMV7_MMU_H_
|
#define ARMV7_MMU_H_
|
||||||
|
|
||||||
#define TTBR_NOT_OUTER_SHAREABLE BIT5
|
#define TTBR_NOT_OUTER_SHAREABLE BIT5
|
||||||
#define TTBR_RGN_OUTER_NON_CACHEABLE 0
|
#define TTBR_RGN_OUTER_NON_CACHEABLE 0
|
||||||
@@ -235,4 +235,4 @@ ConvertSectionAttributesToPageAttributes (
|
|||||||
IN BOOLEAN IsLargePage
|
IN BOOLEAN IsLargePage
|
||||||
);
|
);
|
||||||
|
|
||||||
#endif
|
#endif // ARMV7_MMU_H_
|
||||||
|
@@ -6,8 +6,8 @@
|
|||||||
*
|
*
|
||||||
**/
|
**/
|
||||||
|
|
||||||
#ifndef __ARM_MP_CORE_INFO_GUID_H_
|
#ifndef ARM_MP_CORE_INFO_GUID_H_
|
||||||
#define __ARM_MP_CORE_INFO_GUID_H_
|
#define ARM_MP_CORE_INFO_GUID_H_
|
||||||
|
|
||||||
#define MAX_CPUS_PER_MPCORE_SYSTEM 0x04
|
#define MAX_CPUS_PER_MPCORE_SYSTEM 0x04
|
||||||
#define SCU_CONFIG_REG_OFFSET 0x04
|
#define SCU_CONFIG_REG_OFFSET 0x04
|
||||||
@@ -57,4 +57,4 @@ typedef struct {
|
|||||||
|
|
||||||
extern EFI_GUID gArmMpCoreInfoGuid;
|
extern EFI_GUID gArmMpCoreInfoGuid;
|
||||||
|
|
||||||
#endif /* MPCOREINFO_H_ */
|
#endif /* ARM_MP_CORE_INFO_GUID_H_ */
|
||||||
|
@@ -6,8 +6,8 @@
|
|||||||
*
|
*
|
||||||
**/
|
**/
|
||||||
|
|
||||||
#ifndef __ARM_MM_SVC_H__
|
#ifndef ARM_MM_SVC_H_
|
||||||
#define __ARM_MM_SVC_H__
|
#define ARM_MM_SVC_H_
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* SVC IDs to allow the MM secure partition to initialise itself, handle
|
* SVC IDs to allow the MM secure partition to initialise itself, handle
|
||||||
@@ -44,4 +44,4 @@
|
|||||||
#define SPM_MAJOR_VERSION 0
|
#define SPM_MAJOR_VERSION 0
|
||||||
#define SPM_MINOR_VERSION 1
|
#define SPM_MINOR_VERSION 1
|
||||||
|
|
||||||
#endif
|
#endif // ARM_MM_SVC_H_
|
||||||
|
@@ -10,8 +10,8 @@
|
|||||||
* (https://developer.arm.com/documentation/den0028/c/?lang=en)
|
* (https://developer.arm.com/documentation/den0028/c/?lang=en)
|
||||||
**/
|
**/
|
||||||
|
|
||||||
#ifndef __ARM_STD_SMC_H__
|
#ifndef ARM_STD_SMC_H_
|
||||||
#define __ARM_STD_SMC_H__
|
#define ARM_STD_SMC_H_
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* SMC function IDs for Standard Service queries
|
* SMC function IDs for Standard Service queries
|
||||||
@@ -129,4 +129,4 @@
|
|||||||
/* 0xbf00ff02 is reserved */
|
/* 0xbf00ff02 is reserved */
|
||||||
#define ARM_SMC_ID_TOS_REVISION 0xbf00ff03
|
#define ARM_SMC_ID_TOS_REVISION 0xbf00ff03
|
||||||
|
|
||||||
#endif
|
#endif // ARM_STD_SMC_H_
|
||||||
|
@@ -6,8 +6,8 @@
|
|||||||
|
|
||||||
**/
|
**/
|
||||||
|
|
||||||
#ifndef __ARM_DISASSEBLER_LIB_H__
|
#ifndef ARM_DISASSEMBLER_LIB_H_
|
||||||
#define __ARM_DISASSEBLER_LIB_H__
|
#define ARM_DISASSEMBLER_LIB_H_
|
||||||
|
|
||||||
/**
|
/**
|
||||||
Place a disassembly of **OpCodePtr into buffer, and update OpCodePtr to
|
Place a disassembly of **OpCodePtr into buffer, and update OpCodePtr to
|
||||||
@@ -34,4 +34,4 @@ DisassembleInstruction (
|
|||||||
OUT UINTN Size
|
OUT UINTN Size
|
||||||
);
|
);
|
||||||
|
|
||||||
#endif
|
#endif // ARM_DISASSEMBLER_LIB_H_
|
||||||
|
@@ -7,8 +7,8 @@
|
|||||||
|
|
||||||
**/
|
**/
|
||||||
|
|
||||||
#ifndef __ARM_GENERIC_TIMER_COUNTER_LIB_H__
|
#ifndef ARM_GENERIC_TIMER_COUNTER_LIB_H_
|
||||||
#define __ARM_GENERIC_TIMER_COUNTER_LIB_H__
|
#define ARM_GENERIC_TIMER_COUNTER_LIB_H_
|
||||||
|
|
||||||
VOID
|
VOID
|
||||||
EFIAPI
|
EFIAPI
|
||||||
@@ -82,4 +82,4 @@ ArmGenericTimerSetCompareVal (
|
|||||||
IN UINT64 Value
|
IN UINT64 Value
|
||||||
);
|
);
|
||||||
|
|
||||||
#endif
|
#endif // ARM_GENERIC_TIMER_COUNTER_LIB_H_
|
||||||
|
@@ -6,8 +6,8 @@
|
|||||||
*
|
*
|
||||||
**/
|
**/
|
||||||
|
|
||||||
#ifndef __ARM_GIC_ARCH_LIB_H__
|
#ifndef ARM_GIC_ARCH_LIB_H_
|
||||||
#define __ARM_GIC_ARCH_LIB_H__
|
#define ARM_GIC_ARCH_LIB_H_
|
||||||
|
|
||||||
//
|
//
|
||||||
// GIC definitions
|
// GIC definitions
|
||||||
@@ -24,4 +24,4 @@ ArmGicGetSupportedArchRevision (
|
|||||||
VOID
|
VOID
|
||||||
);
|
);
|
||||||
|
|
||||||
#endif
|
#endif // ARM_GIC_ARCH_LIB_H_
|
||||||
|
@@ -1,13 +1,13 @@
|
|||||||
/** @file
|
/** @file
|
||||||
*
|
*
|
||||||
* Copyright (c) 2011-2018, ARM Limited. All rights reserved.
|
* Copyright (c) 2011-2021, Arm Limited. All rights reserved.<BR>
|
||||||
*
|
*
|
||||||
* SPDX-License-Identifier: BSD-2-Clause-Patent
|
* SPDX-License-Identifier: BSD-2-Clause-Patent
|
||||||
*
|
*
|
||||||
**/
|
**/
|
||||||
|
|
||||||
#ifndef __ARMGIC_H
|
#ifndef ARMGIC_H_
|
||||||
#define __ARMGIC_H
|
#define ARMGIC_H_
|
||||||
|
|
||||||
#include <Library/ArmGicArchLib.h>
|
#include <Library/ArmGicArchLib.h>
|
||||||
|
|
||||||
@@ -333,4 +333,4 @@ ArmGicV3SetPriorityMask (
|
|||||||
IN UINTN Priority
|
IN UINTN Priority
|
||||||
);
|
);
|
||||||
|
|
||||||
#endif
|
#endif // ARMGIC_H_
|
||||||
|
@@ -6,8 +6,8 @@
|
|||||||
*
|
*
|
||||||
**/
|
**/
|
||||||
|
|
||||||
#ifndef __ARM_HVC_LIB__
|
#ifndef ARM_HVC_LIB_H_
|
||||||
#define __ARM_HVC_LIB__
|
#define ARM_HVC_LIB_H_
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The size of the HVC arguments are different between AArch64 and AArch32.
|
* The size of the HVC arguments are different between AArch64 and AArch32.
|
||||||
@@ -37,4 +37,4 @@ ArmCallHvc (
|
|||||||
IN OUT ARM_HVC_ARGS *Args
|
IN OUT ARM_HVC_ARGS *Args
|
||||||
);
|
);
|
||||||
|
|
||||||
#endif
|
#endif // ARM_HVC_LIB_H_
|
||||||
|
@@ -8,8 +8,8 @@
|
|||||||
|
|
||||||
**/
|
**/
|
||||||
|
|
||||||
#ifndef __ARM_LIB__
|
#ifndef ARM_LIB_H_
|
||||||
#define __ARM_LIB__
|
#define ARM_LIB_H_
|
||||||
|
|
||||||
#include <Uefi/UefiBaseType.h>
|
#include <Uefi/UefiBaseType.h>
|
||||||
|
|
||||||
@@ -753,4 +753,4 @@ ArmHasSecurityExtensions (
|
|||||||
);
|
);
|
||||||
#endif // MDE_CPU_ARM
|
#endif // MDE_CPU_ARM
|
||||||
|
|
||||||
#endif // __ARM_LIB__
|
#endif // ARM_LIB_H_
|
||||||
|
@@ -6,8 +6,8 @@
|
|||||||
|
|
||||||
**/
|
**/
|
||||||
|
|
||||||
#ifndef __ARM_MMU_LIB__
|
#ifndef ARM_MMU_LIB_H_
|
||||||
#define __ARM_MMU_LIB__
|
#define ARM_MMU_LIB_H_
|
||||||
|
|
||||||
#include <Uefi/UefiBaseType.h>
|
#include <Uefi/UefiBaseType.h>
|
||||||
|
|
||||||
@@ -64,4 +64,4 @@ ArmSetMemoryAttributes (
|
|||||||
IN UINT64 Attributes
|
IN UINT64 Attributes
|
||||||
);
|
);
|
||||||
|
|
||||||
#endif
|
#endif // ARM_MMU_LIB_H_
|
||||||
|
@@ -6,8 +6,8 @@
|
|||||||
*
|
*
|
||||||
**/
|
**/
|
||||||
|
|
||||||
#ifndef __ARM_SMC_LIB__
|
#ifndef ARM_SMC_LIB_H_
|
||||||
#define __ARM_SMC_LIB__
|
#define ARM_SMC_LIB_H_
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The size of the SMC arguments are different between AArch64 and AArch32.
|
* The size of the SMC arguments are different between AArch64 and AArch32.
|
||||||
@@ -37,4 +37,4 @@ ArmCallSmc (
|
|||||||
IN OUT ARM_SMC_ARGS *Args
|
IN OUT ARM_SMC_ARGS *Args
|
||||||
);
|
);
|
||||||
|
|
||||||
#endif
|
#endif // ARM_SMC_LIB_H_
|
||||||
|
@@ -6,8 +6,8 @@
|
|||||||
*
|
*
|
||||||
**/
|
**/
|
||||||
|
|
||||||
#ifndef __ARM_SVC_LIB__
|
#ifndef ARM_SVC_LIB_H_
|
||||||
#define __ARM_SVC_LIB__
|
#define ARM_SVC_LIB_H_
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The size of the SVC arguments are different between AArch64 and AArch32.
|
* The size of the SVC arguments are different between AArch64 and AArch32.
|
||||||
@@ -43,4 +43,4 @@ ArmCallSvc (
|
|||||||
IN OUT ARM_SVC_ARGS *Args
|
IN OUT ARM_SVC_ARGS *Args
|
||||||
);
|
);
|
||||||
|
|
||||||
#endif
|
#endif // ARM_SVC_LIB_H_
|
||||||
|
@@ -6,8 +6,8 @@
|
|||||||
|
|
||||||
**/
|
**/
|
||||||
|
|
||||||
#ifndef __DEFAULT_EXCEPTION_HANDLER_LIB_H__
|
#ifndef DEFAULT_EXCEPTION_HANDLER_LIB_H_
|
||||||
#define __DEFAULT_EXCEPTION_HANDLER_LIB_H__
|
#define DEFAULT_EXCEPTION_HANDLER_LIB_H_
|
||||||
|
|
||||||
/**
|
/**
|
||||||
This is the default action to take on an unexpected exception
|
This is the default action to take on an unexpected exception
|
||||||
@@ -22,4 +22,4 @@ DefaultExceptionHandler (
|
|||||||
IN OUT EFI_SYSTEM_CONTEXT SystemContext
|
IN OUT EFI_SYSTEM_CONTEXT SystemContext
|
||||||
);
|
);
|
||||||
|
|
||||||
#endif
|
#endif // DEFAULT_EXCEPTION_HANDLER_LIB_H_
|
||||||
|
@@ -162,4 +162,74 @@ OemUpdateSmbiosInfo (
|
|||||||
IN OEM_MISC_SMBIOS_HII_STRING_FIELD Field
|
IN OEM_MISC_SMBIOS_HII_STRING_FIELD Field
|
||||||
);
|
);
|
||||||
|
|
||||||
|
/** Fetches the Type 32 boot information status.
|
||||||
|
|
||||||
|
@return Boot status.
|
||||||
|
**/
|
||||||
|
MISC_BOOT_INFORMATION_STATUS_DATA_TYPE
|
||||||
|
EFIAPI
|
||||||
|
OemGetBootStatus (
|
||||||
|
VOID
|
||||||
|
);
|
||||||
|
|
||||||
|
/** Fetches the chassis status when it was last booted.
|
||||||
|
|
||||||
|
@return Chassis status.
|
||||||
|
**/
|
||||||
|
MISC_CHASSIS_STATE
|
||||||
|
EFIAPI
|
||||||
|
OemGetChassisBootupState (
|
||||||
|
VOID
|
||||||
|
);
|
||||||
|
|
||||||
|
/** Fetches the chassis power supply/supplies status when last booted.
|
||||||
|
|
||||||
|
@return Chassis power supply/supplies status.
|
||||||
|
**/
|
||||||
|
MISC_CHASSIS_STATE
|
||||||
|
EFIAPI
|
||||||
|
OemGetChassisPowerSupplyState (
|
||||||
|
VOID
|
||||||
|
);
|
||||||
|
|
||||||
|
/** Fetches the chassis thermal status when last booted.
|
||||||
|
|
||||||
|
@return Chassis thermal status.
|
||||||
|
**/
|
||||||
|
MISC_CHASSIS_STATE
|
||||||
|
EFIAPI
|
||||||
|
OemGetChassisThermalState (
|
||||||
|
VOID
|
||||||
|
);
|
||||||
|
|
||||||
|
/** Fetches the chassis security status when last booted.
|
||||||
|
|
||||||
|
@return Chassis security status.
|
||||||
|
**/
|
||||||
|
MISC_CHASSIS_SECURITY_STATE
|
||||||
|
EFIAPI
|
||||||
|
OemGetChassisSecurityStatus (
|
||||||
|
VOID
|
||||||
|
);
|
||||||
|
|
||||||
|
/** Fetches the chassis height in RMUs (Rack Mount Units).
|
||||||
|
|
||||||
|
@return The height of the chassis.
|
||||||
|
**/
|
||||||
|
UINT8
|
||||||
|
EFIAPI
|
||||||
|
OemGetChassisHeight (
|
||||||
|
VOID
|
||||||
|
);
|
||||||
|
|
||||||
|
/** Fetches the number of power cords.
|
||||||
|
|
||||||
|
@return The number of power cords.
|
||||||
|
**/
|
||||||
|
UINT8
|
||||||
|
EFIAPI
|
||||||
|
OemGetChassisNumPowerCords (
|
||||||
|
VOID
|
||||||
|
);
|
||||||
|
|
||||||
#endif // OEM_MISC_LIB_H_
|
#endif // OEM_MISC_LIB_H_
|
||||||
|
@@ -2,13 +2,14 @@
|
|||||||
OP-TEE specific header file.
|
OP-TEE specific header file.
|
||||||
|
|
||||||
Copyright (c) 2018, Linaro Ltd. All rights reserved.<BR>
|
Copyright (c) 2018, Linaro Ltd. All rights reserved.<BR>
|
||||||
|
Copyright (c) 2021, Arm Limited. All rights reserved.<BR>
|
||||||
|
|
||||||
SPDX-License-Identifier: BSD-2-Clause-Patent
|
SPDX-License-Identifier: BSD-2-Clause-Patent
|
||||||
|
|
||||||
**/
|
**/
|
||||||
|
|
||||||
#ifndef _OPTEE_H_
|
#ifndef OPTEE_LIB_H_
|
||||||
#define _OPTEE_H_
|
#define OPTEE_LIB_H_
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* The 'Trusted OS Call UID' is supposed to return the following UUID for
|
* The 'Trusted OS Call UID' is supposed to return the following UUID for
|
||||||
@@ -45,12 +46,14 @@ typedef struct {
|
|||||||
UINT64 C;
|
UINT64 C;
|
||||||
} OPTEE_MESSAGE_PARAM_VALUE;
|
} OPTEE_MESSAGE_PARAM_VALUE;
|
||||||
|
|
||||||
|
typedef union {
|
||||||
|
OPTEE_MESSAGE_PARAM_MEMORY Memory;
|
||||||
|
OPTEE_MESSAGE_PARAM_VALUE Value;
|
||||||
|
} OPTEE_MESSAGE_PARAM_UNION;
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
UINT64 Attribute;
|
UINT64 Attribute;
|
||||||
union {
|
OPTEE_MESSAGE_PARAM_UNION Union;
|
||||||
OPTEE_MESSAGE_PARAM_MEMORY Memory;
|
|
||||||
OPTEE_MESSAGE_PARAM_VALUE Value;
|
|
||||||
} Union;
|
|
||||||
} OPTEE_MESSAGE_PARAM;
|
} OPTEE_MESSAGE_PARAM;
|
||||||
|
|
||||||
#define OPTEE_MAX_CALL_PARAMS 4
|
#define OPTEE_MAX_CALL_PARAMS 4
|
||||||
@@ -114,4 +117,4 @@ OpteeInvokeFunction (
|
|||||||
IN OUT OPTEE_INVOKE_FUNCTION_ARG *InvokeFunctionArg
|
IN OUT OPTEE_INVOKE_FUNCTION_ARG *InvokeFunctionArg
|
||||||
);
|
);
|
||||||
|
|
||||||
#endif
|
#endif // OPTEE_LIB_H_
|
||||||
|
@@ -7,8 +7,8 @@
|
|||||||
|
|
||||||
**/
|
**/
|
||||||
|
|
||||||
#ifndef __SEMIHOSTING_H__
|
#ifndef SEMIHOSTING_LIB_H_
|
||||||
#define __SEMIHOSTING_H__
|
#define SEMIHOSTING_LIB_H_
|
||||||
|
|
||||||
/*
|
/*
|
||||||
*
|
*
|
||||||
@@ -129,4 +129,4 @@ SemihostSystem (
|
|||||||
IN CHAR8 *CommandLine
|
IN CHAR8 *CommandLine
|
||||||
);
|
);
|
||||||
|
|
||||||
#endif // __SEMIHOSTING_H__
|
#endif // SEMIHOSTING_LIB_H_
|
||||||
|
@@ -6,8 +6,8 @@
|
|||||||
|
|
||||||
**/
|
**/
|
||||||
|
|
||||||
#ifndef __STANDALONEMM_MMU_LIB__
|
#ifndef STANDALONE_MM_MMU_LIB_
|
||||||
#define __STANDALONEMM_MMU_LIB__
|
#define STANDALONE_MM_MMU_LIB_
|
||||||
|
|
||||||
EFI_STATUS
|
EFI_STATUS
|
||||||
ArmSetMemoryRegionNoExec (
|
ArmSetMemoryRegionNoExec (
|
||||||
@@ -33,4 +33,4 @@ ArmClearMemoryRegionReadOnly (
|
|||||||
IN UINT64 Length
|
IN UINT64 Length
|
||||||
);
|
);
|
||||||
|
|
||||||
#endif /* __STANDALONEMM_MMU_LIB__ */
|
#endif /* STANDALONE_MM_MMU_LIB_ */
|
||||||
|
@@ -6,8 +6,8 @@
|
|||||||
*
|
*
|
||||||
**/
|
**/
|
||||||
|
|
||||||
#ifndef __ARM_MP_CORE_INFO_PPI_H__
|
#ifndef ARM_MP_CORE_INFO_PPI_H_
|
||||||
#define __ARM_MP_CORE_INFO_PPI_H__
|
#define ARM_MP_CORE_INFO_PPI_H_
|
||||||
|
|
||||||
#include <Guid/ArmMpCoreInfo.h>
|
#include <Guid/ArmMpCoreInfo.h>
|
||||||
|
|
||||||
@@ -49,4 +49,4 @@ typedef struct {
|
|||||||
extern EFI_GUID gArmMpCoreInfoPpiGuid;
|
extern EFI_GUID gArmMpCoreInfoPpiGuid;
|
||||||
extern EFI_GUID gArmMpCoreInfoGuid;
|
extern EFI_GUID gArmMpCoreInfoGuid;
|
||||||
|
|
||||||
#endif
|
#endif // ARM_MP_CORE_INFO_PPI_H_
|
||||||
|
@@ -1,12 +1,12 @@
|
|||||||
/** @file
|
/** @file
|
||||||
|
|
||||||
Copyright (c) 2017-2018, Arm Limited. All rights reserved.
|
Copyright (c) 2017-2021, Arm Limited. All rights reserved.<BR>
|
||||||
|
|
||||||
SPDX-License-Identifier: BSD-2-Clause-Patent
|
SPDX-License-Identifier: BSD-2-Clause-Patent
|
||||||
|
|
||||||
System Control and Management Interface V1.0
|
@par Specification Reference:
|
||||||
http://infocenter.arm.com/help/topic/com.arm.doc.den0056a/
|
- Arm System Control and Management Interface - Platform Design Document
|
||||||
DEN0056A_System_Control_and_Management_Interface.pdf
|
(https://developer.arm.com/documentation/den0056/)
|
||||||
**/
|
**/
|
||||||
|
|
||||||
#ifndef ARM_SCMI_BASE_PROTOCOL_H_
|
#ifndef ARM_SCMI_BASE_PROTOCOL_H_
|
||||||
@@ -14,7 +14,8 @@
|
|||||||
|
|
||||||
#include <Protocol/ArmScmi.h>
|
#include <Protocol/ArmScmi.h>
|
||||||
|
|
||||||
#define BASE_PROTOCOL_VERSION 0x10000
|
#define BASE_PROTOCOL_VERSION_V1 0x10000
|
||||||
|
#define BASE_PROTOCOL_VERSION_V2 0x20000
|
||||||
|
|
||||||
#define NUM_PROTOCOL_MASK 0xFFU
|
#define NUM_PROTOCOL_MASK 0xFFU
|
||||||
#define NUM_AGENT_MASK 0xFFU
|
#define NUM_AGENT_MASK 0xFFU
|
||||||
@@ -158,11 +159,10 @@ typedef struct _SCMI_BASE_PROTOCOL {
|
|||||||
|
|
||||||
// SCMI Message IDs for Base protocol.
|
// SCMI Message IDs for Base protocol.
|
||||||
typedef enum {
|
typedef enum {
|
||||||
SCMI_MESSAGE_ID_BASE_DISCOVER_VENDOR = 0x3,
|
ScmiMessageIdBaseDiscoverVendor = 0x3,
|
||||||
SCMI_MESSAGE_ID_BASE_DISCOVER_SUB_VENDOR = 0x4,
|
ScmiMessageIdBaseDiscoverSubVendor = 0x4,
|
||||||
SCMI_MESSAGE_ID_BASE_DISCOVER_IMPLEMENTATION_VERSION = 0x5,
|
ScmiMessageIdBaseDiscoverImplementationVersion = 0x5,
|
||||||
SCMI_MESSAGE_ID_BASE_DISCOVER_LIST_PROTOCOLS = 0x6
|
ScmiMessageIdBaseDiscoverListProtocols = 0x6
|
||||||
} SCMI_MESSAGE_ID_BASE;
|
} SCMI_MESSAGE_ID_BASE;
|
||||||
|
|
||||||
#endif /* ARM_SCMI_BASE_PROTOCOL_H_ */
|
#endif /* ARM_SCMI_BASE_PROTOCOL_H_ */
|
||||||
|
|
||||||
|
@@ -1,6 +1,6 @@
|
|||||||
/** @file
|
/** @file
|
||||||
|
|
||||||
Copyright (c) 2017-2018, Arm Limited. All rights reserved.
|
Copyright (c) 2017-2021, Arm Limited. All rights reserved.
|
||||||
|
|
||||||
SPDX-License-Identifier: BSD-2-Clause-Patent
|
SPDX-License-Identifier: BSD-2-Clause-Patent
|
||||||
|
|
||||||
@@ -89,10 +89,10 @@ EFI_STATUS
|
|||||||
@param[in] This A pointer to SCMI_CLOCK2_PROTOCOL Instance.
|
@param[in] This A pointer to SCMI_CLOCK2_PROTOCOL Instance.
|
||||||
@param[in] ClockId Identifier for the clock device.
|
@param[in] ClockId Identifier for the clock device.
|
||||||
|
|
||||||
@param[out] Format SCMI_CLOCK_RATE_FORMAT_DISCRETE: Clock device
|
@param[out] Format ScmiClockRateFormatDiscrete: Clock device
|
||||||
supports range of clock rates which are non-linear.
|
supports range of clock rates which are non-linear.
|
||||||
|
|
||||||
SCMI_CLOCK_RATE_FORMAT_LINEAR: Clock device supports
|
ScmiClockRateFormatLinear: Clock device supports
|
||||||
range of linear clock rates from Min to Max in steps.
|
range of linear clock rates from Min to Max in steps.
|
||||||
|
|
||||||
@param[out] TotalRates Total number of rates.
|
@param[out] TotalRates Total number of rates.
|
||||||
|
@@ -1,6 +1,6 @@
|
|||||||
/** @file
|
/** @file
|
||||||
|
|
||||||
Copyright (c) 2017-2018, Arm Limited. All rights reserved.
|
Copyright (c) 2017-2021, Arm Limited. All rights reserved.
|
||||||
|
|
||||||
SPDX-License-Identifier: BSD-2-Clause-Patent
|
SPDX-License-Identifier: BSD-2-Clause-Patent
|
||||||
|
|
||||||
@@ -22,16 +22,16 @@ extern EFI_GUID gArmScmiClockProtocolGuid;
|
|||||||
|
|
||||||
// Message Type for clock management protocol.
|
// Message Type for clock management protocol.
|
||||||
typedef enum {
|
typedef enum {
|
||||||
SCMI_MESSAGE_ID_CLOCK_ATTRIBUTES = 0x3,
|
ScmiMessageIdClockAttributes = 0x3,
|
||||||
SCMI_MESSAGE_ID_CLOCK_DESCRIBE_RATES = 0x4,
|
ScmiMessageIdClockDescribeRates = 0x4,
|
||||||
SCMI_MESSAGE_ID_CLOCK_RATE_SET = 0x5,
|
ScmiMessageIdClockRateSet = 0x5,
|
||||||
SCMI_MESSAGE_ID_CLOCK_RATE_GET = 0x6,
|
ScmiMessageIdClockRateGet = 0x6,
|
||||||
SCMI_MESSAGE_ID_CLOCK_CONFIG_SET = 0x7
|
ScmiMessageIdClockConfigSet = 0x7
|
||||||
} SCMI_MESSAGE_ID_CLOCK;
|
} SCMI_MESSAGE_ID_CLOCK;
|
||||||
|
|
||||||
typedef enum {
|
typedef enum {
|
||||||
SCMI_CLOCK_RATE_FORMAT_DISCRETE, // Non-linear range.
|
ScmiClockRateFormatDiscrete, // Non-linear range.
|
||||||
SCMI_CLOCK_RATE_FORMAT_LINEAR // Linear range.
|
ScmiClockRateFormatLinear // Linear range.
|
||||||
} SCMI_CLOCK_RATE_FORMAT;
|
} SCMI_CLOCK_RATE_FORMAT;
|
||||||
|
|
||||||
// Clock management protocol version.
|
// Clock management protocol version.
|
||||||
@@ -57,12 +57,18 @@ typedef enum {
|
|||||||
either Rate or Min/Max/Step triplet is valid.
|
either Rate or Min/Max/Step triplet is valid.
|
||||||
*/
|
*/
|
||||||
typedef struct {
|
typedef struct {
|
||||||
union {
|
|
||||||
UINT64 Min;
|
UINT64 Min;
|
||||||
UINT64 Rate;
|
|
||||||
};
|
|
||||||
UINT64 Max;
|
UINT64 Max;
|
||||||
UINT64 Step;
|
UINT64 Step;
|
||||||
|
} SCMI_CLOCK_RATE_CONTINUOUS;
|
||||||
|
|
||||||
|
typedef struct {
|
||||||
|
UINT64 Rate;
|
||||||
|
} SCMI_CLOCK_RATE_DISCRETE;
|
||||||
|
|
||||||
|
typedef union {
|
||||||
|
SCMI_CLOCK_RATE_CONTINUOUS ContinuousRate;
|
||||||
|
SCMI_CLOCK_RATE_DISCRETE DiscreteRate;
|
||||||
} SCMI_CLOCK_RATE;
|
} SCMI_CLOCK_RATE;
|
||||||
|
|
||||||
#pragma pack()
|
#pragma pack()
|
||||||
@@ -133,10 +139,10 @@ EFI_STATUS
|
|||||||
@param[in] This A pointer to SCMI_CLOCK_PROTOCOL Instance.
|
@param[in] This A pointer to SCMI_CLOCK_PROTOCOL Instance.
|
||||||
@param[in] ClockId Identifier for the clock device.
|
@param[in] ClockId Identifier for the clock device.
|
||||||
|
|
||||||
@param[out] Format SCMI_CLOCK_RATE_FORMAT_DISCRETE: Clock device
|
@param[out] Format ScmiClockRateFormatDiscrete: Clock device
|
||||||
supports range of clock rates which are non-linear.
|
supports range of clock rates which are non-linear.
|
||||||
|
|
||||||
SCMI_CLOCK_RATE_FORMAT_LINEAR: Clock device supports
|
ScmiClockRateFormatLinear: Clock device supports
|
||||||
range of linear clock rates from Min to Max in steps.
|
range of linear clock rates from Min to Max in steps.
|
||||||
|
|
||||||
@param[out] TotalRates Total number of rates.
|
@param[out] TotalRates Total number of rates.
|
||||||
|
@@ -1,6 +1,6 @@
|
|||||||
/** @file
|
/** @file
|
||||||
|
|
||||||
Copyright (c) 2017-2018, Arm Limited. All rights reserved.
|
Copyright (c) 2017-2021, Arm Limited. All rights reserved.
|
||||||
|
|
||||||
SPDX-License-Identifier: BSD-2-Clause-Patent
|
SPDX-License-Identifier: BSD-2-Clause-Patent
|
||||||
|
|
||||||
@@ -247,12 +247,12 @@ typedef struct _SCMI_PERFORMANCE_PROTOCOL {
|
|||||||
} SCMI_PERFORMANCE_PROTOCOL;
|
} SCMI_PERFORMANCE_PROTOCOL;
|
||||||
|
|
||||||
typedef enum {
|
typedef enum {
|
||||||
SCMI_MESSAGE_ID_PERFORMANCE_DOMAIN_ATTRIBUTES = 0x3,
|
ScmiMessageIdPerformanceDomainAttributes = 0x3,
|
||||||
SCMI_MESSAGE_ID_PERFORMANCE_DESCRIBE_LEVELS = 0x4,
|
ScmiMessageIdPerformanceDescribeLevels = 0x4,
|
||||||
SCMI_MESSAGE_ID_PERFORMANCE_LIMITS_SET = 0x5,
|
ScmiMessageIdPerformanceLimitsSet = 0x5,
|
||||||
SCMI_MESSAGE_ID_PERFORMANCE_LIMITS_GET = 0x6,
|
ScmiMessageIdPerformanceLimitsGet = 0x6,
|
||||||
SCMI_MESSAGE_ID_PERFORMANCE_LEVEL_SET = 0x7,
|
ScmiMessageIdPerformanceLevelSet = 0x7,
|
||||||
SCMI_MESSAGE_ID_PERFORMANCE_LEVEL_GET = 0x8,
|
ScmiMessageIdPerformanceLevelGet = 0x8,
|
||||||
} SCMI_MESSAGE_ID_PERFORMANCE;
|
} SCMI_MESSAGE_ID_PERFORMANCE;
|
||||||
|
|
||||||
#endif /* ARM_SCMI_PERFORMANCE_PROTOCOL_H_ */
|
#endif /* ARM_SCMI_PERFORMANCE_PROTOCOL_H_ */
|
||||||
|
@@ -1,7 +1,7 @@
|
|||||||
/** @file
|
/** @file
|
||||||
Generic ARM implementation of TimerLib.h
|
Generic ARM implementation of TimerLib.h
|
||||||
|
|
||||||
Copyright (c) 2011-2016, ARM Limited. All rights reserved.
|
Copyright (c) 2011 - 2021, Arm Limited. All rights reserved.<BR>
|
||||||
|
|
||||||
SPDX-License-Identifier: BSD-2-Clause-Patent
|
SPDX-License-Identifier: BSD-2-Clause-Patent
|
||||||
|
|
||||||
@@ -20,9 +20,9 @@
|
|||||||
|
|
||||||
// Select appropriate multiply function for platform architecture.
|
// Select appropriate multiply function for platform architecture.
|
||||||
#ifdef MDE_CPU_ARM
|
#ifdef MDE_CPU_ARM
|
||||||
#define MultU64xN MultU64x32
|
#define MULT_U64_X_N MultU64x32
|
||||||
#else
|
#else
|
||||||
#define MultU64xN MultU64x64
|
#define MULT_U64_X_N MultU64x64
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
@@ -121,7 +121,7 @@ MicroSecondDelay (
|
|||||||
// = MicroSeconds x TICKS_PER_MICRO_SEC
|
// = MicroSeconds x TICKS_PER_MICRO_SEC
|
||||||
// = MicroSeconds x Frequency.10^-6
|
// = MicroSeconds x Frequency.10^-6
|
||||||
TimerTicks64 = DivU64x32 (
|
TimerTicks64 = DivU64x32 (
|
||||||
MultU64xN (
|
MULT_U64_X_N (
|
||||||
MicroSeconds,
|
MicroSeconds,
|
||||||
GetPlatformTimerFreq ()
|
GetPlatformTimerFreq ()
|
||||||
),
|
),
|
||||||
@@ -263,7 +263,7 @@ GetTimeInNanoSecond (
|
|||||||
// Time = --------- x 1,000,000,000
|
// Time = --------- x 1,000,000,000
|
||||||
// Frequency
|
// Frequency
|
||||||
//
|
//
|
||||||
NanoSeconds = MultU64xN (
|
NanoSeconds = MULT_U64_X_N (
|
||||||
DivU64x32Remainder (
|
DivU64x32Remainder (
|
||||||
Ticks,
|
Ticks,
|
||||||
TimerFreq,
|
TimerFreq,
|
||||||
@@ -276,7 +276,7 @@ GetTimeInNanoSecond (
|
|||||||
// will not overflow 64-bit.
|
// will not overflow 64-bit.
|
||||||
//
|
//
|
||||||
NanoSeconds += DivU64x32 (
|
NanoSeconds += DivU64x32 (
|
||||||
MultU64xN (
|
MULT_U64_X_N (
|
||||||
(UINT64) Remainder,
|
(UINT64) Remainder,
|
||||||
1000000000U),
|
1000000000U),
|
||||||
TimerFreq
|
TimerFreq
|
||||||
|
@@ -71,7 +71,7 @@ CHAR8 *gLdmStack[] = {
|
|||||||
|
|
||||||
|
|
||||||
#define SIGN(_U) ((_U) ? "" : "-")
|
#define SIGN(_U) ((_U) ? "" : "-")
|
||||||
#define WRITE(_W) ((_W) ? "!" : "")
|
#define WRITE(_Write) ((_Write) ? "!" : "")
|
||||||
#define BYTE(_B) ((_B) ? "B":"")
|
#define BYTE(_B) ((_B) ? "B":"")
|
||||||
#define USER(_B) ((_B) ? "^" : "")
|
#define USER(_B) ((_B) ? "^" : "")
|
||||||
|
|
||||||
@@ -159,23 +159,24 @@ DisassembleArmInstruction (
|
|||||||
)
|
)
|
||||||
{
|
{
|
||||||
UINT32 OpCode;
|
UINT32 OpCode;
|
||||||
CHAR8 *Type, *Root;
|
CHAR8 *Type;
|
||||||
BOOLEAN I, P, U, B, W, L, S, H;
|
CHAR8 *Root;
|
||||||
|
BOOLEAN Imm, Pre, Up, WriteBack, Write, Load, Sign, Half;
|
||||||
UINT32 Rn, Rd, Rm;
|
UINT32 Rn, Rd, Rm;
|
||||||
UINT32 imode, offset_8, offset_12;
|
UINT32 IMod, Offset8, Offset12;
|
||||||
UINT32 Index;
|
UINT32 Index;
|
||||||
UINT32 shift_imm, shift;
|
UINT32 ShiftImm, Shift;
|
||||||
|
|
||||||
OpCode = **OpCodePtr;
|
OpCode = **OpCodePtr;
|
||||||
|
|
||||||
I = (OpCode & BIT25) == BIT25;
|
Imm = (OpCode & BIT25) == BIT25; // I
|
||||||
P = (OpCode & BIT24) == BIT24;
|
Pre = (OpCode & BIT24) == BIT24; // P
|
||||||
U = (OpCode & BIT23) == BIT23;
|
Up = (OpCode & BIT23) == BIT23; // U
|
||||||
B = (OpCode & BIT22) == BIT22; // Also called S
|
WriteBack = (OpCode & BIT22) == BIT22; // B, also called S
|
||||||
W = (OpCode & BIT21) == BIT21;
|
Write = (OpCode & BIT21) == BIT21; // W
|
||||||
L = (OpCode & BIT20) == BIT20;
|
Load = (OpCode & BIT20) == BIT20; // L
|
||||||
S = (OpCode & BIT6) == BIT6;
|
Sign = (OpCode & BIT6) == BIT6; // S
|
||||||
H = (OpCode & BIT5) == BIT5;
|
Half = (OpCode & BIT5) == BIT5; // H
|
||||||
Rn = (OpCode >> 16) & 0xf;
|
Rn = (OpCode >> 16) & 0xf;
|
||||||
Rd = (OpCode >> 12) & 0xf;
|
Rd = (OpCode >> 12) & 0xf;
|
||||||
Rm = (OpCode & 0xf);
|
Rm = (OpCode & 0xf);
|
||||||
@@ -189,7 +190,7 @@ DisassembleArmInstruction (
|
|||||||
|
|
||||||
// LDREX, STREX
|
// LDREX, STREX
|
||||||
if ((OpCode & 0x0fe000f0) == 0x01800090) {
|
if ((OpCode & 0x0fe000f0) == 0x01800090) {
|
||||||
if (L) {
|
if (Load) {
|
||||||
// A4.1.27 LDREX{<cond>} <Rd>, [<Rn>]
|
// A4.1.27 LDREX{<cond>} <Rd>, [<Rn>]
|
||||||
AsciiSPrint (Buf, Size, "LDREX%a %a, [%a]", COND (OpCode), gReg[Rd], gReg[Rn]);
|
AsciiSPrint (Buf, Size, "LDREX%a %a, [%a]", COND (OpCode), gReg[Rd], gReg[Rn]);
|
||||||
} else {
|
} else {
|
||||||
@@ -201,89 +202,89 @@ DisassembleArmInstruction (
|
|||||||
|
|
||||||
// LDM/STM
|
// LDM/STM
|
||||||
if ((OpCode & 0x0e000000) == 0x08000000) {
|
if ((OpCode & 0x0e000000) == 0x08000000) {
|
||||||
if (L) {
|
if (Load) {
|
||||||
// A4.1.20 LDM{<cond>}<addressing_mode> <Rn>{!}, <registers>
|
// A4.1.20 LDM{<cond>}<addressing_mode> <Rn>{!}, <registers>
|
||||||
// A4.1.21 LDM{<cond>}<addressing_mode> <Rn>, <registers_without_pc>^
|
// A4.1.21 LDM{<cond>}<addressing_mode> <Rn>, <registers_without_pc>^
|
||||||
// A4.1.22 LDM{<cond>}<addressing_mode> <Rn>{!}, <registers_and_pc>^
|
// A4.1.22 LDM{<cond>}<addressing_mode> <Rn>{!}, <registers_and_pc>^
|
||||||
AsciiSPrint (Buf, Size, "LDM%a%a, %a%a, %a", COND (OpCode), LDM_EXT (Rn ,(OpCode >> 23) & 3), gReg[Rn], WRITE (W), MRegList (OpCode), USER (B));
|
AsciiSPrint (Buf, Size, "LDM%a%a, %a%a, %a", COND (OpCode), LDM_EXT (Rn ,(OpCode >> 23) & 3), gReg[Rn], WRITE (Write), MRegList (OpCode), USER (WriteBack));
|
||||||
} else {
|
} else {
|
||||||
// A4.1.97 STM{<cond>}<addressing_mode> <Rn>{!}, <registers>
|
// A4.1.97 STM{<cond>}<addressing_mode> <Rn>{!}, <registers>
|
||||||
// A4.1.98 STM{<cond>}<addressing_mode> <Rn>, <registers>^
|
// A4.1.98 STM{<cond>}<addressing_mode> <Rn>, <registers>^
|
||||||
AsciiSPrint (Buf, Size, "STM%a%a, %a%a, %a", COND (OpCode), LDM_EXT (Rn ,(OpCode >> 23) & 3), gReg[Rn], WRITE (W), MRegList (OpCode), USER (B));
|
AsciiSPrint (Buf, Size, "STM%a%a, %a%a, %a", COND (OpCode), LDM_EXT (Rn ,(OpCode >> 23) & 3), gReg[Rn], WRITE (Write), MRegList (OpCode), USER (WriteBack));
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// LDR/STR Address Mode 2
|
// LDR/STR Address Mode 2
|
||||||
if ( ((OpCode & 0x0c000000) == 0x04000000) || ((OpCode & 0xfd70f000 ) == 0xf550f000) ) {
|
if ( ((OpCode & 0x0c000000) == 0x04000000) || ((OpCode & 0xfd70f000 ) == 0xf550f000) ) {
|
||||||
offset_12 = OpCode & 0xfff;
|
Offset12 = OpCode & 0xfff;
|
||||||
if ((OpCode & 0xfd70f000 ) == 0xf550f000) {
|
if ((OpCode & 0xfd70f000 ) == 0xf550f000) {
|
||||||
Index = AsciiSPrint (Buf, Size, "PLD");
|
Index = AsciiSPrint (Buf, Size, "PLD");
|
||||||
} else {
|
} else {
|
||||||
Index = AsciiSPrint (Buf, Size, "%a%a%a%a %a, ", L ? "LDR" : "STR", COND (OpCode), BYTE (B), (!(P) && W) ? "T":"", gReg[Rd]);
|
Index = AsciiSPrint (Buf, Size, "%a%a%a%a %a, ", Load ? "LDR" : "STR", COND (OpCode), BYTE (WriteBack), (!(Pre) && Write) ? "T":"", gReg[Rd]);
|
||||||
}
|
}
|
||||||
if (P) {
|
if (Pre) {
|
||||||
if (!I) {
|
if (!Imm) {
|
||||||
// A5.2.2 [<Rn>, #+/-<offset_12>]
|
// A5.2.2 [<Rn>, #+/-<offset_12>]
|
||||||
// A5.2.5 [<Rn>, #+/-<offset_12>]
|
// A5.2.5 [<Rn>, #+/-<offset_12>]
|
||||||
AsciiSPrint (&Buf[Index], Size - Index, "[%a, #%a0x%x]%a", gReg[Rn], SIGN (U), offset_12, WRITE (W));
|
AsciiSPrint (&Buf[Index], Size - Index, "[%a, #%a0x%x]%a", gReg[Rn], SIGN (Up), Offset12, WRITE (Write));
|
||||||
} else if ((OpCode & 0x03000ff0) == 0x03000000) {
|
} else if ((OpCode & 0x03000ff0) == 0x03000000) {
|
||||||
// A5.2.3 [<Rn>, +/-<Rm>]
|
// A5.2.3 [<Rn>, +/-<Rm>]
|
||||||
// A5.2.6 [<Rn>, +/-<Rm>]!
|
// A5.2.6 [<Rn>, +/-<Rm>]!
|
||||||
AsciiSPrint (&Buf[Index], Size - Index, "[%a, #%a%a]%a", gReg[Rn], SIGN (U), WRITE (W));
|
AsciiSPrint (&Buf[Index], Size - Index, "[%a, #%a%a]%a", gReg[Rn], SIGN (Up), WRITE (Write));
|
||||||
} else {
|
} else {
|
||||||
// A5.2.4 [<Rn>, +/-<Rm>, LSL #<shift_imm>]
|
// A5.2.4 [<Rn>, +/-<Rm>, LSL #<shift_imm>]
|
||||||
// A5.2.7 [<Rn>, +/-<Rm>, LSL #<shift_imm>]!
|
// A5.2.7 [<Rn>, +/-<Rm>, LSL #<shift_imm>]!
|
||||||
shift_imm = (OpCode >> 7) & 0x1f;
|
ShiftImm = (OpCode >> 7) & 0x1f;
|
||||||
shift = (OpCode >> 5) & 0x3;
|
Shift = (OpCode >> 5) & 0x3;
|
||||||
if (shift == 0x0) {
|
if (Shift == 0x0) {
|
||||||
Type = "LSL";
|
Type = "LSL";
|
||||||
} else if (shift == 0x1) {
|
} else if (Shift == 0x1) {
|
||||||
Type = "LSR";
|
Type = "LSR";
|
||||||
if (shift_imm == 0) {
|
if (ShiftImm == 0) {
|
||||||
shift_imm = 32;
|
ShiftImm = 32;
|
||||||
}
|
}
|
||||||
} else if (shift == 0x2) {
|
} else if (Shift == 0x2) {
|
||||||
Type = "ASR";
|
Type = "ASR";
|
||||||
} else if (shift_imm == 0) {
|
} else if (ShiftImm == 0) {
|
||||||
AsciiSPrint (&Buf[Index], Size - Index, "[%a, #%a%a, %a, RRX]%a", gReg[Rn], SIGN (U), gReg[Rm], WRITE (W));
|
AsciiSPrint (&Buf[Index], Size - Index, "[%a, #%a%a, %a, RRX]%a", gReg[Rn], SIGN (Up), gReg[Rm], WRITE (Write));
|
||||||
return;
|
return;
|
||||||
} else {
|
} else {
|
||||||
Type = "ROR";
|
Type = "ROR";
|
||||||
}
|
}
|
||||||
|
|
||||||
AsciiSPrint (&Buf[Index], Size - Index, "[%a, #%a%a, %a, #%d]%a", gReg[Rn], SIGN (U), gReg[Rm], Type, shift_imm, WRITE (W));
|
AsciiSPrint (&Buf[Index], Size - Index, "[%a, #%a%a, %a, #%d]%a", gReg[Rn], SIGN (Up), gReg[Rm], Type, ShiftImm, WRITE (Write));
|
||||||
}
|
}
|
||||||
} else { // !P
|
} else { // !Pre
|
||||||
if (!I) {
|
if (!Imm) {
|
||||||
// A5.2.8 [<Rn>], #+/-<offset_12>
|
// A5.2.8 [<Rn>], #+/-<offset_12>
|
||||||
AsciiSPrint (&Buf[Index], Size - Index, "[%a], #%a0x%x", gReg[Rn], SIGN (U), offset_12);
|
AsciiSPrint (&Buf[Index], Size - Index, "[%a], #%a0x%x", gReg[Rn], SIGN (Up), Offset12);
|
||||||
} else if ((OpCode & 0x03000ff0) == 0x03000000) {
|
} else if ((OpCode & 0x03000ff0) == 0x03000000) {
|
||||||
// A5.2.9 [<Rn>], +/-<Rm>
|
// A5.2.9 [<Rn>], +/-<Rm>
|
||||||
AsciiSPrint (&Buf[Index], Size - Index, "[%a], #%a%a", gReg[Rn], SIGN (U), gReg[Rm]);
|
AsciiSPrint (&Buf[Index], Size - Index, "[%a], #%a%a", gReg[Rn], SIGN (Up), gReg[Rm]);
|
||||||
} else {
|
} else {
|
||||||
// A5.2.10 [<Rn>], +/-<Rm>, LSL #<shift_imm>
|
// A5.2.10 [<Rn>], +/-<Rm>, LSL #<shift_imm>
|
||||||
shift_imm = (OpCode >> 7) & 0x1f;
|
ShiftImm = (OpCode >> 7) & 0x1f;
|
||||||
shift = (OpCode >> 5) & 0x3;
|
Shift = (OpCode >> 5) & 0x3;
|
||||||
|
|
||||||
if (shift == 0x0) {
|
if (Shift == 0x0) {
|
||||||
Type = "LSL";
|
Type = "LSL";
|
||||||
} else if (shift == 0x1) {
|
} else if (Shift == 0x1) {
|
||||||
Type = "LSR";
|
Type = "LSR";
|
||||||
if (shift_imm == 0) {
|
if (ShiftImm == 0) {
|
||||||
shift_imm = 32;
|
ShiftImm = 32;
|
||||||
}
|
}
|
||||||
} else if (shift == 0x2) {
|
} else if (Shift == 0x2) {
|
||||||
Type = "ASR";
|
Type = "ASR";
|
||||||
} else if (shift_imm == 0) {
|
} else if (ShiftImm == 0) {
|
||||||
AsciiSPrint (&Buf[Index], Size - Index, "[%a], #%a%a, %a, RRX", gReg[Rn], SIGN (U), gReg[Rm]);
|
AsciiSPrint (&Buf[Index], Size - Index, "[%a], #%a%a, %a, RRX", gReg[Rn], SIGN (Up), gReg[Rm]);
|
||||||
// FIx me
|
// FIx me
|
||||||
return;
|
return;
|
||||||
} else {
|
} else {
|
||||||
Type = "ROR";
|
Type = "ROR";
|
||||||
}
|
}
|
||||||
|
|
||||||
AsciiSPrint (&Buf[Index], Size - Index, "[%a], #%a%a, %a, #%d", gReg[Rn], SIGN (U), gReg[Rm], Type, shift_imm);
|
AsciiSPrint (&Buf[Index], Size - Index, "[%a], #%a%a, %a, #%d", gReg[Rn], SIGN (Up), gReg[Rm], Type, ShiftImm);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
@@ -292,18 +293,18 @@ DisassembleArmInstruction (
|
|||||||
if ((OpCode & 0x0e000000) == 0x00000000) {
|
if ((OpCode & 0x0e000000) == 0x00000000) {
|
||||||
// LDR/STR address mode 3
|
// LDR/STR address mode 3
|
||||||
// LDR|STR{<cond>}H|SH|SB|D <Rd>, <addressing_mode>
|
// LDR|STR{<cond>}H|SH|SB|D <Rd>, <addressing_mode>
|
||||||
if (L) {
|
if (Load) {
|
||||||
if (!S) {
|
if (!Sign) {
|
||||||
Root = "LDR%aH %a, ";
|
Root = "LDR%aH %a, ";
|
||||||
} else if (!H) {
|
} else if (!Half) {
|
||||||
Root = "LDR%aSB %a, ";
|
Root = "LDR%aSB %a, ";
|
||||||
} else {
|
} else {
|
||||||
Root = "LDR%aSH %a, ";
|
Root = "LDR%aSH %a, ";
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (!S) {
|
if (!Sign) {
|
||||||
Root = "STR%aH %a ";
|
Root = "STR%aH %a ";
|
||||||
} else if (!H) {
|
} else if (!Half) {
|
||||||
Root = "LDR%aD %a ";
|
Root = "LDR%aD %a ";
|
||||||
} else {
|
} else {
|
||||||
Root = "STR%aD %a ";
|
Root = "STR%aD %a ";
|
||||||
@@ -312,28 +313,28 @@ DisassembleArmInstruction (
|
|||||||
|
|
||||||
Index = AsciiSPrint (Buf, Size, Root, COND (OpCode), gReg[Rd]);
|
Index = AsciiSPrint (Buf, Size, Root, COND (OpCode), gReg[Rd]);
|
||||||
|
|
||||||
S = (OpCode & BIT6) == BIT6;
|
Sign = (OpCode & BIT6) == BIT6;
|
||||||
H = (OpCode & BIT5) == BIT5;
|
Half = (OpCode & BIT5) == BIT5;
|
||||||
offset_8 = ((OpCode >> 4) | (OpCode * 0xf)) & 0xff;
|
Offset8 = ((OpCode >> 4) | (OpCode * 0xf)) & 0xff;
|
||||||
if (P & !W) {
|
if (Pre & !Write) {
|
||||||
// Immediate offset/index
|
// Immediate offset/index
|
||||||
if (B) {
|
if (WriteBack) {
|
||||||
// A5.3.2 [<Rn>, #+/-<offset_8>]
|
// A5.3.2 [<Rn>, #+/-<offset_8>]
|
||||||
// A5.3.4 [<Rn>, #+/-<offset_8>]!
|
// A5.3.4 [<Rn>, #+/-<offset_8>]!
|
||||||
AsciiSPrint (&Buf[Index], Size - Index, "[%a, #%a%d]%a", gReg[Rn], SIGN (U), offset_8, WRITE (W));
|
AsciiSPrint (&Buf[Index], Size - Index, "[%a, #%a%d]%a", gReg[Rn], SIGN (Up), Offset8, WRITE (Write));
|
||||||
} else {
|
} else {
|
||||||
// A5.3.3 [<Rn>, +/-<Rm>]
|
// A5.3.3 [<Rn>, +/-<Rm>]
|
||||||
// A5.3.5 [<Rn>, +/-<Rm>]!
|
// A5.3.5 [<Rn>, +/-<Rm>]!
|
||||||
AsciiSPrint (&Buf[Index], Size - Index, "[%a, #%a%]a", gReg[Rn], SIGN (U), gReg[Rm], WRITE (W));
|
AsciiSPrint (&Buf[Index], Size - Index, "[%a, #%a%]a", gReg[Rn], SIGN (Up), gReg[Rm], WRITE (Write));
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
// Register offset/index
|
// Register offset/index
|
||||||
if (B) {
|
if (WriteBack) {
|
||||||
// A5.3.6 [<Rn>], #+/-<offset_8>
|
// A5.3.6 [<Rn>], #+/-<offset_8>
|
||||||
AsciiSPrint (&Buf[Index], Size - Index, "[%a], #%a%d", gReg[Rn], SIGN (U), offset_8);
|
AsciiSPrint (&Buf[Index], Size - Index, "[%a], #%a%d", gReg[Rn], SIGN (Up), Offset8);
|
||||||
} else {
|
} else {
|
||||||
// A5.3.7 [<Rn>], +/-<Rm>
|
// A5.3.7 [<Rn>], +/-<Rm>
|
||||||
AsciiSPrint (&Buf[Index], Size - Index, "[%a], #%a%a", gReg[Rn], SIGN (U), gReg[Rm]);
|
AsciiSPrint (&Buf[Index], Size - Index, "[%a], #%a%a", gReg[Rn], SIGN (Up), gReg[Rm]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
@@ -342,19 +343,19 @@ DisassembleArmInstruction (
|
|||||||
if ((OpCode & 0x0fb000f0) == 0x01000050) {
|
if ((OpCode & 0x0fb000f0) == 0x01000050) {
|
||||||
// A4.1.108 SWP SWP{<cond>}B <Rd>, <Rm>, [<Rn>]
|
// A4.1.108 SWP SWP{<cond>}B <Rd>, <Rm>, [<Rn>]
|
||||||
// A4.1.109 SWPB SWP{<cond>}B <Rd>, <Rm>, [<Rn>]
|
// A4.1.109 SWPB SWP{<cond>}B <Rd>, <Rm>, [<Rn>]
|
||||||
AsciiSPrint (Buf, Size, "SWP%a%a %a, %a, [%a]", COND (OpCode), BYTE (B), gReg[Rd], gReg[Rm], gReg[Rn]);
|
AsciiSPrint (Buf, Size, "SWP%a%a %a, %a, [%a]", COND (OpCode), BYTE (WriteBack), gReg[Rd], gReg[Rm], gReg[Rn]);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((OpCode & 0xfe5f0f00) == 0xf84d0500) {
|
if ((OpCode & 0xfe5f0f00) == 0xf84d0500) {
|
||||||
// A4.1.90 SRS SRS<addressing_mode> #<mode>{!}
|
// A4.1.90 SRS SRS<addressing_mode> #<mode>{!}
|
||||||
AsciiSPrint (Buf, Size, "SRS%a #0x%x%a", gLdmStack[(OpCode >> 23) & 3], OpCode & 0x1f, WRITE (W));
|
AsciiSPrint (Buf, Size, "SRS%a #0x%x%a", gLdmStack[(OpCode >> 23) & 3], OpCode & 0x1f, WRITE (Write));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((OpCode & 0xfe500f00) == 0xf8100500) {
|
if ((OpCode & 0xfe500f00) == 0xf8100500) {
|
||||||
// A4.1.59 RFE<addressing_mode> <Rn>{!}
|
// A4.1.59 RFE<addressing_mode> <Rn>{!}
|
||||||
AsciiSPrint (Buf, Size, "RFE%a %a", gLdmStack[(OpCode >> 23) & 3], gReg[Rn], WRITE (W));
|
AsciiSPrint (Buf, Size, "RFE%a %a", gLdmStack[(OpCode >> 23) & 3], gReg[Rn], WRITE (Write));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -369,9 +370,9 @@ DisassembleArmInstruction (
|
|||||||
if (((OpCode >> 6) & 0x7) == 0) {
|
if (((OpCode >> 6) & 0x7) == 0) {
|
||||||
AsciiSPrint (Buf, Size, "CPS #0x%x", (OpCode & 0x2f));
|
AsciiSPrint (Buf, Size, "CPS #0x%x", (OpCode & 0x2f));
|
||||||
} else {
|
} else {
|
||||||
imode = (OpCode >> 18) & 0x3;
|
IMod = (OpCode >> 18) & 0x3;
|
||||||
Index = AsciiSPrint (Buf, Size, "CPS%a %a%a%a",
|
Index = AsciiSPrint (Buf, Size, "CPS%a %a%a%a",
|
||||||
(imode == 3) ? "ID":"IE",
|
(IMod == 3) ? "ID":"IE",
|
||||||
((OpCode & BIT8) != 0) ? "A":"",
|
((OpCode & BIT8) != 0) ? "A":"",
|
||||||
((OpCode & BIT7) != 0) ? "I":"",
|
((OpCode & BIT7) != 0) ? "I":"",
|
||||||
((OpCode & BIT6) != 0) ? "F":"");
|
((OpCode & BIT6) != 0) ? "F":"");
|
||||||
@@ -390,19 +391,19 @@ DisassembleArmInstruction (
|
|||||||
|
|
||||||
if ((OpCode & 0x0fb00000) == 0x01000000) {
|
if ((OpCode & 0x0fb00000) == 0x01000000) {
|
||||||
// A4.1.38 MRS{<cond>} <Rd>, CPSR MRS{<cond>} <Rd>, SPSR
|
// A4.1.38 MRS{<cond>} <Rd>, CPSR MRS{<cond>} <Rd>, SPSR
|
||||||
AsciiSPrint (Buf, Size, "MRS%a %a, %a", COND (OpCode), gReg[Rd], B ? "SPSR" : "CPSR");
|
AsciiSPrint (Buf, Size, "MRS%a %a, %a", COND (OpCode), gReg[Rd], WriteBack ? "SPSR" : "CPSR");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
if ((OpCode & 0x0db00000) == 0x01200000) {
|
if ((OpCode & 0x0db00000) == 0x01200000) {
|
||||||
// A4.1.38 MSR{<cond>} CPSR_<fields>, #<immediate> MSR{<cond>} CPSR_<fields>, <Rm>
|
// A4.1.38 MSR{<cond>} CPSR_<fields>, #<immediate> MSR{<cond>} CPSR_<fields>, <Rm>
|
||||||
if (I) {
|
if (Imm) {
|
||||||
// MSR{<cond>} CPSR_<fields>, #<immediate>
|
// MSR{<cond>} CPSR_<fields>, #<immediate>
|
||||||
AsciiSPrint (Buf, Size, "MRS%a %a_%a, #0x%x", COND (OpCode), B ? "SPSR" : "CPSR", FieldMask ((OpCode >> 16) & 0xf), RotateRight (OpCode & 0xf, ((OpCode >> 8) & 0xf) *2));
|
AsciiSPrint (Buf, Size, "MRS%a %a_%a, #0x%x", COND (OpCode), WriteBack ? "SPSR" : "CPSR", FieldMask ((OpCode >> 16) & 0xf), RotateRight (OpCode & 0xf, ((OpCode >> 8) & 0xf) *2));
|
||||||
} else {
|
} else {
|
||||||
// MSR{<cond>} CPSR_<fields>, <Rm>
|
// MSR{<cond>} CPSR_<fields>, <Rm>
|
||||||
AsciiSPrint (Buf, Size, "MRS%a %a_%a, %a", COND (OpCode), B ? "SPSR" : "CPSR", gReg[Rd]);
|
AsciiSPrint (Buf, Size, "MRS%a %a_%a, %a", COND (OpCode), WriteBack ? "SPSR" : "CPSR", gReg[Rd]);
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -416,35 +417,35 @@ DisassembleArmInstruction (
|
|||||||
if ((OpCode & 0x0e000000) == 0x0c000000) {
|
if ((OpCode & 0x0e000000) == 0x0c000000) {
|
||||||
// A4.1.19 LDC and A4.1.96 SDC
|
// A4.1.19 LDC and A4.1.96 SDC
|
||||||
if ((OpCode & 0xf0000000) == 0xf0000000) {
|
if ((OpCode & 0xf0000000) == 0xf0000000) {
|
||||||
Index = AsciiSPrint (Buf, Size, "%a2 0x%x, CR%d, ", L ? "LDC":"SDC", (OpCode >> 8) & 0xf, Rd);
|
Index = AsciiSPrint (Buf, Size, "%a2 0x%x, CR%d, ", Load ? "LDC":"SDC", (OpCode >> 8) & 0xf, Rd);
|
||||||
} else {
|
} else {
|
||||||
Index = AsciiSPrint (Buf, Size, "%a%a 0x%x, CR%d, ", L ? "LDC":"SDC", COND (OpCode), (OpCode >> 8) & 0xf, Rd);
|
Index = AsciiSPrint (Buf, Size, "%a%a 0x%x, CR%d, ", Load ? "LDC":"SDC", COND (OpCode), (OpCode >> 8) & 0xf, Rd);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!P) {
|
if (!Pre) {
|
||||||
if (!W) {
|
if (!Write) {
|
||||||
// A5.5.5.5 [<Rn>], <option>
|
// A5.5.5.5 [<Rn>], <option>
|
||||||
AsciiSPrint (&Buf[Index], Size - Index, "[%a], {0x%x}", gReg[Rn], OpCode & 0xff);
|
AsciiSPrint (&Buf[Index], Size - Index, "[%a], {0x%x}", gReg[Rn], OpCode & 0xff);
|
||||||
} else {
|
} else {
|
||||||
// A.5.5.4 [<Rn>], #+/-<offset_8>*4
|
// A.5.5.4 [<Rn>], #+/-<offset_8>*4
|
||||||
AsciiSPrint (&Buf[Index], Size - Index, "[%a], #%a0x%x*4", gReg[Rn], SIGN (U), OpCode & 0xff);
|
AsciiSPrint (&Buf[Index], Size - Index, "[%a], #%a0x%x*4", gReg[Rn], SIGN (Up), OpCode & 0xff);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
// A5.5.5.2 [<Rn>, #+/-<offset_8>*4 ]!
|
// A5.5.5.2 [<Rn>, #+/-<offset_8>*4 ]!
|
||||||
AsciiSPrint (&Buf[Index], Size - Index, "[%a, #%a0x%x*4]%a", gReg[Rn], SIGN (U), OpCode & 0xff, WRITE (W));
|
AsciiSPrint (&Buf[Index], Size - Index, "[%a, #%a0x%x*4]%a", gReg[Rn], SIGN (Up), OpCode & 0xff, WRITE (Write));
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((OpCode & 0x0f000010) == 0x0e000010) {
|
if ((OpCode & 0x0f000010) == 0x0e000010) {
|
||||||
// A4.1.32 MRC2, MCR2
|
// A4.1.32 MRC2, MCR2
|
||||||
AsciiSPrint (Buf, Size, "%a%a 0x%x, 0x%x, %a, CR%d, CR%d, 0x%x", L ? "MRC":"MCR", COND (OpCode), (OpCode >> 8) & 0xf, (OpCode >> 20) & 0xf, gReg[Rd], Rn, Rm, (OpCode >> 5) &0x7);
|
AsciiSPrint (Buf, Size, "%a%a 0x%x, 0x%x, %a, CR%d, CR%d, 0x%x", Load ? "MRC":"MCR", COND (OpCode), (OpCode >> 8) & 0xf, (OpCode >> 20) & 0xf, gReg[Rd], Rn, Rm, (OpCode >> 5) &0x7);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((OpCode & 0x0ff00000) == 0x0c400000) {
|
if ((OpCode & 0x0ff00000) == 0x0c400000) {
|
||||||
// A4.1.33 MRRC2, MCRR2
|
// A4.1.33 MRRC2, MCRR2
|
||||||
AsciiSPrint (Buf, Size, "%a%a 0x%x, 0x%x, %a, %a, CR%d", L ? "MRRC":"MCRR", COND (OpCode), (OpCode >> 4) & 0xf, (OpCode >> 20) & 0xf, gReg[Rd], gReg[Rn], Rm);
|
AsciiSPrint (Buf, Size, "%a%a 0x%x, 0x%x, %a, %a, CR%d", Load ? "MRRC":"MCRR", COND (OpCode), (OpCode >> 4) & 0xf, (OpCode >> 20) & 0xf, gReg[Rd], gReg[Rn], Rm);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -9,6 +9,7 @@
|
|||||||
try to reuse existing case entries if possible.
|
try to reuse existing case entries if possible.
|
||||||
|
|
||||||
Copyright (c) 2008 - 2010, Apple Inc. All rights reserved.<BR>
|
Copyright (c) 2008 - 2010, Apple Inc. All rights reserved.<BR>
|
||||||
|
Copyright (c) 2021, Arm Limited. All rights reserved.<BR>
|
||||||
|
|
||||||
SPDX-License-Identifier: BSD-2-Clause-Patent
|
SPDX-License-Identifier: BSD-2-Clause-Patent
|
||||||
|
|
||||||
@@ -451,7 +452,7 @@ SignExtend32 (
|
|||||||
// in the instruction address and you get back the aligned answer
|
// in the instruction address and you get back the aligned answer
|
||||||
//
|
//
|
||||||
UINT32
|
UINT32
|
||||||
PCAlign4 (
|
PcAlign4 (
|
||||||
IN UINT32 Data
|
IN UINT32 Data
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
@@ -486,12 +487,19 @@ DisassembleThumbInstruction (
|
|||||||
UINT32 Index;
|
UINT32 Index;
|
||||||
UINT32 Offset;
|
UINT32 Offset;
|
||||||
UINT16 Rd, Rn, Rm, Rt, Rt2;
|
UINT16 Rd, Rn, Rm, Rt, Rt2;
|
||||||
BOOLEAN H1, H2, imod;
|
BOOLEAN H1Bit; // H1
|
||||||
|
BOOLEAN H2Bit; // H2
|
||||||
|
BOOLEAN IMod; // imod
|
||||||
//BOOLEAN ItFlag;
|
//BOOLEAN ItFlag;
|
||||||
UINT32 PC, Target, msbit, lsbit;
|
UINT32 Pc, Target, MsBit, LsBit;
|
||||||
CHAR8 *Cond;
|
CHAR8 *Cond;
|
||||||
BOOLEAN S, J1, J2, P, U, W;
|
BOOLEAN Sign; // S
|
||||||
UINT32 coproc, opc1, opc2, CRd, CRn, CRm;
|
BOOLEAN J1Bit; // J1
|
||||||
|
BOOLEAN J2Bit; // J2
|
||||||
|
BOOLEAN Pre; // P
|
||||||
|
BOOLEAN UAdd; // U
|
||||||
|
BOOLEAN WriteBack; // W
|
||||||
|
UINT32 Coproc, Opc1, Opc2, CRd, CRn, CRm;
|
||||||
UINT32 Mask;
|
UINT32 Mask;
|
||||||
|
|
||||||
OpCodePtr = *OpCodePtrPtr;
|
OpCodePtr = *OpCodePtrPtr;
|
||||||
@@ -504,10 +512,10 @@ DisassembleThumbInstruction (
|
|||||||
Rd = OpCode & 0x7;
|
Rd = OpCode & 0x7;
|
||||||
Rn = (OpCode >> 3) & 0x7;
|
Rn = (OpCode >> 3) & 0x7;
|
||||||
Rm = (OpCode >> 6) & 0x7;
|
Rm = (OpCode >> 6) & 0x7;
|
||||||
H1 = (OpCode & BIT7) != 0;
|
H1Bit = (OpCode & BIT7) != 0;
|
||||||
H2 = (OpCode & BIT6) != 0;
|
H2Bit = (OpCode & BIT6) != 0;
|
||||||
imod = (OpCode & BIT4) != 0;
|
IMod = (OpCode & BIT4) != 0;
|
||||||
PC = (UINT32)(UINTN)OpCodePtr;
|
Pc = (UINT32)(UINTN)OpCodePtr;
|
||||||
|
|
||||||
// Increment by the minimum instruction size, Thumb2 could be bigger
|
// Increment by the minimum instruction size, Thumb2 could be bigger
|
||||||
*OpCodePtrPtr += 1;
|
*OpCodePtrPtr += 1;
|
||||||
@@ -548,7 +556,7 @@ DisassembleThumbInstruction (
|
|||||||
case LOAD_STORE_FORMAT3:
|
case LOAD_STORE_FORMAT3:
|
||||||
// A6.5.1 <Rd>, [PC, #<8_bit_offset>]
|
// A6.5.1 <Rd>, [PC, #<8_bit_offset>]
|
||||||
Target = (OpCode & 0xff) << 2;
|
Target = (OpCode & 0xff) << 2;
|
||||||
AsciiSPrint (&Buf[Offset], Size - Offset, " r%d, [pc, #0x%x] ;0x%08x", (OpCode >> 8) & 7, Target, PCAlign4 (PC) + Target);
|
AsciiSPrint (&Buf[Offset], Size - Offset, " r%d, [pc, #0x%x] ;0x%08x", (OpCode >> 8) & 7, Target, PcAlign4 (Pc) + Target);
|
||||||
return;
|
return;
|
||||||
case LOAD_STORE_FORMAT4:
|
case LOAD_STORE_FORMAT4:
|
||||||
// Rt, [SP, #imm8]
|
// Rt, [SP, #imm8]
|
||||||
@@ -583,16 +591,16 @@ DisassembleThumbInstruction (
|
|||||||
Cond = gCondition[(OpCode >> 8) & 0xf];
|
Cond = gCondition[(OpCode >> 8) & 0xf];
|
||||||
Buf[Offset-5] = *Cond++;
|
Buf[Offset-5] = *Cond++;
|
||||||
Buf[Offset-4] = *Cond;
|
Buf[Offset-4] = *Cond;
|
||||||
AsciiSPrint (&Buf[Offset], Size - Offset, " 0x%04x", PC + 4 + SignExtend32 ((OpCode & 0xff) << 1, BIT8));
|
AsciiSPrint (&Buf[Offset], Size - Offset, " 0x%04x", Pc + 4 + SignExtend32 ((OpCode & 0xff) << 1, BIT8));
|
||||||
return;
|
return;
|
||||||
case UNCONDITIONAL_BRANCH_SHORT:
|
case UNCONDITIONAL_BRANCH_SHORT:
|
||||||
// A6.3.2 B <target_address>
|
// A6.3.2 B <target_address>
|
||||||
AsciiSPrint (&Buf[Offset], Size - Offset, " 0x%04x", PC + 4 + SignExtend32 ((OpCode & 0x3ff) << 1, BIT11));
|
AsciiSPrint (&Buf[Offset], Size - Offset, " 0x%04x", Pc + 4 + SignExtend32 ((OpCode & 0x3ff) << 1, BIT11));
|
||||||
return;
|
return;
|
||||||
|
|
||||||
case BRANCH_EXCHANGE:
|
case BRANCH_EXCHANGE:
|
||||||
// A6.3.3 BX|BLX <Rm>
|
// A6.3.3 BX|BLX <Rm>
|
||||||
AsciiSPrint (&Buf[Offset], Size - Offset, " %a", gReg[Rn | (H2 ? 8:0)]);
|
AsciiSPrint (&Buf[Offset], Size - Offset, " %a", gReg[Rn | (H2Bit ? 8:0)]);
|
||||||
return;
|
return;
|
||||||
|
|
||||||
case DATA_FORMAT1:
|
case DATA_FORMAT1:
|
||||||
@@ -629,12 +637,12 @@ DisassembleThumbInstruction (
|
|||||||
return;
|
return;
|
||||||
case DATA_FORMAT8:
|
case DATA_FORMAT8:
|
||||||
// A6.4.3 <Rd>|<Rn>, <Rm>
|
// A6.4.3 <Rd>|<Rn>, <Rm>
|
||||||
AsciiSPrint (&Buf[Offset], Size - Offset, " %a, %a", gReg[Rd | (H1 ? 8:0)], gReg[Rn | (H2 ? 8:0)]);
|
AsciiSPrint (&Buf[Offset], Size - Offset, " %a, %a", gReg[Rd | (H1Bit ? 8:0)], gReg[Rn | (H2Bit ? 8:0)]);
|
||||||
return;
|
return;
|
||||||
|
|
||||||
case CPS_FORMAT:
|
case CPS_FORMAT:
|
||||||
// A7.1.24
|
// A7.1.24
|
||||||
AsciiSPrint (&Buf[Offset], Size - Offset, "%a %a%a%a", imod ? "ID":"IE", ((OpCode & BIT2) == 0) ? "":"a", ((OpCode & BIT1) == 0) ? "":"i", ((OpCode & BIT0) == 0) ? "":"f");
|
AsciiSPrint (&Buf[Offset], Size - Offset, "%a %a%a%a", IMod ? "ID":"IE", ((OpCode & BIT2) == 0) ? "":"a", ((OpCode & BIT1) == 0) ? "":"i", ((OpCode & BIT0) == 0) ? "":"f");
|
||||||
return;
|
return;
|
||||||
|
|
||||||
case ENDIAN_FORMAT:
|
case ENDIAN_FORMAT:
|
||||||
@@ -645,13 +653,13 @@ DisassembleThumbInstruction (
|
|||||||
case DATA_CBZ:
|
case DATA_CBZ:
|
||||||
// CB{N}Z <Rn>, <Lable>
|
// CB{N}Z <Rn>, <Lable>
|
||||||
Target = ((OpCode >> 2) & 0x3e) | (((OpCode & BIT9) == BIT9) ? BIT6 : 0);
|
Target = ((OpCode >> 2) & 0x3e) | (((OpCode & BIT9) == BIT9) ? BIT6 : 0);
|
||||||
AsciiSPrint (&Buf[Offset], Size - Offset, " %a, %08x", gReg[Rd], PC + 4 + Target);
|
AsciiSPrint (&Buf[Offset], Size - Offset, " %a, %08x", gReg[Rd], Pc + 4 + Target);
|
||||||
return;
|
return;
|
||||||
|
|
||||||
case ADR_FORMAT:
|
case ADR_FORMAT:
|
||||||
// ADR <Rd>, <Label>
|
// ADR <Rd>, <Label>
|
||||||
Target = (OpCode & 0xff) << 2;
|
Target = (OpCode & 0xff) << 2;
|
||||||
AsciiSPrint (&Buf[Offset], Size - Offset, " %a, %08x", gReg[(OpCode >> 8) & 7], PCAlign4 (PC) + Target);
|
AsciiSPrint (&Buf[Offset], Size - Offset, " %a, %08x", gReg[(OpCode >> 8) & 7], PcAlign4 (Pc) + Target);
|
||||||
return;
|
return;
|
||||||
|
|
||||||
case IT_BLOCK:
|
case IT_BLOCK:
|
||||||
@@ -708,32 +716,32 @@ DisassembleThumbInstruction (
|
|||||||
Target |= ((OpCode32 & BIT13) == BIT13)? BIT18 : 0; // J1
|
Target |= ((OpCode32 & BIT13) == BIT13)? BIT18 : 0; // J1
|
||||||
Target |= ((OpCode32 & BIT26) == BIT26)? BIT20 : 0; // S
|
Target |= ((OpCode32 & BIT26) == BIT26)? BIT20 : 0; // S
|
||||||
Target = SignExtend32 (Target, BIT20);
|
Target = SignExtend32 (Target, BIT20);
|
||||||
AsciiSPrint (&Buf[Offset], Size - Offset, " 0x%08x", PC + 4 + Target);
|
AsciiSPrint (&Buf[Offset], Size - Offset, " 0x%08x", Pc + 4 + Target);
|
||||||
return;
|
return;
|
||||||
case B_T4:
|
case B_T4:
|
||||||
// S:I1:I2:imm10:imm11:0
|
// S:I1:I2:imm10:imm11:0
|
||||||
Target = ((OpCode32 << 1) & 0xffe) + ((OpCode32 >> 4) & 0x3ff000);
|
Target = ((OpCode32 << 1) & 0xffe) + ((OpCode32 >> 4) & 0x3ff000);
|
||||||
S = (OpCode32 & BIT26) == BIT26;
|
Sign = (OpCode32 & BIT26) == BIT26;
|
||||||
J1 = (OpCode32 & BIT13) == BIT13;
|
J1Bit = (OpCode32 & BIT13) == BIT13;
|
||||||
J2 = (OpCode32 & BIT11) == BIT11;
|
J2Bit = (OpCode32 & BIT11) == BIT11;
|
||||||
Target |= (!(J2 ^ S) ? BIT22 : 0); // I2
|
Target |= (!(J2Bit ^ Sign) ? BIT22 : 0); // I2
|
||||||
Target |= (!(J1 ^ S) ? BIT23 : 0); // I1
|
Target |= (!(J1Bit ^ Sign) ? BIT23 : 0); // I1
|
||||||
Target |= (S ? BIT24 : 0); // S
|
Target |= (Sign ? BIT24 : 0); // S
|
||||||
Target = SignExtend32 (Target, BIT24);
|
Target = SignExtend32 (Target, BIT24);
|
||||||
AsciiSPrint (&Buf[Offset], Size - Offset, " 0x%08x", PC + 4 + Target);
|
AsciiSPrint (&Buf[Offset], Size - Offset, " 0x%08x", Pc + 4 + Target);
|
||||||
return;
|
return;
|
||||||
|
|
||||||
case BL_T2:
|
case BL_T2:
|
||||||
// BLX S:I1:I2:imm10:imm11:0
|
// BLX S:I1:I2:imm10:imm11:0
|
||||||
Target = ((OpCode32 << 1) & 0xffc) + ((OpCode32 >> 4) & 0x3ff000);
|
Target = ((OpCode32 << 1) & 0xffc) + ((OpCode32 >> 4) & 0x3ff000);
|
||||||
S = (OpCode32 & BIT26) == BIT26;
|
Sign = (OpCode32 & BIT26) == BIT26;
|
||||||
J1 = (OpCode32 & BIT13) == BIT13;
|
J1Bit = (OpCode32 & BIT13) == BIT13;
|
||||||
J2 = (OpCode32 & BIT11) == BIT11;
|
J2Bit = (OpCode32 & BIT11) == BIT11;
|
||||||
Target |= (!(J2 ^ S) ? BIT23 : 0); // I2
|
Target |= (!(J2Bit ^ Sign) ? BIT23 : 0); // I2
|
||||||
Target |= (!(J1 ^ S) ? BIT24 : 0); // I1
|
Target |= (!(J1Bit ^ Sign) ? BIT24 : 0); // I1
|
||||||
Target |= (S ? BIT25 : 0); // S
|
Target |= (Sign ? BIT25 : 0); // S
|
||||||
Target = SignExtend32 (Target, BIT25);
|
Target = SignExtend32 (Target, BIT25);
|
||||||
AsciiSPrint (&Buf[Offset], Size - Offset, " 0x%08x", PCAlign4 (PC) + Target);
|
AsciiSPrint (&Buf[Offset], Size - Offset, " 0x%08x", PcAlign4 (Pc) + Target);
|
||||||
return;
|
return;
|
||||||
|
|
||||||
case POP_T2:
|
case POP_T2:
|
||||||
@@ -748,8 +756,8 @@ DisassembleThumbInstruction (
|
|||||||
|
|
||||||
case STM_FORMAT:
|
case STM_FORMAT:
|
||||||
// <Rn>{!}, <registers>
|
// <Rn>{!}, <registers>
|
||||||
W = (OpCode32 & BIT21) == BIT21;
|
WriteBack = (OpCode32 & BIT21) == BIT21;
|
||||||
AsciiSPrint (&Buf[Offset], Size - Offset, " %a%a, %a", gReg[(OpCode32 >> 16) & 0xf], W ? "!":"", ThumbMRegList (OpCode32 & 0xffff));
|
AsciiSPrint (&Buf[Offset], Size - Offset, " %a%a, %a", gReg[(OpCode32 >> 16) & 0xf], WriteBack ? "!":"", ThumbMRegList (OpCode32 & 0xffff));
|
||||||
return;
|
return;
|
||||||
|
|
||||||
case LDM_REG_IMM12_SIGNED:
|
case LDM_REG_IMM12_SIGNED:
|
||||||
@@ -759,7 +767,7 @@ DisassembleThumbInstruction (
|
|||||||
// U == 0 means subtrack, U == 1 means add
|
// U == 0 means subtrack, U == 1 means add
|
||||||
Target = -Target;
|
Target = -Target;
|
||||||
}
|
}
|
||||||
AsciiSPrint (&Buf[Offset], Size - Offset, " %a, %a", gReg[(OpCode32 >> 12) & 0xf], PCAlign4 (PC) + Target);
|
AsciiSPrint (&Buf[Offset], Size - Offset, " %a, %a", gReg[(OpCode32 >> 12) & 0xf], PcAlign4 (Pc) + Target);
|
||||||
return;
|
return;
|
||||||
|
|
||||||
case LDM_REG_INDIRECT_LSL:
|
case LDM_REG_INDIRECT_LSL:
|
||||||
@@ -784,36 +792,36 @@ DisassembleThumbInstruction (
|
|||||||
|
|
||||||
case LDM_REG_IMM8:
|
case LDM_REG_IMM8:
|
||||||
// <rt>, [<rn>, {, #<imm8>}]{!}
|
// <rt>, [<rn>, {, #<imm8>}]{!}
|
||||||
W = (OpCode32 & BIT8) == BIT8;
|
WriteBack = (OpCode32 & BIT8) == BIT8;
|
||||||
U = (OpCode32 & BIT9) == BIT9;
|
UAdd = (OpCode32 & BIT9) == BIT9;
|
||||||
P = (OpCode32 & BIT10) == BIT10;
|
Pre = (OpCode32 & BIT10) == BIT10;
|
||||||
Offset += AsciiSPrint (&Buf[Offset], Size - Offset, " %a, [%a", gReg[Rt], gReg[Rn]);
|
Offset += AsciiSPrint (&Buf[Offset], Size - Offset, " %a, [%a", gReg[Rt], gReg[Rn]);
|
||||||
if (P) {
|
if (Pre) {
|
||||||
if ((OpCode32 & 0xff) == 0) {
|
if ((OpCode32 & 0xff) == 0) {
|
||||||
AsciiSPrint (&Buf[Offset], Size - Offset, "]%a", W?"!":"");
|
AsciiSPrint (&Buf[Offset], Size - Offset, "]%a", WriteBack?"!":"");
|
||||||
} else {
|
} else {
|
||||||
AsciiSPrint (&Buf[Offset], Size - Offset, ", #%a0x%x]%a", U?"":"-" , OpCode32 & 0xff, W?"!":"");
|
AsciiSPrint (&Buf[Offset], Size - Offset, ", #%a0x%x]%a", UAdd?"":"-" , OpCode32 & 0xff, WriteBack?"!":"");
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
AsciiSPrint (&Buf[Offset], Size - Offset, "], #%a0x%x", U?"":"-", OpCode32 & 0xff);
|
AsciiSPrint (&Buf[Offset], Size - Offset, "], #%a0x%x", UAdd?"":"-", OpCode32 & 0xff);
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
|
|
||||||
case LDRD_REG_IMM8_SIGNED:
|
case LDRD_REG_IMM8_SIGNED:
|
||||||
// LDRD <rt>, <rt2>, [<rn>, {, #<imm8>]}{!}
|
// LDRD <rt>, <rt2>, [<rn>, {, #<imm8>]}{!}
|
||||||
P = (OpCode32 & BIT24) == BIT24; // index = P
|
Pre = (OpCode32 & BIT24) == BIT24; // index = P
|
||||||
U = (OpCode32 & BIT23) == BIT23;
|
UAdd = (OpCode32 & BIT23) == BIT23;
|
||||||
W = (OpCode32 & BIT21) == BIT21;
|
WriteBack = (OpCode32 & BIT21) == BIT21;
|
||||||
Offset += AsciiSPrint (&Buf[Offset], Size - Offset, " %a, %a, [%a", gReg[Rt], gReg[Rt2], gReg[Rn]);
|
Offset += AsciiSPrint (&Buf[Offset], Size - Offset, " %a, %a, [%a", gReg[Rt], gReg[Rt2], gReg[Rn]);
|
||||||
if (P) {
|
if (Pre) {
|
||||||
if ((OpCode32 & 0xff) == 0) {
|
if ((OpCode32 & 0xff) == 0) {
|
||||||
AsciiSPrint (&Buf[Offset], Size - Offset, "]");
|
AsciiSPrint (&Buf[Offset], Size - Offset, "]");
|
||||||
} else {
|
} else {
|
||||||
AsciiSPrint (&Buf[Offset], Size - Offset, ", #%a0x%x]%a", U?"":"-", (OpCode32 & 0xff) << 2, W?"!":"");
|
AsciiSPrint (&Buf[Offset], Size - Offset, ", #%a0x%x]%a", UAdd?"":"-", (OpCode32 & 0xff) << 2, WriteBack?"!":"");
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if ((OpCode32 & 0xff) != 0) {
|
if ((OpCode32 & 0xff) != 0) {
|
||||||
AsciiSPrint (&Buf[Offset], Size - Offset, ", #%a0x%x", U?"":"-", (OpCode32 & 0xff) << 2);
|
AsciiSPrint (&Buf[Offset], Size - Offset, ", #%a0x%x", UAdd?"":"-", (OpCode32 & 0xff) << 2);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
@@ -825,7 +833,7 @@ DisassembleThumbInstruction (
|
|||||||
// U == 0 means subtrack, U == 1 means add
|
// U == 0 means subtrack, U == 1 means add
|
||||||
Target = -Target;
|
Target = -Target;
|
||||||
}
|
}
|
||||||
AsciiSPrint (&Buf[Offset], Size - Offset, " %a, %a, %a", gReg[Rt], gReg[Rt2], PC + 4 + Target);
|
AsciiSPrint (&Buf[Offset], Size - Offset, " %a, %a, %a", gReg[Rt], gReg[Rt2], Pc + 4 + Target);
|
||||||
return;
|
return;
|
||||||
|
|
||||||
case LDREXB:
|
case LDREXB:
|
||||||
@@ -840,14 +848,14 @@ DisassembleThumbInstruction (
|
|||||||
|
|
||||||
case SRS_FORMAT:
|
case SRS_FORMAT:
|
||||||
// SP{!}, #<mode>
|
// SP{!}, #<mode>
|
||||||
W = (OpCode32 & BIT21) == BIT21;
|
WriteBack = (OpCode32 & BIT21) == BIT21;
|
||||||
AsciiSPrint (&Buf[Offset], Size - Offset, " SP%a, #0x%x", W?"!":"", OpCode32 & 0x1f);
|
AsciiSPrint (&Buf[Offset], Size - Offset, " SP%a, #0x%x", WriteBack?"!":"", OpCode32 & 0x1f);
|
||||||
return;
|
return;
|
||||||
|
|
||||||
case RFE_FORMAT:
|
case RFE_FORMAT:
|
||||||
// <Rn>{!}
|
// <Rn>{!}
|
||||||
W = (OpCode32 & BIT21) == BIT21;
|
WriteBack = (OpCode32 & BIT21) == BIT21;
|
||||||
AsciiSPrint (&Buf[Offset], Size - Offset, " %a%a, #0x%x", gReg[Rn], W?"!":"");
|
AsciiSPrint (&Buf[Offset], Size - Offset, " %a%a, #0x%x", gReg[Rn], WriteBack?"!":"");
|
||||||
return;
|
return;
|
||||||
|
|
||||||
case ADD_IMM12:
|
case ADD_IMM12:
|
||||||
@@ -917,9 +925,9 @@ DisassembleThumbInstruction (
|
|||||||
// ADDR <Rd>, <label>
|
// ADDR <Rd>, <label>
|
||||||
Target = (OpCode32 & 0xff) | ((OpCode32 >> 8) & 0x700) | ((OpCode & BIT26) == BIT26 ? BIT11 : 0);
|
Target = (OpCode32 & 0xff) | ((OpCode32 >> 8) & 0x700) | ((OpCode & BIT26) == BIT26 ? BIT11 : 0);
|
||||||
if ((OpCode & (BIT23 | BIT21)) == (BIT23 | BIT21)) {
|
if ((OpCode & (BIT23 | BIT21)) == (BIT23 | BIT21)) {
|
||||||
Target = PCAlign4 (PC) - Target;
|
Target = PcAlign4 (Pc) - Target;
|
||||||
} else {
|
} else {
|
||||||
Target = PCAlign4 (PC) + Target;
|
Target = PcAlign4 (Pc) + Target;
|
||||||
}
|
}
|
||||||
AsciiSPrint (&Buf[Offset], Size - Offset, " %a, 0x%08x", gReg[Rd], Target);
|
AsciiSPrint (&Buf[Offset], Size - Offset, " %a, 0x%08x", gReg[Rd], Target);
|
||||||
return;
|
return;
|
||||||
@@ -932,52 +940,52 @@ DisassembleThumbInstruction (
|
|||||||
|
|
||||||
case BFC_THUMB2:
|
case BFC_THUMB2:
|
||||||
// BFI <Rd>, <Rn>, #<lsb>, #<width>
|
// BFI <Rd>, <Rn>, #<lsb>, #<width>
|
||||||
msbit = OpCode32 & 0x1f;
|
MsBit = OpCode32 & 0x1f;
|
||||||
lsbit = ((OpCode32 >> 6) & 3) | ((OpCode >> 10) & 0x1c);
|
LsBit = ((OpCode32 >> 6) & 3) | ((OpCode >> 10) & 0x1c);
|
||||||
if ((Rn == 0xf) & (AsciiStrCmp (gOpThumb2[Index].Start, "BFC") == 0)){
|
if ((Rn == 0xf) & (AsciiStrCmp (gOpThumb2[Index].Start, "BFC") == 0)){
|
||||||
// BFC <Rd>, #<lsb>, #<width>
|
// BFC <Rd>, #<lsb>, #<width>
|
||||||
AsciiSPrint (&Buf[Offset], Size - Offset, " %a, #%d, #%d", gReg[Rd], lsbit, msbit - lsbit + 1);
|
AsciiSPrint (&Buf[Offset], Size - Offset, " %a, #%d, #%d", gReg[Rd], LsBit, MsBit - LsBit + 1);
|
||||||
} else if (AsciiStrCmp (gOpThumb2[Index].Start, "BFI") == 0) {
|
} else if (AsciiStrCmp (gOpThumb2[Index].Start, "BFI") == 0) {
|
||||||
AsciiSPrint (&Buf[Offset], Size - Offset, " %a, %a, #%d, #%d", gReg[Rd], gReg[Rn], lsbit, msbit - lsbit + 1);
|
AsciiSPrint (&Buf[Offset], Size - Offset, " %a, %a, #%d, #%d", gReg[Rd], gReg[Rn], LsBit, MsBit - LsBit + 1);
|
||||||
} else {
|
} else {
|
||||||
AsciiSPrint (&Buf[Offset], Size - Offset, " %a, %a, #%d, #%d", gReg[Rd], gReg[Rn], lsbit, msbit + 1);
|
AsciiSPrint (&Buf[Offset], Size - Offset, " %a, %a, #%d, #%d", gReg[Rd], gReg[Rn], LsBit, MsBit + 1);
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
|
|
||||||
case CPD_THUMB2:
|
case CPD_THUMB2:
|
||||||
// <coproc>,<opc1>,<CRd>,<CRn>,<CRm>,<opc2>
|
// <coproc>,<opc1>,<CRd>,<CRn>,<CRm>,<opc2>
|
||||||
coproc = (OpCode32 >> 8) & 0xf;
|
Coproc = (OpCode32 >> 8) & 0xf;
|
||||||
opc1 = (OpCode32 >> 20) & 0xf;
|
Opc1 = (OpCode32 >> 20) & 0xf;
|
||||||
opc2 = (OpCode32 >> 5) & 0x7;
|
Opc2 = (OpCode32 >> 5) & 0x7;
|
||||||
CRd = (OpCode32 >> 12) & 0xf;
|
CRd = (OpCode32 >> 12) & 0xf;
|
||||||
CRn = (OpCode32 >> 16) & 0xf;
|
CRn = (OpCode32 >> 16) & 0xf;
|
||||||
CRm = OpCode32 & 0xf;
|
CRm = OpCode32 & 0xf;
|
||||||
Offset += AsciiSPrint (&Buf[Offset], Size - Offset, " p%d,#%d,c%d,c%d,c%d", coproc, opc1, CRd, CRn, CRm);
|
Offset += AsciiSPrint (&Buf[Offset], Size - Offset, " p%d,#%d,c%d,c%d,c%d", Coproc, Opc1, CRd, CRn, CRm);
|
||||||
if (opc2 != 0) {
|
if (Opc2 != 0) {
|
||||||
AsciiSPrint (&Buf[Offset], Size - Offset, ",#%d,", opc2);
|
AsciiSPrint (&Buf[Offset], Size - Offset, ",#%d,", Opc2);
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
|
|
||||||
case MRC_THUMB2:
|
case MRC_THUMB2:
|
||||||
// MRC <coproc>,<opc1>,<Rt>,<CRn>,<CRm>,<opc2>
|
// MRC <coproc>,<opc1>,<Rt>,<CRn>,<CRm>,<opc2>
|
||||||
coproc = (OpCode32 >> 8) & 0xf;
|
Coproc = (OpCode32 >> 8) & 0xf;
|
||||||
opc1 = (OpCode32 >> 20) & 0xf;
|
Opc1 = (OpCode32 >> 20) & 0xf;
|
||||||
opc2 = (OpCode32 >> 5) & 0x7;
|
Opc2 = (OpCode32 >> 5) & 0x7;
|
||||||
CRn = (OpCode32 >> 16) & 0xf;
|
CRn = (OpCode32 >> 16) & 0xf;
|
||||||
CRm = OpCode32 & 0xf;
|
CRm = OpCode32 & 0xf;
|
||||||
Offset += AsciiSPrint (&Buf[Offset], Size - Offset, " p%d,#%d,%a,c%d,c%d", coproc, opc1, gReg[Rt], CRn, CRm);
|
Offset += AsciiSPrint (&Buf[Offset], Size - Offset, " p%d,#%d,%a,c%d,c%d", Coproc, Opc1, gReg[Rt], CRn, CRm);
|
||||||
if (opc2 != 0) {
|
if (Opc2 != 0) {
|
||||||
AsciiSPrint (&Buf[Offset], Size - Offset, ",#%d,", opc2);
|
AsciiSPrint (&Buf[Offset], Size - Offset, ",#%d,", Opc2);
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
|
|
||||||
case MRRC_THUMB2:
|
case MRRC_THUMB2:
|
||||||
// MRC <coproc>,<opc1>,<Rt>,<Rt2>,<CRm>,<opc2>
|
// MRC <coproc>,<opc1>,<Rt>,<Rt2>,<CRm>,<opc2>
|
||||||
coproc = (OpCode32 >> 8) & 0xf;
|
Coproc = (OpCode32 >> 8) & 0xf;
|
||||||
opc1 = (OpCode32 >> 20) & 0xf;
|
Opc1 = (OpCode32 >> 20) & 0xf;
|
||||||
CRn = (OpCode32 >> 16) & 0xf;
|
CRn = (OpCode32 >> 16) & 0xf;
|
||||||
CRm = OpCode32 & 0xf;
|
CRm = OpCode32 & 0xf;
|
||||||
Offset += AsciiSPrint (&Buf[Offset], Size - Offset, " p%d,#%d,%a,%a,c%d", coproc, opc1, gReg[Rt], gReg[Rt2], CRm);
|
Offset += AsciiSPrint (&Buf[Offset], Size - Offset, " p%d,#%d,%a,%a,c%d", Coproc, Opc1, gReg[Rt], gReg[Rt2], CRm);
|
||||||
return;
|
return;
|
||||||
|
|
||||||
case THUMB2_2REGS:
|
case THUMB2_2REGS:
|
||||||
|
@@ -2,6 +2,7 @@
|
|||||||
* Exception Handling support specific for AArch64
|
* Exception Handling support specific for AArch64
|
||||||
*
|
*
|
||||||
* Copyright (c) 2016 HP Development Company, L.P.
|
* Copyright (c) 2016 HP Development Company, L.P.
|
||||||
|
* Copyright (c) 2021, Arm Limited. All rights reserved.<BR>
|
||||||
*
|
*
|
||||||
* SPDX-License-Identifier: BSD-2-Clause-Patent
|
* SPDX-License-Identifier: BSD-2-Clause-Patent
|
||||||
*
|
*
|
||||||
@@ -27,7 +28,8 @@ RegisterEl0Stack (
|
|||||||
IN VOID *Stack
|
IN VOID *Stack
|
||||||
);
|
);
|
||||||
|
|
||||||
RETURN_STATUS ArchVectorConfig(
|
RETURN_STATUS
|
||||||
|
ArchVectorConfig (
|
||||||
IN UINTN VectorBaseAddress
|
IN UINTN VectorBaseAddress
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
|
@@ -1,5 +1,5 @@
|
|||||||
//
|
//
|
||||||
// Copyright (c) 2011 - 2014 ARM LTD. All rights reserved.<BR>
|
// Copyright (c) 2011 - 2021, Arm Limited. All rights reserved.<BR>
|
||||||
// Portion of Copyright (c) 2014 NVIDIA Corporation. All rights reserved.<BR>
|
// Portion of Copyright (c) 2014 NVIDIA Corporation. All rights reserved.<BR>
|
||||||
// Copyright (c) 2016 HP Development Company, L.P.
|
// Copyright (c) 2016 HP Development Company, L.P.
|
||||||
//
|
//
|
||||||
@@ -200,19 +200,19 @@ ASM_PFX(SErrorSP0):
|
|||||||
//
|
//
|
||||||
// Current EL with SPx: 0x200 - 0x380
|
// Current EL with SPx: 0x200 - 0x380
|
||||||
//
|
//
|
||||||
VECTOR_ENTRY(ExceptionHandlersStart, ARM_VECTOR_CUR_SPx_SYNC)
|
VECTOR_ENTRY(ExceptionHandlersStart, ARM_VECTOR_CUR_SPX_SYNC)
|
||||||
ASM_PFX(SynchronousExceptionSPx):
|
ASM_PFX(SynchronousExceptionSPx):
|
||||||
ExceptionEntry EXCEPT_AARCH64_SYNCHRONOUS_EXCEPTIONS, SP0
|
ExceptionEntry EXCEPT_AARCH64_SYNCHRONOUS_EXCEPTIONS, SP0
|
||||||
|
|
||||||
VECTOR_ENTRY(ExceptionHandlersStart, ARM_VECTOR_CUR_SPx_IRQ)
|
VECTOR_ENTRY(ExceptionHandlersStart, ARM_VECTOR_CUR_SPX_IRQ)
|
||||||
ASM_PFX(IrqSPx):
|
ASM_PFX(IrqSPx):
|
||||||
ExceptionEntry EXCEPT_AARCH64_IRQ
|
ExceptionEntry EXCEPT_AARCH64_IRQ
|
||||||
|
|
||||||
VECTOR_ENTRY(ExceptionHandlersStart, ARM_VECTOR_CUR_SPx_FIQ)
|
VECTOR_ENTRY(ExceptionHandlersStart, ARM_VECTOR_CUR_SPX_FIQ)
|
||||||
ASM_PFX(FiqSPx):
|
ASM_PFX(FiqSPx):
|
||||||
ExceptionEntry EXCEPT_AARCH64_FIQ
|
ExceptionEntry EXCEPT_AARCH64_FIQ
|
||||||
|
|
||||||
VECTOR_ENTRY(ExceptionHandlersStart, ARM_VECTOR_CUR_SPx_SERR)
|
VECTOR_ENTRY(ExceptionHandlersStart, ARM_VECTOR_CUR_SPX_SERR)
|
||||||
ASM_PFX(SErrorSPx):
|
ASM_PFX(SErrorSPx):
|
||||||
ExceptionEntry EXCEPT_AARCH64_SERROR
|
ExceptionEntry EXCEPT_AARCH64_SERROR
|
||||||
|
|
||||||
|
@@ -2,7 +2,7 @@
|
|||||||
* Exception handling support specific for ARM
|
* Exception handling support specific for ARM
|
||||||
*
|
*
|
||||||
* Copyright (c) 2008 - 2009, Apple Inc. All rights reserved.<BR>
|
* Copyright (c) 2008 - 2009, Apple Inc. All rights reserved.<BR>
|
||||||
* Copyright (c) 2014, ARM Limited. All rights reserved.<BR>
|
* Copyright (c) 2014 - 2021, Arm Limited. All rights reserved.<BR>
|
||||||
* Copyright (c) 2016 HP Development Company, L.P.<BR>
|
* Copyright (c) 2016 HP Development Company, L.P.<BR>
|
||||||
*
|
*
|
||||||
* SPDX-License-Identifier: BSD-2-Clause-Patent
|
* SPDX-License-Identifier: BSD-2-Clause-Patent
|
||||||
@@ -26,7 +26,8 @@ PHYSICAL_ADDRESS gExceptionVectorAlignmentMask = ARM_VECTOR_TABLE_ALIGNME
|
|||||||
// NOTE: This code assumes vectors are ARM and not Thumb code
|
// NOTE: This code assumes vectors are ARM and not Thumb code
|
||||||
UINTN gDebuggerNoHandlerValue = 0xEAFFFFFE;
|
UINTN gDebuggerNoHandlerValue = 0xEAFFFFFE;
|
||||||
|
|
||||||
RETURN_STATUS ArchVectorConfig(
|
RETURN_STATUS
|
||||||
|
ArchVectorConfig (
|
||||||
IN UINTN VectorBaseAddress
|
IN UINTN VectorBaseAddress
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
|
@@ -8,8 +8,8 @@
|
|||||||
|
|
||||||
**/
|
**/
|
||||||
|
|
||||||
#ifndef __AARCH64_LIB_H__
|
#ifndef AARCH64_LIB_H_
|
||||||
#define __AARCH64_LIB_H__
|
#define AARCH64_LIB_H_
|
||||||
|
|
||||||
typedef VOID (*AARCH64_CACHE_OPERATION)(UINTN);
|
typedef VOID (*AARCH64_CACHE_OPERATION)(UINTN);
|
||||||
|
|
||||||
@@ -52,5 +52,5 @@ ArmReadIdAA64Mmfr2 (
|
|||||||
VOID
|
VOID
|
||||||
);
|
);
|
||||||
|
|
||||||
#endif // __AARCH64_LIB_H__
|
#endif // AARCH64_LIB_H_
|
||||||
|
|
||||||
|
@@ -6,8 +6,8 @@
|
|||||||
|
|
||||||
**/
|
**/
|
||||||
|
|
||||||
#ifndef __ARM_V7_LIB_H__
|
#ifndef ARM_V7_LIB_H_
|
||||||
#define __ARM_V7_LIB_H__
|
#define ARM_V7_LIB_H_
|
||||||
|
|
||||||
#define ID_MMFR0_SHARELVL_SHIFT 12
|
#define ID_MMFR0_SHARELVL_SHIFT 12
|
||||||
#define ID_MMFR0_SHARELVL_MASK 0xf
|
#define ID_MMFR0_SHARELVL_MASK 0xf
|
||||||
@@ -64,5 +64,5 @@ ArmReadIdPfr1 (
|
|||||||
VOID
|
VOID
|
||||||
);
|
);
|
||||||
|
|
||||||
#endif // __ARM_V7_LIB_H__
|
#endif // ARM_V7_LIB_H_
|
||||||
|
|
||||||
|
@@ -8,8 +8,8 @@
|
|||||||
|
|
||||||
**/
|
**/
|
||||||
|
|
||||||
#ifndef __ARM_LIB_PRIVATE_H__
|
#ifndef ARM_LIB_PRIVATE_H_
|
||||||
#define __ARM_LIB_PRIVATE_H__
|
#define ARM_LIB_PRIVATE_H_
|
||||||
|
|
||||||
#define CACHE_SIZE_4_KB (3UL)
|
#define CACHE_SIZE_4_KB (3UL)
|
||||||
#define CACHE_SIZE_8_KB (4UL)
|
#define CACHE_SIZE_8_KB (4UL)
|
||||||
@@ -186,4 +186,4 @@ ReadCLIDR (
|
|||||||
VOID
|
VOID
|
||||||
);
|
);
|
||||||
|
|
||||||
#endif // __ARM_LIB_PRIVATE_H__
|
#endif // ARM_LIB_PRIVATE_H_
|
||||||
|
@@ -124,7 +124,7 @@ UpdatePageEntries (
|
|||||||
} else if ((Attributes & EFI_MEMORY_WC) != 0) {
|
} else if ((Attributes & EFI_MEMORY_WC) != 0) {
|
||||||
// modify cacheability attributes
|
// modify cacheability attributes
|
||||||
EntryMask |= TT_DESCRIPTOR_PAGE_CACHE_POLICY_MASK;
|
EntryMask |= TT_DESCRIPTOR_PAGE_CACHE_POLICY_MASK;
|
||||||
// map to normal non-cachable
|
// map to normal non-cacheable
|
||||||
EntryValue |= TT_DESCRIPTOR_PAGE_CACHE_POLICY_NON_CACHEABLE; // TEX [2:0]= 001 = 0x2, B=0, C=0
|
EntryValue |= TT_DESCRIPTOR_PAGE_CACHE_POLICY_NON_CACHEABLE; // TEX [2:0]= 001 = 0x2, B=0, C=0
|
||||||
} else if ((Attributes & EFI_MEMORY_WT) != 0) {
|
} else if ((Attributes & EFI_MEMORY_WT) != 0) {
|
||||||
// modify cacheability attributes
|
// modify cacheability attributes
|
||||||
@@ -254,7 +254,7 @@ UpdateSectionEntries (
|
|||||||
} else if ((Attributes & EFI_MEMORY_WC) != 0) {
|
} else if ((Attributes & EFI_MEMORY_WC) != 0) {
|
||||||
// modify cacheability attributes
|
// modify cacheability attributes
|
||||||
EntryMask |= TT_DESCRIPTOR_SECTION_CACHE_POLICY_MASK;
|
EntryMask |= TT_DESCRIPTOR_SECTION_CACHE_POLICY_MASK;
|
||||||
// map to normal non-cachable
|
// map to normal non-cacheable
|
||||||
EntryValue |= TT_DESCRIPTOR_SECTION_CACHE_POLICY_NON_CACHEABLE; // TEX [2:0]= 001 = 0x2, B=0, C=0
|
EntryValue |= TT_DESCRIPTOR_SECTION_CACHE_POLICY_NON_CACHEABLE; // TEX [2:0]= 001 = 0x2, B=0, C=0
|
||||||
} else if ((Attributes & EFI_MEMORY_WT) != 0) {
|
} else if ((Attributes & EFI_MEMORY_WT) != 0) {
|
||||||
// modify cacheability attributes
|
// modify cacheability attributes
|
||||||
|
@@ -1,11 +1,17 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2019, Linaro Limited
|
* Copyright (c) 2019, Linaro Limited
|
||||||
|
* Copyright (c) 2021, Arm Limited. All rights reserved.<BR>
|
||||||
*
|
*
|
||||||
* SPDX-License-Identifier: BSD-2-Clause-Patent
|
* SPDX-License-Identifier: BSD-2-Clause-Patent
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#ifndef ARM_SOFT_FLOAT_LIB_H_
|
||||||
|
#define ARM_SOFT_FLOAT_LIB_H_
|
||||||
|
|
||||||
#define LITTLEENDIAN 1
|
#define LITTLEENDIAN 1
|
||||||
#define INLINE static inline
|
#define INLINE static inline
|
||||||
#define SOFTFLOAT_BUILTIN_CLZ 1
|
#define SOFTFLOAT_BUILTIN_CLZ 1
|
||||||
#define SOFTFLOAT_FAST_INT64
|
#define SOFTFLOAT_FAST_INT64
|
||||||
#include "opts-GCC.h"
|
#include "opts-GCC.h"
|
||||||
|
|
||||||
|
#endif // ARM_SOFT_FLOAT_LIB_H_
|
||||||
|
@@ -7,8 +7,8 @@
|
|||||||
|
|
||||||
**/
|
**/
|
||||||
|
|
||||||
#ifndef _OPTEE_SMC_H_
|
#ifndef OPTEE_SMC_H_
|
||||||
#define _OPTEE_SMC_H_
|
#define OPTEE_SMC_H_
|
||||||
|
|
||||||
/* Returned in Arg0 only from Trusted OS functions */
|
/* Returned in Arg0 only from Trusted OS functions */
|
||||||
#define OPTEE_SMC_RETURN_OK 0x0
|
#define OPTEE_SMC_RETURN_OK 0x0
|
||||||
@@ -47,4 +47,4 @@ typedef struct {
|
|||||||
UINT8 Data4[8];
|
UINT8 Data4[8];
|
||||||
} RFC4122_UUID;
|
} RFC4122_UUID;
|
||||||
|
|
||||||
#endif
|
#endif // OPTEE_SMC_H_
|
||||||
|
@@ -9,8 +9,8 @@
|
|||||||
|
|
||||||
**/
|
**/
|
||||||
|
|
||||||
#ifndef _PLATFORM_BM_H_
|
#ifndef PLATFORM_BM_H_
|
||||||
#define _PLATFORM_BM_H_
|
#define PLATFORM_BM_H_
|
||||||
|
|
||||||
#include <Library/BaseLib.h>
|
#include <Library/BaseLib.h>
|
||||||
#include <Library/BaseMemoryLib.h>
|
#include <Library/BaseMemoryLib.h>
|
||||||
@@ -50,4 +50,4 @@ DisableQuietBoot (
|
|||||||
VOID
|
VOID
|
||||||
);
|
);
|
||||||
|
|
||||||
#endif // _PLATFORM_BM_H_
|
#endif // PLATFORM_BM_H_
|
||||||
|
@@ -37,11 +37,11 @@ SerialPortInitialize (
|
|||||||
/**
|
/**
|
||||||
Write data to serial device.
|
Write data to serial device.
|
||||||
|
|
||||||
@param Buffer Point of data buffer which need to be writed.
|
@param Buffer Point of data buffer which need to be written.
|
||||||
@param NumberOfBytes Number of output bytes which are cached in Buffer.
|
@param NumberOfBytes Number of output bytes which are cached in Buffer.
|
||||||
|
|
||||||
@retval 0 Write data failed.
|
@retval 0 Write data failed.
|
||||||
@retval !0 Actual number of bytes writed to serial device.
|
@retval !0 Actual number of bytes written to serial device.
|
||||||
|
|
||||||
**/
|
**/
|
||||||
|
|
||||||
@@ -103,7 +103,7 @@ SerialPortWrite (
|
|||||||
/**
|
/**
|
||||||
Read data from serial device and save the datas in buffer.
|
Read data from serial device and save the datas in buffer.
|
||||||
|
|
||||||
@param Buffer Point of data buffer which need to be writed.
|
@param Buffer Point of data buffer which need to be written.
|
||||||
@param NumberOfBytes Number of output bytes which are cached in Buffer.
|
@param NumberOfBytes Number of output bytes which are cached in Buffer.
|
||||||
|
|
||||||
@retval 0 Read data failed.
|
@retval 0 Read data failed.
|
||||||
|
@@ -44,7 +44,7 @@ SemihostFileOpen (
|
|||||||
OpenBlock.Mode = Mode;
|
OpenBlock.Mode = Mode;
|
||||||
OpenBlock.NameLength = AsciiStrLen(FileName);
|
OpenBlock.NameLength = AsciiStrLen(FileName);
|
||||||
|
|
||||||
Result = Semihost_SYS_OPEN(&OpenBlock);
|
Result = SEMIHOST_SYS_OPEN (&OpenBlock);
|
||||||
|
|
||||||
if (Result == -1) {
|
if (Result == -1) {
|
||||||
return RETURN_NOT_FOUND;
|
return RETURN_NOT_FOUND;
|
||||||
@@ -66,7 +66,7 @@ SemihostFileSeek (
|
|||||||
SeekBlock.Handle = FileHandle;
|
SeekBlock.Handle = FileHandle;
|
||||||
SeekBlock.Location = Offset;
|
SeekBlock.Location = Offset;
|
||||||
|
|
||||||
Result = Semihost_SYS_SEEK(&SeekBlock);
|
Result = SEMIHOST_SYS_SEEK (&SeekBlock);
|
||||||
|
|
||||||
// Semihosting does not behave as documented. It returns the offset on
|
// Semihosting does not behave as documented. It returns the offset on
|
||||||
// success.
|
// success.
|
||||||
@@ -95,7 +95,7 @@ SemihostFileRead (
|
|||||||
ReadBlock.Buffer = Buffer;
|
ReadBlock.Buffer = Buffer;
|
||||||
ReadBlock.Length = *Length;
|
ReadBlock.Length = *Length;
|
||||||
|
|
||||||
Result = Semihost_SYS_READ(&ReadBlock);
|
Result = SEMIHOST_SYS_READ (&ReadBlock);
|
||||||
|
|
||||||
if ((*Length != 0) && (Result == *Length)) {
|
if ((*Length != 0) && (Result == *Length)) {
|
||||||
return RETURN_ABORTED;
|
return RETURN_ABORTED;
|
||||||
@@ -122,7 +122,7 @@ SemihostFileWrite (
|
|||||||
WriteBlock.Buffer = Buffer;
|
WriteBlock.Buffer = Buffer;
|
||||||
WriteBlock.Length = *Length;
|
WriteBlock.Length = *Length;
|
||||||
|
|
||||||
*Length = Semihost_SYS_WRITE(&WriteBlock);
|
*Length = SEMIHOST_SYS_WRITE (&WriteBlock);
|
||||||
|
|
||||||
if (*Length != 0)
|
if (*Length != 0)
|
||||||
return RETURN_ABORTED;
|
return RETURN_ABORTED;
|
||||||
@@ -135,7 +135,7 @@ SemihostFileClose (
|
|||||||
IN UINTN FileHandle
|
IN UINTN FileHandle
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
if (Semihost_SYS_CLOSE (&FileHandle) == -1) {
|
if (SEMIHOST_SYS_CLOSE (&FileHandle) == -1) {
|
||||||
return RETURN_INVALID_PARAMETER;
|
return RETURN_INVALID_PARAMETER;
|
||||||
} else {
|
} else {
|
||||||
return RETURN_SUCCESS;
|
return RETURN_SUCCESS;
|
||||||
@@ -154,7 +154,7 @@ SemihostFileLength (
|
|||||||
return RETURN_INVALID_PARAMETER;
|
return RETURN_INVALID_PARAMETER;
|
||||||
}
|
}
|
||||||
|
|
||||||
Result = Semihost_SYS_FLEN(&FileHandle);
|
Result = SEMIHOST_SYS_FLEN (&FileHandle);
|
||||||
|
|
||||||
if (Result == -1) {
|
if (Result == -1) {
|
||||||
return RETURN_ABORTED;
|
return RETURN_ABORTED;
|
||||||
@@ -195,7 +195,7 @@ SemihostFileTmpName(
|
|||||||
TmpNameBlock.Identifier = Identifier;
|
TmpNameBlock.Identifier = Identifier;
|
||||||
TmpNameBlock.Length = Length;
|
TmpNameBlock.Length = Length;
|
||||||
|
|
||||||
Result = Semihost_SYS_TMPNAME (&TmpNameBlock);
|
Result = SEMIHOST_SYS_TMPNAME (&TmpNameBlock);
|
||||||
|
|
||||||
if (Result != 0) {
|
if (Result != 0) {
|
||||||
return RETURN_ABORTED;
|
return RETURN_ABORTED;
|
||||||
@@ -220,7 +220,7 @@ SemihostFileRemove (
|
|||||||
RemoveBlock.FileName = FileName;
|
RemoveBlock.FileName = FileName;
|
||||||
RemoveBlock.NameLength = AsciiStrLen(FileName);
|
RemoveBlock.NameLength = AsciiStrLen(FileName);
|
||||||
|
|
||||||
Result = Semihost_SYS_REMOVE(&RemoveBlock);
|
Result = SEMIHOST_SYS_REMOVE (&RemoveBlock);
|
||||||
|
|
||||||
if (Result == 0) {
|
if (Result == 0) {
|
||||||
return RETURN_SUCCESS;
|
return RETURN_SUCCESS;
|
||||||
@@ -258,7 +258,7 @@ SemihostFileRename(
|
|||||||
RenameBlock.NewFileName = NewFileName;
|
RenameBlock.NewFileName = NewFileName;
|
||||||
RenameBlock.NewFileNameLength = AsciiStrLen (NewFileName);
|
RenameBlock.NewFileNameLength = AsciiStrLen (NewFileName);
|
||||||
|
|
||||||
Result = Semihost_SYS_RENAME (&RenameBlock);
|
Result = SEMIHOST_SYS_RENAME (&RenameBlock);
|
||||||
|
|
||||||
if (Result != 0) {
|
if (Result != 0) {
|
||||||
return RETURN_ABORTED;
|
return RETURN_ABORTED;
|
||||||
@@ -272,7 +272,7 @@ SemihostReadCharacter (
|
|||||||
VOID
|
VOID
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
return Semihost_SYS_READC();
|
return SEMIHOST_SYS_READC ();
|
||||||
}
|
}
|
||||||
|
|
||||||
VOID
|
VOID
|
||||||
@@ -280,7 +280,7 @@ SemihostWriteCharacter (
|
|||||||
IN CHAR8 Character
|
IN CHAR8 Character
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
Semihost_SYS_WRITEC(&Character);
|
SEMIHOST_SYS_WRITEC (&Character);
|
||||||
}
|
}
|
||||||
|
|
||||||
VOID
|
VOID
|
||||||
@@ -288,7 +288,7 @@ SemihostWriteString (
|
|||||||
IN CHAR8 *String
|
IN CHAR8 *String
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
Semihost_SYS_WRITE0(String);
|
SEMIHOST_SYS_WRITE0 (String);
|
||||||
}
|
}
|
||||||
|
|
||||||
UINT32
|
UINT32
|
||||||
@@ -301,5 +301,5 @@ SemihostSystem (
|
|||||||
SystemBlock.CommandLine = CommandLine;
|
SystemBlock.CommandLine = CommandLine;
|
||||||
SystemBlock.CommandLength = AsciiStrLen(CommandLine);
|
SystemBlock.CommandLength = AsciiStrLen(CommandLine);
|
||||||
|
|
||||||
return Semihost_SYS_SYSTEM(&SystemBlock);
|
return SEMIHOST_SYS_SYSTEM (&SystemBlock);
|
||||||
}
|
}
|
||||||
|
@@ -2,7 +2,7 @@
|
|||||||
# Semihosting JTAG lib
|
# Semihosting JTAG lib
|
||||||
#
|
#
|
||||||
# Copyright (c) 2008 - 2010, Apple Inc. All rights reserved.<BR>
|
# Copyright (c) 2008 - 2010, Apple Inc. All rights reserved.<BR>
|
||||||
# Copyright (c) 2011 - 2013, ARM Ltd. All rights reserved.<BR>
|
# Copyright (c) 2011 - 2021, Arm Limited. All rights reserved.<BR>
|
||||||
#
|
#
|
||||||
# SPDX-License-Identifier: BSD-2-Clause-Patent
|
# SPDX-License-Identifier: BSD-2-Clause-Patent
|
||||||
#
|
#
|
||||||
@@ -25,6 +25,7 @@
|
|||||||
#
|
#
|
||||||
[Sources.common]
|
[Sources.common]
|
||||||
SemihostLib.c
|
SemihostLib.c
|
||||||
|
SemihostPrivate.h
|
||||||
|
|
||||||
[Sources.ARM]
|
[Sources.ARM]
|
||||||
Arm/GccSemihost.S | GCC
|
Arm/GccSemihost.S | GCC
|
||||||
|
@@ -1,14 +1,14 @@
|
|||||||
/** @file
|
/** @file
|
||||||
|
|
||||||
Copyright (c) 2008 - 2009, Apple Inc. All rights reserved.<BR>
|
Copyright (c) 2008 - 2009, Apple Inc. All rights reserved.<BR>
|
||||||
Copyright (c) 2013 - 2014, ARM Ltd. All rights reserved.<BR>
|
Copyright (c) 2013 - 2021, Arm Limited. All rights reserved.<BR>
|
||||||
|
|
||||||
SPDX-License-Identifier: BSD-2-Clause-Patent
|
SPDX-License-Identifier: BSD-2-Clause-Patent
|
||||||
|
|
||||||
**/
|
**/
|
||||||
|
|
||||||
#ifndef __SEMIHOST_PRIVATE_H__
|
#ifndef SEMIHOST_PRIVATE_H_
|
||||||
#define __SEMIHOST_PRIVATE_H__
|
#define SEMIHOST_PRIVATE_H_
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
CHAR8 *FileName;
|
CHAR8 *FileName;
|
||||||
@@ -151,19 +151,19 @@ _Semihost_SYS_SYSTEM(
|
|||||||
IN SEMIHOST_SYSTEM_BLOCK *SystemBlock
|
IN SEMIHOST_SYSTEM_BLOCK *SystemBlock
|
||||||
);
|
);
|
||||||
|
|
||||||
#define Semihost_SYS_OPEN(OpenBlock) _Semihost_SYS_OPEN(0x01, OpenBlock)
|
#define SEMIHOST_SYS_OPEN(OpenBlock) _Semihost_SYS_OPEN(0x01, OpenBlock)
|
||||||
#define Semihost_SYS_CLOSE(Handle) _Semihost_SYS_CLOSE(0x02, Handle)
|
#define SEMIHOST_SYS_CLOSE(Handle) _Semihost_SYS_CLOSE(0x02, Handle)
|
||||||
#define Semihost_SYS_WRITE0(String) _Semihost_SYS_WRITE0(0x04, String)
|
#define SEMIHOST_SYS_WRITE0(String) _Semihost_SYS_WRITE0(0x04, String)
|
||||||
#define Semihost_SYS_WRITEC(Character) _Semihost_SYS_WRITEC(0x03, Character)
|
#define SEMIHOST_SYS_WRITEC(Character) _Semihost_SYS_WRITEC(0x03, Character)
|
||||||
#define Semihost_SYS_WRITE(WriteBlock) _Semihost_SYS_WRITE(0x05, WriteBlock)
|
#define SEMIHOST_SYS_WRITE(WriteBlock) _Semihost_SYS_WRITE(0x05, WriteBlock)
|
||||||
#define Semihost_SYS_READ(ReadBlock) _Semihost_SYS_READ(0x06, ReadBlock)
|
#define SEMIHOST_SYS_READ(ReadBlock) _Semihost_SYS_READ(0x06, ReadBlock)
|
||||||
#define Semihost_SYS_READC() _Semihost_SYS_READC(0x07, 0)
|
#define SEMIHOST_SYS_READC() _Semihost_SYS_READC(0x07, 0)
|
||||||
#define Semihost_SYS_SEEK(SeekBlock) _Semihost_SYS_SEEK(0x0A, SeekBlock)
|
#define SEMIHOST_SYS_SEEK(SeekBlock) _Semihost_SYS_SEEK(0x0A, SeekBlock)
|
||||||
#define Semihost_SYS_FLEN(Handle) _Semihost_SYS_FLEN(0x0C, Handle)
|
#define SEMIHOST_SYS_FLEN(Handle) _Semihost_SYS_FLEN(0x0C, Handle)
|
||||||
#define Semihost_SYS_TMPNAME(TmpNameBlock) _Semihost_SYS_TMPNAME(0x0D, TmpNameBlock)
|
#define SEMIHOST_SYS_TMPNAME(TmpNameBlock) _Semihost_SYS_TMPNAME(0x0D, TmpNameBlock)
|
||||||
#define Semihost_SYS_REMOVE(RemoveBlock) _Semihost_SYS_REMOVE(0x0E, RemoveBlock)
|
#define SEMIHOST_SYS_REMOVE(RemoveBlock) _Semihost_SYS_REMOVE(0x0E, RemoveBlock)
|
||||||
#define Semihost_SYS_RENAME(RenameBlock) _Semihost_SYS_RENAME(0x0F, RenameBlock)
|
#define SEMIHOST_SYS_RENAME(RenameBlock) _Semihost_SYS_RENAME(0x0F, RenameBlock)
|
||||||
#define Semihost_SYS_SYSTEM(SystemBlock) _Semihost_SYS_SYSTEM(0x12, SystemBlock)
|
#define SEMIHOST_SYS_SYSTEM(SystemBlock) _Semihost_SYS_SYSTEM(0x12, SystemBlock)
|
||||||
|
|
||||||
#elif defined(__GNUC__) // __CC_ARM
|
#elif defined(__GNUC__) // __CC_ARM
|
||||||
|
|
||||||
@@ -175,38 +175,38 @@ GccSemihostCall (
|
|||||||
IN UINTN SystemBlockAddress
|
IN UINTN SystemBlockAddress
|
||||||
); // __attribute__ ((interrupt ("SVC")));
|
); // __attribute__ ((interrupt ("SVC")));
|
||||||
|
|
||||||
#define Semihost_SYS_OPEN(OpenBlock) GccSemihostCall(0x01, (UINTN)(OpenBlock))
|
#define SEMIHOST_SYS_OPEN(OpenBlock) GccSemihostCall(0x01, (UINTN)(OpenBlock))
|
||||||
#define Semihost_SYS_CLOSE(Handle) GccSemihostCall(0x02, (UINTN)(Handle))
|
#define SEMIHOST_SYS_CLOSE(Handle) GccSemihostCall(0x02, (UINTN)(Handle))
|
||||||
#define Semihost_SYS_WRITE0(String) GccSemihostCall(0x04, (UINTN)(String))
|
#define SEMIHOST_SYS_WRITE0(String) GccSemihostCall(0x04, (UINTN)(String))
|
||||||
#define Semihost_SYS_WRITEC(Character) GccSemihostCall(0x03, (UINTN)(Character))
|
#define SEMIHOST_SYS_WRITEC(Character) GccSemihostCall(0x03, (UINTN)(Character))
|
||||||
#define Semihost_SYS_WRITE(WriteBlock) GccSemihostCall(0x05, (UINTN)(WriteBlock))
|
#define SEMIHOST_SYS_WRITE(WriteBlock) GccSemihostCall(0x05, (UINTN)(WriteBlock))
|
||||||
#define Semihost_SYS_READ(ReadBlock) GccSemihostCall(0x06, (UINTN)(ReadBlock))
|
#define SEMIHOST_SYS_READ(ReadBlock) GccSemihostCall(0x06, (UINTN)(ReadBlock))
|
||||||
#define Semihost_SYS_READC() GccSemihostCall(0x07, (UINTN)(0))
|
#define SEMIHOST_SYS_READC() GccSemihostCall(0x07, (UINTN)(0))
|
||||||
#define Semihost_SYS_SEEK(SeekBlock) GccSemihostCall(0x0A, (UINTN)(SeekBlock))
|
#define SEMIHOST_SYS_SEEK(SeekBlock) GccSemihostCall(0x0A, (UINTN)(SeekBlock))
|
||||||
#define Semihost_SYS_FLEN(Handle) GccSemihostCall(0x0C, (UINTN)(Handle))
|
#define SEMIHOST_SYS_FLEN(Handle) GccSemihostCall(0x0C, (UINTN)(Handle))
|
||||||
#define Semihost_SYS_TMPNAME(TmpNameBlock) GccSemihostCall(0x0D, (UINTN)(TmpNameBlock))
|
#define SEMIHOST_SYS_TMPNAME(TmpNameBlock) GccSemihostCall(0x0D, (UINTN)(TmpNameBlock))
|
||||||
#define Semihost_SYS_REMOVE(RemoveBlock) GccSemihostCall(0x0E, (UINTN)(RemoveBlock))
|
#define SEMIHOST_SYS_REMOVE(RemoveBlock) GccSemihostCall(0x0E, (UINTN)(RemoveBlock))
|
||||||
#define Semihost_SYS_RENAME(RenameBlock) GccSemihostCall(0x0F, (UINTN)(RenameBlock))
|
#define SEMIHOST_SYS_RENAME(RenameBlock) GccSemihostCall(0x0F, (UINTN)(RenameBlock))
|
||||||
#define Semihost_SYS_SYSTEM(SystemBlock) GccSemihostCall(0x12, (UINTN)(SystemBlock))
|
#define SEMIHOST_SYS_SYSTEM(SystemBlock) GccSemihostCall(0x12, (UINTN)(SystemBlock))
|
||||||
|
|
||||||
#else // __CC_ARM
|
#else // __CC_ARM
|
||||||
|
|
||||||
#define SEMIHOST_SUPPORTED FALSE
|
#define SEMIHOST_SUPPORTED FALSE
|
||||||
|
|
||||||
#define Semihost_SYS_OPEN(OpenBlock) (-1)
|
#define SEMIHOST_SYS_OPEN(OpenBlock) (-1)
|
||||||
#define Semihost_SYS_CLOSE(Handle) (-1)
|
#define SEMIHOST_SYS_CLOSE(Handle) (-1)
|
||||||
#define Semihost_SYS_WRITE0(String)
|
#define SEMIHOST_SYS_WRITE0(String)
|
||||||
#define Semihost_SYS_WRITEC(Character)
|
#define SEMIHOST_SYS_WRITEC(Character)
|
||||||
#define Semihost_SYS_WRITE(WriteBlock) (0)
|
#define SEMIHOST_SYS_WRITE(WriteBlock) (0)
|
||||||
#define Semihost_SYS_READ(ReadBlock) ((ReadBlock)->Length)
|
#define SEMIHOST_SYS_READ(ReadBlock) ((ReadBlock)->Length)
|
||||||
#define Semihost_SYS_READC() ('x')
|
#define SEMIHOST_SYS_READC() ('x')
|
||||||
#define Semihost_SYS_SEEK(SeekBlock) (-1)
|
#define SEMIHOST_SYS_SEEK(SeekBlock) (-1)
|
||||||
#define Semihost_SYS_FLEN(Handle) (-1)
|
#define SEMIHOST_SYS_FLEN(Handle) (-1)
|
||||||
#define Semihost_SYS_TMPNAME(TmpNameBlock) (-1)
|
#define SEMIHOST_SYS_TMPNAME(TmpNameBlock) (-1)
|
||||||
#define Semihost_SYS_REMOVE(RemoveBlock) (-1)
|
#define SEMIHOST_SYS_REMOVE(RemoveBlock) (-1)
|
||||||
#define Semihost_SYS_RENAME(RenameBlock) (-1)
|
#define SEMIHOST_SYS_RENAME(RenameBlock) (-1)
|
||||||
#define Semihost_SYS_SYSTEM(SystemBlock) (-1)
|
#define SEMIHOST_SYS_SYSTEM(SystemBlock) (-1)
|
||||||
|
|
||||||
#endif // __CC_ARM
|
#endif // __CC_ARM
|
||||||
|
|
||||||
#endif //__SEMIHOST_PRIVATE_H__
|
#endif // SEMIHOST_PRIVATE_H_
|
||||||
|
@@ -101,8 +101,8 @@ SendMemoryPermissionRequest (
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Check error response from Callee.
|
// Check error response from Callee.
|
||||||
if (*RetVal & BIT31) {
|
if ((*RetVal & BIT31) != 0) {
|
||||||
// Bit 31 set means there is an error retured
|
// Bit 31 set means there is an error returned
|
||||||
// See [1], Section 13.5.5.1 MM_SP_MEMORY_ATTRIBUTES_GET_AARCH64 and
|
// See [1], Section 13.5.5.1 MM_SP_MEMORY_ATTRIBUTES_GET_AARCH64 and
|
||||||
// Section 13.5.5.2 MM_SP_MEMORY_ATTRIBUTES_SET_AARCH64.
|
// Section 13.5.5.2 MM_SP_MEMORY_ATTRIBUTES_SET_AARCH64.
|
||||||
switch (*RetVal) {
|
switch (*RetVal) {
|
||||||
|
@@ -1,6 +1,6 @@
|
|||||||
#/** @file
|
#/** @file
|
||||||
#
|
#
|
||||||
# Copyright (c) 2017 - 2018, ARM Limited. All rights reserved.
|
# Copyright (c) 2017 - 2021, Arm Limited. All rights reserved.<BR>
|
||||||
#
|
#
|
||||||
# SPDX-License-Identifier: BSD-2-Clause-Patent
|
# SPDX-License-Identifier: BSD-2-Clause-Patent
|
||||||
#
|
#
|
||||||
@@ -10,7 +10,7 @@
|
|||||||
[Defines]
|
[Defines]
|
||||||
INF_VERSION = 0x0001001A
|
INF_VERSION = 0x0001001A
|
||||||
BASE_NAME = ArmMmuStandaloneMmCoreLib
|
BASE_NAME = ArmMmuStandaloneMmCoreLib
|
||||||
FILE_GUID = da8f0232-fb14-42f0-922c-63104d2c70bd
|
FILE_GUID = 44a741c2-655f-41fc-b066-179f5a9aa78a
|
||||||
MODULE_TYPE = MM_CORE_STANDALONE
|
MODULE_TYPE = MM_CORE_STANDALONE
|
||||||
VERSION_STRING = 1.0
|
VERSION_STRING = 1.0
|
||||||
LIBRARY_CLASS = StandaloneMmMmuLib
|
LIBRARY_CLASS = StandaloneMmMmuLib
|
||||||
|
@@ -139,3 +139,101 @@ OemUpdateSmbiosInfo (
|
|||||||
{
|
{
|
||||||
ASSERT (FALSE);
|
ASSERT (FALSE);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** Fetches the Type 32 boot information status.
|
||||||
|
|
||||||
|
@return Boot status.
|
||||||
|
**/
|
||||||
|
MISC_BOOT_INFORMATION_STATUS_DATA_TYPE
|
||||||
|
EFIAPI
|
||||||
|
OemGetBootStatus (
|
||||||
|
VOID
|
||||||
|
)
|
||||||
|
{
|
||||||
|
ASSERT (FALSE);
|
||||||
|
return BootInformationStatusNoError;
|
||||||
|
}
|
||||||
|
|
||||||
|
/** Fetches the chassis status when it was last booted.
|
||||||
|
|
||||||
|
@return Chassis status.
|
||||||
|
**/
|
||||||
|
MISC_CHASSIS_STATE
|
||||||
|
EFIAPI
|
||||||
|
OemGetChassisBootupState (
|
||||||
|
VOID
|
||||||
|
)
|
||||||
|
{
|
||||||
|
ASSERT (FALSE);
|
||||||
|
return ChassisStateSafe;
|
||||||
|
}
|
||||||
|
|
||||||
|
/** Fetches the chassis power supply/supplies status when last booted.
|
||||||
|
|
||||||
|
@return Chassis power supply/supplies status.
|
||||||
|
**/
|
||||||
|
MISC_CHASSIS_STATE
|
||||||
|
EFIAPI
|
||||||
|
OemGetChassisPowerSupplyState (
|
||||||
|
VOID
|
||||||
|
)
|
||||||
|
{
|
||||||
|
ASSERT (FALSE);
|
||||||
|
return ChassisStateSafe;
|
||||||
|
}
|
||||||
|
|
||||||
|
/** Fetches the chassis thermal status when last booted.
|
||||||
|
|
||||||
|
@return Chassis thermal status.
|
||||||
|
**/
|
||||||
|
MISC_CHASSIS_STATE
|
||||||
|
EFIAPI
|
||||||
|
OemGetChassisThermalState (
|
||||||
|
VOID
|
||||||
|
)
|
||||||
|
{
|
||||||
|
ASSERT (FALSE);
|
||||||
|
return ChassisStateSafe;
|
||||||
|
}
|
||||||
|
|
||||||
|
/** Fetches the chassis security status when last booted.
|
||||||
|
|
||||||
|
@return Chassis security status.
|
||||||
|
**/
|
||||||
|
MISC_CHASSIS_SECURITY_STATE
|
||||||
|
EFIAPI
|
||||||
|
OemGetChassisSecurityStatus (
|
||||||
|
VOID
|
||||||
|
)
|
||||||
|
{
|
||||||
|
ASSERT (FALSE);
|
||||||
|
return ChassisSecurityStatusNone;
|
||||||
|
}
|
||||||
|
|
||||||
|
/** Fetches the chassis height in RMUs (Rack Mount Units).
|
||||||
|
|
||||||
|
@return The height of the chassis.
|
||||||
|
**/
|
||||||
|
UINT8
|
||||||
|
EFIAPI
|
||||||
|
OemGetChassisHeight (
|
||||||
|
VOID
|
||||||
|
)
|
||||||
|
{
|
||||||
|
ASSERT (FALSE);
|
||||||
|
return 1U;
|
||||||
|
}
|
||||||
|
|
||||||
|
/** Fetches the number of power cords.
|
||||||
|
|
||||||
|
@return The number of power cords.
|
||||||
|
**/
|
||||||
|
UINT8
|
||||||
|
EFIAPI
|
||||||
|
OemGetChassisNumPowerCords (
|
||||||
|
VOID
|
||||||
|
)
|
||||||
|
{
|
||||||
|
ASSERT (FALSE);
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
@@ -23,7 +23,7 @@ SMBIOS_MISC_TABLE_DATA(SMBIOS_TABLE_TYPE3, MiscChassisManufacturer) = {
|
|||||||
0, // Length,
|
0, // Length,
|
||||||
0 // Handle
|
0 // Handle
|
||||||
},
|
},
|
||||||
1, // Manufactrurer
|
1, // Manufacturer
|
||||||
MiscChassisTypeMainServerChassis, // Type
|
MiscChassisTypeMainServerChassis, // Type
|
||||||
2, // Version
|
2, // Version
|
||||||
3, // SerialNumber
|
3, // SerialNumber
|
||||||
|
@@ -39,6 +39,7 @@ SMBIOS_MISC_TABLE_FUNCTION(MiscChassisManufacturer)
|
|||||||
{
|
{
|
||||||
CHAR8 *OptionalStrStart;
|
CHAR8 *OptionalStrStart;
|
||||||
CHAR8 *StrStart;
|
CHAR8 *StrStart;
|
||||||
|
UINT8 *SkuNumberField;
|
||||||
UINTN RecordLength;
|
UINTN RecordLength;
|
||||||
UINTN ManuStrLen;
|
UINTN ManuStrLen;
|
||||||
UINTN VerStrLen;
|
UINTN VerStrLen;
|
||||||
@@ -117,10 +118,7 @@ SMBIOS_MISC_TABLE_FUNCTION(MiscChassisManufacturer)
|
|||||||
ChaNumStrLen = StrLen (ChassisSkuNumber);
|
ChaNumStrLen = StrLen (ChassisSkuNumber);
|
||||||
|
|
||||||
ContainedElementCount = InputData->ContainedElementCount;
|
ContainedElementCount = InputData->ContainedElementCount;
|
||||||
|
ExtendLength = ContainedElementCount * sizeof (CONTAINED_ELEMENT);
|
||||||
if (ContainedElementCount > 1) {
|
|
||||||
ExtendLength = (ContainedElementCount - 1) * sizeof (CONTAINED_ELEMENT);
|
|
||||||
}
|
|
||||||
|
|
||||||
//
|
//
|
||||||
// Two zeros following the last string.
|
// Two zeros following the last string.
|
||||||
@@ -149,7 +147,11 @@ SMBIOS_MISC_TABLE_FUNCTION(MiscChassisManufacturer)
|
|||||||
(VOID)CopyMem (SmbiosRecord + 1, &ContainedElements, ExtendLength);
|
(VOID)CopyMem (SmbiosRecord + 1, &ContainedElements, ExtendLength);
|
||||||
|
|
||||||
//ChassisSkuNumber
|
//ChassisSkuNumber
|
||||||
*((UINT8 *)SmbiosRecord + sizeof (SMBIOS_TABLE_TYPE3) + ExtendLength) = 5;
|
SkuNumberField = (UINT8 *)SmbiosRecord +
|
||||||
|
sizeof (SMBIOS_TABLE_TYPE3) -
|
||||||
|
sizeof (CONTAINED_ELEMENT) + ExtendLength;
|
||||||
|
|
||||||
|
*SkuNumberField = 5;
|
||||||
|
|
||||||
OptionalStrStart = (CHAR8 *)((UINT8 *)SmbiosRecord + sizeof (SMBIOS_TABLE_TYPE3) +
|
OptionalStrStart = (CHAR8 *)((UINT8 *)SmbiosRecord + sizeof (SMBIOS_TABLE_TYPE3) +
|
||||||
ExtendLength + 1);
|
ExtendLength + 1);
|
||||||
@@ -162,6 +164,14 @@ SMBIOS_MISC_TABLE_FUNCTION(MiscChassisManufacturer)
|
|||||||
UnicodeStrToAsciiStrS (AssertTag, StrStart, AssertTagStrLen + 1);
|
UnicodeStrToAsciiStrS (AssertTag, StrStart, AssertTagStrLen + 1);
|
||||||
StrStart += AssertTagStrLen + 1;
|
StrStart += AssertTagStrLen + 1;
|
||||||
UnicodeStrToAsciiStrS (ChassisSkuNumber, StrStart, ChaNumStrLen + 1);
|
UnicodeStrToAsciiStrS (ChassisSkuNumber, StrStart, ChaNumStrLen + 1);
|
||||||
|
|
||||||
|
SmbiosRecord->BootupState = OemGetChassisBootupState ();
|
||||||
|
SmbiosRecord->PowerSupplyState = OemGetChassisPowerSupplyState ();
|
||||||
|
SmbiosRecord->ThermalState = OemGetChassisThermalState ();
|
||||||
|
SmbiosRecord->SecurityStatus = OemGetChassisSecurityStatus ();
|
||||||
|
SmbiosRecord->Height = OemGetChassisHeight ();
|
||||||
|
SmbiosRecord->NumberofPowerCords = OemGetChassisNumPowerCords ();
|
||||||
|
|
||||||
//
|
//
|
||||||
// Now we have got the full smbios record, call smbios protocol to add this record.
|
// Now we have got the full smbios record, call smbios protocol to add this record.
|
||||||
//
|
//
|
||||||
|
@@ -23,9 +23,9 @@
|
|||||||
/**
|
/**
|
||||||
Get next language from language code list (with separator ';').
|
Get next language from language code list (with separator ';').
|
||||||
|
|
||||||
@param LangCode Input: point to first language in the list. On
|
@param LangCode Input: point to first language in the list. On
|
||||||
Otput: point to next language in the list, or
|
Output: point to next language in the list, or
|
||||||
NULL if no more language in the list.
|
NULL if no more language in the list.
|
||||||
@param Lang The first language in the list.
|
@param Lang The first language in the list.
|
||||||
|
|
||||||
**/
|
**/
|
||||||
|
@@ -16,6 +16,7 @@
|
|||||||
#include <Library/BaseMemoryLib.h>
|
#include <Library/BaseMemoryLib.h>
|
||||||
#include <Library/DebugLib.h>
|
#include <Library/DebugLib.h>
|
||||||
#include <Library/MemoryAllocationLib.h>
|
#include <Library/MemoryAllocationLib.h>
|
||||||
|
#include <Library/OemMiscLib.h>
|
||||||
#include <Library/UefiBootServicesTableLib.h>
|
#include <Library/UefiBootServicesTableLib.h>
|
||||||
|
|
||||||
#include "SmbiosMisc.h"
|
#include "SmbiosMisc.h"
|
||||||
@@ -59,6 +60,8 @@ SMBIOS_MISC_TABLE_FUNCTION(MiscBootInformation)
|
|||||||
|
|
||||||
SmbiosRecord->Hdr.Length = sizeof (SMBIOS_TABLE_TYPE32);
|
SmbiosRecord->Hdr.Length = sizeof (SMBIOS_TABLE_TYPE32);
|
||||||
|
|
||||||
|
SmbiosRecord->BootStatus = OemGetBootStatus ();
|
||||||
|
|
||||||
//
|
//
|
||||||
// Now we have got the full smbios record, call smbios protocol to add this record.
|
// Now we have got the full smbios record, call smbios protocol to add this record.
|
||||||
//
|
//
|
||||||
|
100
ArmPlatformPkg/ArmPlatformPkg.ci.yaml
Normal file
100
ArmPlatformPkg/ArmPlatformPkg.ci.yaml
Normal file
@@ -0,0 +1,100 @@
|
|||||||
|
## @file
|
||||||
|
# CI configuration for ArmPlatformPkg
|
||||||
|
#
|
||||||
|
# Copyright (c) 2021, Arm Limited. All rights reserved.<BR>
|
||||||
|
# SPDX-License-Identifier: BSD-2-Clause-Patent
|
||||||
|
##
|
||||||
|
{
|
||||||
|
## options defined .pytool/Plugin/LicenseCheck
|
||||||
|
"LicenseCheck": {
|
||||||
|
"IgnoreFiles": []
|
||||||
|
},
|
||||||
|
|
||||||
|
"EccCheck": {
|
||||||
|
## Exception sample looks like below:
|
||||||
|
## "ExceptionList": [
|
||||||
|
## "<ErrorID>", "<KeyWord>"
|
||||||
|
## ]
|
||||||
|
"ExceptionList": [
|
||||||
|
],
|
||||||
|
## Both file path and directory path are accepted.
|
||||||
|
"IgnoreFiles": [
|
||||||
|
"Scripts/Ds5/"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
|
||||||
|
## options defined .pytool/Plugin/CompilerPlugin
|
||||||
|
"CompilerPlugin": {
|
||||||
|
"DscPath": "ArmPlatformPkg.dsc"
|
||||||
|
},
|
||||||
|
|
||||||
|
## options defined .pytool/Plugin/HostUnitTestCompilerPlugin
|
||||||
|
"HostUnitTestCompilerPlugin": {
|
||||||
|
"DscPath": "" # Don't support this test
|
||||||
|
},
|
||||||
|
|
||||||
|
## options defined .pytool/Plugin/CharEncodingCheck
|
||||||
|
"CharEncodingCheck": {
|
||||||
|
"IgnoreFiles": []
|
||||||
|
},
|
||||||
|
|
||||||
|
## options defined .pytool/Plugin/DependencyCheck
|
||||||
|
"DependencyCheck": {
|
||||||
|
"AcceptableDependencies": [
|
||||||
|
"ArmPlatformPkg/ArmPlatformPkg.dec",
|
||||||
|
"ArmPkg/ArmPkg.dec",
|
||||||
|
"EmbeddedPkg/EmbeddedPkg.dec",
|
||||||
|
"MdeModulePkg/MdeModulePkg.dec",
|
||||||
|
"MdePkg/MdePkg.dec"
|
||||||
|
],
|
||||||
|
# For host based unit tests
|
||||||
|
"AcceptableDependencies-HOST_APPLICATION":[
|
||||||
|
"UnitTestFrameworkPkg/UnitTestFrameworkPkg.dec"
|
||||||
|
],
|
||||||
|
# For UEFI shell based apps
|
||||||
|
"AcceptableDependencies-UEFI_APPLICATION":[],
|
||||||
|
"IgnoreInf": []
|
||||||
|
},
|
||||||
|
|
||||||
|
## options defined .pytool/Plugin/DscCompleteCheck
|
||||||
|
"DscCompleteCheck": {
|
||||||
|
"IgnoreInf": [],
|
||||||
|
"DscPath": "ArmPlatformPkg.dsc"
|
||||||
|
},
|
||||||
|
|
||||||
|
## options defined .pytool/Plugin/HostUnitTestDscCompleteCheck
|
||||||
|
"HostUnitTestDscCompleteCheck": {
|
||||||
|
"IgnoreInf": [""],
|
||||||
|
"DscPath": "" # Don't support this test
|
||||||
|
},
|
||||||
|
|
||||||
|
## options defined .pytool/Plugin/GuidCheck
|
||||||
|
"GuidCheck": {
|
||||||
|
"IgnoreGuidName": [],
|
||||||
|
"IgnoreGuidValue": [],
|
||||||
|
"IgnoreFoldersAndFiles": [],
|
||||||
|
"IgnoreDuplicates": [],
|
||||||
|
},
|
||||||
|
|
||||||
|
## options defined .pytool/Plugin/LibraryClassCheck
|
||||||
|
"LibraryClassCheck": {
|
||||||
|
"IgnoreHeaderFile": []
|
||||||
|
},
|
||||||
|
|
||||||
|
## options defined .pytool/Plugin/SpellCheck
|
||||||
|
"SpellCheck": {
|
||||||
|
"AuditOnly": False,
|
||||||
|
"IgnoreFiles": [], # use gitignore syntax to ignore errors
|
||||||
|
# in matching files
|
||||||
|
"ExtendWords": [
|
||||||
|
"hdlcd",
|
||||||
|
"icdsgir",
|
||||||
|
"primecells"
|
||||||
|
], # words to extend to the dictionary for this package
|
||||||
|
"IgnoreStandardPaths": [ # Standard Plugin defined paths that
|
||||||
|
"*.asm", "*.s" # should be ignore
|
||||||
|
],
|
||||||
|
"AdditionalIncludePaths": [] # Additional paths to spell check
|
||||||
|
# (wildcards supported)
|
||||||
|
}
|
||||||
|
}
|
@@ -1,6 +1,6 @@
|
|||||||
#/** @file
|
#/** @file
|
||||||
#
|
#
|
||||||
# Copyright (c) 2011-2018, ARM Limited. All rights reserved.
|
# Copyright (c) 2011-2021, ARM Limited. All rights reserved.
|
||||||
# Copyright (c) 2015, Intel Corporation. All rights reserved.
|
# Copyright (c) 2015, Intel Corporation. All rights reserved.
|
||||||
#
|
#
|
||||||
# SPDX-License-Identifier: BSD-2-Clause-Patent
|
# SPDX-License-Identifier: BSD-2-Clause-Patent
|
||||||
@@ -26,11 +26,28 @@
|
|||||||
Include # Root include for the package
|
Include # Root include for the package
|
||||||
|
|
||||||
[LibraryClasses]
|
[LibraryClasses]
|
||||||
|
## @libraryclass Provides an interface to query platform information.
|
||||||
|
#
|
||||||
ArmPlatformLib|Include/Library/ArmPlatformLib.h
|
ArmPlatformLib|Include/Library/ArmPlatformLib.h
|
||||||
|
|
||||||
|
## @libraryclass Provides an interface to initialize/shutdown a LCD screen.
|
||||||
|
#
|
||||||
LcdHwLib|Include/Library/LcdHwLib.h
|
LcdHwLib|Include/Library/LcdHwLib.h
|
||||||
|
|
||||||
|
## @libraryclass Provides an interface to configure a LCD screen.
|
||||||
|
#
|
||||||
LcdPlatformLib|Include/Library/LcdPlatformLib.h
|
LcdPlatformLib|Include/Library/LcdPlatformLib.h
|
||||||
|
|
||||||
|
## @libraryclass Provides a Nor flash interface.
|
||||||
|
#
|
||||||
NorFlashPlatformLib|Include/Library/NorFlashPlatformLib.h
|
NorFlashPlatformLib|Include/Library/NorFlashPlatformLib.h
|
||||||
|
|
||||||
|
## @libraryclass Provides an interface to the clock of a PL011 device.
|
||||||
|
#
|
||||||
PL011UartClockLib|Include/Library/PL011UartClockLib.h
|
PL011UartClockLib|Include/Library/PL011UartClockLib.h
|
||||||
|
|
||||||
|
## @libraryclass Provides an interface to a PL011 uart.
|
||||||
|
#
|
||||||
PL011UartLib|Include/Library/PL011UartLib.h
|
PL011UartLib|Include/Library/PL011UartLib.h
|
||||||
|
|
||||||
[Guids.common]
|
[Guids.common]
|
||||||
|
@@ -33,6 +33,8 @@
|
|||||||
gArmTokenSpaceGuid.PcdFdBaseAddress|0x0
|
gArmTokenSpaceGuid.PcdFdBaseAddress|0x0
|
||||||
gArmTokenSpaceGuid.PcdFdSize|0x1000
|
gArmTokenSpaceGuid.PcdFdSize|0x1000
|
||||||
|
|
||||||
|
!include MdePkg/MdeLibs.dsc.inc
|
||||||
|
|
||||||
[LibraryClasses.common]
|
[LibraryClasses.common]
|
||||||
ArmGicArchLib|ArmPkg/Library/ArmGicArchSecLib/ArmGicArchSecLib.inf
|
ArmGicArchLib|ArmPkg/Library/ArmGicArchSecLib/ArmGicArchSecLib.inf
|
||||||
ArmGicLib|ArmPkg/Drivers/ArmGic/ArmGicLib.inf
|
ArmGicLib|ArmPkg/Drivers/ArmGic/ArmGicLib.inf
|
||||||
|
@@ -29,7 +29,6 @@
|
|||||||
MdeModulePkg/MdeModulePkg.dec
|
MdeModulePkg/MdeModulePkg.dec
|
||||||
ArmPlatformPkg/ArmPlatformPkg.dec
|
ArmPlatformPkg/ArmPlatformPkg.dec
|
||||||
EmbeddedPkg/EmbeddedPkg.dec
|
EmbeddedPkg/EmbeddedPkg.dec
|
||||||
StandaloneMmPkg/StandaloneMmPkg.dec
|
|
||||||
|
|
||||||
[LibraryClasses]
|
[LibraryClasses]
|
||||||
BaseLib
|
BaseLib
|
||||||
|
@@ -1,10 +1,10 @@
|
|||||||
/** @file
|
/** @file
|
||||||
*
|
|
||||||
* Copyright (c) 2011 - 2020, Arm Limited. All rights reserved.<BR>
|
Copyright (c) 2011 - 2020, Arm Limited. All rights reserved.<BR>
|
||||||
* Copyright (c) 2016, Linaro Limited. All rights reserved.
|
Copyright (c) 2016, Linaro Limited. All rights reserved.
|
||||||
*
|
|
||||||
* SPDX-License-Identifier: BSD-2-Clause-Patent
|
SPDX-License-Identifier: BSD-2-Clause-Patent
|
||||||
*
|
|
||||||
**/
|
**/
|
||||||
|
|
||||||
|
|
||||||
|
@@ -1,9 +1,9 @@
|
|||||||
/** @file
|
/** @file
|
||||||
*
|
|
||||||
* Copyright (c) 2011-2012, ARM Limited. All rights reserved.
|
Copyright (c) 2011-2012, ARM Limited. All rights reserved.
|
||||||
*
|
|
||||||
* SPDX-License-Identifier: BSD-2-Clause-Patent
|
SPDX-License-Identifier: BSD-2-Clause-Patent
|
||||||
*
|
|
||||||
**/
|
**/
|
||||||
|
|
||||||
|
|
||||||
|
@@ -1,10 +1,10 @@
|
|||||||
/** @file
|
## @file
|
||||||
*
|
#
|
||||||
* Copyright (c) 2011 - 2020, Arm Limited. All rights reserved.<BR>
|
# Copyright (c) 2011 - 2020, Arm Limited. All rights reserved.<BR>
|
||||||
*
|
#
|
||||||
* SPDX-License-Identifier: BSD-2-Clause-Patent
|
# SPDX-License-Identifier: BSD-2-Clause-Patent
|
||||||
*
|
#
|
||||||
**/
|
##
|
||||||
|
|
||||||
[Defines]
|
[Defines]
|
||||||
INF_VERSION = 0x00010005
|
INF_VERSION = 0x00010005
|
||||||
|
@@ -1,10 +1,10 @@
|
|||||||
/** @file
|
/** @file
|
||||||
*
|
|
||||||
* Copyright (c) 2011-2013, ARM Limited. All rights reserved.
|
Copyright (c) 2011-2013, ARM Limited. All rights reserved.
|
||||||
* Copyright (c) 2018, Linaro Limited. All rights reserved.
|
Copyright (c) 2018, Linaro Limited. All rights reserved.
|
||||||
*
|
|
||||||
* SPDX-License-Identifier: BSD-2-Clause-Patent
|
SPDX-License-Identifier: BSD-2-Clause-Patent
|
||||||
*
|
|
||||||
**/
|
**/
|
||||||
|
|
||||||
|
|
||||||
|
@@ -1,9 +1,9 @@
|
|||||||
/** @file
|
/** @file
|
||||||
*
|
|
||||||
* Copyright (c) 2011-2012, ARM Limited. All rights reserved.
|
Copyright (c) 2011-2012, ARM Limited. All rights reserved.
|
||||||
*
|
|
||||||
* SPDX-License-Identifier: BSD-2-Clause-Patent
|
SPDX-License-Identifier: BSD-2-Clause-Patent
|
||||||
*
|
|
||||||
**/
|
**/
|
||||||
|
|
||||||
|
|
||||||
|
@@ -1,11 +1,11 @@
|
|||||||
/** @file
|
## @file
|
||||||
*
|
#
|
||||||
* Copyright (c) 2011 - 2020, Arm Limited. All rights reserved.<BR>
|
# Copyright (c) 2011 - 2020, Arm Limited. All rights reserved.<BR>
|
||||||
* Copyright (c) 2018, Linaro Limited. All rights reserved.
|
# Copyright (c) 2018, Linaro Limited. All rights reserved.
|
||||||
*
|
#
|
||||||
* SPDX-License-Identifier: BSD-2-Clause-Patent
|
# SPDX-License-Identifier: BSD-2-Clause-Patent
|
||||||
*
|
#
|
||||||
**/
|
##
|
||||||
|
|
||||||
[Defines]
|
[Defines]
|
||||||
INF_VERSION = 0x00010005
|
INF_VERSION = 0x00010005
|
||||||
|
@@ -1,9 +1,9 @@
|
|||||||
/** @file
|
/** @file
|
||||||
*
|
|
||||||
* Copyright (c) 2011-2013, ARM Limited. All rights reserved.
|
Copyright (c) 2011-2013, ARM Limited. All rights reserved.
|
||||||
*
|
|
||||||
* SPDX-License-Identifier: BSD-2-Clause-Patent
|
SPDX-License-Identifier: BSD-2-Clause-Patent
|
||||||
*
|
|
||||||
**/
|
**/
|
||||||
|
|
||||||
#ifndef _ARMPLATFORMLIB_H_
|
#ifndef _ARMPLATFORMLIB_H_
|
||||||
|
@@ -1,9 +1,9 @@
|
|||||||
/** @file
|
/** @file
|
||||||
*
|
|
||||||
* Copyright 2018 NXP
|
Copyright 2018 NXP
|
||||||
*
|
|
||||||
* SPDX-License-Identifier: BSD-2-Clause-Patent
|
SPDX-License-Identifier: BSD-2-Clause-Patent
|
||||||
*
|
|
||||||
**/
|
**/
|
||||||
|
|
||||||
#ifndef __PL011UARTCLOCKLIB_H__
|
#ifndef __PL011UARTCLOCKLIB_H__
|
||||||
|
@@ -1,9 +1,9 @@
|
|||||||
/** @file
|
/** @file
|
||||||
*
|
|
||||||
* Copyright (c) 2011-2016, ARM Limited. All rights reserved.
|
Copyright (c) 2011-2016, ARM Limited. All rights reserved.
|
||||||
*
|
|
||||||
* SPDX-License-Identifier: BSD-2-Clause-Patent
|
SPDX-License-Identifier: BSD-2-Clause-Patent
|
||||||
*
|
|
||||||
**/
|
**/
|
||||||
|
|
||||||
#ifndef __PL011_UART_LIB_H__
|
#ifndef __PL011_UART_LIB_H__
|
||||||
|
@@ -1,9 +1,9 @@
|
|||||||
/** @file
|
/** @file
|
||||||
*
|
|
||||||
* Copyright (c) 2011-2012, ARM Limited. All rights reserved.
|
Copyright (c) 2011-2012, ARM Limited. All rights reserved.
|
||||||
*
|
|
||||||
* SPDX-License-Identifier: BSD-2-Clause-Patent
|
SPDX-License-Identifier: BSD-2-Clause-Patent
|
||||||
*
|
|
||||||
**/
|
**/
|
||||||
|
|
||||||
#include <Library/ArmLib.h>
|
#include <Library/ArmLib.h>
|
||||||
|
@@ -1,9 +1,9 @@
|
|||||||
/** @file
|
/** @file
|
||||||
*
|
|
||||||
* Copyright (c) 2011, ARM Limited. All rights reserved.
|
Copyright (c) 2011, ARM Limited. All rights reserved.
|
||||||
*
|
|
||||||
* SPDX-License-Identifier: BSD-2-Clause-Patent
|
SPDX-License-Identifier: BSD-2-Clause-Patent
|
||||||
*
|
|
||||||
**/
|
**/
|
||||||
|
|
||||||
#include <Library/ArmPlatformLib.h>
|
#include <Library/ArmPlatformLib.h>
|
||||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user