Browse Source

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@
OPENBSD_6_2
visa 7 years ago
parent
commit
8838f5e94b
1 changed files with 3 additions and 5 deletions
  1. +3
    -5
      src/include/tib.h

+ 3
- 5
src/include/tib.h View File

@ -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 <guenther@openbsd.org>
*
@ -84,11 +84,9 @@
*/
/* If <machine/tcb.h> 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


Loading…
Cancel
Save