From owner-freebsd-platforms Wed Jul 10 12:20:20 2002 Delivered-To: freebsd-platforms@freebsd.org Received: from mx1.FreeBSD.org (mx1.FreeBSD.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id E6DE937B412; Wed, 10 Jul 2002 12:20:09 -0700 (PDT) Received: from rwcrmhc51.attbi.com (rwcrmhc51.attbi.com [204.127.198.38]) by mx1.FreeBSD.org (Postfix) with ESMTP id 3E9D043E5E; Wed, 10 Jul 2002 12:20:09 -0700 (PDT) (envelope-from julian@elischer.org) Received: from InterJet.elischer.org ([12.232.206.8]) by rwcrmhc51.attbi.com (InterMail vM.4.01.03.27 201-229-121-127-20010626) with ESMTP id <20020710192008.SGRK24728.rwcrmhc51.attbi.com@InterJet.elischer.org>; Wed, 10 Jul 2002 19:20:08 +0000 Received: from localhost (localhost.elischer.org [127.0.0.1]) by InterJet.elischer.org (8.9.1a/8.9.1) with ESMTP id MAA41788; Wed, 10 Jul 2002 12:04:41 -0700 (PDT) Date: Wed, 10 Jul 2002 12:04:41 -0700 (PDT) From: Julian Elischer To: Serguei Tzukanov Cc: John Baldwin , freebsd-hackers@freebsd.org, freebsd-platforms@freebsd.org Subject: Re: A question about S/390 port In-Reply-To: <200207102033.25184.tzukanov@narod.ru> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-platforms@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org OK so I have to ask.. S/390 as in IBM Mainframem S/390? On Wed, 10 Jul 2002, Serguei Tzukanov wrote: > > > td_retval[0] is the low word, and td_retval[1] is the high word, you > > just need to make sure the values from those two words get returned > > properly to userland. > > 1) syscall returns 32-bit value: > r2 = rv[0]; > r3 = rv[1]; > r3 is irrelevant here (ABI: "32-bit values returned in r2") > > 2) syscall returns 64-bit value: > MI code uses something like > *(int64_t *)rv = xxx, so I have to do > r2 = rv[0]; > r3 = rv[1]; > ABI says "long long shall be returned with the lower > addressed half in r2 and the higher in r3" > > 3) syscall folded into __syscall returns 32-bit value (e.g. mmap): > MI code does usual > r[0] = xxx; > svc (syscall) handler does > r2 = rv[0]; > r3 = rv[1]; /* zeroed before */ > then mmap wrapper in userspace casts this 64-bit to 32-bit > (loads r2 with r3 really) and always gets 0. > > So to make it consistent I have to know size of returned value for every > syscall and for case 3 do {r3 = rv[0]; r2 = rv[1]}. > > > > To Unsubscribe: send mail to majordomo@FreeBSD.org > with "unsubscribe freebsd-hackers" in the body of the message > To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-platforms" in the body of the message