Re: [Xen-devel] [MINIOS PATCH 1/3] Introduce asm_macros.h

2016-08-20 Thread Samuel Thibault
Juergen Gross, on Thu 18 Aug 2016 12:34:48 +0200, wrote:
> On 18/08/16 12:15, Wei Liu wrote:
> > Ported from Xen Test Framework project (BSD license).
> > 
> > Signed-off-by: Wei Liu 
> 
> Reviewed-by: Juergen Gross 

Acked-by: Samuel Thibault 

___
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel


Re: [Xen-devel] [MINIOS PATCH 1/3] Introduce asm_macros.h

2016-08-18 Thread Juergen Gross
On 18/08/16 12:15, Wei Liu wrote:
> Ported from Xen Test Framework project (BSD license).
> 
> Signed-off-by: Wei Liu 

Reviewed-by: Juergen Gross 


___
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel


[Xen-devel] [MINIOS PATCH 1/3] Introduce asm_macros.h

2016-08-18 Thread Wei Liu
Ported from Xen Test Framework project (BSD license).

Signed-off-by: Wei Liu 
---
v2: Provide a stub for ARM
---
 include/arm/asm_macros.h | 14 ++
 include/asm_macros.h | 40 
 include/x86/asm_macros.h | 28 
 3 files changed, 82 insertions(+)
 create mode 100644 include/arm/asm_macros.h
 create mode 100644 include/asm_macros.h
 create mode 100644 include/x86/asm_macros.h

diff --git a/include/arm/asm_macros.h b/include/arm/asm_macros.h
new file mode 100644
index 000..8b8dafe
--- /dev/null
+++ b/include/arm/asm_macros.h
@@ -0,0 +1,14 @@
+#ifndef _ARM_ASM_MACRO_H_
+#define _ARM_ASM_MACRO_H_
+
+#endif /* _ARM_ASM_MACRO_H_ */
+
+/*
+ * Local variables:
+ * mode: C
+ * c-file-style: "BSD"
+ * c-basic-offset: 4
+ * tab-width: 4
+ * indent-tabs-mode: nil
+ * End:
+ */
diff --git a/include/asm_macros.h b/include/asm_macros.h
new file mode 100644
index 000..0e34090
--- /dev/null
+++ b/include/asm_macros.h
@@ -0,0 +1,40 @@
+/*
+ * Macros for assembly files.
+ */
+
+#ifndef _ASM_MACRO_H_
+#define _ASM_MACRO_H_
+
+#if defined(__i386__) || defined(__x86_64__)
+#include 
+#elif defined(__arm__) || defined(__aarch64__)
+#include 
+#endif
+
+#ifdef __ASSEMBLY__
+
+#define ELFNOTE(name, type, desc)   \
+.pushsection .note.name   ; \
+.align 4  ; \
+.long 2f - 1f   /* namesz */  ; \
+.long 4f - 3f   /* descsz */  ; \
+.long type  /* type   */  ; \
+1:.asciz #name  /* name   */  ; \
+2:.align 4; \
+3:desc  /* desc   */  ; \
+4:.align 4; \
+.popsection
+
+#endif  /* __ASSEMBLY__ */
+
+#endif  /* _ASM_MACRO_H_ */
+
+/*
+ * Local variables:
+ * mode: C
+ * c-file-style: "BSD"
+ * c-basic-offset: 4
+ * tab-width: 4
+ * indent-tabs-mode: nil
+ * End:
+ */
diff --git a/include/x86/asm_macros.h b/include/x86/asm_macros.h
new file mode 100644
index 000..e718e0b
--- /dev/null
+++ b/include/x86/asm_macros.h
@@ -0,0 +1,28 @@
+#ifndef _X86_ASM_MACRO_H_
+#define _X86_ASM_MACRO_H_
+
+#ifdef  __ASSEMBLY__
+# if defined(__x86_64__)
+#  define _WORD .quad
+# elif defined(__i386__)
+#  define _WORD .long
+# endif
+#else
+# if defined(__x86_64__)
+#  define _WORD ".quad"
+# elif defined(__i386__)
+#  define _WORD ".long"
+# endif
+#endif
+
+#endif /* _X86_ASM_MACRO_H_ */
+
+/*
+ * Local variables:
+ * mode: C
+ * c-file-style: "BSD"
+ * c-basic-offset: 4
+ * tab-width: 4
+ * indent-tabs-mode: nil
+ * End:
+ */
-- 
2.1.4


___
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel