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:
parent
38e285f83a
commit
a74985cdd4
@ -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;
|
||||
|
@ -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
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user