| ... | ... | @@ -72,11 +72,17 @@ pub fn syscall6( |
| 72 | 72 | arg5: usize, |
| 73 | 73 | arg6: usize, |
| 74 | 74 | ) usize { |
| 75 | // The 6th argument is passed via memory as we're out of registers if ebp is |
| 76 | // used as frame pointer. We push arg6 value on the stack before changing |
| 77 | // ebp or esp as the compiler may reference it as an offset relative to one |
| 78 | // of those two registers. |
| 75 | 79 | return asm volatile ( |
| 76 | | \\ push %%ebp |
| 77 | | \\ mov %[arg6], %%ebp |
| 78 | | \\ int $0x80 |
| 79 | | \\ pop %%ebp |
| 80 | \\ push %[arg6] |
| 81 | \\ push %%ebp |
| 82 | \\ mov 4(%%esp), %%ebp |
| 83 | \\ int $0x80 |
| 84 | \\ pop %%ebp |
| 85 | \\ add $4, %%esp |
| 80 | 86 | : [ret] "={eax}" (-> usize) |
| 81 | 87 | : [number] "{eax}" (number), |
| 82 | 88 | [arg1] "{ebx}" (arg1), |