In message <[EMAIL PROTECTED]>, Chuck Tuffli write
s:
>I've been chasing down some weird panics in my CAM driver and have
>noticed that functions don't seem to save all register values before
>they modify them.
>
>For example, function A uses register ecx to hold the value of a pointer. Part way 
>through, function A calls function B which uses ecx as a loop index. The bad part is 
>function B never saves/restores the value of ecx and function A starts dereferencing 
>garbage.
>
>An informal sampling of my driver seems to indicate that ebx gets
>pushed/poped at entry/exit but ecx and edx don't. Does any of this
>sound familiar? Thanks!

There are strict rules for which registers should be saved and which not.

You can modify these rules somewhat using weird compiler options, but
it should be consistent for all the code generated with the same
settings.

Which FreeBSD version (uname -a) and which compiler version (cc -v)
is this ?

Poul-Henning


-- 
Poul-Henning Kamp       | UNIX since Zilog Zeus 3.20
[EMAIL PROTECTED]         | TCP/IP since RFC 956
FreeBSD committer       | BSD since 4.3-tahoe    
Never attribute to malice what can adequately be explained by incompetence.

To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-hackers" in the body of the message

Reply via email to