acpi_evaluate_integer
来源:互联网 发布:电子商务淘宝运营模式 编辑:程序博客网 时间:2024/04/29 09:12
acpi_evaluate_integer 用于执行acpi表格中的函数并返回值
以status = acpi_evaluate_integer(ac->device->handle, "_PSR", NULL,&ac->state);为例
acpi_status
acpi_evaluate_integer(acpi_handle handle,
acpi_string pathname,
struct acpi_object_list *arguments, unsigned long long *data)
{
acpi_status status = AE_OK;
union acpi_object element;
struct acpi_buffer buffer = { 0, NULL };
if (!data)
return AE_BAD_PARAMETER;
buffer.length = sizeof(union acpi_object);
buffer.pointer = &element;
status = acpi_evaluate_object(handle, pathname, arguments, &buffer);
if (ACPI_FAILURE(status)) {
acpi_util_eval_error(handle, pathname, status);
return status;
}
if (element.type != ACPI_TYPE_INTEGER) {
acpi_util_eval_error(handle, pathname, AE_BAD_DATA);
return AE_BAD_DATA;
}
*data = element.integer.value;
ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Return value [%llu]\n", *data));
return AE_OK;
}
acpi_evaluate_integer 首先调用acpi_evaluate_object 运行acpi 中定义的函数,然后返回值存在buffer中
最后将*data = element.integer.value; 返回.
以status = acpi_evaluate_integer(ac->device->handle, "_PSR", NULL,&ac->state);为例
acpi_status
acpi_evaluate_integer(acpi_handle handle,
acpi_string pathname,
struct acpi_object_list *arguments, unsigned long long *data)
{
acpi_status status = AE_OK;
union acpi_object element;
struct acpi_buffer buffer = { 0, NULL };
if (!data)
return AE_BAD_PARAMETER;
buffer.length = sizeof(union acpi_object);
buffer.pointer = &element;
status = acpi_evaluate_object(handle, pathname, arguments, &buffer);
if (ACPI_FAILURE(status)) {
acpi_util_eval_error(handle, pathname, status);
return status;
}
if (element.type != ACPI_TYPE_INTEGER) {
acpi_util_eval_error(handle, pathname, AE_BAD_DATA);
return AE_BAD_DATA;
}
*data = element.integer.value;
ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Return value [%llu]\n", *data));
return AE_OK;
}
acpi_evaluate_integer 首先调用acpi_evaluate_object 运行acpi 中定义的函数,然后返回值存在buffer中
最后将*data = element.integer.value; 返回.
0 0
- acpi_evaluate_integer
- linux设备驱动归纳总结(三):6.poll和sellct
- hadoop task的执行
- uboot支持ubi和ubifs遇到的问题
- 未来VR交互模式的畅想
- POJ 3126 Prime Path
- acpi_evaluate_integer
- 数据结构----二叉树----哈夫曼编码
- 微信小程序入门六: WebSocket应用
- OpenLayers之加载缩放控件
- Apache2.4.x版wampserver本地php服务器如何让外网访问及启用.htaccess
- TCP的粘包和分包
- python+BeautifulSoup文档遍历树子节点
- Java 8 中的 Streams API 详解
- 【c++】指针