16fc729afSOlivier Houchard /* $NetBSD: undefined.h,v 1.4 2001/12/20 01:20:23 thorpej Exp $ */ 26fc729afSOlivier Houchard 3d8315c79SWarner Losh /*- 4*af3dc4a7SPedro F. Giffuni * SPDX-License-Identifier: BSD-4-Clause 5*af3dc4a7SPedro F. Giffuni * 66fc729afSOlivier Houchard * Copyright (c) 1995-1996 Mark Brinicombe. 76fc729afSOlivier Houchard * Copyright (c) 1995 Brini. 86fc729afSOlivier Houchard * All rights reserved. 96fc729afSOlivier Houchard * 106fc729afSOlivier Houchard * This code is derived from software written for Brini by Mark Brinicombe 116fc729afSOlivier Houchard * 126fc729afSOlivier Houchard * Redistribution and use in source and binary forms, with or without 136fc729afSOlivier Houchard * modification, are permitted provided that the following conditions 146fc729afSOlivier Houchard * are met: 156fc729afSOlivier Houchard * 1. Redistributions of source code must retain the above copyright 166fc729afSOlivier Houchard * notice, this list of conditions and the following disclaimer. 176fc729afSOlivier Houchard * 2. Redistributions in binary form must reproduce the above copyright 186fc729afSOlivier Houchard * notice, this list of conditions and the following disclaimer in the 196fc729afSOlivier Houchard * documentation and/or other materials provided with the distribution. 206fc729afSOlivier Houchard * 3. All advertising materials mentioning features or use of this software 216fc729afSOlivier Houchard * must display the following acknowledgement: 226fc729afSOlivier Houchard * This product includes software developed by Brini. 236fc729afSOlivier Houchard * 4. The name of the company nor the name of the author may be used to 246fc729afSOlivier Houchard * endorse or promote products derived from this software without specific 256fc729afSOlivier Houchard * prior written permission. 266fc729afSOlivier Houchard * 276fc729afSOlivier Houchard * THIS SOFTWARE IS PROVIDED BY BRINI ``AS IS'' AND ANY EXPRESS OR IMPLIED 286fc729afSOlivier Houchard * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 296fc729afSOlivier Houchard * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 306fc729afSOlivier Houchard * IN NO EVENT SHALL BRINI OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, 316fc729afSOlivier Houchard * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 326fc729afSOlivier Houchard * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 336fc729afSOlivier Houchard * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 346fc729afSOlivier Houchard * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 356fc729afSOlivier Houchard * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 366fc729afSOlivier Houchard * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 376fc729afSOlivier Houchard * SUCH DAMAGE. 386fc729afSOlivier Houchard * 396fc729afSOlivier Houchard * RiscBSD kernel project 406fc729afSOlivier Houchard * 416fc729afSOlivier Houchard * undefined.h 426fc729afSOlivier Houchard * 436fc729afSOlivier Houchard * Undefined instruction types, symbols and prototypes 446fc729afSOlivier Houchard * 456fc729afSOlivier Houchard * Created : 08/02/95 466fc729afSOlivier Houchard */ 476fc729afSOlivier Houchard 486fc729afSOlivier Houchard #ifndef _MACHINE_UNDEFINED_H_ 496fc729afSOlivier Houchard #define _MACHINE_UNDEFINED_H_ 506fc729afSOlivier Houchard #ifdef _KERNEL 516fc729afSOlivier Houchard 526fc729afSOlivier Houchard #include <sys/queue.h> 536fc729afSOlivier Houchard 5464894120SIan Lepore struct trapframe; 5564894120SIan Lepore 5664894120SIan Lepore typedef int (*undef_handler_t) (unsigned int, unsigned int, struct trapframe *, int); 576fc729afSOlivier Houchard 586fc729afSOlivier Houchard #define FP_COPROC 1 596fc729afSOlivier Houchard #define FP_COPROC2 2 606fc729afSOlivier Houchard #define MAX_COPROCS 16 616fc729afSOlivier Houchard 626fc729afSOlivier Houchard /* Prototypes for undefined.c */ 636fc729afSOlivier Houchard 644eaa43e6SKevin Lo void *install_coproc_handler (int, undef_handler_t); 654eaa43e6SKevin Lo void remove_coproc_handler (void *); 664eaa43e6SKevin Lo void undefined_init (void); 676fc729afSOlivier Houchard 686fc729afSOlivier Houchard /* 696fc729afSOlivier Houchard * XXX Stuff below here is for use before malloc() is available. Most code 706fc729afSOlivier Houchard * shouldn't use it. 716fc729afSOlivier Houchard */ 726fc729afSOlivier Houchard 736fc729afSOlivier Houchard struct undefined_handler { 746fc729afSOlivier Houchard LIST_ENTRY(undefined_handler) uh_link; 756fc729afSOlivier Houchard undef_handler_t uh_handler; 766fc729afSOlivier Houchard }; 776fc729afSOlivier Houchard 786fc729afSOlivier Houchard /* 796fc729afSOlivier Houchard * Handlers installed using install_coproc_handler_static shouldn't be 806fc729afSOlivier Houchard * removed. 816fc729afSOlivier Houchard */ 824eaa43e6SKevin Lo void install_coproc_handler_static (int, struct undefined_handler *); 836fc729afSOlivier Houchard 846fc729afSOlivier Houchard /* Calls up to undefined.c from trap handlers */ 856fc729afSOlivier Houchard void undefinedinstruction(struct trapframe *); 866fc729afSOlivier Houchard 876fc729afSOlivier Houchard #endif 886fc729afSOlivier Houchard 896fc729afSOlivier Houchard /* End of undefined.h */ 906fc729afSOlivier Houchard 916fc729afSOlivier Houchard #endif /* _MACHINE_UNDEFINED_H_ */ 92