Implement two new sysarch for arm, ARM_GET_TP and ARM_SET_TP, to work around

the lack of tls on arm.
This commit is contained in:
Olivier Houchard 2005-02-25 22:56:16 +00:00
parent 38e285f83a
commit a74985cdd4
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=142519
2 changed files with 25 additions and 1 deletions

View file

@ -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;

View file

@ -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