diff options
author | Yinghai Lu <yhlu.kernel@gmail.com> | 2008-07-12 04:01:20 -0400 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2008-07-13 02:27:46 -0400 |
commit | f910a9dc7c865896815e2a95fe33363e9522f277 (patch) | |
tree | a4d1361f7d38dd358da62a1c14191cdbf6011d98 /arch/x86/kernel/genx2apic_phys.c | |
parent | 4c9961d56ec20c27ec5d02e49fd7427748312741 (diff) |
x86: make 64bit have get_apic_id
generalize the x2apic code some more.
let read_apic_id become a macro (later on a function/inline)
GET_APIC_ID(apic_read(APIC_ID))
+#define read_apic_id() (GET_APIC_ID(apic_read(APIC_ID)))
instead of this weird construct:
-#define read_apic_id (genapic->read_apic_id)
Signed-off-by: Yinghai Lu <yhlu.kernel@gmail.com>
Cc: Suresh Siddha <suresh.b.siddha@intel.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'arch/x86/kernel/genx2apic_phys.c')
-rw-r--r-- | arch/x86/kernel/genx2apic_phys.c | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/arch/x86/kernel/genx2apic_phys.c b/arch/x86/kernel/genx2apic_phys.c index 3c70b9d692b2..2f3c6ca19de9 100644 --- a/arch/x86/kernel/genx2apic_phys.c +++ b/arch/x86/kernel/genx2apic_phys.c | |||
@@ -84,6 +84,22 @@ static unsigned int x2apic_cpu_mask_to_apicid(cpumask_t cpumask) | |||
84 | return BAD_APICID; | 84 | return BAD_APICID; |
85 | } | 85 | } |
86 | 86 | ||
87 | static unsigned int get_apic_id(unsigned long x) | ||
88 | { | ||
89 | unsigned int id; | ||
90 | |||
91 | id = x; | ||
92 | return id; | ||
93 | } | ||
94 | |||
95 | static unsigned long set_apic_id(unsigned int id) | ||
96 | { | ||
97 | unsigned long x; | ||
98 | |||
99 | x = id; | ||
100 | return x; | ||
101 | } | ||
102 | |||
87 | static unsigned int x2apic_read_id(void) | 103 | static unsigned int x2apic_read_id(void) |
88 | { | 104 | { |
89 | return apic_read(APIC_ID); | 105 | return apic_read(APIC_ID); |
@@ -118,5 +134,7 @@ struct genapic apic_x2apic_phys = { | |||
118 | .send_IPI_self = x2apic_send_IPI_self, | 134 | .send_IPI_self = x2apic_send_IPI_self, |
119 | .cpu_mask_to_apicid = x2apic_cpu_mask_to_apicid, | 135 | .cpu_mask_to_apicid = x2apic_cpu_mask_to_apicid, |
120 | .phys_pkg_id = phys_pkg_id, | 136 | .phys_pkg_id = phys_pkg_id, |
121 | .read_apic_id = x2apic_read_id, | 137 | .get_apic_id = get_apic_id, |
138 | .set_apic_id = set_apic_id, | ||
139 | .apic_id_mask = (0xFFFFFFFFu), | ||
122 | }; | 140 | }; |