Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
xenomai
ipipe
Commits
ad71860a
Commit
ad71860a
authored
Feb 02, 2007
by
Alexey Starikovskiy
Committed by
Len Brown
Feb 02, 2007
Browse files
ACPICA: minimal patch to integrate new tables into Linux
Signed-off-by:
Len Brown
<
len.brown@intel.com
>
parent
a4bbb810
Changes
31
Hide whitespace changes
Inline
Side-by-side
arch/i386/kernel/acpi/boot.c
View file @
ad71860a
...
...
@@ -716,33 +716,26 @@ static int __init acpi_parse_fadt(unsigned long phys, unsigned long size)
printk
(
KERN_WARNING
PREFIX
"Unable to map FADT
\n
"
);
return
0
;
}
/* initialize sci_int early for INT_SRC_OVR MADT parsing */
acpi_fadt
.
sci_int
=
fadt
->
sci_int
;
/* initialize rev and apic_phys_dest_mode for x86_64 genapic */
acpi_fadt
.
revision
=
fadt
->
revision
;
acpi_fadt
.
force_apic_physical_destination_mode
=
fadt
->
force_apic_physical_destination_mode
;
#ifdef CONFIG_X86_PM_TIMER
/* detect the location of the ACPI PM Timer */
if
(
fadt
->
revision
>=
FADT2_REVISION_ID
)
{
if
(
fadt
->
header
.
revision
>=
FADT2_REVISION_ID
)
{
/* FADT rev. 2 */
if
(
fadt
->
xpm_t
m
r_blk
.
address_
space_id
!=
if
(
fadt
->
xpm_t
ime
r_bl
oc
k
.
space_id
!=
ACPI_ADR_SPACE_SYSTEM_IO
)
return
0
;
pmtmr_ioport
=
fadt
->
xpm_t
m
r_blk
.
address
;
pmtmr_ioport
=
fadt
->
xpm_t
ime
r_bl
oc
k
.
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
->
V1_
pm_t
m
r_blk
;
pmtmr_ioport
=
fadt
->
pm_t
ime
r_bl
oc
k
;
}
else
{
/* FADT rev. 1 */
pmtmr_ioport
=
fadt
->
V1_
pm_t
m
r_blk
;
pmtmr_ioport
=
fadt
->
pm_t
ime
r_bl
oc
k
;
}
if
(
pmtmr_ioport
)
printk
(
KERN_INFO
PREFIX
"PM-Timer IO Port: %#x
\n
"
,
...
...
arch/ia64/kernel/acpi.c
View file @
ad71860a
...
...
@@ -76,7 +76,7 @@ const char *acpi_get_sysname(void)
{
#ifdef CONFIG_IA64_GENERIC
unsigned
long
rsdp_phys
;
struct
acpi
20
_table_rsdp
*
rsdp
;
struct
acpi_table_rsdp
*
rsdp
;
struct
acpi_table_xsdt
*
xsdt
;
struct
acpi_table_header
*
hdr
;
...
...
@@ -87,8 +87,8 @@ const char *acpi_get_sysname(void)
return
"dig"
;
}
rsdp
=
(
struct
acpi
20
_table_rsdp
*
)
__va
(
rsdp_phys
);
if
(
strncmp
(
rsdp
->
signature
,
RSDP_SIG
,
sizeof
(
RSDP_SIG
)
-
1
))
{
rsdp
=
(
struct
acpi_table_rsdp
*
)
__va
(
rsdp_phys
);
if
(
strncmp
(
rsdp
->
signature
,
ACPI_SIG_RSDP
,
sizeof
(
ACPI_SIG_RSDP
)
-
1
))
{
printk
(
KERN_ERR
"ACPI 2.0 RSDP signature incorrect, default to
\"
dig
\"\n
"
);
return
"dig"
;
...
...
@@ -96,7 +96,7 @@ const char *acpi_get_sysname(void)
xsdt
=
(
struct
acpi_table_xsdt
*
)
__va
(
rsdp
->
xsdt_address
);
hdr
=
&
xsdt
->
header
;
if
(
strncmp
(
hdr
->
signature
,
XSDT_SIG
,
sizeof
(
XSDT_SIG
)
-
1
))
{
if
(
strncmp
(
hdr
->
signature
,
ACPI_SIG_XSDT
,
sizeof
(
ACPI_SIG_XSDT
)
-
1
))
{
printk
(
KERN_ERR
"ACPI 2.0 XSDT signature incorrect, default to
\"
dig
\"\n
"
);
return
"dig"
;
...
...
arch/ia64/sn/kernel/io_common.c
View file @
ad71860a
...
...
@@ -25,7 +25,6 @@
#include "xtalk/xwidgetdev.h"
#include <linux/acpi.h>
#include <asm/sn/sn2/sn_hwperf.h>
#include <asm/sn/acpi.h>
extern
void
sn_init_cpei_timer
(
void
);
extern
void
register_sn_procfs
(
void
);
...
...
@@ -37,7 +36,6 @@ extern void sn_legacy_pci_window_fixup(struct pci_controller *, u64, u64);
extern
void
sn_io_acpi_init
(
void
);
extern
void
sn_io_init
(
void
);
static
struct
list_head
sn_sysdata_list
;
/* sysdata list struct */
...
...
@@ -50,6 +48,15 @@ int sn_ioif_inited; /* SN I/O infrastructure initialized? */
struct
sn_pcibus_provider
*
sn_pci_provider
[
PCIIO_ASIC_MAX_TYPES
];
/* indexed by asic type */
int
sn_acpi_base_support
()
{
struct
acpi_table_header
*
header
;
(
void
)
acpi_get_table_by_index
(
ACPI_TABLE_INDEX_DSDT
,
&
header
);
if
(
header
&&
header
->
oem_revision
>=
0x20101
)
return
1
;
return
0
;
}
/*
* Hooks and struct for unsupported pci providers
*/
...
...
@@ -286,7 +293,7 @@ void sn_pci_fixup_slot(struct pci_dev *dev)
list_add_tail
(
&
pcidev_info
->
pdi_list
,
&
(
SN_PLATFORM_DATA
(
dev
->
bus
)
->
pcidev_info
));
if
(
SN_ACPI_BASE_SUPPORT
())
if
(
sn_acpi_base_support
())
sn_acpi_slot_fixup
(
dev
,
pcidev_info
);
else
sn_more_slot_fixup
(
dev
,
pcidev_info
);
...
...
@@ -498,7 +505,7 @@ void __devinit
sn_pci_fixup_bus
(
struct
pci_bus
*
bus
)
{
if
(
SN_ACPI_BASE_SUPPORT
())
if
(
sn_acpi_base_support
())
sn_acpi_bus_fixup
(
bus
);
else
sn_bus_fixup
(
bus
);
...
...
@@ -546,7 +553,7 @@ sn_io_early_init(void)
printk
(
KERN_INFO
"ACPI DSDT OEM Rev 0x%x
\n
"
,
acpi_gbl_DSDT
->
oem_revision
);
if
(
SN_ACPI_BASE_SUPPORT
())
if
(
sn_acpi_base_support
())
sn_io_acpi_init
();
else
sn_io_init
();
...
...
arch/ia64/sn/kernel/iomv.c
View file @
ad71860a
/*
/*
* This file is subject to the terms and conditions of the GNU General Public
* License. See the file "COPYING" in the main directory of this archive
* for more details.
...
...
@@ -16,7 +16,6 @@
#include <asm/sn/pda.h>
#include <asm/sn/sn_cpuid.h>
#include <asm/sn/shub_mmr.h>
#include <asm/sn/acpi.h>
#define IS_LEGACY_VGA_IOPORT(p) \
(((p) >= 0x3b0 && (p) <= 0x3bb) || ((p) >= 0x3c0 && (p) <= 0x3df))
...
...
@@ -26,9 +25,12 @@
* @port: port to convert
*
* Legacy in/out instructions are converted to ld/st instructions
* on IA64. This routine will convert a port number into a valid
* on IA64. This routine will convert a port number into a valid
* SN i/o address. Used by sn_in*() and sn_out*().
*/
extern
int
sn_acpi_base_support
();
void
*
sn_io_addr
(
unsigned
long
port
)
{
if
(
!
IS_RUNNING_ON_SIMULATOR
())
{
...
...
@@ -37,7 +39,7 @@ void *sn_io_addr(unsigned long port)
/* On sn2, legacy I/O ports don't point at anything */
if
(
port
<
(
64
*
1024
))
return
NULL
;
if
(
SN_ACPI_BASE_SUPPORT
())
if
(
sn_acpi_base_support
())
return
(
__ia64_mk_io_addr
(
port
));
else
return
((
void
*
)(
port
|
__IA64_UNCACHED_OFFSET
));
...
...
arch/x86_64/kernel/time.c
View file @
ad71860a
...
...
@@ -498,7 +498,7 @@ static unsigned long get_cmos_time(void)
{
unsigned
int
year
,
mon
,
day
,
hour
,
min
,
sec
;
unsigned
long
flags
;
unsigned
extyear
=
0
;
unsigned
century
=
0
;
spin_lock_irqsave
(
&
rtc_lock
,
flags
);
...
...
@@ -510,9 +510,9 @@ static unsigned long get_cmos_time(void)
mon
=
CMOS_READ
(
RTC_MONTH
);
year
=
CMOS_READ
(
RTC_YEAR
);
#ifdef CONFIG_ACPI
if
(
acpi_
fadt
.
revision
>=
FADT2_REVISION_ID
&&
acpi_
fadt
.
century
)
extyear
=
CMOS_READ
(
acpi_
fadt
.
century
);
if
(
acpi_
gbl_FADT
.
header
.
revision
>=
FADT2_REVISION_ID
&&
acpi_
gbl_FADT
.
century
)
century
=
CMOS_READ
(
acpi_
gbl_FADT
.
century
);
#endif
}
while
(
sec
!=
CMOS_READ
(
RTC_SECONDS
));
...
...
@@ -530,10 +530,10 @@ static unsigned long get_cmos_time(void)
BCD_TO_BIN
(
mon
);
BCD_TO_BIN
(
year
);
if
(
extyear
)
{
BCD_TO_BIN
(
extyear
);
year
+=
extyear
;
printk
(
KERN_INFO
"Extended CMOS year: %d
\n
"
,
extyear
);
if
(
century
)
{
BCD_TO_BIN
(
century
);
year
+=
century
*
100
;
printk
(
KERN_INFO
"Extended CMOS year: %d
\n
"
,
century
*
100
);
}
else
{
/*
* x86-64 systems only exists since 2002.
...
...
@@ -954,7 +954,7 @@ __cpuinit int unsynchronized_tsc(void)
if
(
boot_cpu_data
.
x86_vendor
==
X86_VENDOR_INTEL
)
{
#ifdef CONFIG_ACPI
/* But TSC doesn't tick in C3 so don't use it there */
if
(
acpi_
fadt
.
length
>
0
&&
acpi_
fadt
.
plvl3_lat
<
1000
)
if
(
acpi_
gbl_FADT
.
header
.
length
>
0
&&
acpi_
gbl_FADT
.
C3latency
<
1000
)
return
1
;
#endif
return
0
;
...
...
drivers/acpi/asus_acpi.c
View file @
ad71860a
...
...
@@ -26,7 +26,7 @@
* Pontus Fuchs - Helper functions, cleanup
* Johann Wiesner - Small compile fixes
* John Belmonte - ACPI code for Toshiba laptop was a good starting point.
*
r
ic Burghard - LED display support for W1N
*
�
ic Burghard - LED display support for W1N
*
*/
...
...
@@ -1128,7 +1128,6 @@ static int asus_model_match(char *model)
static
int
asus_hotk_get_info
(
void
)
{
struct
acpi_buffer
buffer
=
{
ACPI_ALLOCATE_BUFFER
,
NULL
};
struct
acpi_buffer
dsdt
=
{
ACPI_ALLOCATE_BUFFER
,
NULL
};
union
acpi_object
*
model
=
NULL
;
int
bsts_result
;
char
*
string
=
NULL
;
...
...
@@ -1142,11 +1141,9 @@ static int asus_hotk_get_info(void)
* HID), this bit will be moved. A global variable asus_info contains
* the DSDT header.
*/
status
=
acpi_get_table
(
ACPI_
TABLE_ID
_DSDT
,
1
,
&
dsdt
);
status
=
acpi_get_table
(
ACPI_
SIG
_DSDT
,
1
,
&
asus_info
);
if
(
ACPI_FAILURE
(
status
))
printk
(
KERN_WARNING
" Couldn't get the DSDT table header
\n
"
);
else
asus_info
=
dsdt
.
pointer
;
/* We have to write 0 on init this far for all ASUS models */
if
(
!
write_acpi_int
(
hotk
->
handle
,
"INIT"
,
0
,
&
buffer
))
{
...
...
@@ -1358,8 +1355,6 @@ static void __exit asus_acpi_exit(void)
acpi_bus_unregister_driver
(
&
asus_hotk_driver
);
remove_proc_entry
(
PROC_ASUS
,
acpi_root_dir
);
kfree
(
asus_info
);
return
;
}
...
...
drivers/acpi/blacklist.c
View file @
ad71860a
...
...
@@ -44,7 +44,7 @@ struct acpi_blacklist_item {
char
oem_id
[
7
];
char
oem_table_id
[
9
];
u32
oem_revision
;
acpi_table_type
table
;
char
*
table
;
enum
acpi_blacklist_predicates
oem_revision_predicate
;
char
*
reason
;
u32
is_critical_error
;
...
...
@@ -56,18 +56,18 @@ struct acpi_blacklist_item {
*/
static
struct
acpi_blacklist_item
acpi_blacklist
[]
__initdata
=
{
/* Compaq Presario 1700 */
{
"PTLTD "
,
" DSDT "
,
0x06040000
,
ACPI_DSDT
,
less_than_or_equal
,
{
"PTLTD "
,
" DSDT "
,
0x06040000
,
ACPI_
SIG_
DSDT
,
less_than_or_equal
,
"Multiple problems"
,
1
},
/* Sony FX120, FX140, FX150? */
{
"SONY "
,
"U0 "
,
0x20010313
,
ACPI_DSDT
,
less_than_or_equal
,
{
"SONY "
,
"U0 "
,
0x20010313
,
ACPI_
SIG_
DSDT
,
less_than_or_equal
,
"ACPI driver problem"
,
1
},
/* Compaq Presario 800, Insyde BIOS */
{
"INT440"
,
"SYSFexxx"
,
0x00001001
,
ACPI_DSDT
,
less_than_or_equal
,
{
"INT440"
,
"SYSFexxx"
,
0x00001001
,
ACPI_
SIG_
DSDT
,
less_than_or_equal
,
"Does not use _REG to protect EC OpRegions"
,
1
},
/* IBM 600E - _ADR should return 7, but it returns 1 */
{
"IBM "
,
"TP600E "
,
0x00000105
,
ACPI_DSDT
,
less_than_or_equal
,
{
"IBM "
,
"TP600E "
,
0x00000105
,
ACPI_
SIG_
DSDT
,
less_than_or_equal
,
"Incorrect _ADR"
,
1
},
{
"ASUS
\0\0
"
,
"P2B-S "
,
0
,
ACPI_DSDT
,
all_versions
,
{
"ASUS
\0\0
"
,
"P2B-S "
,
0
,
ACPI_
SIG_
DSDT
,
all_versions
,
"Bogus PCI routing"
,
1
},
{
""
}
...
...
@@ -106,8 +106,7 @@ int __init acpi_blacklisted(void)
struct
acpi_table_header
*
table_header
;
while
(
acpi_blacklist
[
i
].
oem_id
[
0
]
!=
'\0'
)
{
if
(
acpi_get_table_header_early
(
acpi_blacklist
[
i
].
table
,
&
table_header
))
{
if
(
acpi_get_table_header
(
acpi_blacklist
[
i
].
table
,
0
,
&
table_header
))
{
i
++
;
continue
;
}
...
...
drivers/acpi/bus.c
View file @
ad71860a
...
...
@@ -44,9 +44,6 @@ ACPI_MODULE_NAME("acpi_bus")
extern
void
__init
acpi_pic_sci_set_trigger
(
unsigned
int
irq
,
u16
trigger
);
#endif
struct
fadt_descriptor
acpi_fadt
;
EXPORT_SYMBOL
(
acpi_fadt
);
struct
acpi_device
*
acpi_root
;
struct
proc_dir_entry
*
acpi_root_dir
;
EXPORT_SYMBOL
(
acpi_root_dir
);
...
...
@@ -582,11 +579,12 @@ static int __init acpi_bus_init_irq(void)
return
0
;
}
acpi_native_uint
acpi_gbl_permanent_mmap
;
void
__init
acpi_early_init
(
void
)
{
acpi_status
status
=
AE_OK
;
struct
acpi_buffer
buffer
=
{
sizeof
(
acpi_fadt
),
&
acpi_fadt
};
if
(
acpi_disabled
)
return
;
...
...
@@ -597,6 +595,15 @@ void __init acpi_early_init(void)
if
(
!
acpi_strict
)
acpi_gbl_enable_interpreter_slack
=
TRUE
;
acpi_gbl_permanent_mmap
=
1
;
status
=
acpi_reallocate_root_table
();
if
(
ACPI_FAILURE
(
status
))
{
printk
(
KERN_ERR
PREFIX
"Unable to reallocate ACPI tables
\n
"
);
goto
error0
;
}
status
=
acpi_initialize_subsystem
();
if
(
ACPI_FAILURE
(
status
))
{
printk
(
KERN_ERR
PREFIX
...
...
@@ -611,14 +618,6 @@ void __init acpi_early_init(void)
goto
error0
;
}
/*
* Get a separate copy of the FADT for use by other drivers.
*/
status
=
acpi_get_table
(
ACPI_TABLE_ID_FADT
,
1
,
&
buffer
);
if
(
ACPI_FAILURE
(
status
))
{
printk
(
KERN_ERR
PREFIX
"Unable to get the FADT
\n
"
);
goto
error0
;
}
#ifdef CONFIG_X86
if
(
!
acpi_ioapic
)
{
extern
acpi_interrupt_flags
acpi_sci_flags
;
...
...
drivers/acpi/ec.c
View file @
ad71860a
...
...
@@ -872,9 +872,7 @@ static int __init acpi_ec_get_real_ecdt(void)
acpi_status
status
;
struct
acpi_table_ecdt
*
ecdt_ptr
;
status
=
acpi_get_firmware_table
(
"ECDT"
,
1
,
ACPI_LOGICAL_ADDRESSING
,
(
struct
acpi_table_header
**
)
&
ecdt_ptr
);
status
=
acpi_get_table
(
"ECDT"
,
1
,
(
struct
acpi_table_header
**
)
&
ecdt_ptr
);
if
(
ACPI_FAILURE
(
status
))
return
-
ENODEV
;
...
...
drivers/acpi/motherboard.c
View file @
ad71860a
...
...
@@ -134,41 +134,41 @@ static void __init acpi_request_region (struct acpi_generic_address *addr,
if
(
!
addr
->
address
||
!
length
)
return
;
if
(
addr
->
address_
space_id
==
ACPI_ADR_SPACE_SYSTEM_IO
)
if
(
addr
->
space_id
==
ACPI_ADR_SPACE_SYSTEM_IO
)
request_region
(
addr
->
address
,
length
,
desc
);
else
if
(
addr
->
address_
space_id
==
ACPI_ADR_SPACE_SYSTEM_MEMORY
)
else
if
(
addr
->
space_id
==
ACPI_ADR_SPACE_SYSTEM_MEMORY
)
request_mem_region
(
addr
->
address
,
length
,
desc
);
}
static
void
__init
acpi_reserve_resources
(
void
)
{
acpi_request_region
(
&
acpi_gbl_FADT
->
xpm1a_evt_blk
,
acpi_gbl_FADT
->
pm1_evt_len
,
"ACPI PM1a_EVT_BLK"
);
acpi_request_region
(
&
acpi_gbl_FADT
.
xpm1a_ev
en
t_bl
oc
k
,
acpi_gbl_FADT
.
pm1_ev
en
t_len
gth
,
"ACPI PM1a_EVT_BLK"
);
acpi_request_region
(
&
acpi_gbl_FADT
->
xpm1b_evt_blk
,
acpi_gbl_FADT
->
pm1_evt_len
,
"ACPI PM1b_EVT_BLK"
);
acpi_request_region
(
&
acpi_gbl_FADT
.
xpm1b_ev
en
t_bl
oc
k
,
acpi_gbl_FADT
.
pm1_ev
en
t_len
gth
,
"ACPI PM1b_EVT_BLK"
);
acpi_request_region
(
&
acpi_gbl_FADT
->
xpm1a_cnt_blk
,
acpi_gbl_FADT
->
pm1_cnt_len
,
"ACPI PM1a_CNT_BLK"
);
acpi_request_region
(
&
acpi_gbl_FADT
.
xpm1a_c
o
nt
rol
_bl
oc
k
,
acpi_gbl_FADT
.
pm1_c
o
nt
rol
_len
gth
,
"ACPI PM1a_CNT_BLK"
);
acpi_request_region
(
&
acpi_gbl_FADT
->
xpm1b_cnt_blk
,
acpi_gbl_FADT
->
pm1_cnt_len
,
"ACPI PM1b_CNT_BLK"
);
acpi_request_region
(
&
acpi_gbl_FADT
.
xpm1b_c
o
nt
rol
_bl
oc
k
,
acpi_gbl_FADT
.
pm1_c
o
nt
rol
_len
gth
,
"ACPI PM1b_CNT_BLK"
);
if
(
acpi_gbl_FADT
->
pm_t
m
_len
==
4
)
acpi_request_region
(
&
acpi_gbl_FADT
->
xpm_t
m
r_blk
,
4
,
"ACPI PM_TMR"
);
if
(
acpi_gbl_FADT
.
pm_t
imer
_len
gth
==
4
)
acpi_request_region
(
&
acpi_gbl_FADT
.
xpm_t
ime
r_bl
oc
k
,
4
,
"ACPI PM_TMR"
);
acpi_request_region
(
&
acpi_gbl_FADT
->
xpm2_cnt_blk
,
acpi_gbl_FADT
->
pm2_cnt_len
,
"ACPI PM2_CNT_BLK"
);
acpi_request_region
(
&
acpi_gbl_FADT
.
xpm2_c
o
nt
rol
_bl
oc
k
,
acpi_gbl_FADT
.
pm2_c
o
nt
rol
_len
gth
,
"ACPI PM2_CNT_BLK"
);
/* Length of GPE blocks must be a non-negative multiple of 2 */
if
(
!
(
acpi_gbl_FADT
->
gpe0_blk_len
&
0x1
))
acpi_request_region
(
&
acpi_gbl_FADT
->
xgpe0_blk
,
acpi_gbl_FADT
->
gpe0_blk_len
,
"ACPI GPE0_BLK"
);
if
(
!
(
acpi_gbl_FADT
.
gpe0_bl
oc
k_len
gth
&
0x1
))
acpi_request_region
(
&
acpi_gbl_FADT
.
xgpe0_bl
oc
k
,
acpi_gbl_FADT
.
gpe0_bl
oc
k_len
gth
,
"ACPI GPE0_BLK"
);
if
(
!
(
acpi_gbl_FADT
->
gpe1_blk_len
&
0x1
))
acpi_request_region
(
&
acpi_gbl_FADT
->
xgpe1_blk
,
acpi_gbl_FADT
->
gpe1_blk_len
,
"ACPI GPE1_BLK"
);
if
(
!
(
acpi_gbl_FADT
.
gpe1_bl
oc
k_len
gth
&
0x1
))
acpi_request_region
(
&
acpi_gbl_FADT
.
xgpe1_bl
oc
k
,
acpi_gbl_FADT
.
gpe1_bl
oc
k_len
gth
,
"ACPI GPE1_BLK"
);
}
static
int
__init
acpi_motherboard_init
(
void
)
...
...
drivers/acpi/osl.c
View file @
ad71860a
...
...
@@ -36,6 +36,7 @@
#include <linux/delay.h>
#include <linux/workqueue.h>
#include <linux/nmi.h>
#include <linux/acpi.h>
#include <acpi/acpi.h>
#include <asm/io.h>
#include <acpi/acpi_bus.h>
...
...
@@ -136,53 +137,43 @@ void acpi_os_vprintf(const char *fmt, va_list args)
#endif
}
acpi_
status
acpi_os_get_root_pointer
(
u32
flags
,
struct
acpi_pointer
*
addr
)
acpi_
physical_address
__init
acpi_os_get_root_pointer
(
void
)
{
if
(
efi_enabled
)
{
addr
->
pointer_type
=
ACPI_PHYSICAL_POINTER
;
if
(
efi
.
acpi20
!=
EFI_INVALID_TABLE_ADDR
)
addr
->
pointer
.
physical
=
efi
.
acpi20
;
return
efi
.
acpi20
;
else
if
(
efi
.
acpi
!=
EFI_INVALID_TABLE_ADDR
)
addr
->
pointer
.
physical
=
efi
.
acpi
;
return
efi
.
acpi
;
else
{
printk
(
KERN_ERR
PREFIX
"System description tables not found
\n
"
);
return
AE_NOT_FOUND
;
return
0
;
}
}
else
{
if
(
ACPI_FAILURE
(
acpi_find_root_pointer
(
flags
,
addr
)))
{
printk
(
KERN_ERR
PREFIX
"System description tables not found
\n
"
);
return
AE_NOT_FOUND
;
}
}
return
AE_OK
;
}
else
return
acpi_find_rsdp
();
}
acpi_status
acpi_os_map_memory
(
acpi_physical_address
phys
,
acpi_size
size
,
void
__iomem
**
virt
)
void
__iomem
*
acpi_os_map_memory
(
acpi_physical_address
phys
,
acpi_size
size
)
{
if
(
phys
>
ULONG_MAX
)
{
printk
(
KERN_ERR
PREFIX
"Cannot map memory that high
\n
"
);
return
AE_BAD_PARAMETER
;
return
0
;
}
/*
* ioremap checks to ensure this is in reserved space
*/
*
virt
=
ioremap
((
unsigned
long
)
phys
,
size
);
if
(
!*
virt
)
return
AE_NO_MEMORY
;
return
AE_OK
;
if
(
acpi_gbl_permanent_mmap
)
/*
* ioremap checks to ensure this is in reserved space
*/
return
ioremap
((
unsigned
long
)
phys
,
size
);
else
return
__acpi_map_table
((
unsigned
long
)
phys
,
size
);
}
EXPORT_SYMBOL_GPL
(
acpi_os_map_memory
);
void
acpi_os_unmap_memory
(
void
__iomem
*
virt
,
acpi_size
size
)
{
iounmap
(
virt
);
if
(
acpi_gbl_permanent_mmap
)
{
iounmap
(
virt
);
}
}
EXPORT_SYMBOL_GPL
(
acpi_os_unmap_memory
);
...
...
drivers/acpi/processor_core.c
View file @
ad71860a
...
...
@@ -431,7 +431,7 @@ static int acpi_processor_get_info(struct acpi_processor *pr)
* Check to see if we have bus mastering arbitration control. This
* is required for proper C3 usage (to maintain cache coherency).
*/
if
(
acpi_fadt
.
V1_
pm2_cnt_blk
&&
acpi_fadt
.
pm2_cnt_len
)
{
if
(
acpi_fadt
.
pm2_c
o
nt
rol
_bl
oc
k
&&
acpi_fadt
.
pm2_c
o
nt
rol
_len
gth
)
{
pr
->
flags
.
bm_control
=
1
;
ACPI_DEBUG_PRINT
((
ACPI_DB_INFO
,
"Bus mastering arbitration control present
\n
"
));
...
...
drivers/acpi/processor_idle.c
View file @
ad71860a
...
...
@@ -160,7 +160,7 @@ static inline u32 ticks_elapsed(u32 t1, u32 t2)
{
if
(
t2
>=
t1
)
return
(
t2
-
t1
);
else
if
(
!
acpi_fadt
.
tmr_val_ext
)
else
if
(
!
(
acpi_fadt
.
flags
&
ACPI_FADT_32BIT_TIMER
)
)
return
(((
0x00FFFFFF
-
t1
)
+
t2
)
&
0x00FFFFFF
);
else
return
((
0xFFFFFFFF
-
t1
)
+
t2
);
...
...
@@ -236,7 +236,7 @@ static void acpi_cstate_enter(struct acpi_processor_cx *cstate)
/* Dummy wait op - must do something useless after P_LVL2 read
because chipsets cannot guarantee that STPCLK# signal
gets asserted in time to freeze execution properly. */
unused
=
inl
(
acpi_fadt
.
xpm_t
m
r_blk
.
address
);
unused
=
inl
(
acpi_fadt
.
xpm_t
ime
r_bl
oc
k
.
address
);
}
}
...
...
@@ -338,7 +338,7 @@ static void acpi_processor_idle(void)
* detection phase, to work cleanly with logical CPU hotplug.
*/
if
((
cx
->
type
!=
ACPI_STATE_C1
)
&&
(
num_online_cpus
()
>
1
)
&&
!
pr
->
flags
.
has_cst
&&
!
acpi_fadt
.
plvl2_up
)
!
pr
->
flags
.
has_cst
&&
!
(
acpi_fadt
.
flags
&
ACPI_FADT_C2_MP_SUPPORTED
)
)
cx
=
&
pr
->
power
.
states
[
ACPI_STATE_C1
];
#endif
...
...
@@ -384,11 +384,11 @@ static void acpi_processor_idle(void)
case
ACPI_STATE_C2
:
/* Get start time (ticks) */
t1
=
inl
(
acpi_fadt
.
xpm_t
m
r_blk
.
address
);
t1
=
inl
(
acpi_fadt
.
xpm_t
ime
r_bl
oc
k
.
address
);
/* Invoke C2 */
acpi_cstate_enter
(
cx
);
/* Get end time (ticks) */
t2
=
inl
(
acpi_fadt
.
xpm_t
m
r_blk
.
address
);
t2
=
inl
(
acpi_fadt
.
xpm_t
ime
r_bl
oc
k
.
address
);
#ifdef CONFIG_GENERIC_TIME
/* TSC halts in C2, so notify users */
...
...
@@ -420,11 +420,11 @@ static void acpi_processor_idle(void)
}
/* Get start time (ticks) */
t1
=
inl
(
acpi_fadt
.
xpm_t
m
r_blk
.
address
);
t1
=
inl
(
acpi_fadt
.
xpm_t
ime
r_bl
oc
k
.
address
);
/* Invoke C3 */
acpi_cstate_enter
(
cx
);
/* Get end time (ticks) */
t2
=
inl
(
acpi_fadt
.
xpm_t
m
r_blk
.
address
);
t2
=
inl
(
acpi_fadt
.
xpm_t
ime
r_bl
oc
k
.
address
);
if
(
pr
->
flags
.
bm_check
)
{
/* Enable bus master arbitration */
atomic_dec
(
&
c3_cpu_count
);
...
...
@@ -457,7 +457,7 @@ static void acpi_processor_idle(void)
#ifdef CONFIG_HOTPLUG_CPU
/* Don't do promotion/demotion */
if
((
cx
->
type
==
ACPI_STATE_C1
)
&&
(
num_online_cpus
()
>
1
)
&&
!
pr
->
flags
.
has_cst
&&
!
acpi_fadt
.
plvl2_up
)
{
!
pr
->
flags
.
has_cst
&&
!
(
acpi_fadt
.
flags
&
ACPI_FADT_C2_MP_SUPPORTED
)
)
{
next_state
=
cx
;
goto
end
;
}
...
...
@@ -627,7 +627,8 @@ static int acpi_processor_get_power_info_fadt(struct acpi_processor *pr)
* Check for P_LVL2_UP flag before entering C2 and above on
* an SMP system.
*/
if
((
num_online_cpus
()
>
1
)
&&
!
acpi_fadt
.
plvl2_up
)
if
((
num_online_cpus
()
>
1
)
&&
!
(
acpi_fadt
.
flags
&
ACPI_FADT_C2_MP_SUPPORTED
))
return
-
ENODEV
;
#endif
...
...
@@ -636,8 +637,8 @@ static int acpi_processor_get_power_info_fadt(struct acpi_processor *pr)
pr
->
power
.
states
[
ACPI_STATE_C3
].
address
=
pr
->
pblk
+
5
;
/* determine latencies from FADT */
pr
->
power
.
states
[
ACPI_STATE_C2
].
latency
=
acpi_fadt
.
plvl2_lat
;
pr
->
power
.
states
[
ACPI_STATE_C3
].
latency
=
acpi_fadt
.
plvl3_lat
;
pr
->
power
.
states
[
ACPI_STATE_C2
].
latency
=
acpi_fadt
.
C2latency
;
pr
->
power
.
states
[
ACPI_STATE_C3
].
latency
=
acpi_fadt
.
C3latency
;
ACPI_DEBUG_PRINT
((
ACPI_DB_INFO
,
"lvl2[0x%08x] lvl3[0x%08x]
\n
"
,
...
...
@@ -883,7 +884,7 @@ static void acpi_processor_power_verify_c3(struct acpi_processor *pr,
* WBINVD should be set in fadt, for C3 state to be
* supported on when bm_check is not required.
*/
if
(
acpi_fadt
.
wb_invd
!=
1
)
{
if
(
!
(
acpi_fadt
.
flags
&
ACPI_FADT_WBINVD
)
)
{
ACPI_DEBUG_PRINT
((
ACPI_DB_INFO
,
"Cache invalidation should work properly"
" for C3 to be enabled on SMP systems
\n
"
));
...
...
@@ -1164,9 +1165,9 @@ int __cpuinit acpi_processor_power_init(struct acpi_processor *pr,
if
(
!
pr
)
return
-
EINVAL
;
if
(
acpi_fadt
.
cst_cnt
&&
!
nocst
)
{
if
(
acpi_fadt
.
cst_c
o
nt
rol
&&
!
nocst
)
{
status
=
acpi_os_write_port
(
acpi_fadt
.
smi_c
m
d
,
acpi_fadt
.
cst_cnt
,
8
);
acpi_os_write_port
(
acpi_fadt
.
smi_c
omman
d
,
acpi_fadt
.
cst_c
o
nt
rol
,
8
);
if
(
ACPI_FAILURE
(
status
))
{
ACPI_EXCEPTION
((
AE_INFO
,
status
,
"Notifying BIOS of _CST ability failed"
));
...
...
drivers/acpi/processor_perflib.c
View file @
ad71860a
...
...
@@ -352,31 +352,24 @@ int acpi_processor_notify_smm(struct module *calling_module)
is_done
=
-
EIO
;
/* Can't write pstate_cnt to smi_c
m
d if either value is zero */
if
((
!
acpi_fadt
.
smi_c
m
d
)
||
(
!
acpi_fadt
.
pstate_cnt
))
{
ACPI_DEBUG_PRINT
((
ACPI_DB_INFO
,
"No SMI port or pstate_cnt
\n
"
));
/* Can't write pstate_c
o
nt
rol
to smi_c
omman
d if either value is zero */