undefined.h revision 167752
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: head/sys/arm/include/undefined.h 167752 2007-03-21 03:28:16Z kevlo $
46129198Scognet */
47129198Scognet
48129198Scognet
49129198Scognet#ifndef _MACHINE_UNDEFINED_H_
50129198Scognet#define _MACHINE_UNDEFINED_H_
51129198Scognet#ifdef _KERNEL
52129198Scognet
53129198Scognet#include <sys/queue.h>
54129198Scognet
55167752Skevlotypedef int (*undef_handler_t) (unsigned int, unsigned int, trapframe_t *, int);
56129198Scognet
57129198Scognet#define FP_COPROC	1
58129198Scognet#define FP_COPROC2	2
59129198Scognet#define MAX_COPROCS	16
60129198Scognet
61129198Scognet/* Prototypes for undefined.c */
62129198Scognet
63167752Skevlovoid *install_coproc_handler (int, undef_handler_t);
64167752Skevlovoid remove_coproc_handler (void *);
65167752Skevlovoid undefined_init (void);
66129198Scognet
67129198Scognet/*
68129198Scognet * XXX Stuff below here is for use before malloc() is available.  Most code
69129198Scognet * shouldn't use it.
70129198Scognet */
71129198Scognet
72129198Scognetstruct undefined_handler {
73129198Scognet	LIST_ENTRY(undefined_handler) uh_link;
74129198Scognet	undef_handler_t uh_handler;
75129198Scognet};
76129198Scognet
77129198Scognet/*
78129198Scognet * Handlers installed using install_coproc_handler_static shouldn't be
79129198Scognet * removed.
80129198Scognet */
81167752Skevlovoid install_coproc_handler_static (int, struct undefined_handler *);
82129198Scognet
83129198Scognet/* Calls up to undefined.c from trap handlers */
84129198Scognetvoid undefinedinstruction(struct trapframe *);
85129198Scognet
86129198Scognet#endif
87129198Scognet
88129198Scognet/* End of undefined.h */
89129198Scognet
90129198Scognet#endif /* _MACHINE_UNDEFINED_H_ */
91