16fc729afSOlivier Houchard /* $NetBSD: disassem.h,v 1.4 2001/03/04 04:15:58 matt Exp $ */ 26fc729afSOlivier Houchard 3d8315c79SWarner Losh /*- 4*af3dc4a7SPedro F. Giffuni * SPDX-License-Identifier: BSD-4-Clause 5*af3dc4a7SPedro F. Giffuni * 66fc729afSOlivier Houchard * Copyright (c) 1997 Mark Brinicombe. 76fc729afSOlivier Houchard * Copyright (c) 1997 Causality Limited. 86fc729afSOlivier Houchard * 96fc729afSOlivier Houchard * All rights reserved. 106fc729afSOlivier Houchard * 116fc729afSOlivier Houchard * Redistribution and use in source and binary forms, with or without 126fc729afSOlivier Houchard * modification, are permitted provided that the following conditions 136fc729afSOlivier Houchard * are met: 146fc729afSOlivier Houchard * 1. Redistributions of source code must retain the above copyright 156fc729afSOlivier Houchard * notice, this list of conditions and the following disclaimer. 166fc729afSOlivier Houchard * 2. Redistributions in binary form must reproduce the above copyright 176fc729afSOlivier Houchard * notice, this list of conditions and the following disclaimer in the 186fc729afSOlivier Houchard * documentation and/or other materials provided with the distribution. 196fc729afSOlivier Houchard * 3. All advertising materials mentioning features or use of this software 206fc729afSOlivier Houchard * must display the following acknowledgement: 216fc729afSOlivier Houchard * This product includes software developed by Mark Brinicombe. 226fc729afSOlivier Houchard * 4. The name of the company nor the name of the author may be used to 236fc729afSOlivier Houchard * endorse or promote products derived from this software without specific 246fc729afSOlivier Houchard * prior written permission. 256fc729afSOlivier Houchard * 266fc729afSOlivier Houchard * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED 276fc729afSOlivier Houchard * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 286fc729afSOlivier Houchard * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 296fc729afSOlivier Houchard * IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, 306fc729afSOlivier Houchard * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 316fc729afSOlivier Houchard * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 326fc729afSOlivier Houchard * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 336fc729afSOlivier Houchard * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 346fc729afSOlivier Houchard * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 356fc729afSOlivier Houchard * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 366fc729afSOlivier Houchard * SUCH DAMAGE. 376fc729afSOlivier Houchard * 386fc729afSOlivier Houchard * Define the interface structure required by the disassembler. 396fc729afSOlivier Houchard */ 406fc729afSOlivier Houchard 416fc729afSOlivier Houchard #ifndef _MACHINE_DISASSEM_H_ 426fc729afSOlivier Houchard #define _MACHINE_DISASSEM_H_ 436fc729afSOlivier Houchard typedef struct { 446fc729afSOlivier Houchard u_int (*di_readword)(u_int); 456fc729afSOlivier Houchard void (*di_printaddr)(u_int); 461c5ddcdfSOlivier Houchard int (*di_printf)(const char *, ...) __printflike(1, 2); 476fc729afSOlivier Houchard } disasm_interface_t; 486fc729afSOlivier Houchard 496fc729afSOlivier Houchard /* Prototypes for callable functions */ 506fc729afSOlivier Houchard 516fc729afSOlivier Houchard vm_offset_t disasm(const disasm_interface_t *, vm_offset_t, int); 526fc729afSOlivier Houchard void disassemble(u_int); 536fc729afSOlivier Houchard 546fc729afSOlivier Houchard #endif /* !_MACHINE_DISASSEM_H_ */ 55