1129198Scognet/*	$NetBSD: undefined.h,v 1.4 2001/12/20 01:20:23 thorpej Exp $	*/
2129198Scognet
3139735Simp/*-
4129198Scognet * Copyright (c) 1995-1996 Mark Brinicombe.
5129198Scognet * Copyright (c) 1995 Brini.
6129198Scognet * All rights reserved.
7129198Scognet *
8129198Scognet * This code is derived from software written for Brini by Mark Brinicombe
9129198Scognet *
10129198Scognet * Redistribution and use in source and binary forms, with or without
11129198Scognet * modification, are permitted provided that the following conditions
12129198Scognet * are met:
13129198Scognet * 1. Redistributions of source code must retain the above copyright
14129198Scognet *    notice, this list of conditions and the following disclaimer.
15129198Scognet * 2. Redistributions in binary form must reproduce the above copyright
16129198Scognet *    notice, this list of conditions and the following disclaimer in the
17129198Scognet *    documentation and/or other materials provided with the distribution.
18129198Scognet * 3. All advertising materials mentioning features or use of this software
19129198Scognet *    must display the following acknowledgement:
20129198Scognet *	This product includes software developed by Brini.
21129198Scognet * 4. The name of the company nor the name of the author may be used to
22129198Scognet *    endorse or promote products derived from this software without specific
23129198Scognet *    prior written permission.
24129198Scognet *
25129198Scognet * THIS SOFTWARE IS PROVIDED BY BRINI ``AS IS'' AND ANY EXPRESS OR IMPLIED
26129198Scognet * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
27129198Scognet * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
28129198Scognet * IN NO EVENT SHALL BRINI OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
29129198Scognet * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
30129198Scognet * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
31129198Scognet * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
32129198Scognet * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
33129198Scognet * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
34129198Scognet * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
35129198Scognet * SUCH DAMAGE.
36129198Scognet *
37129198Scognet * RiscBSD kernel project
38129198Scognet *
39129198Scognet * undefined.h
40129198Scognet *
41129198Scognet * Undefined instruction types, symbols and prototypes
42129198Scognet *
43129198Scognet * Created      : 08/02/95
44129198Scognet *
45129198Scognet * $FreeBSD$
46129198Scognet */
47129198Scognet
48129198Scognet
49129198Scognet#ifndef _MACHINE_UNDEFINED_H_
50129198Scognet#define _MACHINE_UNDEFINED_H_
51129198Scognet#ifdef _KERNEL
52129198Scognet
53129198Scognet#include <sys/queue.h>
54129198Scognet
55257200Sianstruct trapframe;
56129198Scognet
57257200Siantypedef int (*undef_handler_t) (unsigned int, unsigned int, struct trapframe *, int);
58257200Sian
59129198Scognet#define FP_COPROC	1
60129198Scognet#define FP_COPROC2	2
61129198Scognet#define MAX_COPROCS	16
62129198Scognet
63129198Scognet/* Prototypes for undefined.c */
64129198Scognet
65167752Skevlovoid *install_coproc_handler (int, undef_handler_t);
66167752Skevlovoid remove_coproc_handler (void *);
67167752Skevlovoid undefined_init (void);
68129198Scognet
69129198Scognet/*
70129198Scognet * XXX Stuff below here is for use before malloc() is available.  Most code
71129198Scognet * shouldn't use it.
72129198Scognet */
73129198Scognet
74129198Scognetstruct undefined_handler {
75129198Scognet	LIST_ENTRY(undefined_handler) uh_link;
76129198Scognet	undef_handler_t uh_handler;
77129198Scognet};
78129198Scognet
79129198Scognet/*
80129198Scognet * Handlers installed using install_coproc_handler_static shouldn't be
81129198Scognet * removed.
82129198Scognet */
83167752Skevlovoid install_coproc_handler_static (int, struct undefined_handler *);
84129198Scognet
85129198Scognet/* Calls up to undefined.c from trap handlers */
86129198Scognetvoid undefinedinstruction(struct trapframe *);
87129198Scognet
88129198Scognet#endif
89129198Scognet
90129198Scognet/* End of undefined.h */
91129198Scognet
92129198Scognet#endif /* _MACHINE_UNDEFINED_H_ */
93