diff options
author | David Howells <dhowells@redhat.com> | 2012-05-01 16:31:33 -0400 |
---|---|---|
committer | Al Viro <viro@zeniv.linux.org.uk> | 2012-06-01 12:59:37 -0400 |
commit | 1e5ef91556d0985e765252754ca90595deafb793 (patch) | |
tree | 252de12100a862b53054081d6f6266985dc2224c /arch | |
parent | 137c3c469f5a940c8c095b734373581c3a0d3955 (diff) |
FRV: Shrink TIF_WORK_MASK [ver #2]
Shrink TIF_WORK_MASK so that it will fit in the 12-bit signed immediate
operand field of an ANDI instruction.
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>
Diffstat (limited to 'arch')
-rw-r--r-- | arch/frv/include/asm/thread_info.h | 16 | ||||
-rw-r--r-- | arch/frv/kernel/entry.S | 12 |
2 files changed, 15 insertions, 13 deletions
diff --git a/arch/frv/include/asm/thread_info.h b/arch/frv/include/asm/thread_info.h index 54ab13a0de41..0ff03a33c81e 100644 --- a/arch/frv/include/asm/thread_info.h +++ b/arch/frv/include/asm/thread_info.h | |||
@@ -94,8 +94,8 @@ register struct thread_info *__current_thread_info asm("gr15"); | |||
94 | #define TIF_NEED_RESCHED 3 /* rescheduling necessary */ | 94 | #define TIF_NEED_RESCHED 3 /* rescheduling necessary */ |
95 | #define TIF_SINGLESTEP 4 /* restore singlestep on return to user mode */ | 95 | #define TIF_SINGLESTEP 4 /* restore singlestep on return to user mode */ |
96 | #define TIF_RESTORE_SIGMASK 5 /* restore signal mask in do_signal() */ | 96 | #define TIF_RESTORE_SIGMASK 5 /* restore signal mask in do_signal() */ |
97 | #define TIF_POLLING_NRFLAG 16 /* true if poll_idle() is polling TIF_NEED_RESCHED */ | 97 | #define TIF_POLLING_NRFLAG 6 /* true if poll_idle() is polling TIF_NEED_RESCHED */ |
98 | #define TIF_MEMDIE 17 /* is terminating due to OOM killer */ | 98 | #define TIF_MEMDIE 7 /* is terminating due to OOM killer */ |
99 | 99 | ||
100 | #define _TIF_SYSCALL_TRACE (1 << TIF_SYSCALL_TRACE) | 100 | #define _TIF_SYSCALL_TRACE (1 << TIF_SYSCALL_TRACE) |
101 | #define _TIF_NOTIFY_RESUME (1 << TIF_NOTIFY_RESUME) | 101 | #define _TIF_NOTIFY_RESUME (1 << TIF_NOTIFY_RESUME) |
@@ -105,8 +105,16 @@ register struct thread_info *__current_thread_info asm("gr15"); | |||
105 | #define _TIF_RESTORE_SIGMASK (1 << TIF_RESTORE_SIGMASK) | 105 | #define _TIF_RESTORE_SIGMASK (1 << TIF_RESTORE_SIGMASK) |
106 | #define _TIF_POLLING_NRFLAG (1 << TIF_POLLING_NRFLAG) | 106 | #define _TIF_POLLING_NRFLAG (1 << TIF_POLLING_NRFLAG) |
107 | 107 | ||
108 | #define _TIF_WORK_MASK 0x0000FFFE /* work to do on interrupt/exception return */ | 108 | /* work to do on interrupt/exception return */ |
109 | #define _TIF_ALLWORK_MASK 0x0000FFFF /* work to do on any return to u-space */ | 109 | #define _TIF_WORK_MASK \ |
110 | (_TIF_NOTIFY_RESUME | _TIF_SIGPENDING | _TIF_NEED_RESCHED | _TIF_SINGLESTEP) | ||
111 | |||
112 | /* work to do on any return to u-space */ | ||
113 | #define _TIF_ALLWORK_MASK (_TIF_WORK_MASK | _TIF_SYSCALL_TRACE) | ||
114 | |||
115 | #if _TIF_ALLWORK_MASK >= 0x2000 | ||
116 | #error "_TIF_ALLWORK_MASK won't fit in an ANDI now (see entry.S)" | ||
117 | #endif | ||
110 | 118 | ||
111 | /* | 119 | /* |
112 | * Thread-synchronous status. | 120 | * Thread-synchronous status. |
diff --git a/arch/frv/kernel/entry.S b/arch/frv/kernel/entry.S index ff3092c18ca2..03da263e112a 100644 --- a/arch/frv/kernel/entry.S +++ b/arch/frv/kernel/entry.S | |||
@@ -924,9 +924,7 @@ __syscall_exit: | |||
924 | movgs gr23,psr | 924 | movgs gr23,psr |
925 | 925 | ||
926 | ldi @(gr15,#TI_FLAGS),gr4 | 926 | ldi @(gr15,#TI_FLAGS),gr4 |
927 | sethi.p %hi(_TIF_ALLWORK_MASK),gr5 | 927 | andicc gr4,#_TIF_ALLWORK_MASK,gr0,icc0 |
928 | setlo %lo(_TIF_ALLWORK_MASK),gr5 | ||
929 | andcc gr4,gr5,gr0,icc0 | ||
930 | bne icc0,#0,__syscall_exit_work | 928 | bne icc0,#0,__syscall_exit_work |
931 | 929 | ||
932 | # restore all registers and return | 930 | # restore all registers and return |
@@ -1111,9 +1109,7 @@ __entry_resume_userspace: | |||
1111 | __entry_return_from_user_interrupt: | 1109 | __entry_return_from_user_interrupt: |
1112 | LEDS 0x6402 | 1110 | LEDS 0x6402 |
1113 | ldi @(gr15,#TI_FLAGS),gr4 | 1111 | ldi @(gr15,#TI_FLAGS),gr4 |
1114 | sethi.p %hi(_TIF_WORK_MASK),gr5 | 1112 | andicc gr4,#_TIF_WORK_MASK,gr0,icc0 |
1115 | setlo %lo(_TIF_WORK_MASK),gr5 | ||
1116 | andcc gr4,gr5,gr0,icc0 | ||
1117 | beq icc0,#1,__entry_return_direct | 1113 | beq icc0,#1,__entry_return_direct |
1118 | 1114 | ||
1119 | __entry_work_pending: | 1115 | __entry_work_pending: |
@@ -1133,9 +1129,7 @@ __entry_work_resched: | |||
1133 | 1129 | ||
1134 | LEDS 0x6401 | 1130 | LEDS 0x6401 |
1135 | ldi @(gr15,#TI_FLAGS),gr4 | 1131 | ldi @(gr15,#TI_FLAGS),gr4 |
1136 | sethi.p %hi(_TIF_WORK_MASK),gr5 | 1132 | andicc gr4,#_TIF_WORK_MASK,gr0,icc0 |
1137 | setlo %lo(_TIF_WORK_MASK),gr5 | ||
1138 | andcc gr4,gr5,gr0,icc0 | ||
1139 | beq icc0,#1,__entry_return_direct | 1133 | beq icc0,#1,__entry_return_direct |
1140 | andicc gr4,#_TIF_NEED_RESCHED,gr0,icc0 | 1134 | andicc gr4,#_TIF_NEED_RESCHED,gr0,icc0 |
1141 | bne icc0,#1,__entry_work_resched | 1135 | bne icc0,#1,__entry_work_resched |