1a9643ea8Slogwang /* $NetBSD: undefined.h,v 1.4 2001/12/20 01:20:23 thorpej Exp $ */ 2a9643ea8Slogwang 3a9643ea8Slogwang /*- 4*22ce4affSfengbojiang * SPDX-License-Identifier: BSD-4-Clause 5*22ce4affSfengbojiang * 6a9643ea8Slogwang * Copyright (c) 1995-1996 Mark Brinicombe. 7a9643ea8Slogwang * Copyright (c) 1995 Brini. 8a9643ea8Slogwang * All rights reserved. 9a9643ea8Slogwang * 10a9643ea8Slogwang * This code is derived from software written for Brini by Mark Brinicombe 11a9643ea8Slogwang * 12a9643ea8Slogwang * Redistribution and use in source and binary forms, with or without 13a9643ea8Slogwang * modification, are permitted provided that the following conditions 14a9643ea8Slogwang * are met: 15a9643ea8Slogwang * 1. Redistributions of source code must retain the above copyright 16a9643ea8Slogwang * notice, this list of conditions and the following disclaimer. 17a9643ea8Slogwang * 2. Redistributions in binary form must reproduce the above copyright 18a9643ea8Slogwang * notice, this list of conditions and the following disclaimer in the 19a9643ea8Slogwang * documentation and/or other materials provided with the distribution. 20a9643ea8Slogwang * 3. All advertising materials mentioning features or use of this software 21a9643ea8Slogwang * must display the following acknowledgement: 22a9643ea8Slogwang * This product includes software developed by Brini. 23a9643ea8Slogwang * 4. The name of the company nor the name of the author may be used to 24a9643ea8Slogwang * endorse or promote products derived from this software without specific 25a9643ea8Slogwang * prior written permission. 26a9643ea8Slogwang * 27a9643ea8Slogwang * THIS SOFTWARE IS PROVIDED BY BRINI ``AS IS'' AND ANY EXPRESS OR IMPLIED 28a9643ea8Slogwang * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 29a9643ea8Slogwang * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 30a9643ea8Slogwang * IN NO EVENT SHALL BRINI OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, 31a9643ea8Slogwang * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 32a9643ea8Slogwang * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 33a9643ea8Slogwang * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 34a9643ea8Slogwang * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 35a9643ea8Slogwang * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 36a9643ea8Slogwang * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 37a9643ea8Slogwang * SUCH DAMAGE. 38a9643ea8Slogwang * 39a9643ea8Slogwang * RiscBSD kernel project 40a9643ea8Slogwang * 41a9643ea8Slogwang * undefined.h 42a9643ea8Slogwang * 43a9643ea8Slogwang * Undefined instruction types, symbols and prototypes 44a9643ea8Slogwang * 45a9643ea8Slogwang * Created : 08/02/95 46a9643ea8Slogwang * 47a9643ea8Slogwang * $FreeBSD$ 48a9643ea8Slogwang */ 49a9643ea8Slogwang 50a9643ea8Slogwang #ifndef _MACHINE_UNDEFINED_H_ 51a9643ea8Slogwang #define _MACHINE_UNDEFINED_H_ 52a9643ea8Slogwang #ifdef _KERNEL 53a9643ea8Slogwang 54a9643ea8Slogwang #include <sys/queue.h> 55a9643ea8Slogwang 56a9643ea8Slogwang struct trapframe; 57a9643ea8Slogwang 58a9643ea8Slogwang typedef int (*undef_handler_t) (unsigned int, unsigned int, struct trapframe *, int); 59a9643ea8Slogwang 60a9643ea8Slogwang #define FP_COPROC 1 61a9643ea8Slogwang #define FP_COPROC2 2 62a9643ea8Slogwang #define MAX_COPROCS 16 63a9643ea8Slogwang 64a9643ea8Slogwang /* Prototypes for undefined.c */ 65a9643ea8Slogwang 66a9643ea8Slogwang void *install_coproc_handler (int, undef_handler_t); 67a9643ea8Slogwang void remove_coproc_handler (void *); 68a9643ea8Slogwang void undefined_init (void); 69a9643ea8Slogwang 70a9643ea8Slogwang /* 71a9643ea8Slogwang * XXX Stuff below here is for use before malloc() is available. Most code 72a9643ea8Slogwang * shouldn't use it. 73a9643ea8Slogwang */ 74a9643ea8Slogwang 75a9643ea8Slogwang struct undefined_handler { 76a9643ea8Slogwang LIST_ENTRY(undefined_handler) uh_link; 77a9643ea8Slogwang undef_handler_t uh_handler; 78a9643ea8Slogwang }; 79a9643ea8Slogwang 80a9643ea8Slogwang /* 81a9643ea8Slogwang * Handlers installed using install_coproc_handler_static shouldn't be 82a9643ea8Slogwang * removed. 83a9643ea8Slogwang */ 84a9643ea8Slogwang void install_coproc_handler_static (int, struct undefined_handler *); 85a9643ea8Slogwang 86a9643ea8Slogwang /* Calls up to undefined.c from trap handlers */ 87a9643ea8Slogwang void undefinedinstruction(struct trapframe *); 88a9643ea8Slogwang 89a9643ea8Slogwang #endif 90a9643ea8Slogwang 91a9643ea8Slogwang /* End of undefined.h */ 92a9643ea8Slogwang 93a9643ea8Slogwang #endif /* _MACHINE_UNDEFINED_H_ */ 94