]> xenbits.xensource.com Git - people/andrewcoop/xen-test-framework.git/commitdiff
xtf: Perform misc code cleanup
authorMichal Orzel <michal.orzel@arm.com>
Wed, 10 Mar 2021 10:43:32 +0000 (11:43 +0100)
committerAndrew Cooper <andrew.cooper3@citrix.com>
Tue, 13 Apr 2021 23:30:27 +0000 (00:30 +0100)
 * Define macro ALIGN to set alignment.  Header file asm_macros.h should not
   contain architecture specific code.  Replace hardcoded alignment value with
   a call to macro ALIGN.

 * Move declaration of shared_info into xtf/traps.h.  Declaration of
   shared_info structure should be placed in xtf/traps.h as it is a common
   declaration for all the possible architectures.

 * Do not protect including <arch/barrier.h>.  We should always include
   <arch/barrier.h> and rely on the compiler to throw an error. This would
   avoid increasing #if protection each time we would add a new architecture.

Signed-off-by: Michal Orzel <michal.orzel@arm.com>
Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
arch/x86/include/arch/asm_macros.h
arch/x86/include/arch/traps.h
include/xtf/asm_macros.h
include/xtf/barrier.h
include/xtf/traps.h

index e12e1ba2bc4fc425eb77cff3e819fff6148bd26e..1aabed567e18653bf8959ec93dc51f556f2bb7ef 100644 (file)
@@ -15,6 +15,8 @@
 # define __ASM_CODE_RAW(x) #x
 #endif
 
+#define ALIGN .align 16
+
 /* Select between two variations based on compat or long mode. */
 #ifdef __i386__
 # define __ASM_SEL(c, l)     __ASM_CODE(c)
index 0c6888b6a09f549dfed0342473a9659d5df750ca..60fc3a4c9772685a994c479b1c0115dfc5943bb5 100644 (file)
@@ -57,7 +57,6 @@ extern uint8_t user_stack[PAGE_SIZE];
 
 extern xen_pv_start_info_t *pv_start_info;
 extern xen_pvh_start_info_t *pvh_start_info;
-extern shared_info_t shared_info;
 
 /*
  * Parameters for fine tuning the exec_user_*() behaviour.
index 5484f7cac466e8d3c7c00a6030daaa32eb0718cc..c5313555ee007adc9fd63f9f1751b5690fa4d830 100644 (file)
@@ -25,7 +25,7 @@ name:
  * @param name Function name.
  */
 #define ENTRY(name)                             \
-    .align 16;                                  \
+    ALIGN;                                      \
     GLOBAL(name)
 
 /**
index b526fe1bd510e87d2483f6b9ec5ae1467014e2d8..3b02d4951396cb9d89b525121a5f27c58f18a889 100644 (file)
@@ -1,11 +1,7 @@
 #ifndef XTF_BARRIER_H
 #define XTF_BARRIER_H
 
-#if defined(__x86_64__) || defined (__i386__)
 # include <arch/barrier.h>
-#else
-# error Bad architecture
-#endif
 
 #endif /* XTF_BARRIER_H */
 
index 8fc66af92ad9e129133e50ee90bd188ad482b757..4081db6e2675cc127106953c7c15718a229d6fa7 100644 (file)
@@ -6,6 +6,8 @@
 
 #include <arch/traps.h>
 
+extern shared_info_t shared_info;
+
 /**
  * May be implemented by a guest to provide custom exception handling.
  */