2 |
#define DEVICES_H |
#define DEVICES_H |
3 |
|
|
4 |
/* |
/* |
5 |
* Copyright (C) 2003-2005 Anders Gavare. All rights reserved. |
* Copyright (C) 2003-2006 Anders Gavare. All rights reserved. |
6 |
* |
* |
7 |
* Redistribution and use in source and binary forms, with or without |
* Redistribution and use in source and binary forms, with or without |
8 |
* modification, are permitted provided that the following conditions are met: |
* modification, are permitted provided that the following conditions are met: |
28 |
* SUCH DAMAGE. |
* SUCH DAMAGE. |
29 |
* |
* |
30 |
* |
* |
31 |
* $Id: devices.h,v 1.207 2006/02/18 17:55:25 debug Exp $ |
* $Id: devices.h,v 1.218 2006/10/02 09:26:53 debug Exp $ |
32 |
* |
* |
33 |
* Memory mapped devices. |
* Memory mapped devices. |
34 |
* |
* |
43 |
struct machine; |
struct machine; |
44 |
struct memory; |
struct memory; |
45 |
struct pci_data; |
struct pci_data; |
46 |
|
struct timer; |
47 |
|
|
48 |
/* #ifdef WITH_X11 |
/* #ifdef WITH_X11 |
49 |
#include <X11/Xlib.h> |
#include <X11/Xlib.h> |
149 |
int color_fb_flag, int irq_nr, int type); |
int color_fb_flag, int irq_nr, int type); |
150 |
|
|
151 |
/* dev_cons.c: */ |
/* dev_cons.c: */ |
|
#define DEV_CONS_ADDRESS 0x0000000010000000 |
|
|
#define DEV_CONS_LENGTH 0x0000000000000020 |
|
|
#define DEV_CONS_PUTGETCHAR 0x0000 |
|
|
#define DEV_CONS_HALT 0x0010 |
|
152 |
struct cons_data { |
struct cons_data { |
153 |
int console_handle; |
int console_handle; |
154 |
int irq_nr; |
int irq_nr; |
198 |
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 *); |
199 |
void dev_decxmi_init(struct memory *mem, uint64_t baseaddr); |
void dev_decxmi_init(struct memory *mem, uint64_t baseaddr); |
200 |
|
|
|
/* dev_disk.c: */ |
|
|
#define DEV_DISK_ADDRESS 0x13000000 |
|
|
|
|
201 |
/* dev_eagle.c: */ |
/* dev_eagle.c: */ |
202 |
struct pci_data *dev_eagle_init(struct machine *machine, struct memory *mem, |
struct pci_data *dev_eagle_init(struct machine *machine, struct memory *mem, |
203 |
int irqbase, int pciirq); |
int irqbase, int pciirq); |
204 |
|
|
|
/* dev_ether.c: */ |
|
|
#define DEV_ETHER_ADDRESS 0x14000000 |
|
|
#define DEV_ETHER_LENGTH 0x8000 |
|
|
|
|
205 |
/* dev_fb.c: */ |
/* dev_fb.c: */ |
|
#define DEV_FB_ADDRESS 0x12000000 /* Default for testmips */ |
|
206 |
#define DEV_FB_LENGTH 0x3c0000 /* 3c0000 to not colide with */ |
#define DEV_FB_LENGTH 0x3c0000 /* 3c0000 to not colide with */ |
207 |
/* turbochannel rom, */ |
/* turbochannel rom, */ |
208 |
/* otherwise size = 4MB */ |
/* otherwise size = 4MB */ |
216 |
/* Extra flags: */ |
/* Extra flags: */ |
217 |
#define VFB_REVERSE_START 0x10000 |
#define VFB_REVERSE_START 0x10000 |
218 |
struct vfb_data { |
struct vfb_data { |
219 |
|
struct memory *memory; |
220 |
int vfb_type; |
int vfb_type; |
221 |
|
|
222 |
int vfb_scaledown; |
int vfb_scaledown; |
225 |
int ysize; |
int ysize; |
226 |
int bit_depth; |
int bit_depth; |
227 |
int color32k; /* hack for 16-bit HPCmips */ |
int color32k; /* hack for 16-bit HPCmips */ |
228 |
int psp_15bit; /* plastation portable hack */ |
int psp_15bit; /* playstation portable hack */ |
229 |
|
|
230 |
unsigned char color_plane_mask; |
unsigned char color_plane_mask; |
231 |
|
|
242 |
/* RGB palette for <= 8 bit modes: (r,g,b bytes for each) */ |
/* RGB palette for <= 8 bit modes: (r,g,b bytes for each) */ |
243 |
unsigned char rgb_palette[256 * 3]; |
unsigned char rgb_palette[256 * 3]; |
244 |
|
|
245 |
|
char *name; |
246 |
|
char title[100]; |
247 |
|
|
248 |
void (*redraw_func)(struct vfb_data *, int, int); |
void (*redraw_func)(struct vfb_data *, int, int); |
249 |
|
|
250 |
/* These should always be in sync: */ |
/* These should always be in sync: */ |
280 |
uint32_t timer_load[N_FOOTBRIDGE_TIMERS]; |
uint32_t timer_load[N_FOOTBRIDGE_TIMERS]; |
281 |
uint32_t timer_value[N_FOOTBRIDGE_TIMERS]; |
uint32_t timer_value[N_FOOTBRIDGE_TIMERS]; |
282 |
uint32_t timer_control[N_FOOTBRIDGE_TIMERS]; |
uint32_t timer_control[N_FOOTBRIDGE_TIMERS]; |
283 |
int timer_being_read; |
|
284 |
int timer_poll_mode; |
struct timer *timer[N_FOOTBRIDGE_TIMERS]; |
285 |
|
int pending_timer_interrupts[N_FOOTBRIDGE_TIMERS]; |
286 |
|
|
287 |
uint32_t irq_status; |
uint32_t irq_status; |
288 |
uint32_t irq_enable; |
uint32_t irq_enable; |
376 |
/* dev_kn02.c: */ |
/* dev_kn02.c: */ |
377 |
struct kn02_csr { |
struct kn02_csr { |
378 |
uint8_t csr[sizeof(uint32_t)]; |
uint8_t csr[sizeof(uint32_t)]; |
379 |
uint8_t filler[4096 - sizeof(uint32_t)]; /* for bintrans mapping */ |
uint8_t filler[4096 - sizeof(uint32_t)]; /* for dyntrans mapping */ |
380 |
}; |
}; |
381 |
int dev_kn02_access(struct cpu *cpu, struct memory *mem, uint64_t relative_addr, unsigned char *data, size_t len, int writeflag, void *); |
int dev_kn02_access(struct cpu *cpu, struct memory *mem, uint64_t relative_addr, unsigned char *data, size_t len, int writeflag, void *); |
382 |
struct kn02_csr *dev_kn02_init(struct cpu *cpu, struct memory *mem, |
struct kn02_csr *dev_kn02_init(struct cpu *cpu, struct memory *mem, |
689 |
int dont_clear_next; |
int dont_clear_next; |
690 |
int escape_state; |
int escape_state; |
691 |
|
|
692 |
|
int pending_timer_interrupts; |
693 |
|
struct timer *timer; |
694 |
|
|
695 |
/* See icureg.h in NetBSD for more info. */ |
/* See icureg.h in NetBSD for more info. */ |
696 |
uint16_t sysint1; |
uint16_t sysint1; |
697 |
uint16_t msysint1; |
uint16_t msysint1; |
727 |
int mouse_mode; |
int mouse_mode; |
728 |
int mouse_revision; /* 0..15 */ |
int mouse_revision; /* 0..15 */ |
729 |
int mouse_x, mouse_y, mouse_buttons; |
int mouse_x, mouse_y, mouse_buttons; |
|
|
|
|
int old_host_mouse_x; |
|
|
int old_host_mouse_y; |
|
|
int old_host_mouse_stays_put; |
|
|
int mouse_check_interval; |
|
|
int mouse_check_interval_reset; |
|
730 |
}; |
}; |
731 |
void lk201_tick(struct lk201_data *); |
void lk201_tick(struct machine *, struct lk201_data *); |
732 |
void lk201_tx_data(struct lk201_data *, int port, int idata); |
void lk201_tx_data(struct lk201_data *, int port, int idata); |
733 |
void lk201_init(struct lk201_data *d, int use_fb, |
void lk201_init(struct lk201_data *d, int use_fb, |
734 |
void (*add_to_rx_queue)(void *,int,int), int console_handle, void *); |
void (*add_to_rx_queue)(void *,int,int), int console_handle, void *); |