Matthew Fioravante
2011-Mar-11 22:44 UTC
[Xen-devel] [PATCH 4/12] VTPM mini-os: Mini-os machine specific headers
This patch adds endian.h and byteorder.h to mini-os. endian.h defines __BYTE_ORDER similar to how its done on linux and __WORDSIZE. byteorder.h defines the standard macros for cpu_to_be and friends for 16,32, and 64 bit. The bswap inlines in byteswap.h were changed to macros to allow use in some initializer statements. A check is added to check gcc versions to use optimized gcc builtins if they are available. Signed off by: Matthew Fioravante <matthew.fioravante@jhuapl.edu> _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
Samuel Thibault
2011-Mar-12 00:31 UTC
Re: [Xen-devel] [PATCH 4/12] VTPM mini-os: Mini-os machine specific headers
Matthew Fioravante, le Fri 11 Mar 2011 17:44:01 -0500, a écrit :> +/* Use gcc optimized versions if they exist */ > +#if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3) > +#define bswap_32(v) __builtin_bswap32(v) > +#define bswap_64(v) __builtin_bswap32(v)Typo here, right? Samuel _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
Stefano Stabellini
2011-Mar-14 12:22 UTC
Re: [Xen-devel] [PATCH 4/12] VTPM mini-os: Mini-os machine specific headers
On Fri, 11 Mar 2011, Matthew Fioravante wrote:> diff -Naur xen-unstable-trp-sdp-pristine/extras/mini-os/include/endian.h xen-unstable-trp-sdp/extras/mini-os/include/endian.h > --- xen-unstable-trp-sdp-pristine/extras/mini-os/include/endian.h 1969-12-31 19:00:00.000000000 -0500 > +++ xen-unstable-trp-sdp/extras/mini-os/include/endian.h 2011-02-23 19:40:48.000000000 -0500 > @@ -0,0 +1,53 @@ > +/* Copyright (C) 1992, 1996, 1997, 2000, 2008 Free Software Foundation, Inc. > + This file is part of the GNU C Library. > + > + The GNU C Library is free software; you can redistribute it and/or > + modify it under the terms of the GNU Lesser General Public > + License as published by the Free Software Foundation; either > + version 2.1 of the License, or (at your option) any later version. > + > + The GNU C Library is distributed in the hope that it will be useful, > + but WITHOUT ANY WARRANTY; without even the implied warranty of > + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU > + Lesser General Public License for more details. > + > + You should have received a copy of the GNU Lesser General Public > + License along with the GNU C Library; if not, write to the Free > + Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA > + 02111-1307 USA. */ > +MiniOS is BSD and we would like to keep it that way.> diff -Naur xen-unstable-trp-sdp-pristine/extras/mini-os/include/ia64/arch_endian.h xen-unstable-trp-sdp/extras/mini-os/include/ia64/arch_endian.h > --- xen-unstable-trp-sdp-pristine/extras/mini-os/include/ia64/arch_endian.h 1969-12-31 19:00:00.000000000 -0500 > +++ xen-unstable-trp-sdp/extras/mini-os/include/ia64/arch_endian.h 2011-02-23 19:40:48.000000000 -0500 > @@ -0,0 +1,25 @@ > +/* Copyright (C) 1992, 1996, 1997, 2000, 2008 Free Software Foundation, Inc. > + This file is part of the GNU C Library. > + > + The GNU C Library is free software; you can redistribute it and/or > + modify it under the terms of the GNU Lesser General Public > + License as published by the Free Software Foundation; either > + version 2.1 of the License, or (at your option) any later version. > + > + The GNU C Library is distributed in the hope that it will be useful, > + but WITHOUT ANY WARRANTY; without even the implied warranty of > + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU > + Lesser General Public License for more details. > + > + You should have received a copy of the GNU Lesser General Public > + License along with the GNU C Library; if not, write to the Free > + Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA > + 02111-1307 USA. */ > +ditto>> diff -Naur xen-unstable-trp-sdp-pristine/extras/mini-os/include/x86/arch_endian.h xen-unstable-trp-sdp/extras/mini-os/include/x86/arch_endian.h > --- xen-unstable-trp-sdp-pristine/extras/mini-os/include/x86/arch_endian.h 1969-12-31 19:00:00.000000000 -0500 > +++ xen-unstable-trp-sdp/extras/mini-os/include/x86/arch_endian.h 2011-02-23 19:40:48.000000000 -0500 > @@ -0,0 +1,25 @@ > +/* Copyright (C) 1992, 1996, 1997, 2000, 2008 Free Software Foundation, Inc. > + This file is part of the GNU C Library. > + > + The GNU C Library is free software; you can redistribute it and/or > + modify it under the terms of the GNU Lesser General Public > + License as published by the Free Software Foundation; either > + version 2.1 of the License, or (at your option) any later version. > + > + The GNU C Library is distributed in the hope that it will be useful, > + but WITHOUT ANY WARRANTY; without even the implied warranty of > + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU > + Lesser General Public License for more details. > + > + You should have received a copy of the GNU Lesser General Public > + License along with the GNU C Library; if not, write to the Free > + Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA > + 02111-1307 USA. */ditto _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
Matthew Fioravante
2011-Mar-14 15:47 UTC
Re: [Xen-devel] [PATCH 4/12] VTPM mini-os: Mini-os machine specific headers
I copied the header from the Linux system. Its a very simple header file. Can we just change the license or does our implementation have to significantly different? On 03/14/2011 08:22 AM, Stefano Stabellini wrote:> On Fri, 11 Mar 2011, Matthew Fioravante wrote: >> diff -Naur xen-unstable-trp-sdp-pristine/extras/mini-os/include/endian.h xen-unstable-trp-sdp/extras/mini-os/include/endian.h >> --- xen-unstable-trp-sdp-pristine/extras/mini-os/include/endian.h 1969-12-31 19:00:00.000000000 -0500 >> +++ xen-unstable-trp-sdp/extras/mini-os/include/endian.h 2011-02-23 19:40:48.000000000 -0500 >> @@ -0,0 +1,53 @@ >> +/* Copyright (C) 1992, 1996, 1997, 2000, 2008 Free Software Foundation, Inc. >> + This file is part of the GNU C Library. >> + >> + The GNU C Library is free software; you can redistribute it and/or >> + modify it under the terms of the GNU Lesser General Public >> + License as published by the Free Software Foundation; either >> + version 2.1 of the License, or (at your option) any later version. >> + >> + The GNU C Library is distributed in the hope that it will be useful, >> + but WITHOUT ANY WARRANTY; without even the implied warranty of >> + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU >> + Lesser General Public License for more details. >> + >> + You should have received a copy of the GNU Lesser General Public >> + License along with the GNU C Library; if not, write to the Free >> + Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA >> + 02111-1307 USA. */ >> + > MiniOS is BSD and we would like to keep it that way. > > >> diff -Naur xen-unstable-trp-sdp-pristine/extras/mini-os/include/ia64/arch_endian.h xen-unstable-trp-sdp/extras/mini-os/include/ia64/arch_endian.h >> --- xen-unstable-trp-sdp-pristine/extras/mini-os/include/ia64/arch_endian.h 1969-12-31 19:00:00.000000000 -0500 >> +++ xen-unstable-trp-sdp/extras/mini-os/include/ia64/arch_endian.h 2011-02-23 19:40:48.000000000 -0500 >> @@ -0,0 +1,25 @@ >> +/* Copyright (C) 1992, 1996, 1997, 2000, 2008 Free Software Foundation, Inc. >> + This file is part of the GNU C Library. >> + >> + The GNU C Library is free software; you can redistribute it and/or >> + modify it under the terms of the GNU Lesser General Public >> + License as published by the Free Software Foundation; either >> + version 2.1 of the License, or (at your option) any later version. >> + >> + The GNU C Library is distributed in the hope that it will be useful, >> + but WITHOUT ANY WARRANTY; without even the implied warranty of >> + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU >> + Lesser General Public License for more details. >> + >> + You should have received a copy of the GNU Lesser General Public >> + License along with the GNU C Library; if not, write to the Free >> + Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA >> + 02111-1307 USA. */ >> + > ditto > >>> diff -Naur xen-unstable-trp-sdp-pristine/extras/mini-os/include/x86/arch_endian.h xen-unstable-trp-sdp/extras/mini-os/include/x86/arch_endian.h >> --- xen-unstable-trp-sdp-pristine/extras/mini-os/include/x86/arch_endian.h 1969-12-31 19:00:00.000000000 -0500 >> +++ xen-unstable-trp-sdp/extras/mini-os/include/x86/arch_endian.h 2011-02-23 19:40:48.000000000 -0500 >> @@ -0,0 +1,25 @@ >> +/* Copyright (C) 1992, 1996, 1997, 2000, 2008 Free Software Foundation, Inc. >> + This file is part of the GNU C Library. >> + >> + The GNU C Library is free software; you can redistribute it and/or >> + modify it under the terms of the GNU Lesser General Public >> + License as published by the Free Software Foundation; either >> + version 2.1 of the License, or (at your option) any later version. >> + >> + The GNU C Library is distributed in the hope that it will be useful, >> + but WITHOUT ANY WARRANTY; without even the implied warranty of >> + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU >> + Lesser General Public License for more details. >> + >> + You should have received a copy of the GNU Lesser General Public >> + License along with the GNU C Library; if not, write to the Free >> + Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA >> + 02111-1307 USA. */ > ditto >_______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
Stefano Stabellini
2011-Mar-14 15:48 UTC
Re: [Xen-devel] [PATCH 4/12] VTPM mini-os: Mini-os machine specific headers
On Mon, 14 Mar 2011, Matthew Fioravante wrote:> I copied the header from the Linux system. Its a very simple header file. Can > we just change the license or does our implementation have to significantly > different?You cannot change the license of a Linux header file, but you can copy the header from a BSD system instead. _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
Matthew Fioravante
2011-Mar-14 17:02 UTC
Re: [Xen-devel] [PATCH 4/12] VTPM mini-os: Mini-os machine specific headers
Which part? The check for gcc version >= 4.3 or the #defines for bswap_XX? I think its correct On 03/11/2011 07:31 PM, Samuel Thibault wrote:> Matthew Fioravante, le Fri 11 Mar 2011 17:44:01 -0500, a écrit : >> +/* Use gcc optimized versions if they exist */ >> +#if __GNUC__> 4 || (__GNUC__ == 4&& __GNUC_MINOR__>= 3) >> +#define bswap_32(v) __builtin_bswap32(v) >> +#define bswap_64(v) __builtin_bswap32(v) > Typo here, right? > > Samuel_______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
Samuel Thibault
2011-Mar-14 17:35 UTC
Re: [Xen-devel] [PATCH 4/12] VTPM mini-os: Mini-os machine specific headers
Matthew Fioravante, le Mon 14 Mar 2011 13:02:24 -0400, a écrit :> Which part? The check for gcc version >= 4.3 or the #defines for bswap_XX? > > I think its correctThe 64bit #define. If it''s really meant to be using __builtin_bswap32 instead of __builtin_bswap64, a comment should say why :)> On 03/11/2011 07:31 PM, Samuel Thibault wrote: > >Matthew Fioravante, le Fri 11 Mar 2011 17:44:01 -0500, a écrit : > >>+/* Use gcc optimized versions if they exist */ > >>+#if __GNUC__> 4 || (__GNUC__ == 4&& __GNUC_MINOR__>= 3) > >>+#define bswap_32(v) __builtin_bswap32(v) > >>+#define bswap_64(v) __builtin_bswap32(v) > >Typo here, right?Samuel _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel