From owner-freebsd-ppc@FreeBSD.ORG Wed Nov 30 05:47:24 2005 Return-Path: X-Original-To: freebsd-ppc@freebsd.org Delivered-To: freebsd-ppc@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 4ED8A16A41F for ; Wed, 30 Nov 2005 05:47:24 +0000 (GMT) (envelope-from grehan@freebsd.org) Received: from hummer.onthenet.com.au (hummer.OntheNet.com.au [203.13.68.9]) by mx1.FreeBSD.org (Postfix) with ESMTP id E9DF043D58 for ; Wed, 30 Nov 2005 05:47:20 +0000 (GMT) (envelope-from grehan@freebsd.org) Received: from [203.144.18.182] (CPE-18-182.dsl.OntheNet.net [203.144.18.182]) by hummer.onthenet.com.au (Postfix) with ESMTP id AD38819FDD0; Wed, 30 Nov 2005 15:47:18 +1000 (EST) Message-ID: <438D3D37.60007@freebsd.org> Date: Wed, 30 Nov 2005 15:48:39 +1000 From: Peter Grehan User-Agent: Mozilla/5.0 (X11; U; FreeBSD i386; en-US; rv:1.7.2) Gecko/20041016 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Arun Sharma References: <4389EB8A.9070200@sharma-home.net> <438C7502.8050401@sharma-home.net> In-Reply-To: <438C7502.8050401@sharma-home.net> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Cc: alex@rinet.ru, freebsd-ppc@freebsd.org Subject: Re: strace for powerpc X-BeenThere: freebsd-ppc@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Porting FreeBSD to the PowerPC List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 30 Nov 2005 05:47:24 -0000 Hi Arun, > Couple of things that I noticed aren't working well: > > - when a system call fails, the return value and the error code are wrong. You may want to test for the presence of the high bit in the CR rather than equality i.e. +#elif defined(POWERPC) + if ((regs.cr & 0x10000000) == 0x10000000) { + tcp->u_rval = -1; + u_error = regs.fixreg[FIRSTARG]; Also, the value should be OR'd to the CR instead of assigned: + if (error) { + regs.cr |= 0x10000000; + regs.fixreg[FIRSTARG] = error; > - I'm not sure if frame.lr is the equivalent of regs.r_eip on i386. From > the powerpc manuals, it looks like SRR0 contains the address where the > syscall would return to. Yep, that's correct for the syscall exception. later, Peter.