From 8838f5e94b820644454afa505c554fc80e54a78e Mon Sep 17 00:00:00 2001 From: visa <> Date: Thu, 20 Apr 2017 16:07:52 +0000 Subject: [PATCH] Get TCB address using the RDHWR instruction instead of __get_tcb(). This gives fast access to the address on systems that implement the UserLocal register. TCB caching is still used when running in the single-threaded mode in order not to penalize old systems. The kernel counterpart of this change must be in place before using this diff! With guenther@ --- src/include/tib.h | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/src/include/tib.h b/src/include/tib.h index 7dff1168..597d2496 100644 --- a/src/include/tib.h +++ b/src/include/tib.h @@ -1,4 +1,4 @@ -/* $OpenBSD: tib.h,v 1.3 2016/05/07 19:05:21 guenther Exp $ */ +/* $OpenBSD: tib.h,v 1.4 2017/04/20 16:07:52 visa Exp $ */ /* * Copyright (c) 2011,2014 Philip Guenther * @@ -84,11 +84,9 @@ */ -/* If doesn't provide a better way, then use the default */ -#ifdef TCB_GET +/* All archs but mips64 have fast TCB_GET() and don't need caching */ +#ifndef __mips64__ # define TCB_HAVE_MD_GET 1 -#else -# define TCB_GET() __get_tcb() #endif #ifdef TCB_SET # define TCB_HAVE_MD_SET 1