1135684Scognet/*-
2135684Scognet * Copyright (c) 2004 Doug Rabson
3135684Scognet * All rights reserved.
4135684Scognet *
5135684Scognet * Redistribution and use in source and binary forms, with or without
6135684Scognet * modification, are permitted provided that the following conditions
7135684Scognet * are met:
8135684Scognet * 1. Redistributions of source code must retain the above copyright
9135684Scognet *    notice, this list of conditions and the following disclaimer.
10135684Scognet * 2. Redistributions in binary form must reproduce the above copyright
11135684Scognet *    notice, this list of conditions and the following disclaimer in the
12135684Scognet *    documentation and/or other materials provided with the distribution.
13135684Scognet *
14135684Scognet * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
15135684Scognet * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
16135684Scognet * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
17135684Scognet * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
18135684Scognet * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
19135684Scognet * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
20135684Scognet * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
21135684Scognet * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
22135684Scognet * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
23135684Scognet * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
24135684Scognet * SUCH DAMAGE.
25135684Scognet *
26135684Scognet *	$FreeBSD$
27135684Scognet */
28135684Scognet
29135684Scognet#include <string.h>
30233107Sgonzo#include <sys/types.h>
31135684Scognet
32233106Sgonzo#include <machine/sysarch.h>
33288019Srodrigc#include "libc_private.h"
34233106Sgonzo
35135684Scognetvoid
36135684Scognet_set_tp(void *tp)
37135684Scognet{
38233106Sgonzo
39239271Sgonzo#ifdef ARM_TP_ADDRESS
40233106Sgonzo	*((struct tcb **)ARM_TP_ADDRESS) = tp;
41239271Sgonzo#else
42239271Sgonzo	sysarch(ARM_SET_TP, tp);
43239271Sgonzo#endif
44135684Scognet}
45