Skip to content

Commit

Permalink
FRV: Optimise the system call exit path in entry.S [ver #2]
Browse files Browse the repository at this point in the history
Optimise the system call exit path in entry.S by packing some instructions.

Suggested-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: David Howells <dhowells@redhat.com>
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
  • Loading branch information
David Howells authored and Al Viro committed Jun 1, 2012
1 parent 1e5ef91 commit a2eddc7
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions arch/frv/kernel/entry.S
Original file line number Diff line number Diff line change
Expand Up @@ -905,18 +905,19 @@ __syscall_call:
__syscall_exit:
LEDS 0x6300

sti gr8,@(gr28,#REG_GR(8)) ; save return value
# keep current PSR in GR23
movsg psr,gr23

# rebuild saved psr - execve will change it for init/main.c
ldi @(gr28,#REG_PSR),gr22

sti.p gr8,@(gr28,#REG_GR(8)) ; save return value

# rebuild saved psr - execve will change it for init/main.c
srli gr22,#1,gr5
andi.p gr22,#~PSR_PS,gr22
andi gr5,#PSR_PS,gr5
or gr5,gr22,gr22
ori gr22,#PSR_S,gr22

# keep current PSR in GR23
movsg psr,gr23
ori.p gr22,#PSR_S,gr22

# make sure we don't miss an interrupt setting need_resched or sigpending between
# sampling and the RETT
Expand Down

0 comments on commit a2eddc7

Please sign in to comment.