@@ -400,8 +400,10 @@ pub(in crate::imp) unsafe fn syscall5(
400
400
a4 : ArgReg < ' _ , A4 > ,
401
401
) -> RetReg < R0 > {
402
402
let r0;
403
- // As in syscall 4, use xchg to handle a3. a4 should go in edi, and
404
- // we can use that register as an operand.
403
+ // As in `syscall4`, use xchg to handle a3. a4 should go in edi, and we can
404
+ // use that register as an operand. Unlike in `indirect_syscall5`, we don't
405
+ // have a `callee` operand taking up a register, so we have enough
406
+ // registers and don't need to use a slice.
405
407
asm ! (
406
408
"xchg esi, {a3}" ,
407
409
"int $$0x80" ,
@@ -428,6 +430,7 @@ pub(in crate::imp) unsafe fn syscall5_readonly(
428
430
a4 : ArgReg < ' _ , A4 > ,
429
431
) -> RetReg < R0 > {
430
432
let r0;
433
+ // See the comments in `syscall5`.
431
434
asm ! (
432
435
"xchg esi, {a3}" ,
433
436
"int $$0x80" ,
@@ -455,14 +458,7 @@ pub(in crate::imp) unsafe fn syscall6(
455
458
a5 : ArgReg < ' _ , A5 > ,
456
459
) -> RetReg < R0 > {
457
460
let r0;
458
- // Oof. a3 should go in esi, and a5 should go in ebp, and `asm!` won't
459
- // let us use either of those registers as operands. And we can't request
460
- // stack slots. And there are no other registers free. Use eax as a
461
- // temporary pointer to a slice, since it gets clobbered as the return
462
- // value anyway.
463
- //
464
- // This is another reason that syscalls should be compiler intrinsics
465
- // rather than inline asm.
461
+ // See the comments in `indirect_syscall6`.
466
462
asm ! (
467
463
"push ebp" ,
468
464
"push esi" ,
@@ -494,6 +490,7 @@ pub(in crate::imp) unsafe fn syscall6_readonly(
494
490
a5 : ArgReg < ' _ , A5 > ,
495
491
) -> RetReg < R0 > {
496
492
let r0;
493
+ // See the comments in `indirect_syscall6`.
497
494
asm ! (
498
495
"push ebp" ,
499
496
"push esi" ,
0 commit comments