|
Packit Service |
82fcde |
/* Copyright (C) 2010-2018 Free Software Foundation, Inc.
|
|
Packit Service |
82fcde |
This file is part of the GNU C Library.
|
|
Packit Service |
82fcde |
Contributed by Maxim Kuvyrkov <maxim@codesourcery.com>, 2010.
|
|
Packit Service |
82fcde |
|
|
Packit Service |
82fcde |
The GNU C Library is free software; you can redistribute it and/or
|
|
Packit Service |
82fcde |
modify it under the terms of the GNU Lesser General Public
|
|
Packit Service |
82fcde |
License as published by the Free Software Foundation; either
|
|
Packit Service |
82fcde |
version 2.1 of the License, or (at your option) any later version.
|
|
Packit Service |
82fcde |
|
|
Packit Service |
82fcde |
In addition to the permissions in the GNU Lesser General Public
|
|
Packit Service |
82fcde |
License, the Free Software Foundation gives you unlimited
|
|
Packit Service |
82fcde |
permission to link the compiled version of this file with other
|
|
Packit Service |
82fcde |
programs, and to distribute those programs without any restriction
|
|
Packit Service |
82fcde |
coming from the use of this file. (The GNU Lesser General Public
|
|
Packit Service |
82fcde |
License restrictions do apply in other respects; for example, they
|
|
Packit Service |
82fcde |
cover modification of the file, and distribution when not linked
|
|
Packit Service |
82fcde |
into another program.)
|
|
Packit Service |
82fcde |
|
|
Packit Service |
82fcde |
Note that people who make modified versions of this file are not
|
|
Packit Service |
82fcde |
obligated to grant this special exception for their modified
|
|
Packit Service |
82fcde |
versions; it is their choice whether to do so. The GNU Lesser
|
|
Packit Service |
82fcde |
General Public License gives permission to release a modified
|
|
Packit Service |
82fcde |
version without this exception; this exception also makes it
|
|
Packit Service |
82fcde |
possible to release a modified version which carries forward this
|
|
Packit Service |
82fcde |
exception.
|
|
Packit Service |
82fcde |
|
|
Packit Service |
82fcde |
The GNU C Library is distributed in the hope that it will be useful,
|
|
Packit Service |
82fcde |
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
Packit Service |
82fcde |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
Packit Service |
82fcde |
Lesser General Public License for more details.
|
|
Packit Service |
82fcde |
|
|
Packit Service |
82fcde |
You should have received a copy of the GNU Lesser General Public
|
|
Packit Service |
82fcde |
License along with the GNU C Library. If not, see
|
|
Packit Service |
82fcde |
<http://www.gnu.org/licenses/>. */
|
|
Packit Service |
82fcde |
|
|
Packit Service |
82fcde |
#include <sysdep.h>
|
|
Packit Service |
82fcde |
#include <m68k-vdso.h>
|
|
Packit Service |
82fcde |
|
|
Packit Service |
82fcde |
.text
|
|
Packit Service |
82fcde |
|
|
Packit Service |
82fcde |
.hidden __vdso_read_tp_stub
|
|
Packit Service |
82fcde |
ENTRY (__vdso_read_tp_stub)
|
|
Packit Service |
82fcde |
move.l #__NR_get_thread_area, %d0
|
|
Packit Service |
82fcde |
trap #0
|
|
Packit Service |
82fcde |
move.l %d0, %a0
|
|
Packit Service |
82fcde |
rts
|
|
Packit Service |
82fcde |
END (__vdso_read_tp_stub)
|
|
Packit Service |
82fcde |
|
|
Packit Service |
82fcde |
# ifdef SHARED
|
|
Packit Service |
82fcde |
/* GCC will emit calls to this routine. Linux has an
|
|
Packit Service |
82fcde |
equivalent helper function (which clobbers fewer registers than
|
|
Packit Service |
82fcde |
a normal function call) in a vdso; tail call to the
|
|
Packit Service |
82fcde |
helper. */
|
|
Packit Service |
82fcde |
# if IS_IN (rtld)
|
|
Packit Service |
82fcde |
/* rtld gets a hidden copy of __m68k_read_tp. */
|
|
Packit Service |
82fcde |
.hidden __m68k_read_tp
|
|
Packit Service |
82fcde |
# endif
|
|
Packit Service |
82fcde |
ENTRY (__m68k_read_tp)
|
|
Packit Service |
82fcde |
LOAD_GOT (%a0)
|
|
Packit Service |
82fcde |
move.l M68K_VDSO_SYMBOL (__vdso_read_tp)@GOT(%a0), %a0
|
|
Packit Service |
82fcde |
move.l (%a0), %a0
|
|
Packit Service |
82fcde |
jmp (%a0)
|
|
Packit Service |
82fcde |
END (__m68k_read_tp)
|
|
Packit Service |
82fcde |
|
|
Packit Service |
82fcde |
/* The following two stubs are for macros in atomic.h, they can't
|
|
Packit Service |
82fcde |
clobber anything. */
|
|
Packit Service |
82fcde |
|
|
Packit Service |
82fcde |
.hidden __vdso_atomic_cmpxchg_32_stub
|
|
Packit Service |
82fcde |
ENTRY (__vdso_atomic_cmpxchg_32_stub)
|
|
Packit Service |
82fcde |
move.l %d2, -(%sp)
|
|
Packit Service |
82fcde |
cfi_adjust_cfa_offset (4)
|
|
Packit Service |
82fcde |
cfi_rel_offset (%d2, 0)
|
|
Packit Service |
82fcde |
move.l %d0, %d2
|
|
Packit Service |
82fcde |
move.l #SYS_ify (atomic_cmpxchg_32), %d0
|
|
Packit Service |
82fcde |
trap #0
|
|
Packit Service |
82fcde |
move.l (%sp)+, %d2
|
|
Packit Service |
82fcde |
cfi_adjust_cfa_offset (-4)
|
|
Packit Service |
82fcde |
cfi_restore (%d2)
|
|
Packit Service |
82fcde |
rts
|
|
Packit Service |
82fcde |
END (__vdso_atomic_cmpxchg_32_stub)
|
|
Packit Service |
82fcde |
|
|
Packit Service |
82fcde |
.hidden __vdso_atomic_barrier_stub
|
|
Packit Service |
82fcde |
ENTRY (__vdso_atomic_barrier_stub)
|
|
Packit Service |
82fcde |
move.l %d0, -(%sp)
|
|
Packit Service |
82fcde |
cfi_adjust_cfa_offset (4)
|
|
Packit Service |
82fcde |
move.l #SYS_ify (atomic_barrier), %d0
|
|
Packit Service |
82fcde |
trap #0
|
|
Packit Service |
82fcde |
move.l (%sp)+, %d0
|
|
Packit Service |
82fcde |
cfi_adjust_cfa_offset (-4)
|
|
Packit Service |
82fcde |
rts
|
|
Packit Service |
82fcde |
END (__vdso_atomic_barrier_stub)
|
|
Packit Service |
82fcde |
# else /* !SHARED */
|
|
Packit Service |
82fcde |
/* If the vDSO is not available, use a syscall to get TP. */
|
|
Packit Service |
82fcde |
strong_alias (__vdso_read_tp_stub, __m68k_read_tp)
|
|
Packit Service |
82fcde |
# endif /* SHARED */
|