WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

Re: [Xen-devel] Suggested changes to xen/include from recent Linux

To: "Magenheimer, Dan (HP Labs Fort Collins)" <dan.magenheimer@xxxxxx>
Subject: Re: [Xen-devel] Suggested changes to xen/include from recent Linux
From: Hollis Blanchard <hollisb@xxxxxxxxxx>
Date: Mon, 11 Apr 2005 14:12:36 -0500
Cc: Xen-devel <xen-devel@xxxxxxxxxxxxxxxxxxx>
Delivery-date: Mon, 11 Apr 2005 19:14:45 +0000
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <516F50407E01324991DD6D07B0531AD535A94D@xxxxxxxxxxxxxxxxxxxxxxxxxxxxx>
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
Organization: IBM Linux Technology Center
References: <516F50407E01324991DD6D07B0531AD535A94D@xxxxxxxxxxxxxxxxxxxxxxxxxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
On Sat, 2005-04-09 at 13:42 -0700, Magenheimer, Dan (HP Labs Fort
Collins) wrote:
> As I mentioned at the xummit (spelling intended :-), a
> Xen/ia64 contributor from SGI (Greg Edwards) is updating
> the Xen/ia64 Linux dependencies from 2.6.7 to 2.6.11.
> This is now working, but he identified a couple places
> where it would make sense to modify common (include/xen)
> files.  So, rather than just "fix" them in ia64-specific
> files, I thought I would publish them for comment and to
> see if they might/should go into include/xen:

I agree, there should be a minimum of "fixing" generic code in
arch-specific files.

> 1) In include/xen/spinlock.h:
> 
> Linux has started using the following define:
> 
> #define DEFINE_SPINLOCK(x) spinlock_t x = SPIN_LOCK_UNLOCKED
> 
> I see that the construct could be used throughout xen/arch/x86
> as well... indeed there are TWO C files where a similar macro
> is defined but called DECLARE_MUTEX.
> 
> I propose adding the macro.

In general I don't see the need to cling to Linux code, but I can see
how your copy-and-patch scheme makes you more sensitive to this.

I don't see the harm in this particular case.

> 2) In include/xen/types.h:
> 
> Starting in 2.6.9, there are some new type-checking attributes and
> the following lines have been added to include/linux/types.h.  There's
> some explanation of it here:
> 
> http://kerneltrap.org/node/3848  (search for __bitwise)
> 
> Since Jimi mentioned a need for bi-endian support in Xen/ppc, I thought
> these might be added eventually anyway, so they could be added now
> to include/xen/type.s.

Apparently this was actually a statement about x86-64. LE support on PPC
is a second-class citizen, and current rumors aside I think only WinNT
has used it.

> I propose adding the lines (possibly including the comment verbatim?)
> 
> /*
>  * Below are truly Linux-specific types that should never collide with
>  * any application/library that wants linux/types.h.
>  */
> 
> #ifdef __CHECKER__
> #define __bitwise __attribute__((bitwise))
> #else
> #define __bitwise
> #endif
> 
> typedef __u16 __bitwise __le16;
> typedef __u16 __bitwise __be16;
> typedef __u32 __bitwise __le32;
> typedef __u32 __bitwise __be32;
> #if defined(__GNUC__) && !defined(__STRICT_ANSI__)
> typedef __u64 __bitwise __le64;
> typedef __u64 __bitwise __be64;
> #endif

Maybe this could be added along with the first users of these types?

-- 
Hollis Blanchard
IBM Linux Technology Center


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel

<Prev in Thread] Current Thread [Next in Thread>