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

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

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 4 by dpavlin, Mon Oct 8 16:18:00 2007 UTC revision 20 by dpavlin, Mon Oct 8 16:19:23 2007 UTC
# Line 28  Line 28 
28   *  SUCH DAMAGE.   *  SUCH DAMAGE.
29   *   *
30   *   *
31   *  $Id: devices.h,v 1.162 2005/04/11 20:44:40 debug Exp $   *  $Id: devices.h,v 1.194 2005/11/22 02:07:40 debug Exp $
32   *   *
33   *  Memory mapped devices.   *  Memory mapped devices.
34   *   *
# Line 48  struct pci_data; Line 48  struct pci_data;
48  #include <X11/Xlib.h>  #include <X11/Xlib.h>
49  #endif */  #endif */
50    
51    /*  dev_8259.c:  */
52    struct pic8259_data {
53            int             irq_nr;         /*  if connected to another 8259  */
54    
55            int             irq_base;
56            int             current_command;
57    
58            int             init_state;
59    
60            int             priority_reg;
61            uint8_t         irr;            /*  interrupt request register  */
62            uint8_t         isr;            /*  interrupt in-service register  */
63            uint8_t         ier;            /*  interrupt enable register  */
64    };
65    
66  /*  dev_dec_ioasic.c:  */  /*  dev_dec_ioasic.c:  */
67  #define DEV_DEC_IOASIC_LENGTH           0x80100  #define DEV_DEC_IOASIC_LENGTH           0x80100
# Line 91  struct au1x00_ic_data { Line 105  struct au1x00_ic_data {
105  int dev_au1x00_access(struct cpu *cpu, struct memory *mem, uint64_t relative_addr, unsigned char *data, size_t len, int writeflag, void *);  int dev_au1x00_access(struct cpu *cpu, struct memory *mem, uint64_t relative_addr, unsigned char *data, size_t len, int writeflag, void *);
106  struct au1x00_ic_data *dev_au1x00_init(struct machine *machine, struct memory *mem);  struct au1x00_ic_data *dev_au1x00_init(struct machine *machine, struct memory *mem);
107    
108    /*  dev_bebox.c:  */
109    struct bebox_data {
110            /*  The 5 motherboard registers:  */  
111            uint32_t        cpu0_int_mask;
112            uint32_t        cpu1_int_mask;
113            uint32_t        int_status;
114            uint32_t        xpi;
115            uint32_t        resets;
116    };
117    
118  /*  dev_bt431.c:  */  /*  dev_bt431.c:  */
119  #define DEV_BT431_LENGTH                0x20  #define DEV_BT431_LENGTH                0x20
120  #define DEV_BT431_NREGS                 0x800   /*  ?  */  #define DEV_BT431_NREGS                 0x800   /*  ?  */
# Line 123  void dev_bt459_init(struct machine *mach Line 147  void dev_bt459_init(struct machine *mach
147  #define DEV_CONS_LENGTH                 0x0000000000000020  #define DEV_CONS_LENGTH                 0x0000000000000020
148  #define     DEV_CONS_PUTGETCHAR             0x0000  #define     DEV_CONS_PUTGETCHAR             0x0000
149  #define     DEV_CONS_HALT                   0x0010  #define     DEV_CONS_HALT                   0x0010
150  int dev_cons_access(struct cpu *cpu, struct memory *mem,  struct cons_data {
151          uint64_t relative_addr, unsigned char *data, size_t len,          int     console_handle;
152          int writeflag, void *);          int     irq_nr;
153  int dev_cons_init(struct machine *machine, struct memory *mem,  };
         uint64_t baseaddr, char *name, int irq_nr);  
