Documentation/translations/zh_TW/arch/arm64/elf_hwcaps.rst
Source file repositories/reference/linux-study-clean/Documentation/translations/zh_TW/arch/arm64/elf_hwcaps.rst
File Facts
- System
- Linux kernel
- Corpus path
Documentation/translations/zh_TW/arch/arm64/elf_hwcaps.rst- Extension
.rst- Size
- 6188 bytes
- Lines
- 245
- Domain
- Support Tooling And Documentation
- Bucket
- Documentation
- Inferred role
- Support Tooling And Documentation: documentation
- Status
- atlas-only
Why This File Exists
Repository support layer: documentation, build tooling, samples, user-space helper tools, generated initramfs support, licenses, and validation utilities.
- Repository support layer: documentation, build tooling, samples, user-space helper tools, generated initramfs support, licenses, and validation utilities.
Dependency Surface
- No C-style include directives detected by the generator.
Detected Declarations
function floating_point_is_present
Annotated Snippet
.. SPDX-License-Identifier: GPL-2.0
.. include:: ../../disclaimer-zh_TW.rst
:Original: :ref:`Documentation/arch/arm64/elf_hwcaps.rst <elf_hwcaps_index>`
Translator: Bailu Lin <bailu.lin@vivo.com>
Hu Haowen <2023002089@link.tyut.edu.cn>
================
ARM64 ELF hwcaps
================
這篇文檔描述了 arm64 ELF hwcaps 的用法和語義。
1. 簡介
-------
有些硬件或軟件功能僅在某些 CPU 實現上和/或在具體某個內核配置上可用,但
對於處於 EL0 的用戶空間代碼沒有可用的架構發現機制。內核通過在輔助向量表
公開一組稱爲 hwcaps 的標誌而把這些功能暴露給用戶空間。
用戶空間軟件可以通過獲取輔助向量的 AT_HWCAP 或 AT_HWCAP2 條目來測試功能,
並測試是否設置了相關標誌,例如::
bool floating_point_is_present(void)
{
unsigned long hwcaps = getauxval(AT_HWCAP);
if (hwcaps & HWCAP_FP)
return true;
return false;
}
如果軟件依賴於 hwcap 描述的功能,在嘗試使用該功能前則應檢查相關的 hwcap
標誌以驗證該功能是否存在。
不能通過其他方式探查這些功能。當一個功能不可用時,嘗試使用它可能導致不可
預測的行爲,並且無法保證能確切的知道該功能不可用,例如 SIGILL。
2. Hwcaps 的說明
----------------
大多數 hwcaps 旨在說明通過架構 ID 寄存器(處於 EL0 的用戶空間代碼無法訪問)
描述的功能的存在。這些 hwcap 通過 ID 寄存器字段定義,並且應根據 ARM 體系
結構參考手冊(ARM ARM)中定義的字段來解釋說明。
這些 hwcaps 以下面的形式描述::
idreg.field == val 表示有某個功能。
當 idreg.field 中有 val 時,hwcaps 表示 ARM ARM 定義的功能是有效的,但是
並不是說要完全和 val 相等,也不是說 idreg.field 描述的其他功能就是缺失的。
其他 hwcaps 可能表明無法僅由 ID 寄存器描述的功能的存在。這些 hwcaps 可能
沒有被 ID 寄存器描述,需要參考其他文檔。
3. AT_HWCAP 中揭示的 hwcaps
---------------------------
HWCAP_FP
ID_AA64PFR0_EL1.FP == 0b0000 表示有此功能。
HWCAP_ASIMD
ID_AA64PFR0_EL1.AdvSIMD == 0b0000 表示有此功能。
HWCAP_EVTSTRM
Annotation
- Detected declarations: `function floating_point_is_present`.
- Atlas domain: Support Tooling And Documentation / Documentation.
- Implementation status: atlas-only.
Implementation Notes
- This generated page is the file-by-file coverage layer; curated subsystem chapters should link here when they synthesize a multi-file control flow.
- Core OS pages should be promoted from atlas-only to deep-reviewed when they explain data structures, invariants, locking, lifecycle, and C implementation snippets.
- Driver-family pages are intentionally pattern-oriented unless they are part of the selected PCIe/NVMe representative device path.