From owner-freebsd-amd64@FreeBSD.ORG Sun May 16 05:31:41 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 402A616A4CE for ; Sun, 16 May 2004 05:31:41 -0700 (PDT) Received: from hexagon.stack.nl (hexagon.stack.nl [131.155.140.144]) by mx1.FreeBSD.org (Postfix) with ESMTP id 9074C43D31 for ; Sun, 16 May 2004 05:31:40 -0700 (PDT) (envelope-from marcov@stack.nl) Received: from toad.stack.nl (zen.stack.nl [IPv6:2001:610:1108:5010::130]) by hexagon.stack.nl (Postfix) with ESMTP id 9F4442D467; Sun, 16 May 2004 14:31:39 +0200 (CEST) Received: by toad.stack.nl (Postfix, from userid 816) id 79BC594; Sun, 16 May 2004 14:31:39 +0200 (CEST) In-Reply-To: <20040515231954.4594F93@toad.stack.nl> "from Marco van de Voort at May 16, 2004 01:19:54 am" To: Marco van de Voort Date: Sun, 16 May 2004 14:31:39 +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: <20040516123139.79BC594@toad.stack.nl> From: marcov@stack.nl (Marco van de Voort) cc: freebsd-amd64@freebsd.org 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 12:31:41 -0000 > I read the ABI info on x86-64.org, and objdumped some linux and freebsd > code, and I ran into a linux<->freebsd difference something I can't figure > out: Answering my own question: FreeBSD uses the gcc mechanism to build the same parameterlist for a syscall like for a normal procedure. (to avoid having to shift params) The register for the 4th parameter for gcc is %rcx, for the kernel it is %r10. So gcc puts the 4th param in %rcx, and the move moves it to %r10 for the kernel.