From d40bcaab8e4e7897e6ae5b199a5a6441694b9018 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=C3=A7ois=20Revol?= Date: Tue, 23 Oct 2007 23:48:02 +0000 Subject: [PATCH] m68k code. We will use SRP (supervisor root pointer) register to hold the current thread pointer. Its use by the pmmu is optional and I don't plan on using it. There are 32 other bits left. Wonder if weshouldn't use it for system_time() instead... will see, but there are no other usable regs. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@22696 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- headers/private/kernel/arch/m68k/arch_thread.h | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/headers/private/kernel/arch/m68k/arch_thread.h b/headers/private/kernel/arch/m68k/arch_thread.h index 6a79fc5160..f3efc7fcd8 100644 --- a/headers/private/kernel/arch/m68k/arch_thread.h +++ b/headers/private/kernel/arch/m68k/arch_thread.h @@ -23,16 +23,19 @@ struct iframe *m68k_get_user_iframe(void); extern inline struct thread * arch_thread_get_current_thread(void) { - struct thread *t; - asm volatile("mfsprg2 %0" : "=r"(t)); - return t; + uint64 v = 0; + asm volatile("pmove %%srp,(%0)" : : "a"(&v)); + return (struct thread *)(v & 0xffffffff); } extern inline void arch_thread_set_current_thread(struct thread *t) { - asm volatile("mtsprg2 %0" : : "r"(t)); + uint64 v; + asm volatile("pmove %%srp,(%0)\n" \ + "move %1,(4,%0)\n" \ + "pmove (%0),%%srp" : : "a"(&v), "d"(t)); }