-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
yaml --- r: 288847 b: refs/heads/master c: 644e9cb h: refs/heads/master i: 288845: 176e5ee 288843: efeeb69 288839: f807b9b 288831: 085c8b6 v: v3
- Loading branch information
Andi Kleen
authored and
Greg Kroah-Hartman
committed
Jan 27, 2012
1 parent
64555ba
commit 283d281
Showing
7 changed files
with
166 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
--- | ||
refs/heads/master: d6e486868cde585842d55ba3b6ec57af090fc343 | ||
refs/heads/master: 644e9cbbe3fc032cc92d0936057e166a994dc246 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
#ifndef _CPU_DEVICE_ID | ||
#define _CPU_DEVICE_ID 1 | ||
|
||
/* | ||
* Declare drivers belonging to specific x86 CPUs | ||
* Similar in spirit to pci_device_id and related PCI functions | ||
*/ | ||
|
||
#include <linux/mod_devicetable.h> | ||
|
||
extern const struct x86_cpu_id *x86_match_cpu(const struct x86_cpu_id *match); | ||
|
||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
#include <asm/cpu_device_id.h> | ||
#include <asm/processor.h> | ||
#include <linux/cpu.h> | ||
#include <linux/module.h> | ||
|
||
/** | ||
* x86_match_cpu - match current CPU again an array of x86_cpu_ids | ||
* @match: Pointer to array of x86_cpu_ids. Last entry terminated with | ||
* {}. | ||
* | ||
* Return the entry if the current CPU matches the entries in the | ||
* passed x86_cpu_id match table. Otherwise NULL. The match table | ||
* contains vendor (X86_VENDOR_*), family, model and feature bits or | ||
* respective wildcard entries. | ||
* | ||
* A typical table entry would be to match a specific CPU | ||
* { X86_VENDOR_INTEL, 6, 0x12 } | ||
* or to match a specific CPU feature | ||
* { X86_FEATURE_MATCH(X86_FEATURE_FOOBAR) } | ||
* | ||
* Fields can be wildcarded with %X86_VENDOR_ANY, %X86_FAMILY_ANY, | ||
* %X86_MODEL_ANY, %X86_FEATURE_ANY or 0 (except for vendor) | ||
* | ||
* Arrays used to match for this should also be declared using | ||
* MODULE_DEVICE_TABLE(x86_cpu, ...) | ||
* | ||
* This always matches against the boot cpu, assuming models and features are | ||
* consistent over all CPUs. | ||
*/ | ||
const struct x86_cpu_id *x86_match_cpu(const struct x86_cpu_id *match) | ||
{ | ||
const struct x86_cpu_id *m; | ||
struct cpuinfo_x86 *c = &boot_cpu_data; | ||
|
||
for (m = match; m->vendor | m->family | m->model | m->feature; m++) { | ||
if (m->vendor != X86_VENDOR_ANY && c->x86_vendor != m->vendor) | ||
continue; | ||
if (m->family != X86_FAMILY_ANY && c->x86 != m->family) | ||
continue; | ||
if (m->model != X86_MODEL_ANY && c->x86_model != m->model) | ||
continue; | ||
if (m->feature != X86_FEATURE_ANY && !cpu_has(c, m->feature)) | ||
continue; | ||
return m; | ||
} | ||
return NULL; | ||
} | ||
EXPORT_SYMBOL(x86_match_cpu); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters