1/*	$NetBSD: spl_stubs.c,v 1.2 2011/02/20 07:45:48 matt Exp $	*/
2
3/*-
4 * Copyright (c) 2010 The NetBSD Foundation, Inc.
5 * All rights reserved.
6 *
7 * This code is derived from software contributed to The NetBSD Foundation
8 * by Matt Thomas <matt@3am-software.com>.
9 *
10 * Redistribution and use in source and binary forms, with or without
11 * modification, are permitted provided that the following conditions
12 * are met:
13 * 1. Redistributions of source code must retain the above copyright
14 *    notice, this list of conditions and the following disclaimer.
15 * 2. Redistributions in binary form must reproduce the above copyright
16 *    notice, this list of conditions and the following disclaimer in the
17 *    documentation and/or other materials provided with the distribution.
18 *
19 * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
20 * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
21 * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
22 * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
23 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
24 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
25 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
26 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
27 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
28 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
29 * POSSIBILITY OF SUCH DAMAGE.
30 */
31
32#include <sys/cdefs.h>
33__KERNEL_RCSID(0, "$NetBSD: spl_stubs.c,v 1.2 2011/02/20 07:45:48 matt Exp $");
34
35#define __INTR_PRIVATE
36
37#include <sys/param.h>
38
39#include <mips/cache.h>
40#include <mips/intr.h>
41#include <mips/locore.h>
42
43int	splhigh(void)		__section(".stub");
44int	splhigh_noprof(void)	__section(".stub");
45int	splsched(void)		__section(".stub");
46int	splvm(void)		__section(".stub");
47int	splsoftserial(void)	__section(".stub");
48int	splsoftnet(void)	__section(".stub");
49int	splsoftbio(void)	__section(".stub");
50int	splsoftclock(void)	__section(".stub");
51int	splraise(int)		__section(".stub");
52void	splx(int)		__section(".stub");
53void	splx_noprof(int)	__section(".stub");
54void	spl0(void)		__section(".stub");
55int	splintr(uint32_t *)	__section(".stub");
56void	_setsoftintr(uint32_t)	__section(".stub");
57void	_clrsoftintr(uint32_t)	__section(".stub");
58void	splcheck(void)		__section(".stub");
59
60int
61splhigh(void)
62{
63	return (*mips_splsw.splsw_splhigh)();
64}
65
66int
67splhigh_noprof(void)
68{
69	return (*mips_splsw.splsw_splhigh_noprof)();
70}
71
72int
73splsched(void)
74{
75	return (*mips_splsw.splsw_splsched)();
76}
77
78int
79splvm(void)
80{
81	return (*mips_splsw.splsw_splvm)();
82}
83
84int
85splsoftserial(void)
86{
87	return (*mips_splsw.splsw_splsoftserial)();
88}
89
90int
91splsoftnet(void)
92{
93	return (*mips_splsw.splsw_splsoftnet)();
94}
95
96int
97splsoftbio(void)
98{
99	return (*mips_splsw.splsw_splsoftbio)();
100}
101
102int
103splsoftclock(void)
104{
105	return (*mips_splsw.splsw_splsoftclock)();
106}
107
108void
109spl0(void)
110{
111	(*mips_splsw.splsw_spl0)();
112}
113
114void
115splx(int s)
116{
117	(*mips_splsw.splsw_splx)(s);
118}
119
120void
121splx_noprof(int s)
122{
123	(*mips_splsw.splsw_splx_noprof)(s);
124}
125
126int
127splraise(int s)
128{
129        return (*mips_splsw.splsw_splraise)(s);
130}
131
132int
133splintr(uint32_t *p)
134{
135	return (*mips_splsw.splsw_splintr)(p);
136}
137
138void
139_setsoftintr(uint32_t m)
140{
141	(*mips_splsw.splsw__setsoftintr)(m);
142}
143
144void
145_clrsoftintr(uint32_t m)
146{
147	(*mips_splsw.splsw__clrsoftintr)(m);
148}
149
150void
151splcheck(void)
152{
153	(*mips_splsw.splsw_splcheck)();
154}
155