Skip to content

Commit

Permalink
x86: Make asmlinkage explicitly a no-op, and avoid usage in arch/x86
Browse files Browse the repository at this point in the history
Signed-off-by: Keir Fraser <keir@xen.org>
xen-unstable changeset:   24511:a141f6d64916
xen-unstable date:        Sun Jan 15 22:02:35 2012 +0000
  • Loading branch information
Keir Fraser committed Jun 20, 2012
1 parent 129c2fa commit c0d8fe1
Show file tree
Hide file tree
Showing 16 changed files with 44 additions and 46 deletions.
2 changes: 1 addition & 1 deletion xen/arch/x86/acpi/power.c
Expand Up @@ -331,7 +331,7 @@ static void tboot_sleep(u8 sleep_state)
}

/* System is really put into sleep state by this stub */
acpi_status asmlinkage acpi_enter_sleep_state(u8 sleep_state)
acpi_status acpi_enter_sleep_state(u8 sleep_state)
{
acpi_status status;

Expand Down
2 changes: 1 addition & 1 deletion xen/arch/x86/hvm/svm/asid.c
Expand Up @@ -38,7 +38,7 @@ void svm_asid_init(struct cpuinfo_x86 *c)
* Called directly before VMRUN. Checks if the VCPU needs a new ASID,
* assigns it, and if required, issues required TLB flushes.
*/
asmlinkage void svm_asid_handle_vmrun(void)
void svm_asid_handle_vmrun(void)
{
struct vcpu *curr = current;
bool_t need_flush = hvm_asid_handle_vmenter();
Expand Down
2 changes: 1 addition & 1 deletion xen/arch/x86/hvm/svm/intr.c
Expand Up @@ -112,7 +112,7 @@ static void enable_intr_window(struct vcpu *v, struct hvm_intack intack)
vmcb->general1_intercepts |= GENERAL1_INTERCEPT_VINTR;
}

asmlinkage void svm_intr_assist(void)
void svm_intr_assist(void)
{
struct vcpu *v = current;
struct vmcb_struct *vmcb = v->arch.hvm_svm.vmcb;
Expand Down
4 changes: 2 additions & 2 deletions xen/arch/x86/hvm/svm/svm.c
Expand Up @@ -1387,7 +1387,7 @@ static struct hvm_function_table __read_mostly svm_function_table = {
.set_rdtsc_exiting = svm_set_rdtsc_exiting
};

asmlinkage void svm_vmexit_handler(struct cpu_user_regs *regs)
void svm_vmexit_handler(struct cpu_user_regs *regs)
{
unsigned int exit_reason;
struct vcpu *v = current;
Expand Down Expand Up @@ -1643,7 +1643,7 @@ asmlinkage void svm_vmexit_handler(struct cpu_user_regs *regs)
(vlapic_get_reg(vcpu_vlapic(v), APIC_TASKPRI) & 0xFF) >> 4;
}

asmlinkage void svm_trace_vmentry(void)
void svm_trace_vmentry(void)
{
HVMTRACE_ND (VMENTRY, 1/*cycles*/, 0, 0, 0, 0, 0, 0, 0);
}
Expand Down
2 changes: 1 addition & 1 deletion xen/arch/x86/hvm/vmx/intr.c
Expand Up @@ -110,7 +110,7 @@ static void enable_intr_window(struct vcpu *v, struct hvm_intack intack)
}
}

asmlinkage void vmx_intr_assist(void)
void vmx_intr_assist(void)
{
struct hvm_intack intack;
struct vcpu *v = current;
Expand Down
6 changes: 3 additions & 3 deletions xen/arch/x86/hvm/vmx/vmx.c
Expand Up @@ -2189,7 +2189,7 @@ static void vmx_failed_vmentry(unsigned int exit_reason,
domain_crash(curr->domain);
}

asmlinkage void vmx_enter_realmode(struct cpu_user_regs *regs)
void vmx_enter_realmode(struct cpu_user_regs *regs)
{
struct vcpu *v = current;

Expand Down Expand Up @@ -2268,7 +2268,7 @@ static int vmx_handle_xsetbv(u64 new_bv)
return -1;
}

asmlinkage void vmx_vmexit_handler(struct cpu_user_regs *regs)
void vmx_vmexit_handler(struct cpu_user_regs *regs)
{
unsigned int exit_reason, idtv_info, intr_info = 0, vector = 0;
unsigned long exit_qualification, inst_len = 0;
Expand Down Expand Up @@ -2647,7 +2647,7 @@ asmlinkage void vmx_vmexit_handler(struct cpu_user_regs *regs)
}
}

