1/* [2009-07-30 ohodson] TODO: implement! */ 2 3/** 4 * \file 5 * \brief Miscellaneous architecture-specific functions 6 */ 7 8/* 9 * Copyright (c) 2008, 2009, ETH Zurich. 10 * All rights reserved. 11 * 12 * This file is distributed under the terms in the attached LICENSE file. 13 * If you do not find this file, copies can be found by writing to: 14 * ETH Zurich D-INFK, Haldeneggsteig 4, CH-8092 Zurich. Attn: Systems Group. 15 */ 16 17#ifndef ARCH_MISC_H 18#define ARCH_MISC_H 19 20// 21// Helpers for pasting #defined values into inline assembler. 22// 23#define STR(x) #x 24#define XTR(x) STR(x) 25 26#include <arch/armv7/cp15.h> 27 28/** 29 * \brief Set thread-local-storage register. 30 */ 31static inline void arch_set_thread_register(uintptr_t value) 32{ 33 cp15_write_tpidruro(value); 34} 35 36static inline uintptr_t arch_get_thread_register(void) 37{ 38 return cp15_read_tpidruro(); 39} 40 41#endif /* ARCH_MISC_H */ 42