On Thursday 17 November 2005 21:37, linux-os (Dick Johnson) wrote: > On Thu, 17 Nov 2005, Jeff Dike wrote: > > This patch makes stub_segv use the stub_syscall macros. This was > > needed anyway, but the bug that prompted this was the discovery that > > gcc was storing stuff in RCX, which is trashed across a system > > call.
> But the C-calling convention used by gcc for 32-bit systems > is supposed to allow the called-function to destroy general- > purpose registers but not index registers. In other words, > ECX, EDX are supposed to be available and EAX is used for > return-values. The register size isn't supposed to have > anything to do with it (longword/quadword)! > In 64-bit world, the same is supposed to apply as well. > If RCX is now precious, it's a GCC bug that should be fixed. It's not _normally_ precious, for function calling conventions, but syscalls are different. Read include/asm-x86_64/unistd.h and see that the _syscallX macros contain various register clobber. I.e. they explicitly tell GCC "don't use that". We (UML code) were missing that. Simple. -- Inform me of my mistakes, so I can keep imitating Homer Simpson's "Doh!". Paolo Giarrusso, aka Blaisorblade (Skype ID "PaoloGiarrusso", ICQ 215621894) http://www.user-mode-linux.org/~blaisorblade ___________________________________ Yahoo! Messenger: chiamate gratuite in tutto il mondo http://it.messenger.yahoo.com ------------------------------------------------------- This SF.Net email is sponsored by the JBoss Inc. Get Certified Today Register for a JBoss Training Course. Free Certification Exam for All Training Attendees Through End of 2005. For more info visit: http://ads.osdn.com/?ad_id=7628&alloc_id=16845&op=click _______________________________________________ User-mode-linux-devel mailing list User-mode-linux-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel