Documentation/translations/zh_TW/cpu-freq/core.rst
Source file repositories/reference/linux-study-clean/Documentation/translations/zh_TW/cpu-freq/core.rst
File Facts
- System
- Linux kernel
- Corpus path
Documentation/translations/zh_TW/cpu-freq/core.rst- Extension
.rst- Size
- 3547 bytes
- Lines
- 111
- 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.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
- No C-style include directives detected by the generator.
Detected Declarations
function soc_pm_init
Annotated Snippet
.. SPDX-License-Identifier: GPL-2.0
.. include:: ../disclaimer-zh_TW.rst
:Original: Documentation/cpu-freq/core.rst
:翻譯:
司延騰 Yanteng Si <siyanteng@loongson.cn>
:校譯:
唐藝舟 Tang Yizhou <tangyeechou@gmail.com>
====================================
CPUFreq核心和CPUFreq通知器的通用說明
====================================
作者:
- Dominik Brodowski <linux@brodo.de>
- David Kimdon <dwhedon@debian.org>
- Rafael J. Wysocki <rafael.j.wysocki@intel.com>
- Viresh Kumar <viresh.kumar@linaro.org>
.. 目錄:
1. CPUFreq核心和接口
2. CPUFreq通知器
3. 含有Operating Performance Point (OPP)的CPUFreq表的生成
1. CPUFreq核心和接口
======================
cpufreq核心代碼位於drivers/cpufreq/cpufreq.c中。這些cpufreq代碼爲CPUFreq架構的驅
動程序(那些執行硬件頻率切換的代碼)以及 "通知器" 提供了一個標準化的接口。
包括設備驅動程序;需要了解策略變化(如 ACPI 熱量管理),或所有頻率變化(如計時代碼),
甚至需要強制限制爲指定頻率(如 ARM 架構上的 LCD 驅動程序)的其它內核組件。
此外,內核 "常數" loops_per_jiffy 會根據頻率變化而更新。
cpufreq策略的引用計數由 cpufreq_cpu_get 和 cpufreq_cpu_put 來完成,以確保 cpufreq 驅
動程序被正確地註冊到核心中,並且驅動程序在 cpufreq_put_cpu 被調用之前不會被卸載。這也保證
了每個CPU核的cpufreq 策略在使用期間不會被釋放。
2. CPUFreq 通知器
====================
CPUFreq通知器遵循標準的內核通知器接口。
關於通知器的細節請參閱 linux/include/linux/notifier.h。
這裏有兩個不同的CPUfreq通知器 - 策略通知器和轉換通知器。
2.1 CPUFreq策略通知器
----------------------------
當創建或移除策略時,這些都會被通知。
階段是在通知器的第二個參數中指定的。當第一次創建策略時,階段是CPUFREQ_CREATE_POLICY,當
策略被移除時,階段是CPUFREQ_REMOVE_POLICY。
第三個參數 ``void *pointer`` 指向一個結構體cpufreq_policy,其包括min,max(新策略的下限和
上限(單位爲kHz))這幾個值。
2.2 CPUFreq轉換通知器
--------------------------------
當CPUfreq驅動切換CPU核心頻率時,策略中的每個在線CPU都會收到兩次通知,這些變化沒有任何外部幹
預。
第二個參數指定階段 - CPUFREQ_PRECHANGE or CPUFREQ_POSTCHANGE.
Annotation
- Detected declarations: `function soc_pm_init`.
- 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.