Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 279725
b: refs/heads/master
c: bbc6f1b
h: refs/heads/master
i:
  279723: ada4401
v: v3
  • Loading branch information
Greg Ungerer committed Dec 30, 2011
1 parent 1af431e commit 568fc2d
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 3 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 88be3515934004d271398129ba7145635e95127e
refs/heads/master: bbc6f1ba509cf9cda42ce63bbd40afe577ab028e
10 changes: 9 additions & 1 deletion trunk/arch/m68k/include/asm/entry.h
Original file line number Diff line number Diff line change
Expand Up @@ -222,16 +222,24 @@
* Non-MMU systems do not reserve %a2 in this way, and this definition is
* not used for them.
*/
#ifdef CONFIG_MMU

#define curptr a2

#define GET_CURRENT(tmp) get_current tmp
.macro get_current reg=%d0
movel %sp,\reg
andw #-THREAD_SIZE,\reg
andl #-THREAD_SIZE,\reg
movel \reg,%curptr
movel %curptr@,%curptr
.endm

#else

#define GET_CURRENT(tmp)

#endif /* CONFIG_MMU */

#else /* C source */

#define STR(X) STR1(X)
Expand Down
3 changes: 3 additions & 0 deletions trunk/arch/m68k/kernel/entry_no.S
Original file line number Diff line number Diff line change
Expand Up @@ -44,13 +44,15 @@

ENTRY(buserr)
SAVE_ALL_INT
GET_CURRENT(%d0)
movel %sp,%sp@- /* stack frame pointer argument */
jsr buserr_c
addql #4,%sp
jra ret_from_exception

ENTRY(trap)
SAVE_ALL_INT
GET_CURRENT(%d0)
movel %sp,%sp@- /* stack frame pointer argument */
jsr trap_c
addql #4,%sp
Expand All @@ -61,6 +63,7 @@ ENTRY(trap)
.globl dbginterrupt
ENTRY(dbginterrupt)
SAVE_ALL_INT
GET_CURRENT(%d0)
movel %sp,%sp@- /* stack frame pointer argument */
jsr dbginterrupt_c
addql #4,%sp
Expand Down
6 changes: 5 additions & 1 deletion trunk/arch/m68k/platform/coldfire/entry.S
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ enosys:
ENTRY(system_call)
SAVE_ALL_SYS
move #0x2000,%sr /* enable intrs again */
GET_CURRENT(%d2)

cmpl #NR_syscalls,%d0
jcc enosys
Expand Down Expand Up @@ -165,6 +166,7 @@ Lsignal_return:
*/
ENTRY(inthandler)
SAVE_ALL_INT
GET_CURRENT(%d2)

movew %sp@(PT_OFF_FORMATVEC),%d0 /* put exception # in d0 */
andl #0x03fc,%d0 /* mask out vector only */
Expand All @@ -190,7 +192,9 @@ ENTRY(resume)
movel %sp,%a0@(TASK_THREAD+THREAD_KSP) /* save kernel stack pointer */
RDUSP /* movel %usp,%a3 */
movel %a3,%a0@(TASK_THREAD+THREAD_USP) /* save thread user stack */

#ifdef CONFIG_MMU
movel %a1,%a2 /* set new current */
#endif
movel %a1@(TASK_THREAD+THREAD_USP),%a3 /* restore thread user stack */
WRUSP /* movel %a3,%usp */
movel %a1@(TASK_THREAD+THREAD_KSP),%sp /* restore new kernel stack */
Expand Down

0 comments on commit 568fc2d

Please sign in to comment.