@@ -416,8 +416,10 @@ pub(in crate::imp) unsafe fn syscall5(
416
416
a4 : ArgReg < ' _ , A4 > ,
417
417
) -> RetReg < R0 > {
418
418
let r0;
419
- // As in syscall 4, use xchg to handle a3. a4 should go in edi, and
420
- // we can use that register as an operand.
419
+ // As in `syscall4`, use xchg to handle a3. a4 should go in edi, and we can
420
+ // use that register as an operand. Unlike in `indirect_syscall5`, we don't
421
+ // have a `callee` operand taking up a register, so we have enough
422
+ // registers and don't need to use a slice.
421
423
asm ! (
422
424
".ifnes \" {a3}\" ,\" esi\" " ,
423
425
"xchg esi, {a3}" ,
@@ -448,6 +450,7 @@ pub(in crate::imp) unsafe fn syscall5_readonly(
448
450
a4 : ArgReg < ' _ , A4 > ,
449
451
) -> RetReg < R0 > {
450
452
let r0;
453
+ // See the comments in `syscall5`.
451
454
asm ! (
452
455
".ifnes \" {a3}\" ,\" esi\" " ,
453
456
"xchg esi, {a3}" ,
@@ -479,14 +482,7 @@ pub(in crate::imp) unsafe fn syscall6(
479
482
a5 : ArgReg < ' _ , A5 > ,
480
483
) -> RetReg < R0 > {
481
484
let r0;
482
- // Oof. a3 should go in esi, and a5 should go in ebp, and `asm!` won't
483
- // let us use either of those registers as operands. And we can't request
484
- // stack slots. And there are no other registers free. Use eax as a
485
- // temporary pointer to a slice, since it gets clobbered as the return
486
- // value anyway.
487
- //
488
- // This is another reason that syscalls should be compiler intrinsics
489
- // rather than inline asm.
485
+ // See the comments in `indirect_syscall6`.
490
486
asm ! (
491
487
"push ebp" ,
492
488
"push esi" ,
@@ -518,6 +514,7 @@ pub(in crate::imp) unsafe fn syscall6_readonly(
518
514
a5 : ArgReg < ' _ , A5 > ,
519
515
) -> RetReg < R0 > {
520
516
let r0;
517
+ // See the comments in `indirect_syscall6`.
521
518
asm ! (
522
519
"push ebp" ,
523
520
"push esi" ,
0 commit comments