Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
cloud-kernel
提交
5f3b1a8b
cloud-kernel
项目概览
openanolis
/
cloud-kernel
1 年多 前同步成功
通知
160
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看板
提交
5f3b1a8b
编写于
2月 02, 2007
作者:
A
Alexey Starikovskiy
提交者:
Len Brown
2月 02, 2007
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
ACPICA: Remove duplicate table definitions (non-conflicting)
Signed-off-by:
N
Len Brown
<
len.brown@intel.com
>
上级
ad363f80
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
224 addition
and
330 deletion
+224
-330
arch/i386/kernel/acpi/boot.c
arch/i386/kernel/acpi/boot.c
+74
-82
arch/ia64/kernel/acpi.c
arch/ia64/kernel/acpi.c
+86
-86
drivers/acpi/bus.c
drivers/acpi/bus.c
+6
-5
drivers/acpi/tables.c
drivers/acpi/tables.c
+55
-54
include/linux/acpi.h
include/linux/acpi.h
+3
-103
未找到文件。
arch/i386/kernel/acpi/boot.c
浏览文件 @
5f3b1a8b
...
...
@@ -66,7 +66,7 @@ static inline int acpi_madt_oem_check(char *oem_id, char *oem_table_id) { return
#define BAD_MADT_ENTRY(entry, end) ( \
(!entry) || (unsigned long)entry + sizeof(*entry) > end || \
((
acpi_table_entry
_header *)entry)->length < sizeof(*entry))
((
struct acpi_subtable
_header *)entry)->length < sizeof(*entry))
#define PREFIX "ACPI: "
...
...
@@ -79,7 +79,7 @@ int acpi_ioapic;
int
acpi_strict
;
EXPORT_SYMBOL
(
acpi_strict
);
acpi_interrupt_flags
acpi_sci_flags
__initdata
;
u8
acpi_sci_flags
__initdata
;
int
acpi_sci_override_gsi
__initdata
;
int
acpi_skip_timer_override
__initdata
;
int
acpi_use_timer_override
__initdata
;
...
...
@@ -246,11 +246,11 @@ static int __init acpi_parse_madt(struct acpi_table_header *header)
}
static
int
__init
acpi_parse_lapic
(
acpi_table_entry
_header
*
header
,
const
unsigned
long
end
)
acpi_parse_lapic
(
struct
acpi_subtable
_header
*
header
,
const
unsigned
long
end
)
{
struct
acpi_
table_l
apic
*
processor
=
NULL
;
struct
acpi_
madt_local_
apic
*
processor
=
NULL
;
processor
=
(
struct
acpi_
table_l
apic
*
)
header
;
processor
=
(
struct
acpi_
madt_local_
apic
*
)
header
;
if
(
BAD_MADT_ENTRY
(
processor
,
end
))
return
-
EINVAL
;
...
...
@@ -258,8 +258,8 @@ acpi_parse_lapic(acpi_table_entry_header * header, const unsigned long end)
acpi_table_print_madt_entry
(
header
);
/* Record local apic id only when enabled */
if
(
processor
->
flags
.
enabled
)
x86_acpiid_to_apicid
[
processor
->
acpi
_id
]
=
processor
->
id
;
if
(
processor
->
lapic_flags
&
ACPI_MADT_ENABLED
)
x86_acpiid_to_apicid
[
processor
->
processor
_id
]
=
processor
->
id
;
/*
* We need to register disabled CPU as well to permit
...
...
@@ -269,18 +269,18 @@ acpi_parse_lapic(acpi_table_entry_header * header, const unsigned long end)
* when we use CPU hotplug.
*/
mp_register_lapic
(
processor
->
id
,
/* APIC ID */
processor
->
flags
.
enabled
);
/* Enabled? */
processor
->
lapic_flags
&
ACPI_MADT_ENABLED
);
/* Enabled? */
return
0
;
}
static
int
__init
acpi_parse_lapic_addr_ovr
(
acpi_table_entry
_header
*
header
,
acpi_parse_lapic_addr_ovr
(
struct
acpi_subtable
_header
*
header
,
const
unsigned
long
end
)
{
struct
acpi_
table_lapic_addr_ovr
*
lapic_addr_ovr
=
NULL
;
struct
acpi_
madt_local_apic_override
*
lapic_addr_ovr
=
NULL
;
lapic_addr_ovr
=
(
struct
acpi_
table_lapic_addr_ovr
*
)
header
;
lapic_addr_ovr
=
(
struct
acpi_
madt_local_apic_override
*
)
header
;
if
(
BAD_MADT_ENTRY
(
lapic_addr_ovr
,
end
))
return
-
EINVAL
;
...
...
@@ -291,11 +291,11 @@ acpi_parse_lapic_addr_ovr(acpi_table_entry_header * header,
}
static
int
__init
acpi_parse_lapic_nmi
(
acpi_table_entry
_header
*
header
,
const
unsigned
long
end
)
acpi_parse_lapic_nmi
(
struct
acpi_subtable
_header
*
header
,
const
unsigned
long
end
)
{
struct
acpi_
table_l
apic_nmi
*
lapic_nmi
=
NULL
;
struct
acpi_
madt_local_
apic_nmi
*
lapic_nmi
=
NULL
;
lapic_nmi
=
(
struct
acpi_
table_l
apic_nmi
*
)
header
;
lapic_nmi
=
(
struct
acpi_
madt_local_
apic_nmi
*
)
header
;
if
(
BAD_MADT_ENTRY
(
lapic_nmi
,
end
))
return
-
EINVAL
;
...
...
@@ -313,11 +313,11 @@ acpi_parse_lapic_nmi(acpi_table_entry_header * header, const unsigned long end)
#ifdef CONFIG_X86_IO_APIC
static
int
__init
acpi_parse_ioapic
(
acpi_table_entry
_header
*
header
,
const
unsigned
long
end
)
acpi_parse_ioapic
(
struct
acpi_subtable
_header
*
header
,
const
unsigned
long
end
)
{
struct
acpi_
table_io
apic
*
ioapic
=
NULL
;
struct
acpi_
madt_io_
apic
*
ioapic
=
NULL
;
ioapic
=
(
struct
acpi_
table_io
apic
*
)
header
;
ioapic
=
(
struct
acpi_
madt_io_
apic
*
)
header
;
if
(
BAD_MADT_ENTRY
(
ioapic
,
end
))
return
-
EINVAL
;
...
...
@@ -342,11 +342,11 @@ static void __init acpi_sci_ioapic_setup(u32 gsi, u16 polarity, u16 trigger)
polarity
=
3
;
/* Command-line over-ride via acpi_sci= */
if
(
acpi_sci_flags
.
trigger
)
trigger
=
acpi_sci_flags
.
trigger
;
if
(
acpi_sci_flags
&
ACPI_MADT_TRIGGER_MASK
)
trigger
=
(
acpi_sci_flags
&
ACPI_MADT_TRIGGER_MASK
)
>>
2
;
if
(
acpi_sci_flags
.
polarity
)
polarity
=
acpi_sci_flags
.
polarity
;
if
(
acpi_sci_flags
&
ACPI_MADT_POLARITY_MASK
)
polarity
=
acpi_sci_flags
&
ACPI_MADT_POLARITY_MASK
;
/*
* mp_config_acpi_legacy_irqs() already setup IRQs < 16
...
...
@@ -364,44 +364,45 @@ static void __init acpi_sci_ioapic_setup(u32 gsi, u16 polarity, u16 trigger)
}
static
int
__init
acpi_parse_int_src_ovr
(
acpi_table_entry
_header
*
header
,
acpi_parse_int_src_ovr
(
struct
acpi_subtable
_header
*
header
,
const
unsigned
long
end
)
{
struct
acpi_
table_int_src_ovr
*
intsrc
=
NULL
;
struct
acpi_
madt_interrupt_override
*
intsrc
=
NULL
;
intsrc
=
(
struct
acpi_
table_int_src_ovr
*
)
header
;
intsrc
=
(
struct
acpi_
madt_interrupt_override
*
)
header
;
if
(
BAD_MADT_ENTRY
(
intsrc
,
end
))
return
-
EINVAL
;
acpi_table_print_madt_entry
(
header
);
if
(
intsrc
->
bus
_irq
==
acpi_gbl_FADT
.
sci_interrupt
)
{
if
(
intsrc
->
source
_irq
==
acpi_gbl_FADT
.
sci_interrupt
)
{
acpi_sci_ioapic_setup
(
intsrc
->
global_irq
,
intsrc
->
flags
.
polarity
,
intsrc
->
flags
.
trigger
);
intsrc
->
inti_flags
&
ACPI_MADT_POLARITY_MASK
,
(
intsrc
->
inti_flags
&
ACPI_MADT_TRIGGER_MASK
)
>>
2
);
return
0
;
}
if
(
acpi_skip_timer_override
&&
intsrc
->
bus
_irq
==
0
&&
intsrc
->
global_irq
==
2
)
{
intsrc
->
source
_irq
==
0
&&
intsrc
->
global_irq
==
2
)
{
printk
(
PREFIX
"BIOS IRQ0 pin2 override ignored.
\n
"
);
return
0
;
}
mp_override_legacy_irq
(
intsrc
->
bus_irq
,
intsrc
->
flags
.
polarity
,
intsrc
->
flags
.
trigger
,
intsrc
->
global_irq
);
mp_override_legacy_irq
(
intsrc
->
source_irq
,
intsrc
->
inti_flags
&
ACPI_MADT_POLARITY_MASK
,
(
intsrc
->
inti_flags
&
ACPI_MADT_TRIGGER_MASK
)
>>
2
,
intsrc
->
global_irq
);
return
0
;
}
static
int
__init
acpi_parse_nmi_src
(
acpi_table_entry
_header
*
header
,
const
unsigned
long
end
)
acpi_parse_nmi_src
(
struct
acpi_subtable
_header
*
header
,
const
unsigned
long
end
)
{
struct
acpi_
table_nmi_src
*
nmi_src
=
NULL
;
struct
acpi_
madt_nmi_source
*
nmi_src
=
NULL
;
nmi_src
=
(
struct
acpi_
table_nmi_src
*
)
header
;
nmi_src
=
(
struct
acpi_
madt_nmi_source
*
)
header
;
if
(
BAD_MADT_ENTRY
(
nmi_src
,
end
))
return
-
EINVAL
;
...
...
@@ -417,7 +418,7 @@ acpi_parse_nmi_src(acpi_table_entry_header * header, const unsigned long end)
/*
* acpi_pic_sci_set_trigger()
*
*
* use ELCR to set PIC-mode trigger type for SCI
*
* If a PIC-mode SCI is not recognized or gives spurious IRQ7's
...
...
@@ -511,7 +512,7 @@ int acpi_map_lsapic(acpi_handle handle, int *pcpu)
{
struct
acpi_buffer
buffer
=
{
ACPI_ALLOCATE_BUFFER
,
NULL
};
union
acpi_object
*
obj
;
struct
acpi_
table_l
apic
*
lapic
;
struct
acpi_
madt_local_
apic
*
lapic
;
cpumask_t
tmp_map
,
new_map
;
u8
physid
;
int
cpu
;
...
...
@@ -529,10 +530,10 @@ int acpi_map_lsapic(acpi_handle handle, int *pcpu)
return
-
EINVAL
;
}
lapic
=
(
struct
acpi_
table_l
apic
*
)
obj
->
buffer
.
pointer
;
lapic
=
(
struct
acpi_
madt_local_
apic
*
)
obj
->
buffer
.
pointer
;
if
(
(
lapic
->
header
.
type
!=
ACPI_MADT_LAPIC
)
||
(
!
lapic
->
flags
.
enabled
))
{
if
(
lapic
->
header
.
type
!=
ACPI_MADT_TYPE_LOCAL_APIC
||
!
(
lapic
->
lapic_flags
&
ACPI_MADT_ENABLED
))
{
kfree
(
buffer
.
pointer
);
return
-
EINVAL
;
}
...
...
@@ -544,7 +545,7 @@ int acpi_map_lsapic(acpi_handle handle, int *pcpu)
buffer
.
pointer
=
NULL
;
tmp_map
=
cpu_present_map
;
mp_register_lapic
(
physid
,
lapic
->
flags
.
enabled
);
mp_register_lapic
(
physid
,
lapic
->
lapic_flags
&
ACPI_MADT_ENABLED
);
/*
* If mp_register_lapic successfully generates a new logical cpu
...
...
@@ -619,36 +620,30 @@ acpi_scan_rsdp(unsigned long start, unsigned long length)
return
0
;
}
static
int
__init
acpi_parse_sbf
(
struct
acpi_table_header
*
header
)
static
int
__init
acpi_parse_sbf
(
struct
acpi_table_header
*
table
)
{
struct
acpi_table_sbf
*
sb
;
if
(
!
header
)
return
-
EINVAL
;
struct
acpi_table_boot
*
sb
;
sb
=
(
struct
acpi_table_
sbf
*
)
header
;
sb
=
(
struct
acpi_table_
boot
*
)
table
;
if
(
!
sb
)
{
printk
(
KERN_WARNING
PREFIX
"Unable to map SBF
\n
"
);
return
-
ENODEV
;
}
sbf_port
=
sb
->
sbf_cmos
;
/* Save CMOS port */
sbf_port
=
sb
->
cmos_index
;
/* Save CMOS port */
return
0
;
}
#ifdef CONFIG_HPET_TIMER
static
int
__init
acpi_parse_hpet
(
struct
acpi_table_header
*
header
)
static
int
__init
acpi_parse_hpet
(
struct
acpi_table_header
*
table
)
{
struct
acpi_table_hpet
*
hpet_tbl
;
struct
resource
*
hpet_res
;
resource_size_t
res_start
;
if
(
!
header
)
return
-
EINVAL
;
hpet_tbl
=
(
struct
acpi_table_hpet
*
)
header
;
hpet_tbl
=
(
struct
acpi_table_hpet
*
)
table
;
if
(
!
hpet_tbl
)
{
printk
(
KERN_WARNING
PREFIX
"Unable to map HPET
\n
"
);
return
-
ENODEV
;
...
...
@@ -706,35 +701,28 @@ static int __init acpi_parse_hpet(struct acpi_table_header *header)
extern
u32
pmtmr_ioport
;
#endif
static
int
__init
acpi_parse_fadt
(
struct
acpi_table_header
*
header
)
static
int
__init
acpi_parse_fadt
(
struct
acpi_table_header
*
table
)
{
struct
acpi_table_fadt
*
fadt
=
NULL
;
fadt
=
(
struct
acpi_table_fadt
*
)
header
;
if
(
!
fadt
)
{
printk
(
KERN_WARNING
PREFIX
"Unable to map FADT
\n
"
);
return
0
;
}
#ifdef CONFIG_X86_PM_TIMER
/* detect the location of the ACPI PM Timer */
if
(
fadt
->
header
.
revision
>=
FADT2_REVISION_ID
)
{
if
(
acpi_gbl_FADT
.
header
.
revision
>=
FADT2_REVISION_ID
)
{
/* FADT rev. 2 */
if
(
fadt
->
xpm_timer_block
.
space_id
!=
if
(
acpi_gbl_FADT
.
xpm_timer_block
.
space_id
!=
ACPI_ADR_SPACE_SYSTEM_IO
)
return
0
;
pmtmr_ioport
=
fadt
->
xpm_timer_block
.
address
;
pmtmr_ioport
=
acpi_gbl_FADT
.
xpm_timer_block
.
address
;
/*
* "X" fields are optional extensions to the original V1.0
* fields, so we must selectively expand V1.0 fields if the
* corresponding X field is zero.
*/
if
(
!
pmtmr_ioport
)
pmtmr_ioport
=
fadt
->
pm_timer_block
;
pmtmr_ioport
=
acpi_gbl_FADT
.
pm_timer_block
;
}
else
{
/* FADT rev. 1 */
pmtmr_ioport
=
fadt
->
pm_timer_block
;
pmtmr_ioport
=
acpi_gbl_FADT
.
pm_timer_block
;
}
if
(
pmtmr_ioport
)
printk
(
KERN_INFO
PREFIX
"PM-Timer IO Port: %#x
\n
"
,
...
...
@@ -776,13 +764,13 @@ static int __init acpi_parse_madt_lapic_entries(void)
if
(
!
cpu_has_apic
)
return
-
ENODEV
;
/*
/*
* Note that the LAPIC address is obtained from the MADT (32-bit value)
* and (optionally) overriden by a LAPIC_ADDR_OVR entry (64-bit value).
*/
count
=
acpi_table_parse_madt
(
ACPI_MADT_
LAPIC_ADDR_OVR
,
acpi_table_parse_madt
(
ACPI_MADT_
TYPE_LOCAL_APIC_OVERRIDE
,
acpi_parse_lapic_addr_ovr
,
0
);
if
(
count
<
0
)
{
printk
(
KERN_ERR
PREFIX
...
...
@@ -792,7 +780,7 @@ static int __init acpi_parse_madt_lapic_entries(void)
mp_register_lapic_address
(
acpi_lapic_addr
);
count
=
acpi_table_parse_madt
(
ACPI_MADT_
L
APIC
,
acpi_parse_lapic
,
count
=
acpi_table_parse_madt
(
ACPI_MADT_
TYPE_LOCAL_
APIC
,
acpi_parse_lapic
,
MAX_APICS
);
if
(
!
count
)
{
printk
(
KERN_ERR
PREFIX
"No LAPIC entries present
\n
"
);
...
...
@@ -805,7 +793,7 @@ static int __init acpi_parse_madt_lapic_entries(void)
}
count
=
acpi_table_parse_madt
(
ACPI_MADT_
L
APIC_NMI
,
acpi_parse_lapic_nmi
,
0
);
acpi_table_parse_madt
(
ACPI_MADT_
TYPE_LOCAL_
APIC_NMI
,
acpi_parse_lapic_nmi
,
0
);
if
(
count
<
0
)
{
printk
(
KERN_ERR
PREFIX
"Error parsing LAPIC NMI entry
\n
"
);
/* TBD: Cleanup to allow fallback to MPS */
...
...
@@ -834,7 +822,7 @@ static int __init acpi_parse_madt_ioapic_entries(void)
return
-
ENODEV
;
}
if
(
!
cpu_has_apic
)
if
(
!
cpu_has_apic
)
return
-
ENODEV
;
/*
...
...
@@ -847,7 +835,7 @@ static int __init acpi_parse_madt_ioapic_entries(void)
}
count
=
acpi_table_parse_madt
(
ACPI_MADT_
IO
APIC
,
acpi_parse_ioapic
,
acpi_table_parse_madt
(
ACPI_MADT_
TYPE_IO_
APIC
,
acpi_parse_ioapic
,
MAX_IO_APICS
);
if
(
!
count
)
{
printk
(
KERN_ERR
PREFIX
"No IOAPIC entries present
\n
"
);
...
...
@@ -858,7 +846,7 @@ static int __init acpi_parse_madt_ioapic_entries(void)
}
count
=
acpi_table_parse_madt
(
ACPI_MADT_
INT_SRC_OVR
,
acpi_parse_int_src_ovr
,
acpi_table_parse_madt
(
ACPI_MADT_
TYPE_INTERRUPT_OVERRIDE
,
acpi_parse_int_src_ovr
,
NR_IRQ_VECTORS
);
if
(
count
<
0
)
{
printk
(
KERN_ERR
PREFIX
...
...
@@ -878,7 +866,7 @@ static int __init acpi_parse_madt_ioapic_entries(void)
mp_config_acpi_legacy_irqs
();
count
=
acpi_table_parse_madt
(
ACPI_MADT_
NMI_SRC
,
acpi_parse_nmi_src
,
acpi_table_parse_madt
(
ACPI_MADT_
TYPE_NMI_SOURCE
,
acpi_parse_nmi_src
,
NR_IRQ_VECTORS
);
if
(
count
<
0
)
{
printk
(
KERN_ERR
PREFIX
"Error parsing NMI SRC entry
\n
"
);
...
...
@@ -900,7 +888,7 @@ static void __init acpi_process_madt(void)
#ifdef CONFIG_X86_LOCAL_APIC
int
count
,
error
;
count
=
acpi_table_parse
(
"APIC"
,
acpi_parse_madt
);
count
=
acpi_table_parse
(
ACPI_SIG_MADT
,
acpi_parse_madt
);
if
(
count
>=
1
)
{
/*
...
...
@@ -1187,7 +1175,7 @@ int __init acpi_boot_table_init(void)
if
(
acpi_disabled
&&
!
acpi_ht
)
return
1
;
/*
/*
* Initialize the ACPI boot-time table parser.
*/
error
=
acpi_table_init
();
...
...
@@ -1196,7 +1184,7 @@ int __init acpi_boot_table_init(void)
return
error
;
}
acpi_table_parse
(
"BOOT"
,
acpi_parse_sbf
);
acpi_table_parse
(
ACPI_SIG_BOOT
,
acpi_parse_sbf
);
/*
* blacklist may disable ACPI entirely
...
...
@@ -1224,7 +1212,7 @@ int __init acpi_boot_init(void)
if
(
acpi_disabled
&&
!
acpi_ht
)
return
1
;
acpi_table_parse
(
"BOOT"
,
acpi_parse_sbf
);
acpi_table_parse
(
ACPI_SIG_BOOT
,
acpi_parse_sbf
);
/*
* set sci_int and PM timer address
...
...
@@ -1236,7 +1224,7 @@ int __init acpi_boot_init(void)
*/
acpi_process_madt
();
acpi_table_parse
(
"HPET"
,
acpi_parse_hpet
);
acpi_table_parse
(
ACPI_SIG_HPET
,
acpi_parse_hpet
);
return
0
;
}
...
...
@@ -1307,13 +1295,17 @@ static int __init setup_acpi_sci(char *s)
if
(
!
s
)
return
-
EINVAL
;
if
(
!
strcmp
(
s
,
"edge"
))
acpi_sci_flags
.
trigger
=
1
;
acpi_sci_flags
=
ACPI_MADT_TRIGGER_EDGE
|
(
acpi_sci_flags
&
~
ACPI_MADT_TRIGGER_MASK
);
else
if
(
!
strcmp
(
s
,
"level"
))
acpi_sci_flags
.
trigger
=
3
;
acpi_sci_flags
=
ACPI_MADT_TRIGGER_LEVEL
|
(
acpi_sci_flags
&
~
ACPI_MADT_TRIGGER_MASK
);
else
if
(
!
strcmp
(
s
,
"high"
))
acpi_sci_flags
.
polarity
=
1
;
acpi_sci_flags
=
ACPI_MADT_POLARITY_ACTIVE_HIGH
|
(
acpi_sci_flags
&
~
ACPI_MADT_POLARITY_MASK
);
else
if
(
!
strcmp
(
s
,
"low"
))
acpi_sci_flags
.
polarity
=
3
;
acpi_sci_flags
=
ACPI_MADT_POLARITY_ACTIVE_LOW
|
(
acpi_sci_flags
&
~
ACPI_MADT_POLARITY_MASK
);
else
return
-
EINVAL
;
return
0
;
...
...
arch/ia64/kernel/acpi.c
浏览文件 @
5f3b1a8b
...
...
@@ -55,7 +55,7 @@
#define BAD_MADT_ENTRY(entry, end) ( \
(!entry) || (unsigned long)entry + sizeof(*entry) > end || \
((
acpi_table_entry
_header *)entry)->length < sizeof(*entry))
((
struct acpi_subtable
_header *)entry)->length < sizeof(*entry))
#define PREFIX "ACPI: "
...
...
@@ -94,7 +94,7 @@ const char *acpi_get_sysname(void)
return
"dig"
;
}
xsdt
=
(
struct
acpi_table_xsdt
*
)
__va
(
rsdp
->
xsdt_address
);
xsdt
=
(
struct
acpi_table_xsdt
*
)
__va
(
rsdp
->
xsdt_
physical_
address
);
hdr
=
&
xsdt
->
header
;
if
(
strncmp
(
hdr
->
signature
,
ACPI_SIG_XSDT
,
sizeof
(
ACPI_SIG_XSDT
)
-
1
))
{
printk
(
KERN_ERR
...
...
@@ -169,12 +169,12 @@ struct acpi_table_madt *acpi_madt __initdata;
static
u8
has_8259
;
static
int
__init
acpi_parse_lapic_addr_ovr
(
acpi_table_entry
_header
*
header
,
acpi_parse_lapic_addr_ovr
(
struct
acpi_subtable
_header
*
header
,
const
unsigned
long
end
)
{
struct
acpi_
table_lapic_addr_ovr
*
lapic
;
struct
acpi_
madt_local_apic_override
*
lapic
;
lapic
=
(
struct
acpi_
table_lapic_addr_ovr
*
)
header
;
lapic
=
(
struct
acpi_
madt_local_apic_override
*
)
header
;
if
(
BAD_MADT_ENTRY
(
lapic
,
end
))
return
-
EINVAL
;
...
...
@@ -187,21 +187,20 @@ acpi_parse_lapic_addr_ovr(acpi_table_entry_header * header,
}
static
int
__init
acpi_parse_lsapic
(
acpi_table_entry
_header
*
header
,
const
unsigned
long
end
)
acpi_parse_lsapic
(
struct
acpi_subtable
_header
*
header
,
const
unsigned
long
end
)
{
struct
acpi_
table_l
sapic
*
lsapic
;
struct
acpi_
madt_local_
sapic
*
lsapic
;
lsapic
=
(
struct
acpi_
table_l
sapic
*
)
header
;
lsapic
=
(
struct
acpi_
madt_local_
sapic
*
)
header
;
if
(
BAD_MADT_ENTRY
(
lsapic
,
end
))
return
-
EINVAL
;
/*Skip BAD_MADT_ENTRY check, as lsapic size could vary */
if
(
lsapic
->
flags
.
enabled
)
{
if
(
lsapic
->
lapic_flags
&
ACPI_MADT_ENABLED
)
{
#ifdef CONFIG_SMP
smp_boot_data
.
cpu_phys_id
[
available_cpus
]
=
(
lsapic
->
id
<<
8
)
|
lsapic
->
eid
;
#endif
ia64_acpiid_to_sapicid
[
lsapic
->
acpi
_id
]
=
ia64_acpiid_to_sapicid
[
lsapic
->
processor
_id
]
=
(
lsapic
->
id
<<
8
)
|
lsapic
->
eid
;
++
available_cpus
;
}
...
...
@@ -211,11 +210,11 @@ acpi_parse_lsapic(acpi_table_entry_header * header, const unsigned long end)
}
static
int
__init
acpi_parse_lapic_nmi
(
acpi_table_entry
_header
*
header
,
const
unsigned
long
end
)
acpi_parse_lapic_nmi
(
struct
acpi_subtable
_header
*
header
,
const
unsigned
long
end
)
{
struct
acpi_
table_l
apic_nmi
*
lacpi_nmi
;
struct
acpi_
madt_local_
apic_nmi
*
lacpi_nmi
;
lacpi_nmi
=
(
struct
acpi_
table_l
apic_nmi
*
)
header
;
lacpi_nmi
=
(
struct
acpi_
madt_local_
apic_nmi
*
)
header
;
if
(
BAD_MADT_ENTRY
(
lacpi_nmi
,
end
))
return
-
EINVAL
;
...
...
@@ -225,11 +224,11 @@ acpi_parse_lapic_nmi(acpi_table_entry_header * header, const unsigned long end)
}
static
int
__init
acpi_parse_iosapic
(
acpi_table_entry
_header
*
header
,
const
unsigned
long
end
)
acpi_parse_iosapic
(
struct
acpi_subtable
_header
*
header
,
const
unsigned
long
end
)
{
struct
acpi_
table_io
sapic
*
iosapic
;
struct
acpi_
madt_io_
sapic
*
iosapic
;
iosapic
=
(
struct
acpi_
table_io
sapic
*
)
header
;
iosapic
=
(
struct
acpi_
madt_io_
sapic
*
)
header
;
if
(
BAD_MADT_ENTRY
(
iosapic
,
end
))
return
-
EINVAL
;
...
...
@@ -240,13 +239,13 @@ acpi_parse_iosapic(acpi_table_entry_header * header, const unsigned long end)
static
unsigned
int
__initdata
acpi_madt_rev
;
static
int
__init
acpi_parse_plat_int_src
(
acpi_table_entry
_header
*
header
,
acpi_parse_plat_int_src
(
struct
acpi_subtable
_header
*
header
,
const
unsigned
long
end
)
{
struct
acpi_
table_plat_int_src
*
plintsrc
;
struct
acpi_
madt_interrupt_source
*
plintsrc
;
int
vector
;
plintsrc
=
(
struct
acpi_
table_plat_int_src
*
)
header
;
plintsrc
=
(
struct
acpi_
madt_interrupt_source
*
)
header
;
if
(
BAD_MADT_ENTRY
(
plintsrc
,
end
))
return
-
EINVAL
;
...
...
@@ -257,19 +256,19 @@ acpi_parse_plat_int_src(acpi_table_entry_header * header,
*/
vector
=
iosapic_register_platform_intr
(
plintsrc
->
type
,
plintsrc
->
global_irq
,
plintsrc
->
iosapic_vector
,
plintsrc
->
io
_
sapic_vector
,
plintsrc
->
eid
,
plintsrc
->
id
,
(
plintsrc
->
flags
.
polarity
==
1
)
?
IOSAPIC_POL_HIGH
:
IOSAPIC_POL_LOW
,
(
plintsrc
->
flags
.
trigger
==
1
)
?
IOSAPIC_EDGE
:
IOSAPIC_LEVEL
);
(
(
plintsrc
->
inti_flags
&
ACPI_MADT_POLARITY_MASK
)
==
ACPI_MADT_POLARITY_ACTIVE_HIGH
)
?
IOSAPIC_POL_
HIGH
:
IOSAPIC_POL_
LOW
,
(
(
plintsrc
->
inti_flags
&
ACPI_MADT_TRIGGER_MASK
)
==
ACPI_MADT_TRIGGER_EDGE
)
?
IOSAPIC_
EDGE
:
IOSAPIC_
LEVEL
);
platform_intr_list
[
plintsrc
->
type
]
=
vector
;
if
(
acpi_madt_rev
>
1
)
{
acpi_cpei_override
=
plintsrc
->
plint_flags
.
cpei_override_flag
;
acpi_cpei_override
=
plintsrc
->
flags
&
ACPI_MADT_CPEI_OVERRIDE
;
}
/*
...
...
@@ -324,30 +323,32 @@ unsigned int get_cpei_target_cpu(void)
}
static
int
__init
acpi_parse_int_src_ovr
(
acpi_table_entry
_header
*
header
,
acpi_parse_int_src_ovr
(
struct
acpi_subtable
_header
*
header
,
const
unsigned
long
end
)
{
struct
acpi_
table_int_src_ovr
*
p
;
struct
acpi_
madt_interrupt_override
*
p
;
p
=
(
struct
acpi_
table_int_src_ovr
*
)
header
;
p
=
(
struct
acpi_
madt_interrupt_override
*
)
header
;
if
(
BAD_MADT_ENTRY
(
p
,
end
))
return
-
EINVAL
;
iosapic_override_isa_irq
(
p
->
bus_irq
,
p
->
global_irq
,
(
p
->
flags
.
polarity
==
1
)
?
IOSAPIC_POL_HIGH
:
IOSAPIC_POL_LOW
,
(
p
->
flags
.
trigger
==
1
)
?
IOSAPIC_EDGE
:
IOSAPIC_LEVEL
);
iosapic_override_isa_irq
(
p
->
source_irq
,
p
->
global_irq
,
((
p
->
inti_flags
&
ACPI_MADT_POLARITY_MASK
)
==
ACPI_MADT_POLARITY_ACTIVE_HIGH
)
?
IOSAPIC_POL_HIGH
:
IOSAPIC_POL_LOW
,
((
p
->
inti_flags
&
ACPI_MADT_TRIGGER_MASK
)
==
ACPI_MADT_TRIGGER_EDGE
)
?
IOSAPIC_EDGE
:
IOSAPIC_LEVEL
);
return
0
;
}
static
int
__init
acpi_parse_nmi_src
(
acpi_table_entry
_header
*
header
,
const
unsigned
long
end
)
acpi_parse_nmi_src
(
struct
acpi_subtable
_header
*
header
,
const
unsigned
long
end
)
{
struct
acpi_
table_nmi_src
*
nmi_src
;
struct
acpi_
madt_nmi_source
*
nmi_src
;
nmi_src
=
(
struct
acpi_
table_nmi_src
*
)
header
;
nmi_src
=
(
struct
acpi_
madt_nmi_source
*
)
header
;
if
(
BAD_MADT_ENTRY
(
nmi_src
,
end
))
return
-
EINVAL
;
...
...
@@ -371,12 +372,12 @@ static void __init acpi_madt_oem_check(char *oem_id, char *oem_table_id)
}
}
static
int
__init
acpi_parse_madt
(
unsigned
long
phys_addr
,
unsigned
long
siz
e
)
static
int
__init
acpi_parse_madt
(
struct
acpi_table_header
*
tabl
e
)
{
if
(
!
phys_addr
||
!
siz
e
)
if
(
!
tabl
e
)
return
-
EINVAL
;
acpi_madt
=
(
struct
acpi_table_madt
*
)
__va
(
phys_addr
)
;
acpi_madt
=
(
struct
acpi_table_madt
*
)
table
;
acpi_madt_rev
=
acpi_madt
->
header
.
revision
;
...
...
@@ -384,14 +385,14 @@ static int __init acpi_parse_madt(unsigned long phys_addr, unsigned long size)
#ifdef CONFIG_ITANIUM
has_8259
=
1
;
/* Firmware on old Itanium systems is broken */
#else
has_8259
=
acpi_madt
->
flags
.
pcat_compat
;
has_8259
=
acpi_madt
->
flags
&
ACPI_MADT_PCAT_COMPAT
;
#endif
iosapic_system_init
(
has_8259
);
/* Get base address of IPI Message Block */
if
(
acpi_madt
->
lapic_
address
)
ipi_base_addr
=
ioremap
(
acpi_madt
->
lapic_
address
,
0
);
if
(
acpi_madt
->
address
)
ipi_base_addr
=
ioremap
(
acpi_madt
->
address
,
0
);
printk
(
KERN_INFO
PREFIX
"Local APIC address %p
\n
"
,
ipi_base_addr
);
...
...
@@ -413,23 +414,24 @@ static u32 __devinitdata pxm_flag[PXM_FLAG_LEN];
#define pxm_bit_test(bit) (test_bit(bit,(void *)pxm_flag))
static
struct
acpi_table_slit
__initdata
*
slit_table
;
static
int
get_processor_proximity_domain
(
struct
acpi_
table_processor
_affinity
*
pa
)
static
int
get_processor_proximity_domain
(
struct
acpi_
srat_cpu
_affinity
*
pa
)
{
int
pxm
;
pxm
=
pa
->
proximity_domain
;
pxm
=
pa
->
proximity_domain
_lo
;
if
(
ia64_platform_is
(
"sn2"
))
pxm
+=
pa
->
reserved
[
0
]
<<
8
;
pxm
+=
pa
->
proximity_domain_hi
[
0
]
<<
8
;
return
pxm
;
}
static
int
get_memory_proximity_domain
(
struct
acpi_
table_memory
_affinity
*
ma
)
static
int
get_memory_proximity_domain
(
struct
acpi_
srat_mem
_affinity
*
ma
)
{
int
pxm
;
pxm
=
ma
->
proximity_domain
;
if
(
ia64_platform_is
(
"sn2"
))
pxm
+=
ma
->
reserved1
[
0
]
<<
8
;
pxm
+=
ma
->
reserved
<<
8
;
return
pxm
;
}
...
...
@@ -442,7 +444,7 @@ void __init acpi_numa_slit_init(struct acpi_table_slit *slit)
u32
len
;
len
=
sizeof
(
struct
acpi_table_header
)
+
8
+
slit
->
localit
ies
*
slit
->
localities
;
+
slit
->
localit
y_count
*
slit
->
locality_count
;
if
(
slit
->
header
.
length
!=
len
)
{
printk
(
KERN_ERR
"ACPI 2.0 SLIT: size mismatch: %d expected, %d actual
\n
"
,
...
...
@@ -454,11 +456,11 @@ void __init acpi_numa_slit_init(struct acpi_table_slit *slit)
}
void
__init
acpi_numa_processor_affinity_init
(
struct
acpi_
table_processor
_affinity
*
pa
)
acpi_numa_processor_affinity_init
(
struct
acpi_
srat_cpu
_affinity
*
pa
)
{
int
pxm
;
if
(
!
pa
->
flags
.
enabled
)
if
(
!
(
pa
->
flags
&
ACPI_SRAT_CPU_ENABLED
)
)
return
;
pxm
=
get_processor_proximity_domain
(
pa
);
...
...
@@ -467,14 +469,14 @@ acpi_numa_processor_affinity_init(struct acpi_table_processor_affinity *pa)
pxm_bit_set
(
pxm
);
node_cpuid
[
srat_num_cpus
].
phys_id
=
(
pa
->
apic_id
<<
8
)
|
(
pa
->
lsapic_eid
);
(
pa
->
apic_id
<<
8
)
|
(
pa
->
l
ocal_
sapic_eid
);
/* nid should be overridden as logical node id later */
node_cpuid
[
srat_num_cpus
].
nid
=
pxm
;
srat_num_cpus
++
;
}
void
__init
acpi_numa_memory_affinity_init
(
struct
acpi_
table_memory
_affinity
*
ma
)
acpi_numa_memory_affinity_init
(
struct
acpi_
srat_mem
_affinity
*
ma
)
{
unsigned
long
paddr
,
size
;
int
pxm
;
...
...
@@ -483,13 +485,11 @@ acpi_numa_memory_affinity_init(struct acpi_table_memory_affinity *ma)
pxm
=
get_memory_proximity_domain
(
ma
);
/* fill node memory chunk structure */
paddr
=
ma
->
base_addr_hi
;
paddr
=
(
paddr
<<
32
)
|
ma
->
base_addr_lo
;
size
=
ma
->
length_hi
;
size
=
(
size
<<
32
)
|
ma
->
length_lo
;
paddr
=
ma
->
base_address
;
size
=
ma
->
length
;
/* Ignore disabled entries */
if
(
!
ma
->
flags
.
enabled
)
if
(
!
(
ma
->
flags
&
ACPI_SRAT_MEM_ENABLED
)
)
return
;
/* record this node in proximity bitmap */
...
...
@@ -560,16 +560,16 @@ void __init acpi_numa_arch_fixup(void)
if
(
!
slit_table
)
return
;
memset
(
numa_slit
,
-
1
,
sizeof
(
numa_slit
));
for
(
i
=
0
;
i
<
slit_table
->
localit
ies
;
i
++
)
{
for
(
i
=
0
;
i
<
slit_table
->
localit
y_count
;
i
++
)
{
if
(
!
pxm_bit_test
(
i
))
continue
;
node_from
=
pxm_to_node
(
i
);
for
(
j
=
0
;
j
<
slit_table
->
localit
ies
;
j
++
)
{
for
(
j
=
0
;
j
<
slit_table
->
localit
y_count
;
j
++
)
{
if
(
!
pxm_bit_test
(
j
))
continue
;
node_to
=
pxm_to_node
(
j
);
node_distance
(
node_from
,
node_to
)
=
slit_table
->
entry
[
i
*
slit_table
->
localit
ies
+
j
];
slit_table
->
entry
[
i
*
slit_table
->
localit
y_count
+
j
];
}
}
...
...
@@ -614,15 +614,15 @@ void acpi_unregister_gsi(u32 gsi)
EXPORT_SYMBOL
(
acpi_unregister_gsi
);
static
int
__init
acpi_parse_fadt
(
unsigned
long
phys_addr
,
unsigned
long
siz
e
)
static
int
__init
acpi_parse_fadt
(
struct
acpi_table_header
*
tabl
e
)
{
struct
acpi_table_header
*
fadt_header
;
struct
acpi_table_fadt
*
fadt
;
if
(
!
phys_addr
||
!
siz
e
)
if
(
!
tabl
e
)
return
-
EINVAL
;
fadt_header
=
(
struct
acpi_table_header
*
)
__va
(
phys_addr
)
;
fadt_header
=
(
struct
acpi_table_header
*
)
table
;
if
(
fadt_header
->
revision
!=
3
)
return
-
ENODEV
;
/* Only deal with ACPI 2.0 FADT */
...
...
@@ -655,7 +655,7 @@ int __init acpi_boot_init(void)
* information -- the successor to MPS tables.
*/
if
(
acpi_table_parse
(
ACPI_
APIC
,
acpi_parse_madt
)
<
1
)
{
if
(
acpi_table_parse
(
ACPI_
SIG_MADT
,
acpi_parse_madt
)
<
1
)
{
printk
(
KERN_ERR
PREFIX
"Can't find MADT
\n
"
);
goto
skip_madt
;
}
...
...
@@ -663,40 +663,40 @@ int __init acpi_boot_init(void)
/* Local APIC */
if
(
acpi_table_parse_madt
(
ACPI_MADT_
LAPIC_ADDR_OVR
,
acpi_parse_lapic_addr_ovr
,
0
)
<
0
)
(
ACPI_MADT_
TYPE_LOCAL_APIC_OVERRIDE
,
acpi_parse_lapic_addr_ovr
,
0
)
<
0
)
printk
(
KERN_ERR
PREFIX
"Error parsing LAPIC address override entry
\n
"
);
if
(
acpi_table_parse_madt
(
ACPI_MADT_
L
SAPIC
,
acpi_parse_lsapic
,
NR_CPUS
)
if
(
acpi_table_parse_madt
(
ACPI_MADT_
TYPE_LOCAL_
SAPIC
,
acpi_parse_lsapic
,
NR_CPUS
)
<
1
)
printk
(
KERN_ERR
PREFIX
"Error parsing MADT - no LAPIC entries
\n
"
);
if
(
acpi_table_parse_madt
(
ACPI_MADT_
L
APIC_NMI
,
acpi_parse_lapic_nmi
,
0
)
if
(
acpi_table_parse_madt
(
ACPI_MADT_
TYPE_LOCAL_
APIC_NMI
,
acpi_parse_lapic_nmi
,
0
)
<
0
)
printk
(
KERN_ERR
PREFIX
"Error parsing LAPIC NMI entry
\n
"
);
/* I/O APIC */
if
(
acpi_table_parse_madt
(
ACPI_MADT_
IO
SAPIC
,
acpi_parse_iosapic
,
NR_IOSAPICS
)
<
1
)
(
ACPI_MADT_
TYPE_IO_
SAPIC
,
acpi_parse_iosapic
,
NR_IOSAPICS
)
<
1
)
printk
(
KERN_ERR
PREFIX
"Error parsing MADT - no IOSAPIC entries
\n
"
);
/* System-Level Interrupt Routing */
if
(
acpi_table_parse_madt
(
ACPI_MADT_
PLAT_INT_SRC
,
acpi_parse_plat_int_src
,
(
ACPI_MADT_
TYPE_INTERRUPT_SOURCE
,
acpi_parse_plat_int_src
,
ACPI_MAX_PLATFORM_INTERRUPTS
)
<
0
)
printk
(
KERN_ERR
PREFIX
"Error parsing platform interrupt source entry
\n
"
);
if
(
acpi_table_parse_madt
(
ACPI_MADT_
INT_SRC_OVR
,
acpi_parse_int_src_ovr
,
0
)
<
0
)
(
ACPI_MADT_
TYPE_INTERRUPT_OVERRIDE
,
acpi_parse_int_src_ovr
,
0
)
<
0
)
printk
(
KERN_ERR
PREFIX
"Error parsing interrupt source overrides entry
\n
"
);
if
(
acpi_table_parse_madt
(
ACPI_MADT_
NMI_SRC
,
acpi_parse_nmi_src
,
0
)
<
0
)
if
(
acpi_table_parse_madt
(
ACPI_MADT_
TYPE_NMI_SOURCE
,
acpi_parse_nmi_src
,
0
)
<
0
)
printk
(
KERN_ERR
PREFIX
"Error parsing NMI SRC entry
\n
"
);
skip_madt:
...
...
@@ -706,7 +706,7 @@ int __init acpi_boot_init(void)
* gets interrupts such as power and sleep buttons. If it's not
* on a Legacy interrupt, it needs to be setup.
*/
if
(
acpi_table_parse
(
ACPI_FADT
,
acpi_parse_fadt
)
<
1
)
if
(
acpi_table_parse
(
ACPI_
SIG_
FADT
,
acpi_parse_fadt
)
<
1
)
printk
(
KERN_ERR
PREFIX
"Can't find FADT
\n
"
);
#ifdef CONFIG_SMP
...
...
@@ -839,7 +839,7 @@ int acpi_map_lsapic(acpi_handle handle, int *pcpu)
{
struct
acpi_buffer
buffer
=
{
ACPI_ALLOCATE_BUFFER
,
NULL
};
union
acpi_object
*
obj
;
struct
acpi_
table_l
sapic
*
lsapic
;
struct
acpi_
madt_local_
sapic
*
lsapic
;
cpumask_t
tmp_map
;
long
physid
;
int
cpu
;
...
...
@@ -851,16 +851,16 @@ int acpi_map_lsapic(acpi_handle handle, int *pcpu)
return
-
EINVAL
;
obj
=
buffer
.
pointer
;
if
(
obj
->
type
!=
ACPI_TYPE_BUFFER
||
obj
->
buffer
.
length
<
sizeof
(
*
lsapic
))
{
if
(
obj
->
type
!=
ACPI_TYPE_BUFFER
)
{
kfree
(
buffer
.
pointer
);
return
-
EINVAL
;
}
lsapic
=
(
struct
acpi_
table_l
sapic
*
)
obj
->
buffer
.
pointer
;
lsapic
=
(
struct
acpi_
madt_local_
sapic
*
)
obj
->
buffer
.
pointer
;
if
((
lsapic
->
header
.
type
!=
ACPI_MADT_
L
SAPIC
)
||
(
!
lsapic
->
flags
.
enabled
))
{
if
((
lsapic
->
header
.
type
!=
ACPI_MADT_
TYPE_LOCAL_
SAPIC
)
||
(
!
lsapic
->
lapic_flags
&
ACPI_MADT_ENABLED
))
{
kfree
(
buffer
.
pointer
);
return
-
EINVAL
;
}
...
...
@@ -880,7 +880,7 @@ int acpi_map_lsapic(acpi_handle handle, int *pcpu)
cpu_set
(
cpu
,
cpu_present_map
);
ia64_cpu_to_sapicid
[
cpu
]
=
physid
;
ia64_acpiid_to_sapicid
[
lsapic
->
acpi
_id
]
=
ia64_cpu_to_sapicid
[
cpu
];
ia64_acpiid_to_sapicid
[
lsapic
->
processor
_id
]
=
ia64_cpu_to_sapicid
[
cpu
];
*
pcpu
=
cpu
;
return
(
0
);
...
...
@@ -917,7 +917,7 @@ acpi_map_iosapic(acpi_handle handle, u32 depth, void *context, void **ret)
{
struct
acpi_buffer
buffer
=
{
ACPI_ALLOCATE_BUFFER
,
NULL
};
union
acpi_object
*
obj
;
struct
acpi_
table_io
sapic
*
iosapic
;
struct
acpi_
madt_io_
sapic
*
iosapic
;
unsigned
int
gsi_base
;
int
pxm
,
node
;
...
...
@@ -935,9 +935,9 @@ acpi_map_iosapic(acpi_handle handle, u32 depth, void *context, void **ret)
return
AE_OK
;
}
iosapic
=
(
struct
acpi_
table_io
sapic
*
)
obj
->
buffer
.
pointer
;
iosapic
=
(
struct
acpi_
madt_io_
sapic
*
)
obj
->
buffer
.
pointer
;
if
(
iosapic
->
header
.
type
!=
ACPI_MADT_
IO
SAPIC
)
{
if
(
iosapic
->
header
.
type
!=
ACPI_MADT_
TYPE_IO_
SAPIC
)
{
kfree
(
buffer
.
pointer
);
return
AE_OK
;
}
...
...
drivers/acpi/bus.c
浏览文件 @
5f3b1a8b
...
...
@@ -620,15 +620,16 @@ void __init acpi_early_init(void)
#ifdef CONFIG_X86
if
(
!
acpi_ioapic
)
{
extern
acpi_interrupt_flags
acpi_sci_flags
;
extern
u8
acpi_sci_flags
;
/* compatible (0) means level (3) */
if
(
acpi_sci_flags
.
trigger
==
0
)
acpi_sci_flags
.
trigger
=
3
;
if
(
!
(
acpi_sci_flags
&
ACPI_MADT_TRIGGER_MASK
))
{
acpi_sci_flags
&=
~
ACPI_MADT_TRIGGER_MASK
;
acpi_sci_flags
|=
ACPI_MADT_TRIGGER_LEVEL
;
}
/* Set PIC-mode SCI trigger type */
acpi_pic_sci_set_trigger
(
acpi_gbl_FADT
.
sci_interrupt
,
acpi_sci_flags
.
trigger
);
(
acpi_sci_flags
&
ACPI_MADT_TRIGGER_MASK
)
>>
2
);
}
else
{
extern
int
acpi_sci_override_gsi
;
/*
...
...
drivers/acpi/tables.c
浏览文件 @
5f3b1a8b
...
...
@@ -43,90 +43,92 @@ static char *mps_inti_flags_trigger[] = { "dfl", "edge", "res", "level" };
static
struct
acpi_table_desc
initial_tables
[
ACPI_MAX_TABLES
]
__initdata
;
void
acpi_table_print_madt_entry
(
acpi_table_entry
_header
*
header
)
void
acpi_table_print_madt_entry
(
struct
acpi_subtable
_header
*
header
)
{
if
(
!
header
)
return
;
switch
(
header
->
type
)
{
case
ACPI_MADT_
L
APIC
:
case
ACPI_MADT_
TYPE_LOCAL_
APIC
:
{
struct
acpi_
table_l
apic
*
p
=
(
struct
acpi_
table_l
apic
*
)
header
;
struct
acpi_
madt_local_
apic
*
p
=
(
struct
acpi_
madt_local_
apic
*
)
header
;
printk
(
KERN_INFO
PREFIX
"LAPIC (acpi_id[0x%02x] lapic_id[0x%02x] %s)
\n
"
,
p
->
acpi
_id
,
p
->
id
,
p
->
flags
.
enabled
?
"enabled"
:
"disabled"
);
p
->
processor
_id
,
p
->
id
,
(
p
->
lapic_flags
&
ACPI_MADT_ENABLED
)
?
"enabled"
:
"disabled"
);
}
break
;
case
ACPI_MADT_
IO
APIC
:
case
ACPI_MADT_
TYPE_IO_
APIC
:
{
struct
acpi_
table_io
apic
*
p
=
(
struct
acpi_
table_io
apic
*
)
header
;
struct
acpi_
madt_io_
apic
*
p
=
(
struct
acpi_
madt_io_
apic
*
)
header
;
printk
(
KERN_INFO
PREFIX
"IOAPIC (id[0x%02x] address[0x%08x] gsi_base[%d])
\n
"
,
p
->
id
,
p
->
address
,
p
->
global_irq_base
);
}
break
;
case
ACPI_MADT_
INT_SRC_OVR
:
case
ACPI_MADT_
TYPE_INTERRUPT_OVERRIDE
:
{
struct
acpi_
table_int_src_ovr
*
p
=
(
struct
acpi_
table_int_src_ovr
*
)
header
;
struct
acpi_
madt_interrupt_override
*
p
=
(
struct
acpi_
madt_interrupt_override
*
)
header
;
printk
(
KERN_INFO
PREFIX
"INT_SRC_OVR (bus %d bus_irq %d global_irq %d %s %s)
\n
"
,
p
->
bus
,
p
->
bus_irq
,
p
->
global_irq
,
mps_inti_flags_polarity
[
p
->
flags
.
polarity
],
mps_inti_flags_trigger
[
p
->
flags
.
trigger
]);
if
(
p
->
flags
.
reserved
)
p
->
bus
,
p
->
source_irq
,
p
->
global_irq
,
mps_inti_flags_polarity
[
p
->
inti_flags
&
ACPI_MADT_POLARITY_MASK
],
mps_inti_flags_trigger
[(
p
->
inti_flags
&
ACPI_MADT_TRIGGER_MASK
)
>>
2
]);
if
(
p
->
inti_flags
&
~
(
ACPI_MADT_POLARITY_MASK
|
ACPI_MADT_TRIGGER_MASK
))
printk
(
KERN_INFO
PREFIX
"INT_SRC_OVR unexpected reserved flags: 0x%x
\n
"
,
p
->
flags
.
reserved
);
p
->
inti_flags
&
~
(
ACPI_MADT_POLARITY_MASK
|
ACPI_MADT_TRIGGER_MASK
));
}
break
;
case
ACPI_MADT_
NMI_SRC
:
case
ACPI_MADT_
TYPE_NMI_SOURCE
:
{
struct
acpi_
table_nmi_src
*
p
=
(
struct
acpi_
table_nmi_src
*
)
header
;
struct
acpi_
madt_nmi_source
*
p
=
(
struct
acpi_
madt_nmi_source
*
)
header
;
printk
(
KERN_INFO
PREFIX
"NMI_SRC (%s %s global_irq %d)
\n
"
,
mps_inti_flags_polarity
[
p
->
flags
.
polarity
],
mps_inti_flags_trigger
[
p
->
flags
.
trigger
],
mps_inti_flags_polarity
[
p
->
inti_flags
&
ACPI_MADT_POLARITY_MASK
],
mps_inti_flags_trigger
[
(
p
->
inti_flags
&
ACPI_MADT_TRIGGER_MASK
)
>>
2
],
p
->
global_irq
);
}
break
;
case
ACPI_MADT_
L
APIC_NMI
:
case
ACPI_MADT_
TYPE_LOCAL_
APIC_NMI
:
{
struct
acpi_
table_l
apic_nmi
*
p
=
(
struct
acpi_
table_l
apic_nmi
*
)
header
;
struct
acpi_
madt_local_
apic_nmi
*
p
=
(
struct
acpi_
madt_local_
apic_nmi
*
)
header
;
printk
(
KERN_INFO
PREFIX
"LAPIC_NMI (acpi_id[0x%02x] %s %s lint[0x%x])
\n
"
,
p
->
acpi
_id
,
mps_inti_flags_polarity
[
p
->
flags
.
polarity
],
mps_inti_flags_trigger
[
p
->
flags
.
trigger
],
p
->
processor
_id
,
mps_inti_flags_polarity
[
p
->
inti_flags
&
ACPI_MADT_POLARITY_MASK
],
mps_inti_flags_trigger
[
(
p
->
inti_flags
&
ACPI_MADT_TRIGGER_MASK
)
>>
2
],
p
->
lint
);
}
break
;
case
ACPI_MADT_
LAPIC_ADDR_OVR
:
case
ACPI_MADT_
TYPE_LOCAL_APIC_OVERRIDE
:
{
struct
acpi_
table_lapic_addr_ovr
*
p
=
(
struct
acpi_
table_lapic_addr_ovr
*
)
header
;
struct
acpi_
madt_local_apic_override
*
p
=
(
struct
acpi_
madt_local_apic_override
*
)
header
;
printk
(
KERN_INFO
PREFIX
"LAPIC_ADDR_OVR (address[%p])
\n
"
,
(
void
*
)(
unsigned
long
)
p
->
address
);
}
break
;
case
ACPI_MADT_
IO
SAPIC
:
case
ACPI_MADT_
TYPE_IO_
SAPIC
:
{
struct
acpi_
table_io
sapic
*
p
=
(
struct
acpi_
table_io
sapic
*
)
header
;
struct
acpi_
madt_io_
sapic
*
p
=
(
struct
acpi_
madt_io_
sapic
*
)
header
;
printk
(
KERN_INFO
PREFIX
"IOSAPIC (id[0x%x] address[%p] gsi_base[%d])
\n
"
,
p
->
id
,
(
void
*
)(
unsigned
long
)
p
->
address
,
...
...
@@ -134,26 +136,26 @@ void acpi_table_print_madt_entry(acpi_table_entry_header * header)
}
break
;
case
ACPI_MADT_
L
SAPIC
:
case
ACPI_MADT_
TYPE_LOCAL_
SAPIC
:
{
struct
acpi_
table_l
sapic
*
p
=
(
struct
acpi_
table_l
sapic
*
)
header
;
struct
acpi_
madt_local_
sapic
*
p
=
(
struct
acpi_
madt_local_
sapic
*
)
header
;
printk
(
KERN_INFO
PREFIX
"LSAPIC (acpi_id[0x%02x] lsapic_id[0x%02x] lsapic_eid[0x%02x] %s)
\n
"
,
p
->
acpi
_id
,
p
->
id
,
p
->
eid
,
p
->
flags
.
enabled
?
"enabled"
:
"disabled"
);
p
->
processor
_id
,
p
->
id
,
p
->
eid
,
(
p
->
lapic_flags
&
ACPI_MADT_ENABLED
)
?
"enabled"
:
"disabled"
);
}
break
;
case
ACPI_MADT_
PLAT_INT_SRC
:
case
ACPI_MADT_
TYPE_INTERRUPT_SOURCE
:
{
struct
acpi_
table_plat_int_src
*
p
=
(
struct
acpi_
table_plat_int_src
*
)
header
;
struct
acpi_
madt_interrupt_source
*
p
=
(
struct
acpi_
madt_interrupt_source
*
)
header
;
printk
(
KERN_INFO
PREFIX
"PLAT_INT_SRC (%s %s type[0x%x] id[0x%04x] eid[0x%x] iosapic_vector[0x%x] global_irq[0x%x]
\n
"
,
mps_inti_flags_polarity
[
p
->
flags
.
polarity
],
mps_inti_flags_trigger
[
p
->
flags
.
trigger
],
p
->
type
,
p
->
id
,
p
->
eid
,
p
->
iosapic_vector
,
mps_inti_flags_polarity
[
p
->
inti_flags
&
ACPI_MADT_POLARITY_MASK
],
mps_inti_flags_trigger
[
(
p
->
inti_flags
&
ACPI_MADT_TRIGGER_MASK
)
>>
2
],
p
->
type
,
p
->
id
,
p
->
eid
,
p
->
io
_
sapic_vector
,
p
->
global_irq
);
}
break
;
...
...
@@ -175,7 +177,7 @@ acpi_table_parse_madt_family(char *id,
unsigned
int
max_entries
)
{
struct
acpi_table_header
*
madt
=
NULL
;
acpi_table_entry
_header
*
entry
;
struct
acpi_subtable
_header
*
entry
;
unsigned
int
count
=
0
;
unsigned
long
madt_end
;
...
...
@@ -183,7 +185,6 @@ acpi_table_parse_madt_family(char *id,
return
-
EINVAL
;
/* Locate the MADT (if exists). There should only be one. */
acpi_get_table
(
id
,
0
,
&
madt
);
if
(
!
madt
)
{
...
...
@@ -195,17 +196,17 @@ acpi_table_parse_madt_family(char *id,
/* Parse all entries looking for a match. */
entry
=
(
acpi_table_entry
_header
*
)
entry
=
(
struct
acpi_subtable
_header
*
)
((
unsigned
long
)
madt
+
madt_size
);
while
(((
unsigned
long
)
entry
)
+
sizeof
(
acpi_table_entry
_header
)
<
while
(((
unsigned
long
)
entry
)
+
sizeof
(
struct
acpi_subtable
_header
)
<
madt_end
)
{
if
(
entry
->
type
==
entry_id
&&
(
!
max_entries
||
count
++
<
max_entries
))
if
(
handler
(
entry
,
madt_end
))
return
-
EINVAL
;
entry
=
(
acpi_table_entry
_header
*
)
entry
=
(
struct
acpi_subtable
_header
*
)
((
unsigned
long
)
entry
+
entry
->
length
);
}
if
(
max_entries
&&
count
>
max_entries
)
{
...
...
@@ -217,10 +218,10 @@ acpi_table_parse_madt_family(char *id,
}
int
__init
acpi_table_parse_madt
(
enum
acpi_madt_
entry_id
id
,
acpi_table_parse_madt
(
enum
acpi_madt_
type
id
,
acpi_madt_entry_handler
handler
,
unsigned
int
max_entries
)
{
return
acpi_table_parse_madt_family
(
"APIC"
,
return
acpi_table_parse_madt_family
(
ACPI_SIG_MADT
,
sizeof
(
struct
acpi_table_madt
),
id
,
handler
,
max_entries
);
}
...
...
@@ -228,7 +229,6 @@ acpi_table_parse_madt(enum acpi_madt_entry_id id,
int
__init
acpi_table_parse
(
char
*
id
,
acpi_table_handler
handler
)
{
struct
acpi_table_header
*
table
=
NULL
;
if
(
!
handler
)
return
-
EINVAL
;
...
...
@@ -245,10 +245,11 @@ int __init acpi_table_parse(char *id, acpi_table_handler handler)
*
* find RSDP, find and checksum SDT/XSDT.
* checksum all tables, print SDT/XSDT
*
*
* result: sdt_entry[] is initialized
*/
int
__init
acpi_table_init
(
void
)
{
acpi_initialize_tables
(
initial_tables
,
ACPI_MAX_TABLES
,
0
);
...
...
include/linux/acpi.h
浏览文件 @
5f3b1a8b
...
...
@@ -58,106 +58,6 @@ typedef struct {
u8
length
;
}
__attribute__
((
packed
))
acpi_table_entry_header
;
/* Multiple APIC Description Table (MADT) */
enum
acpi_madt_entry_id
{
ACPI_MADT_LAPIC
=
0
,
ACPI_MADT_IOAPIC
,
ACPI_MADT_INT_SRC_OVR
,
ACPI_MADT_NMI_SRC
,
ACPI_MADT_LAPIC_NMI
,
ACPI_MADT_LAPIC_ADDR_OVR
,
ACPI_MADT_IOSAPIC
,
ACPI_MADT_LSAPIC
,
ACPI_MADT_PLAT_INT_SRC
,
ACPI_MADT_ENTRY_COUNT
};
typedef
struct
{
u16
polarity
:
2
;
u16
trigger
:
2
;
u16
reserved
:
12
;
}
__attribute__
((
packed
))
acpi_interrupt_flags
;
struct
acpi_table_lapic
{
acpi_table_entry_header
header
;
u8
acpi_id
;
u8
id
;
struct
{
u32
enabled
:
1
;
u32
reserved
:
31
;
}
flags
;
}
__attribute__
((
packed
));
struct
acpi_table_ioapic
{
acpi_table_entry_header
header
;
u8
id
;
u8
reserved
;
u32
address
;
u32
global_irq_base
;
}
__attribute__
((
packed
));
struct
acpi_table_int_src_ovr
{
acpi_table_entry_header
header
;
u8
bus
;
u8
bus_irq
;
u32
global_irq
;
acpi_interrupt_flags
flags
;
}
__attribute__
((
packed
));
struct
acpi_table_nmi_src
{
acpi_table_entry_header
header
;
acpi_interrupt_flags
flags
;
u32
global_irq
;
}
__attribute__
((
packed
));
struct
acpi_table_lapic_nmi
{
acpi_table_entry_header
header
;
u8
acpi_id
;
acpi_interrupt_flags
flags
;
u8
lint
;
}
__attribute__
((
packed
));
struct
acpi_table_lapic_addr_ovr
{
acpi_table_entry_header
header
;
u8
reserved
[
2
];
u64
address
;
}
__attribute__
((
packed
));
struct
acpi_table_iosapic
{
acpi_table_entry_header
header
;
u8
id
;
u8
reserved
;
u32
global_irq_base
;
u64
address
;
}
__attribute__
((
packed
));
struct
acpi_table_lsapic
{
acpi_table_entry_header
header
;
u8
acpi_id
;
u8
id
;
u8
eid
;
u8
reserved
[
3
];
struct
{
u32
enabled
:
1
;
u32
reserved
:
31
;
}
flags
;
}
__attribute__
((
packed
));
struct
acpi_table_plat_int_src
{
acpi_table_entry_header
header
;
acpi_interrupt_flags
flags
;
u8
type
;
/* See acpi_interrupt_type */
u8
id
;
u8
eid
;
u8
iosapic_vector
;
u32
global_irq
;
struct
{
u32
cpei_override_flag
:
1
;
u32
reserved
:
31
;
}
plint_flags
;
}
__attribute__
((
packed
));
enum
acpi_interrupt_id
{
ACPI_INTERRUPT_PMI
=
1
,
ACPI_INTERRUPT_INIT
,
...
...
@@ -285,7 +185,7 @@ typedef int (*acpi_table_handler) (struct acpi_table_header *header);
extern
acpi_table_handler
acpi_table_ops
[
ACPI_TABLE_COUNT
];
typedef
int
(
*
acpi_madt_entry_handler
)
(
acpi_table_entry
_header
*
header
,
const
unsigned
long
end
);
typedef
int
(
*
acpi_madt_entry_handler
)
(
struct
acpi_subtable
_header
*
header
,
const
unsigned
long
end
);
char
*
__acpi_map_table
(
unsigned
long
phys_addr
,
unsigned
long
size
);
unsigned
long
acpi_find_rsdp
(
void
);
...
...
@@ -295,11 +195,11 @@ int acpi_numa_init (void);
int
acpi_table_init
(
void
);
int
acpi_table_parse
(
char
*
id
,
acpi_table_handler
handler
);
int
acpi_table_parse_madt
(
enum
acpi_madt_
entry_id
id
,
acpi_madt_entry_handler
handler
,
unsigned
int
max_entries
);
int
acpi_table_parse_madt
(
enum
acpi_madt_
type
id
,
acpi_madt_entry_handler
handler
,
unsigned
int
max_entries
);
int
acpi_table_parse_srat
(
enum
acpi_srat_entry_id
id
,
acpi_madt_entry_handler
handler
,
unsigned
int
max_entries
);
int
acpi_parse_mcfg
(
struct
acpi_table_header
*
header
);
void
acpi_table_print
(
struct
acpi_table_header
*
header
,
unsigned
long
phys_addr
);
void
acpi_table_print_madt_entry
(
acpi_table_entry
_header
*
madt
);
void
acpi_table_print_madt_entry
(
struct
acpi_subtable
_header
*
madt
);
void
acpi_table_print_srat_entry
(
acpi_table_entry_header
*
srat
);
/* the following four functions are architecture-dependent */
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录