Fix gcc inline assembler operand constraints for syscall -- as pushl modifies %esp...
authorBenedikt Huber <benedikt.huber@gmail.com>
Wed, 29 Feb 2012 14:17:04 +0000 (15:17 +0100)
committerBen Pfaff <blp@cs.stanford.edu>
Thu, 1 Mar 2012 05:22:46 +0000 (21:22 -0800)
commiteaedb2511bda3dd4447cde9b2c65f9a61d94c91e
treefd552120b7d839aa243a5bce9f56c3af7f74311c
parent5f011b3fa67f5d9dadcb588a547023bc6a322d52
Fix gcc inline assembler operand constraints for syscall -- as pushl modifies %esp, variable operands must not reference the stack pointer.

Without this patch, gcc-4.6.1-9ubuntu3 miscompiles the read syscall to:
  000000b6 <read>:
    b6:   ff 74 24 0c             pushl  0xc(%esp)
    ba:   ff 74 24 08             pushl  0x8(%esp)  ; [!]
    be:   ff 74 24 04             pushl  0x4(%esp)  ; [!]
    ...
src/lib/user/syscall.c