From c8baa23e56bd87cd702bbdbc2a7d36c115769d75 Mon Sep 17 00:00:00 2001 From: Marcel Moolenaar Date: Thu, 24 Jul 2003 07:41:08 +0000 Subject: [PATCH] Implement alpha_pal_wrunique() and alpha_pal_rdunique(). Both are used to set and get the thread pointer. Note that a context switch will automaticly save and restore the thread pointer. --- sys/alpha/include/alpha_cpu.h | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/sys/alpha/include/alpha_cpu.h b/sys/alpha/include/alpha_cpu.h index d1b34366a23..32b00ffaf10 100644 --- a/sys/alpha/include/alpha_cpu.h +++ b/sys/alpha/include/alpha_cpu.h @@ -458,6 +458,23 @@ alpha_pal_rdval(void) return v0; } +static __inline void +alpha_pal_wrunique(u_int64_t tp) +{ + register u_int64_t a0 __asm__("$16") = tp; + __asm__ __volatile__("call_pal 0x9f # PAL_wrunique" + : "+r" (a0) : : "$1", "$22", "$23", "$24", "$25"); +} + +static __inline u_int64_t +alpha_pal_rdunique(void) +{ + register u_int64_t v0 __asm__("$0"); + __asm__ __volatile__("call_pal 0x9e # PAL_rdunique" + : "=r" (v0) : : "$1", "$22", "$23", "$24", "$25"); + return (v0); +} + static __inline void alpha_pal_tbi(u_int64_t op, u_int64_t va) {