/[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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 34 - (hide annotations)
Mon Oct 8 16:21:17 2007 UTC (16 years, 7 months ago) by dpavlin
File MIME type: text/plain
File size: 19004 byte(s)
++ trunk/HISTORY	(local)
$Id: HISTORY,v 1.1480 2007/02/19 01:34:42 debug Exp $
20061029	Changing usleep(1) calls in the debugger to usleep(10000)
20061107	Adding a new disk image option (-d o...) which sets the ISO9660
		filesystem base offset; also making some other hacks to allow
		NetBSD/dreamcast and homebrew demos/games to boot directly
		from a filesystem image.
		Moving Dreamcast-specific stuff in the documentation to its
		own page (dreamcast.html).
		Adding a border to the Dreamcast PVR framebuffer.
20061108	Adding a -T command line option (again?), for halting the
		emulator on unimplemented memory accesses.
20061109	Continuing on various SH4 and Dreamcast related things.
		The emulator should now halt on more unimplemented device
		accesses, instead of just printing a warning, forcing me to
		actually implement missing stuff :)
20061111	Continuing on SH4 and Dreamcast stuff.
		Adding a bogus Landisk (SH4) machine mode.
20061112	Implementing some parts of the Dreamcast GDROM device. With
		some ugly hacks, NetBSD can (barely) mount an ISO image.
20061113	NetBSD/dreamcast now starts booting from the Live CD image,
		but crashes randomly quite early on in the boot process.
20061122	Beginning on a skeleton interrupt.h and interrupt.c for the
		new interrupt subsystem.
20061124	Continuing on the new interrupt system; taking the first steps
		to attempt to connect CPUs (SuperH and MIPS) and devices
		(dev_cons and SH4 timer interrupts) to it. Many things will
		probably break from now on.
20061125	Converting dev_ns16550, dev_8253 to the new interrupt system.
		Attempting to begin to convert the ISA bus.
20061130	Incorporating a patch from Brian Foley for the configure
		script, which checks for X11 libs in /usr/X11R6/lib64 (which
		is used on some Linux systems).
20061227	Adding a note in the man page about booting from Dreamcast
		CDROM images (i.e. that no external kernel is needed).
20061229	Continuing on the interrupt system rewrite: beginning to
		convert more devices, adding abort() calls for legacy interrupt
		system calls so that everything now _has_ to be rewritten!
		Almost all machine modes are now completely broken.
20061230	More progress on removing old interrupt code, mostly related
		to the ISA bus + devices, the LCA bus (on AlphaBook1), and
		the Footbridge bus (for CATS). And some minor PCI stuff.
		Connecting the ARM cpu to the new interrupt system.
		The CATS, NetWinder, and QEMU_MIPS machine modes now work with
		the new interrupt system :)
20061231	Connecting PowerPC CPUs to the new interrupt system.
		Making PReP machines (IBM 6050) work again.
		Beginning to convert the GT PCI controller (for e.g. Malta
		and Cobalt emulation). Some things work, but not everything.
		Updating Copyright notices for 2007.
20070101	Converting dev_kn02 from legacy style to devinit; the 3max
		machine mode now works with the new interrupt system :-]
20070105	Beginning to convert the SGI O2 machine to the new interrupt
		system; finally converting O2 (IP32) devices to devinit, etc.
20070106	Continuing on the interrupt system redesign/rewrite; KN01
		(PMAX), KN230, and Dreamcast ASIC interrupts should work again,
		moving out stuff from machine.h and devices.h into the
		corresponding devices, beginning the rewrite of i80321
		interrupts, etc.
20070107	Beginning on the rewrite of Eagle interrupt stuff (PReP, etc).
20070117	Beginning the rewrite of Algor (V3) interrupts (finally
		changing dev_v3 into devinit style).
20070118	Removing the "bus" registry concept from machine.h, because
		it was practically meaningless.
		Continuing on the rewrite of Algor V3 ISA interrupts.
20070121	More work on Algor interrupts; they are now working again,
		well enough to run NetBSD/algor. :-)
20070122	Converting VR41xx (HPCmips) interrupts. NetBSD/hpcmips
		can be installed using the new interrupt system :-)
20070123	Making the testmips mode work with the new interrupt system.
20070127	Beginning to convert DEC5800 devices to devinit, and to the
		new interrupt system.
		Converting Playstation 2 devices to devinit, and converting
		the interrupt system. Also fixing a severe bug: the interrupt
		mask register on Playstation 2 is bitwise _toggled_ on writes.
