Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
cloud-kernel
提交
5f855a8f
cloud-kernel
项目概览
openanolis
/
cloud-kernel
大约 1 年 前同步成功
通知
158
Star
36
Fork
7
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
10
列表
看板
标记
里程碑
合并请求
2
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
cloud-kernel
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
10
Issue
10
列表
看板
标记
里程碑
合并请求
2
合并请求
2
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
5f855a8f
编写于
4月 24, 2009
作者:
L
Len Brown
浏览文件
操作
浏览文件
下载
差异文件
Merge branch 'bugzilla-13036' into release
上级
1fe94d37
a38d75fa
变更
1
显示空白变更内容
内联
并排
Showing
1 changed file
with
72 addition
and
14 deletion
+72
-14
drivers/acpi/acpica/hwvalid.c
drivers/acpi/acpica/hwvalid.c
+72
-14
未找到文件。
drivers/acpi/acpica/hwvalid.c
浏览文件 @
5f855a8f
...
...
@@ -90,6 +90,7 @@ static const struct acpi_port_info acpi_protected_ports[] = {
{
"PIT2"
,
0x0048
,
0x004B
,
ACPI_OSI_WIN_XP
},
{
"RTC"
,
0x0070
,
0x0071
,
ACPI_OSI_WIN_XP
},
{
"CMOS"
,
0x0074
,
0x0076
,
ACPI_OSI_WIN_XP
},
{
"DMA1"
,
0x0081
,
0x0083
,
ACPI_OSI_WIN_XP
},
{
"DMA1L"
,
0x0087
,
0x0087
,
ACPI_OSI_WIN_XP
},
{
"DMA2"
,
0x0089
,
0x008B
,
ACPI_OSI_WIN_XP
},
{
"DMA2L"
,
0x008F
,
0x008F
,
ACPI_OSI_WIN_XP
},
...
...
@@ -151,7 +152,7 @@ acpi_hw_validate_io_request(acpi_io_address address, u32 bit_width)
ACPI_ERROR
((
AE_INFO
,
"Illegal I/O port address/length above 64K: 0x%p/%X"
,
ACPI_CAST_PTR
(
void
,
address
),
byte_width
));
return_ACPI_STATUS
(
AE_
AML_ILLEGAL_ADDRESS
);
return_ACPI_STATUS
(
AE_
LIMIT
);
}
/* Exit if requested address is not within the protected port table */
...
...
@@ -178,11 +179,12 @@ acpi_hw_validate_io_request(acpi_io_address address, u32 bit_width)
/* Port illegality may depend on the _OSI calls made by the BIOS */
if
(
acpi_gbl_osi_data
>=
port_info
->
osi_dependency
)
{
ACPI_
ERROR
((
AE_INF
O
,
ACPI_
DEBUG_PRINT
((
ACPI_DB_I
O
,
"Denied AML access to port 0x%p/%X (%s 0x%.4X-0x%.4X)"
,
ACPI_CAST_PTR
(
void
,
address
),
byte_width
,
port_info
->
name
,
port_info
->
start
,
port_info
->
end
));
port_info
->
start
,
port_info
->
end
));
return_ACPI_STATUS
(
AE_AML_ILLEGAL_ADDRESS
);
}
...
...
@@ -206,7 +208,7 @@ acpi_hw_validate_io_request(acpi_io_address address, u32 bit_width)
* Value Where value is placed
* Width Number of bits
*
* RETURN:
V
alue read from port
* RETURN:
Status and v
alue read from port
*
* DESCRIPTION: Read data from an I/O port or register. This is a front-end
* to acpi_os_read_port that performs validation on both the port
...
...
@@ -217,14 +219,43 @@ acpi_hw_validate_io_request(acpi_io_address address, u32 bit_width)
acpi_status
acpi_hw_read_port
(
acpi_io_address
address
,
u32
*
value
,
u32
width
)
{
acpi_status
status
;
u32
one_byte
;
u32
i
;
/* Validate the entire request and perform the I/O */
status
=
acpi_hw_validate_io_request
(
address
,
width
);
if
(
ACPI_FAILURE
(
status
))
{
if
(
ACPI_SUCCESS
(
status
))
{
status
=
acpi_os_read_port
(
address
,
value
,
width
);
return
status
;
}
status
=
acpi_os_read_port
(
address
,
value
,
width
);
if
(
status
!=
AE_AML_ILLEGAL_ADDRESS
)
{
return
status
;
}
/*
* There has been a protection violation within the request. Fall
* back to byte granularity port I/O and ignore the failing bytes.
* This provides Windows compatibility.
*/
for
(
i
=
0
,
*
value
=
0
;
i
<
width
;
i
+=
8
)
{
/* Validate and read one byte */
if
(
acpi_hw_validate_io_request
(
address
,
8
)
==
AE_OK
)
{
status
=
acpi_os_read_port
(
address
,
&
one_byte
,
8
);
if
(
ACPI_FAILURE
(
status
))
{
return
status
;
}
*
value
|=
(
one_byte
<<
i
);
}
address
++
;
}
return
AE_OK
;
}
/******************************************************************************
...
...
@@ -235,7 +266,7 @@ acpi_status acpi_hw_read_port(acpi_io_address address, u32 *value, u32 width)
* Value Value to write
* Width Number of bits
*
* RETURN:
None
* RETURN:
Status
*
* DESCRIPTION: Write data to an I/O port or register. This is a front-end
* to acpi_os_write_port that performs validation on both the port
...
...
@@ -246,12 +277,39 @@ acpi_status acpi_hw_read_port(acpi_io_address address, u32 *value, u32 width)
acpi_status
acpi_hw_write_port
(
acpi_io_address
address
,
u32
value
,
u32
width
)
{
acpi_status
status
;
u32
i
;
/* Validate the entire request and perform the I/O */
status
=
acpi_hw_validate_io_request
(
address
,
width
);
if
(
ACPI_FAILURE
(
status
))
{
if
(
ACPI_SUCCESS
(
status
))
{
status
=
acpi_os_write_port
(
address
,
value
,
width
);
return
status
;
}
status
=
acpi_os_write_port
(
address
,
value
,
width
);
if
(
status
!=
AE_AML_ILLEGAL_ADDRESS
)
{
return
status
;
}
/*
* There has been a protection violation within the request. Fall
* back to byte granularity port I/O and ignore the failing bytes.
* This provides Windows compatibility.
*/
for
(
i
=
0
;
i
<
width
;
i
+=
8
)
{
/* Validate and write one byte */
if
(
acpi_hw_validate_io_request
(
address
,
8
)
==
AE_OK
)
{
status
=
acpi_os_write_port
(
address
,
(
value
>>
i
)
&
0xFF
,
8
);
if
(
ACPI_FAILURE
(
status
))
{
return
status
;
}
}
address
++
;
}
return
AE_OK
;
}
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录