From owner-freebsd-hackers@FreeBSD.ORG Fri Jun 10 15:13:49 2005 Return-Path: X-Original-To: freebsd-hackers@freebsd.org Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 4319A16A41C for ; Fri, 10 Jun 2005 15:13:49 +0000 (GMT) (envelope-from oceanare@pacific.net.sg) Received: from sarajevo.pacific.net.sg (sarajevo.pacific.net.sg [203.120.90.134]) by mx1.FreeBSD.org (Postfix) with SMTP id 663E143D1D for ; Fri, 10 Jun 2005 15:13:47 +0000 (GMT) (envelope-from oceanare@pacific.net.sg) Received: (qmail 6705 invoked from network); 10 Jun 2005 15:13:46 -0000 Received: from unknown (HELO maxwell2.pacific.net.sg) (203.120.90.192) by sarajevo with SMTP; 10 Jun 2005 15:13:46 -0000 Received: from [192.168.0.107] ([210.24.246.101]) by maxwell2.pacific.net.sg with ESMTP id <20050610151346.WKCR1130.maxwell2.pacific.net.sg@[192.168.0.107]>; Fri, 10 Jun 2005 23:13:46 +0800 Message-ID: <42A9AE12.8060702@pacific.net.sg> Date: Fri, 10 Jun 2005 23:13:22 +0800 From: Erich Dollansky Organization: oceanare pte ltd User-Agent: Mozilla Thunderbird 1.0.2 (X11/20050514) X-Accept-Language: en-us, en MIME-Version: 1.0 To: Reko Turja References: <00aa01c56dc4$e93fb050$92a7cb52@rekon> In-Reply-To: <00aa01c56dc4$e93fb050$92a7cb52@rekon> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: freebsd-hackers@freebsd.org Subject: Re: X86 machine code enter and FreeBSD kernel X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Jun 2005 15:13:49 -0000 Hi, Reko Turja wrote: > I received no reply on this question at questions mailing list, so I try > asking this here. Hope I'm not asking this in completely wrong list. > > In recent discussion in OpenWatcom lists it was noticed that at least > certain addressing modes of assembler ENTER instruction causes a crash > when used in Linux. GCC circumnavigates this by not emitting ENTER > instructions in machine code. Linus's comment on the above issue can be > found on: > > http://groups.google.co.nz/groups?selm=7i86ni%24b7n%241%40palladium.transmeta.com > > > What's the status of the above "feature" in FreeBSD, does the kernel > support the > whole x86 instruction set without similar cut corners? > This here is out of my memory from the days when 'enter' was a new instruction. So, do not kill me if I am wrong. 'enter' allows to specify a nesting level. Languages like Pascal can use this for functions which are local to other functions to enable the inner function to access the stack of the outer function. C does not support this at all. So, if you use this instruction, it must be used with a nesting level of zero. This will not cause any problems but will be a plain waste of CPU time. Erich