154    
155  /*  dev_colorplanemask.c:  */  /*  dev_colorplanemask.c:  */
156  #define DEV_COLORPLANEMASK_LENGTH       0x0000000000000010  #define DEV_COLORPLANEMASK_LENGTH       0x0000000000000010
# Line 137  int dev_colorplanemask_access(struct cpu Line 160  int dev_colorplanemask_access(struct cpu
160  void dev_colorplanemask_init(struct memory *mem, uint64_t baseaddr,  void dev_colorplanemask_init(struct memory *mem, uint64_t baseaddr,
161          unsigned char *color_plane_mask);          unsigned char *color_plane_mask);
162    
163    /*  dev_cpc700.c:  */
164    struct cpc700_data {
165            struct pci_data *pci_data;
166            uint32_t        sr;     /*  Status register (interrupt)  */
167            uint32_t        er;     /*  Enable register  */
168    };
169    struct cpc700_data *dev_cpc700_init(struct machine *, struct memory *);
170    
171  /*  dev_dc7085.c:  */  /*  dev_dc7085.c:  */
172  #define DEV_DC7085_LENGTH               0x0000000000000080  #define DEV_DC7085_LENGTH               0x0000000000000080
173  /*  see dc7085.h for more info  */  /*  see dc7085.h for more info  */
# Line 164  void dev_deccca_init(struct memory *mem, Line 195  void dev_deccca_init(struct memory *mem,
195  int dev_decxmi_access(struct cpu *cpu, struct memory *mem, uint64_t relative_addr, unsigned char *data, size_t len, int writeflag, void *);  int dev_decxmi_access(struct cpu *cpu, struct memory *mem, uint64_t relative_addr, unsigned char *data, size_t len, int writeflag, void *);
196  void dev_decxmi_init(struct memory *mem, uint64_t baseaddr);  void dev_decxmi_init(struct memory *mem, uint64_t baseaddr);
197    
198    /*  dev_disk.c:  */
199    #define DEV_DISK_ADDRESS                0x13000000
200    
201    /*  dev_eagle.c:  */
202    struct pci_data *dev_eagle_init(struct machine *machine, struct memory *mem,
203            int irqbase, int pciirq);
204    
205    /*  dev_ether.c:  */
206    #define DEV_ETHER_ADDRESS               0x14000000
207    #define DEV_ETHER_LENGTH                0x8000
208    
209  /*  dev_fb.c:  */  /*  dev_fb.c:  */
210  #define DEV_FB_LENGTH                   0x3c0000        /*  3c0000 to not colide with turbochannel rom, otherwise size = (4*1024*1024)  */  #define DEV_FB_ADDRESS          0x12000000      /*  Default for testmips  */
211  #define VFB_GENERIC                     0  #define DEV_FB_LENGTH           0x3c0000        /*  3c0000 to not colide with */
212  #define VFB_HPCMIPS                     1                                                  /*  turbochannel rom,         */
213  #define VFB_DEC_VFB01                   2                                                  /*  otherwise size = 4MB      */
214  #define VFB_DEC_VFB02                   3  #define VFB_GENERIC             0
215  #define VFB_DEC_MAXINE                  4  #define VFB_HPC                 1
216  #define VFB_PLAYSTATION2                5  #define VFB_DEC_VFB01           2
217    #define VFB_DEC_VFB02           3
218    #define VFB_DEC_MAXINE          4
219    #define VFB_PLAYSTATION2        5
220  struct vfb_data {  struct vfb_data {
221          int             vfb_type;          int             vfb_type;
222    
# Line 180  struct vfb_data { Line 225  struct vfb_data {
225          int             xsize;          int             xsize;
226          int             ysize;          int             ysize;
227          int             bit_depth;          int             bit_depth;
228          int             color32k;          int             color32k;       /*  hack for 16-bit HPCmips  */
229            int             psp_15bit;      /*  plastation portable hack  */
230    
231          unsigned char   color_plane_mask;          unsigned char   color_plane_mask;
232    
# Line 206  struct vfb_data { Line 252  struct vfb_data {
252  #define VFB_MFB_VRAM                    0x200000  #define VFB_MFB_VRAM                    0x200000
253  #define VFB_CFB_BT459                   0x200000  #define VFB_CFB_BT459                   0x200000
254  void set_grayscale_palette(struct vfb_data *d, int ncolors);  void set_grayscale_palette(struct vfb_data *d, int ncolors);
255    void dev_fb_resize(struct vfb_data *d, int new_xsize, int new_ysize);
256  void dev_fb_setcursor(struct vfb_data *d, int cursor_x, int cursor_y, int on,  void dev_fb_setcursor(struct vfb_data *d, int cursor_x, int cursor_y, int on,
257          int cursor_xsize, int cursor_ysize);          int cursor_xsize, int cursor_ysize);
258  void framebuffer_blockcopyfill(struct vfb_data *d, int fillflag, int fill_r,  void framebuffer_blockcopyfill(struct vfb_data *d, int fillflag, int fill_r,
259          int fill_g, int fill_b, int x1, int y1, int x2, int y2,          int fill_g, int fill_b, int x1, int y1, int x2, int y2,
260          int from_x, int from_y);          int from_x, int from_y);
261  void dev_fb_tick(struct cpu *, void *);  void dev_fb_tick(struct cpu *, void *);
262  int dev_fb_access(struct cpu *cpu, struct memory *mem, uint64_t relative_addr, unsigned char *data, size_t len, int writeflag, void *);  int dev_fb_access(struct cpu *cpu, struct memory *mem, uint64_t relative_addr,
263  struct vfb_data *dev_fb_init(struct machine *machine, struct memory *mem, uint64_t baseaddr, int vfb_type,          unsigned char *data, size_t len, int writeflag, void *);
264          int visible_xsize, int visible_ysize, int xsize, int ysize, int bit_depth, char *name, int logo);  struct vfb_data *dev_fb_init(struct machine *machine, struct memory *mem,
265            uint64_t baseaddr, int vfb_type, int visible_xsize, int visible_ysize,
266            int xsize, int ysize, int bit_depth, char *name);
267    
268    /*  dev_footbridge:  */
269    #define N_FOOTBRIDGE_TIMERS             4
270    struct footbridge_data {
271            struct pci_data *pcibus;
272    
273            int             console_handle;
274    
275            int             timer_tick_countdown[N_FOOTBRIDGE_TIMERS];
276            uint32_t        timer_load[N_FOOTBRIDGE_TIMERS];
277            uint32_t        timer_value[N_FOOTBRIDGE_TIMERS];
278            uint32_t        timer_control[N_FOOTBRIDGE_TIMERS];
279            int             timer_being_read;
280            int             timer_poll_mode;
281    
282            uint32_t        irq_status;
283            uint32_t        irq_enable;
284    
285            uint32_t        fiq_status;
286            uint32_t        fiq_enable;
287    };
288    
289  /*  dev_gt.c:  */  /*  dev_gt.c:  */
290  #define DEV_GT_LENGTH                   0x0000000000001000  #define DEV_GT_LENGTH                   0x1000
291  int dev_gt_access(struct cpu *cpu, struct memory *mem, uint64_t relative_addr, unsigned char *data, size_t len, int writeflag, void *);  int dev_gt_access(struct cpu *cpu, struct memory *mem, uint64_t relative_addr,
292  struct pci_data *dev_gt_init(struct machine *machine, struct memory *mem, uint64_t baseaddr, int irq_nr, int pciirq);          unsigned char *data, size_t len, int writeflag, void *);
293    struct pci_data *dev_gt_init(struct machine *machine, struct memory *mem,
294            uint64_t baseaddr, int irq_nr, int pciirq, int type);
295    
296  /*  dev_jazz.c:  */  /*  dev_jazz.c:  */
297  #define DEV_JAZZ_LENGTH                 0x280  #define DEV_JAZZ_LENGTH                 0x280
# Line 310  int dev_m700_fb_access(struct cpu *cpu, Line 382  int dev_m700_fb_access(struct cpu *cpu,
382  void dev_m700_fb_init(struct machine *machine, struct memory *mem,  void dev_m700_fb_init(struct machine *machine, struct memory *mem,
383          uint64_t baseaddr, uint64_t baseaddr2);          uint64_t baseaddr, uint64_t baseaddr2);
384    
385  /*  dev_ns16550.c:  */  /*  dev_malta.c:  */
386  #define DEV_NS16550_LENGTH              0x0000000000000008  struct malta_data {
387  /*  see comreg.h and ns16550reg.h for more info  */          uint8_t         assert_lo;
388  int dev_ns16550_access(struct cpu *cpu, struct memory *mem,          uint8_t         assert_hi;
389          uint64_t relative_addr, unsigned char *data, size_t len,          uint8_t         disable_lo;
390          int writeflag, void *);          uint8_t         disable_hi;
391  int dev_ns16550_init(struct machine *machine, struct memory *mem,          int             poll_mode;
392          uint64_t baseaddr, int irq_nr, int addrmult, int in_use, char *name);  };
393    
394  /*  dev_mc146818.c:  */  /*  dev_mc146818.c:  */
395  #define DEV_MC146818_LENGTH             0x0000000000000100  #define DEV_MC146818_LENGTH             0x0000000000000100
# Line 326  int dev_ns16550_init(struct machine *mac Line 398  int dev_ns16550_init(struct machine *mac
398  #define MC146818_ARC_NEC        2  #define MC146818_ARC_NEC        2
399  #define MC146818_ARC_JAZZ       3  #define MC146818_ARC_JAZZ       3
400  #define MC146818_SGI            4  #define MC146818_SGI            4
401    #define MC146818_CATS           5
402    #define MC146818_ALGOR          6
403    #define MC146818_PMPPC          7
404  /*  see mc146818reg.h for more info  */  /*  see mc146818reg.h for more info  */
405  void dev_mc146818_tick(struct cpu *cpu, void *);  void dev_mc146818_tick(struct cpu *cpu, void *);
406  int dev_mc146818_access(struct cpu *cpu, struct memory *mem,  int dev_mc146818_access(struct cpu *cpu, struct memory *mem,
# Line 344  int dev_pckbc_access(struct cpu *cpu, st Line 419  int dev_pckbc_access(struct cpu *cpu, st
419          int writeflag, void *);          int writeflag, void *);
420  int dev_pckbc_init(struct machine *machine, struct memory *mem,  int dev_pckbc_init(struct machine *machine, struct memory *mem,
421          uint64_t baseaddr, int type, int keyboard_irqnr, int mouse_irqnr,          uint64_t baseaddr, int type, int keyboard_irqnr, int mouse_irqnr,
422          int in_use);          int in_use, int pc_style_flag);
423    
424  /*  dev_pmppc.c:  */  /*  dev_pmppc.c:  */
425  int dev_pmppc_board_access(struct cpu *cpu, struct memory *mem,  int dev_pmppc_board_access(struct cpu *cpu, struct memory *mem,
# Line 387  struct ps2_data *dev_ps2_stuff_init(stru Line 462  struct ps2_data *dev_ps2_stuff_init(stru
462  int dev_pmagja_access(struct cpu *cpu, struct memory *mem, uint64_t relative_addr, unsigned char *data, size_t len, int writeflag, void *);  int dev_pmagja_access(struct cpu *cpu, struct memory *mem, uint64_t relative_addr, unsigned char *data, size_t len, int writeflag, void *);
463  void dev_pmagja_init(struct machine *machine, struct memory *mem, uint64_t baseaddr, int irq_nr);  void dev_pmagja_init(struct machine *machine, struct memory *mem, uint64_t baseaddr, int irq_nr);
464    
465    /*  dev_prep.c:  */
466    struct prep_data {
467            uint32_t        int_status;
468    };
469    
470  /*  dev_px.c:  */  /*  dev_px.c:  */
471  struct px_data {  struct px_data {
472          struct memory   *fb_mem;          struct memory   *fb_mem;
# Line 407  struct px_data { Line 487  struct px_data {
487  #define DEV_PX_TYPE_PXGPLUS             2  #define DEV_PX_TYPE_PXGPLUS             2
488  #define DEV_PX_TYPE_PXGPLUSTURBO        3  #define DEV_PX_TYPE_PXGPLUSTURBO        3
489  #define DEV_PX_LENGTH                   0x3c0000  #define DEV_PX_LENGTH                   0x3c0000
490  int dev_px_access(struct cpu *cpu, struct memory *mem, uint64_t relative_addr, unsigned char *data, size_t len, int writeflag, void *);  int dev_px_access(struct cpu *cpu, struct memory *mem, uint64_t relative_addr,
491  void dev_px_init(struct machine *machine, struct memory *mem, uint64_t baseaddr, int px_type, int irq_nr);          unsigned char *data, size_t len, int writeflag, void *);
492    void dev_px_init(struct machine *machine, struct memory *mem, uint64_t baseaddr,
493            int px_type, int irq_nr);
494    
495  /*  dev_ram.c:  */  /*  dev_ram.c:  */
496  #define DEV_RAM_RAM             0  #define DEV_RAM_RAM                             0
497  #define DEV_RAM_MIRROR          1  #define DEV_RAM_MIRROR                          1
498  int dev_ram_access(struct cpu *cpu, struct memory *mem, uint64_t relative_addr, unsigned char *data, size_t len, int writeflag, void *);  #define DEV_RAM_MIGHT_POINT_TO_DEVICES          0x10
499  void dev_ram_init(struct memory *mem, uint64_t baseaddr, uint64_t length, int mode, uint64_t otheraddr);  int dev_ram_access(struct cpu *cpu, struct memory *mem, uint64_t relative_addr,
500            unsigned char *data, size_t len, int writeflag, void *);
501    void dev_ram_init(struct machine *machine, uint64_t baseaddr, uint64_t length,
502            int mode, uint64_t otheraddr);
503    
504  /*  dev_scc.c:  */  /*  dev_scc.c:  */
505  #define DEV_SCC_LENGTH                  0x1000  #define DEV_SCC_LENGTH                  0x1000
506  int dev_scc_access(struct cpu *cpu, struct memory *mem, uint64_t relative_addr, unsigned char *data, size_t len, int writeflag, void *);  int dev_scc_access(struct cpu *cpu, struct memory *mem, uint64_t relative_addr,
507  int dev_scc_dma_func(struct cpu *cpu, void *extra, uint64_t addr, size_t dma_len, int tx);          unsigned char *data, size_t len, int writeflag, void *);
508  void *dev_scc_init(struct machine *machine, struct memory *mem, uint64_t baseaddr, int irq_nr, int use_fb, int scc_nr, int addrmul);  int dev_scc_dma_func(struct cpu *cpu, void *extra, uint64_t addr,
509            size_t dma_len, int tx);
510    void *dev_scc_init(struct machine *machine, struct memory *mem,
511            uint64_t baseaddr, int irq_nr, int use_fb, int scc_nr, int addrmul);
512    
513  /*  dev_sfb.c:  */  /*  dev_sfb.c:  */
514  #define DEV_SFB_LENGTH          0x400000  #define DEV_SFB_LENGTH          0x400000
515  int dev_sfb_access(struct cpu *cpu, struct memory *mem, uint64_t relative_addr, unsigned char *data, size_t len, int writeflag, void *);  int dev_sfb_access(struct cpu *cpu, struct memory *mem, uint64_t relative_addr,
516  void dev_sfb_init(struct machine *machine, struct memory *mem, uint64_t baseaddr, struct vfb_data *vfb_data);          unsigned char *data, size_t len, int writeflag, void *);
517    void dev_sfb_init(struct machine *machine, struct memory *mem,
518            uint64_t baseaddr, struct vfb_data *vfb_data);
519    
520  /*  dev_sgi_gbe.c:  */  /*  dev_sgi_gbe.c:  */
521  #define DEV_SGI_GBE_LENGTH              0x1000000  #define DEV_SGI_GBE_LENGTH              0x1000000
522  int dev_sgi_gbe_access(struct cpu *cpu, struct memory *mem, uint64_t relative_addr, unsigned char *data, size_t len, int writeflag, void *);  int dev_sgi_gbe_access(struct cpu *cpu, struct memory *mem,
523  void dev_sgi_gbe_init(struct machine *machine, struct memory *mem, uint64_t baseaddr);          uint64_t relative_addr, unsigned char *data, size_t len, int writeflag,
524            void *);
525    void dev_sgi_gbe_init(struct machine *machine, struct memory *mem,
526            uint64_t baseaddr);
527    
528  /*  dev_sgi_ip20.c:  */  /*  dev_sgi_ip20.c:  */
529  #define DEV_SGI_IP20_LENGTH             0x40  #define DEV_SGI_IP20_LENGTH             0x40
# Line 524  void dev_ssc_init(struct machine *machin Line 617  void dev_ssc_init(struct machine *machin
617    
618  /*  dev_turbochannel.c:  */  /*  dev_turbochannel.c:  */
619  #define DEV_TURBOCHANNEL_LEN            0x0470  #define DEV_TURBOCHANNEL_LEN            0x0470
620  int dev_turbochannel_access(struct cpu *cpu, struct memory *mem, uint64_t relative_addr, unsigned char *data, size_t len, int writeflag, void *);  int dev_turbochannel_access(struct cpu *cpu, struct memory *mem,
621  void dev_turbochannel_init(struct machine *machine, struct memory *mem, int slot_nr, uint64_t baseaddr, uint64_t endaddr, char *device_name, int irq);          uint64_t relative_addr, unsigned char *data, size_t len,
622            int writeflag, void *);
623    void dev_turbochannel_init(struct machine *machine, struct memory *mem,
624            int slot_nr, uint64_t baseaddr, uint64_t endaddr, char *device_name,
625            int irq);
626    
627  /*  dev_vga.c:  */  /*  dev_vga.c:  */
628  int dev_vga_access(struct cpu *cpu, struct memory *mem, uint64_t relative_addr,  int dev_vga_access(struct cpu *cpu, struct memory *mem, uint64_t relative_addr,
629          unsigned char *data, size_t len, int writeflag, void *);          unsigned char *data, size_t len, int writeflag, void *);
630  void dev_vga_init(struct machine *machine, struct memory *mem,  void dev_vga_init(struct machine *machine, struct memory *mem,
631          uint64_t videomem_base, uint64_t control_base, int max_x, int max_y,          uint64_t videomem_base, uint64_t control_base, char *name);
         char *name);  
632    
633  /*  dev_vr41xx.c:  */  /*  dev_vr41xx.c:  */
634  #define DEV_VR41XX_LENGTH               0x800           /*  TODO?  */  #define DEV_VR41XX_LENGTH               0x800           /*  TODO?  */
# Line 567  int dev_vr41xx_access(struct cpu *cpu, s Line 663  int dev_vr41xx_access(struct cpu *cpu, s
663  struct vr41xx_data *dev_vr41xx_init(struct machine *machine,  struct vr41xx_data *dev_vr41xx_init(struct machine *machine,
664          struct memory *mem, int cpumodel);          struct memory *mem, int cpumodel);
665    
 /*  dev_wdc.c:  */  
 #define DEV_WDC_LENGTH                  0x8  
 int dev_wdc_access(struct cpu *cpu, struct memory *mem, uint64_t relative_addr, unsigned char *data, size_t len, int writeflag, void *);  
 void dev_wdc_init(struct machine *machine, struct memory *mem, uint64_t baseaddr, int irq_nr, int base_drive);  
   
666  /*  dev_wdsc.c:  */  /*  dev_wdsc.c:  */
667  #define DEV_WDSC_NREGS                  0x100           /*  8-bit register select  */  #define DEV_WDSC_NREGS                  0x100           /*  8-bit register select  */
668  #define DEV_WDSC_LENGTH                 0x10  #define DEV_WDSC_LENGTH                 0x10

Legend:
Removed from v.4  
changed lines
  Added in v.20

  ViewVC Help
Powered by ViewVC 1.1.26