diff options
Diffstat (limited to 'arch/x86/kernel/genapic_flat_64.c')
-rw-r--r-- | arch/x86/kernel/genapic_flat_64.c | 26 |
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 | ||
100 | static unsigned int get_apic_id(unsigned long x) | ||
101 | { | ||
102 | unsigned int id; | ||
103 | |||
104 | id = (((x)>>24) & 0xFFu); | ||
105 | return id; | ||
106 | } | ||
107 | |||
108 | static unsigned long set_apic_id(unsigned int id) | ||
109 | { | ||
110 | unsigned long x; | ||
111 | |||
112 | x = ((id & 0xFFu)<<24); | ||
113 | return x; | ||
114 | } | ||
115 | |||
100 | static unsigned int read_xapic_id(void) | 116 | static 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 | }; |