From mboxrd@z Thu Jan 1 00:00:00 1970 From: Andrew Cooper Subject: Re: [PATCH 01/11] mini-os: Make some headers more rumpkernel-friendly Date: Mon, 23 Jun 2014 11:32:27 +0100 Message-ID: <53A8023B.6040300@citrix.com> References: <1403291090-8657-1-git-send-email-ian.jackson@eu.citrix.com> <1403291090-8657-2-git-send-email-ian.jackson@eu.citrix.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mail6.bemta5.messagelabs.com ([195.245.231.135]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1Wz1Y9-0005qf-0D for xen-devel@lists.xenproject.org; Mon, 23 Jun 2014 10:32:33 +0000 In-Reply-To: <1403291090-8657-2-git-send-email-ian.jackson@eu.citrix.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Ian Jackson , xen-devel@lists.xenproject.org Cc: Samuel Thibault , Keir Fraser , Ian Campbell List-Id: xen-devel@lists.xenproject.org On 20/06/14 20:04, Ian Jackson wrote: > Signed-off-by: Ian Jackson > --- > include/mini-os/os.h | 15 ++++++++++----- > include/mini-os/spinlock.h | 2 ++ > include/mini-os/x86/mm.h | 4 ++++ > include/mini-os/x86/spinlock.h | 3 +++ > 4 files changed, 19 insertions(+), 5 deletions(-) > > diff --git a/include/mini-os/os.h b/include/mini-os/os.h > index 9938d31..675a2bf 100644 > --- a/include/mini-os/os.h > +++ b/include/mini-os/os.h > @@ -1,17 +1,20 @@ > #ifndef _MINIOS_OS_H_ > #define _MINIOS_OS_H_ > > -#if __GNUC__ == 2 && __GNUC_MINOR__ < 96 > -#define __builtin_expect(x, expected_value) (x) > -#endif > +#define smp_processor_id() 0 > #define unlikely(x) __builtin_expect((x),0) > #define likely(x) __builtin_expect((x),1) Not relevant to the patch itself, but as identified in c/s e5545fb6d0, these constructs are buggy. > > -#define smp_processor_id() 0 > +#include > + > +#ifndef __RUMP_KERNEL__ > + > +#if __GNUC__ == 2 && __GNUC_MINOR__ < 96 > +#define __builtin_expect(x, expected_value) (x) > +#endif > Do we honestly care about compilers this old? ~Andrew > #ifndef __ASSEMBLY__ > #include > -#include > #include > #endif > > @@ -21,4 +24,6 @@ > > #include > > +#endif /* !__RUMP_KERNEL__ */ > + > #endif /* _MINIOS_OS_H_ */ > diff --git a/include/mini-os/spinlock.h b/include/mini-os/spinlock.h > index 5e662bb..b87ffe5 100644 > --- a/include/mini-os/spinlock.h > +++ b/include/mini-os/spinlock.h > @@ -1,7 +1,9 @@ > #ifndef __MINIOS_ASM_SPINLOCK_H > #define __MINIOS_ASM_SPINLOCK_H > > +#ifndef __RUMP_KERNEL__ > #include > +#endif > > /* > * Your basic SMP spinlocks, allowing only a single CPU anywhere > diff --git a/include/mini-os/x86/mm.h b/include/mini-os/x86/mm.h > index e41ef74..2a73d08 100644 > --- a/include/mini-os/x86/mm.h > +++ b/include/mini-os/x86/mm.h > @@ -36,6 +36,8 @@ > #endif > #endif > > +#ifndef __RUMP_KERNEL__ > + > #define L1_FRAME 1 > #define L2_FRAME 2 > #define L3_FRAME 3 > @@ -231,4 +233,6 @@ static __inline__ paddr_t machine_to_phys(maddr_t machine) > pgentry_t *need_pgt(unsigned long addr); > int mfn_is_ram(unsigned long mfn); > > +#endif /* !__RUMP_KERNEL__ */ > + > #endif /* _ARCH_MM_H_ */ > diff --git a/include/mini-os/x86/spinlock.h b/include/mini-os/x86/spinlock.h > index 4b8faf7..b22f2a4 100644 > --- a/include/mini-os/x86/spinlock.h > +++ b/include/mini-os/x86/spinlock.h > @@ -3,7 +3,10 @@ > #ifndef __ARCH_ASM_SPINLOCK_H > #define __ARCH_ASM_SPINLOCK_H > > +#ifndef __RUMP_KERNEL__ > #include > +#endif > + > #include "os.h" > >