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

2016-08-17 Thread Wei Liu
On Wed, Aug 17, 2016 at 03:03:44PM +0100, Wei Liu wrote:
> On Wed, Aug 17, 2016 at 03:01:07PM +0100, Andrew Cooper wrote:
> > On 17/08/16 13:35, Wei Liu wrote:
> > > diff --git a/include/asm_macros.h b/include/asm_macros.h
> > > new file mode 100644
> > > index 000..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 
> > 
> > This presumably should be , and a stub file
> > for ARM ?
> > 
> 
> Don't want to rearrange build system and directory hierarchy just yet.

Oops, I misunderstood. I think your suggestion on arch_asm_macros.h is
sensible.

Wei.

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


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

2016-08-17 Thread Wei Liu
On Wed, Aug 17, 2016 at 03:01:07PM +0100, Andrew Cooper wrote:
> On 17/08/16 13:35, Wei Liu wrote:
> > diff --git a/include/asm_macros.h b/include/asm_macros.h
> > new file mode 100644
> > index 000..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 
> 
> This presumably should be , and a stub file
> for ARM ?
> 

Don't want to rearrange build system and directory hierarchy just yet.

Good point on ARM stub, though. I will add one for ARM.

Wei.

> ~Andrew

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


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

2016-08-17 Thread Andrew Cooper
On 17/08/16 13:35, Wei Liu wrote:
> diff --git a/include/asm_macros.h b/include/asm_macros.h
> new file mode 100644
> index 000..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 

This presumably should be , and a stub file
for ARM ?

~Andrew

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


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

2016-08-17 Thread Andrew Cooper
On 17/08/16 14:40, Wei Liu wrote:
> On Wed, Aug 17, 2016 at 02:56:00PM +0200, Samuel Thibault wrote:
>> Hello,
>>
>> Wei Liu, on Wed 17 Aug 2016 13:35:12 +0100, wrote:
>>> Ported from xtf.git.
>> What is xtf.git? Does it use the same BSD licencing?
>> To my knowledge this is coming from the linux kernel source.
> This:
> http://xenbits.xen.org/gitweb/?p=people/andrewcoop/xen-test-framework.git;a=summary
>
> The official repository is not yet ready. That project is BSD licensed.
>
> Andrew, can you clarify whether you copied this from Linux by mistake?

This definitely isn't Linux.  Their version is unnecessarily complicated.

I wrote this code myself, but there are only so many ways of arranging
the construction of a legal note field in a readable way.

Arguably, my code actually looks closer to its FreeBSD equivalent than
Linux.

~Andrew

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


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

2016-08-17 Thread Wei Liu
On Wed, Aug 17, 2016 at 02:40:09PM +0100, Wei Liu wrote:
> On Wed, Aug 17, 2016 at 02:56:00PM +0200, Samuel Thibault wrote:
> > Hello,
> > 
> > Wei Liu, on Wed 17 Aug 2016 13:35:12 +0100, wrote:
> > > Ported from xtf.git.
> > 
> > What is xtf.git? Does it use the same BSD licencing?
> > To my knowledge this is coming from the linux kernel source.
> 
> This:
> http://xenbits.xen.org/gitweb/?p=people/andrewcoop/xen-test-framework.git;a=summary
> 
> The official repository is not yet ready. That project is BSD licensed.
> 
> Andrew, can you clarify whether you copied this from Linux by mistake?
> 

Actually I think FreeBSD has similar construct in
i386/include/asmacros.h. We should be fine here.

Wei.

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


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

2016-08-17 Thread Wei Liu
On Wed, Aug 17, 2016 at 02:56:00PM +0200, Samuel Thibault wrote:
> Hello,
> 
> Wei Liu, on Wed 17 Aug 2016 13:35:12 +0100, wrote:
> > Ported from xtf.git.
> 
> What is xtf.git? Does it use the same BSD licencing?
> To my knowledge this is coming from the linux kernel source.

This:
http://xenbits.xen.org/gitweb/?p=people/andrewcoop/xen-test-framework.git;a=summary

The official repository is not yet ready. That project is BSD licensed.

Andrew, can you clarify whether you copied this from Linux by mistake?

Wei.

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


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

2016-08-17 Thread Samuel Thibault
Hello,

Wei Liu, on Wed 17 Aug 2016 13:35:12 +0100, wrote:
> Ported from xtf.git.

What is xtf.git? Does it use the same BSD licencing?
To my knowledge this is coming from the linux kernel source.

> Signed-off-by: Wei Liu 
> ---
>  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 000..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 
> +
> +#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
> 

-- 
Samuel
"And the next time you consider complaining that running Lucid Emacs
19.05 via NFS from a remote Linux machine in Paraguay doesn't seem to
get the background colors right, you'll know who to thank."
(By Matt Welsh)

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


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

2016-08-17 Thread Wei Liu
Ported from xtf.git.

Signed-off-by: Wei Liu 
---
 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 000..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 
+
+#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