/[gxemul]/trunk/src/include/devices.h
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Contents of /trunk/src/include/devices.h

Parent Directory Parent Directory | Revision Log Revision Log


Revision 42 - (show annotations)
Mon Oct 8 16:22:32 2007 UTC (16 years, 6 months ago) by dpavlin
File MIME type: text/plain
File size: 18637 byte(s)
++ trunk/HISTORY	(local)
$Id: HISTORY,v 1.1613 2007/06/15 20:11:26 debug Exp $
20070501	Continuing a little on m88k disassembly (control registers,
		more instructions).
		Adding a dummy mvme88k machine mode.
20070502	Re-adding MIPS load/store alignment exceptions.
20070503	Implementing more of the M88K disassembly code.
20070504	Adding disassembly of some more M88K load/store instructions.
		Implementing some relatively simple M88K instructions (br.n,
		xor[.u] imm, and[.u] imm).
20070505	Implementing M88K three-register and, or, xor, and jmp[.n],
		bsr[.n] including function call trace stuff.
		Applying a patch from Bruce M. Simpson which implements the
		SYSCON_BOARD_CPU_CLOCK_FREQ_ID object of the syscon call in
		the yamon PROM emulation.
20070506	Implementing M88K bb0[.n] and bb1[.n], and skeletons for
		ldcr and stcr (although no control regs are implemented yet).
20070509	Found and fixed the bug which caused Linux for QEMU_MIPS to
		stop working in 0.4.5.1: It was a faulty change to the MIPS
		'sc' and 'scd' instructions I made while going through gcc -W
		warnings on 20070428.
20070510	Updating the Linux/QEMU_MIPS section in guestoses.html to
		use mips-test-0.2.tar.gz instead of 0.1.
		A big thank you to Miod Vallat for sending me M88K manuals.
		Implementing more M88K instructions (addu, subu, div[u], mulu,
		ext[u], clr, set, cmp).
20070511	Fixing bugs in the M88K "and" and "and.u" instructions (found
		by comparing against the manual).
		Implementing more M88K instructions (mask[.u], mak, bcnd (auto-
		generated)) and some more control register details.
		Cleanup: Removing the experimental AVR emulation mode and
		corresponding devices; AVR emulation wasn't really meaningful.
		Implementing autogeneration of most M88K loads/stores. The
		rectangle drawing demo (with -O0) for M88K runs :-)
		Beginning on M88K exception handling.
		More M88K instructions: tb0, tb1, rte, sub, jsr[.n].
		Adding some skeleton MVME PROM ("BUG") emulation.
20070512	Fixing a bug in the M88K cmp instruction.
		Adding the M88K lda (scaled register) instruction.
		Fixing bugs in 64-bit (32-bit pairs) M88K loads/stores.
		Removing the unused tick_hz stuff from the machine struct.
		Implementing the M88K xmem instruction. OpenBSD/mvme88k gets
		far enough to display the Copyright banner :-)
		Implementing subu.co (guess), addu.co, addu.ci, ff0, and ff1.
		Adding a dev_mvme187, for MVME187-specific devices/registers.
		OpenBSD/mvme88k prints more boot messages. :)
20070515	Continuing on MVME187 emulation (adding more devices, beginning
		on the CMMUs, etc).
		Adding the M88K and.c, xor.c, and or.c instructions, and making
		sure that mul, div, etc cause exceptions if executed when SFD1
		is disabled.
20070517	Continuing on M88K and MVME187 emulation in general; moving
		the CMMU registers to the CPU struct, separating dev_pcc2 from
		dev_mvme187, and beginning on memory_m88k.c (BATC and PATC).
		Fixing a bug in 64-bit (32-bit pairs) M88K fast stores.
		Implementing the clock part of dev_mk48txx.
		Implementing the M88K fstcr and xcr instructions.
		Implementing m88k_cpu_tlbdump().
		Beginning on the implementation of a separate address space
		for M88K .usr loads/stores.
20070520	Removing the non-working (skeleton) Sandpoint, SonyNEWS, SHARK
		Dnard, and Zaurus machine modes.
		Experimenting with dyntrans to_be_translated read-ahead. It
		seems to give a very small performance increase for MIPS
		emulation, but a large performance degradation for SuperH. Hm.
