diff options
author | cognet <cognet@FreeBSD.org> | 2005-02-25 22:56:16 +0000 |
---|---|---|
committer | cognet <cognet@FreeBSD.org> | 2005-02-25 22:56:16 +0000 |
commit | 3aab48710898e890ef95204bb96f93dff24a0a3c (patch) | |
tree | 3680e055eb1888876b1d8d14c5b596374c52840f /sys/arm | |
parent | 5b6d27e25bbaea8893cf09e2da0d00554b02c4a7 (diff) | |
download | FreeBSD-src-3aab48710898e890ef95204bb96f93dff24a0a3c.zip FreeBSD-src-3aab48710898e890ef95204bb96f93dff24a0a3c.tar.gz |
Implement two new sysarch for arm, ARM_GET_TP and ARM_SET_TP, to work around
the lack of tls on arm.
Diffstat (limited to 'sys/arm')
-rw-r--r-- | sys/arm/arm/sys_machdep.c | 23 | ||||
-rw-r--r-- | sys/arm/include/sysarch.h | 3 |
2 files changed, 25 insertions, 1 deletions
diff --git a/sys/arm/arm/sys_machdep.c b/sys/arm/arm/sys_machdep.c index ed8960c..16ec846 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 6a8a6d7..d0c0c47 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 |