]> xenbits.xensource.com Git - people/royger/xen-test-framework.git/commitdiff
Introduce ENDFUNC() and annotate ASM functions as such
authorAndrew Cooper <andrew.cooper3@citrix.com>
Fri, 22 Apr 2016 18:59:02 +0000 (19:59 +0100)
committerAndrew Cooper <andrew.cooper3@citrix.com>
Fri, 22 Apr 2016 18:59:02 +0000 (19:59 +0100)
Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
arch/x86/boot/head_hvm.S
arch/x86/boot/head_pv.S
arch/x86/entry_32.S
arch/x86/entry_64.S
include/xtf/asm_macros.h
tests/swint-emulation/lowlevel.S

index 466ca5cada878c61ee083efb0de215b2ebb99127..7f503d68e031a62150ddd0b52cb599c6e2f5b561 100644 (file)
@@ -79,7 +79,7 @@ GLOBAL(_start)                  /* HVM common setup. */
         push $main_err_msg
 #endif
         call panic
-SIZE(_start)
+ENDFUNC(_start)
 
 .section .rodata.str1, "aMS", @progbits, 1
 
index 9312fef64b45dc9469f559c087aa74116e425c03..cdb1b2ba44c9ed38ba36a5ba44feca467eb2e24a 100644 (file)
@@ -46,7 +46,7 @@ GLOBAL(_start)
         push $main_err_msg
 #endif
         call panic
-SIZE(_start)
+ENDFUNC(_start)
 
 .section .rodata.str1, "aMS", @progbits, 1
 
index 9f2fd51ecb419a7206b2e3ff4112d79e31f2a6ca..1ffedb7e624a48f9420e51f2defb6d54354cb641 100644 (file)
@@ -46,6 +46,8 @@ ENTRY(entry_\sym)
         push  $\vec
 
         jmp   handle_exception
+
+ENDFUNC(entry_\sym)
 .endm
 
 exception_entry DE  X86_EXC_DE
@@ -81,6 +83,7 @@ handle_exception:
         add $8, %esp            /* Pop error_code/entry_vector. */
 
         env_IRET
+ENDFUNC(handle_exception)
 
 
 ENTRY(entry_ret_to_kernel)      /* int $0x20 (return to kernel) */
@@ -91,6 +94,7 @@ ENTRY(entry_ret_to_kernel)      /* int $0x20 (return to kernel) */
         mov 3*4(%esp), %esp     /* Load %esp from iret frame  */
         jmp *%eax               /* Jump back                  */
 
+ENDFUNC(entry_ret_to_kernel)
 
 ENTRY(exec_user)                /* void (*fn)(void) */
 
@@ -113,6 +117,8 @@ ENTRY(exec_user)                /* void (*fn)(void) */
         int $0x20               /* Return to kernel privilege. */
         ret
 
+ENDFUNC(exec_user)
+
 /*
  * Local variables:
  * tab-width: 8
index d8f13e71eafbcf6cdb8a12f8e3d871f82e221a22..1154d9ce500a00f8485e2f472ecc29d081715eab 100644 (file)
@@ -61,6 +61,8 @@ ENTRY(entry_\sym)
         movl  $\vec, 4(%rsp)
 
         jmp   handle_exception
+
+ENDFUNC(entry_\sym)
 .endm
 
 exception_entry DE  X86_EXC_DE
@@ -95,6 +97,7 @@ handle_exception:
         add $8, %rsp            /* Pop error_code/entry_vector. */
 
         env_IRETQ
+ENDFUNC(handle_exception)
 
 
 ENTRY(entry_ret_to_kernel)      /* int $0x20 (return to kernel) */
@@ -104,6 +107,7 @@ ENTRY(entry_ret_to_kernel)      /* int $0x20 (return to kernel) */
         mov 3*8(%rsp), %rsp     /* Load %esp from iret frame  */
         jmp *%rax               /* Jump back                  */
 
+ENDFUNC(entry_ret_to_kernel)
 
 ENTRY(exec_user)                /* void (*fn)(void) */
 
@@ -126,6 +130,8 @@ ENTRY(exec_user)                /* void (*fn)(void) */
         int $0x20               /* Return to kernel privilege. */
         ret
 
+ENDFUNC(exec_user)
+
 /*
  * Local variables:
  * tab-width: 8
index 1de91aeb66f256b23ae2736176ae49707f7ef483..1806fa1a5d0cf5e2769d44abc499b08853f6b0db 100644 (file)
@@ -35,6 +35,14 @@ name:
 #define SIZE(name)                              \
     .size name, . - name;
 
+/**
+ * Set the type of @p name to function, and set its size.
+ * @param name Symbol name.
+ */
+#define ENDFUNC(name)                           \
+    .type name, STT_FUNC;                       \
+    SIZE(name)
+
 /**
  * Create an ELF note entry.
  *
index f2010b5af90210e7e7c4a244a210f35bc45138b8..67f0e61dff1d0bfeee635da0c880774f2d5f96bf 100644 (file)
@@ -70,6 +70,8 @@ GLOBAL(label_\insn\()_\type\()_trap)
         /* Fixup from fault label to trap label. */
         _ASM_EXTABLE(label_\insn\()_\type\()_fault,
                      label_\insn\()_\type\()_trap)
+
+ENDFUNC(stub_\insn\()_\type)
 .endm
 
         /* For a single instruction, generate each test variant. */