aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/kernel/genapic_flat_64.c
diff options
context:
space:
mode:
authorYinghai Lu <yhlu.kernel@gmail.com>2008-07-12 04:01:20 -0400
committerIngo Molnar <mingo@elte.hu>2008-07-13 02:27:46 -0400
commitf910a9dc7c865896815e2a95fe33363e9522f277 (patch)
treea4d1361f7d38dd358da62a1c14191cdbf6011d98 /arch/x86/kernel/genapic_flat_64.c
parent4c9961d56ec20c27ec5d02e49fd7427748312741 (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/genapic_flat_64.c')
-rw-r--r--arch/x86/kernel/genapic_flat_64.c26
1 files changed, 23 insertions, 3 deletions
diff --git a/arch/x86/kernel/genapic_flat_64.c b/arch/x86/kernel/genapic_flat_64.c
index 7dac2f275fad..2c973cbf054f 100644
--- a/arch/x86/kernel/genapic_flat_64.c
+++ b/arch/x86/kernel/genapic_flat_64.c
@@ -97,11 +97,27 @@ static void flat_send_IPI_all(int vector)
97 __send_IPI_shortcut(APIC_DEST_ALLINC, vector, APIC_DEST_LOGICAL); 97 __send_IPI_shortcut(APIC_DEST_ALLINC, vector, APIC_DEST_LOGICAL);
98} 98}
99 99
100static unsigned int get_apic_id(unsigned long x)
101{
102 unsigned int id;
103
104 id = (((x)>>24) & 0xFFu);
105 return id;
106}
107
108static unsigned long set_apic_id(unsigned int id)
109{
110 unsigned long x;
111
112 x = ((id & 0xFFu)<<24);
113 return x;
114}
115
100static unsigned int read_xapic_id(void) 116static unsigned int read_xapic_id(void)
101{ 117{
102 unsigned int id; 118 unsigned int id;
103 119
104 id = GET_APIC_ID(apic_read(APIC_ID)); 120 id = get_apic_id(apic_read(APIC_ID));
105 return id; 121 return id;
106} 122}
107 123
@@ -134,7 +150,9 @@ struct genapic apic_flat = {
134 .send_IPI_self = apic_send_IPI_self, 150 .send_IPI_self = apic_send_IPI_self,
135 .cpu_mask_to_apicid = flat_cpu_mask_to_apicid, 151 .cpu_mask_to_apicid = flat_cpu_mask_to_apicid,
136 .phys_pkg_id = phys_pkg_id, 152 .phys_pkg_id = phys_pkg_id,
137 .read_apic_id = read_xapic_id, 153 .get_apic_id = get_apic_id,
154 .set_apic_id = set_apic_id,
155 .apic_id_mask = (0xFFu<<24),
138}; 156};
139 157
140/* 158/*
@@ -200,5 +218,7 @@ struct genapic apic_physflat = {
200 .send_IPI_self = apic_send_IPI_self, 218 .send_IPI_self = apic_send_IPI_self,
201 .cpu_mask_to_apicid = physflat_cpu_mask_to_apicid, 219 .cpu_mask_to_apicid = physflat_cpu_mask_to_apicid,
202 .phys_pkg_id = phys_pkg_id, 220 .phys_pkg_id = phys_pkg_id,
203 .read_apic_id = read_xapic_id, 221 .get_apic_id = get_apic_id,
222 .set_apic_id = set_apic_id,
223 .apic_id_mask = (0xFFu<<24),
204}; 224};