X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Ftests%2Fvm%2Fpt-grow-pusha.c;h=b6b165fa185e9d29cb469df9517748d95d469821;hb=f5a8a96c77a329a6fe175e62c6ed3c149fc3937d;hp=61efb015710cb94422ddd9c9dbdfbab058cfd7d2;hpb=615bf3b3d2a8573ed6fb9ddc0055745e163ac999;p=pintos-anon diff --git a/src/tests/vm/pt-grow-pusha.c b/src/tests/vm/pt-grow-pusha.c index 61efb01..b6b165f 100644 --- a/src/tests/vm/pt-grow-pusha.c +++ b/src/tests/vm/pt-grow-pusha.c @@ -1,3 +1,7 @@ +/* Expand the stack by 32 bytes all at once using the PUSHA + instruction. + This must succeed. */ + #include #include "tests/arc4.h" #include "tests/cksum.h" @@ -8,9 +12,9 @@ void test_main (void) { asm volatile - ("mov %%eax, %%esp;" /* Save a copy of the stack pointer. */ - "and %%esp, 0xfffff000;" /* Move stack pointer to bottom of page. */ - "pusha;" /* Push 32 bytes on stack at once. */ - "mov %%esp, %%eax" /* Restore copied stack pointer. */ - ::: "eax"); /* Tell GCC we modified eax. */ + ("movl %%esp, %%eax;" /* Save a copy of the stack pointer. */ + "andl $0xfffff000, %%esp;" /* Move stack pointer to bottom of page. */ + "pushal;" /* Push 32 bytes on stack at once. */ + "movl %%eax, %%esp" /* Restore copied stack pointer. */ + ::: "eax"); /* Tell GCC we destroyed eax. */ }