20070128	Removing the dummy NetGear machine mode and the 8250 device
		(which was only used by the NetGear machine).
		Beginning to convert the MacPPC GC (Grand Central) interrupt
		controller to the new interrupt system.
		Converting Jazz interrupts (PICA61 etc.) to the new interrupt
		system. NetBSD/arc can be installed again :-)
		Fixing the JAZZ timer (hardcoding it at 100 Hz, works with
		NetBSD and it is better than a completely dummy timer as it
		was before).
		Converting dev_mp to the new interrupt system, although I
		haven't had time to actually test it yet.
		Completely removing src/machines/interrupts.c, cpu_interrupt
		and cpu_interrupt_ack in src/cpu.c, and
		src/include/machine_interrupts.h! Adding fatal error messages
		+ abort() in the few places that are left to fix.
		Converting dev_z8530 to the new interrupt system.
		FINALLY removing the md_int struct completely from the
		machine struct.
		SH4 fixes (adding a PADDR invalidation in the ITLB replacement
		code in memory_sh.c); the NetBSD/dreamcast LiveCD now runs
		all the way to the login prompt, and can be interacted with :-)
		Converting the CPC700 controller (PCI and interrupt controller
		for PM/PPC) to the new interrupt system.
20070129	Fixing MACE ISA interrupts (SGI IP32 emulation). Both NetBSD/
		sgimips' and OpenBSD/sgi's ramdisk kernels can now be
		interacted with again.
20070130	Moving out the MIPS multi_lw and _sw instruction combinations
		so that they are auto-generated at compile time instead.
20070131	Adding detection of amd64/x86_64 hosts in the configure script,
		for doing initial experiments (again :-) with native code
		generation.
		Adding a -k command line option to set the size of the dyntrans
		cache, and a -B command line option to disable native code
		generation, even if GXemul was compiled with support for
		native code generation for the specific host CPU architecture.
20070201	Experimenting with a skeleton for native code generation.
		Changing the default behaviour, so that native code generation
		is now disabled by default, and has to be enabled by using
		-b on the command line.
20070202	Continuing the native code generation experiments.
		Making PCI interrupts work for Footbridge again.
20070203	More native code generation experiments.
		Removing most of the native code generation experimental code,
		it does not make sense to include any quick hacks like this.
		Minor cleanup/removal of some more legacy MIPS interrupt code.
20070204	Making i80321 interrupts work again (for NetBSD/evbarm etc.),
		and fixing the timer at 100 Hz.
20070206	Experimenting with removing the wdc interrupt slowness hack.
20070207	Lowering the number of dyntrans TLB entries for MIPS from
		192 to 128, resulting in a minor speed improvement.
		Minor optimization to the code invalidation routine in
		cpu_dyntrans.c.
20070208	Increasing (experimentally) the nr of dyntrans instructions per
		loop from 60 to 120.
20070210	Commenting out (experimentally) the dyntrans_device_danger
		detection in memory_rw.c.
		Changing the testmips and baremips machines to use a revision 2
		MIPS64 CPU by default, instead of revision 1.
		Removing the dummy i960, IA64, x86, AVR32, and HP PA-RISC
		files, the PC bios emulation, and the Olivetti M700 (ARC) and
		db64360 emulation modes.
20070211	Adding an "mp" demo to the demos directory, which tests the
		SMP functionality of the testmips machine.
		Fixing PReP interrupts some more. NetBSD/prep now boots again.
20070216	Adding a "nop workaround" for booting Mach/PMAX to the
		documentation; thanks to Artur Bujdoso for the values.
		Converting more of the MacPPC interrupt stuff to the new
		system.
		Beginning to convert BeBox interrupts to the new system.
		PPC603e should NOT have the PPC_NO_DEC flag! Removing it.
		Correcting BeBox clock speed (it was set to 100 in the NetBSD
		bootinfo block, but should be 33000000/4), allowing NetBSD
		to start without using the (incorrect) PPC_NO_DEC hack.
20070217	Implementing (slow) AltiVec vector loads and stores, allowing
		NetBSD/macppc to finally boot using the GENERIC kernel :-)
		Updating the documentation with install instructions for
		NetBSD/macppc.
20070218-19	Regression testing for the release.

