xref: /openbsd-src/sys/arch/m88k/include/m88100.h (revision 19c1239e1b9c6f38de694011306d4e8ae17291ea)
1*19c1239eSmiod /*	$OpenBSD: m88100.h,v 1.9 2014/05/31 11:19:06 miod Exp $ */
23180e169Smiod /*
33180e169Smiod  * Mach Operating System
43180e169Smiod  * Copyright (c) 1993-1992 Carnegie Mellon University
53180e169Smiod  * All Rights Reserved.
63180e169Smiod  *
73180e169Smiod  * Permission to use, copy, modify and distribute this software and its
83180e169Smiod  * documentation is hereby granted, provided that both the copyright
93180e169Smiod  * notice and this permission notice appear in all copies of the
103180e169Smiod  * software, derivative works or modified versions, and any portions
113180e169Smiod  * thereof, and that both notices appear in supporting documentation.
123180e169Smiod  *
133180e169Smiod  * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS"
143180e169Smiod  * CONDITION.  CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR
153180e169Smiod  * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
163180e169Smiod  *
173180e169Smiod  * Carnegie Mellon requests users of this software to return to
183180e169Smiod  *
193180e169Smiod  *  Software Distribution Coordinator  or  Software.Distribution@CS.CMU.EDU
203180e169Smiod  *  School of Computer Science
213180e169Smiod  *  Carnegie Mellon University
223180e169Smiod  *  Pittsburgh PA 15213-3890
233180e169Smiod  *
243180e169Smiod  * any improvements or extensions that they make and grant Carnegie Mellon
253180e169Smiod  * the rights to redistribute these changes.
263180e169Smiod  */
273180e169Smiod 
282fa72412Spirofti #ifndef _M88K_M88100_H_
292fa72412Spirofti #define _M88K_M88100_H_
303180e169Smiod 
313180e169Smiod /*
323180e169Smiod  *	88100 RISC definitions
333180e169Smiod  */
343180e169Smiod 
353180e169Smiod /*
363180e169Smiod  * DMT0, DMT1, DMT2 layout
373180e169Smiod  */
383180e169Smiod #define DMT_BO		0x00008000	/* Byte-Ordering */
393180e169Smiod #define DMT_DAS		0x00004000	/* Data Access Space */
403180e169Smiod #define DMT_DOUB1	0x00002000	/* Double Word */
413180e169Smiod #define DMT_LOCKBAR	0x00001000	/* Bud Lock */
423180e169Smiod #define DMT_DREG	0x00000F80	/* Destination Registers 5bits */
433180e169Smiod #define DMT_SIGNED	0x00000040	/* Sign-Extended Bit */
443180e169Smiod #define DMT_EN		0x0000003C	/* Byte Enable Bit */
453180e169Smiod #define DMT_WRITE	0x00000002	/* Read/Write Transaction Bit */
463180e169Smiod #define	DMT_VALID	0x00000001	/* Valid Transaction Bit */
473180e169Smiod 
483180e169Smiod #define	DMT_DREGSHIFT	7
493180e169Smiod #define	DMT_ENSHIFT	2
503180e169Smiod 
513180e169Smiod #define	DMT_DREGBITS(x)	(((x) & DMT_DREG) >> DMT_DREGSHIFT)
523180e169Smiod #define	DMT_ENBITS(x)	(((x) & DMT_EN) >> DMT_ENSHIFT)
533180e169Smiod 
54a17d5c50Smiod #if defined(_KERNEL) && !defined(_LOCORE)
55743b0bd2Smiod 
562bd536ecSmiod void	dae_print(u_int *);
572bd536ecSmiod void	data_access_emulation(u_int *);
58a17d5c50Smiod 
59a17d5c50Smiod u_int32_t do_load_word(vaddr_t, int);
60aa1be6daSmiod u_int32_t do_load_half(vaddr_t, int);
61aa1be6daSmiod u_int32_t do_load_byte(vaddr_t, int);
62a17d5c50Smiod void      do_store_word(vaddr_t, u_int32_t, int);
63a17d5c50Smiod void      do_store_half(vaddr_t, u_int16_t, int);
64a17d5c50Smiod void      do_store_byte(vaddr_t, u_int8_t, int);
65a17d5c50Smiod u_int32_t do_xmem_word(vaddr_t, u_int32_t, int);
66a17d5c50Smiod u_int8_t  do_xmem_byte(vaddr_t, u_int8_t, int);
67743b0bd2Smiod 
68743b0bd2Smiod void	m88100_apply_patches(void);
6969d29e1eSmiod void	m88100_smp_setup(struct cpu_info *);
70743b0bd2Smiod 
71*19c1239eSmiod /* rewind one instruction */
72*19c1239eSmiod static __inline__ void
m88100_rewind_insn(struct reg * regs)73*19c1239eSmiod m88100_rewind_insn(struct reg *regs)
74*19c1239eSmiod {
75*19c1239eSmiod 	regs->sfip = regs->snip;
76*19c1239eSmiod 	regs->snip = regs->sxip;
77*19c1239eSmiod }
78*19c1239eSmiod 
79a17d5c50Smiod #endif
80a17d5c50Smiod 
812fa72412Spirofti #endif /* _M88K_M88100_H_ */
82