From: Wei Liu <wei.liu2@citrix.com>
To: Minios-devel <minios-devel@lists.xenproject.org>
Cc: Juergen Gross <jgross@suse.com>,
Xen-devel <xen-devel@lists.xenproject.org>,
Wei Liu <wei.liu2@citrix.com>,
Samuel Thibault <samuel.thibault@ens-lyon.org>
Subject: [MINIOS PATCH 1/3] Introduce asm_macros.h
Date: Thu, 18 Aug 2016 11:15:24 +0100 [thread overview]
Message-ID: <1471515326-4610-2-git-send-email-wei.liu2@citrix.com> (raw)
In-Reply-To: <1471515326-4610-1-git-send-email-wei.liu2@citrix.com>
Ported from Xen Test Framework project (BSD license).
Signed-off-by: Wei Liu <wei.liu2@citrix.com>
---
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 0000000..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 0000000..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 <x86/asm_macros.h>
+#elif defined(__arm__) || defined(__aarch64__)
+#include <arm/asm_macros.h>
+#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 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@lists.xen.org
https://lists.xen.org/xen-devel
next prev parent reply other threads:[~2016-08-18 10:15 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-08-18 10:15 [MINIOS PATCH 0/3] x86: use ELF notes and unified linker script Wei Liu
2016-08-18 10:15 ` Wei Liu [this message]
2016-08-18 10:34 ` [MINIOS PATCH 1/3] Introduce asm_macros.h Juergen Gross
2016-08-20 11:03 ` Samuel Thibault
2016-08-18 10:15 ` [MINIOS PATCH 2/3] x86: switch to use elfnote Wei Liu
2016-08-20 11:04 ` Samuel Thibault
2016-08-18 10:15 ` [MINIOS PATCH 3/3] x86: use unified linker script Wei Liu
2016-08-18 10:39 ` Juergen Gross
2016-08-20 11:05 ` Samuel Thibault
2016-08-18 10:20 ` [MINIOS PATCH 0/3] x86: use ELF notes and " Andrew Cooper
2016-08-22 9:41 ` Wei Liu
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1471515326-4610-2-git-send-email-wei.liu2@citrix.com \
--to=wei.liu2@citrix.com \
--cc=jgross@suse.com \
--cc=minios-devel@lists.xenproject.org \
--cc=samuel.thibault@ens-lyon.org \
--cc=xen-devel@lists.xenproject.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).