1232577Sgonzo/*-
2232577Sgonzo * Copyright (c) 2012 Oleksandr Tymoshenko
3232577Sgonzo * All rights reserved.
4232577Sgonzo *
5232577Sgonzo * Redistribution and use in source and binary forms, with or without
6232577Sgonzo * modification, are permitted provided that the following conditions
7232577Sgonzo * are met:
8232577Sgonzo * 1. Redistributions of source code must retain the above copyright
9232577Sgonzo *    notice, this list of conditions, and the following disclaimer,
10232577Sgonzo *    without modification, immediately at the beginning of the file.
11232577Sgonzo * 2. Redistributions in binary form must reproduce the above copyright
12232577Sgonzo *    notice, this list of conditions and the following disclaimer in
13232577Sgonzo *    the documentation and/or other materials provided with the
14232577Sgonzo *    distribution.
15232577Sgonzo *
16232577Sgonzo * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
17232577Sgonzo * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
18232577Sgonzo * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
19232577Sgonzo * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE FOR
20232577Sgonzo * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
21232577Sgonzo * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
22232577Sgonzo * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
23232577Sgonzo * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
24232577Sgonzo * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
25232577Sgonzo * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
26232577Sgonzo * SUCH DAMAGE.
27232577Sgonzo *
28232577Sgonzo * $FreeBSD$
29232577Sgonzo *
30232577Sgonzo */
31232577Sgonzo
32232577Sgonzo#ifndef	__MIPS_TLS_H__
33232577Sgonzo#define	__MIPS_TLS_H__
34232577Sgonzo
35232583Sjmallett#if defined(_KERNEL) && !defined(KLD_MODULE) && !defined(_STANDALONE)
36232583Sjmallett#include "opt_compat.h"
37232583Sjmallett#endif
38232583Sjmallett
39232577Sgonzo/*
40232577Sgonzo * TLS parameters
41232577Sgonzo */
42232577Sgonzo
43232577Sgonzo#define TLS_TP_OFFSET	0x7000
44232577Sgonzo#define TLS_DTP_OFFSET	0x8000
45232577Sgonzo
46232577Sgonzo#ifdef __mips_n64
47232577Sgonzo#define TLS_TCB_SIZE	16
48232583Sjmallett#ifdef COMPAT_FREEBSD32
49232583Sjmallett#define TLS_TCB_SIZE32	8
50232583Sjmallett#endif
51232577Sgonzo#else
52232577Sgonzo#define TLS_TCB_SIZE	8
53232577Sgonzo#endif
54232577Sgonzo
55232577Sgonzo#endif	/* __MIPS_TLS_H__ */
56