X86 machine code enter and FreeBSD kernel
Erich Dollansky
oceanare at pacific.net.sg
Fri Jun 10 15:13:49 GMT 2005
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
More information about the freebsd-hackers
mailing list