==============  RELEASE 0.4.4  ==============


1 dpavlin 4 #ifndef DEVICES_H
2     #define DEVICES_H
3    
4     /*
5 dpavlin 34 * Copyright (C) 2003-2007 Anders Gavare. All rights reserved.
6 dpavlin 4 *
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 dpavlin 34 * $Id: devices.h,v 1.241 2007/02/10 14:21:10 debug Exp $
32 dpavlin 4 *
33     * Memory mapped devices.
34     *
35 dpavlin 34 * 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 dpavlin 4 */
48    
49     #include <sys/types.h>
50     #include <inttypes.h>
51    
52 dpavlin 34 #include "interrupt.h"
53    
54 dpavlin 4 struct cpu;
55     struct machine;
56     struct memory;
57     struct pci_data;
58 dpavlin 32 struct timer;
59 dpavlin 4
60     /* #ifdef WITH_X11
61     #include <X11/Xlib.h>
62     #endif */
63    
64 dpavlin 6 /* dev_8259.c: */
65     struct pic8259_data {
66 dpavlin 34 struct interrupt irq;
67 dpavlin 4
68 dpavlin 6 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 dpavlin 4 /* 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 dpavlin 34 char *irq_path, void *turbochannel, int mode,
100 dpavlin 4 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 dpavlin 34 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 dpavlin 4 struct vfb_data;
111 dpavlin 34 void dev_bt431_init(struct memory *mem, uint64_t baseaddr,
112     struct vfb_data *vfb_data, int color_fb_flag);
113 dpavlin 4
114     /* dev_bt455.c: */
115     #define DEV_BT455_LENGTH 0x20
116 dpavlin 34 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 dpavlin 4 struct vfb_data;
120 dpavlin 34 void dev_bt455_init(struct memory *mem, uint64_t baseaddr,
121     struct vfb_data *vfb_data);
122 dpavlin 4
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 dpavlin 34 int color_fb_flag, char *irq_path, int type);
136 dpavlin 4
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 dpavlin 34 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 dpavlin 4
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 dpavlin 12 #define DEV_FB_LENGTH 0x3c0000 /* 3c0000 to not colide with */
166     /* turbochannel rom, */
167     /* otherwise size = 4MB */
168 dpavlin 22 /* Type: */
169 dpavlin 12 #define VFB_GENERIC 0
170 dpavlin 18 #define VFB_HPC 1
171 dpavlin 12 #define VFB_DEC_VFB01 2
172     #define VFB_DEC_VFB02 3
173     #define VFB_DEC_MAXINE 4
174     #define VFB_PLAYSTATION2 5
175 dpavlin 22 /* Extra flags: */
176     #define VFB_REVERSE_START 0x10000
177 dpavlin 4 struct vfb_data {
178 dpavlin 28 struct memory *memory;
179 dpavlin 4 int vfb_type;
180    
181     int vfb_scaledown;
182    
183     int xsize;
184     int ysize;
185     int bit_depth;
186 dpavlin 10 int color32k; /* hack for 16-bit HPCmips */
187 dpavlin 24 int psp_15bit; /* playstation portable hack */
188 dpavlin 4
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 dpavlin 28 char *name;
205     char title[100];
206    
207 dpavlin 22 void (*redraw_func)(struct vfb_data *, int, int);
208    
209 dpavlin 4 /* 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 dpavlin 6 void dev_fb_resize(struct vfb_data *d, int new_xsize, int new_ysize);
219 dpavlin 4 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 dpavlin 12 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 dpavlin 4
231     /* dev_gt.c: */
232 dpavlin 10 #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 dpavlin 34 uint64_t baseaddr, char *timer_irq_path, char *isa_irq_path, int type);
237 dpavlin 4
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 dpavlin 34 #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 dpavlin 4 #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 dpavlin 34 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 dpavlin 4
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 dpavlin 34 char *irq_path, int len);
278 dpavlin 4
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 dpavlin 16 #define MC146818_CATS 5
287 dpavlin 20 #define MC146818_ALGOR 6
288     #define MC146818_PMPPC 7
289 dpavlin 4 /* 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 dpavlin 34 uint64_t baseaddr, char *irq_path, int access_style, int addrdiv);
296 dpavlin 4
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 dpavlin 34 uint64_t baseaddr, int type, char *keyboard_irqpath,
307     char *mouse_irqpath, int in_use, int pc_style_flag);
308 dpavlin 4
309 dpavlin 34 /* dev_pmagja.c: */
310     #define DEV_PMAGJA_LENGTH 0x3c0000
311     int dev_pmagja_access(struct cpu *cpu, struct memory *mem,
312 dpavlin 4 uint64_t relative_addr, unsigned char *data, size_t len,
313     int writeflag, void *);
314 dpavlin 34 void dev_pmagja_init(struct machine *machine, struct memory *mem,
315     uint64_t baseaddr, char *irq_path);
316 dpavlin 4
317     /* dev_px.c: */
318     struct px_data {
319 dpavlin 34 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 dpavlin 4
328 dpavlin 34 uint32_t intr;
329     unsigned char sram[128 * 1024];
330 dpavlin 4 };
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 dpavlin 18 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 dpavlin 34 void dev_px_init(struct machine *machine, struct memory *mem,
340     uint64_t baseaddr, int px_type, char *irq_path);
341 dpavlin 4
342     /* dev_ram.c: */
343 dpavlin 18 #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 dpavlin 4
351     /* dev_scc.c: */
352     #define DEV_SCC_LENGTH 0x1000
353 dpavlin 18 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 dpavlin 4
360     /* dev_sfb.c: */
361     #define DEV_SFB_LENGTH 0x400000
362 dpavlin 18 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 dpavlin 4
367     /* dev_sgi_gbe.c: */
368     #define DEV_SGI_GBE_LENGTH 0x1000000
369 dpavlin 18 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 dpavlin 4
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 dpavlin 34 void dev_crime_init(struct machine *machine, struct memory *mem,
402     uint64_t baseaddr, char *irq_path, int use_fb);
403 dpavlin 4 #define DEV_MACEPCI_LENGTH 0x1000
404 dpavlin 34 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 dpavlin 4 #define DEV_SGI_MEC_LENGTH 0x1000
410 dpavlin 34 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 dpavlin 4 #define DEV_SGI_UST_LENGTH 0x10000
416 dpavlin 34 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 dpavlin 4 void dev_sgi_ust_init(struct memory *mem, uint64_t baseaddr);
420     #define DEV_SGI_MTE_LENGTH 0x10000
421 dpavlin 34 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 dpavlin 4 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 dpavlin 34 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 dpavlin 4
435     /* dev_ssc.c: */
436     #define DEV_SSC_LENGTH 0x1000
437 dpavlin 34 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 dpavlin 4
442     /* dev_turbochannel.c: */
443     #define DEV_TURBOCHANNEL_LEN 0x0470
444 dpavlin 6 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 dpavlin 34 char *irq_path);
450 dpavlin 4
451 dpavlin 22 /* 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 dpavlin 4 /* 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 dpavlin 6 uint64_t videomem_base, uint64_t control_base, char *name);
460 dpavlin 4
461     /* dev_vr41xx.c: */
462     struct vr41xx_data *dev_vr41xx_init(struct machine *machine,
463     struct memory *mem, int cpumodel);
464    
465     /* dev_wdsc.c: */
466     #define DEV_WDSC_NREGS 0x100 /* 8-bit register select */
467     #define DEV_WDSC_LENGTH 0x10
468     int dev_wdsc_access(struct cpu *cpu, struct memory *mem, uint64_t relative_addr, unsigned char *data, size_t len, int writeflag, void *);
469     void dev_wdsc_init(struct machine *machine, struct memory *mem, uint64_t baseaddr, int controller_nr, int irq_nr);
470    
471     /* lk201.c: */
472     struct lk201_data {
473     int use_fb;
474     int console_handle;
475    
476     void (*add_to_rx_queue)(void *,int,int);
477     void *add_data;
478    
479     unsigned char keyb_buf[8];
480     int keyb_buf_pos;
481    
482     int mouse_mode;
483     int mouse_revision; /* 0..15 */
484     int mouse_x, mouse_y, mouse_buttons;
485     };
486 dpavlin 32 void lk201_tick(struct machine *, struct lk201_data *);
487 dpavlin 4 void lk201_tx_data(struct lk201_data *, int port, int idata);
488     void lk201_init(struct lk201_data *d, int use_fb,
489     void (*add_to_rx_queue)(void *,int,int), int console_handle, void *);
490    
491    
492     #endif /* DEVICES_H */
493    

  ViewVC Help
Powered by ViewVC 1.1.26