From mboxrd@z Thu Jan 1 00:00:00 1970 Message-ID: To: tphilipp@potion-studios.com, 9fans@9fans.net Date: Mon, 26 Jul 2010 23:14:43 +0200 From: cinap_lenrek@gmx.de In-Reply-To: <899e1dd0ffcee329db7dc0b8faf0b201-EhVcXl1ERwBcRx0AAAwEUR8fGQlVS19cWF9EAV1EWEZaOl4PQVh/H1dXXkFeRExtXlhRQFlSWgxcXw==-webmailer2@server01.webmailer.hosteurope.de> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="upas-mvydoxhekmiqjfavjnfhnthvjf" Subject: Re: [9fans] Plan9 Calling Convention (x86) Topicbox-Message-UUID: 443388b2-ead6-11e9-9d60-3106f5b1d025 This is a multi-part message in MIME format. --upas-mvydoxhekmiqjfavjnfhnthvjf Content-Disposition: inline Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit caller saves, so function is free to use any register. params are put on the stack and then just uses a call instruction wich leaves the return pc on the stack. function allocates space for its local variables on the stack and restores SP before return. return value of a function is put in AX (for integers and pointers). structures and 64bit vlongs are returned the way that the caller allocates it and passes a pointer to it as the first parameter (on the stack). AX is then not used as return value and can be used freely in the callee. -- cinap --upas-mvydoxhekmiqjfavjnfhnthvjf Content-Type: message/rfc822 Content-Disposition: inline Return-Path: <9fans-bounces+cinap_lenrek=gmx.de@9fans.net> Delivered-To: GMX delivery to cinap_lenrek@gmx.de Received: (qmail invoked by alias); 26 Jul 2010 19:36:17 -0000 Received: from gouda.swtch.com (EHLO gouda.swtch.com) [67.207.142.3] by mx0.gmx.net (mx001) with SMTP; 26 Jul 2010 21:36:17 +0200 Received: from localhost ([127.0.0.1] helo=gouda.swtch.com) by gouda.swtch.com with esmtp (Exim 4.69) (envelope-from <9fans-bounces@9fans.net>) id 1OdTKY-0002Ub-Tv; Mon, 26 Jul 2010 19:27:19 +0000 Received: from jordan.mc0.hosteurope.de ([80.237.138.9]) by gouda.swtch.com with esmtp (Exim 4.69) (envelope-from ) id 1OdTKX-0002UW-14 for 9fans@9fans.net; Mon, 26 Jul 2010 19:27:17 +0000 Received: from server01.webmailer.hosteurope.de ([10.9.0.180]); by mailout.hosteurope.de (jordan.mc0.hosteurope.de) running EXperimental Internet Mailer with esmtps (TLSv1:AES256-SHA:256) id 1OdTKQ-0006vS-TD for 9fans@9fans.net; Mon, 26 Jul 2010 21:27:10 +0200 Received: from nobody by server01.webmailer.hosteurope.de with local (Exim 4.69) (envelope-from ) id 1OdTKQ-0001z3-Rq for 9fans@9fans.net; Mon, 26 Jul 2010 21:27:10 +0200 X-Squirrel-UserHash: EhVcXl1ERwBcRx0AAAwEUR8f X-Squirrel-FromHash: UVZZCQsXTFQ= Message-ID: <899e1dd0ffcee329db7dc0b8faf0b201-EhVcXl1ERwBcRx0AAAwEUR8fGQlVS19cWF9EAV1EWEZaOl4PQVh/H1dXXkFeRExtXlhRQFlSWgxcXw==-webmailer2@server01.webmailer.hosteurope.de> Date: Mon, 26 Jul 2010 21:27:10 +0200 From: "Tassilo Philipp" To: 9fans@9fans.net User-Agent: Host Europe Webmailer/1.0 MIME-Version: 1.0 Content-Type: text/plain;charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-Priority: 3 (Normal) Importance: Normal X-HE-Access: Yes X-bounce-key: webpack.hosteurope.de; tphilipp@potion-studios.com; 1280172430; 023dacc5; Subject: [9fans] Plan9 Calling Convention (x86) X-BeenThere: 9fans@9fans.net X-Mailman-Version: 2.1.10 Precedence: list Reply-To: tphilipp@potion-studios.com, Fans of the OS Plan 9 from Bell Labs <9fans@9fans.net> List-Id: Fans of the OS Plan 9 from Bell Labs <9fans.9fans.net> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: 9fans-bounces@9fans.net Errors-To: 9fans-bounces+cinap_lenrek=gmx.de@9fans.net X-GMX-Antivirus: 0 (no virus found) X-GMX-Antispam: 0 (Mail was not recognized as spam); Detail=5D7Q89H36p77e5KAPs1l6v/Sb97LojnDtMgfETrECMLUO9erHzOJe+OynZRhvlGqb5A0X bbiCt2rAnnct/NAlbHMvoAL6GY+23tB3khNK7au3fkL89Y026H2WJg1zsjGg0I0r5V9ldzzR5wBB /r19Q==V1; X-Flags: 0000 X-GMX-UID: 5oY/bE9FeSE5Lp4kyHQhdwB2IGRvb0Dg Hi, I'm in the process of porting dyncall (http://dyncall.org) to Plan9, and I was wondering if there are any documents about the calling convention used by Plan9 - specifically for x86, for starters. I was unable to find any at the time of writing, and well, hoped that it would be similar to the SystemV calling convention(s) used by the *BSDs or Linux, etc., but that doesn't seem to be the case. The only information I found so far, is, that most of the compiled Plan9 functions don't seem to have any prologue/epilogue, however, this assumption might be wrong (maybe I didn't get how Plan9 works on the machine-level, so far). I'm still new to Plan9, but it's quite mind-opening to discover certain aspects of the OS - especially after getting so (too) used to Unix/Windows OS design decisions and accepting them as the normal/right way to do things... Thanks, Tassilo --upas-mvydoxhekmiqjfavjnfhnthvjf--