Date: Fri, 10 Jun 2005 23:13:22 +0800 From: Erich Dollansky <oceanare@pacific.net.sg> To: Reko Turja <reko.turja@liukuma.net> Cc: freebsd-hackers@freebsd.org Subject: Re: X86 machine code enter and FreeBSD kernel Message-ID: <42A9AE12.8060702@pacific.net.sg> In-Reply-To: <00aa01c56dc4$e93fb050$92a7cb52@rekon> References: <00aa01c56dc4$e93fb050$92a7cb52@rekon>
next in thread | previous in thread | raw e-mail | index | archive | help
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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?42A9AE12.8060702>