diff options
author | Niklas Hallqvist <niklas@cvs.openbsd.org> | 1996-08-23 18:53:18 +0000 |
---|---|---|
committer | Niklas Hallqvist <niklas@cvs.openbsd.org> | 1996-08-23 18:53:18 +0000 |
commit | 4480a114041b55db8e1866c53fcdc234e5314cde (patch) | |
tree | 56130a121a4199651dfb0a31465c6fb77ad090b0 /sys/arch | |
parent | 52f16f85700c22cbcd144b996d4cf636eac43b6f (diff) |
Merge to late July NetBSD, more to come...
Diffstat (limited to 'sys/arch')
-rw-r--r-- | sys/arch/amiga/dev/event.c | 3 | ||||
-rw-r--r-- | sys/arch/amiga/dev/flsc.c | 7 | ||||
-rw-r--r-- | sys/arch/amiga/dev/grf_cl.c | 147 | ||||
-rw-r--r-- | sys/arch/amiga/dev/grf_clreg.h | 129 | ||||
-rw-r--r-- | sys/arch/amiga/dev/grf_et.c | 246 | ||||
-rw-r--r-- | sys/arch/amiga/dev/grf_etreg.h | 2 | ||||
-rw-r--r-- | sys/arch/amiga/dev/grf_rh.c | 18 | ||||
-rw-r--r-- | sys/arch/amiga/dev/grf_rt.c | 10 | ||||
-rw-r--r-- | sys/arch/amiga/dev/grfabs_cc.c | 19 | ||||
-rw-r--r-- | sys/arch/amiga/dev/grfioctl.h | 5 | ||||
-rw-r--r-- | sys/arch/amiga/dev/idesc.c | 14 | ||||
-rw-r--r-- | sys/arch/amiga/dev/if_ae.c | 6 | ||||
-rw-r--r-- | sys/arch/amiga/dev/ite.c | 9 | ||||
-rw-r--r-- | sys/arch/amiga/dev/ite_et.c | 49 | ||||
-rw-r--r-- | sys/arch/amiga/dev/mfc.c | 8 | ||||
-rw-r--r-- | sys/arch/amiga/dev/msc.c | 5 | ||||
-rw-r--r-- | sys/arch/amiga/dev/ser.c | 8 |
17 files changed, 348 insertions, 337 deletions
diff --git a/sys/arch/amiga/dev/event.c b/sys/arch/amiga/dev/event.c index 5c3128f170d..1de83faa4b9 100644 --- a/sys/arch/amiga/dev/event.c +++ b/sys/arch/amiga/dev/event.c @@ -1,4 +1,4 @@ -/* $NetBSD: event.c,v 1.3 1994/10/26 02:02:58 cgd Exp $ */ +/* $NetBSD: event.c,v 1.3.6.1 1996/05/31 09:17:39 is Exp $ */ /* * Copyright (c) 1992, 1993 @@ -166,6 +166,7 @@ ev_select(ev, rw, p) break; case FWRITE: + splx(s); return (1); /* always fails => never blocks */ } splx(s); diff --git a/sys/arch/amiga/dev/flsc.c b/sys/arch/amiga/dev/flsc.c index b1197ba2cba..9dca64cd8c6 100644 --- a/sys/arch/amiga/dev/flsc.c +++ b/sys/arch/amiga/dev/flsc.c @@ -1,6 +1,6 @@ -/* $OpenBSD: flsc.c,v 1.3 1996/05/02 06:43:39 niklas Exp $ */ +/* $OpenBSD: flsc.c,v 1.4 1996/08/23 18:52:32 niklas Exp $ */ -/* $NetBSD: flsc.c,v 1.5 1996/04/21 21:11:03 veego Exp $ */ +/* $NetBSD: flsc.c,v 1.5.4.1 1996/06/03 19:35:40 is Exp $ */ /* * Copyright (c) 1995 Daniel Widenfalk @@ -110,7 +110,8 @@ flscmatch(pdp, match, auxp) return(0); zap = auxp; - if (zap->manid == 0x2140 && zap->prodid == 11) + if (zap->manid == 0x2140 && zap->prodid == 11 + && iszthreepa(zap->pa)) return(1); return(0); diff --git a/sys/arch/amiga/dev/grf_cl.c b/sys/arch/amiga/dev/grf_cl.c index 9a51bc639f5..38eb6c0b1e5 100644 --- a/sys/arch/amiga/dev/grf_cl.c +++ b/sys/arch/amiga/dev/grf_cl.c @@ -1,5 +1,5 @@ -/* $OpenBSD: grf_cl.c,v 1.5 1996/05/29 10:14:57 niklas Exp $ */ -/* $NetBSD: grf_cl.c,v 1.11 1996/05/19 21:05:20 veego Exp $ */ +/* $OpenBSD: grf_cl.c,v 1.6 1996/08/23 18:52:36 niklas Exp $ */ +/* $NetBSD: grf_cl.c,v 1.11.4.1 1996/05/27 10:50:40 is Exp $ */ /* * Copyright (c) 1995 Ezra Story @@ -78,29 +78,33 @@ #include <amiga/dev/grf_clreg.h> #include <amiga/dev/zbusvar.h> -static int cl_mondefok __P((struct grfvideo_mode *)); -static void cl_boardinit __P((struct grf_softc *)); +int cl_mondefok __P((struct grfvideo_mode *)); +void cl_boardinit __P((struct grf_softc *)); static void cl_CompFQ __P((u_int, u_char *, u_char *)); -static int cl_getvmode __P((struct grf_softc *, struct grfvideo_mode *)); -static int cl_setvmode __P((struct grf_softc *, unsigned int)); -static int cl_toggle __P((struct grf_softc *, unsigned short)); -static int cl_getcmap __P((struct grf_softc *, struct grf_colormap *)); -static int cl_putcmap __P((struct grf_softc *, struct grf_colormap *)); +int cl_getvmode __P((struct grf_softc *, struct grfvideo_mode *)); +int cl_setvmode __P((struct grf_softc *, unsigned int)); +int cl_toggle __P((struct grf_softc *, unsigned short)); +int cl_getcmap __P((struct grf_softc *, struct grf_colormap *)); +int cl_putcmap __P((struct grf_softc *, struct grf_colormap *)); #ifndef CL5426CONSOLE -static void cl_off __P((struct grf_softc *)); +void cl_off __P((struct grf_softc *)); #endif -static void cl_inittextmode __P((struct grf_softc *)); -static int cl_ioctl __P((register struct grf_softc *, u_long, void *)); -static int cl_getmousepos __P((struct grf_softc *, struct grf_position *)); -static int cl_setmousepos __P((struct grf_softc *, struct grf_position *)); +void cl_inittextmode __P((struct grf_softc *)); +int cl_ioctl __P((register struct grf_softc *, u_long, void *)); +int cl_getmousepos __P((struct grf_softc *, struct grf_position *)); +int cl_setmousepos __P((struct grf_softc *, struct grf_position *)); static int cl_setspriteinfo __P((struct grf_softc *, struct grf_spriteinfo *)); -static int cl_getspriteinfo __P((struct grf_softc *, struct grf_spriteinfo *)); +int cl_getspriteinfo __P((struct grf_softc *, struct grf_spriteinfo *)); static int cl_getspritemax __P((struct grf_softc *, struct grf_position *)); -static int cl_blank __P((struct grf_softc *, int *)); +int cl_blank __P((struct grf_softc *, int *)); int cl_setmonitor __P((struct grf_softc *, struct grfvideo_mode *)); void cl_writesprpos __P((volatile char *, short, short)); void writeshifted __P((volatile char *, char, char)); +static void RegWakeup __P((volatile caddr_t)); +static void RegOnpass __P((volatile caddr_t)); +static void RegOffpass __P((volatile caddr_t)); + void grfclattach __P((struct device *, struct device *, void *)); int grfclprint __P((void *, char *)); int grfclmatch __P((struct device *, void *, void *)); @@ -307,7 +311,6 @@ grfclattach(pdp, dp, auxp) /* wakeup the board */ cl_boardinit(gp); - #ifdef CL5426CONSOLE grfcl_iteinit(gp); (void) cl_load_mon(gp, &clconsole_mode); @@ -378,7 +381,8 @@ cl_boardinit(gp) vgaw(ba, 0x46e8, 0x16); vgaw(ba, 0x102, 1); vgaw(ba, 0x46e8, 0x0e); - vgaw(ba, 0x3c3, 1); + if (cl_sd64 != 1) + vgaw(ba, 0x3c3, 1); /* setup initial unchanging parameters */ @@ -400,11 +404,17 @@ cl_boardinit(gp) WSeq(ba, SEQ_ID_MEMORY_MODE, 0x0e); /* a or 6? */ WSeq(ba, SEQ_ID_EXT_SEQ_MODE, (cltype == PICASSO) ? 0x20 : 0x80); WSeq(ba, SEQ_ID_EEPROM_CNTL, 0x00); - WSeq(ba, SEQ_ID_PERF_TUNE, 0x0a); /* mouse 0a fa */ + if (cl_sd64 == 1) + WSeq(ba, SEQ_ID_PERF_TUNE, 0x5a); + else + WSeq(ba, SEQ_ID_PERF_TUNE, 0x0a); /* mouse 0a fa */ WSeq(ba, SEQ_ID_SIG_CNTL, 0x02); WSeq(ba, SEQ_ID_CURSOR_ATTR, 0x04); - WSeq(ba, SEQ_ID_MCLK_SELECT, 0x22); + if (cl_sd64 == 1) + WSeq(ba, SEQ_ID_MCLK_SELECT, 0x1c); + else + WSeq(ba, SEQ_ID_MCLK_SELECT, 0x22); WCrt(ba, CRT_ID_PRESET_ROW_SCAN, 0x00); WCrt(ba, CRT_ID_CURSOR_START, 0x00); @@ -450,7 +460,7 @@ cl_boardinit(gp) delay(200000); vgaw(ba, GREG_MISC_OUTPUT_W, 0xef); - WGfx(ba, GCT_ID_BLT_STAT_START, 0x40); + WGfx(ba, GCT_ID_BLT_STAT_START, 0x04); WGfx(ba, GCT_ID_BLT_STAT_START, 0x00); /* colors initially set to greyscale */ @@ -543,7 +553,7 @@ cl_blank(gp, on) struct grf_softc *gp; int *on; { - WSeq(gp->g_regkva, SEQ_ID_CLOCKING_MODE, *on ? 0x21 : 0x01); + WSeq(gp->g_regkva, SEQ_ID_CLOCKING_MODE, *on ? 0x01 : 0x21); return(0); } @@ -766,8 +776,7 @@ cl_getspriteinfo(gp, data) return (0); } -static -int +static int cl_setspriteinfo(gp, data) struct grf_softc *gp; struct grf_spriteinfo *data; @@ -903,8 +912,7 @@ cl_setspriteinfo(gp, data) return (0); } -static -int +static int cl_getspritemax(gp, data) struct grf_softc *gp; struct grf_position *data; @@ -1073,7 +1081,7 @@ cl_toggle(gp, wopp) struct grf_softc *gp; unsigned short wopp; /* don't need that one yet, ill */ { - volatile unsigned char *ba; + volatile caddr_t ba; ba = gp->g_regkva; @@ -1191,8 +1199,7 @@ cl_load_mon(gp, md) { struct grfvideo_mode *gv; struct grfinfo *gi; - volatile unsigned char *ba; - volatile caddr_t fb; + volatile caddr_t ba, fb; unsigned char num0, denom0; unsigned short HT, HDE, HBS, HBE, HSS, HSE, VDE, VBS, VBE, VSS, VSE, VT; @@ -1315,8 +1322,7 @@ cl_load_mon(gp, md) (DBLSCAN ? 0x80 : 0x00) | ((VBS & 0x200) ? 0x20 : 0x00) | (TEXT ? ((md->fy - 1) & 0x1f) : 0x00)); - WCrt(ba, CRT_ID_MODE_CONTROL, - ((TEXT || (gv->depth == 1)) ? 0xc3 : 0xa3)); + WCrt(ba, CRT_ID_MODE_CONTROL, 0xe3); /* text cursor */ @@ -1337,7 +1343,7 @@ cl_load_mon(gp, md) WCrt(ba, CRT_ID_START_ADDR_LOW, 0x00); WCrt(ba, CRT_ID_START_VER_RETR, VSS); - WCrt(ba, CRT_ID_END_VER_RETR, (VSE & 0x0f) | 0x30); + WCrt(ba, CRT_ID_END_VER_RETR, (VSE & 0x0f) | 0x20); WCrt(ba, CRT_ID_VER_DISP_ENA_END, VDE); WCrt(ba, CRT_ID_START_VER_BLANK, VBS); WCrt(ba, CRT_ID_END_VER_BLANK, VBE); @@ -1531,4 +1537,81 @@ cl_memset(d, c, l) for (; l > 0; l--) *d++ = c; } + +/* Special wakeup/passthrough registers on graphics boards + * + * The methods have diverged a bit for each board, so + * WPass(P) has been converted into a set of specific + * inline functions. + */ +static void +RegWakeup(ba) + volatile caddr_t ba; +{ + + switch (cltype) { + case SPECTRUM: + vgaw(ba, PASS_ADDRESS_W, 0x1f); + break; + case PICASSO: + vgaw(ba, PASS_ADDRESS_W, 0xff); + break; + case PICCOLO: + if (cl_sd64 == 1) + vgaw(ba, PASS_ADDRESS_W, 0x1f); + else + vgaw(ba, PASS_ADDRESS_W, vgar(ba, PASS_ADDRESS) | 0x10); + break; + } + delay(200000); +} + +static void +RegOnpass(ba) + volatile caddr_t ba; +{ + + switch (cltype) { + case SPECTRUM: + vgaw(ba, PASS_ADDRESS_W, 0x4f); + break; + case PICASSO: + vgaw(ba, PASS_ADDRESS_WP, 0x01); + break; + case PICCOLO: + if (cl_sd64 == 1) + vgaw(ba, PASS_ADDRESS_W, 0x4f); + else + vgaw(ba, PASS_ADDRESS_W, vgar(ba, PASS_ADDRESS) & 0xdf); + break; + } + pass_toggle = 1; + delay(200000); +} + +static void +RegOffpass(ba) + volatile caddr_t ba; +{ + + switch (cltype) { + case SPECTRUM: + vgaw(ba, PASS_ADDRESS_W, 0x6f); + break; + case PICASSO: + vgaw(ba, PASS_ADDRESS_W, 0xff); + delay(200000); + vgaw(ba, PASS_ADDRESS_W, 0xff); + break; + case PICCOLO: + if (cl_sd64 == 1) + vgaw(ba, PASS_ADDRESS_W, 0x6f); + else + vgaw(ba, PASS_ADDRESS_W, vgar(ba, PASS_ADDRESS) | 0x20); + break; + } + pass_toggle = 0; + delay(200000); +} + #endif /* NGRFCL */ diff --git a/sys/arch/amiga/dev/grf_clreg.h b/sys/arch/amiga/dev/grf_clreg.h index c024cf1503f..228df97f167 100644 --- a/sys/arch/amiga/dev/grf_clreg.h +++ b/sys/arch/amiga/dev/grf_clreg.h @@ -1,5 +1,5 @@ -/* $OpenBSD: grf_clreg.h,v 1.4 1996/05/29 10:14:59 niklas Exp $ */ -/* $NetBSD: grf_clreg.h,v 1.4 1996/05/19 21:05:23 veego Exp $ */ +/* $OpenBSD: grf_clreg.h,v 1.5 1996/08/23 18:52:38 niklas Exp $ */ +/* $NetBSD: grf_clreg.h,v 1.4.4.1 1996/05/27 10:50:42 is Exp $ */ /* * Copyright (c) 1995 Ezra Story @@ -272,122 +272,37 @@ struct grfcltext_mode { #define WGfx(ba, idx, val) \ - do { vgaw(ba, GCT_ADDRESS, idx); vgaw(ba, GCT_ADDRESS_W , val); } while (0) + do { \ + vgaw(ba, GCT_ADDRESS, idx); \ + vgaw(ba, GCT_ADDRESS_W , val); \ + } while (0) #define WSeq(ba, idx, val) \ - do { vgaw(ba, SEQ_ADDRESS, idx); vgaw(ba, SEQ_ADDRESS_W , val); } while (0) + do { \ + vgaw(ba, SEQ_ADDRESS, idx); \ + vgaw(ba, SEQ_ADDRESS_W , val); \ + } while (0) \ + +/* asm volatile ("nop"); \ */ #define WCrt(ba, idx, val) \ - do { vgaw(ba, CRT_ADDRESS, idx); vgaw(ba, CRT_ADDRESS_W , val); } while (0) + do { \ + vgaw(ba, CRT_ADDRESS, idx); \ + vgaw(ba, CRT_ADDRESS_W , val); \ + } while (0) #define WAttr(ba, idx, val) \ do { \ - vgar(ba, ACT_ADDRESS_RESET);\ - vgaw(ba, ACT_ADDRESS_W, idx);\ - vgaw(ba, ACT_ADDRESS_W, val);\ + vgar(ba, ACT_ADDRESS_RESET); \ + vgaw(ba, ACT_ADDRESS_W, idx); \ + vgaw(ba, ACT_ADDRESS_W, val); \ } while (0) #define SetTextPlane(ba, m) \ do { \ - WGfx(ba, GCT_ID_READ_MAP_SELECT, m & 3 );\ - WSeq(ba, SEQ_ID_MAP_MASK, (1 << (m & 3)));\ - } while (0) - -/* Special wakeup/passthrough registers on graphics boards - * - * The methods have diverged a bit for each board, so - * WPass(P) has been converted into a set of specific - * inline functions. - */ -static inline void RegWakeup(volatile void *ba) { - extern int cltype; - extern int cl_sd64; - - switch (cltype) { - case SPECTRUM: - vgaw(ba, PASS_ADDRESS_W, 0x1f); - break; - case PICASSO: - vgaw(ba, PASS_ADDRESS_W, 0xff); - break; - case PICCOLO: - if (cl_sd64 == 1) - vgaw(ba, PASS_ADDRESS_W, 0x1f); - else - vgaw(ba, PASS_ADDRESS_W, vgar(ba, PASS_ADDRESS) | 0x10); - break; - } - delay(200000); -} - -static inline void RegOnpass(volatile void *ba) { - extern int cltype; - extern int cl_sd64; - extern unsigned char pass_toggle; - - switch (cltype) { - case SPECTRUM: - vgaw(ba, PASS_ADDRESS_W, 0x4f); - break; - case PICASSO: - vgaw(ba, PASS_ADDRESS_WP, 0x01); - break; - case PICCOLO: - if (cl_sd64 == 1) - vgaw(ba, PASS_ADDRESS_W, 0x4f); - else - vgaw(ba, PASS_ADDRESS_W, vgar(ba, PASS_ADDRESS) & 0xdf); - break; - } - pass_toggle = 1; - delay(200000); -} - -static inline void RegOffpass(volatile void *ba) { - extern int cltype; - extern int cl_sd64; - extern unsigned char pass_toggle; - - switch (cltype) { - case SPECTRUM: - vgaw(ba, PASS_ADDRESS_W, 0x6f); - break; - case PICASSO: - vgaw(ba, PASS_ADDRESS_W, 0xff); - delay(200000); - vgaw(ba, PASS_ADDRESS_W, 0xff); - break; - case PICCOLO: - if (cl_sd64 == 1) - vgaw(ba, PASS_ADDRESS_W, 0x6f); - else - vgaw(ba, PASS_ADDRESS_W, vgar(ba, PASS_ADDRESS) | 0x20); - break; - } - pass_toggle = 0; - delay(200000); -} - -static inline unsigned char RAttr(volatile void * ba, short idx) { - vgar(ba, ACT_ADDRESS_RESET); - vgaw(ba, ACT_ADDRESS_W, idx); - return vgar (ba, ACT_ADDRESS_R); -} - -static inline unsigned char RSeq(volatile void * ba, short idx) { - vgaw (ba, SEQ_ADDRESS, idx); - return vgar (ba, SEQ_ADDRESS_R); -} - -static inline unsigned char RCrt(volatile void * ba, short idx) { - vgaw (ba, CRT_ADDRESS, idx); - return vgar (ba, CRT_ADDRESS_R); -} - -static inline unsigned char RGfx(volatile void * ba, short idx) { - vgaw(ba, GCT_ADDRESS, idx); - return vgar (ba, GCT_ADDRESS_R); -} + WGfx(ba, GCT_ID_READ_MAP_SELECT, m & 3 ); \ + WSeq(ba, SEQ_ID_MAP_MASK, (1 << (m & 3))); \ + } while (0) int cl_mode __P((register struct grf_softc *gp, u_long cmd, void *arg, u_long a2, int a3)); diff --git a/sys/arch/amiga/dev/grf_et.c b/sys/arch/amiga/dev/grf_et.c index 411a974b915..242c6762c31 100644 --- a/sys/arch/amiga/dev/grf_et.c +++ b/sys/arch/amiga/dev/grf_et.c @@ -1,4 +1,4 @@ -/* $NetBSD: grf_et.c,v 1.1 1996/05/19 21:05:32 veego Exp $ */ +/* $NetBSD: grf_et.c,v 1.1.4.2 1996/06/04 09:01:21 is Exp $ */ /* * Copyright (c) 1996 Tobias Abt @@ -71,39 +71,40 @@ #include <amiga/dev/grf_etreg.h> #include <amiga/dev/zbusvar.h> -int et_mondefok __P((struct grfvideo_mode * gv)); -void et_boardinit __P((struct grf_softc * gp)); -static void et_CompFQ __P((u_int fq, u_char * num, u_char * denom)); -int et_getvmode __P((struct grf_softc * gp, struct grfvideo_mode * vm)); -int et_setvmode __P((struct grf_softc * gp, unsigned int mode)); -int et_toggle __P((struct grf_softc * gp, unsigned short)); -int et_getcmap __P((struct grf_softc * gfp, struct grf_colormap * cmap)); -int et_putcmap __P((struct grf_softc * gfp, struct grf_colormap * cmap)); +int et_mondefok __P((struct grfvideo_mode *gv)); +void et_boardinit __P((struct grf_softc *gp)); +static void et_CompFQ __P((u_int fq, u_char *num, u_char *denom)); +int et_getvmode __P((struct grf_softc *gp, struct grfvideo_mode *vm)); +int et_setvmode __P((struct grf_softc *gp, unsigned int mode)); +int et_toggle __P((struct grf_softc *gp, unsigned short)); +int et_getcmap __P((struct grf_softc *gfp, struct grf_colormap *cmap)); +int et_putcmap __P((struct grf_softc *gfp, struct grf_colormap *cmap)); #ifndef TSENGCONSOLE -void et_off __P((struct grf_softc * gp)); +void et_off __P((struct grf_softc *gp)); #endif -void et_inittextmode __P((struct grf_softc * gp)); -int et_ioctl __P((register struct grf_softc * gp, u_long cmd, void *data)); -int et_getmousepos __P((struct grf_softc * gp, struct grf_position * data)); +void et_inittextmode __P((struct grf_softc *gp)); +int et_ioctl __P((register struct grf_softc *gp, u_long cmd, void *data)); +int et_getmousepos __P((struct grf_softc *gp, struct grf_position *data)); void et_writesprpos __P((volatile char *ba, short x, short y)); -#ifdef notyet -void et_writeshifted __P((unsigned char *to, char shiftx, char shifty)); -#endif -int et_setmousepos __P((struct grf_softc * gp, struct grf_position * data)); -static int et_setspriteinfo __P((struct grf_softc * gp, struct grf_spriteinfo * data)); -int et_getspriteinfo __P((struct grf_softc * gp, struct grf_spriteinfo * data)); -static int et_getspritemax __P((struct grf_softc * gp, struct grf_position * data)); -int et_setmonitor __P((struct grf_softc * gp, struct grfvideo_mode * gv)); -int et_blank __P((struct grf_softc * gp, int * on)); -static int et_getControllerType __P((struct grf_softc * gp)); -static int et_getDACType __P((struct grf_softc * gp)); +int et_setmousepos __P((struct grf_softc *gp, struct grf_position *data)); +static int et_setspriteinfo __P((struct grf_softc *gp, + struct grf_spriteinfo *data)); +int et_getspriteinfo __P((struct grf_softc *gp, + struct grf_spriteinfo *data)); +static int et_getspritemax __P((struct grf_softc *gp, + struct grf_position *data)); +int et_setmonitor __P((struct grf_softc *gp, struct grfvideo_mode *gv)); +int et_blank __P((struct grf_softc *gp, int *on)); +static int et_getControllerType __P((struct grf_softc *gp)); +static int et_getDACType __P((struct grf_softc *gp)); int grfetmatch __P((struct device *, void *, void *)); void grfetattach __P((struct device *, struct device *, void *)); int grfetprint __P((void *, char *)); void et_memset __P((unsigned char *d, unsigned char c, int l)); -/* Graphics display definitions. +/* + * Graphics display definitions. * These are filled by 'grfconfig' using GRFIOCSETMON. */ #define monitor_def_max 8 @@ -133,30 +134,6 @@ struct grfettext_mode etconsole_mode = { 8, TSENGFONTY, 640 / 8, 480 / TSENGFONTY, TSENGFONT, 32, 255 }; -/* some modes -# 640x480 256colors 41kHz 79Hz active -x 31500000 640 480 8 640 752 672 768 728 487 505 488 490 512 -# 31500000 640 480 8 80 94 84 96 91 487 505 488 490 512 -# 640x512 256colors 42kHz 76Hz active -x 32500000 640 512 8 640 760 664 760 736 519 536 520 522 543 -# 32500000 640 512 8 80 95 83 95 92 519 536 520 522 543 -# 720x540 256colors 43kHz 74Hz active -x 37500000 720 540 8 720 856 744 840 832 547 565 548 550 572 -# 37500000 720 540 8 90 107 93 105 104 547 565 548 550 572 -# 800x600 256colors 48kHz 73Hz active -x 50350000 800 600 8 792 1048 864 960 1016 599 648 615 617 647 -# 50350000 800 600 8 99 131 108 120 127 599 648 615 617 647 -# 912x684 256colors 57kHz 78Hz active -x 65000000 912 684 8 904 1136 944 1040 1104 683 725 693 695 724 -# 65000000 912 684 8 113 142 118 130 138 683 725 693 695 724 -# 1024x768 256colors 61kHz 75Hz active -x 80000000 1024 768 8 1024 1288 1072 1168 1264 775 806 780 782 813 -# 80000000 1024 768 8 128 161 134 146 158 775 806 780 782 813 -# 1120x832 256colors 56kHz 64Hz active -x 80000000 1120 832 8 1120 1424 1152 1248 1400 839 848 833 835 855 -# 80000000 1120 832 8 140 178 144 156 175 839 848 833 835 855 -*/ - /* Console colors */ unsigned char etconscolors[3][3] = { /* background, foreground, hilite */ {0, 0x40, 0x50}, {152, 152, 152}, {255, 255, 255} @@ -171,7 +148,8 @@ unsigned char pass_toggle; /* passthru status tracker */ unsigned char Merlin_switch = 0; -/* because all Tseng-boards have 2 configdev entries, one for +/* + * Because all Tseng-boards have 2 configdev entries, one for * framebuffer mem and the other for regs, we have to hold onto * the pointers globally until we match on both. This and 'ettype' * are the primary obsticles to multiple board support, but if you @@ -200,8 +178,8 @@ struct cfattach grfet_ca = { struct cfdriver grfet_cd = { NULL, "grfet", DV_DULL, NULL, 0 }; -static struct cfdata *cfdata; +static struct cfdata *cfdata; int grfetmatch(pdp, match, auxp) @@ -243,13 +221,6 @@ grfetmatch(pdp, match, auxp) return (0); regprod = 4; fbprod = 3; - /* - * This card works only in ZorroII mode. - * ZorroIII needs different initialisations, - * which will be implemented later. - */ - if iszthreepa(zap->pa) - return (0); break; default: return (0); @@ -264,13 +235,13 @@ grfetmatch(pdp, match, auxp) /* Configure either registers or framebuffer in any order */ /* as said before, oMniBus does not support ProdID */ if (ettype == OMNIBUS) { - if (zap->size == 64 * 1024) { + if (zap->size == 64*1024) { /* register area */ - et_regaddr = zap->va; + et_regaddr=zap->va; } else { /* memory area */ - et_fbaddr = zap->va; - et_fbsize = zap->size; + et_fbaddr=zap->va; + et_fbsize=zap->size; } } else { if (zap->prodid == regprod) { @@ -313,13 +284,6 @@ grfetattach(pdp, dp, auxp) if (!et_regaddr || !et_fbaddr) return; - if (zap->manid == MERLIN && iszthreepa(zap->pa)) { - printf("grfet: WARNING: It is not possible to use the Merlin in ZorroIII mode.\n"); - printf("grfet: Switch the Jumper to use it in ZorroII mode.\n"); - printf("grfet unattached!!\n"); - return; - } - /* do all that messy console/grf stuff */ if (dp == NULL) gp = &congrf; @@ -431,7 +395,7 @@ et_boardinit(gp) vgaw(ba, MERLIN_SWITCH_REG, 0); delay(20000); vgaw(ba, MERLIN_VDAC_DATA, 1); - + vgaw(ba, MERLIN_VDAC_INDEX, 0x00); vgaw(ba, MERLIN_VDAC_SPRITE, 0xff); vgaw(ba, MERLIN_VDAC_INDEX, 0x01); @@ -444,7 +408,7 @@ et_boardinit(gp) vgaw(ba, MERLIN_VDAC_DATA, 0); } - + /* setup initial unchanging parameters */ vgaw(ba, GREG_HERCULESCOMPAT, 0x03); @@ -470,15 +434,19 @@ et_boardinit(gp) WCrt(ba, CRT_ID_UNDERLINE_LOC, 0x07); WCrt(ba, CRT_ID_MODE_CONTROL, 0xa3); /* c3 */ WCrt(ba, CRT_ID_LINE_COMPARE, 0xff); /* ff */ -/* - WCrt(ba, CRT_ID_EXT_DISP_CNTL, 0x22); -*/ /* ET4000 special */ WCrt(ba, CRT_ID_RASCAS_CONFIG, 0x28); WCrt(ba, CTR_ID_EXT_START, 0x00); WCrt(ba, CRT_ID_6845_COMPAT, 0x08); WCrt(ba, CRT_ID_VIDEO_CONFIG1, 0xd3); - WCrt(ba, CRT_ID_VIDEO_CONFIG2, 0x0f); + WCrt(ba, CRT_ID_VIDEO_CONFIG2, 0x0f); /* assume ZorroII first */ + + if (iszthreepa(ba)) { + if (((vgar(ba, GREG_FEATURE_CONTROL_R) & 12) | + (vgar(ba, GREG_STATUS0_R) & 0x60)) == 0x24 ) + WCrt(ba, CRT_ID_VIDEO_CONFIG2, 0x07); /* ZorroIII */ + } + WCrt(ba, CRT_ID_HOR_OVERFLOW, 0x00); WGfx(ba, GCT_ID_SET_RESET, 0x00); @@ -537,16 +505,16 @@ et_boardinit(gp) /* card spezific initialisations */ switch(ettype) { case OMNIBUS: - etctype = et_getControllerType(gp); - etdtype = et_getDACType(gp); + etctype=et_getControllerType(gp); + etdtype=et_getDACType(gp); break; case MERLIN: - etctype = ETW32; - etdtype = MERLINDAC; + etctype=ETW32; + etdtype=MERLINDAC; break; case DOMINO: - etctype = ET4000; - etdtype = SIERRA11483; + etctype=ET4000; + etdtype=SIERRA11483; break; } } @@ -613,9 +581,6 @@ et_off(gp) { char *ba = gp->g_regkva; - /* we'll put the pass-through on for cc ite and set Full Bandwidth bit - * on just in case it didn't work...but then it doesn't matter does - * it? =) */ RegOnpass(ba); WSeq(ba, SEQ_ID_CLOCKING_MODE, 0x21); } @@ -627,7 +592,7 @@ et_blank(gp, on) struct grf_softc *gp; int *on; { - WSeq(gp->g_regkva, SEQ_ID_CLOCKING_MODE, *on ? 0x21 : 0x01); + WSeq(gp->g_regkva, SEQ_ID_CLOCKING_MODE, *on ? 0x01 : 0x21); return(0); } @@ -751,27 +716,12 @@ et_writesprpos(ba, x, y) } -#ifdef notyet -void -et_writeshifted(to, shiftx, shifty) - unsigned char *to; - char shiftx; - char shifty; -{ -} -#endif - - int et_setmousepos(gp, data) struct grf_softc *gp; struct grf_position *data; { volatile char *ba = gp->g_regkva; -#if 0 - volatile char *fb = gp->g_fbkva; - volatile char *sprite = fb + (et_fbsize - 1024); -#endif short rx, ry, prx, pry; /* no movement */ @@ -788,11 +738,6 @@ et_setmousepos(gp, data) * ripped out optimization (not extremely worthwhile, * and kind of buggy anyhow). */ -#ifdef notyet - if (rx < 0 || ry < 0 || prx < 0 || pry < 0) { - et_writeshifted(sprite, rx < 0 ? -rx : 0, ry < 0 ? -ry : 0); - } -#endif /* do movement, save position */ et_writesprpos(ba, rx < 0 ? 0 : rx, ry < 0 ? 0 : ry); @@ -919,10 +864,11 @@ et_getcmap(gfp, cmap) break; } - if (!(error = copyout(red + cmap->index, cmap->red, cmap->count)) - && !(error = copyout(green + cmap->index, cmap->green, cmap->count)) - && !(error = copyout(blue + cmap->index, cmap->blue, cmap->count))) - return (0); + error = copyout(red + cmap->index, cmap->red, cmap->count); + if (!error) + error = copyout(green + cmap->index, cmap->green, cmap->count); + if (!error) + error = copyout(blue + cmap->index, cmap->blue, cmap->count); return (error); } @@ -945,38 +891,42 @@ et_putcmap(gfp, cmap) cmap->count = 256 - cmap->index; /* first copy the colors into kernelspace */ - if (!(error = copyin(cmap->red, red + cmap->index, cmap->count)) - && !(error = copyin(cmap->green, green + cmap->index, cmap->count)) - && !(error = copyin(cmap->blue, blue + cmap->index, cmap->count))) { - ba = gfp->g_regkva; - x = cmap->count - 1; - - rp = red + cmap->index; - gp = green + cmap->index; - bp = blue + cmap->index; - - switch(ettype){ - case MERLIN: - vgaw(ba, MERLIN_VDAC_INDEX, cmap->index); - do { - vgaw(ba, MERLIN_VDAC_COLORS, *rp++); - vgaw(ba, MERLIN_VDAC_COLORS, *gp++); - vgaw(ba, MERLIN_VDAC_COLORS, *bp++); - } while (x-- > 0); - break; - default: - vgaw(ba, VDAC_ADDRESS_W, cmap->index); - do { - vgaw(ba, VDAC_DATA, *rp++ >> etcmap_shift); - vgaw(ba, VDAC_DATA, *gp++ >> etcmap_shift); - vgaw(ba, VDAC_DATA, *bp++ >> etcmap_shift); - } while (x-- > 0); - break; - } + if ((error = copyin(cmap->red, red + cmap->index, cmap->count))) + return (error); - return (0); - } else + if ((error = copyin(cmap->green, green + cmap->index, cmap->count))) + return (error); + + if ((error = copyin(cmap->blue, blue + cmap->index, cmap->count))) return (error); + + ba = gfp->g_regkva; + x = cmap->count - 1; + + rp = red + cmap->index; + gp = green + cmap->index; + bp = blue + cmap->index; + + switch(ettype){ + case MERLIN: + vgaw(ba, MERLIN_VDAC_INDEX, cmap->index); + do { + vgaw(ba, MERLIN_VDAC_COLORS, *rp++); + vgaw(ba, MERLIN_VDAC_COLORS, *gp++); + vgaw(ba, MERLIN_VDAC_COLORS, *bp++); + } while (x-- > 0); + break; + default: + vgaw(ba, VDAC_ADDRESS_W, cmap->index); + do { + vgaw(ba, VDAC_DATA, *rp++ >> etcmap_shift); + vgaw(ba, VDAC_DATA, *gp++ >> etcmap_shift); + vgaw(ba, VDAC_DATA, *bp++ >> etcmap_shift); + } while (x-- > 0); + break; + } + + return (0); } @@ -1387,8 +1337,10 @@ et_inittextmode(gp) unsigned short z; - /* load text font into beginning of display memory. Each character - * cell is 32 bytes long (enough for 4 planes) */ + /* + * load text font into beginning of display memory. Each character + * cell is 32 bytes long (enough for 4 planes) + */ SetTextPlane(ba, 0x02); et_memset(fb, 0, 256 * 32); @@ -1522,7 +1474,11 @@ et_getDACType(gp) /* check for MUSIC DAC */ - if(vgar(ba, HDR)); if(vgar(ba, HDR)); if(vgar(ba, HDR)); if(vgar(ba, HDR)); + if(vgar(ba, HDR)); /* We MUST do 4 HW reads to switch into command mode */ + if(vgar(ba, HDR)); + if(vgar(ba, HDR)); + if(vgar(ba, HDR)); + vgaw(ba, VDAC_COMMAND, 0x02); /* set some strange MUSIC mode (???) */ vgaw(ba, VDAC_XINDEX, 0x01); @@ -1534,7 +1490,11 @@ et_getDACType(gp) return(MUSICDAC); } - /* nothing else found, so let us pretend it is a stupid Sierra SC 11483 */ + /* + * nothing else found, so let us pretend it is a stupid + * Sierra SC 11483 + */ + /* shift color values by 2 */ etcmap_shift = 2; diff --git a/sys/arch/amiga/dev/grf_etreg.h b/sys/arch/amiga/dev/grf_etreg.h index 41e82d8ab80..bec07ac688f 100644 --- a/sys/arch/amiga/dev/grf_etreg.h +++ b/sys/arch/amiga/dev/grf_etreg.h @@ -1,4 +1,4 @@ -/* $NetBSD: grf_etreg.h,v 1.1 1996/05/19 21:05:34 veego Exp $ */ +/* $NetBSD: grf_etreg.h,v 1.1.4.1 1996/05/27 01:12:13 is Exp $ */ /* * Copyright (c) 1996 Tobias Abt diff --git a/sys/arch/amiga/dev/grf_rh.c b/sys/arch/amiga/dev/grf_rh.c index b24b5794a0d..0da8f9d2572 100644 --- a/sys/arch/amiga/dev/grf_rh.c +++ b/sys/arch/amiga/dev/grf_rh.c @@ -1,5 +1,5 @@ -/* $OpenBSD: grf_rh.c,v 1.7 1996/05/29 10:15:10 niklas Exp $ */ -/* $NetBSD: grf_rh.c,v 1.17 1996/05/19 21:05:37 veego Exp $ */ +/* $OpenBSD: grf_rh.c,v 1.8 1996/08/23 18:52:46 niklas Exp $ */ +/* $NetBSD: grf_rh.c,v 1.17.4.1 1996/05/26 17:26:45 is Exp $ */ /* * Copyright (c) 1994 Markus Wild @@ -1414,7 +1414,7 @@ int rh_mon_max = sizeof (monitor_defs)/sizeof (monitor_defs[0]); int rh_default_mon = 0; int rh_default_gfx = 4; -static struct MonDef *current_mon; +static struct MonDef *current_mon; /* EVIL */ int rh_mode __P((struct grf_softc *, u_long, void *, u_long, int)); void grfrhattach __P((struct device *, struct device *, void *)); @@ -1494,12 +1494,6 @@ grfrhattach(pdp, dp, auxp) (char *)&gp[1] - (char *)&gp->g_display); } else { gp->g_regkva = (volatile caddr_t)zap->va; - - gp->g_regkva[0x3c8]=0; - gp->g_regkva[0x3c9]=30; - gp->g_regkva[0x3c9]=30; - gp->g_regkva[0x3c9]=00; - gp->g_fbkva = (volatile caddr_t)zap->va + LM_OFFSET; gp->g_unit = GRF_RETINAIII_UNIT; gp->g_mode = rh_mode; @@ -2064,12 +2058,12 @@ rh_blank(gp, on) struct grf_softc *gp; int *on; { + struct MonDef *md = (struct MonDef *)gp->g_data; int r; - r = RSeq(gp->g_regkva, SEQ_ID_CLOCKING_MODE); - r &= 0xdf; /* set Bit 5 to 0 */ + r = 0x01 | ((md->FLG & MDF_CLKDIV2)/ MDF_CLKDIV2 * 8); - WSeq(gp->g_regkva, SEQ_ID_CLOCKING_MODE, r | (*on ? 0x00 : 0x20)); + WSeq(gp->g_regkva, SEQ_ID_CLOCKING_MODE, *on ? r : 0x21); return(0); } diff --git a/sys/arch/amiga/dev/grf_rt.c b/sys/arch/amiga/dev/grf_rt.c index 0a28eed7381..92213360164 100644 --- a/sys/arch/amiga/dev/grf_rt.c +++ b/sys/arch/amiga/dev/grf_rt.c @@ -1,5 +1,5 @@ -/* $OpenBSD: grf_rt.c,v 1.6 1996/05/29 10:15:15 niklas Exp $ */ -/* $NetBSD: grf_rt.c,v 1.27 1996/05/19 21:05:45 veego Exp $ */ +/* $OpenBSD: grf_rt.c,v 1.7 1996/08/23 18:52:50 niklas Exp $ */ +/* $NetBSD: grf_rt.c,v 1.27.4.1 1996/05/26 17:26:43 is Exp $ */ /* * Copyright (c) 1993 Markus Wild @@ -1460,12 +1460,12 @@ rt_blank(gp, on) struct grf_softc *gp; int *on; { + struct MonDef *md = (struct MonDef *)gp->g_data; int r; - r = RSeq(gp->g_regkva, SEQ_ID_CLOCKING_MODE); - r &= 0xdf; /* set Bit 5 to 0 */ + r = 0x01 | ((md->FLG & MDF_CLKDIV2)/ MDF_CLKDIV2 * 8); - WSeq(gp->g_regkva, SEQ_ID_CLOCKING_MODE, r | (*on ? 0x00 : 0x20)); + WSeq(gp->g_regkva, SEQ_ID_CLOCKING_MODE, *on ? r : 0x21); return(0); } diff --git a/sys/arch/amiga/dev/grfabs_cc.c b/sys/arch/amiga/dev/grfabs_cc.c index 0a74231f536..ca4288c1522 100644 --- a/sys/arch/amiga/dev/grfabs_cc.c +++ b/sys/arch/amiga/dev/grfabs_cc.c @@ -1,5 +1,5 @@ -/* $OpenBSD: grfabs_cc.c,v 1.3 1996/05/29 10:15:20 niklas Exp $ */ -/* $NetBSD: grfabs_cc.c,v 1.12 1996/05/19 21:05:50 veego Exp $ */ +/* $OpenBSD: grfabs_cc.c,v 1.4 1996/08/23 18:52:55 niklas Exp $ */ +/* $NetBSD: grfabs_cc.c,v 1.12.4.1 1996/05/28 20:46:04 is Exp $ */ /* * Copyright (c) 1994 Christian E. Hopps @@ -1843,7 +1843,11 @@ cc_init_ntsc_aga() aga_this_data->bplcon0 = 0x0240 | USE_CON3; /* color composite * enable, * shres. */ +#ifdef GRF_AGA_VGA aga_this_data->std_start_x = 0x40 /*STANDARD_VIEW_X*/; +#else + aga_this_data->std_start_x = 0x4f /*STANDARD_VIEW_X*/; +#endif aga_this_data->std_start_y = 0x2b /*STANDARD_VIEW_Y*/; aga_this_data->vbl_handler = (vbl_handler_func *) cc_mode_vbl_handler; aga_this_data->beamcon0 = SPECIAL_BEAMCON ^ VSYNCTRUE; @@ -1856,12 +1860,23 @@ cc_init_ntsc_aga() /* static, so I can patch and play */ +#ifdef GRF_AGA_VGA int AGA_htotal = 0x71; int AGA_hsstrt = 0xc; int AGA_hsstop = 0x16; int AGA_hbstrt = 0x5; +#else +int AGA_htotal = 0x79; +int AGA_hsstrt = 0xe; +int AGA_hsstop = 0x1c; +int AGA_hbstrt = 0x8; +#endif int AGA_hbstop = 0x1e; +#ifdef GRF_AGA_VGA int AGA_vtotal = 0x1c1; +#else +int AGA_vtotal = 0x1ec; +#endif int AGA_vsstrt = 0x3; int AGA_vsstop = 0x6; int AGA_vbstrt = 0x0; diff --git a/sys/arch/amiga/dev/grfioctl.h b/sys/arch/amiga/dev/grfioctl.h index 901bc2d975b..f7b9534ea02 100644 --- a/sys/arch/amiga/dev/grfioctl.h +++ b/sys/arch/amiga/dev/grfioctl.h @@ -1,4 +1,4 @@ -/* $NetBSD: grfioctl.h,v 1.11 1995/10/09 02:08:47 chopps Exp $ */ +/* $NetBSD: grfioctl.h,v 1.11.6.1 1996/06/04 10:22:00 is Exp $ */ /* * Copyright (c) 1988 University of Utah. @@ -217,3 +217,6 @@ struct grf_bitblt { /* can't use IOCON/OFF because that would turn ite on */ #define GRFIOCBLANK _IOW('G', 58, int) + +#define GRFIOCBLANK_LIVE 1 +#define GRFIOCBLANK_DARK 0 diff --git a/sys/arch/amiga/dev/idesc.c b/sys/arch/amiga/dev/idesc.c index abfb8e53299..fe5fd3e6674 100644 --- a/sys/arch/amiga/dev/idesc.c +++ b/sys/arch/amiga/dev/idesc.c @@ -1,5 +1,5 @@ -/* $OpenBSD: idesc.c,v 1.5 1996/05/29 10:15:24 niklas Exp $ */ -/* $NetBSD: idesc.c,v 1.21 1996/05/12 02:26:03 mhitch Exp $ */ +/* $OpenBSD: idesc.c,v 1.6 1996/08/23 18:53:01 niklas Exp $ */ +/* $NetBSD: idesc.c,v 1.21.4.2 1996/05/30 03:20:14 mhitch Exp $ */ /* * Copyright (c) 1994 Michael L. Hitch @@ -894,8 +894,10 @@ ideicmd(dev, target, cbuf, clen, buf, len) return (ideiread(ide, lba, buf, nblks)); case READ_COMMAND: - lba = *((long *)cbuf) & 0x000fffff; + lba = *((long *)cbuf) & 0x001fffff; nblks = *((u_char *)(cbuf + 4)); + if (nblks == 0) + nblks = 256; return (ideiread(ide, lba, buf, nblks)); case WRITE_BIG: @@ -904,8 +906,10 @@ ideicmd(dev, target, cbuf, clen, buf, len) return (ideiwrite(ide, lba, buf, nblks)); case WRITE_COMMAND: - lba = *((long *)cbuf) & 0x000fffff; + lba = *((long *)cbuf) & 0x001fffff; nblks = *((u_char *)(cbuf + 4)); + if (nblks == 0) + nblks = 256; return (ideiwrite(ide, lba, buf, nblks)); case PREVENT_ALLOW: @@ -996,7 +1000,7 @@ idego(dev, xs) switch (xs->cmd->opcode) { case READ_COMMAND: case WRITE_COMMAND: - lba = *((long *)xs->cmd) & 0x000fffff; + lba = *((long *)xs->cmd) & 0x001fffff; nblks = xs->cmd->bytes[3]; if (nblks == 0) nblks = 256; diff --git a/sys/arch/amiga/dev/if_ae.c b/sys/arch/amiga/dev/if_ae.c index a0ac1f62833..22e2fbea4c1 100644 --- a/sys/arch/amiga/dev/if_ae.c +++ b/sys/arch/amiga/dev/if_ae.c @@ -1,5 +1,5 @@ -/* $OpenBSD: if_ae.c,v 1.7 1996/05/09 22:39:58 niklas Exp $ */ -/* $NetBSD: if_ae.c,v 1.8 1996/05/07 00:46:37 thorpej Exp $ */ +/* $OpenBSD: if_ae.c,v 1.8 1996/08/23 18:53:04 niklas Exp $ */ +/* $NetBSD: if_ae.c,v 1.8.4.1 1996/05/26 17:26:41 is Exp $ */ /* * Copyright (c) 1995 Bernd Ernesti and Klaus Burkert. All rights reserved. @@ -271,7 +271,9 @@ void aememinit(sc) register struct ae_softc *sc; { +#if NBPFILTER > 0 register struct ifnet *ifp = &sc->sc_arpcom.ac_if; +#endif /* * This structure is referenced from the CARD's/PCnet-ISA's point * of view, thus the 0x8000 address which is the buffer RAM area diff --git a/sys/arch/amiga/dev/ite.c b/sys/arch/amiga/dev/ite.c index abc4eda5ce4..5b32e7437ff 100644 --- a/sys/arch/amiga/dev/ite.c +++ b/sys/arch/amiga/dev/ite.c @@ -1,5 +1,5 @@ -/* $OpenBSD: ite.c,v 1.7 1996/05/29 10:15:27 niklas Exp $ */ -/* $NetBSD: ite.c,v 1.41 1996/05/19 19:03:06 is Exp $ */ +/* $OpenBSD: ite.c,v 1.8 1996/08/23 18:53:07 niklas Exp $ */ +/* $NetBSD: ite.c,v 1.41.4.1 1996/06/06 04:53:13 mhitch Exp $ */ /* * Copyright (c) 1988 University of Utah. @@ -445,9 +445,10 @@ iteopen(dev, mode, devtype, p) ip = getitesp(dev); - if (ip->tp == NULL) + if (ip->tp == NULL) { tp = ip->tp = ttymalloc(); - else + tty_attach(tp); + } else tp = ip->tp; if ((tp->t_state & (TS_ISOPEN | TS_XCLUDE)) == (TS_ISOPEN | TS_XCLUDE) && p->p_ucred->cr_uid != 0) diff --git a/sys/arch/amiga/dev/ite_et.c b/sys/arch/amiga/dev/ite_et.c index d2e275b55e1..6cfb981c122 100644 --- a/sys/arch/amiga/dev/ite_et.c +++ b/sys/arch/amiga/dev/ite_et.c @@ -1,4 +1,4 @@ -/* $NetBSD: ite_et.c,v 1.1 1996/05/19 21:06:00 veego Exp $ */ +/* $NetBSD: ite_et.c,v 1.1.4.1 1996/05/27 01:12:10 is Exp $ */ /* * Copyright (c) 1995 Ezra Story @@ -64,6 +64,7 @@ void et_putc __P((struct ite_softc *ip, int c, int dy, int dx, int mode)); void et_clear __P((struct ite_softc *ip, int sy, int sx, int h, int w)); void et_scroll __P((struct ite_softc *ip, int sy, int sx, int count, int dir)); +static void etbcopy(const void *src, void *dst, size_t len); /* @@ -198,9 +199,9 @@ et_clear(ip, sy, sx, h, w) len = w*h; SetTextPlane(ba, 0x00); - bcopy(src, dst, len); + etbcopy(src, dst, len); SetTextPlane(ba, 0x01); - bcopy(src, dst, len); + etbcopy(src, dst, len); } @@ -220,18 +221,18 @@ et_scroll(ip, sy, sx, count, dir) switch (dir) { case SCROLL_UP: - bcopy(fb, fb - (count * ip->cols), + etbcopy(fb, fb - (count * ip->cols), (ip->bottom_margin + 1 - sy) * ip->cols); break; case SCROLL_DOWN: - bcopy(fb, fb + (count * ip->cols), + etbcopy(fb, fb + (count * ip->cols), (ip->bottom_margin + 1 - (sy + count)) * ip->cols); break; case SCROLL_RIGHT: - bcopy(fb+sx, fb+sx+count, ip->cols - (sx + count)); + etbcopy(fb+sx, fb+sx+count, ip->cols - (sx + count)); break; case SCROLL_LEFT: - bcopy(fb+sx, fb+sx-count, ip->cols - sx); + etbcopy(fb+sx, fb+sx-count, ip->cols - sx); break; } @@ -239,19 +240,45 @@ et_scroll(ip, sy, sx, count, dir) switch (dir) { case SCROLL_UP: - bcopy(fb, fb - (count * ip->cols), + etbcopy(fb, fb - (count * ip->cols), (ip->bottom_margin + 1 - sy) * ip->cols); break; case SCROLL_DOWN: - bcopy(fb, fb + (count * ip->cols), + etbcopy(fb, fb + (count * ip->cols), (ip->bottom_margin + 1 - (sy + count)) * ip->cols); break; case SCROLL_RIGHT: - bcopy(fb+sx, fb+sx+count, ip->cols - (sx + count)); + etbcopy(fb+sx, fb+sx+count, ip->cols - (sx + count)); break; case SCROLL_LEFT: - bcopy(fb+sx, fb+sx-count, ip->cols - sx); + etbcopy(fb+sx, fb+sx-count, ip->cols - sx); break; } } + + +static void etbcopy(src, dst, len) + const void *src; + void *dst; + size_t len; +{ + int i; + + if (src == dst) + return; + + if (src > dst) + for (i=len; i>0; i--) { + *((char *)dst)++ = *((char *)src)++; + } + else { + ((char *)src) += len; + ((char *)dst) += len; + + for (i=len; i>0; i--){ + *--((char *)dst) = *--((char *)src); + } + } +} + #endif /* NGRFET */ diff --git a/sys/arch/amiga/dev/mfc.c b/sys/arch/amiga/dev/mfc.c index 7d62df1c863..4f582390961 100644 --- a/sys/arch/amiga/dev/mfc.c +++ b/sys/arch/amiga/dev/mfc.c @@ -1,5 +1,5 @@ -/* $OpenBSD: mfc.c,v 1.6 1996/05/02 06:44:19 niklas Exp $ */ -/* $NetBSD: mfc.c,v 1.12 1996/04/21 21:12:09 veego Exp $ */ +/* $OpenBSD: mfc.c,v 1.7 1996/08/23 18:53:12 niklas Exp $ */ +/* $NetBSD: mfc.c,v 1.12.4.1 1996/06/06 04:53:16 mhitch Exp $ */ /* * Copyright (c) 1994 Michael L. Hitch @@ -488,8 +488,10 @@ mfcsopen(dev, flag, mode, p) if (sc->sc_tty) tp = sc->sc_tty; - else + else { tp = sc->sc_tty = ttymalloc(); + tty_attach(tp); + } tp->t_oproc = (void (*) (struct tty *)) mfcsstart; tp->t_param = mfcsparam; diff --git a/sys/arch/amiga/dev/msc.c b/sys/arch/amiga/dev/msc.c index 15fb5d84db5..d8828ed5f8d 100644 --- a/sys/arch/amiga/dev/msc.c +++ b/sys/arch/amiga/dev/msc.c @@ -1,5 +1,5 @@ -/* $OpenBSD: msc.c,v 1.4 1996/05/02 06:44:22 niklas Exp $ */ -/* $NetBSD: msc.c,v 1.6 1996/04/21 21:12:15 veego Exp $ */ +/* $OpenBSD: msc.c,v 1.5 1996/08/23 18:53:14 niklas Exp $ */ +/* $NetBSD: msc.c,v 1.6.4.1 1996/06/06 04:53:17 mhitch Exp $ */ /* * Copyright (c) 1993 Zik. @@ -324,6 +324,7 @@ mscopen(dev, flag, mode, p) if (!msc_tty[ttyn]) { tp = ttymalloc(); + tty_attach(tp); msc_tty[ttyn] = tp; msc_tty[ttyn+1] = (struct tty *)NULL; diff --git a/sys/arch/amiga/dev/ser.c b/sys/arch/amiga/dev/ser.c index 39a22b35178..1d40b2cb402 100644 --- a/sys/arch/amiga/dev/ser.c +++ b/sys/arch/amiga/dev/ser.c @@ -1,5 +1,5 @@ -/* $OpenBSD: ser.c,v 1.4 1996/05/02 06:44:30 niklas Exp $ */ -/* $NetBSD: ser.c,v 1.34 1996/04/27 20:53:31 veego Exp $ */ +/* $OpenBSD: ser.c,v 1.5 1996/08/23 18:53:17 niklas Exp $ */ +/* $NetBSD: ser.c,v 1.34.4.1 1996/06/06 04:53:19 mhitch Exp $ */ /* * Copyright (c) 1982, 1986, 1990 The Regents of the University of California. @@ -251,9 +251,11 @@ seropen(dev, flag, mode, p) if (ser_tty[unit]) tp = ser_tty[unit]; - else + else { tp = ((struct ser_softc *)ser_cd.cd_devs[unit])->ser_tty = ser_tty[unit] = ttymalloc(); + tty_attach(tp); + } tp->t_oproc = (void (*) (struct tty *)) serstart; tp->t_param = serparam; |