aboutsummaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authorIngo Molnar <mingo@elte.hu>2009-01-27 17:12:02 -0500
committerIngo Molnar <mingo@elte.hu>2009-01-28 17:20:04 -0500
commitef7471b13f3ef81074af1972b97355df9df3cdf3 (patch)
tree3cdec011feacf034f16bb183b76acbaad3645b31 /arch
parent943d0f74d47724d0e33083674c16a834f080af2c (diff)
x86, genapic: unify struct genapic
Move over the (now identical) struct genapic definitions from genapic_32/64.h to genapic.h. Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'arch')
-rw-r--r--arch/x86/include/asm/genapic.h96
-rw-r--r--arch/x86/include/asm/genapic_32.h93
-rw-r--r--arch/x86/include/asm/genapic_64.h91
3 files changed, 96 insertions, 184 deletions
diff --git a/arch/x86/include/asm/genapic.h b/arch/x86/include/asm/genapic.h
index d48bee663a6f..3dea66a328e3 100644
--- a/arch/x86/include/asm/genapic.h
+++ b/arch/x86/include/asm/genapic.h
@@ -1,5 +1,101 @@
1#ifndef _ASM_X86_GENAPIC_H
2#define _ASM_X86_GENAPIC_H
3
4#include <linux/cpumask.h>
5
6/*
7 * Copyright 2004 James Cleverdon, IBM.
8 * Subject to the GNU Public License, v.2
9 *
10 * Generic APIC sub-arch data struct.
11 *
12 * Hacked for x86-64 by James Cleverdon from i386 architecture code by
13 * Martin Bligh, Andi Kleen, James Bottomley, John Stultz, and
14 * James Cleverdon.
15 */
16
17struct genapic {
18 char *name;
19
20 int (*probe)(void);
21 int (*acpi_madt_oem_check)(char *oem_id, char *oem_table_id);
22 int (*apic_id_registered)(void);
23
24 u32 int_delivery_mode;
25 u32 int_dest_mode;
26
27 const struct cpumask *(*target_cpus)(void);
28
29 int ESR_DISABLE;
30
31 int apic_destination_logical;
32 unsigned long (*check_apicid_used)(physid_mask_t bitmap, int apicid);
33 unsigned long (*check_apicid_present)(int apicid);
34
35 int no_balance_irq;
36 int no_ioapic_check;
37
38 void (*vector_allocation_domain)(int cpu, struct cpumask *retmask);
39 void (*init_apic_ldr)(void);
40
41 physid_mask_t (*ioapic_phys_id_map)(physid_mask_t map);
42
43 void (*setup_apic_routing)(void);
44 int (*multi_timer_check)(int apic, int irq);
45 int (*apicid_to_node)(int logical_apicid);
46 int (*cpu_to_logical_apicid)(int cpu);
47 int (*cpu_present_to_apicid)(int mps_cpu);
48 physid_mask_t (*apicid_to_cpu_present)(int phys_apicid);
49 void (*setup_portio_remap)(void);
50 int (*check_phys_apicid_present)(int boot_cpu_physical_apicid);
51 void (*enable_apic_mode)(void);
52#ifdef CONFIG_X86_32
53 u32 (*phys_pkg_id)(u32 cpuid_apic, int index_msb);
54#else
55 unsigned int (*phys_pkg_id)(int index_msb);
56#endif
57
58 /*
59 * When one of the next two hooks returns 1 the genapic
60 * is switched to this. Essentially they are additional
61 * probe functions:
62 */
63 int (*mps_oem_check)(struct mpc_table *mpc, char *oem,
64 char *productid);
65
66 unsigned int (*get_apic_id)(unsigned long x);
67 unsigned long (*set_apic_id)(unsigned int id);
68 unsigned long apic_id_mask;
69
70 unsigned int (*cpu_mask_to_apicid)(const struct cpumask *cpumask);
71 unsigned int (*cpu_mask_to_apicid_and)(const struct cpumask *cpumask,
72 const struct cpumask *andmask);
73
74#ifdef CONFIG_SMP
75 /* ipi */
76 void (*send_IPI_mask)(const struct cpumask *mask, int vector);
77 void (*send_IPI_mask_allbutself)(const struct cpumask *mask,
78 int vector);
79 void (*send_IPI_allbutself)(int vector);
80 void (*send_IPI_all)(int vector);
81 void (*send_IPI_self)(int vector);
82#endif
83 /* wakeup_secondary_cpu */
84 int (*wakeup_cpu)(int apicid, unsigned long start_eip);
85
86 int trampoline_phys_low;
87 int trampoline_phys_high;
88 void (*wait_for_init_deassert)(atomic_t *deassert);
89 void (*smp_callin_clear_local_apic)(void);
90 void (*store_NMI_vector)(unsigned short *high, unsigned short *low);
91 void (*restore_NMI_vector)(unsigned short *high, unsigned short *low);
92 void (*inquire_remote_apic)(int apicid);
93};
94
1#ifdef CONFIG_X86_32 95#ifdef CONFIG_X86_32
2# include "genapic_32.h" 96# include "genapic_32.h"
3#else 97#else
4# include "genapic_64.h" 98# include "genapic_64.h"
5#endif 99#endif
100
101#endif /* _ASM_X86_GENAPIC_64_H */
diff --git a/arch/x86/include/asm/genapic_32.h b/arch/x86/include/asm/genapic_32.h
index 5808b7daf0a3..a56785ed12a9 100644
--- a/arch/x86/include/asm/genapic_32.h
+++ b/arch/x86/include/asm/genapic_32.h
@@ -4,99 +4,6 @@
4#include <asm/mpspec.h> 4#include <asm/mpspec.h>
5#include <asm/atomic.h> 5#include <asm/atomic.h>
6 6
7/*
8 * Generic APIC driver interface.
9 *
10 * An straight forward mapping of the APIC related parts of the
11 * x86 subarchitecture interface to a dynamic object.
12 *
13 * This is used by the "generic" x86 subarchitecture.
14 *
15 * Copyright 2003 Andi Kleen, SuSE Labs.
16 */
17
18struct mpc_bus;
19struct mpc_table;
20struct mpc_cpu;
21
22struct genapic {
23 char *name;
24
25 int (*probe)(void);
26 int (*acpi_madt_oem_check)(char *oem_id, char *oem_table_id);
27 int (*apic_id_registered)(void);
28
29 u32 int_delivery_mode;
30 u32 int_dest_mode;
31
32 const struct cpumask *(*target_cpus)(void);
33
34 int ESR_DISABLE;
35
36 int apic_destination_logical;
37 unsigned long (*check_apicid_used)(physid_mask_t bitmap, int apicid);
38 unsigned long (*check_apicid_present)(int apicid);
39
40 int no_balance_irq;
41 int no_ioapic_check;
42
43 void (*vector_allocation_domain)(int cpu, struct cpumask *retmask);
44 void (*init_apic_ldr)(void);
45
46 physid_mask_t (*ioapic_phys_id_map)(physid_mask_t map);
47
48 void (*setup_apic_routing)(void);
49 int (*multi_timer_check)(int apic, int irq);
50 int (*apicid_to_node)(int logical_apicid);
51 int (*cpu_to_logical_apicid)(int cpu);
52 int (*cpu_present_to_apicid)(int mps_cpu);
53 physid_mask_t (*apicid_to_cpu_present)(int phys_apicid);
54 void (*setup_portio_remap)(void);
55 int (*check_phys_apicid_present)(int boot_cpu_physical_apicid);
56 void (*enable_apic_mode)(void);
57#ifdef CONFIG_X86_32
58 u32 (*phys_pkg_id)(u32 cpuid_apic, int index_msb);
59#else
60 unsigned int (*phys_pkg_id)(int index_msb);
61#endif
62
63 /*
64 * When one of the next two hooks returns 1 the genapic
65 * is switched to this. Essentially they are additional
66 * probe functions:
67 */
68 int (*mps_oem_check)(struct mpc_table *mpc, char *oem,
69 char *productid);
70
71 unsigned int (*get_apic_id)(unsigned long x);
72 unsigned long (*set_apic_id)(unsigned int id);
73 unsigned long apic_id_mask;
74
75 unsigned int (*cpu_mask_to_apicid)(const struct cpumask *cpumask);
76 unsigned int (*cpu_mask_to_apicid_and)(const struct cpumask *cpumask,
77 const struct cpumask *andmask);
78
79#ifdef CONFIG_SMP
80 /* ipi */
81 void (*send_IPI_mask)(const struct cpumask *mask, int vector);
82 void (*send_IPI_mask_allbutself)(const struct cpumask *mask,
83 int vector);
84 void (*send_IPI_allbutself)(int vector);
85 void (*send_IPI_all)(int vector);
86 void (*send_IPI_self)(int vector);
87#endif
88 /* wakeup_secondary_cpu */
89 int (*wakeup_cpu)(int apicid, unsigned long start_eip);
90
91 int trampoline_phys_low;
92 int trampoline_phys_high;
93 void (*wait_for_init_deassert)(atomic_t *deassert);
94 void (*smp_callin_clear_local_apic)(void);
95 void (*store_NMI_vector)(unsigned short *high, unsigned short *low);
96 void (*restore_NMI_vector)(unsigned short *high, unsigned short *low);
97 void (*inquire_remote_apic)(int apicid);
98};
99
100#define APICFUNC(x) .x = x, 7#define APICFUNC(x) .x = x,
101 8
102/* More functions could be probably marked IPIFUNC and save some space 9/* More functions could be probably marked IPIFUNC and save some space
diff --git a/arch/x86/include/asm/genapic_64.h b/arch/x86/include/asm/genapic_64.h
index 0a5f7122d9fe..c70ca0d50eb3 100644
--- a/arch/x86/include/asm/genapic_64.h
+++ b/arch/x86/include/asm/genapic_64.h
@@ -1,97 +1,6 @@
1#ifndef _ASM_X86_GENAPIC_64_H 1#ifndef _ASM_X86_GENAPIC_64_H
2#define _ASM_X86_GENAPIC_64_H 2#define _ASM_X86_GENAPIC_64_H
3 3
4#include <linux/cpumask.h>
5
6/*
7 * Copyright 2004 James Cleverdon, IBM.
8 * Subject to the GNU Public License, v.2
9 *
10 * Generic APIC sub-arch data struct.
11 *
12 * Hacked for x86-64 by James Cleverdon from i386 architecture code by
13 * Martin Bligh, Andi Kleen, James Bottomley, John Stultz, and
14 * James Cleverdon.
15 */
16
17struct genapic {
18 char *name;
19
20 int (*probe)(void);
21 int (*acpi_madt_oem_check)(char *oem_id, char *oem_table_id);
22 int (*apic_id_registered)(void);
23
24 u32 int_delivery_mode;
25 u32 int_dest_mode;
26
27 const struct cpumask *(*target_cpus)(void);
28
29 int ESR_DISABLE;
30
31 int apic_destination_logical;
32 unsigned long (*check_apicid_used)(physid_mask_t bitmap, int apicid);
33 unsigned long (*check_apicid_present)(int apicid);
34
35 int no_balance_irq;
36 int no_ioapic_check;
37
38 void (*vector_allocation_domain)(int cpu, struct cpumask *retmask);
39 void (*init_apic_ldr)(void);
40
41 physid_mask_t (*ioapic_phys_id_map)(physid_mask_t map);
42
43 void (*setup_apic_routing)(void);
44 int (*multi_timer_check)(int apic, int irq);
45 int (*apicid_to_node)(int logical_apicid);
46 int (*cpu_to_logical_apicid)(int cpu);
47 int (*cpu_present_to_apicid)(int mps_cpu);
48 physid_mask_t (*apicid_to_cpu_present)(int phys_apicid);
49 void (*setup_portio_remap)(void);
50 int (*check_phys_apicid_present)(int boot_cpu_physical_apicid);
51 void (*enable_apic_mode)(void);
52#ifdef CONFIG_X86_32
53 u32 (*phys_pkg_id)(u32 cpuid_apic, int index_msb);
54#else
55 unsigned int (*phys_pkg_id)(int index_msb);
56#endif
57
58 /*
59 * When one of the next two hooks returns 1 the genapic
60 * is switched to this. Essentially they are additional
61 * probe functions:
62 */
63 int (*mps_oem_check)(struct mpc_table *mpc, char *oem,
64 char *productid);
65
66 unsigned int (*get_apic_id)(unsigned long x);
67 unsigned long (*set_apic_id)(unsigned int id);
68 unsigned long apic_id_mask;
69
70 unsigned int (*cpu_mask_to_apicid)(const struct cpumask *cpumask);
71 unsigned int (*cpu_mask_to_apicid_and)(const struct cpumask *cpumask,
72 const struct cpumask *andmask);
73
74#ifdef CONFIG_SMP
75 /* ipi */
76 void (*send_IPI_mask)(const struct cpumask *mask, int vector);
77 void (*send_IPI_mask_allbutself)(const struct cpumask *mask,
78 int vector);
79 void (*send_IPI_allbutself)(int vector);
80 void (*send_IPI_all)(int vector);
81 void (*send_IPI_self)(int vector);
82#endif
83 /* wakeup_secondary_cpu */
84 int (*wakeup_cpu)(int apicid, unsigned long start_eip);
85
86 int trampoline_phys_low;
87 int trampoline_phys_high;
88 void (*wait_for_init_deassert)(atomic_t *deassert);
89 void (*smp_callin_clear_local_apic)(void);
90 void (*store_NMI_vector)(unsigned short *high, unsigned short *low);
91 void (*restore_NMI_vector)(unsigned short *high, unsigned short *low);
92 void (*inquire_remote_apic)(int apicid);
93};
94
95extern struct genapic *genapic; 4extern struct genapic *genapic;
96 5
97extern struct genapic apic_flat; 6extern struct genapic apic_flat;