From owner-freebsd-sparc64@FreeBSD.ORG Mon Jan 27 21:54:04 2014 Return-Path: Delivered-To: sparc64@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id C72C4DDB for ; Mon, 27 Jan 2014 21:54:04 +0000 (UTC) Received: from vlakno.cz (mail.vlakno.cz [95.129.96.251]) by mx1.freebsd.org (Postfix) with ESMTP id 871831536 for ; Mon, 27 Jan 2014 21:54:04 +0000 (UTC) Received: by vlakno.cz (Postfix, from userid 1002) id 05FCE1CC55E8; Mon, 27 Jan 2014 22:54:03 +0100 (CET) Date: Mon, 27 Jan 2014 22:54:03 +0100 From: Roman Divacky To: Craig Butler Subject: Re: Call for help: clang/llvm for sparc64 Message-ID: <20140127215402.GA85169@freebsd.org> References: <20140117221330.GA2788@freebsd.org> <1390175474.8376.3.camel@atlas.lerwick.hopto.org> <3866560.132.1390324121556.JavaMail.craig@w520> <20140121170801.GA56661@freebsd.org> <52E553E6.6020902@pix.net> <20140126190349.GA89295@freebsd.org> <20140127200331.GA80131@freebsd.org> <3051948.261.1390859647458.JavaMail.craig@w520> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <3051948.261.1390859647458.JavaMail.craig@w520> User-Agent: Mutt/1.5.22 (2013-10-16) Cc: Kurt Lidl , sparc64@freebsd.org X-BeenThere: freebsd-sparc64@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: Porting FreeBSD to the Sparc List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 27 Jan 2014 21:54:04 -0000 On Mon, Jan 27, 2014 at 09:50:52PM +0000, Craig Butler wrote: > > > > Btw, can someone test this patch? ie. compile (with gcc) sparc64 > > kernel > > with it and boot it? > > > > > Yes, I had to fix that but forgot to upstream it. > > > > > > Index: sparc64/include/pcpu.h > > > =================================================================== > > > --- sparc64/include/pcpu.h (revision 259767) > > > +++ sparc64/include/pcpu.h (working copy) > > > @@ -70,9 +70,26 @@ > > > struct pcb; > > > struct pcpu; > > > > > > -register struct pcb *curpcb __asm__(__XSTRING(PCB_REG)); > > > -register struct pcpu *pcpup __asm__(__XSTRING(PCPU_REG)); > > > +static __inline __pure2 struct pcb * > > > +__curpcb(void) > > > +{ > > > + struct pcb *pcb; > > > > > > + __asm("ldx [%" __XSTRING(PCB_REG) "], %0" : "=r" (pcb)); > > > + return (pcb); > > > +} > > > +#define curpcb (__curpcb()) > > > + > > > +static __inline __pure2 struct pcpu * > > > +__curpcpu(void) > > > +{ > > > + struct pcpu *pcpu; > > > + > > > + __asm("ldx [%" __XSTRING(PCPU_REG) "], %0" : "=r" (pcpu)); > > > + return (pcpu); > > > +} > > > +#define pcpup (__curpcpu()) > > > + > > > #define PCPU_GET(member) (pcpup->pc_ ## member) > > > > > > static __inline __pure2 struct thread * > > > > > > > > > the llvm sparc64 is not yet ready for wide consumption. Once llvm > > > 3.4 is imported > > > (days now) the sparc64 backend will be enabled as well. Then I plan > > > to backport > > > all the fixes from llvm trunk to enable it to selfhost. So that we > > > can build > > > llvm 3.5 with llvm itself. This is necesary as llvm is becoming > > > c++11 only. > > > > > Do you want us to apply that patch to /usr/src/sys/sparc64/include/pcpu.h then make with gcc ?? > Do we have to pull down HEAD or can this be applied over a 9.2|10-RELEASE ? > Which gcc ?? -current and in-base gcc I would think would be the best. But 10.0R should work too. Roman