From owner-freebsd-amd64@FreeBSD.ORG Sun May 16 14:08:05 2004 Return-Path: Delivered-To: freebsd-amd64@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 9169716A4CE for ; Sun, 16 May 2004 14:08:05 -0700 (PDT) Received: from mailhost.stack.nl (vaak.stack.nl [131.155.140.140]) by mx1.FreeBSD.org (Postfix) with ESMTP id 06C2A43D1D for ; Sun, 16 May 2004 14:08:05 -0700 (PDT) (envelope-from marcov@stack.nl) Received: from toad.stack.nl (zen.stack.nl [IPv6:2001:610:1108:5010::130]) by mailhost.stack.nl (Postfix) with ESMTP id 1EEC31F07C for ; Sun, 16 May 2004 23:08:04 +0200 (CEST) Received: by toad.stack.nl (Postfix, from userid 816) id F03CC94; Sun, 16 May 2004 23:08:03 +0200 (CEST) In-Reply-To: <200405161316.30635.peter@wemm.org> "from Peter Wemm at May 16, 2004 01:16:30 pm" To: freebsd-amd64@freebsd.org Date: Sun, 16 May 2004 23:08:03 +0200 (CEST) X-Mailer: ELM [version 2.4ME+ PL88 (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII Message-Id: <20040516210803.F03CC94@toad.stack.nl> From: marcov@stack.nl (Marco van de Voort) Subject: Re: ABI question, porting ports to amd64 X-BeenThere: freebsd-amd64@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Porting FreeBSD to the AMD64 platform List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 16 May 2004 21:08:05 -0000 y> > is %r10. So gcc puts the 4th param in %rcx, and the move moves it to > > %r10 for the kernel. > > Correct. We use the ABI argument ordering since that is what gcc gave > us when calling the stub funtions, but the syscall instruction clobbers > %rcx as it enters the kernel. > > If we were smarter, we'd only do this move if we know the syscall had 4 > or more arguments. But unfortunately, we don't have this information > when building libc. > > Or, we'd declare the syscall prototypes with an explicit override of the > register parameter assignments or something. (bad luck though if you > neglect to use the right #includes for your code and miss out a > prototype) I was always curious why the (basic) *nix syscalls weren't inlined? Can't gcc do that?