--- src/kernel/sel4/libsel4/sel4_arch_include/ia32/sel4/sel4_arch/syscalls.h +++ src/kernel/sel4/libsel4/sel4_arch_include/ia32/sel4/sel4_arch/syscalls.h @@ -20,19 +20,21 @@ { asm volatile ( "pushl %%ebp \n" + "pushl %%ebx \n" "movl %%ecx, %%ebp \n" "movl %%esp, %%ecx \n" + "movl %%edx, %%ebx \n" "leal 1f, %%edx \n" "1: \n" "sysenter \n" + "popl %%ebx \n" "popl %%ebp \n" - : + : "+d" (dest) : "a" (seL4_SysSend), - "b" (dest), "S" (msgInfo.words[0]), "D" (seL4_GetMR(0)), "c" (seL4_GetMR(1)) - : "%edx" + : ); } @@ -42,19 +44,21 @@ { asm volatile ( "pushl %%ebp \n" + "pushl %%ebx \n" "movl %%ecx, %%ebp \n" "movl %%esp, %%ecx \n" + "movl %%edx, %%ebx \n" "leal 1f, %%edx \n" "1: \n" "sysenter \n" + "popl %%ebx \n" "popl %%ebp \n" - : + : "+d" (dest) : "a" (seL4_SysSend), - "b" (dest), "S" (msgInfo.words[0]), "D" (mr0 != seL4_Null ? *mr0 : 0), "c" (mr1 != seL4_Null ? *mr1 : 0) - : "%edx" + : ); } @@ -63,19 +67,21 @@ { asm volatile ( "pushl %%ebp \n" + "pushl %%ebx \n" "movl %%ecx, %%ebp \n" "movl %%esp, %%ecx \n" + "movl %%edx, %%ebx \n" "leal 1f, %%edx \n" "1: \n" "sysenter \n" + "popl %%ebx \n" "popl %%ebp \n" - : + : "+d" (dest) : "a" (seL4_SysNBSend), - "b" (dest), "S" (msgInfo.words[0]), "D" (seL4_GetMR(0)), "c" (seL4_GetMR(1)) - : "%edx" + : ); } @@ -85,19 +91,21 @@ { asm volatile ( "pushl %%ebp \n" + "pushl %%ebx \n" "movl %%ecx, %%ebp \n" "movl %%esp, %%ecx \n" + "movl %%edx, %%ebx \n" "leal 1f, %%edx \n" "1: \n" "sysenter \n" + "popl %%ebx \n" "popl %%ebp \n" - : + : "+d" (dest) : "a" (seL4_SysNBSend), - "b" (dest), "S" (msgInfo.words[0]), "D" (mr0 != seL4_Null ? *mr0 : 0), "c" (mr1 != seL4_Null ? *mr1 : 0) - : "%edx" + : ); } @@ -106,18 +114,20 @@ { asm volatile ( "pushl %%ebp \n" + "pushl %%ebx \n" "movl %%ecx, %%ebp \n" "movl %%esp, %%ecx \n" "leal 1f, %%edx \n" "1: \n" "sysenter \n" + "popl %%ebx \n" "popl %%ebp \n" : : "a" (seL4_SysReply), "S" (msgInfo.words[0]), "D" (seL4_GetMR(0)), "c" (seL4_GetMR(1)) - : "%ebx", "%edx" + : "%edx" ); } @@ -127,18 +137,20 @@ { asm volatile ( "pushl %%ebp \n" + "pushl %%ebx \n" "movl %%ecx, %%ebp \n" "movl %%esp, %%ecx \n" "leal 1f, %%edx \n" "1: \n" "sysenter \n" + "popl %%ebx \n" "popl %%ebp \n" : : "a" (seL4_SysReply), "S" (msgInfo.words[0]), "D" (mr0 != seL4_Null ? *mr0 : 0), "c" (mr1 != seL4_Null ? *mr1 : 0) - : "%ebx", "%edx" + : "%edx" ); } @@ -147,16 +159,18 @@ { asm volatile ( "pushl %%ebp \n" + "pushl %%ebx \n" "movl %%esp, %%ecx \n" + "movl %%edx, %%ebx \n" "leal 1f, %%edx \n" "1: \n" "sysenter \n" + "popl %%ebx \n" "popl %%ebp \n" - : + : "+d" (dest) : "a" (seL4_SysSend), - "b" (dest), "S" (seL4_MessageInfo_new(0, 0, 0, 0).words[0]) - : "%ecx", "%edx" + : "%ecx" ); } @@ -170,20 +184,24 @@ asm volatile ( "pushl %%ebp \n" + "pushl %%ebx \n" "movl %%esp, %%ecx \n" + "movl %%edx, %%ebx \n" "leal 1f, %%edx \n" "1: \n" "sysenter \n" + "movl %%ebx, %%edx \n" + "popl %%ebx \n" "movl %%ebp, %%ecx \n" "popl %%ebp \n" : - "=b" (badge), + "=d" (badge), "=S" (info.words[0]), "=D" (mr0), "=c" (mr1) : "a" (seL4_SysRecv), - "b" (src) - : "%edx", "memory" + "d" (src) + : "memory" ); seL4_SetMR(0, mr0); @@ -207,20 +225,24 @@ asm volatile ( "pushl %%ebp \n" + "pushl %%ebx \n" "movl %%esp, %%ecx \n" + "movl %%edx, %%ebx \n" "leal 1f, %%edx \n" "1: \n" "sysenter \n" + "movl %%ebx, %%edx \n" + "popl %%ebx \n" "movl %%ebp, %%ecx \n" "popl %%ebp \n" : - "=b" (badge), + "=d" (badge), "=S" (info.words[0]), "=D" (msg0), "=c" (msg1) : "a" (seL4_SysRecv), - "b" (src) - : "%edx", "memory" + "d" (src) + : "memory" ); if (mr0 != seL4_Null) { @@ -247,20 +269,23 @@ asm volatile ( "pushl %%ebp \n" + "pushl %%ebx \n" "movl %%esp, %%ecx \n" "leal 1f, %%edx \n" "1: \n" "sysenter \n" + "movl %%ebx, %%edx \n" + "popl %%ebx \n" "movl %%ebp, %%ecx \n" "popl %%ebp \n" : - "=b" (badge), + "=d" (badge), "=S" (info.words[0]), "=D" (mr0), "=c" (mr1) : "a" (seL4_SysNBRecv), - "b" (src) - : "%edx", "memory" + "d" (src) + : "memory" ); seL4_SetMR(0, mr0); @@ -282,24 +307,27 @@ asm volatile ( "pushl %%ebp \n" + "pushl %%ebx \n" "movl %%ecx, %%ebp \n" "movl %%esp, %%ecx \n" + "movl %%edx, %%ebx \n" "leal 1f, %%edx \n" "1: \n" "sysenter \n" + "movl %%ebx, %%edx \n" + "popl %%ebx \n" "movl %%ebp, %%ecx \n" "popl %%ebp \n" : "=S" (info.words[0]), "=D" (mr0), "=c" (mr1), - "=b" (dest) /* dummy, tells GCC that ebx is clobbered */ + "+d" (dest) : "a" (seL4_SysCall), - "b" (dest), "S" (msgInfo.words[0]), "D" (mr0), "c" (mr1) - : "%edx", "memory" + : "memory" ); seL4_SetMR(0, mr0); @@ -325,24 +353,27 @@ asm volatile ( "pushl %%ebp \n" + "pushl %%ebx \n" "movl %%ecx, %%ebp \n" "movl %%esp, %%ecx \n" + "movl %%edx, %%ebx \n" "leal 1f, %%edx \n" "1: \n" "sysenter \n" + "movl %%ebx, %%edx \n" + "popl %%ebx \n" "movl %%ebp, %%ecx \n" "popl %%ebp \n" : "=S" (info.words[0]), "=D" (msg0), "=c" (msg1), - "=b" (dest) /* dummy, tells GCC that ebx is clobbered */ + "+d" (dest) : "a" (seL4_SysCall), - "b" (dest), "S" (msgInfo.words[0]), "D" (msg0), "c" (msg1) - : "%edx", "memory" + : "memory" ); if (mr0 != seL4_Null) { @@ -365,24 +396,28 @@ asm volatile ( "pushl %%ebp \n" + "pushl %%ebx \n" "movl %%ecx, %%ebp \n" "movl %%esp, %%ecx \n" + "movl %%edx, %%ebx \n" "leal 1f, %%edx \n" "1: \n" "sysenter \n" + "movl %%ebx, %%edx \n" + "popl %%ebx \n" "movl %%ebp, %%ecx \n" "popl %%ebp \n" : - "=b" (badge), + "=d" (badge), "=S" (info.words[0]), "=D" (mr0), "=c" (mr1) : "a" (seL4_SysReplyRecv), - "b" (dest), + "d" (dest), "S" (msgInfo.words[0]), "D" (mr0), "c" (mr1) - : "%edx", "memory" + : "memory" ); seL4_SetMR(0, mr0); @@ -413,24 +448,27 @@ asm volatile ( "pushl %%ebp \n" + "pushl %%ebx \n" "movl %%ecx, %%ebp \n" "movl %%esp, %%ecx \n" + "movl %%edx, %%ebx \n" "leal 1f, %%edx \n" "1: \n" "sysenter \n" + "movl %%ebx, %%edx \n" + "popl %%ebx \n" "movl %%ebp, %%ecx \n" "popl %%ebp \n" : - "=b" (badge), + "+d" (badge), "=S" (info.words[0]), "=D" (msg0), "=c" (msg1) : "a" (seL4_SysReplyRecv), - "b" (dest), "S" (msgInfo.words[0]), "D" (msg0), "c" (msg1) - : "%edx", "memory" + : "memory" ); if (mr0 != seL4_Null) { @@ -452,14 +490,16 @@ { asm volatile ( "pushl %%ebp \n" + "pushl %%ebx \n" "movl %%esp, %%ecx \n" "leal 1f, %%edx \n" "1: \n" "sysenter \n" + "popl %%ebx \n" "popl %%ebp \n" : : "a" (seL4_SysYield) - : "%ebx", "%ecx", "%edx", "%esi", "%edi", "memory" + : "%ecx", "%edx", "%esi", "%edi", "memory" ); } @@ -469,15 +509,17 @@ { asm volatile ( "pushl %%ebp \n" + "pushl %%ebx \n" "movl %%esp, %%ecx \n" + "movl %%edx, %%ebx \n" "leal 1f, %%edx \n" "1: \n" "sysenter \n" + "popl %%ebx \n" "popl %%ebp \n" - : - : "a" (seL4_SysDebugPutChar), - "b" (c) - : "%ecx", "%edx", "%esi", "%edi", "memory" + : "+d" (c) + : "a" (seL4_SysDebugPutChar) + : "%ecx", "%esi", "%edi", "memory" ); } #endif @@ -488,14 +530,16 @@ { asm volatile ( "pushl %%ebp \n" + "pushl %%ebx \n" "movl %%esp, %%ecx \n" "leal 1f, %%edx \n" "1: \n" "sysenter \n" + "popl %%ebx \n" "popl %%ebp \n" : : "a" (seL4_SysDebugHalt) - : "%ebx", "%ecx", "%edx", "%esi", "%edi", "memory" + : "%ecx", "%edx", "%esi", "%edi", "memory" ); } #endif @@ -506,14 +550,16 @@ { asm volatile ( "pushl %%ebp \n" + "pushl %%ebx \n" "movl %%esp, %%ecx \n" "leal 1f, %%edx \n" "1: \n" "sysenter \n" + "popl %%ebx \n" "popl %%ebp \n" : : "a" (seL4_SysDebugSnapshot) - : "%ebx", "%ecx", "%edx", "%esi", "%edi", "memory" + : "%ecx", "%edx", "%esi", "%edi", "memory" ); } #endif @@ -524,14 +570,18 @@ { asm volatile ( "pushl %%ebp \n" + "pushl %%ebx \n" "movl %%esp, %%ecx \n" + "movl %%edx, %%ebx \n" "leal 1f, %%edx \n" "1: \n" "sysenter \n" + "movl %%ebx, %%edx \n" + "popl %%ebx \n" "popl %%ebp \n" - : "=b"(cap) - : "a"(seL4_SysDebugCapIdentify), "b"(cap) - : "%ecx", "%edx", "%esi", "%edi", "memory" + : "+d"(cap) + : "a"(seL4_SysDebugCapIdentify) + : "%ecx", "%esi", "%edi", "memory" ); return (seL4_Uint32)cap; } @@ -546,14 +596,17 @@ asm volatile ( "pushl %%ebp \n" + "pushl %%ebx \n" "movl %%esp, %%ecx \n" + "movl %%edx, %%ebx \n" "leal 1f, %%edx \n" "1: \n" "sysenter \n" + "popl %%ebx \n" "popl %%ebp \n" - : - : "a"(seL4_SysDebugNameThread), "b"(tcb) - : "%ecx", "%edx", "%esi", "%edi", "memory" + : "+d" (tcb) + : "a"(seL4_SysDebugNameThread) + : "%ecx", "%esi", "%edi", "memory" ); } #endif @@ -564,16 +617,18 @@ { asm volatile ( "pushl %%ebp \n" + "pushl %%ebx \n" "movl %%esp, %%ecx \n" + "movl %%edx, %%ebx \n" "leal 1f, %%edx \n" "1: \n" "sysenter \n" + "popl %%ebx \n" "popl %%ebp \n" - : + : "+d" (userfn) : "a" (seL4_SysDebugRun), - "b" (userfn), "S" (userarg) - : "%ecx", "%edx", "%edi", "memory" + : "%ecx", "%edi", "memory" ); } #endif @@ -600,16 +655,19 @@ { asm volatile ( "pushl %%ebp \n" + "pushl %%ebx \n" "movl %%esp, %%ecx \n" + "movl %%edx, %%ebx \n" "leal 1f, %%edx \n" "1: \n" "sysenter \n" + "movl %%ebx, %%edx \n" + "popl %%ebx \n" "popl %%ebp \n" - : "=b" (start) + : "+d" (start) : "a" (seL4_SysBenchmarkDumpLog), - "b" (start), "S" (size) - : "%ecx", "%edx", "%edi", "memory" + : "%ecx", "%edi", "memory" ); return (seL4_Uint32) start; @@ -622,14 +680,17 @@ seL4_Uint32 ret = 0; asm volatile ( "pushl %%ebp \n" + "pushl %%ebx \n" "movl %%esp, %%ecx \n" "leal 1f, %%edx \n" "1: \n" "sysenter \n" + "movl %%ebx, %%edx \n" + "popl %%ebx \n" "popl %%ebp \n" - : "=b" (ret) + : "=d" (ret) : "a" (seL4_SysBenchmarkLogSize) - : "%ecx", "%edx", "%edi", "memory" + : "%ecx", "%edi", "memory" ); return ret;