20070522	Disabling correct SuperH ITLB emulation; it does not seem to be
		necessary in order to let SH4 guest OSes run, and it slows down
		userspace code.
		Implementing "samepage" branches for SuperH emulation, and some
		other minor speed hacks.
20070525	Continuing on M88K memory-related stuff: exceptions, memory
		transaction register contents, etc.
		Implementing the M88K subu.ci instruction.
		Removing the non-working (skeleton) Iyonix machine mode.
		OpenBSD/mvme88k reaches userland :-), starts executing
		/sbin/init's instructions, and issues a few syscalls, before
		crashing.
20070526	Fixing bugs in dev_mk48txx, so that OpenBSD/mvme88k detects
		the correct time-of-day.
		Implementing a generic IRQ controller for the test machines
		(dev_irqc), similar to a proposed patch from Petr Stepan.
		Experimenting some more with translation read-ahead.
		Adding an "expect" script for automated OpenBSD/landisk
		install regression/performance tests.
20070527	Adding a dummy mmEye (SH3) machine mode skeleton.
		FINALLY found the strange M88K bug I have been hunting: I had
		not emulated the SNIP value for exceptions occurring in
		branch delay slots correctly.
		Implementing correct exceptions for 64-bit M88K loads/stores.
		Address to symbol lookups are now disabled when M88K is
		running in usermode (because usermode addresses don't have
		anything to do with supervisor addresses).
20070531	Removing the mmEye machine mode skeleton.
20070604	Some minor code cleanup.
20070605	Moving src/useremul.c into a subdir (src/useremul/), and
		cleaning up some more legacy constructs.
		Adding -Wstrict-aliasing and -fstrict-aliasing detection to
		the configure script.
20070606	Adding a check for broken GCC on Solaris to the configure
		script. (GCC 3.4.3 on Solaris cannot handle static variables
		which are initialized to 0 or NULL. :-/)
		Removing the old (non-working) ARC emulation modes: NEC RD94,
		R94, R96, and R98, and the last traces of Olivetti M700 and
		Deskstation Tyne.
		Removing the non-working skeleton WDSC device (dev_wdsc).
20070607	Thinking about how to use the host's cc + ld at runtime to
		generate native code. (See experiments/native_cc_ld_test.i
		for an example.)
20070608	Adding a program counter sampling timer, which could be useful
		for native code generation experiments.
		The KN02_CSR_NRMMOD bit in the DECstation 5000/200 (KN02) CSR
		should always be set, to allow a 5000/200 PROM to boot.
20070609	Moving out breakpoint details from the machine struct into
		a helper struct, and removing the limit on max nr of
		breakpoints.
20070610	Moving out tick functions into a helper struct as well (which
		also gets rid of the max limit).
20070612	FINALLY figured out why Debian/DECstation stopped working when
		translation read-ahead was enabled: in src/memory_rw.c, the
		call to invalidate_code_translation was made also if the
		memory access was an instruction load (if the page was mapped
		as writable); it shouldn't be called in that case.
20070613	Implementing some more MIPS32/64 revision 2 instructions: di,
		ei, ext, dext, dextm, dextu, and ins.
20070614	Implementing an instruction combination for the NetBSD/arm
		idle loop (making the host not use any cpu if NetBSD/arm
		inside the emulator is not using any cpu).
		Increasing the nr of ARM VPH entries from 128 to 384.
20070615	Removing the ENABLE_arch stuff from the configure script, so
		that all included architectures are included in both release
		and development builds.
		Moving memory related helper functions from misc.c to memory.c.
		Adding preliminary instructions for netbooting NetBSD/pmppc to
		guestoses.html; it doesn't work yet, there are weird timeouts.
		Beginning a total rewrite of the userland emulation modes
		(removing all emulation modes, beginning from scratch with
		NetBSD/MIPS and FreeBSD/Alpha only).
