内核ACPI函数API之acpi_has_method

本文介绍了一个用于检查ACPI handle是否提供了特定方法的函数acpi_has_method。通过示例代码展示了如何使用该函数来验证是否存在名为_DEP的方法。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

acpi_has_method(acpi_handle handle, char *name) 用于判断handle 是否提供形参name指定的method
其使用的例程如下:
	if (!acpi_has_method(adev->handle, "_DEP"))
		return false;
例如这个例子就是判断adev->handle 是提供_DEP 这个函数
其源码分析如下:
bool acpi_has_method(acpi_handle handle, char *name)
{
	acpi_handle tmp;
	#原来首先就是通过acpi_get_handle 查询这个handler 下是否包含name 这个函数,并通过acpi_get_handle的返回值确认,0 #表示包含这个函数
	return ACPI_SUCCESS(acpi_get_handle(handle, name, &tmp));
}
其中
#define ACPI_SUCCESS(a)                 (!(a))

笔记本的风扇控制 ---------------------------------------- 09 November 2006. Summary of changes for version 20061109: 1) ACPI CA Core Subsystem: Optimized the Load ASL operator in the case where the source operand is an operation region. Simply map the operation region memory, instead of performing a bytewise read. (Region must be of type SystemMemory, see below.) Fixed the Load ASL operator for the case where the source operand is a region field. A buffer object is also allowed as the source operand. BZ 480 Fixed a problem where the Load ASL operator allowed the source operand to be an operation region of any type. It is now restricted to regions of type SystemMemory, as per the ACPI specification. BZ 481 Additional cleanup and optimizations for the new Table Manager code. AcpiEnable will now fail if all of the required ACPI tables are not loaded (FADT, FACS, DSDT). BZ 477 Added #pragma pack(8/4) to acobject.h to ensure that the structures in this header are always compiled as aligned. The ACPI_OPERAND_OBJECT has been manually optimized to be aligned and will not work if it is byte-packed. Example Code and Data Size: These are the sizes for the OS- independent acpica.lib produced by the Microsoft Visual C++ 6.0 32- bit compiler. The debug version of the code includes the debug output trace mechanism and has a much larger code and data size. Previous Release: Non-Debug Version: 78.1K Code, 17.1K Data, 95.2K Total Debug Version: 155.4K Code, 63.1K Data, 218.5K Total Current Release: Non-Debug Version: 77.9K Code, 17.0K Data, 94.9K Total Debug Version: 155.2K Code, 63.1K Data, 218.3K Total 2) iASL Compiler/Disassembler and Tools: Fixed a problem where the presence of the _OSI predefined control method within complex expressions could cause an internal compiler error. AcpiExec: Implemented full region support for multiple address spaces. SpaceId is now part of the REGION object. BZ 429 ---------------------------------------- 11 Oc
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值