asmlinkage void vmx_vmenter_helper(void)
void vmx_vmenter_helper(void)
{
struct vcpu *curr = current;
u32 new_asid, old_asid;
Expand Down
2 changes: 1 addition & 1 deletion xen/arch/x86/irq.c
Expand Up @@ -515,7 +515,7 @@ void irq_set_affinity(int irq, cpumask_t mask)

DEFINE_PER_CPU(unsigned int, irq_count);

asmlinkage void do_IRQ(struct cpu_user_regs *regs)
void do_IRQ(struct cpu_user_regs *regs)
{
struct irqaction *action;
uint32_t tsc_in;
Expand Down
2 changes: 1 addition & 1 deletion xen/arch/x86/trace.c
Expand Up @@ -11,7 +11,7 @@
#define TRC_64_FLAG 0
#endif

asmlinkage void trace_hypercall(void)
void trace_hypercall(void)
{
struct cpu_user_regs *regs = guest_cpu_user_regs();

Expand Down
34 changes: 17 additions & 17 deletions xen/arch/x86/traps.c
Expand Up @@ -89,8 +89,8 @@ idt_entry_t idt_table[IDT_ENTRIES];
idt_entry_t *idt_tables[NR_CPUS] __read_mostly;

#define DECLARE_TRAP_HANDLER(_name) \
asmlinkage void _name(void); \
asmlinkage void do_ ## _name(struct cpu_user_regs *regs)
void _name(void); \
void do_ ## _name(struct cpu_user_regs *regs)

DECLARE_TRAP_HANDLER(divide_error);
DECLARE_TRAP_HANDLER(debug);
Expand Down Expand Up @@ -405,7 +405,7 @@ static char *trapstr(int trapnr)
* are disabled). In such situations we can't do much that is safe. We try to
* print out some tracing and then we just spin.
*/
asmlinkage void fatal_trap(int trapnr, struct cpu_user_regs *regs)
void fatal_trap(int trapnr, struct cpu_user_regs *regs)
{
static DEFINE_PER_CPU(char, depth);

Expand Down Expand Up @@ -519,7 +519,7 @@ static unsigned int check_guest_io_breakpoint(struct vcpu *v,
* Called from asm to set up the MCE trapbounce info.
* Returns 0 if no callback is set up, else 1.
*/
asmlinkage int set_guest_machinecheck_trapbounce(void)
int set_guest_machinecheck_trapbounce(void)
{
struct vcpu *v = current;
struct trap_bounce *tb = &v->arch.trap_bounce;
Expand All @@ -533,7 +533,7 @@ asmlinkage int set_guest_machinecheck_trapbounce(void)
* Called from asm to set up the NMI trapbounce info.
* Returns 0 if no callback is set up, else 1.
*/
asmlinkage int set_guest_nmi_trapbounce(void)
int set_guest_nmi_trapbounce(void)
{
struct vcpu *v = current;
struct trap_bounce *tb = &v->arch.trap_bounce;
Expand Down Expand Up @@ -581,13 +581,13 @@ static inline void do_trap(
}

#define DO_ERROR_NOCODE(trapnr, name) \
asmlinkage void do_##name(struct cpu_user_regs *regs) \
void do_##name(struct cpu_user_regs *regs) \
{ \
do_trap(trapnr, regs, 0); \
}

#define DO_ERROR(trapnr, name) \
asmlinkage void do_##name(struct cpu_user_regs *regs) \
void do_##name(struct cpu_user_regs *regs) \
{ \
do_trap(trapnr, regs, 1); \
}
Expand Down Expand Up @@ -904,7 +904,7 @@ static int emulate_forced_invalid_op(struct cpu_user_regs *regs)
return EXCRET_fault_fixed;
}

asmlinkage void do_invalid_op(struct cpu_user_regs *regs)
void do_invalid_op(struct cpu_user_regs *regs)
{
struct bug_frame bug;
struct bug_frame_str bug_str;
Expand Down Expand Up @@ -998,7 +998,7 @@ asmlinkage void do_invalid_op(struct cpu_user_regs *regs)
panic("FATAL TRAP: vector = %d (invalid opcode)\n", TRAP_invalid_op);
}

asmlinkage void do_int3(struct cpu_user_regs *regs)
void do_int3(struct cpu_user_regs *regs)
{
DEBUGGER_trap_entry(TRAP_int3, regs);

Expand All @@ -1011,7 +1011,7 @@ asmlinkage void do_int3(struct cpu_user_regs *regs)
do_guest_trap(TRAP_int3, regs, 0);
}

asmlinkage void do_machine_check(struct cpu_user_regs *regs)
void do_machine_check(struct cpu_user_regs *regs)
{
machine_check_vector(regs, regs->error_code);
}
Expand Down Expand Up @@ -1291,7 +1291,7 @@ static int fixup_page_fault(unsigned long addr, struct cpu_user_regs *regs)
* Bit 3: Reserved bit violation
* Bit 4: Instruction fetch
*/
asmlinkage void do_page_fault(struct cpu_user_regs *regs)
void do_page_fault(struct cpu_user_regs *regs)
{
unsigned long addr, fixup;
unsigned int error_code;
Expand Down Expand Up @@ -1346,7 +1346,7 @@ asmlinkage void do_page_fault(struct cpu_user_regs *regs)
* during early boot (an issue was seen once, but was most likely a hardware
* problem).
*/
asmlinkage void do_early_page_fault(struct cpu_user_regs *regs)
void do_early_page_fault(struct cpu_user_regs *regs)
{
static int stuck;
static unsigned long prev_eip, prev_cr2;
Expand Down Expand Up @@ -2812,7 +2812,7 @@ static void emulate_gate_op(struct cpu_user_regs *regs)
#endif
}

asmlinkage void do_general_protection(struct cpu_user_regs *regs)
void do_general_protection(struct cpu_user_regs *regs)
{
struct vcpu *v = current;
unsigned long fixup;
Expand Down Expand Up @@ -3087,7 +3087,7 @@ static int dummy_nmi_callback(struct cpu_user_regs *regs, int cpu)

static nmi_callback_t nmi_callback = dummy_nmi_callback;

asmlinkage void do_nmi(struct cpu_user_regs *regs)
void do_nmi(struct cpu_user_regs *regs)
{
unsigned int cpu = smp_processor_id();
unsigned char reason;
Expand Down Expand Up @@ -3123,7 +3123,7 @@ void unset_nmi_callback(void)
nmi_callback = dummy_nmi_callback;
}

asmlinkage void do_device_not_available(struct cpu_user_regs *regs)
void do_device_not_available(struct cpu_user_regs *regs)
{
struct vcpu *curr = current;

Expand All @@ -3142,7 +3142,7 @@ asmlinkage void do_device_not_available(struct cpu_user_regs *regs)
return;
}

asmlinkage void do_debug(struct cpu_user_regs *regs)
void do_debug(struct cpu_user_regs *regs)
{
struct vcpu *v = current;

Expand Down Expand Up @@ -3195,7 +3195,7 @@ asmlinkage void do_debug(struct cpu_user_regs *regs)
return;
}

asmlinkage void do_spurious_interrupt_bug(struct cpu_user_regs *regs)
void do_spurious_interrupt_bug(struct cpu_user_regs *regs)
{
}

Expand Down
6 changes: 3 additions & 3 deletions xen/arch/x86/x86_32/traps.c
Expand Up @@ -195,7 +195,7 @@ DEFINE_PER_CPU_READ_MOSTLY(struct tss_struct *, doublefault_tss);
static unsigned char __attribute__ ((__section__ (".bss.page_aligned")))
boot_cpu_doublefault_space[PAGE_SIZE];

asmlinkage void do_double_fault(void)
void do_double_fault(void)
{
struct tss_struct *tss;
unsigned int cpu;
Expand Down Expand Up @@ -301,7 +301,7 @@ static void set_task_gate(unsigned int n, unsigned int sel)
void __devinit subarch_percpu_traps_init(void)
{
struct tss_struct *tss = this_cpu(doublefault_tss);
asmlinkage int hypercall(void);
int hypercall(void);

if ( !tss )
{
Expand Down Expand Up @@ -512,7 +512,7 @@ long do_set_callbacks(unsigned long event_selector,

static void hypercall_page_initialise_ring0_kernel(void *hypercall_page)
{
extern asmlinkage int hypercall(void);
extern int hypercall(void);
char *p;
int i;

Expand Down
12 changes: 6 additions & 6 deletions xen/arch/x86/x86_64/traps.c
Expand Up @@ -23,10 +23,10 @@
#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);
void syscall_enter(void);
void sysenter_entry(void);
void compat_hypercall(void);
void int80_direct_trap(void);

static void print_xen_info(void)
{
Expand Down Expand Up @@ -215,8 +215,8 @@ void show_page_walk(unsigned long addr)
l1_table_offset(addr), l1e_get_intpte(l1e), pfn);
}

asmlinkage void double_fault(void);
asmlinkage void do_double_fault(struct cpu_user_regs *regs)
void double_fault(void);
void do_double_fault(struct cpu_user_regs *regs)
{
unsigned int cpu;

Expand Down
6 changes: 2 additions & 4 deletions xen/include/asm-x86/config.h
Expand Up @@ -110,13 +110,13 @@ extern char wakeup_start[];
extern unsigned int video_mode, video_flags;
#endif

#define asmlinkage

#if defined(__x86_64__)

#define CONFIG_X86_64 1
#define CONFIG_COMPAT 1

#define asmlinkage

#define PML4_ENTRY_BITS 39
#ifndef __ASSEMBLY__
#define PML4_ENTRY_BYTES (1UL << PML4_ENTRY_BITS)
Expand Down Expand Up @@ -277,8 +277,6 @@ extern unsigned int video_mode, video_flags;
#define CONFIG_X86_32 1
#define CONFIG_DOMAIN_PAGE 1

#define asmlinkage __attribute__((regparm(0)))

/*
* Memory layout (high to low): PAE-SIZE
* ------
Expand Down
2 changes: 1 addition & 1 deletion xen/include/asm-x86/irq.h
Expand Up @@ -86,7 +86,7 @@ fastcall void smp_thermal_interrupt(struct cpu_user_regs *regs);
fastcall void smp_cmci_interrupt(struct cpu_user_regs *regs);
fastcall void smp_irq_move_cleanup_interrupt(struct cpu_user_regs *regs);

asmlinkage void do_IRQ(struct cpu_user_regs *regs);
void do_IRQ(struct cpu_user_regs *regs);

void disable_8259A_irq(unsigned int irq);
void enable_8259A_irq(unsigned int irq);
Expand Down
4 changes: 2 additions & 2 deletions xen/include/asm-x86/processor.h
Expand Up @@ -538,7 +538,7 @@ void show_registers(struct cpu_user_regs *regs);
void show_execution_state(struct cpu_user_regs *regs);
#define dump_execution_state() run_in_exception_handler(show_execution_state)
void show_page_walk(unsigned long addr);
asmlinkage void fatal_trap(int trapnr, struct cpu_user_regs *regs);
void fatal_trap(int trapnr, struct cpu_user_regs *regs);

#ifdef CONFIG_COMPAT
void compat_show_guest_stack(struct vcpu *, struct cpu_user_regs *, int lines);
Expand All @@ -550,7 +550,7 @@ extern void mtrr_ap_init(void);
extern void mtrr_bp_init(void);

void mcheck_init(struct cpuinfo_x86 *c);
asmlinkage void do_machine_check(struct cpu_user_regs *regs);
void do_machine_check(struct cpu_user_regs *regs);
void cpu_mcheck_distribute_cmci(void);
void cpu_mcheck_disable(void);

Expand Down
2 changes: 1 addition & 1 deletion xen/include/asm-x86/x86_32/asm_defns.h
Expand Up @@ -135,7 +135,7 @@ __asm__( \
#define IRQ_NAME(nr) IRQ_NAME2(IRQ##nr)

#define BUILD_IRQ(nr) \
asmlinkage void IRQ_NAME(nr); \
void IRQ_NAME(nr); \
__asm__( \
"\n"__ALIGN_STR"\n" \
STR(IRQ) #nr "_interrupt:\n\t" \
Expand Down
2 changes: 1 addition & 1 deletion xen/include/asm-x86/x86_64/asm_defns.h
Expand Up @@ -113,7 +113,7 @@ __asm__( \
#define IRQ_NAME(nr) IRQ_NAME2(IRQ##nr)

#define BUILD_IRQ(nr) \
asmlinkage void IRQ_NAME(nr); \
void IRQ_NAME(nr); \
__asm__( \
"\n"__ALIGN_STR"\n" \
STR(IRQ) #nr "_interrupt:\n\t" \
Expand Down

0 comments on commit c0d8fe1

Please sign in to comment.