Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
linux
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
linux
Commits
547f7847
Commit
547f7847
authored
Nov 11, 2008
by
Len Brown
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'processor-256' into release
parents
f398778a
5b53ed69
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
51 additions
and
38 deletions
+51
-38
drivers/acpi/processor_core.c
drivers/acpi/processor_core.c
+49
-37
drivers/acpi/scan.c
drivers/acpi/scan.c
+1
-1
include/acpi/acpi_drivers.h
include/acpi/acpi_drivers.h
+1
-0
No files found.
drivers/acpi/processor_core.c
View file @
547f7847
...
@@ -88,6 +88,7 @@ static int acpi_processor_handle_eject(struct acpi_processor *pr);
...
@@ -88,6 +88,7 @@ static int acpi_processor_handle_eject(struct acpi_processor *pr);
static
const
struct
acpi_device_id
processor_device_ids
[]
=
{
static
const
struct
acpi_device_id
processor_device_ids
[]
=
{
{
ACPI_PROCESSOR_OBJECT_HID
,
0
},
{
ACPI_PROCESSOR_HID
,
0
},
{
ACPI_PROCESSOR_HID
,
0
},
{
""
,
0
},
{
""
,
0
},
};
};
...
@@ -408,7 +409,7 @@ static int acpi_processor_remove_fs(struct acpi_device *device)
...
@@ -408,7 +409,7 @@ static int acpi_processor_remove_fs(struct acpi_device *device)
/* Use the acpiid in MADT to map cpus in case of SMP */
/* Use the acpiid in MADT to map cpus in case of SMP */
#ifndef CONFIG_SMP
#ifndef CONFIG_SMP
static
int
get_cpu_id
(
acpi_handle
handle
,
u32
acpi_id
)
{
return
-
1
;
}
static
int
get_cpu_id
(
acpi_handle
handle
,
int
type
,
u32
acpi_id
)
{
return
-
1
;
}
#else
#else
static
struct
acpi_table_madt
*
madt
;
static
struct
acpi_table_madt
*
madt
;
...
@@ -427,27 +428,35 @@ static int map_lapic_id(struct acpi_subtable_header *entry,
...
@@ -427,27 +428,35 @@ static int map_lapic_id(struct acpi_subtable_header *entry,
}
}
static
int
map_lsapic_id
(
struct
acpi_subtable_header
*
entry
,
static
int
map_lsapic_id
(
struct
acpi_subtable_header
*
entry
,
u32
acpi_id
,
int
*
apic_id
)
int
device_declaration
,
u32
acpi_id
,
int
*
apic_id
)
{
{
struct
acpi_madt_local_sapic
*
lsapic
=
struct
acpi_madt_local_sapic
*
lsapic
=
(
struct
acpi_madt_local_sapic
*
)
entry
;
(
struct
acpi_madt_local_sapic
*
)
entry
;
u32
tmp
=
(
lsapic
->
id
<<
8
)
|
lsapic
->
eid
;
/* Only check enabled APICs*/
/* Only check enabled APICs*/
if
(
lsapic
->
lapic_flags
&
ACPI_MADT_ENABLED
)
{
if
(
!
(
lsapic
->
lapic_flags
&
ACPI_MADT_ENABLED
))
/* First check against id */
return
0
;
if
(
lsapic
->
processor_id
==
acpi_id
)
{
*
apic_id
=
(
lsapic
->
id
<<
8
)
|
lsapic
->
eid
;
/* Device statement declaration type */
return
1
;
if
(
device_declaration
)
{
/* Check against optional uid */
if
(
entry
->
length
<
16
)
}
else
if
(
entry
->
length
>=
16
&&
printk
(
KERN_ERR
PREFIX
lsapic
->
uid
==
acpi_id
)
{
"Invalid LSAPIC with Device type processor (SAPIC ID %#x)
\n
"
,
*
apic_id
=
lsapic
->
uid
;
tmp
);
return
1
;
else
if
(
lsapic
->
uid
==
acpi_id
)
}
goto
found
;
}
/* Processor statement declaration type */
}
else
if
(
lsapic
->
processor_id
==
acpi_id
)
goto
found
;
return
0
;
return
0
;
found:
*
apic_id
=
tmp
;
return
1
;
}
}
static
int
map_madt_entry
(
u32
acpi_id
)
static
int
map_madt_entry
(
int
type
,
u32
acpi_id
)
{
{
unsigned
long
madt_end
,
entry
;
unsigned
long
madt_end
,
entry
;
int
apic_id
=
-
1
;
int
apic_id
=
-
1
;
...
@@ -468,7 +477,7 @@ static int map_madt_entry(u32 acpi_id)
...
@@ -468,7 +477,7 @@ static int map_madt_entry(u32 acpi_id)
if
(
map_lapic_id
(
header
,
acpi_id
,
&
apic_id
))
if
(
map_lapic_id
(
header
,
acpi_id
,
&
apic_id
))
break
;
break
;
}
else
if
(
header
->
type
==
ACPI_MADT_TYPE_LOCAL_SAPIC
)
{
}
else
if
(
header
->
type
==
ACPI_MADT_TYPE_LOCAL_SAPIC
)
{
if
(
map_lsapic_id
(
header
,
acpi_id
,
&
apic_id
))
if
(
map_lsapic_id
(
header
,
type
,
acpi_id
,
&
apic_id
))
break
;
break
;
}
}
entry
+=
header
->
length
;
entry
+=
header
->
length
;
...
@@ -476,7 +485,7 @@ static int map_madt_entry(u32 acpi_id)
...
@@ -476,7 +485,7 @@ static int map_madt_entry(u32 acpi_id)
return
apic_id
;
return
apic_id
;
}
}
static
int
map_mat_entry
(
acpi_handle
handle
,
u32
acpi_id
)
static
int
map_mat_entry
(
acpi_handle
handle
,
int
type
,
u32
acpi_id
)
{
{
struct
acpi_buffer
buffer
=
{
ACPI_ALLOCATE_BUFFER
,
NULL
};
struct
acpi_buffer
buffer
=
{
ACPI_ALLOCATE_BUFFER
,
NULL
};
union
acpi_object
*
obj
;
union
acpi_object
*
obj
;
...
@@ -499,7 +508,7 @@ static int map_mat_entry(acpi_handle handle, u32 acpi_id)
...
@@ -499,7 +508,7 @@ static int map_mat_entry(acpi_handle handle, u32 acpi_id)
if
(
header
->
type
==
ACPI_MADT_TYPE_LOCAL_APIC
)
{
if
(
header
->
type
==
ACPI_MADT_TYPE_LOCAL_APIC
)
{
map_lapic_id
(
header
,
acpi_id
,
&
apic_id
);
map_lapic_id
(
header
,
acpi_id
,
&
apic_id
);
}
else
if
(
header
->
type
==
ACPI_MADT_TYPE_LOCAL_SAPIC
)
{
}
else
if
(
header
->
type
==
ACPI_MADT_TYPE_LOCAL_SAPIC
)
{
map_lsapic_id
(
header
,
acpi_id
,
&
apic_id
);
map_lsapic_id
(
header
,
type
,
acpi_id
,
&
apic_id
);
}
}
exit:
exit:
...
@@ -508,14 +517,14 @@ static int map_mat_entry(acpi_handle handle, u32 acpi_id)
...
@@ -508,14 +517,14 @@ static int map_mat_entry(acpi_handle handle, u32 acpi_id)
return
apic_id
;
return
apic_id
;
}
}
static
int
get_cpu_id
(
acpi_handle
handle
,
u32
acpi_id
)
static
int
get_cpu_id
(
acpi_handle
handle
,
int
type
,
u32
acpi_id
)
{
{
int
i
;
int
i
;
int
apic_id
=
-
1
;
int
apic_id
=
-
1
;
apic_id
=
map_mat_entry
(
handle
,
acpi_id
);
apic_id
=
map_mat_entry
(
handle
,
type
,
acpi_id
);
if
(
apic_id
==
-
1
)
if
(
apic_id
==
-
1
)
apic_id
=
map_madt_entry
(
acpi_id
);
apic_id
=
map_madt_entry
(
type
,
acpi_id
);
if
(
apic_id
==
-
1
)
if
(
apic_id
==
-
1
)
return
apic_id
;
return
apic_id
;
...
@@ -531,15 +540,16 @@ static int get_cpu_id(acpi_handle handle, u32 acpi_id)
...
@@ -531,15 +540,16 @@ static int get_cpu_id(acpi_handle handle, u32 acpi_id)
Driver Interface
Driver Interface
-------------------------------------------------------------------------- */
-------------------------------------------------------------------------- */
static
int
acpi_processor_get_info
(
struct
acpi_
processor
*
pr
,
unsigned
has_uid
)
static
int
acpi_processor_get_info
(
struct
acpi_
device
*
device
)
{
{
acpi_status
status
=
0
;
acpi_status
status
=
0
;
union
acpi_object
object
=
{
0
};
union
acpi_object
object
=
{
0
};
struct
acpi_buffer
buffer
=
{
sizeof
(
union
acpi_object
),
&
object
};
struct
acpi_buffer
buffer
=
{
sizeof
(
union
acpi_object
),
&
object
};
int
cpu_index
;
struct
acpi_processor
*
pr
;
int
cpu_index
,
device_declaration
=
0
;
static
int
cpu0_initialized
;
static
int
cpu0_initialized
;
pr
=
acpi_driver_data
(
device
);
if
(
!
pr
)
if
(
!
pr
)
return
-
EINVAL
;
return
-
EINVAL
;
...
@@ -560,22 +570,23 @@ static int acpi_processor_get_info(struct acpi_processor *pr, unsigned has_uid)
...
@@ -560,22 +570,23 @@ static int acpi_processor_get_info(struct acpi_processor *pr, unsigned has_uid)
ACPI_DEBUG_PRINT
((
ACPI_DB_INFO
,
ACPI_DEBUG_PRINT
((
ACPI_DB_INFO
,
"No bus mastering arbitration control
\n
"
));
"No bus mastering arbitration control
\n
"
));
/* Check if it is a Device with HID and UID */
if
(
!
strcmp
(
acpi_device_hid
(
device
),
ACPI_PROCESSOR_HID
))
{
if
(
has_uid
)
{
/*
* Declared with "Device" statement; match _UID.
* Note that we don't handle string _UIDs yet.
*/
unsigned
long
long
value
;
unsigned
long
long
value
;
status
=
acpi_evaluate_integer
(
pr
->
handle
,
METHOD_NAME__UID
,
status
=
acpi_evaluate_integer
(
pr
->
handle
,
METHOD_NAME__UID
,
NULL
,
&
value
);
NULL
,
&
value
);
if
(
ACPI_FAILURE
(
status
))
{
if
(
ACPI_FAILURE
(
status
))
{
printk
(
KERN_ERR
PREFIX
"Evaluating processor _UID
\n
"
);
printk
(
KERN_ERR
PREFIX
"Evaluating processor _UID [%#x]
\n
"
,
status
);
return
-
ENODEV
;
return
-
ENODEV
;
}
}
device_declaration
=
1
;
pr
->
acpi_id
=
value
;
pr
->
acpi_id
=
value
;
}
else
{
}
else
{
/*
/* Declared with "Processor" statement; match ProcessorID */
* Evalute the processor object. Note that it is common on SMP to
* have the first (boot) processor with a valid PBLK address while
* all others have a NULL address.
*/
status
=
acpi_evaluate_object
(
pr
->
handle
,
NULL
,
NULL
,
&
buffer
);
status
=
acpi_evaluate_object
(
pr
->
handle
,
NULL
,
NULL
,
&
buffer
);
if
(
ACPI_FAILURE
(
status
))
{
if
(
ACPI_FAILURE
(
status
))
{
printk
(
KERN_ERR
PREFIX
"Evaluating processor object
\n
"
);
printk
(
KERN_ERR
PREFIX
"Evaluating processor object
\n
"
);
...
@@ -584,11 +595,12 @@ static int acpi_processor_get_info(struct acpi_processor *pr, unsigned has_uid)
...
@@ -584,11 +595,12 @@ static int acpi_processor_get_info(struct acpi_processor *pr, unsigned has_uid)
/*
/*
* TBD: Synch processor ID (via LAPIC/LSAPIC structures) on SMP.
* TBD: Synch processor ID (via LAPIC/LSAPIC structures) on SMP.
* >>> 'acpi_get_processor_id(acpi_id, &id)' in arch/xxx/acpi.c
* >>> 'acpi_get_processor_id(acpi_id, &id)' in
* arch/xxx/acpi.c
*/
*/
pr
->
acpi_id
=
object
.
processor
.
proc_id
;
pr
->
acpi_id
=
object
.
processor
.
proc_id
;
}
}
cpu_index
=
get_cpu_id
(
pr
->
handle
,
pr
->
acpi_id
);
cpu_index
=
get_cpu_id
(
pr
->
handle
,
device_declaration
,
pr
->
acpi_id
);
/* Handle UP system running SMP kernel, with no LAPIC in MADT */
/* Handle UP system running SMP kernel, with no LAPIC in MADT */
if
(
!
cpu0_initialized
&&
(
cpu_index
==
-
1
)
&&
if
(
!
cpu0_initialized
&&
(
cpu_index
==
-
1
)
&&
...
@@ -660,7 +672,7 @@ static int __cpuinit acpi_processor_start(struct acpi_device *device)
...
@@ -660,7 +672,7 @@ static int __cpuinit acpi_processor_start(struct acpi_device *device)
pr
=
acpi_driver_data
(
device
);
pr
=
acpi_driver_data
(
device
);
result
=
acpi_processor_get_info
(
pr
,
device
->
flags
.
unique_id
);
result
=
acpi_processor_get_info
(
device
);
if
(
result
)
{
if
(
result
)
{
/* Processor is physically not present */
/* Processor is physically not present */
return
0
;
return
0
;
...
...
drivers/acpi/scan.c
View file @
547f7847
...
@@ -1013,7 +1013,7 @@ static void acpi_device_set_id(struct acpi_device *device,
...
@@ -1013,7 +1013,7 @@ static void acpi_device_set_id(struct acpi_device *device,
hid
=
ACPI_POWER_HID
;
hid
=
ACPI_POWER_HID
;
break
;
break
;
case
ACPI_BUS_TYPE_PROCESSOR
:
case
ACPI_BUS_TYPE_PROCESSOR
:
hid
=
ACPI_PROCESSOR_HID
;
hid
=
ACPI_PROCESSOR_
OBJECT_
HID
;
break
;
break
;
case
ACPI_BUS_TYPE_SYSTEM
:
case
ACPI_BUS_TYPE_SYSTEM
:
hid
=
ACPI_SYSTEM_HID
;
hid
=
ACPI_SYSTEM_HID
;
...
...
include/acpi/acpi_drivers.h
View file @
547f7847
...
@@ -57,6 +57,7 @@
...
@@ -57,6 +57,7 @@
*/
*/
#define ACPI_POWER_HID "LNXPOWER"
#define ACPI_POWER_HID "LNXPOWER"
#define ACPI_PROCESSOR_OBJECT_HID "ACPI_CPU"
#define ACPI_PROCESSOR_HID "ACPI0007"
#define ACPI_PROCESSOR_HID "ACPI0007"
#define ACPI_SYSTEM_HID "LNXSYSTM"
#define ACPI_SYSTEM_HID "LNXSYSTM"
#define ACPI_THERMAL_HID "LNXTHERM"
#define ACPI_THERMAL_HID "LNXTHERM"
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment