xref: /openbsd/sys/arch/arm/arm/disassem.h (revision 944951e9)
1*944951e9Smiod /*	$OpenBSD: disassem.h,v 1.2 2012/01/17 18:50:57 miod Exp $	*/
2e1e4f5b1Sdrahn /*	$NetBSD: disassem.h,v 1.4 2001/03/04 04:15:58 matt Exp $	*/
3e1e4f5b1Sdrahn 
4e1e4f5b1Sdrahn /*
5e1e4f5b1Sdrahn  * Copyright (c) 1997 Mark Brinicombe.
6e1e4f5b1Sdrahn  * Copyright (c) 1997 Causality Limited.
7e1e4f5b1Sdrahn  *
8e1e4f5b1Sdrahn  * All rights reserved.
9e1e4f5b1Sdrahn  *
10e1e4f5b1Sdrahn  * Redistribution and use in source and binary forms, with or without
11e1e4f5b1Sdrahn  * modification, are permitted provided that the following conditions
12e1e4f5b1Sdrahn  * are met:
13e1e4f5b1Sdrahn  * 1. Redistributions of source code must retain the above copyright
14e1e4f5b1Sdrahn  *    notice, this list of conditions and the following disclaimer.
15e1e4f5b1Sdrahn  * 2. Redistributions in binary form must reproduce the above copyright
16e1e4f5b1Sdrahn  *    notice, this list of conditions and the following disclaimer in the
17e1e4f5b1Sdrahn  *    documentation and/or other materials provided with the distribution.
18e1e4f5b1Sdrahn  * 3. All advertising materials mentioning features or use of this software
19e1e4f5b1Sdrahn  *    must display the following acknowledgement:
20e1e4f5b1Sdrahn  *	This product includes software developed by Mark Brinicombe.
21e1e4f5b1Sdrahn  * 4. The name of the company nor the name of the author may be used to
22e1e4f5b1Sdrahn  *    endorse or promote products derived from this software without specific
23e1e4f5b1Sdrahn  *    prior written permission.
24e1e4f5b1Sdrahn  *
25e1e4f5b1Sdrahn  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
26e1e4f5b1Sdrahn  * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
27e1e4f5b1Sdrahn  * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
28e1e4f5b1Sdrahn  * IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
29e1e4f5b1Sdrahn  * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
30e1e4f5b1Sdrahn  * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
31e1e4f5b1Sdrahn  * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
32e1e4f5b1Sdrahn  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
33e1e4f5b1Sdrahn  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
34e1e4f5b1Sdrahn  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
35e1e4f5b1Sdrahn  * SUCH DAMAGE.
36e1e4f5b1Sdrahn  *
37e1e4f5b1Sdrahn  * Define the interface structure required by the disassembler.
38e1e4f5b1Sdrahn  */
39e1e4f5b1Sdrahn 
40e1e4f5b1Sdrahn typedef struct {
41e1e4f5b1Sdrahn 	db_expr_t	(*di_readword)(db_expr_t);
42e1e4f5b1Sdrahn 	void	(*di_printaddr)(db_expr_t);
43*944951e9Smiod 	int	(*di_printf)(const char *, ...)
44*944951e9Smiod 	    __attribute__((__format__(__kprintf__,1,2)));
45e1e4f5b1Sdrahn } disasm_interface_t;
46e1e4f5b1Sdrahn 
47e1e4f5b1Sdrahn /* Prototypes for callable functions */
48e1e4f5b1Sdrahn 
49e1e4f5b1Sdrahn vaddr_t disasm(const disasm_interface_t *, vaddr_t, int);
50e1e4f5b1Sdrahn void disassemble(u_int);
51