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
This commit is contained in:
@@ -23,16 +23,19 @@ struct iframe *m68k_get_user_iframe(void);
|
|||||||
extern inline struct thread *
|
extern inline struct thread *
|
||||||
arch_thread_get_current_thread(void)
|
arch_thread_get_current_thread(void)
|
||||||
{
|
{
|
||||||
struct thread *t;
|
uint64 v = 0;
|
||||||
asm volatile("mfsprg2 %0" : "=r"(t));
|
asm volatile("pmove %%srp,(%0)" : : "a"(&v));
|
||||||
return t;
|
return (struct thread *)(v & 0xffffffff);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
extern inline void
|
extern inline void
|
||||||
arch_thread_set_current_thread(struct thread *t)
|
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));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user