x86: reduce scope of some symbols used with reset_stack_and_jump()
authorJan Beulich <jbeulich@suse.com>
Wed, 21 Dec 2011 13:26:09 +0000 (14:26 +0100)
committerJan Beulich <jbeulich@suse.com>
Wed, 21 Dec 2011 13:26:09 +0000 (14:26 +0100)
By making the macro properly advertise the use of the input symbol to
the compiler, it is no longer necessary for them to be global if
they're defined and used in just one source file.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Keir Fraser <keir@xen.org>
xen/arch/x86/domain.c
xen/arch/x86/hvm/svm/svm.c
xen/arch/x86/setup.c
xen/include/asm-x86/asm_defns.h
xen/include/asm-x86/current.h
xen/include/asm-x86/setup.h

index b8a64c39ece952d70007bb31332d64a27589814f..532c0ec37907b33e1a2cccce47ad01c6dcdee713 100644 (file)
@@ -74,17 +74,6 @@ static void paravirt_ctxt_switch_to(struct vcpu *v);
 
 static void vcpu_destroy_pagetables(struct vcpu *v);
 
-static void continue_idle_domain(struct vcpu *v)
-{
-    reset_stack_and_jump(idle_loop);
-}
-
-static void continue_nonidle_domain(struct vcpu *v)
-{
-    check_wakeup_from_wait();
-    reset_stack_and_jump(ret_from_intr);
-}
-
 static void default_idle(void)
 {
     local_irq_disable();
@@ -118,7 +107,7 @@ static void play_dead(void)
     (*dead_idle)();
 }
 
-void idle_loop(void)
+static void idle_loop(void)
 {
     for ( ; ; )
     {
@@ -141,6 +130,17 @@ void startup_cpu_idle_loop(void)
     reset_stack_and_jump(idle_loop);
 }
 
+static void continue_idle_domain(struct vcpu *v)
+{
+    reset_stack_and_jump(idle_loop);
+}
+
+static void continue_nonidle_domain(struct vcpu *v)
+{
+    check_wakeup_from_wait();
+    reset_stack_and_jump(ret_from_intr);
+}
+
 void dump_pageframe_info(struct domain *d)
 {
     struct page_info *page;
index 016fdf3c0bbc286c60997e065621b628bd62f1f5..6986f4a97f55ee6ace2f44fccbe04fe2df0b4af1 100644 (file)
@@ -63,6 +63,8 @@
 #include <asm/debugger.h>
 #include <asm/xstate.h>
 
+void svm_asm_do_resume(void);
+
 u32 svm_feature_flags;
 
 /* Indicates whether guests may use EFER.LMSLE. */
index 32b20c28efa2c330b65426bf4a9b82a86dc80ed1..ae236c94c3e3bdd712be94ea2ae37daec8c45b03 100644 (file)
@@ -508,7 +508,7 @@ static void __init kexec_reserve_area(struct e820map *e820)
     }
 }
 
-void init_done(void)
+static void noinline init_done(void)
 {
     /* Free (or page-protect) the init areas. */
     memset(__init_begin, 0xcc, __init_end - __init_begin); /* int3 poison */
index ca6152e64ab28065d427a2724197219e90c3866d..e6a710ee0ff038090c5f1f6f7eefcb0a654e4c04 100644 (file)
@@ -8,6 +8,10 @@
 #endif
 #include <asm/processor.h>
 
+#ifndef __ASSEMBLY__
+void ret_from_intr(void);
+#endif
+
 #ifdef __x86_64__
 #include <asm/x86_64/asm_defns.h>
 #else
index bed04f1c249597f832e4d168c63765e9f3690e72..017d4b7106576e6cfb99b0598f83dbe33fc9be6c 100644 (file)
@@ -56,8 +56,8 @@ static inline struct cpu_info *get_cpu_info(void)
 
 #define reset_stack_and_jump(__fn)              \
     __asm__ __volatile__ (                      \
-        "mov %0,%%"__OP"sp; jmp "STR(__fn)      \
-        : : "r" (guest_cpu_user_regs()) : "memory" )
+        "mov %0,%%"__OP"sp; jmp %c1"            \
+        : : "r" (guest_cpu_user_regs()), "i" (__fn) : "memory" )
 
 #define schedule_tail(vcpu) (((vcpu)->arch.schedule_tail)(vcpu))
 
index b684f0134812f27382e441eab2d78193bf53e531..aeabb50423416f8cb61ba164bf6b371c823f867c 100644 (file)
@@ -7,8 +7,6 @@
 extern bool_t early_boot;
 extern unsigned long xenheap_initial_phys_start;
 
-void init_done(void);
-
 void early_cpu_init(void);
 void early_time_init(void);
 void early_page_fault(void);