xen: remove more declarations from C files
PATCH 1/1 xen: remove more declarations from C files
# HG changeset patch
# User Tim Deegan <[email protected]> # Date 1306426663 -3600
# Node ID 69fe4b8a7c0961070a626cb473d19a0770db663a # Parent 88fe9f780b3d0cf0fcd5aa9b87d4ec7ad404e985
xen: remove more declarations from C files.
This patch moves some more, mostly data, extern declarations into
header files. I haven't been as strict as I was with functions;
in particular there are a number of declarations of assembler labels that are only used in one place. I've also left a few compat-mode tricks, and all the magic in symbols.c
Signed-off-by Tim Deegan <[email protected]>
xen/arch/x86/cpu/mcheck/mce.c +0 -3
@@ -326,9 +326,6 @@ mctelem_cookie_t mcheck_mca_logout(enummca_init_global (mc_flags, mig);/* A hook here to get global extended msrs */ { -struct mcinfo_extended *intel_get_extended_msrs ( -struct mcinfo_global *mig,struct mc_info *mi); -if (boot_cpu_data.x86_vendor ==X86_VENDOR_INTEL )intel_get_extended_msrs (mig, mci);
xen/arch/x86/cpu/mcheck/mce.h +3 -0
@@ -57,6 +57,9 @@ extern int firstbank;int intel_mce_rdmsr (uint32_t msr,uint64_t *val);int intel_mce_wrmsr (uint32_t msr,uint64_t val); +struct mcinfo_extended *intel_get_extended_msrs ( +struct mcinfo_global *mig,struct mc_info *mi); +int mce_available (struct cpuinfo_x86 *c);int mce_firstbank (struct cpuinfo_x86 *c);/* Helper functions used for collecting error telemetry */
xen/arch/x86/cpu/mcheck/x86_mca.h +0 -1
@@ -156,6 +156,5 @@ struct mca_error_handler/* Global variables */ extern bool_t mce_disabled; -extern unsigned int nr_mce_banks;#endif /* X86_MCA_H */
xen/arch/x86/cpu/mtrr/main.c +0 -6
@@ -63,12 +63,6 @@ const struct mtrr_ops *__read_mostly mtrstatic void set_mtrr (unsigned int reg,unsigned long base,unsigned long size,mtrr_type type); -#ifndef CONFIG_X86_64 -extern int arr3_protected; -#else -#define arr3_protected 0 -#endif -static const char *const mtrr_strings[MTRR_NUM_TYPES ] = {"uncachable" ,/* 0 */
xen/arch/x86/cpu/mtrr/mtrr.h +5 -0
@@ -86,3 +86,8 @@ void mtrr_wrmsr(unsigned int msr, uint64extern int amd_init_mtrr (void );extern int cyrix_init_mtrr (void ); +#ifndef CONFIG_X86_64 +extern int arr3_protected; +#else +#define arr3_protected 0 +#endif
xen/arch/x86/extable.c +0 -5
@@ -6,11 +6,6 @@#include <xen/spinlock.h> #include <asm/uaccess.h> -extern struct exception_table_entry __start___ex_table[]; -extern struct exception_table_entry __stop___ex_table[]; -extern struct exception_table_entry __start___pre_ex_table[]; -extern struct exception_table_entry __stop___pre_ex_table[]; -#ifdef __i386__#define EX_FIELD (ptr, field) (ptr)->field#define swap_ex NULL
xen/arch/x86/hvm/intercept.c +0 -7
@@ -32,13 +32,6 @@#include <xen/event.h> #include <xen/iommu.h> -extern const struct hvm_mmio_handler hpet_mmio_handler; -extern const struct hvm_mmio_handler vlapic_mmio_handler; -extern const struct hvm_mmio_handler vioapic_mmio_handler; -extern const struct hvm_mmio_handler msixtbl_mmio_handler; - -#define HVM_MMIO_HANDLER_NR 4 -static const struct hvm_mmio_handler *const hvm_mmio_handlers[HVM_MMIO_HANDLER_NR ] = {
xen/arch/x86/hvm/mtrr.c +0 -2
@@ -28,8 +28,6 @@#include <asm/hvm/support.h> #include <asm/hvm/cacheattr.h> -extern struct mtrr_state mtrr_state; -static uint32_t size_or_mask;/* Get page attribute fields (PAn) from PAT MSR. */
xen/arch/x86/hvm/svm/svm.c +0 -2
@@ -1656,8 +1656,6 @@ static void svm_vmexit_ud_intercept(stru } } -extern unsigned int nr_mce_banks;/* from mce.h */ -static int svm_is_erratum_383 (struct cpu_user_regs *regs) {uint64_t msr_content;
xen/arch/x86/hvm/svm/vmcb.c +0 -2
@@ -32,8 +32,6 @@#include <asm/hvm/svm/svm.h> #include <asm/hvm/svm/svmdebug.h> -extern int svm_dbg_on; -struct vmcb_struct *alloc_vmcb (void ) {struct vmcb_struct *vmcb;
xen/arch/x86/hvm/vpmu.c +0 -3
@@ -78,9 +78,6 @@ void vpmu_load(struct vcpu *v) vpmu->arch_vpmu_ops->arch_vpmu_load (v); } -extern struct arch_vpmu_ops core2_vpmu_ops; -extern struct arch_vpmu_ops amd_vpmu_ops; -void vpmu_initialise (struct vcpu *v) {struct vpmu_struct *vpmu =vcpu_vpmu (v);
xen/arch/x86/io_apic.c +0 -1
@@ -1440,7 +1440,6 @@ static void __init setup_ioapic_ids_from*/ static int __init timer_irq_works (void ) { -extern unsigned long pit0_ticks;unsigned long t1, flags; t1 = pit0_ticks;
xen/arch/x86/oprofile/nmi_int.c +0 -1
@@ -339,7 +339,6 @@ static int force_cpu_type(const char *st }custom_param ("cpu_type" , force_cpu_type); -extern int ppro_has_global_ctrl;static int __init ppro_init (char ** cpu_type) {__u8 cpu_model = current_cpu_data.x86_model;
xen/arch/x86/oprofile/op_model_athlon.c +0 -1
@@ -52,7 +52,6 @@static unsigned long reset_value[MAX_COUNTERS ];extern char svm_stgi_label[]; -extern struct op_x86_model_spec const *__read_mostly model;#ifdef CONFIG_X86_64 u32 ibs_caps =0 ;
xen/arch/x86/oprofile/op_x86_model.h +4 -0
@@ -51,4 +51,8 @@ extern struct op_x86_model_spec const opextern struct op_x86_model_spec const op_amd_fam15h_spec;void arch_perfmon_setup_counters (void ); + +extern int ppro_has_global_ctrl; +extern struct op_x86_model_spec const *__read_mostly model; +#endif /* OP_X86_MODEL_H */
xen/arch/x86/platform_hypercall.c +0 -3
@@ -30,9 +30,6 @@#include "cpu/mtrr/mtrr.h" #include <xsm/xsm.h> -extern uint16_t boot_edid_caps; -extern uint8_t boot_edid_info[]; -#ifndef COMPAT typedef long ret_t ;DEFINE_SPINLOCK (xenpf_lock);
xen/arch/x86/setup.c +1 -5
@@ -45,10 +45,6 @@#include <asm/setup.h> #include <xen/cpu.h> -extern u16 boot_edid_caps; -extern u8 boot_edid_info[128 ]; -extern struct boot_video_info boot_vid_info; -/* opt_nosmp: If true, secondary processors are ignored. */ static bool_t __initdata opt_nosmp;boolean_param ("nosmp" , opt_nosmp);
@@ -438,6 +434,7 @@ struct boot_video_info {u16 vesapm_off;/* 0x26 */ u16 vesa_attrib;/* 0x28 */ }; +extern struct boot_video_info boot_vid_info;static void __init parse_video_info (void ) {
@@ -806,7 +803,6 @@ void __init __start_xen(unsigned long mb end =0 ;if ( end > s ) { -extern l2_pgentry_t l2_xenmap[];l4_pgentry_t *pl4e;l3_pgentry_t *pl3e;l2_pgentry_t *pl2e;
xen/arch/x86/tboot.c +0 -1
@@ -245,7 +245,6 @@ static void tboot_gen_domain_integrity(c*/ static int mfn_in_guarded_stack (unsigned long mfn) { -extern void *stack_base[NR_CPUS ];void *p;int i;
xen/arch/x86/traps.c +0 -2
@@ -3248,8 +3248,6 @@ asmlinkage void do_debug(struct cpu_userif ( regs->eflags &X86_EFLAGS_TF ) {#ifdef __x86_64__ -void sysenter_entry (void ); -void sysenter_eflags_saved (void );/* In SYSENTER entry path we can't zap TF until EFLAGS is saved. */ if ( (regs->rip >= (unsigned long )sysenter_entry) && (regs->rip <= (unsigned long )sysenter_eflags_saved) )
xen/arch/x86/x86_32/mm.c +0 -2
@@ -34,8 +34,6 @@l2_pgentry_t __attribute__ ((__section__ (".bss.page_aligned" ))) idle_pg_table_l2[4 *L2_PAGETABLE_ENTRIES ]; -extern l1_pgentry_t l1_identmap[L1_PAGETABLE_ENTRIES ]; -unsigned int __read_mostly PAGE_HYPERVISOR = __PAGE_HYPERVISOR;unsigned int __read_mostly PAGE_HYPERVISOR_NOCACHE = __PAGE_HYPERVISOR_NOCACHE;
xen/arch/x86/x86_64/traps.c +0 -4
@@ -24,10 +24,6 @@#include <asm/hvm/support.h> #include <public/callback.h> -asmlinkage void syscall_enter(void); -asmlinkage void sysenter_entry(void); -asmlinkage void compat_hypercall(void); -asmlinkage void int80_direct_trap(void);static void print_xen_info (void ) {
xen/common/sched_arinc653.c +1 -1
@@ -654,7 +654,7 @@ a653sched_adjust_global(const struct sch* callback functions. * The symbol must be visible to the rest of Xen at link time. */ -struct scheduler sched_arinc653_def = { +const struct scheduler sched_arinc653_def = { .name ="ARINC 653 Scheduler" , .opt_name ="arinc653" , .sched_id =XEN_SCHEDULER_ARINC653 ,
xen/common/schedule.c +0 -4
@@ -57,10 +57,6 @@ static void poll_timer_fn(void *data); DEFINE_PER_CPU(struct schedule_data, schedule_data); DEFINE_PER_CPU(struct scheduler *, scheduler); -extern const struct scheduler sched_sedf_def; -extern const struct scheduler sched_credit_def; -extern const struct scheduler sched_credit2_def; -extern const struct scheduler sched_arinc653_def;static const struct scheduler *schedulers[] = { &sched_sedf_def, &sched_credit_def,
xen/drivers/acpi/pmstat.c +0 -2
@@ -45,8 +45,6 @@ DEFINE_PER_CPU_READ_MOSTLY(struct pm_px *, cpufreq_statistic_data); -extern struct list_head cpufreq_governor_list; -/* * Get PM statistic info */
xen/drivers/passthrough/amd/iommu_acpi.c +0 -6
@@ -25,12 +25,6 @@#include <asm/hvm/svm/amd-iommu-proto.h> #include <asm/hvm/svm/amd-iommu-acpi.h> -extern unsigned long amd_iommu_page_entries; -extern unsigned short ivrs_bdf_entries; -extern struct ivrs_mappings *ivrs_mappings; -extern int ioapic_bdf[MAX_IO_APICS ]; -extern void *shared_intremap_table; -static unsigned short __initdata last_bdf; static void __init add_ivrs_mapping_entry(
xen/drivers/passthrough/amd/iommu_intr.c +0 -2
@@ -28,8 +28,6 @@#define INTREMAP_ENTRIES (1 << INTREMAP_LENGTH)int ioapic_bdf[MAX_IO_APICS ]; -extern struct ivrs_mappings *ivrs_mappings; -extern unsigned short ivrs_bdf_entries;void *shared_intremap_table;static DEFINE_SPINLOCK (shared_intremap_lock);
xen/drivers/passthrough/amd/pci_amd_iommu.c +0 -3
@@ -25,9 +25,6 @@#include <asm/amd-iommu.h> #include <asm/hvm/svm/amd-iommu-proto.h> -extern unsigned short ivrs_bdf_entries; -extern struct ivrs_mappings *ivrs_mappings; -struct amd_iommu *find_iommu_for_device (int bdf) {BUG_ON ( bdf >= ivrs_bdf_entries );
xen/include/acpi/cpufreq/cpufreq.h +2 -0
@@ -103,6 +103,8 @@ extern struct cpufreq_governor cpufreq_gextern struct cpufreq_governor cpufreq_gov_performance;extern struct cpufreq_governor cpufreq_gov_powersave; +extern struct list_head cpufreq_governor_list; +extern int cpufreq_register_governor (struct cpufreq_governor *governor);extern struct cpufreq_governor *__find_governor (const char *governor);#define CPUFREQ_DEFAULT_GOVERNOR &cpufreq_gov_dbs
xen/include/asm-x86/amd-iommu.h +4 -0
@@ -99,4 +99,8 @@ struct ivrs_mappings {u8 dte_ext_int_pass; u8 dte_init_pass; }; + +extern unsigned short ivrs_bdf_entries; +extern struct ivrs_mappings *ivrs_mappings; +#endif /* _ASM_X86_64_AMD_IOMMU_H */
xen/include/asm-x86/config.h +2 -0
@@ -108,6 +108,8 @@ extern unsigned int trampoline_xen_phys_extern unsigned char trampoline_cpu_started;extern char wakeup_start[];extern unsigned int video_mode, video_flags; +extern unsigned short boot_edid_caps; +extern unsigned char boot_edid_info[128 ];#endif #if defined(__x86_64__)
xen/include/asm-x86/hvm/io.h +7 -0
@@ -65,6 +65,13 @@ struct hvm_mmio_handler {hvm_mmio_write_t write_handler; }; +extern const struct hvm_mmio_handler hpet_mmio_handler; +extern const struct hvm_mmio_handler vlapic_mmio_handler; +extern const struct hvm_mmio_handler vioapic_mmio_handler; +extern const struct hvm_mmio_handler msixtbl_mmio_handler; + +#define HVM_MMIO_HANDLER_NR 4 +int hvm_io_intercept (ioreq_t *p,int type); void register_io_handler( struct domain *d, unsigned long addr, unsigned long size,
xen/include/asm-x86/hvm/svm/amd-iommu-proto.h +4 -0
@@ -23,6 +23,7 @@#include <xen/sched.h> #include <asm/amd-iommu.h> +#include <asm/apicdef.h> #include <xen/domain_page.h> #define for_each_amd_iommu (amd_iommu) \
@@ -95,6 +96,9 @@ void amd_iommu_read_msi_from_ire(unsigned int amd_iommu_read_ioapic_from_ire (unsigned int apic,unsigned int reg); +extern int ioapic_bdf[MAX_IO_APICS ]; +extern void *shared_intremap_table; +/* power management support */ void amd_iommu_resume (void );void amd_iommu_suspend (void );
xen/include/asm-x86/hvm/vpmu.h +3 -0
@@ -56,6 +56,9 @@ struct arch_vpmu_ops {void (*arch_vpmu_load)(struct vcpu *v); }; +extern struct arch_vpmu_ops core2_vpmu_ops; +extern struct arch_vpmu_ops amd_vpmu_ops; +struct vpmu_struct {u32 flags;void *context;
xen/include/asm-x86/mce.h +3 -0
@@ -30,4 +30,7 @@ extern int vmce_init_msr(struct domain *extern void vmce_destroy_msr (struct domain *d);extern int vmce_wrmsr (uint32_t msr,uint64_t val);extern int vmce_rdmsr (uint32_t msr,uint64_t *val); + +extern unsigned int nr_mce_banks; +#endif
xen/include/asm-x86/mtrr.h +1 -0
@@ -52,6 +52,7 @@ struct mtrr_state {/* ranges in var MSRs are overlapped or not:0(no overlapped) */ bool_t overlapped; }; +extern struct mtrr_state mtrr_state;extern void mtrr_save_fixed_ranges (void *);extern void mtrr_save_state (void );
xen/include/asm-x86/page.h +2 -0
@@ -303,6 +303,8 @@ extern l2_pgentry_t *compat_idle_pg_tabextern unsigned int m2p_compat_vstart;#endif extern l2_pgentry_t l2_identmap[4 *L2_PAGETABLE_ENTRIES ]; +extern l1_pgentry_t l1_identmap[L1_PAGETABLE_ENTRIES ]; +extern l2_pgentry_t l2_xenmap[];void paging_init (void );void setup_idle_pagetable (void );#endif /* !defined(__ASSEMBLY__) */
xen/include/asm-x86/processor.h +7 -0
@@ -580,6 +580,13 @@ DECLARE_TRAP_HANDLER(machine_check);DECLARE_TRAP_HANDLER (alignment_check);DECLARE_TRAP_HANDLER (spurious_interrupt_bug);#undef DECLARE_TRAP_HANDLER + +asmlinkage void syscall_enter(void); +asmlinkage void sysenter_entry(void); +asmlinkage void sysenter_eflags_saved(void); +asmlinkage void compat_hypercall(void); +asmlinkage void int80_direct_trap(void); + extern asmlinkage int hypercall(void); int cpuid_hypervisor_leaves( uint32_t idx, uint32_t sub_idx,
xen/include/asm-x86/uaccess.h +4 -0
@@ -269,6 +269,10 @@ struct exception_table_entry {s32 addr, cont; }; +extern struct exception_table_entry __start___ex_table[]; +extern struct exception_table_entry __stop___ex_table[]; +extern struct exception_table_entry __start___pre_ex_table[]; +extern struct exception_table_entry __stop___pre_ex_table[];extern unsigned long search_exception_table (unsigned long );extern void sort_exception_tables (void );
xen/include/xen/sched-if.h +6 -0
@@ -183,6 +183,12 @@ struct scheduler {void (*tick_resume) (const struct scheduler *,unsigned int ); }; +extern const struct scheduler sched_sedf_def; +extern const struct scheduler sched_credit_def; +extern const struct scheduler sched_credit2_def; +extern const struct scheduler sched_arinc653_def; + +struct cpupool {int cpupool_id;
xen/include/xen/smp.h +2 -0
@@ -63,4 +63,6 @@ static inline void on_each_cpu(int alloc_cpu_id (void ); +extern void *stack_base[NR_CPUS ]; +#endif /* __XEN_SMP_H__ */
xen/include/xen/time.h +1 -0
@@ -15,6 +15,7 @@ extern int init_xen_time(void);extern void cstate_restore_tsc (void );extern unsigned long cpu_khz; +extern unsigned long pit0_ticks;struct domain ;struct vcpu ;