When emulating rdhwr for TLS, use the 32-bit offset under COMPAT_FREEBSD32.
This commit is contained in:
parent
54da2fb8f2
commit
22c6822677
@ -32,6 +32,10 @@
|
||||
#ifndef __MIPS_TLS_H__
|
||||
#define __MIPS_TLS_H__
|
||||
|
||||
#if defined(_KERNEL) && !defined(KLD_MODULE) && !defined(_STANDALONE)
|
||||
#include "opt_compat.h"
|
||||
#endif
|
||||
|
||||
/*
|
||||
* TLS parameters
|
||||
*/
|
||||
@ -41,6 +45,9 @@
|
||||
|
||||
#ifdef __mips_n64
|
||||
#define TLS_TCB_SIZE 16
|
||||
#ifdef COMPAT_FREEBSD32
|
||||
#define TLS_TCB_SIZE32 8
|
||||
#endif
|
||||
#else
|
||||
#define TLS_TCB_SIZE 8
|
||||
#endif
|
||||
|
@ -814,6 +814,11 @@ dofault:
|
||||
if (inst.RType.rd == 29) {
|
||||
frame_regs = &(trapframe->zero);
|
||||
frame_regs[inst.RType.rt] = (register_t)(intptr_t)td->td_md.md_tls;
|
||||
#if defined(__mips_n64) && defined(COMPAT_FREEBSD32)
|
||||
if (SV_PROC_FLAG(td->td_proc, SV_ILP32))
|
||||
frame_regs[inst.RType.rt] += TLS_TP_OFFSET + TLS_TCB_SIZE32;
|
||||
else
|
||||
#endif
|
||||
frame_regs[inst.RType.rt] += TLS_TP_OFFSET + TLS_TCB_SIZE;
|
||||
trapframe->pc += sizeof(int);
|
||||
goto out;
|
||||
|
Loading…
x
Reference in New Issue
Block a user