From b5b2589231847905229d78588316e708cbd03af1 Mon Sep 17 00:00:00 2001 From: Denys Vlasenko Date: Tue, 30 Aug 2011 19:04:54 +0200 Subject: [PATCH] Small optimization on AVR32 * syscall.c (syscall_enter): Optimize tcp->u_arg[i] setting from regs.FOO for AVR32. Signed-off-by: Denys Vlasenko --- syscall.c | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/syscall.c b/syscall.c index 89861ad0..f8c4c8ba 100644 --- a/syscall.c +++ b/syscall.c @@ -1503,15 +1503,14 @@ syscall_enter(struct tcb *tcp) for (i = 0; i < nargs; ++i) tcp->u_arg[i] = regs.uregs[i]; # elif defined(AVR32) - /* TODO: make it faster by unrolling into 6 direct assignments */ - static const unsigned long *argregp[MAX_ARGS] = { ®s.r12, - ®s.r11, - ®s.r10, - ®s.r9, - ®s.r5, - ®s.r3 }; - for (i = 0; i < nargs; ++i) - tcp->u_arg[i] = *argregp[i]; + (void)i; + (void)nargs; + tcp->u_arg[0] = regs.r12; + tcp->u_arg[1] = regs.r11; + tcp->u_arg[2] = regs.r10; + tcp->u_arg[3] = regs.r9; + tcp->u_arg[4] = regs.r5; + tcp->u_arg[5] = regs.r3; # elif defined(BFIN) static const int argreg[MAX_ARGS] = { PT_R0, PT_R1, PT_R2, PT_R3, PT_R4, PT_R5 }; -- 2.40.0