1e210488e0d4082b9a0c55195c22191f29ed56bf8Serban Constantinescu/* 2e210488e0d4082b9a0c55195c22191f29ed56bf8Serban Constantinescu * Copyright (C) 2013 The Android Open Source Project 354a7494f17f80d6c548a58434bcb5579a26cc125Elliott Hughes * All rights reserved. 4e210488e0d4082b9a0c55195c22191f29ed56bf8Serban Constantinescu * 5e210488e0d4082b9a0c55195c22191f29ed56bf8Serban Constantinescu * Redistribution and use in source and binary forms, with or without 6e210488e0d4082b9a0c55195c22191f29ed56bf8Serban Constantinescu * modification, are permitted provided that the following conditions 7e210488e0d4082b9a0c55195c22191f29ed56bf8Serban Constantinescu * are met: 8e210488e0d4082b9a0c55195c22191f29ed56bf8Serban Constantinescu * * Redistributions of source code must retain the above copyright 9e210488e0d4082b9a0c55195c22191f29ed56bf8Serban Constantinescu * notice, this list of conditions and the following disclaimer. 10e210488e0d4082b9a0c55195c22191f29ed56bf8Serban Constantinescu * * Redistributions in binary form must reproduce the above copyright 11e210488e0d4082b9a0c55195c22191f29ed56bf8Serban Constantinescu * notice, this list of conditions and the following disclaimer in 12e210488e0d4082b9a0c55195c22191f29ed56bf8Serban Constantinescu * the documentation and/or other materials provided with the 13e210488e0d4082b9a0c55195c22191f29ed56bf8Serban Constantinescu * distribution. 14e210488e0d4082b9a0c55195c22191f29ed56bf8Serban Constantinescu * 15e210488e0d4082b9a0c55195c22191f29ed56bf8Serban Constantinescu * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 16e210488e0d4082b9a0c55195c22191f29ed56bf8Serban Constantinescu * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 17e210488e0d4082b9a0c55195c22191f29ed56bf8Serban Constantinescu * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS 18e210488e0d4082b9a0c55195c22191f29ed56bf8Serban Constantinescu * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE 19e210488e0d4082b9a0c55195c22191f29ed56bf8Serban Constantinescu * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, 20e210488e0d4082b9a0c55195c22191f29ed56bf8Serban Constantinescu * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, 21e210488e0d4082b9a0c55195c22191f29ed56bf8Serban Constantinescu * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS 22e210488e0d4082b9a0c55195c22191f29ed56bf8Serban Constantinescu * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED 23e210488e0d4082b9a0c55195c22191f29ed56bf8Serban Constantinescu * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 24e210488e0d4082b9a0c55195c22191f29ed56bf8Serban Constantinescu * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT 25e210488e0d4082b9a0c55195c22191f29ed56bf8Serban Constantinescu * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 26e210488e0d4082b9a0c55195c22191f29ed56bf8Serban Constantinescu * SUCH DAMAGE. 27e210488e0d4082b9a0c55195c22191f29ed56bf8Serban Constantinescu */ 28e210488e0d4082b9a0c55195c22191f29ed56bf8Serban Constantinescu 29a75869f0b2528079503d2e4dd2174142ab1df904Elliott Hughes#include <sys/cdefs.h> 30a75869f0b2528079503d2e4dd2174142ab1df904Elliott Hughes 31a75869f0b2528079503d2e4dd2174142ab1df904Elliott Hughes__LIBC_HIDDEN__ void __set_tls(void* tls) { 32e210488e0d4082b9a0c55195c22191f29ed56bf8Serban Constantinescu asm("msr tpidr_el0, %0" : : "r" (tls)); 33e210488e0d4082b9a0c55195c22191f29ed56bf8Serban Constantinescu} 34