From a74985cdd4d00da10d13579ee9be190c336a5b8b Mon Sep 17 00:00:00 2001 From: Olivier Houchard Date: Fri, 25 Feb 2005 22:56:16 +0000 Subject: [PATCH] Implement two new sysarch for arm, ARM_GET_TP and ARM_SET_TP, to work around the lack of tls on arm. --- sys/arm/arm/sys_machdep.c | 23 ++++++++++++++++++++++- sys/arm/include/sysarch.h | 3 +++ 2 files changed, 25 insertions(+), 1 deletion(-) diff --git a/sys/arm/arm/sys_machdep.c b/sys/arm/arm/sys_machdep.c index ed8960c1f6e..16ec846b926 100644 --- a/sys/arm/arm/sys_machdep.c +++ b/sys/arm/arm/sys_machdep.c @@ -81,6 +81,22 @@ arm32_drain_writebuf(struct thread *td, void *args) return(0); } +static int +arm32_set_tp(struct thread *td, void *args) +{ + + td->td_md.md_tp = args; + return (0); +} + +static int +arm32_get_tp(struct thread *td, void *args) +{ + + td->td_retval[0] = (uint32_t)td->td_md.md_tp; + return (0); +} + int sysarch(td, uap) struct thread *td; @@ -96,7 +112,12 @@ sysarch(td, uap) case ARM_DRAIN_WRITEBUF : error = arm32_drain_writebuf(td, uap->parms); break; - + case ARM_SET_TP: + error = arm32_set_tp(td, uap->parms); + break; + case ARM_GET_TP: + error = arm32_get_tp(td, uap->parms); + break; default: error = EINVAL; break; diff --git a/sys/arm/include/sysarch.h b/sys/arm/include/sysarch.h index 6a8a6d7cb7b..d0c0c47c4ee 100644 --- a/sys/arm/include/sysarch.h +++ b/sys/arm/include/sysarch.h @@ -50,6 +50,8 @@ #define ARM_SYNC_ICACHE 0 #define ARM_DRAIN_WRITEBUF 1 +#define ARM_SET_TP 2 +#define ARM_GET_TP 3 struct arm_sync_icache_args { uintptr_t addr; /* Virtual start address */ @@ -60,6 +62,7 @@ struct arm_sync_icache_args { __BEGIN_DECLS int arm_sync_icache (u_int addr, int len); int arm_drain_writebuf (void); +int sysarch(int, void *); __END_DECLS #endif