xref: /openbsd/sys/arch/m88k/include/m88100.h (revision 19c1239e)
1 /*	$OpenBSD: m88100.h,v 1.9 2014/05/31 11:19:06 miod Exp $ */
2 /*
3  * Mach Operating System
4  * Copyright (c) 1993-1992 Carnegie Mellon University
5  * All Rights Reserved.
6  *
7  * Permission to use, copy, modify and distribute this software and its
8  * documentation is hereby granted, provided that both the copyright
9  * notice and this permission notice appear in all copies of the
10  * software, derivative works or modified versions, and any portions
11  * thereof, and that both notices appear in supporting documentation.
12  *
13  * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS"
14  * CONDITION.  CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR
15  * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
16  *
17  * Carnegie Mellon requests users of this software to return to
18  *
19  *  Software Distribution Coordinator  or  Software.Distribution@CS.CMU.EDU
20  *  School of Computer Science
21  *  Carnegie Mellon University
22  *  Pittsburgh PA 15213-3890
23  *
24  * any improvements or extensions that they make and grant Carnegie Mellon
25  * the rights to redistribute these changes.
26  */
27 
28 #ifndef _M88K_M88100_H_
29 #define _M88K_M88100_H_
30 
31 /*
32  *	88100 RISC definitions
33  */
34 
35 /*
36  * DMT0, DMT1, DMT2 layout
37  */
38 #define DMT_BO		0x00008000	/* Byte-Ordering */
39 #define DMT_DAS		0x00004000	/* Data Access Space */
40 #define DMT_DOUB1	0x00002000	/* Double Word */
41 #define DMT_LOCKBAR	0x00001000	/* Bud Lock */
42 #define DMT_DREG	0x00000F80	/* Destination Registers 5bits */
43 #define DMT_SIGNED	0x00000040	/* Sign-Extended Bit */
44 #define DMT_EN		0x0000003C	/* Byte Enable Bit */
45 #define DMT_WRITE	0x00000002	/* Read/Write Transaction Bit */
46 #define	DMT_VALID	0x00000001	/* Valid Transaction Bit */
47 
48 #define	DMT_DREGSHIFT	7
49 #define	DMT_ENSHIFT	2
50 
51 #define	DMT_DREGBITS(x)	(((x) & DMT_DREG) >> DMT_DREGSHIFT)
52 #define	DMT_ENBITS(x)	(((x) & DMT_EN) >> DMT_ENSHIFT)
53 
54 #if defined(_KERNEL) && !defined(_LOCORE)
55 
56 void	dae_print(u_int *);
57 void	data_access_emulation(u_int *);
58 
59 u_int32_t do_load_word(vaddr_t, int);
60 u_int32_t do_load_half(vaddr_t, int);
61 u_int32_t do_load_byte(vaddr_t, int);
62 void      do_store_word(vaddr_t, u_int32_t, int);
63 void      do_store_half(vaddr_t, u_int16_t, int);
64 void      do_store_byte(vaddr_t, u_int8_t, int);
65 u_int32_t do_xmem_word(vaddr_t, u_int32_t, int);
66 u_int8_t  do_xmem_byte(vaddr_t, u_int8_t, int);
67 
68 void	m88100_apply_patches(void);
69 void	m88100_smp_setup(struct cpu_info *);
70 
71 /* rewind one instruction */
72 static __inline__ void
m88100_rewind_insn(struct reg * regs)73 m88100_rewind_insn(struct reg *regs)
74 {
75 	regs->sfip = regs->snip;
76 	regs->snip = regs->sxip;
77 }
78 
79 #endif
80 
81 #endif /* _M88K_M88100_H_ */
82