From owner-svn-src-all@FreeBSD.ORG Tue Mar 6 03:27:58 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A2D81106566C; Tue, 6 Mar 2012 03:27:58 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 8E74A8FC19; Tue, 6 Mar 2012 03:27:58 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q263RwiR017507; Tue, 6 Mar 2012 03:27:58 GMT (envelope-from gonzo@svn.freebsd.org) Received: (from gonzo@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q263RwIu017505; Tue, 6 Mar 2012 03:27:58 GMT (envelope-from gonzo@svn.freebsd.org) Message-Id: <201203060327.q263RwIu017505@svn.freebsd.org> From: Oleksandr Tymoshenko Date: Tue, 6 Mar 2012 03:27:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r232579 - head/lib/libthr/arch/mips/include X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 06 Mar 2012 03:27:58 -0000 Author: gonzo Date: Tue Mar 6 03:27:58 2012 New Revision: 232579 URL: http://svn.freebsd.org/changeset/base/232579 Log: - Switch to saving non-offseted pointer to TLS block in order too keep things simple Modified: head/lib/libthr/arch/mips/include/pthread_md.h Modified: head/lib/libthr/arch/mips/include/pthread_md.h ============================================================================== --- head/lib/libthr/arch/mips/include/pthread_md.h Tue Mar 6 03:27:08 2012 (r232578) +++ head/lib/libthr/arch/mips/include/pthread_md.h Tue Mar 6 03:27:58 2012 (r232579) @@ -35,15 +35,11 @@ #include #include +#include #include #define CPU_SPINWAIT #define DTV_OFFSET offsetof(struct tcb, tcb_dtv) -#ifdef __mips_n64 -#define TP_OFFSET 0x7010 -#else -#define TP_OFFSET 0x7008 -#endif /* * Variant I tcb. The structure layout is fixed, don't blindly @@ -65,7 +61,7 @@ static __inline void _tcb_set(struct tcb *tcb) { - sysarch(MIPS_SET_TLS, ((uint8_t*)tcb + TP_OFFSET)); + sysarch(MIPS_SET_TLS, tcb); } /* @@ -74,10 +70,10 @@ _tcb_set(struct tcb *tcb) static __inline struct tcb * _tcb_get(void) { - uint8_t *tcb; + struct tcb *tcb; sysarch(MIPS_GET_TLS, &tcb); - return ((struct tcb *)(tcb - TP_OFFSET)); + return tcb; } extern struct pthread *_thr_initial;