From: Michal Orzel Date: Wed, 10 Mar 2021 10:43:32 +0000 (+0100) Subject: xtf: Perform misc code cleanup X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=4288d41183a6a14f328504d8b206ea27e9981266;p=people%2Fandrewcoop%2Fxen-test-framework.git xtf: Perform misc code cleanup * 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 . We should always include 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 Reviewed-by: Andrew Cooper --- diff --git a/arch/x86/include/arch/asm_macros.h b/arch/x86/include/arch/asm_macros.h index e12e1ba..1aabed5 100644 --- a/arch/x86/include/arch/asm_macros.h +++ b/arch/x86/include/arch/asm_macros.h @@ -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) diff --git a/arch/x86/include/arch/traps.h b/arch/x86/include/arch/traps.h index 0c6888b..60fc3a4 100644 --- a/arch/x86/include/arch/traps.h +++ b/arch/x86/include/arch/traps.h @@ -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. diff --git a/include/xtf/asm_macros.h b/include/xtf/asm_macros.h index 5484f7c..c531355 100644 --- a/include/xtf/asm_macros.h +++ b/include/xtf/asm_macros.h @@ -25,7 +25,7 @@ name: * @param name Function name. */ #define ENTRY(name) \ - .align 16; \ + ALIGN; \ GLOBAL(name) /** diff --git a/include/xtf/barrier.h b/include/xtf/barrier.h index b526fe1..3b02d49 100644 --- a/include/xtf/barrier.h +++ b/include/xtf/barrier.h @@ -1,11 +1,7 @@ #ifndef XTF_BARRIER_H #define XTF_BARRIER_H -#if defined(__x86_64__) || defined (__i386__) # include -#else -# error Bad architecture -#endif #endif /* XTF_BARRIER_H */ diff --git a/include/xtf/traps.h b/include/xtf/traps.h index 8fc66af..4081db6 100644 --- a/include/xtf/traps.h +++ b/include/xtf/traps.h @@ -6,6 +6,8 @@ #include +extern shared_info_t shared_info; + /** * May be implemented by a guest to provide custom exception handling. */