[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-devel] [MINIOS PATCH 2/4] Introduce asm_macros.h



Ported from xtf.git.

Signed-off-by: Wei Liu <wei.liu2@xxxxxxxxxx>
---
 include/asm_macros.h     | 36 ++++++++++++++++++++++++++++++++++++
 include/x86/asm_macros.h | 28 ++++++++++++++++++++++++++++
 2 files changed, 64 insertions(+)
 create mode 100644 include/asm_macros.h
 create mode 100644 include/x86/asm_macros.h

diff --git a/include/asm_macros.h b/include/asm_macros.h
new file mode 100644
index 0000000..15dd377
--- /dev/null
+++ b/include/asm_macros.h
@@ -0,0 +1,36 @@
+/*
+ * Macros for assembly files.
+ */
+
+#ifndef _ASM_MACRO_H_
+#define _ASM_MACRO_H_
+
+#include <x86/asm_macros.h>
+
+#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 0000000..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@xxxxxxxxxxxxx
https://lists.xen.org/xen-devel

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.