20070616	After fixing a bug in the DEC21143 NIC (the TDSTAT_OWN bit was
		only cleared for the last segment when transmitting, not all
		segments), NetBSD/pmppc boots with root-on-nfs without the
		timeouts. Updating guestoses.html.
		Removing the skeleton PSP (Playstation Portable) mode.
		Moving X11-related stuff in the machine struct into a helper
		struct.
		Cleanup of out-of-memory checks, to use a new CHECK_ALLOCATION
		macro (which prints a meaningful error message).
		Adding a COMMENT to each machine and device (for automagic
		.index comment generation).
		Doing regression testing for the next release.

==============  RELEASE 0.4.6  ==============


1 #ifndef DEVICES_H
2 #define DEVICES_H
3
4 /*
5 * Copyright (C) 2003-2007 Anders Gavare. All rights reserved.
6 *
7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions are met:
9 *
10 * 1. Redistributions of source code must retain the above copyright
11 * notice, this list of conditions and the following disclaimer.
12 * 2. Redistributions in binary form must reproduce the above copyright
13 * notice, this list of conditions and the following disclaimer in the
14 * documentation and/or other materials provided with the distribution.
15 * 3. The name of the author may not be used to endorse or promote products
16 * derived from this software without specific prior written permission.
17 *
18 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
19 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
20 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
21 * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
22 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
23 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
24 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
25 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
26 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
27 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
28 * SUCH DAMAGE.
29 *
30 *
31 * $Id: devices.h,v 1.242 2007/06/06 00:46:35 debug Exp $
32 *
33 * Memory mapped devices.
34 *
35 * NOTE: Many of these devices are legacy devices, that are here for one
36 * of these two reasons:
37 *
38 * A) Devices introduced before the DEVINIT system had to
39 * be declared somewhere.
40 *
41 * B) The way interrupt controllers and such were implemented
42 * up until release 0.4.3 requires that several parts of
43 * the program access internal fields of interrupt
44 * controllers' structs.
45 *
46 * Both A and B need to be solved.
47 */
48
49 #include <sys/types.h>
50 #include <inttypes.h>
51
52 #include "interrupt.h"
53
54 struct cpu;
55 struct machine;
56 struct memory;
57 struct pci_data;
58 struct timer;
59
60 /* #ifdef WITH_X11
61 #include <X11/Xlib.h>
62 #endif */
63
64 /* dev_8259.c: */
65 struct pic8259_data {
66 struct interrupt irq;
67
68 int irq_base;
69 int current_command;
70
71 int init_state;
72
73 int priority_reg;
74 uint8_t irr; /* interrupt request register */
75 uint8_t isr; /* interrupt in-service register */
76 uint8_t ier; /* interrupt enable register */
77 };
78
79 /* dev_dec_ioasic.c: */
80 #define DEV_DEC_IOASIC_LENGTH 0x80100
81 #define N_DEC_IOASIC_REGS (0x1f0 / 0x10)
82 #define MAX_IOASIC_DMA_FUNCTIONS 8
83 struct dec_ioasic_data {
84 uint32_t reg[N_DEC_IOASIC_REGS];
85 int (*(dma_func[MAX_IOASIC_DMA_FUNCTIONS]))(struct cpu *, void *, uint64_t addr, size_t dma_len, int tx);
86 void *dma_func_extra[MAX_IOASIC_DMA_FUNCTIONS];
87 int rackmount_flag;
88 };
89 int dev_dec_ioasic_access(struct cpu *cpu, struct memory *mem, uint64_t relative_addr, unsigned char *data, size_t len, int writeflag, void *);
90 struct dec_ioasic_data *dev_dec_ioasic_init(struct cpu *cpu, struct memory *mem, uint64_t baseaddr, int rackmount_flag);
91
92 /* dev_asc.c: */
93 #define DEV_ASC_DEC_LENGTH 0x40000
94 #define DEV_ASC_PICA_LENGTH 0x1000
95 #define DEV_ASC_DEC 1
96 #define DEV_ASC_PICA 2
97 int dev_asc_access(struct cpu *cpu, struct memory *mem, uint64_t relative_addr, unsigned char *data, size_t len, int writeflag, void *);
98 void dev_asc_init(struct machine *machine, struct memory *mem, uint64_t baseaddr,
99 char *irq_path, void *turbochannel, int mode,
100 size_t (*dma_controller)(void *dma_controller_data,
101 unsigned char *data, size_t len, int writeflag),
102 void *dma_controller_data);
103
104 /* dev_bt431.c: */
105 #define DEV_BT431_LENGTH 0x20
106 #define DEV_BT431_NREGS 0x800 /* ? */
107 int dev_bt431_access(struct cpu *cpu, struct memory *mem,
108 uint64_t relative_addr, unsigned char *data, size_t len,
109 int writeflag, void *);
110 struct vfb_data;
111 void dev_bt431_init(struct memory *mem, uint64_t baseaddr,
112 struct vfb_data *vfb_data, int color_fb_flag);
113
114 /* dev_bt455.c: */
115 #define DEV_BT455_LENGTH 0x20
116 int dev_bt455_access(struct cpu *cpu, struct memory *mem,
117 uint64_t relative_addr, unsigned char *data, size_t len,
118 int writeflag, void *);
119 struct vfb_data;
120 void dev_bt455_init(struct memory *mem, uint64_t baseaddr,
121 struct vfb_data *vfb_data);
122
123 /* dev_bt459.c: */
124 #define DEV_BT459_LENGTH 0x20
125 #define DEV_BT459_NREGS 0x1000
126 #define BT459_PX 1 /* px[g] */
127 #define BT459_BA 2 /* cfb */
128 #define BT459_BBA 3 /* sfb */
129 int dev_bt459_access(struct cpu *cpu, struct memory *mem,
130 uint64_t relative_addr, unsigned char *data, size_t len,
131 int writeflag, void *);
132 struct vfb_data;
133 void dev_bt459_init(struct machine *machine, struct memory *mem,
134 uint64_t baseaddr, uint64_t baseaddr_irq, struct vfb_data *vfb_data,
135 int color_fb_flag, char *irq_path, int type);
136
137 /* dev_colorplanemask.c: */
138 #define DEV_COLORPLANEMASK_LENGTH 0x0000000000000010
139 int dev_colorplanemask_access(struct cpu *cpu, struct memory *mem,
140 uint64_t relative_addr, unsigned char *data, size_t len,
141 int writeflag, void *);
142 void dev_colorplanemask_init(struct memory *mem, uint64_t baseaddr,
143 unsigned char *color_plane_mask);
144
145 /* dev_dc7085.c: */
146 #define DEV_DC7085_LENGTH 0x0000000000000080
147 /* see dc7085.h for more info */
148 void dev_dc7085_tick(struct cpu *cpu, void *);
149 int dev_dc7085_access(struct cpu *cpu, struct memory *mem,
150 uint64_t relative_addr, unsigned char *data, size_t len,
151 int writeflag, void *);
152 int dev_dc7085_init(struct machine *machine, struct memory *mem,
153 uint64_t baseaddr, char *irq_path, int use_fb);
154
155 /* dev_dec5800.c: */
156 #define DEV_DECCCA_LENGTH 0x10000 /* ? */
157 #define DEC_DECCCA_BASEADDR 0x19000000 /* ? I just made this up */
158 int dev_deccca_access(struct cpu *cpu, struct memory *mem, uint64_t relative_addr, unsigned char *data, size_t len, int writeflag, void *);
159 void dev_deccca_init(struct memory *mem, uint64_t baseaddr);
160 #define DEV_DECXMI_LENGTH 0x800000
161 int dev_decxmi_access(struct cpu *cpu, struct memory *mem, uint64_t relative_addr, unsigned char *data, size_t len, int writeflag, void *);
162 void dev_decxmi_init(struct memory *mem, uint64_t baseaddr);
163
164 /* dev_fb.c: */
165 #define DEV_FB_LENGTH 0x3c0000 /* 3c0000 to not colide with */
166 /* turbochannel rom, */
167 /* otherwise size = 4MB */
168 /* Type: */
169 #define VFB_GENERIC 0
170 #define VFB_HPC 1
171 #define VFB_DEC_VFB01 2
172 #define VFB_DEC_VFB02 3
173 #define VFB_DEC_MAXINE 4
174 #define VFB_PLAYSTATION2 5
175 /* Extra flags: */
176 #define VFB_REVERSE_START 0x10000
177 struct vfb_data {
178 struct memory *memory;
179 int vfb_type;
180
181 int vfb_scaledown;
182
183 int xsize;
184 int ysize;
185 int bit_depth;
186 int color32k; /* hack for 16-bit HPCmips */
187 int psp_15bit; /* playstation portable hack */
188
189 unsigned char color_plane_mask;
190
191 int bytes_per_line; /* cached */
192
193 int visible_xsize;
194 int visible_ysize;
195
196 size_t framebuffer_size;
197 int x11_xsize, x11_ysize;
198
199 int update_x1, update_y1, update_x2, update_y2;
200
201 /* RGB palette for <= 8 bit modes: (r,g,b bytes for each) */
202 unsigned char rgb_palette[256 * 3];
203
204 char *name;
205 char title[100];
206
207 void (*redraw_func)(struct vfb_data *, int, int);
208
209 /* These should always be in sync: */
210 unsigned char *framebuffer;
211 struct fb_window *fb_window;
212 };
213 #define VFB_MFB_BT455 0x100000
214 #define VFB_MFB_BT431 0x180000
215 #define VFB_MFB_VRAM 0x200000
216 #define VFB_CFB_BT459 0x200000
217 void set_grayscale_palette(struct vfb_data *d, int ncolors);
218 void dev_fb_resize(struct vfb_data *d, int new_xsize, int new_ysize);
219 void dev_fb_setcursor(struct vfb_data *d, int cursor_x, int cursor_y, int on,
220 int cursor_xsize, int cursor_ysize);
221 void framebuffer_blockcopyfill(struct vfb_data *d, int fillflag, int fill_r,
222 int fill_g, int fill_b, int x1, int y1, int x2, int y2,
223 int from_x, int from_y);
224 void dev_fb_tick(struct cpu *, void *);
225 int dev_fb_access(struct cpu *cpu, struct memory *mem, uint64_t relative_addr,
226 unsigned char *data, size_t len, int writeflag, void *);
227 struct vfb_data *dev_fb_init(struct machine *machine, struct memory *mem,
228 uint64_t baseaddr, int vfb_type, int visible_xsize, int visible_ysize,
229 int xsize, int ysize, int bit_depth, char *name);
230
231 /* dev_gt.c: */
232 #define DEV_GT_LENGTH 0x1000
233 int dev_gt_access(struct cpu *cpu, struct memory *mem, uint64_t relative_addr,
234 unsigned char *data, size_t len, int writeflag, void *);
235 struct pci_data *dev_gt_init(struct machine *machine, struct memory *mem,
236 uint64_t baseaddr, char *timer_irq_path, char *isa_irq_path, int type);
237
238 /* dev_jazz.c: */
239 size_t dev_jazz_dma_controller(void *dma_controller_data,
240 unsigned char *data, size_t len, int writeflag);
241
242 /* dev_kn01.c: */
243 #define DEV_KN01_LENGTH 4
244 int dev_kn01_access(struct cpu *cpu, struct memory *mem,
245 uint64_t relative_addr, unsigned char *data, size_t len,
246 int writeflag, void *);
247 void dev_kn01_init(struct memory *mem, uint64_t baseaddr, int color_fb);
248 #define DEV_VDAC_LENGTH 0x20
249 #define DEV_VDAC_MAPWA 0x00
250 #define DEV_VDAC_MAP 0x04
251 #define DEV_VDAC_MASK 0x08
252 #define DEV_VDAC_MAPRA 0x0c
253 #define DEV_VDAC_OVERWA 0x10
254 #define DEV_VDAC_OVER 0x14
255 #define DEV_VDAC_OVERRA 0x1c
256 int dev_vdac_access(struct cpu *cpu, struct memory *mem,
257 uint64_t relative_addr, unsigned char *data, size_t len,
258 int writeflag, void *);
259 void dev_vdac_init(struct memory *mem, uint64_t baseaddr,
260 unsigned char *rgb_palette, int color_fb_flag);
261
262 /* dev_kn220.c: */
263 #define DEV_DEC5500_IOBOARD_LENGTH 0x100000
264 int dev_dec5500_ioboard_access(struct cpu *cpu, struct memory *mem, uint64_t relative_addr, unsigned char *data, size_t len, int writeflag, void *);
265 struct dec5500_ioboard_data *dev_dec5500_ioboard_init(struct cpu *cpu, struct memory *mem, uint64_t baseaddr);
266 #define DEV_SGEC_LENGTH 0x1000
267 int dev_sgec_access(struct cpu *cpu, struct memory *mem, uint64_t relative_addr, unsigned char *data, size_t len, int writeflag, void *);
268 void dev_sgec_init(struct memory *mem, uint64_t baseaddr, int irq_nr);
269
270 /* dev_le.c: */
271 #define DEV_LE_LENGTH 0x1c0200
272 int dev_le_access(struct cpu *cpu, struct memory *mem,
273 uint64_t relative_addr, unsigned char *data, size_t len,
274 int writeflag, void *);
275 void dev_le_init(struct machine *machine, struct memory *mem,
276 uint64_t baseaddr, uint64_t buf_start, uint64_t buf_end,
277 char *irq_path, int len);
278
279 /* dev_mc146818.c: */
280 #define DEV_MC146818_LENGTH 0x0000000000000100
281 #define MC146818_DEC 0
282 #define MC146818_PC_CMOS 1
283 #define MC146818_ARC_NEC 2
284 #define MC146818_ARC_JAZZ 3
285 #define MC146818_SGI 4
286 #define MC146818_CATS 5
287 #define MC146818_ALGOR 6
288 #define MC146818_PMPPC 7
289 /* see mc146818reg.h for more info */
290 void dev_mc146818_tick(struct cpu *cpu, void *);
291 int dev_mc146818_access(struct cpu *cpu, struct memory *mem,
292 uint64_t relative_addr, unsigned char *data, size_t len,
293 int writeflag, void *);
294 void dev_mc146818_init(struct machine *machine, struct memory *mem,
295 uint64_t baseaddr, char *irq_path, int access_style, int addrdiv);
296
297 /* dev_pckbc.c: */
298 #define DEV_PCKBC_LENGTH 0x10
299 #define PCKBC_8042 0
300 #define PCKBC_8242 1
301 #define PCKBC_JAZZ 3
302 int dev_pckbc_access(struct cpu *cpu, struct memory *mem,
303 uint64_t relative_addr, unsigned char *data, size_t len,
304 int writeflag, void *);
305 int dev_pckbc_init(struct machine *machine, struct memory *mem,
306 uint64_t baseaddr, int type, char *keyboard_irqpath,
307 char *mouse_irqpath, int in_use, int pc_style_flag);
308
309 /* dev_pmagja.c: */
310 #define DEV_PMAGJA_LENGTH 0x3c0000
311 int dev_pmagja_access(struct cpu *cpu, struct memory *mem,
312 uint64_t relative_addr, unsigned char *data, size_t len,
313 int writeflag, void *);
314 void dev_pmagja_init(struct machine *machine, struct memory *mem,
315 uint64_t baseaddr, char *irq_path);
316
317 /* dev_px.c: */
318 struct px_data {
319 struct memory *fb_mem;
320 struct vfb_data *vfb_data;
321 int type;
322 char *px_name;
323 struct interrupt irq;
324 int bitdepth;
325 int xconfig;
326 int yconfig;
327
328 uint32_t intr;
329 unsigned char sram[128 * 1024];
330 };
331 /* TODO: perhaps these types are wrong? */
332 #define DEV_PX_TYPE_PX 0
333 #define DEV_PX_TYPE_PXG 1
334 #define DEV_PX_TYPE_PXGPLUS 2
335 #define DEV_PX_TYPE_PXGPLUSTURBO 3
336 #define DEV_PX_LENGTH 0x3c0000
337 int dev_px_access(struct cpu *cpu, struct memory *mem, uint64_t relative_addr,
338 unsigned char *data, size_t len, int writeflag, void *);
339 void dev_px_init(struct machine *machine, struct memory *mem,
340 uint64_t baseaddr, int px_type, char *irq_path);
341
342 /* dev_ram.c: */
343 #define DEV_RAM_RAM 0
344 #define DEV_RAM_MIRROR 1
345 #define DEV_RAM_MIGHT_POINT_TO_DEVICES 0x10
346 int dev_ram_access(struct cpu *cpu, struct memory *mem, uint64_t relative_addr,
347 unsigned char *data, size_t len, int writeflag, void *);
348 void dev_ram_init(struct machine *machine, uint64_t baseaddr, uint64_t length,
349 int mode, uint64_t otheraddr);
350
351 /* dev_scc.c: */
352 #define DEV_SCC_LENGTH 0x1000
353 int dev_scc_access(struct cpu *cpu, struct memory *mem, uint64_t relative_addr,
354 unsigned char *data, size_t len, int writeflag, void *);
355 int dev_scc_dma_func(struct cpu *cpu, void *extra, uint64_t addr,
356 size_t dma_len, int tx);
357 void *dev_scc_init(struct machine *machine, struct memory *mem,
358 uint64_t baseaddr, int irq_nr, int use_fb, int scc_nr, int addrmul);
359
360 /* dev_sfb.c: */
361 #define DEV_SFB_LENGTH 0x400000
362 int dev_sfb_access(struct cpu *cpu, struct memory *mem, uint64_t relative_addr,
363 unsigned char *data, size_t len, int writeflag, void *);
364 void dev_sfb_init(struct machine *machine, struct memory *mem,
365 uint64_t baseaddr, struct vfb_data *vfb_data);
366
367 /* dev_sgi_gbe.c: */
368 #define DEV_SGI_GBE_LENGTH 0x1000000
369 int dev_sgi_gbe_access(struct cpu *cpu, struct memory *mem,
370 uint64_t relative_addr, unsigned char *data, size_t len, int writeflag,
371 void *);
372 void dev_sgi_gbe_init(struct machine *machine, struct memory *mem,
373 uint64_t baseaddr);
374
375 /* dev_sgi_ip20.c: */
376 #define DEV_SGI_IP20_LENGTH 0x40
377 #define DEV_SGI_IP20_BASE 0x1fb801c0
378 struct sgi_ip20_data {
379 int dummy;
380 };
381 int dev_sgi_ip20_access(struct cpu *cpu, struct memory *mem, uint64_t relative_addr, unsigned char *data, size_t len, int writeflag, void *);
382 struct sgi_ip20_data *dev_sgi_ip20_init(struct cpu *cpu, struct memory *mem, uint64_t baseaddr);
383
384 /* dev_sgi_ip22.c: */
385 #define DEV_SGI_IP22_LENGTH 0x100
386 #define DEV_SGI_IP22_IMC_LENGTH 0x100
387 #define DEV_SGI_IP22_UNKNOWN2_LENGTH 0x100
388 #define IP22_IMC_BASE 0x1fa00000
389 #define IP22_UNKNOWN2_BASE 0x1fb94000
390 struct sgi_ip22_data {
391 int guiness_flag;
392 uint32_t reg[DEV_SGI_IP22_LENGTH / 4];
393 uint32_t imc_reg[DEV_SGI_IP22_IMC_LENGTH / 4];
394 uint32_t unknown2_reg[DEV_SGI_IP22_UNKNOWN2_LENGTH / 4];
395 uint32_t unknown_timer;
396 };
397 int dev_sgi_ip22_access(struct cpu *cpu, struct memory *mem, uint64_t relative_addr, unsigned char *data, size_t len, int writeflag, void *);
398 struct sgi_ip22_data *dev_sgi_ip22_init(struct machine *machine, struct memory *mem, uint64_t baseaddr, int guiness_flag);
399
400 /* dev_sgi_ip32.c: */
401 void dev_crime_init(struct machine *machine, struct memory *mem,
402 uint64_t baseaddr, char *irq_path, int use_fb);
403 #define DEV_MACEPCI_LENGTH 0x1000
404 int dev_macepci_access(struct cpu *cpu, struct memory *mem,
405 uint64_t relative_addr, unsigned char *data, size_t len,
406 int writeflag, void *);
407 struct pci_data *dev_macepci_init(struct machine *machine, struct memory *mem,
408 uint64_t baseaddr, char *irq_path);
409 #define DEV_SGI_MEC_LENGTH 0x1000
410 int dev_sgi_mec_access(struct cpu *cpu, struct memory *mem,
411 uint64_t relative_addr, unsigned char *data, size_t len,
412 int writeflag, void *);
413 void dev_sgi_mec_init(struct machine *machine, struct memory *mem,
414 uint64_t baseaddr, char *irq_path, unsigned char *macaddr);
415 #define DEV_SGI_UST_LENGTH 0x10000
416 int dev_sgi_ust_access(struct cpu *cpu, struct memory *mem,
417 uint64_t relative_addr, unsigned char *data, size_t len,
418 int writeflag, void *);
419 void dev_sgi_ust_init(struct memory *mem, uint64_t baseaddr);
420 #define DEV_SGI_MTE_LENGTH 0x10000
421 int dev_sgi_mte_access(struct cpu *cpu, struct memory *mem,
422 uint64_t relative_addr, unsigned char *data, size_t len,
423 int writeflag, void *);
424 void dev_sgi_mte_init(struct memory *mem, uint64_t baseaddr);
425
426 /* dev_sii.c: */
427 #define DEV_SII_LENGTH 0x100
428 void dev_sii_tick(struct cpu *cpu, void *);
429 int dev_sii_access(struct cpu *cpu, struct memory *mem, uint64_t relative_addr,
430 unsigned char *data, size_t len, int writeflag, void *);
431 void dev_sii_init(struct machine *machine, struct memory *mem,
432 uint64_t baseaddr, uint64_t buf_start, uint64_t buf_end,
433 char *irq_path);
434
435 /* dev_ssc.c: */
436 #define DEV_SSC_LENGTH 0x1000
437 int dev_ssc_access(struct cpu *cpu, struct memory *mem, uint64_t relative_addr,
438 unsigned char *data, size_t len, int writeflag, void *);
439 void dev_ssc_init(struct machine *machine, struct memory *mem,
440 uint64_t baseaddr, char *irq_path, int use_fb);
441
442 /* dev_turbochannel.c: */
443 #define DEV_TURBOCHANNEL_LEN 0x0470
444 int dev_turbochannel_access(struct cpu *cpu, struct memory *mem,
445 uint64_t relative_addr, unsigned char *data, size_t len,
446 int writeflag, void *);
447 void dev_turbochannel_init(struct machine *machine, struct memory *mem,
448 int slot_nr, uint64_t baseaddr, uint64_t endaddr, char *device_name,
449 char *irq_path);
450
451 /* dev_uninorth.c: */
452 struct pci_data *dev_uninorth_init(struct machine *machine, struct memory *mem,
453 uint64_t addr, int irqbase, int pciirq);
454
455 /* dev_vga.c: */
456 int dev_vga_access(struct cpu *cpu, struct memory *mem, uint64_t relative_addr,
457 unsigned char *data, size_t len, int writeflag, void *);
458 void dev_vga_init(struct machine *machine, struct memory *mem,
459 uint64_t videomem_base, uint64_t control_base, char *name);
460
461 /* dev_vr41xx.c: */
462 struct vr41xx_data *dev_vr41xx_init(struct machine *machine,
463 struct memory *mem, int cpumodel);
464
465 /* lk201.c: */
466 struct lk201_data {
467 int use_fb;
468 int console_handle;
469
470 void (*add_to_rx_queue)(void *,int,int);
471 void *add_data;
472
473 unsigned char keyb_buf[8];
474 int keyb_buf_pos;
475
476 int mouse_mode;
477 int mouse_revision; /* 0..15 */
478 int mouse_x, mouse_y, mouse_buttons;
479 };
480 void lk201_tick(struct machine *, struct lk201_data *);
481 void lk201_tx_data(struct lk201_data *, int port, int idata);
482 void lk201_init(struct lk201_data *d, int use_fb,
483 void (*add_to_rx_queue)(void *,int,int), int console_handle, void *);
484
485
486 #endif /* DEVICES_H */
487

  ViewVC Help
Powered by ViewVC 1.1.26