summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authormw <mw@NetBSD.org>1993-10-30 23:40:53 +0000
committermw <mw@NetBSD.org>1993-10-30 23:40:53 +0000
commit4e382ac007d58fbdab05b575dd979774a3ee045a (patch)
treef168dce9b7ce817e79a5e7da846952d1b89ee92f /sys
parent70297450616386a5d065ff956edf748d970d37d9 (diff)
new tree for amiga, replacing the bogous previous one.
SunOS support works for a lot of executables now (static and dynamic).
Diffstat (limited to 'sys')
-rw-r--r--sys/arch/amiga/conf/AMIGA7
-rw-r--r--sys/arch/amiga/conf/GODZILLA56
-rw-r--r--sys/arch/amiga/conf/Makefile.amiga12
-rw-r--r--sys/arch/amiga/conf/files.amiga.old8
-rw-r--r--sys/arch/amiga/dev/device.h3
-rw-r--r--sys/arch/amiga/dev/dmavar.h3
-rw-r--r--sys/arch/amiga/dev/even_parity.c2
-rw-r--r--sys/arch/amiga/dev/genpar.c2
-rw-r--r--sys/arch/amiga/dev/grf.c13
-rw-r--r--sys/arch/amiga/dev/grf_cc.c34
-rw-r--r--sys/arch/amiga/dev/grf_ccreg.h11
-rw-r--r--sys/arch/amiga/dev/grf_rt.c60
-rw-r--r--sys/arch/amiga/dev/grf_tg.c2
-rw-r--r--sys/arch/amiga/dev/grfioctl.h6
-rw-r--r--sys/arch/amiga/dev/grfvar.h6
-rw-r--r--sys/arch/amiga/dev/if_le.c2
-rw-r--r--sys/arch/amiga/dev/if_lereg.h2
-rw-r--r--sys/arch/amiga/dev/ite.c260
-rw-r--r--sys/arch/amiga/dev/ite_cc.c2
-rw-r--r--sys/arch/amiga/dev/ite_subr.c137
-rw-r--r--sys/arch/amiga/dev/ite_tg.c2
-rw-r--r--sys/arch/amiga/dev/iteioctl.h6
-rw-r--r--sys/arch/amiga/dev/itevar.h6
-rw-r--r--sys/arch/amiga/dev/kbd.c2
-rw-r--r--sys/arch/amiga/dev/kbdmap.c2
-rw-r--r--sys/arch/amiga/dev/kbdmap.h2
-rw-r--r--sys/arch/amiga/dev/kbdreg.h3
-rw-r--r--sys/arch/amiga/dev/kernel_font.c.distrib10
-rw-r--r--sys/arch/amiga/dev/par.c422
-rw-r--r--sys/arch/amiga/dev/parioctl.h2
-rw-r--r--sys/arch/amiga/dev/rdb.h2
-rw-r--r--sys/arch/amiga/dev/retina-mondefs.c196
-rw-r--r--sys/arch/amiga/dev/retina-monitors71
-rw-r--r--sys/arch/amiga/dev/scsi.c27
-rw-r--r--sys/arch/amiga/dev/scsireg.h3
-rw-r--r--sys/arch/amiga/dev/scsivar.h3
-rw-r--r--sys/arch/amiga/dev/sd.c11
-rw-r--r--sys/arch/amiga/dev/ser.c3
-rw-r--r--sys/arch/amiga/dev/serreg.h3
-rw-r--r--sys/arch/amiga/dev/st.c105
-rw-r--r--sys/arch/amiga/dev/stvar.h13
-rw-r--r--sys/arch/amiga/dev/transmon76
-rw-r--r--sys/arch/amiga/dev/vn.c11
-rw-r--r--sys/arch/amiga/dev/vnioctl.h6
44 files changed, 1192 insertions, 423 deletions
diff --git a/sys/arch/amiga/conf/AMIGA b/sys/arch/amiga/conf/AMIGA
index 3dfaac2b12e..97829bbf0fc 100644
--- a/sys/arch/amiga/conf/AMIGA
+++ b/sys/arch/amiga/conf/AMIGA
@@ -7,6 +7,7 @@ maxusers 16
# Standard options
#options QUOTA
+options SWAPPAGER,VNODEPAGER,DEVPAGER
options INET
options NFS,NFSSERVER,NFSCLIENT
options MFS
@@ -52,7 +53,7 @@ master gvp11scsi0 at manufacturer 2017 product 11
device ser0 at manufacturer 1 product 3
#device clock at manufacturer 1 product 4
#device kbd at manufacturer 1 product 5
-#device par at manufacturer 1 product 6
+device par0 at manufacturer 1 product 6
#device mouse at manufacturer 1 product 8
disk sd0 at a3000scsi0 slave 0
@@ -113,7 +114,3 @@ pseudo-device pty
pseudo-device loop
pseudo-device ether
pseudo-device vn 10
-
-pseudo-device devpager
-pseudo-device swappager
-pseudo-device vnodepager
diff --git a/sys/arch/amiga/conf/GODZILLA b/sys/arch/amiga/conf/GODZILLA
index a472cc83fb2..87d7782db46 100644
--- a/sys/arch/amiga/conf/GODZILLA
+++ b/sys/arch/amiga/conf/GODZILLA
@@ -7,12 +7,14 @@ maxusers 16
# Standard options
#options QUOTA
+options COMPAT_SUNOS
+options SWAPPAGER,VNODEPAGER,DEVPAGER
options INET
options NFS,NFSSERVER,NFSCLIENT
options MFS
options ISOFS
options FIFO
-options MSDOSFS
+#options MSDOSFS
options KERNFS
options FDESC
#options ISO
@@ -43,52 +45,52 @@ config vmunix root on sd1a swap on sd1b and sd6b
# manufacturer 1 is a pseudo and stands for `builtin'
master a3000scsi0 at manufacturer 1 product 1
-master a2091scsi0 at manufacturer 514 product 3
-master gvp11scsi0 at manufacturer 2017 product 11
+#master a2091scsi0 at manufacturer 514 product 3
+#master gvp11scsi0 at manufacturer 2017 product 11
#master floppy0 at manufacturer 1 product 2
# further builtin devices
device ser0 at manufacturer 1 product 3
#device clock at manufacturer 1 product 4
#device kbd at manufacturer 1 product 5
-#device par at manufacturer 1 product 6
+device par0 at manufacturer 1 product 6
#device mouse at manufacturer 1 product 8
disk sd0 at a3000scsi0 slave 0
-disk sd0 at a2091scsi0 slave 0
-disk sd0 at gvp11scsi0 slave 0
+#disk sd0 at a2091scsi0 slave 0
+#disk sd0 at gvp11scsi0 slave 0
disk sd1 at a3000scsi0 slave 1
-disk sd1 at a2091scsi0 slave 1
-disk sd1 at gvp11scsi0 slave 1
+#disk sd1 at a2091scsi0 slave 1
+#disk sd1 at gvp11scsi0 slave 1
disk sd2 at a3000scsi0 slave 2
-disk sd2 at a2091scsi0 slave 2
-disk sd2 at gvp11scsi0 slave 2
+#disk sd2 at a2091scsi0 slave 2
+#disk sd2 at gvp11scsi0 slave 2
disk sd3 at a3000scsi0 slave 3
-disk sd3 at a2091scsi0 slave 3
-disk sd3 at gvp11scsi0 slave 3
+#disk sd3 at a2091scsi0 slave 3
+#disk sd3 at gvp11scsi0 slave 3
disk sd4 at a3000scsi0 slave 4
-disk sd4 at a2091scsi0 slave 4
-disk sd4 at gvp11scsi0 slave 4
+#disk sd4 at a2091scsi0 slave 4
+#disk sd4 at gvp11scsi0 slave 4
disk sd5 at a3000scsi0 slave 5
-disk sd5 at a2091scsi0 slave 5
-disk sd5 at gvp11scsi0 slave 5
+#disk sd5 at a2091scsi0 slave 5
+#disk sd5 at gvp11scsi0 slave 5
disk sd6 at a3000scsi0 slave 6
-disk sd6 at a2091scsi0 slave 6
-disk sd6 at gvp11scsi0 slave 6
+#disk sd6 at a2091scsi0 slave 6
+#disk sd6 at gvp11scsi0 slave 6
tape st0 at a3000scsi0 slave ?
-tape st0 at a2091scsi0 slave ?
-tape st0 at gvp11scsi0 slave ?
+#tape st0 at a2091scsi0 slave ?
+#tape st0 at gvp11scsi0 slave ?
tape st1 at a3000scsi0 slave ?
-tape st1 at a2091scsi0 slave ?
-tape st1 at gvp11scsi0 slave ?
+#tape st1 at a2091scsi0 slave ?
+#tape st1 at gvp11scsi0 slave ?
device grf0 at manufacturer 1 product 7
device grf1 at manufacturer 18260 product 6
@@ -104,15 +106,11 @@ device le0 at manufacturer ? product ?
# my dear A2410
#device tiga0 at manufacturer 1030 product 0
-pseudo-device sl 4
-pseudo-device ppp 4
+pseudo-device sl 1
+pseudo-device ppp 1
pseudo-device bpfilter 16
pseudo-device ite 2
pseudo-device pty
pseudo-device loop
pseudo-device ether
-pseudo-device vn 10
-
-pseudo-device devpager
-pseudo-device swappager
-pseudo-device vnodepager
+#pseudo-device vn 10
diff --git a/sys/arch/amiga/conf/Makefile.amiga b/sys/arch/amiga/conf/Makefile.amiga
index ec1814acfc1..db9c4ecca85 100644
--- a/sys/arch/amiga/conf/Makefile.amiga
+++ b/sys/arch/amiga/conf/Makefile.amiga
@@ -1,5 +1,4 @@
-# from: @(#)Makefile.hp300 7.10 (Berkeley) 6/27/91
-# $Id: Makefile.amiga,v 1.3 1993/09/02 18:07:47 mw Exp $
+# @(#)Makefile.hp300 7.10 (Berkeley) 6/27/91
#
# Makefile for 4.4 BSD
#
@@ -37,6 +36,13 @@ INCLUDES= -I. -I$S/arch -I$S -I$S/sys
COPTS= ${INCLUDES} ${IDENT} -DKERNEL -Dmc68020 -Damiga -DREFBIT
CFLAGS= -O -mc68020 -m68881 ${COPTS}
+### find out what to use for libkern
+.include "$S/lib/libkern/Makefile.inc"
+.ifndef PROF
+LIBKERN= ${KERNLIB}
+.else
+LIBKERN= ${KERNLIB_PROF}
+.endif
# compile rules: rules are named ${TYPE}_${SUFFIX}${CONFIG_DEP}
# where TYPE is NORMAL, DRIVER, or PROFILE}; SUFFIX is the file suffix,
# capitalized (e.g. C for a .c file), and CONFIG_DEP is _C if the file
@@ -65,7 +71,7 @@ NORMAL_S_C= ${CPP} ${COPTS} ${PARAM} $< | ${AS} -o $@
# ${SYSTEM_LD_HEAD}
# ${SYSTEM_LD} swapxxx.o
# ${SYSTEM_LD_TAIL}
-SYSTEM_OBJ= locore.o ${OBJS} param.o ioconf.o vers.o
+SYSTEM_OBJ= locore.o ${OBJS} param.o ioconf.o vers.o ${LIBKERN}
#SYSTEM_DEP= Makefile symbols.sort ${SYSTEM_OBJ}
SYSTEM_DEP= Makefile ${SYSTEM_OBJ}
SYSTEM_LD_HEAD= @echo loading $@; rm -f $@
diff --git a/sys/arch/amiga/conf/files.amiga.old b/sys/arch/amiga/conf/files.amiga.old
index c52a8f7c3c7..49259401eda 100644
--- a/sys/arch/amiga/conf/files.amiga.old
+++ b/sys/arch/amiga/conf/files.amiga.old
@@ -19,7 +19,7 @@ arch/amiga/dev/a3000dma.c optional a3000scsi device-driver
arch/amiga/dev/a2091dma.c optional a2091scsi device-driver
arch/amiga/dev/gvp11dma.c optional gvp11scsi device-driver
arch/amiga/dev/vn.c optional vn device-driver
-arch/amiga/dev/scsi.c optional a3000scsi
+arch/amiga/dev/scsi.c optional a3000scsi or a2091scsi or gvp11scsi
arch/amiga/dev/sd.c optional sd device-driver
arch/amiga/dev/st.c optional st device-driver
arch/amiga/dev/ser.c optional ser device-driver
@@ -39,3 +39,9 @@ arch/amiga/dev/if_le.c optional le device-driver
arch/amiga/dev/rtclocka.c optional rtclocka device-driver
arch/amiga/dev/rtclockb.c optional rtclockb device-driver
kern/syscalls.c standard
+arch/amiga/sunos/sun_disklabel.c optional compat_sunos
+arch/amiga/sunos/sun_ioctl.c optional compat_sunos
+arch/amiga/sunos/sun_misc.c optional compat_sunos
+arch/amiga/sunos/sun_sysent.c optional compat_sunos
+arch/amiga/sunos/sun_exec_aout.c optional compat_sunos
+arch/amiga/sunos/sun_syscalls.c optional compat_sunos
diff --git a/sys/arch/amiga/dev/device.h b/sys/arch/amiga/dev/device.h
index e1a5ada76a7..46921594dc9 100644
--- a/sys/arch/amiga/dev/device.h
+++ b/sys/arch/amiga/dev/device.h
@@ -30,8 +30,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * from: @(#)device.h 7.3 (Berkeley) 5/7/91
- * $Id: device.h,v 1.3 1993/09/02 18:07:54 mw Exp $
+ * @(#)device.h 7.3 (Berkeley) 5/7/91
*/
struct driver {
diff --git a/sys/arch/amiga/dev/dmavar.h b/sys/arch/amiga/dev/dmavar.h
index 700a9391fb2..12a05ee4d12 100644
--- a/sys/arch/amiga/dev/dmavar.h
+++ b/sys/arch/amiga/dev/dmavar.h
@@ -30,8 +30,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * from: @(#)dmavar.h 7.2 (Berkeley) 11/4/90
- * $Id: dmavar.h,v 1.3 1993/09/02 18:07:55 mw Exp $
+ * @(#)dmavar.h 7.2 (Berkeley) 11/4/90
*/
/* dmago flags */
diff --git a/sys/arch/amiga/dev/even_parity.c b/sys/arch/amiga/dev/even_parity.c
index 5c8a66994d5..c7d14dd3add 100644
--- a/sys/arch/amiga/dev/even_parity.c
+++ b/sys/arch/amiga/dev/even_parity.c
@@ -1,5 +1,3 @@
-/* $Id: even_parity.c,v 1.2 1993/08/02 18:33:30 mycroft Exp $ */
-
u_char even_parity[] = {
0, 1, 1, 0, 1, 0, 0, 1, 1, 0, 0, 1, 0, 1, 1, 0,
1, 0, 0, 1, 0, 1, 1, 0, 0, 1, 1, 0, 1, 0, 0, 1,
diff --git a/sys/arch/amiga/dev/genpar.c b/sys/arch/amiga/dev/genpar.c
index 72c364d0fe8..fd8c5560b5f 100644
--- a/sys/arch/amiga/dev/genpar.c
+++ b/sys/arch/amiga/dev/genpar.c
@@ -1,5 +1,3 @@
-/* $Id: genpar.c,v 1.2 1993/08/02 18:33:31 mycroft Exp $ */
-
#define bset(i,b) ((i & (1<<b))?1:0)
main()
diff --git a/sys/arch/amiga/dev/grf.c b/sys/arch/amiga/dev/grf.c
index ecffe567d6e..88e63fe8fcb 100644
--- a/sys/arch/amiga/dev/grf.c
+++ b/sys/arch/amiga/dev/grf.c
@@ -35,9 +35,9 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * from: Utah Hdr: grf.c 1.31 91/01/21
- * from: @(#)grf.c 7.8 (Berkeley) 5/7/91
- * $Id: grf.c,v 1.3 1993/09/02 18:07:56 mw Exp $
+ * from: Utah $Hdr: grf.c 1.31 91/01/21$
+ *
+ * @(#)grf.c 7.8 (Berkeley) 5/7/91
*/
/*
@@ -413,7 +413,6 @@ grfaddr(gp, off)
{
register struct grfinfo *gi = &gp->g_display;
-#if 0
/* control registers */
if (off >= 0 && off < gi->gd_regsize)
return(((u_int)gi->gd_regaddr + off) >> PGSHIFT);
@@ -423,7 +422,6 @@ grfaddr(gp, off)
off -= gi->gd_regsize;
return(((u_int)gi->gd_fbaddr + off) >> PGSHIFT);
}
-#endif
/* bogus */
return(-1);
}
@@ -452,8 +450,9 @@ grfmmap(dev, addrp, p)
vn.v_type = VCHR; /* XXX */
vn.v_specinfo = &si; /* XXX */
vn.v_rdev = dev; /* XXX */
- error = vm_mmap(&p->p_vmspace->vm_map, (vm_offset_t *)addrp,
- (vm_size_t)len, VM_PROT_ALL, flags, (caddr_t)&vn, 0);
+ error = vm_mmap(&p->p_vmspace->vm_map, (vm_offset_t *)addrp,
+ (vm_size_t)len, VM_PROT_ALL, VM_PROT_ALL, flags,
+ (caddr_t)&vn, 0);
return(error);
}
diff --git a/sys/arch/amiga/dev/grf_cc.c b/sys/arch/amiga/dev/grf_cc.c
index 71c284974a8..e79097c4614 100644
--- a/sys/arch/amiga/dev/grf_cc.c
+++ b/sys/arch/amiga/dev/grf_cc.c
@@ -1,5 +1,3 @@
-/* $Id: grf_cc.c,v 1.3 1993/09/02 18:07:57 mw Exp $ */
-
#include "grf.h"
#if NGRF > 0
@@ -12,17 +10,8 @@
#include "grf_ccreg.h"
#include "../include/cpu.h"
#include "../amiga/custom.h"
-<<<<<<< grf_cc.c
-
-||||||| 1.1.1.2
-=======
#include "../amiga/cia.h"
->>>>>>> /tmp/T4009586
-<<<<<<< 1.1.1.2
-
-=======
->>>>>>> /tmp/T4009586
extern caddr_t CHIPMEMADDR;
extern caddr_t chipmem_steal ();
@@ -553,6 +542,28 @@ cc_vbl ()
if (!ccfb.beepTimer) custom.aud[0].vol = custom.aud[1].vol = 0;
}
+/* useful function for debugging.. */
+int
+amiga_mouse_button (num)
+ int num;
+{
+ switch (num)
+ {
+ case 1:
+ return ccfb.mouseb1;
+
+ case 2:
+ return ccfb.mouseb2;
+
+ case 3:
+ return ccfb.mouseb3;
+
+ default:
+ return 0;
+ }
+}
+
+
/* Initialize hardware.
* Must point g_display at a grfinfo structure describing the hardware.
* Returns 0 if hardware not present, non-zero ow.
@@ -749,3 +760,4 @@ cc_mode(gp, cmd, arg)
}
#endif
+
diff --git a/sys/arch/amiga/dev/grf_ccreg.h b/sys/arch/amiga/dev/grf_ccreg.h
index 7365616d897..d4105c35c41 100644
--- a/sys/arch/amiga/dev/grf_ccreg.h
+++ b/sys/arch/amiga/dev/grf_ccreg.h
@@ -1,7 +1,5 @@
/*
* Driver for custom chips display.
- *
- * $Id: grf_ccreg.h,v 1.3 1993/09/02 18:07:59 mw Exp $
*/
/* this is a mere collection of data, the registers itself are in the
@@ -185,10 +183,19 @@ struct ccfb {
#define DEF_SCREEN (60*5*60) /* 5 minutes */
/* these are the initial values for changeable parameters: */
+#ifdef BORING_DEFAULTS
#define DEF_DISP_WIDTH 640
#define DEF_DISP_HEIGHT 400
#define DEF_DISP_X 258 /* "" */
#define DEF_DISP_Y 88 /* hardware preferred values.. */
+#else
+/* these make use of possible overscan, giving you a much larger
+ console */
+#define DEF_DISP_WIDTH 704
+#define DEF_DISP_HEIGHT 464
+#define DEF_DISP_X 194
+#define DEF_DISP_Y 44
+#endif
#define DEF_FB_X 0
#define DEF_FB_Y 0
/* mtk: if it were up to me, I'd delete all of the above */
diff --git a/sys/arch/amiga/dev/grf_rt.c b/sys/arch/amiga/dev/grf_rt.c
index ca9eb2565e0..99ba11e43c9 100644
--- a/sys/arch/amiga/dev/grf_rt.c
+++ b/sys/arch/amiga/dev/grf_rt.c
@@ -114,8 +114,13 @@ unsigned char NCRStdPalette[16*3] = {
struct MonDef MON_768_600_80 = { 50000000, 24, 768, 600, 97,104,112,122,119, 601, 606, 616, 628, 628,
4, NCRStdPalette, 96, 75, 7200, 8, 8, kernel_font, 32, 255};
+#if 0
struct MonDef MON_1024_768_80 = { 90000000, 24, 1024, 768, 129,130,141,172,169, 769, 770, 783, 804, 804,
4, NCRStdPalette,128, 96, 12288, 8, 8, kernel_font, 32, 255};
+#else
+ struct MonDef MON_1024_768_80 = { 90000000, 0, 1024, 768, 257,258,278,321,320, 769, 770, 783, 804, 804,
+ 4, NCRStdPalette,128, 96, 12288, 8, 8, kernel_font, 32, 255};
+#endif
struct MonDef MON_1024_1024_59= { 90000000, 24, 1024,1024, 129,130,141,173,170,1025,1059,1076,1087,1087,
4, NCRStdPalette,128, 128, 16384, 8, 8, kernel_font, 32, 255};
@@ -150,9 +155,35 @@ struct MonDef monitor_defs[] = {
{ 50000000, 24, 768, 600, 97,104,112,122,119, 601, 606, 616, 628, 628,
4, NCRStdPalette, 96, 75, 7200, 8, 8, kernel_font, 32, 255},
+
+
{ 90000000, 24, 1024, 768, 129,130,141,172,169, 769, 770, 783, 804, 804,
4, NCRStdPalette,128, 96, 12288, 8, 8, kernel_font, 32, 255},
+ { 100000000, 24, 1024, 768, 129,130,141,172,169, 769, 770, 783, 804, 804,
+ 4, NCRStdPalette,128, 96, 12288, 8, 8, kernel_font, 32, 255},
+
+ { 110000000, 24, 1024, 768, 129,130,141,172,169, 769, 770, 783, 804, 804,
+ 4, NCRStdPalette,128, 96, 12288, 8, 8, kernel_font, 32, 255},
+
+ { 120000000, 24, 1024, 768, 129,130,141,172,169, 769, 770, 783, 804, 804,
+ 4, NCRStdPalette,128, 96, 12288, 8, 8, kernel_font, 32, 255},
+
+ { 13000000, 24, 1024, 768, 129,130,141,172,169, 769, 770, 783, 804, 804,
+ 4, NCRStdPalette,128, 96, 12288, 8, 8, kernel_font, 32, 255},
+
+ { 72000000, 24, 1024, 768, 129,130,141,172,169, 769, 770, 783, 804, 804,
+ 4, NCRStdPalette,128, 96, 12288, 8, 8, kernel_font, 32, 255},
+
+ { 75000000, 24, 1024, 768, 129,130,141,172,169, 769, 770, 783, 804, 804,
+ 4, NCRStdPalette,128, 96, 12288, 8, 8, kernel_font, 32, 255},
+
+
+
+
+ { 90000000, 24, 1024, 768, 129,130,139,161,160, 769, 770, 783, 804, 804,
+ 4, NCRStdPalette,128, 96, 12288, 8, 8, kernel_font, 32, 255},
+
{ 90000000, 24, 1024,1024, 129,130,141,173,170,1025,1059,1076,1087,1087,
4, NCRStdPalette,128, 128, 16384, 8, 8, kernel_font, 32, 255},
@@ -268,6 +299,10 @@ static int rt_load_mon (struct grf_softc *gp, struct MonDef *md)
/* hmm... */
fb[0x8000] = 0;
+ /* enable extension registers */
+ WSeq (ba, SEQ_ID_EXTENDED_ENABLE, 0x05);
+
+#if 0
/* program the clock oscillator */
vgaw (ba, GREG_MISC_OUTPUT_W, 0xe3 | ((clksel & 3) * 0x04));
vgaw (ba, GREG_FEATURE_CONTROL_W, 0x00);
@@ -285,9 +320,26 @@ static int rt_load_mon (struct grf_softc *gp, struct MonDef *md)
/* XXXX I think this order of setting RESET is wrong... */
WSeq (ba, SEQ_ID_RESET, 0x01);
WSeq (ba, SEQ_ID_RESET, 0x03);
+#else
+ WSeq (ba, SEQ_ID_RESET, 0x01);
+
+ /* set font width + rest of clocks */
+ WSeq (ba, SEQ_ID_EXT_CLOCK_MODE, 0x30 | (FW & 0x0f) | ((clksel & 4) / 4 * 0x40) );
+ /* another clock bit, plus hw stuff */
+ WSeq (ba, SEQ_ID_MISC_FEATURE_SEL, 0xf4 | (clksel & 8) );
+
+ /* program the clock oscillator */
+ vgaw (ba, GREG_MISC_OUTPUT_W, 0xe3 | ((clksel & 3) * 0x04));
+ vgaw (ba, GREG_FEATURE_CONTROL_W, 0x00);
+
+ WSeq (ba, SEQ_ID_CLOCKING_MODE, 0x01 | ((md->FLG & MDF_CLKDIV2)/ MDF_CLKDIV2 * 8));
+ WSeq (ba, SEQ_ID_MAP_MASK, 0x0f);
+ WSeq (ba, SEQ_ID_CHAR_MAP_SELECT, 0x00);
+ /* odd/even write select + extended memory */
+ WSeq (ba, SEQ_ID_MEMORY_MODE, 0x06);
+ WSeq (ba, SEQ_ID_RESET, 0x03);
+#endif
- /* enable extension registers *
- WSeq (ba, SEQ_ID_EXTENDED_ENABLE, 0x05);
/* monochrome cursor */
WSeq (ba, SEQ_ID_CURSOR_CONTROL, 0x00);
/* bank0 */
@@ -300,8 +352,10 @@ static int rt_load_mon (struct grf_softc *gp, struct MonDef *md)
WSeq (ba, SEQ_ID_SEC_HOST_OFF_LO, 0x00);
/* 1M-chips + ena SEC + ena EMem + rw PrimA0/rw Sec/B0 */
WSeq (ba, SEQ_ID_EXTENDED_MEM_ENA, 0x3 | 0x4 | 0x10 | 0x40);
+#if 0
/* set font width + rest of clocks */
WSeq (ba, SEQ_ID_EXT_CLOCK_MODE, 0x30 | (FW & 0x0f) | ((clksel & 4) / 4 * 0x40) );
+#endif
/* no ext-chain4 + no host-addr-bit-16 */
WSeq (ba, SEQ_ID_EXT_VIDEO_ADDR, 0x00);
/* no packed/nibble + no 256bit gfx format */
@@ -312,8 +366,10 @@ static int rt_load_mon (struct grf_softc *gp, struct MonDef *md)
WSeq (ba, SEQ_ID_COLOR_EXP_WFG, 0x01);
WSeq (ba, SEQ_ID_COLOR_EXP_WBG, 0x00);
WSeq (ba, SEQ_ID_EXT_RW_CONTROL, 0x00);
+#if 0
/* another clock bit, plus hw stuff */
WSeq (ba, SEQ_ID_MISC_FEATURE_SEL, 0xf4 | (clksel & 8) );
+#endif
/* don't tristate PCLK and PIX */
WSeq (ba, SEQ_ID_COLOR_KEY_CNTL, 0x40 );
/* reset CRC circuit */
diff --git a/sys/arch/amiga/dev/grf_tg.c b/sys/arch/amiga/dev/grf_tg.c
index 0fdfa403450..26595887155 100644
--- a/sys/arch/amiga/dev/grf_tg.c
+++ b/sys/arch/amiga/dev/grf_tg.c
@@ -1,5 +1,3 @@
-/* $Id: grf_tg.c,v 1.2 1993/08/02 18:33:34 mycroft Exp $ */
-
#include "errno.h"
/* to be written.. */
diff --git a/sys/arch/amiga/dev/grfioctl.h b/sys/arch/amiga/dev/grfioctl.h
index 8f89e53b95b..e046f395993 100644
--- a/sys/arch/amiga/dev/grfioctl.h
+++ b/sys/arch/amiga/dev/grfioctl.h
@@ -35,9 +35,9 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * from: Utah Hdr: grfioctl.h 1.1 90/07/09
- * from: @(#)grfioctl.h 7.2 (Berkeley) 11/4/90
- * $Id: grfioctl.h,v 1.3 1993/09/02 18:08:00 mw Exp $
+ * from: Utah $Hdr: grfioctl.h 1.1 90/07/09$
+ *
+ * @(#)grfioctl.h 7.2 (Berkeley) 11/4/90
*/
diff --git a/sys/arch/amiga/dev/grfvar.h b/sys/arch/amiga/dev/grfvar.h
index a4e847113ea..363f6a0266c 100644
--- a/sys/arch/amiga/dev/grfvar.h
+++ b/sys/arch/amiga/dev/grfvar.h
@@ -35,9 +35,9 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * from: Utah Hdr: grfvar.h 1.9 91/01/21
- * from: @(#)grfvar.h 7.3 (Berkeley) 5/7/91
- * $Id: grfvar.h,v 1.3 1993/09/02 18:08:01 mw Exp $
+ * from: Utah $Hdr: grfvar.h 1.9 91/01/21$
+ *
+ * @(#)grfvar.h 7.3 (Berkeley) 5/7/91
*/
/* internal structure of lock page */
diff --git a/sys/arch/amiga/dev/if_le.c b/sys/arch/amiga/dev/if_le.c
index 6cab3baae26..acba567ef0b 100644
--- a/sys/arch/amiga/dev/if_le.c
+++ b/sys/arch/amiga/dev/if_le.c
@@ -31,7 +31,7 @@
* SUCH DAMAGE.
*
* from: @(#)if_le.c 7.6 (Berkeley) 5/8/91
- * $Id: if_le.c,v 1.1.1.1 1993/09/02 16:53:07 mw Exp $
+ * $Id: if_le.c,v 1.2 1993/10/30 23:41:14 mw Exp $
*/
#include "le.h"
diff --git a/sys/arch/amiga/dev/if_lereg.h b/sys/arch/amiga/dev/if_lereg.h
index bb1ff5a96a7..d59158428ba 100644
--- a/sys/arch/amiga/dev/if_lereg.h
+++ b/sys/arch/amiga/dev/if_lereg.h
@@ -31,7 +31,7 @@
* SUCH DAMAGE.
*
* from: @(#)if_lereg.h 7.1 (Berkeley) 5/8/90
- * $Id: if_lereg.h,v 1.1.1.1 1993/09/02 16:53:40 mw Exp $
+ * $Id: if_lereg.h,v 1.2 1993/10/30 23:41:15 mw Exp $
*/
#define LEID 21
diff --git a/sys/arch/amiga/dev/ite.c b/sys/arch/amiga/dev/ite.c
index e0a8f7d9c04..5b58c56274a 100644
--- a/sys/arch/amiga/dev/ite.c
+++ b/sys/arch/amiga/dev/ite.c
@@ -35,19 +35,14 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * from: Utah Hdr: ite.c 1.1 90/07/09
+ * from: Utah $Hdr: ite.c 1.1 90/07/09$
+ *
* from: @(#)ite.c 7.6 (Berkeley) 5/16/91
-<<<<<<< ite.c
- * $Id: ite.c,v 1.3 1993/09/02 18:08:02 mw Exp $
-||||||| 1.1.1.2
- * $Id: ite.c,v 1.3 1993/09/02 18:08:02 mw Exp $
-=======
- * $Id: ite.c,v 1.3 1993/09/02 18:08:02 mw Exp $
+ * $Id: ite.c,v 1.4 1993/10/30 23:41:17 mw Exp $
*
* Original author: unknown
* Amiga author:: Markus Wild
* Other contributors: Bryan Ford (improved vt100 compability)
->>>>>>> /tmp/T4009622
*/
/*
@@ -253,26 +248,8 @@ iteinit(dev)
ip->cursorx = 0;
ip->cursory = 0;
(*itesw[ip->type].ite_init)(ip);
-<<<<<<< ite.c
- (*itesw[ip->type].ite_cursor)(ip, DRAW_CURSOR);
-||||||| 1.1.1.2
- (*itesw[ip->type].ite_cursor)(ip, DRAW_CURSOR);
-
- /* ip->rows initialized by ite_init above */
- ip->top_margin = 0; ip->bottom_margin = ip->rows - 1;
-=======
->>>>>>> /tmp/T4009622
-
-<<<<<<< ite.c
- /* ip->rows initialized by ite_init above */
- ip->top_margin = 0; ip->bottom_margin = ip->rows - 1;
- ip->attribute = 0;
-||||||| 1.1.1.2
- ip->attribute = 0;
-=======
#ifdef DO_WEIRD_ATTRIBUTES
->>>>>>> /tmp/T4009622
if (ip->attrbuf == NULL)
ip->attrbuf = (u_char *)
malloc(ip->rows * ip->cols, M_DEVBUF, M_WAITOK);
@@ -686,9 +663,9 @@ itefilter(c, caller)
}
- /* intercept Ctrl-LAlt-F1 here to switch back to original ascii-keymap.
+ /* intercept LAlt-LMeta-F1 here to switch back to original ascii-keymap.
this should probably be configurable.. */
- if (mod == (KBD_MOD_LALT|KBD_MOD_SHIFT) && code == 0x50)
+ if (mod == (KBD_MOD_LALT|KBD_MOD_LMETA) && c == 0x50)
{
bcopy (&ascii_kbdmap, &kbdmap, sizeof (struct kbdmap));
splx (s);
@@ -770,7 +747,8 @@ itefilter(c, caller)
}
/* if not string, apply META and CTRL modifiers */
- if (! (key.mode & KBD_MODE_STRING))
+ if (! (key.mode & KBD_MODE_STRING)
+ && (!(key.mode & KBD_MODE_KPAD) || !kbd_ip->keypad_appmode))
{
if (mod & KBD_MOD_CTRL)
code &= 0x1f;
@@ -778,12 +756,42 @@ itefilter(c, caller)
if (mod & KBD_MOD_META)
code |= 0x80;
}
+ else if ((key.mode & KBD_MODE_KPAD) && kbd_ip->keypad_appmode)
+ {
+ static char *in = "0123456789-+.\r()/*";
+ static char *out = "pqrstuvwxymlnMPQRS";
+ char *cp;
+
+ if (caller != ITEFILT_CONSOLE && (cp = index (in, code)))
+ {
+ /* keypad-appmode sends SS3 followed by the above translated
+ character */
+ itesendch (27); itesendch ('O');
+ itesendch (out[cp - in]);
+ splx (s);
+ return -1;
+ }
+ }
else
{
/* strings are only supported in normal tty mode, not in console mode */
if (caller != ITEFILT_CONSOLE)
{
+ /* *NO* I don't like this.... */
+ static u_char app_cursor[] = {
+ 3, 27, 'O', 'A',
+ 3, 27, 'O', 'B',
+ 3, 27, 'O', 'C',
+ 3, 27, 'O', 'D'};
+
str = kbdmap.strings + code;
+ /* if this is a cursor key, AND it has the default keymap setting,
+ AND we're in app-cursor mode, switch to the above table. This
+ is *nasty* ! */
+ if (c >= 0x4c && c <= 0x4f && kbd_ip->cursor_appmode
+ && !bcmp (str, "\x03\x1b[", 3) && index ("ABCD", str[3]))
+ str = app_cursor + 4 * (str[3] - 'A');
+
/* using a length-byte instead of 0-termination allows to embed \0 into
strings, although this is not used in the default keymap */
for (i = *str++; i; i--)
@@ -969,6 +977,11 @@ ite_dnline(ip, sp, n)
struct itesw *sp;
int n;
{
+ /* interesting.. if the cursor is outside the scrolling
+ region, this command is simply ignored.. */
+ if (ip->cury < ip->top_margin || ip->cury > ip->bottom_margin)
+ return;
+
n = MIN(n, ip->bottom_margin + 1 - ip->cury);
if (n <= ip->bottom_margin - ip->cury)
{
@@ -987,19 +1000,21 @@ ite_inline(ip, sp, n)
struct itesw *sp;
int n;
{
- if ((ip->cury >= ip->top_margin) && (ip->cury <= ip->bottom_margin))
+ /* interesting.. if the cursor is outside the scrolling
+ region, this command is simply ignored.. */
+ if (ip->cury < ip->top_margin || ip->cury > ip->bottom_margin)
+ return;
+
+ n = MIN(n, ip->bottom_margin + 1 - ip->cury);
+ if (n <= ip->bottom_margin - ip->cury)
{
- n = MIN(n, ip->bottom_margin + 1 - ip->cury);
- if (n <= ip->bottom_margin - ip->cury)
- {
- (*sp->ite_scroll)(ip, ip->cury, 0, n, SCROLL_DOWN);
- attrmov(ip, ip->cury, 0, ip->cury + n, 0,
- ip->bottom_margin + 1 - ip->cury - n, ip->cols);
- }
- (*sp->ite_clear)(ip, ip->cury, 0, n, ip->cols);
- attrclr(ip, ip->cury, 0, n, ip->cols);
- (*sp->ite_cursor)(ip, DRAW_CURSOR);
+ (*sp->ite_scroll)(ip, ip->cury, 0, n, SCROLL_DOWN);
+ attrmov(ip, ip->cury, 0, ip->cury + n, 0,
+ ip->bottom_margin + 1 - ip->cury - n, ip->cols);
}
+ (*sp->ite_clear)(ip, ip->cury, 0, n, ip->cols);
+ attrclr(ip, ip->cury, 0, n, ip->cols);
+ (*sp->ite_cursor)(ip, DRAW_CURSOR);
}
static void inline
@@ -1007,27 +1022,14 @@ ite_lf (ip, sp)
struct ite_softc *ip;
struct itesw *sp;
{
- if (ip->inside_margins)
- {
- ++ip->cury;
- if ((ip->cury == ip->bottom_margin+1) || (ip->cury == ip->rows))
- {
- ip->cury--;
- (*sp->ite_scroll)(ip, ip->top_margin + 1, 0, 1, SCROLL_UP);
- ite_clrline(ip, sp);
- }
- (*sp->ite_cursor)(ip, MOVE_CURSOR);
- }
- else
+ ++ip->cury;
+ if ((ip->cury == ip->bottom_margin+1) || (ip->cury == ip->rows))
{
- if (++ip->cury >= ip->rows)
- {
- ip->cury = ip->rows - 1;
- (*sp->ite_scroll)(ip, 1, 0, 1, SCROLL_UP);
- ite_clrline(ip, sp);
- }
- (*sp->ite_cursor)(ip, MOVE_CURSOR);
+ ip->cury--;
+ (*sp->ite_scroll)(ip, ip->top_margin + 1, 0, 1, SCROLL_UP);
+ ite_clrline(ip, sp);
}
+ (*sp->ite_cursor)(ip, MOVE_CURSOR);
clr_attr(ip, ATTR_INV);
}
@@ -1057,13 +1059,11 @@ ite_rlf (ip, sp)
struct ite_softc *ip;
struct itesw *sp;
{
- int top = ip->inside_margins ? ip->top_margin : 0;
-
ip->cury--;
- if ((ip->cury < 0) || (ip->cury == top-1))
+ if ((ip->cury < 0) || (ip->cury == ip->top_margin - 1))
{
ip->cury++;
- (*sp->ite_scroll)(ip, top, 0, 1, SCROLL_DOWN);
+ (*sp->ite_scroll)(ip, ip->top_margin, 0, 1, SCROLL_DOWN);
ite_clrline(ip, sp);
}
(*sp->ite_cursor)(ip, MOVE_CURSOR);
@@ -1156,7 +1156,7 @@ ite_reset(ip)
ip->emul_level = EMUL_VT300_7;
ip->eightbit_C1 = 0;
ip->top_margin = 0; ip->bottom_margin = ip->rows - 1;
- ip->inside_margins = 1;
+ ip->inside_margins = 0;
ip->linefeed_newline = 0;
ip->auto_wrap = 0;
ip->cursor_appmode = 0;
@@ -1442,6 +1442,7 @@ doesc:
case '8':
/* screen alignment pattern... */
+ alignment_display (ip, sp);
ip->escape = 0;
return;
@@ -1464,6 +1465,16 @@ doesc:
*ip->ap++ = c;
return;
+ case BS:
+ /* you wouldn't believe such perversion is possible?
+ it is.. BS is allowed in between cursor sequences
+ (at least), according to vttest.. */
+ if (--ip->curx < 0)
+ ip->curx = 0;
+ else
+ (*sp->ite_cursor)(ip, MOVE_CURSOR);
+ break;
+
case 'p':
*ip->ap = 0;
if (! strncmp (ip->argbuf, "61\"", 3))
@@ -1501,15 +1512,7 @@ doesc:
break;
}
ip->escape = 0;
-<<<<<<< ite.c
- return -1;
-||||||| 1.1.1.2
- return -1;
-
-=======
return;
->>>>>>> /tmp/T4009622
-
case 'n':
switch (ite_zargnum(ip))
@@ -1525,27 +1528,8 @@ doesc:
break;
}
ip->escape = 0;
-<<<<<<< ite.c
- return -1;
-
-||||||| 1.1.1.2
- return -1;
-=======
return;
->>>>>>> /tmp/T4009622
-
-<<<<<<< ite.c
- case 'h': case 'l':
- *ip->ap = 0;
- if (ip->ap == &ip->argbuf[1] && ip->argbuf[0] == '4')
- ip->imode = (c == 'h'); /* insert/replace mode */
-||||||| 1.1.1.2
- case 'h': case 'l':
- *ip->ap = 0;
- if (ip->ap == &ip->argbuf[1] && ip->argbuf[0] == '4')
- ip->imode = (c == 'h'); /* insert/replace mode */
-=======
case 'x':
switch (ite_zargnum(ip))
@@ -1560,7 +1544,6 @@ doesc:
}
ip->escape = 0;
return;
->>>>>>> /tmp/T4009622
case 'g':
@@ -1618,6 +1601,36 @@ doesc:
return;
+ case 'G':
+ /* this one was *not* in my vt320 manual but in
+ a vt320 termcap entry.. who is right?
+ It's supposed to set the horizontal cursor position. */
+ *ip->ap = 0;
+ x = atoi (ip->argbuf);
+ if (x) x--;
+ ip->curx = MIN(x, ip->cols - 1);
+ ip->escape = 0;
+ (*sp->ite_cursor)(ip, MOVE_CURSOR);
+ clr_attr (ip, ATTR_INV);
+ return;
+
+
+ case 'd':
+ /* same thing here, this one's for setting the absolute
+ vertical cursor position. Not documented... */
+ *ip->ap = 0;
+ y = atoi (ip->argbuf);
+ if (y) y--;
+ if (ip->inside_margins)
+ y += ip->top_margin;
+ ip->cury = MIN(y, ip->rows - 1);
+ ip->escape = 0;
+ snap_cury(ip, sp);
+ (*sp->ite_cursor)(ip, MOVE_CURSOR);
+ clr_attr (ip, ATTR_INV);
+ return;
+
+
case 'H':
case 'f':
*ip->ap = 0;
@@ -1628,6 +1641,8 @@ doesc:
x = atoi (cp + 1);
if (x) x--;
if (y) y--;
+ if (ip->inside_margins)
+ y += ip->top_margin;
ip->cury = MIN(y, ip->rows - 1);
ip->curx = MIN(x, ip->cols - 1);
ip->escape = 0;
@@ -1637,17 +1652,32 @@ doesc:
return;
case 'A':
- n = ip->cury - ite_argnum (ip);
+ n = ite_argnum (ip);
+ n = ip->cury - (n ? n : 1);
if (n < 0) n = 0;
- ip->cury = MAX(n, ip->inside_margins ? ip->top_margin : 0);
+ if (ip->inside_margins)
+ n = MAX(ip->top_margin, n);
+ else if (n == ip->top_margin - 1)
+ /* allow scrolling outside region, but don't scroll out
+ of active region without explicit CUP */
+ n = ip->top_margin;
+ ip->cury = n;
ip->escape = 0;
(*sp->ite_cursor)(ip, MOVE_CURSOR);
clr_attr (ip, ATTR_INV);
return;
case 'B':
- n = ite_argnum (ip) + ip->cury;
- ip->cury = MIN(n, ip->inside_margins ? ip->bottom_margin : ip->rows - 1);
+ n = ite_argnum (ip);
+ n = ip->cury + (n ? n : 1);
+ n = MIN(ip->rows - 1, n);
+ if (ip->inside_margins)
+ n = MIN(ip->bottom_margin, n);
+ else if (n == ip->bottom_margin + 1)
+ /* allow scrolling outside region, but don't scroll out
+ of active region without explicit CUP */
+ n = ip->bottom_margin;
+ ip->cury = n;
ip->escape = 0;
(*sp->ite_cursor)(ip, MOVE_CURSOR);
clr_attr (ip, ATTR_INV);
@@ -1655,6 +1685,7 @@ doesc:
case 'C':
n = ite_argnum (ip);
+ n = n ? n : 1;
ip->curx = MIN(ip->curx + n, ip->cols - 1);
ip->escape = 0;
(*sp->ite_cursor)(ip, MOVE_CURSOR);
@@ -1663,6 +1694,7 @@ doesc:
case 'D':
n = ite_argnum (ip);
+ n = n ? n : 1;
n = ip->curx - n;
ip->curx = n >= 0 ? n : 0;
ip->escape = 0;
@@ -1719,27 +1751,30 @@ doesc:
case 'r':
*ip->ap = 0;
x = atoi (ip->argbuf);
- y = 0;
+ x = x ? x : 1;
+ y = ip->rows;
cp = index (ip->argbuf, ';');
if (cp)
- y = atoi (cp + 1);
- if ((x > 0) || (y > 1))
{
- if (x) x--;
- if (y) y--;
- ip->top_margin = MIN(x, ip->rows - 1);
- ip->bottom_margin = MIN(y, ip->rows - 1);
- if (ip->bottom_margin < ip->top_margin)
- ip->bottom_margin = ip->top_margin;
+ y = atoi (cp + 1);
+ y = y ? y : ip->rows;
}
- else
+ if (y - x < 2)
{
- ip->top_margin = 0;
- ip->bottom_margin = ip->rows - 1;
+ /* if illegal scrolling region, reset to defaults */
+ x = 1;
+ y = ip->rows;
+ }
+ x--;
+ y--;
+ ip->top_margin = MIN(x, ip->rows - 1);
+ ip->bottom_margin = MIN(y, ip->rows - 1);
+ if (ip->inside_margins)
+ {
+ ip->cury = ip->top_margin;
+ ip->curx = 0;
+ (*sp->ite_cursor)(ip, MOVE_CURSOR);
}
- ip->cury = ip->top_margin;
- ip->curx = 0;
- (*sp->ite_cursor)(ip, MOVE_CURSOR);
ip->escape = 0;
return;
@@ -1892,6 +1927,9 @@ doesc:
case 6: /* origin mode */
ip->inside_margins = (c == 'h');
+ ip->curx = 0;
+ ip->cury = ip->inside_margins ? ip->top_margin : 0;
+ (*sp->ite_cursor)(ip, MOVE_CURSOR);
break;
case 7: /* auto wraparound */
diff --git a/sys/arch/amiga/dev/ite_cc.c b/sys/arch/amiga/dev/ite_cc.c
index b82b8cedcd7..37c41ba2981 100644
--- a/sys/arch/amiga/dev/ite_cc.c
+++ b/sys/arch/amiga/dev/ite_cc.c
@@ -1,5 +1,3 @@
-/* $Id: ite_cc.c,v 1.3 1993/09/02 18:08:03 mw Exp $ */
-
#include "ite.h"
#if NITE > 0
diff --git a/sys/arch/amiga/dev/ite_subr.c b/sys/arch/amiga/dev/ite_subr.c
new file mode 100644
index 00000000000..0039e8984ee
--- /dev/null
+++ b/sys/arch/amiga/dev/ite_subr.c
@@ -0,0 +1,137 @@
+/*
+ * Copyright (c) 1988 University of Utah.
+ * Copyright (c) 1990 The Regents of the University of California.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to Berkeley by
+ * the Systems Programming Group of the University of Utah Computer
+ * Science Department.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. All advertising materials mentioning features or use of this software
+ * must display the following acknowledgement:
+ * This product includes software developed by the University of
+ * California, Berkeley and its contributors.
+ * 4. Neither the name of the University nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ * from: Utah $Hdr: ite_subr.c 1.1 90/07/09$
+ *
+ * @(#)ite_subr.c 7.4 (Berkeley) 5/4/91
+ */
+
+#include "ite.h"
+#if NITE > 0
+
+#include "param.h"
+#include "conf.h"
+#include "proc.h"
+#include "ioctl.h"
+#include "tty.h"
+#include "systm.h"
+
+#include "itevar.h"
+#include "itereg.h"
+
+#include "machine/cpu.h"
+
+ite_devinfo(ip)
+ struct ite_softc *ip;
+{
+ struct fontinfo *fi;
+ struct font *fd;
+
+ fi = (struct fontinfo *) ((*FONTROM << 8 | *(FONTROM + 2)) + REGADDR);
+ fd = (struct font *) ((fi->haddr << 8 | fi->laddr) + REGADDR);
+
+ ip->ftheight = fd->fh;
+ ip->ftwidth = fd->fw;
+ ip->fbwidth = ITEREGS->fbwidth_h << 8 | ITEREGS->fbwidth_l;
+ ip->fbheight = ITEREGS->fbheight_h << 8 | ITEREGS->fbheight_l;
+ ip->dwidth = ITEREGS->dispwidth_h << 8 | ITEREGS->dispwidth_l;
+ ip->dheight = ITEREGS->dispheight_h << 8 | ITEREGS->dispheight_l;
+ ip->rows = ip->dheight / ip->ftheight;
+ ip->cols = ip->dwidth / ip->ftwidth;
+
+ if (ip->fbwidth > ip->dwidth) {
+ /*
+ * Stuff goes to right of display.
+ */
+ ip->fontx = ip->dwidth;
+ ip->fonty = 0;
+ ip->cpl = (ip->fbwidth - ip->dwidth) / ip->ftwidth;
+ ip->cblankx = ip->dwidth;
+ ip->cblanky = ip->fonty + ((128 / ip->cpl) +1) * ip->ftheight;
+ }
+ else {
+ /*
+ * Stuff goes below the display.
+ */
+ ip->fontx = 0;
+ ip->fonty = ip->dheight;
+ ip->cpl = ip->fbwidth / ip->ftwidth;
+ ip->cblankx = 0;
+ ip->cblanky = ip->fonty + ((128 / ip->cpl) + 1) * ip->ftheight;
+ }
+}
+
+ite_fontinit(ip)
+ register struct ite_softc *ip;
+{
+ struct fontinfo *fi;
+ struct font *fd;
+ register u_char *fbmem, *dp;
+ register int bn;
+ int c, l, b;
+
+ fi = (struct fontinfo *) ((*FONTROM << 8 | *(FONTROM + 2)) + REGADDR);
+ fd = (struct font *) ((fi->haddr << 8 | fi->laddr) + REGADDR);
+
+ dp = fd->data;
+
+ for (c = 0; c < 128; c++) {
+ fbmem = (u_char *) FBBASE +
+ (ip->fonty + (c / ip->cpl) * ip->ftheight) *
+ ip->fbwidth;
+ fbmem += ip->fontx + (c % ip->cpl) * ip->ftwidth;
+ for (l = 0; l < ip->ftheight; l++) {
+ bn = 7;
+ for (b = 0; b < ip->ftwidth; b++) {
+ if ((1 << bn) & *dp)
+ *fbmem++ = 1;
+ else
+ *fbmem++ = 0;
+ if (--bn < 0) {
+ bn = 7;
+ dp += 2;
+ }
+ }
+ if (bn < 7)
+ dp += 2;
+ fbmem -= ip->ftwidth;
+ fbmem += ip->fbwidth;
+ }
+ }
+
+}
+#endif
diff --git a/sys/arch/amiga/dev/ite_tg.c b/sys/arch/amiga/dev/ite_tg.c
index 4fea4b95331..8a1ce905b5f 100644
--- a/sys/arch/amiga/dev/ite_tg.c
+++ b/sys/arch/amiga/dev/ite_tg.c
@@ -1,5 +1,3 @@
-/* $Id: ite_tg.c,v 1.2 1993/08/02 18:33:35 mycroft Exp $ */
-
tiga_init ()
{
}
diff --git a/sys/arch/amiga/dev/iteioctl.h b/sys/arch/amiga/dev/iteioctl.h
index 52e121610f5..0be764efccd 100644
--- a/sys/arch/amiga/dev/iteioctl.h
+++ b/sys/arch/amiga/dev/iteioctl.h
@@ -35,9 +35,9 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * from: Utah Hdr: iteioctl.h 1.1 90/07/09
- * from: @(#)iteioctl.h 7.2 (Berkeley) 11/4/90
- * $Id: iteioctl.h,v 1.3 1993/09/02 18:08:04 mw Exp $
+ * from: Utah $Hdr: iteioctl.h 1.1 90/07/09$
+ *
+ * @(#)iteioctl.h 7.2 (Berkeley) 11/4/90
*/
#define ITESWITCH _IOW('Z',0x69, int) /* XXX */
diff --git a/sys/arch/amiga/dev/itevar.h b/sys/arch/amiga/dev/itevar.h
index d90bb3df0e8..f4c0dbf258e 100644
--- a/sys/arch/amiga/dev/itevar.h
+++ b/sys/arch/amiga/dev/itevar.h
@@ -35,9 +35,9 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * from: Utah Hdr: itevar.h 1.1 90/07/09
- * from: @(#)itevar.h 7.2 (Berkeley) 11/4/90
- * $Id: itevar.h,v 1.3 1993/09/02 18:08:05 mw Exp $
+ * from: Utah $Hdr: itevar.h 1.1 90/07/09$
+ *
+ * @(#)itevar.h 7.2 (Berkeley) 11/4/90
*/
#define UNIT(dev) minor(dev)
diff --git a/sys/arch/amiga/dev/kbd.c b/sys/arch/amiga/dev/kbd.c
index 5ffd84fab48..f168c2cab00 100644
--- a/sys/arch/amiga/dev/kbd.c
+++ b/sys/arch/amiga/dev/kbd.c
@@ -30,7 +30,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: kbd.c,v 1.3 1993/09/02 18:08:06 mw Exp $
+ * kbd.c
*/
#include "ite.h"
diff --git a/sys/arch/amiga/dev/kbdmap.c b/sys/arch/amiga/dev/kbdmap.c
index 98e3f9b26bf..0cddcc720c3 100644
--- a/sys/arch/amiga/dev/kbdmap.c
+++ b/sys/arch/amiga/dev/kbdmap.c
@@ -1,5 +1,3 @@
-/* $Id: kbdmap.c,v 1.3 1993/09/02 18:08:07 mw Exp $ */
-
#include "kbdmap.h"
/* define a default keymap. This can be changed by keyboard ioctl's
diff --git a/sys/arch/amiga/dev/kbdmap.h b/sys/arch/amiga/dev/kbdmap.h
index bd031300775..89a4ee2690b 100644
--- a/sys/arch/amiga/dev/kbdmap.h
+++ b/sys/arch/amiga/dev/kbdmap.h
@@ -1,5 +1,3 @@
-/* $Id: kbdmap.h,v 1.3 1993/09/02 18:08:08 mw Exp $ */
-
#define NUL 0
#define SOH 1
#define STX 2
diff --git a/sys/arch/amiga/dev/kbdreg.h b/sys/arch/amiga/dev/kbdreg.h
index c3b780fb789..07d973a4e8f 100644
--- a/sys/arch/amiga/dev/kbdreg.h
+++ b/sys/arch/amiga/dev/kbdreg.h
@@ -30,8 +30,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * from: @(#)dcareg.h 7.3 (Berkeley) 5/7/91
- * $Id: kbdreg.h,v 1.2 1993/08/01 19:23:13 mycroft Exp $
+ * @(#)dcareg.h 7.3 (Berkeley) 5/7/91
*/
struct kbddevice {
diff --git a/sys/arch/amiga/dev/kernel_font.c.distrib b/sys/arch/amiga/dev/kernel_font.c.distrib
index b2beb853049..46b3269e1df 100644
--- a/sys/arch/amiga/dev/kernel_font.c.distrib
+++ b/sys/arch/amiga/dev/kernel_font.c.distrib
@@ -13,13 +13,9 @@
* 3-Sep-90 Alessandro Forin (af) at Carnegie-Mellon University
* Created.
* $Log: kernel_font.c.distrib,v $
- * Revision 1.1.1.1 1993/07/05 19:19:48 mw
- * sys/arch/amiga tree. This is the machdep part required to get the kernel
- * up on an A3000. There are still (very) few changes required outside the
- * arch/amiga tree, so you can't recompile the kernel yet. Support for
- * third party SCSI controllers for the A2000 is on its way. The kernel is
- * fully functional (except for a missing ethernet-driver ...). This
- * tree is based on my version #390.
+ * Revision 1.2 1993/10/30 23:41:27 mw
+ * new tree for amiga, replacing the bogous previous one.
+ * SunOS support works for a lot of executables now (static and dynamic).
*
* Revision 2.6 91/06/19 11:46:19 rvb
* File moved here from mips/PMAX since it tries to be generic;
diff --git a/sys/arch/amiga/dev/par.c b/sys/arch/amiga/dev/par.c
index e89360e9f62..ae248f96398 100644
--- a/sys/arch/amiga/dev/par.c
+++ b/sys/arch/amiga/dev/par.c
@@ -31,27 +31,29 @@
* SUCH DAMAGE.
*
* from: @(#)ppi.c 7.3 (Berkeley) 12/16/90
- * $Id: par.c,v 1.1.1.1 1993/09/02 16:53:41 mw Exp $
+ * $Id: par.c,v 1.2 1993/10/30 23:41:28 mw Exp $
*/
/*
* parallel port interface
-
- XXXX NOT YET WORKING XXXXX
*/
-#include "ppi.h"
+#include "par.h"
#if NPAR > 0
#include "sys/param.h"
#include "sys/errno.h"
#include "sys/uio.h"
#include "sys/malloc.h"
+#include "sys/file.h"
+#include "sys/systm.h"
#include "device.h"
#include "parioctl.h"
+#include "../amiga/cia.h"
-int parattach(), parstart(), partimo(), parintr();
+int parattach(), parstart(), partimo();
+void parintr();
struct driver pardriver = {
parattach, "par", parstart,
};
@@ -63,7 +65,7 @@ struct par_softc {
#define sc_burst sc_param.burst
#define sc_timo sc_param.timo
#define sc_delay sc_param.delay
-} par_softc[NPPI];
+} par_softc[NPAR];
/* sc_flags values */
#define PARF_ALIVE 0x01
@@ -77,9 +79,10 @@ struct par_softc {
#define UNIT(x) minor(x)
#ifdef DEBUG
-int pardebug = 0x80;
+int pardebug = 0;
#define PDB_FOLLOW 0x01
#define PDB_IO 0x02
+#define PDB_INTERRUPT 0x04
#define PDB_NOCHECK 0x80
#endif
@@ -106,8 +109,13 @@ paropen(dev, flags)
return(ENXIO);
#ifdef DEBUG
if (pardebug & PDB_FOLLOW)
- printf("paropen(%x, %x): flags %x\n",
- dev, flags, sc->sc_flags);
+ {
+ printf("paropen(%x, %x): flags %x, ",
+ dev, flags, sc->sc_flags);
+ printf ("port = $%x\n",
+ ((ciab.pra ^ CIAB_PRA_SEL)
+ & (CIAB_PRA_SEL|CIAB_PRA_BUSY|CIAB_PRA_POUT)));
+ }
#endif
if (sc->sc_flags & PARF_OPEN)
return(EBUSY);
@@ -203,7 +211,7 @@ parrw(dev, uio)
int buflen;
char *buf;
- if ((sc->sc_flags & PARF_OREAD) ^^ (uio->uio_rw == UIO_READ))
+ if (!!(sc->sc_flags & PARF_OREAD) ^ (uio->uio_rw == UIO_READ))
return EINVAL;
if (uio->uio_resid == 0)
@@ -218,132 +226,151 @@ parrw(dev, uio)
buflen = MIN(sc->sc_burst, uio->uio_resid);
buf = (char *)malloc(buflen, M_DEVBUF, M_WAITOK);
sc->sc_flags |= PARF_UIO;
- if (sc->sc_timo > 0) {
- sc->sc_flags |= PARF_TIMO;
- timeout(partimo, unit, sc->sc_timo);
- }
- while (uio->uio_resid > 0) {
- len = MIN(buflen, uio->uio_resid);
- cp = buf;
- if (uio->uio_rw == UIO_WRITE) {
- error = uiomove(cp, len, uio);
- if (error)
- break;
+ if (sc->sc_timo > 0)
+ {
+ sc->sc_flags |= PARF_TIMO;
+ timeout(partimo, unit, sc->sc_timo);
}
- again:
- s = splbio();
+ while (uio->uio_resid > 0)
+ {
+ len = MIN(buflen, uio->uio_resid);
+ cp = buf;
+ if (uio->uio_rw == UIO_WRITE)
+ {
+ error = uiomove(cp, len, uio);
+ if (error)
+ break;
+ }
+again:
+ s = splbio();
#if 0
- if ((sc->sc_flags & PARF_UIO) && hpibreq(&sc->sc_dq) == 0)
- sleep(sc, PRIBIO+1);
+ if ((sc->sc_flags & PARF_UIO) && hpibreq(&sc->sc_dq) == 0)
+ sleep(sc, PRIBIO+1);
#endif
- /*
- * Check if we timed out during sleep or uiomove
- */
- (void) splsoftclock();
- if ((sc->sc_flags & PARF_UIO) == 0) {
+ /*
+ * Check if we timed out during sleep or uiomove
+ */
+ (void) splsoftclock();
+ if ((sc->sc_flags & PARF_UIO) == 0)
+ {
#ifdef DEBUG
- if (pardebug & PDB_IO)
- printf("parrw: uiomove/sleep timo, flags %x\n",
- sc->sc_flags);
+ if (pardebug & PDB_IO)
+ printf("parrw: uiomove/sleep timo, flags %x\n",
+ sc->sc_flags);
#endif
- if (sc->sc_flags & PARF_TIMO) {
- untimeout(partimo, unit);
- sc->sc_flags &= ~PARF_TIMO;
- }
+ if (sc->sc_flags & PARF_TIMO)
+ {
+ untimeout(partimo, unit);
+ sc->sc_flags &= ~PARF_TIMO;
+ }
+ splx(s);
+ break;
+ }
splx(s);
- break;
- }
- splx(s);
- /*
- * Perform the operation
- */
- if (uio->uio_rw == UIO_WRITE)
- cnt = hpibsend(sc->sc_ad->amiga_ctlr, sc->sc_ad->amiga_slave,
- sc->sc_sec, cp, len);
- else
- cnt = hpibrecv(sc->sc_ad->amiga_ctlr, sc->sc_ad->amiga_slave,
- sc->sc_sec, cp, len);
- s = splbio();
- hpibfree(&sc->sc_dq);
+ /*
+ * Perform the operation
+ */
+ if (uio->uio_rw == UIO_WRITE)
+ cnt = parsend (cp, len);
+ else
+ cnt = parreceive (cp, len);
+
+ if (cnt < 0)
+ {
+ error = -cnt;
+ break;
+ }
+
+ s = splbio();
+#if 0
+ hpibfree(&sc->sc_dq);
+#endif
#ifdef DEBUG
- if (pardebug & PDB_IO)
- printf("parrw: %s(%d, %d, %x, %x, %d) -> %d\n",
- uio->uio_rw == UIO_READ ? "recv" : "send",
- sc->sc_ad->amiga_ctlr, sc->sc_ad->amiga_slave,
- sc->sc_sec, cp, len, cnt);
+ if (pardebug & PDB_IO)
+ printf("parrw: %s(%x, %d) -> %d\n",
+ uio->uio_rw == UIO_READ ? "recv" : "send", cp, len, cnt);
#endif
- splx(s);
- if (uio->uio_rw == UIO_READ) {
- if (cnt) {
- error = uiomove(cp, cnt, uio);
- if (error)
- break;
- gotdata++;
- }
+ splx(s);
+ if (uio->uio_rw == UIO_READ)
+ {
+ if (cnt)
+ {
+ error = uiomove(cp, cnt, uio);
+ if (error)
+ break;
+ gotdata++;
+ }
+ /*
+ * Didn't get anything this time, but did in the past.
+ * Consider us done.
+ */
+ else if (gotdata)
+ break;
+ }
+ s = splsoftclock();
/*
- * Didn't get anything this time, but did in the past.
- * Consider us done.
+ * Operation timeout (or non-blocking), quit now.
*/
- else if (gotdata)
- break;
- }
- s = splsoftclock();
- /*
- * Operation timeout (or non-blocking), quit now.
- */
- if ((sc->sc_flags & PARF_UIO) == 0) {
+ if ((sc->sc_flags & PARF_UIO) == 0)
+ {
#ifdef DEBUG
- if (pardebug & PDB_IO)
- printf("parrw: timeout/done\n");
+ if (pardebug & PDB_IO)
+ printf("parrw: timeout/done\n");
#endif
+ splx(s);
+ break;
+ }
+ /*
+ * Implement inter-read delay
+ */
+ if (sc->sc_delay > 0)
+ {
+ sc->sc_flags |= PARF_DELAY;
+ timeout(parstart, unit, sc->sc_delay);
+ error = tsleep(sc, PCATCH|PZERO-1, "par-cdelay", 0);
+ if (error)
+ {
+ splx(s);
+ break;
+ }
+ }
splx(s);
- break;
+ /*
+ * Must not call uiomove again til we've used all data
+ * that we already grabbed.
+ */
+ if (uio->uio_rw == UIO_WRITE && cnt != len)
+ {
+ cp += cnt;
+ len -= cnt;
+ cnt = 0;
+ goto again;
+ }
}
- /*
- * Implement inter-read delay
- */
- if (sc->sc_delay > 0) {
- sc->sc_flags |= PARF_DELAY;
- timeout(parstart, unit, sc->sc_delay);
- error = tsleep(sc, PCATCH|PZERO-1, "par-cdelay", 0);
- if (error) {
- splx(s);
- break;
- }
+ s = splsoftclock();
+ if (sc->sc_flags & PARF_TIMO)
+ {
+ untimeout(partimo, unit);
+ sc->sc_flags &= ~PARF_TIMO;
}
- splx(s);
- /*
- * Must not call uiomove again til we've used all data
- * that we already grabbed.
- */
- if (uio->uio_rw == UIO_WRITE && cnt != len) {
- cp += cnt;
- len -= cnt;
- cnt = 0;
- goto again;
+ if (sc->sc_flags & PARF_DELAY)
+ {
+ untimeout(parstart, unit);
+ sc->sc_flags &= ~PARF_DELAY;
}
- }
- s = splsoftclock();
- if (sc->sc_flags & PARF_TIMO) {
- untimeout(partimo, unit);
- sc->sc_flags &= ~PARF_TIMO;
- }
- if (sc->sc_flags & PARF_DELAY) {
- untimeout(parstart, unit);
- sc->sc_flags &= ~PARF_DELAY;
- }
splx(s);
/*
* Adjust for those chars that we uiomove'ed but never wrote
*/
- if (uio->uio_rw == UIO_WRITE && cnt != len) {
- uio->uio_resid += (len - cnt);
+ if (uio->uio_rw == UIO_WRITE && cnt != len)
+ {
+ uio->uio_resid += (len - cnt);
#ifdef DEBUG
- if (pardebug & PDB_IO)
- printf("parrw: short write, adjust by %d\n",
- len-cnt);
+ if (pardebug & PDB_IO)
+ printf("parrw: short write, adjust by %d\n",
+ len-cnt);
#endif
- }
+ }
free(buf, M_DEVBUF);
#ifdef DEBUG
if (pardebug & (PDB_FOLLOW|PDB_IO))
@@ -352,42 +379,47 @@ parrw(dev, uio)
return (error);
}
+int
parioctl(dev, cmd, data, flag)
-dev_t dev;
-int cmd;
-caddr_t data;
-int flag;
+ dev_t dev;
+ int cmd;
+ caddr_t data;
+ int flag;
{
struct par_softc *sc = &par_softc[UNIT(dev)];
struct parparam *pp, *upp;
int error = 0;
- switch (cmd) {
- case PARIOCGPARAM:
- pp = &sc->sc_param;
- upp = (struct parparam *)data;
- upp->burst = pp->burst;
- upp->timo = parhztoms(pp->timo);
- upp->delay = parhztoms(pp->delay);
- break;
- case PARIOCSPARAM:
- pp = &sc->sc_param;
- upp = (struct parparam *)data;
- if (upp->burst < PAR_BURST_MIN || upp->burst > PAR_BURST_MAX ||
- upp->delay < PAR_DELAY_MIN || upp->delay > PAR_DELAY_MAX)
+ switch (cmd)
+ {
+ case PARIOCGPARAM:
+ pp = &sc->sc_param;
+ upp = (struct parparam *)data;
+ upp->burst = pp->burst;
+ upp->timo = parhztoms(pp->timo);
+ upp->delay = parhztoms(pp->delay);
+ break;
+
+ case PARIOCSPARAM:
+ pp = &sc->sc_param;
+ upp = (struct parparam *)data;
+ if (upp->burst < PAR_BURST_MIN || upp->burst > PAR_BURST_MAX ||
+ upp->delay < PAR_DELAY_MIN || upp->delay > PAR_DELAY_MAX)
+ return(EINVAL);
+ pp->burst = upp->burst;
+ pp->timo = parmstohz(upp->timo);
+ pp->delay = parmstohz(upp->delay);
+ break;
+
+ default:
return(EINVAL);
- pp->burst = upp->burst;
- pp->timo = parmstohz(upp->timo);
- pp->delay = parmstohz(upp->delay);
- break;
- default:
- return(EINVAL);
- }
+ }
return (error);
}
+int
parhztoms(h)
-int h;
+ int h;
{
extern int hz;
register int m = h;
@@ -397,8 +429,9 @@ int h;
return(m);
}
+int
parmstohz(m)
-int m;
+ int m;
{
extern int hz;
register int h = m;
@@ -411,18 +444,107 @@ int m;
return(h);
}
+/* stuff below here if for interrupt driven output of data thru
+ the parallel port. */
+
+int partimeout_pending;
+int parsend_pending;
+
void
parintr (mask)
int mask;
{
+ int s = splclock();
+#ifdef DEBUG
+ if (pardebug & PDB_INTERRUPT)
+ printf ("parintr %s\n", mask ? "FLG" : "tout");
+#endif
+ /* if invoked from timeout handler, mask will be 0, if from
+ interrupt, it will contain the cia-icr mask, which is != 0 */
+ if (mask)
+ {
+ if (partimeout_pending)
+ untimeout ((timeout_t) parintr, 0);
+ if (parsend_pending)
+ parsend_pending = 0;
+ }
+
+ /* either way, there won't be a timeout pending any longer */
+ partimeout_pending = 0;
+
wakeup (parintr);
+ splx (s);
+}
+
+int
+parsendch (ch)
+ u_char ch;
+{
+ int error = 0;
+ int s;
+
+ /* if either offline, busy or out of paper, wait for that
+ condition to clear */
+ s = splclock();
+ while (!error
+ && (parsend_pending
+ || ((ciab.pra ^ CIAB_PRA_SEL)
+ & (CIAB_PRA_SEL|CIAB_PRA_BUSY|CIAB_PRA_POUT))))
+ {
+ extern int hz;
+
+#ifdef DEBUG
+ if (pardebug & PDB_INTERRUPT)
+ printf ("parsendch, port = $%x\n",
+ ((ciab.pra ^ CIAB_PRA_SEL)
+ & (CIAB_PRA_SEL|CIAB_PRA_BUSY|CIAB_PRA_POUT)));
+#endif
+ /* wait a second, and try again */
+ timeout ((timeout_t) parintr, 0, hz);
+ partimeout_pending = 1;
+ /* this is essentially a flipflop to have us wait for the
+ first character being transmitted when trying to transmit
+ the second, etc. */
+ parsend_pending = 0;
+ /* it's quite important that a parallel putc can be
+ interrupted, given the possibility to lock a printer
+ in an offline condition.. */
+ if (error = tsleep (parintr, PCATCH|PZERO-1, "parsendch", 0))
+ {
+#ifdef DEBUG
+ if (pardebug & PDB_INTERRUPT)
+ printf ("parsendch interrupted, error = %d\n", error);
+#endif
+ if (partimeout_pending)
+ untimeout ((timeout_t) parintr, 0);
+
+ partimeout_pending = 0;
+ }
+ }
+
+ if (! error)
+ {
+#ifdef DEBUG
+ if (pardebug & PDB_INTERRUPT)
+ printf ("#%d", ch);
+#endif
+ ciaa.prb = ch;
+ parsend_pending = 1;
+ }
+
+ splx (s);
+
+ return error;
}
+
int
parsend (buf, len)
u_char *buf;
int len;
{
+ int err, orig_len = len;
+
/* make sure I/O lines are setup right for output */
/* control lines set to input */
@@ -430,15 +552,25 @@ parsend (buf, len)
/* data lines to output */
ciaa.ddrb = 0xff;
- while (len)
- {
-
- }
-}
+ for (; len; len--, buf++)
+ if (err = parsendch (*buf))
+ return err < 0 ? -EINTR : -err;
+ /* either all or nothing.. */
+ return orig_len;
+}
+int
+parreceive (buf, len)
+ u_char *buf;
+ int len;
+{
+ /* oh deary me, something's gotta be left to be implemented
+ later... */
+ return 0;
+}
#endif
diff --git a/sys/arch/amiga/dev/parioctl.h b/sys/arch/amiga/dev/parioctl.h
index 63cff93f7b3..8707073f95f 100644
--- a/sys/arch/amiga/dev/parioctl.h
+++ b/sys/arch/amiga/dev/parioctl.h
@@ -31,7 +31,7 @@
* SUCH DAMAGE.
*
* from: @(#)ppiioctl.h 7.2 (Berkeley) 12/16/90
- * $Id: parioctl.h,v 1.1.1.1 1993/09/02 16:53:41 mw Exp $
+ * $Id: parioctl.h,v 1.2 1993/10/30 23:41:29 mw Exp $
*/
#ifndef _IOCTL_
diff --git a/sys/arch/amiga/dev/rdb.h b/sys/arch/amiga/dev/rdb.h
index 2f1206cd18a..b6b7f4e09f1 100644
--- a/sys/arch/amiga/dev/rdb.h
+++ b/sys/arch/amiga/dev/rdb.h
@@ -1,5 +1,3 @@
-/* $Id: rdb.h,v 1.2 1993/08/02 18:33:40 mycroft Exp $ */
-
#ifndef _amiga_rdb_h
#define _amiga_rdb_h
diff --git a/sys/arch/amiga/dev/retina-mondefs.c b/sys/arch/amiga/dev/retina-mondefs.c
new file mode 100644
index 00000000000..e812970186a
--- /dev/null
+++ b/sys/arch/amiga/dev/retina-mondefs.c
@@ -0,0 +1,196 @@
+static struct MonDef monitor_defs[] = {
+ /* FQ, FLG, MW, MH
+ HBS, HSS, HSE, HBE, HT, VBS, VSS, VSE, VBE, VT
+ Depth, PAL, TX, TY, XY, FX, FY, FontData, FLo, FHi*/
+
+ /* 80x50 (640x400) 31.5kHz 60Hz */
+ { 28322000, 16, 640, 400,
+ 80, 91, 99, 110, 110, 401, 445, 504, 522, 522,
+ 4, NCRStdPalette, 80, 50, 4000, 8, 8, kernel_font, 32, 255 },
+
+ /* 80x50 (640x400) 35.0kHz 72Hz */
+ { 63000000, 16, 640, 400,
+ 80, 89, 98, 110, 110, 401, 411, 483, 483, 483,
+ 4, NCRStdPalette, 80, 50, 4000, 8, 8, kernel_font, 32, 255 },
+
+ /* 80x50 (640x400) 37.1kHz 69Hz */
+ { 65000000, 16, 640, 400,
+ 80, 88, 94, 107, 107, 401, 411, 530, 530, 530,
+ 4, NCRStdPalette, 80, 50, 4000, 8, 8, kernel_font, 32, 255 },
+
+ /* 100x75 (800x600) 31.5kHz 50Hz */
+ { 80000000, 16, 800, 600,
+ 100, 113, 148, 156, 156, 601, 602, 612, 628, 628,
+ 4, NCRStdPalette, 100, 75, 7500, 8, 8, kernel_font, 32, 255 },
+
+ /* 100x75 (800x600) 35.0kHz 57Hz */
+ { 75000000, 16, 800, 600,
+ 100, 110, 120, 132, 131, 601, 602, 603, 603, 603,
+ 4, NCRStdPalette, 100, 75, 7500, 8, 8, kernel_font, 32, 255 },
+
+ /* 100x75 (800x600) 37.2kHz 60Hz */
+ { 80000000, 16, 800, 600,
+ 100, 110, 121, 132, 132, 601, 603, 613, 613, 613,
+ 4, NCRStdPalette, 100, 75, 7500, 8, 8, kernel_font, 32, 255 },
+
+ /* 100x75 (800x600) 57.1kHz 90Hz */
+ { 56644000, 16, 800, 600,
+ 100, 106, 107, 122, 121, 601, 607, 617, 629, 629,
+ 4, NCRStdPalette, 100, 75, 7500, 8, 8, kernel_font, 32, 255 },
+
+ /* 128x96 (1024x768) 31.5kHz 78Hz interlace */
+ { 80000000, 22, 1024, 768,
+ 128, 134, 140, 156, 156, 385, 385, 386, 401, 401,
+ 4, NCRStdPalette, 128, 96, 12288, 8, 8, kernel_font, 32, 255 },
+
+ /* 128x96 (1024x768) 35.0kHz 86Hz interlace */
+ { 90000000, 22, 1024, 768,
+ 128, 135, 143, 158, 158, 385, 385, 386, 401, 401,
+ 4, NCRStdPalette, 128, 96, 12288, 8, 8, kernel_font, 32, 255 },
+
+ /* 128x96 (1024x768) 38.1kHz 89Hz interlace */
+ { 50000000, 18, 1024, 768,
+ 128, 135, 146, 162, 161, 385, 399, 400, 423, 423,
+ 4, NCRStdPalette, 128, 96, 12288, 8, 8, kernel_font, 32, 255 },
+
+ /* 128x96 (1024x768) 57.0kHz 71Hz */
+ { 75000000, 16, 1024, 768,
+ 128, 129, 141, 162, 162, 769, 770, 771, 798, 798,
+ 4, NCRStdPalette, 128, 96, 12288, 8, 8, kernel_font, 32, 255 },
+
+ /* 128x96 (1024x768) 71.2kHz 85Hz */
+ { 90000000, 16, 1024, 768,
+ 128, 136, 141, 156, 155, 769, 793, 806, 832, 832,
+ 4, NCRStdPalette, 128, 96, 12288, 8, 8, kernel_font, 32, 255 },
+
+ /* 80x100 (640x800) 31.9kHz 75Hz interlace */
+ { 28322000, 18, 640, 800,
+ 80, 81, 88, 109, 108, 401, 402, 409, 418, 418,
+ 4, NCRStdPalette, 80, 100, 8000, 8, 8, kernel_font, 32, 255 },
+
+ /* 80x100 (640x800) 35.5kHz 84Hz interlace */
+ { 63000000, 22, 640, 800,
+ 80, 81, 88, 109, 108, 401, 402, 409, 418, 418,
+ 4, NCRStdPalette, 80, 100, 8000, 8, 8, kernel_font, 32, 255 },
+
+ /* 80x50 (640x400) 36.6kHz 87Hz */
+ { 65000000, 16, 640, 400,
+ 80, 88, 95, 109, 108, 401, 402, 409, 418, 418,
+ 4, NCRStdPalette, 80, 50, 4000, 8, 8, kernel_font, 32, 255 },
+
+ /* 96x64 (768x512) 36.9kHz 68Hz */
+ { 36000000, 16, 768, 512,
+ 96, 103, 111, 120, 119, 513, 521, 529, 535, 535,
+ 4, NCRStdPalette, 96, 64, 6144, 8, 8, kernel_font, 32, 255 },
+
+ /* 96x64 (768x512) 38.4kHz 71Hz */
+ { 75000000, 16, 768, 512,
+ 96, 103, 111, 120, 119, 513, 521, 529, 535, 535,
+ 4, NCRStdPalette, 96, 64, 6144, 8, 8, kernel_font, 32, 255 },
+
+ /* 96x64 (768x512) 41.0kHz 76Hz */
+ { 80000000, 16, 768, 512,
+ 96, 103, 111, 120, 119, 513, 521, 529, 535, 535,
+ 4, NCRStdPalette, 96, 64, 6144, 8, 8, kernel_font, 32, 255 },
+
+ /* 96x64 (768x512) 46.0kHz 85Hz */
+ { 44900000, 16, 768, 512,
+ 96, 103, 110, 120, 119, 513, 522, 530, 535, 535,
+ 4, NCRStdPalette, 96, 64, 6144, 8, 8, kernel_font, 32, 255 },
+
+ /* 96x64 (768x512) 46.1kHz 85Hz */
+ { 90000000, 16, 768, 512,
+ 96, 103, 110, 120, 119, 513, 522, 530, 535, 535,
+ 4, NCRStdPalette, 96, 64, 6144, 8, 8, kernel_font, 32, 255 },
+
+ /* 100x75 (800x600) 47.3kHz 75Hz */
+ { 50000000, 16, 800, 600,
+ 100, 108, 116, 130, 129, 601, 602, 612, 628, 628,
+ 4, NCRStdPalette, 100, 75, 7500, 8, 8, kernel_font, 32, 255 },
+
+ /* 100x75 (800x600) 53.6kHz 85Hz */
+ { 56644000, 16, 800, 600,
+ 100, 109, 118, 130, 129, 601, 602, 612, 628, 628,
+ 4, NCRStdPalette, 100, 75, 7500, 8, 8, kernel_font, 32, 255 },
+
+ /* 128x96 (1024x768) 48.5kHz 60Hz */
+ { 63000000, 16, 1024, 768,
+ 128, 129, 139, 160, 160, 769, 774, 787, 805, 805,
+ 4, NCRStdPalette, 128, 96, 12288, 8, 8, kernel_font, 32, 255 },
+
+ /* 128x96 (1024x768) 50.0kHz 61Hz */
+ { 65000000, 16, 1024, 768,
+ 128, 129, 139, 160, 160, 769, 774, 787, 805, 805,
+ 4, NCRStdPalette, 128, 96, 12288, 8, 8, kernel_font, 32, 255 },
+
+ /* 128x96 (1024x768) 55.4kHz 68Hz */
+ { 72000000, 16, 1024, 768,
+ 128, 137, 147, 160, 160, 769, 785, 798, 805, 805,
+ 4, NCRStdPalette, 128, 96, 12288, 8, 8, kernel_font, 32, 255 },
+
+ /* 128x96 (1024x768) 57.7kHz 71Hz */
+ { 75000000, 16, 1024, 768,
+ 128, 128, 138, 160, 160, 769, 780, 793, 805, 805,
+ 4, NCRStdPalette, 128, 96, 12288, 8, 8, kernel_font, 32, 255 },
+
+ /* 128x96 (1024x768) 61.5kHz 76Hz */
+ { 80000000, 16, 1024, 768,
+ 128, 131, 141, 160, 160, 769, 780, 793, 805, 805,
+ 4, NCRStdPalette, 128, 96, 12288, 8, 8, kernel_font, 32, 255 },
+
+ /* 128x96 (1024x768) 69.2kHz 85Hz */
+ { 90000000, 16, 1024, 768,
+ 128, 138, 148, 160, 160, 769, 780, 793, 805, 805,
+ 4, NCRStdPalette, 128, 96, 12288, 8, 8, kernel_font, 32, 255 },
+
+ /* 128x128 (1024x1024) 71.8kHz 66Hz ***EXCEEDS CHIP LIMIT!!!*** */
+ { 100000000, 16, 1024, 1024,
+ 128, 129, 140, 172, 171, 1025, 1026, 1043, 1073, 1073,
+ 4, NCRStdPalette, 128, 128, 16384, 8, 8, kernel_font, 32, 255 },
+
+ /* 128x128 (1024x1024) 79.0kHz 73Hz ***EXCEEDS CHIP LIMIT!!!*** */
+ { 110000000, 16, 1024, 1024,
+ 128, 129, 140, 172, 171, 1025, 1026, 1043, 1073, 1073,
+ 4, NCRStdPalette, 128, 128, 16384, 8, 8, kernel_font, 32, 255 },
+
+ /* 128x128 (1024x1024) 86.2kHz 80Hz ***EXCEEDS CHIP LIMIT!!!*** */
+ { 120000000, 16, 1024, 1024,
+ 128, 129, 140, 172, 171, 1025, 1026, 1043, 1073, 1073,
+ 4, NCRStdPalette, 128, 128, 16384, 8, 8, kernel_font, 32, 255 },
+
+};
+
+static const char *monitor_descr[] = {
+ "80x50 (640x400) 31.5kHz 60Hz",
+ "80x50 (640x400) 35.0kHz 72Hz",
+ "80x50 (640x400) 37.1kHz 69Hz",
+ "100x75 (800x600) 31.5kHz 50Hz",
+ "100x75 (800x600) 35.0kHz 57Hz",
+ "100x75 (800x600) 37.2kHz 60Hz",
+ "100x75 (800x600) 57.1kHz 90Hz",
+ "128x96 (1024x768) 31.5kHz 78Hz interlace",
+ "128x96 (1024x768) 35.0kHz 86Hz interlace",
+ "128x96 (1024x768) 38.1kHz 89Hz interlace",
+ "128x96 (1024x768) 57.0kHz 71Hz",
+ "128x96 (1024x768) 71.2kHz 85Hz",
+ "80x100 (640x800) 31.9kHz 75Hz interlace",
+ "80x100 (640x800) 35.5kHz 84Hz interlace",
+ "80x50 (640x400) 36.6kHz 87Hz",
+ "96x64 (768x512) 36.9kHz 68Hz",
+ "96x64 (768x512) 38.4kHz 71Hz",
+ "96x64 (768x512) 41.0kHz 76Hz",
+ "96x64 (768x512) 46.0kHz 85Hz",
+ "96x64 (768x512) 46.1kHz 85Hz",
+ "100x75 (800x600) 47.3kHz 75Hz",
+ "100x75 (800x600) 53.6kHz 85Hz",
+ "128x96 (1024x768) 48.5kHz 60Hz",
+ "128x96 (1024x768) 50.0kHz 61Hz",
+ "128x96 (1024x768) 55.4kHz 68Hz",
+ "128x96 (1024x768) 57.7kHz 71Hz",
+ "128x96 (1024x768) 61.5kHz 76Hz",
+ "128x96 (1024x768) 69.2kHz 85Hz",
+ "128x128 (1024x1024) 71.8kHz 66Hz ***EXCEEDS CHIP LIMIT!!!***",
+ "128x128 (1024x1024) 79.0kHz 73Hz ***EXCEEDS CHIP LIMIT!!!***",
+ "128x128 (1024x1024) 86.2kHz 80Hz ***EXCEEDS CHIP LIMIT!!!***",
+};
+
diff --git a/sys/arch/amiga/dev/retina-monitors b/sys/arch/amiga/dev/retina-monitors
new file mode 100644
index 00000000000..c5688fbed00
--- /dev/null
+++ b/sys/arch/amiga/dev/retina-monitors
@@ -0,0 +1,71 @@
+; 640 × 200, 4 Bit, 31609 Hz, 75 Hz d
+ID 759528833 FQ 28322000 MD 0 FLG 9
+SW 640 SH 200 MW 640 MH 200
+HBS 81 HSS 82 HSE 89 HBE 110 HT 107
+VBS 401 VSS 402 VSE 409 VBE 418 VT 418
+
+; 640 × 400, 4 Bit, 31609 Hz, 75 Hz
+ID 759528046 FQ 28322000 MD 0 FLG 8
+SW 640 SH 400 MW 640 MH 400
+HBS 81 HSS 82 HSE 89 HBE 110 HT 107
+VBS 401 VSS 402 VSE 409 VBE 418 VT 418
+
+; 600 × 480, 4 Bit, 31250 Hz, 62 Hz
+ID 759528276 FQ 50000000 MD 0 FLG 8
+SW 600 SH 480 MW 600 MH 480
+HBS 76 HSS 77 HSE 84 HBE 98 HT 95
+VBS 481 VSS 482 VSE 490 VBE 502 VT 502
+
+; 800 × 600, 4 Bit, 31500 Hz, 50 Hz
+ID 759528122 FQ 63000000 MD 0 FLG 8
+SW 800 SH 600 MW 800 MH 600
+HBS 101 HSS 102 HSE 110 HBE 123 HT 120
+VBS 601 VSS 602 VSE 612 VBE 628 VT 628
+
+; 800 × 600, 4 Bit, 37878 Hz, 60 Hz
+ID 759528140 FQ 80000000 MD 0 FLG 8
+SW 800 SH 600 MW 800 MH 600
+HBS 101 HSS 102 HSE 111 HBE 130 HT 127
+VBS 601 VSS 602 VSE 612 VBE 628 VT 628
+
+; 1024 × 768, 4 Bit, 45646 Hz, 56 Hz
+ID 759528453 FQ 65000000 MD 0 FLG 8
+SW 1024 SH 768 MW 1024 MH 768
+HBS 129 HSS 130 HSE 141 HBE 176 HT 173
+VBS 769 VSS 770 VSE 783 VBE 805 VT 805
+
+; 800 × 600, 4 Bit, 48828 Hz, 77 Hz
+ID 759528343 FQ 50000000 MD 0 FLG 8
+SW 800 SH 600 MW 800 MH 600
+HBS 101 HSS 102 HSE 110 HBE 126 HT 123
+VBS 601 VSS 602 VSE 612 VBE 628 VT 628
+
+; 1280 × 1024, 4 Bit, 48309 Hz, 89 Hz i
+ID 759528707 FQ 80000000 MD 0 FLG 10
+SW 1280 SH 1024 MW 1280 MH 1024
+HBS 161 HSS 162 HSE 175 HBE 205 HT 202
+VBS 513 VSS 514 VSE 522 VBE 535 VT 535
+
+; 1440 × 1280, 4 Bit, 49559 Hz, 73 Hz i
+ID 759528770 FQ 90000000 MD 0 FLG 10
+SW 1440 SH 1280 MW 1440 MH 1280
+HBS 181 HSS 182 HSE 196 HBE 225 HT 222
+VBS 641 VSS 642 VSE 653 VBE 670 VT 670
+
+; 800 × 600, 4 Bit, 55316 Hz, 87 Hz
+ID 759528365 FQ 56644000 MD 0 FLG 8
+SW 800 SH 600 MW 800 MH 600
+HBS 101 HSS 102 HSE 110 HBE 126 HT 123
+VBS 601 VSS 602 VSE 612 VBE 628 VT 628
+
+; 1024 × 768, 4 Bit, 56179 Hz, 69 Hz
+ID 759528500 FQ 80000000 MD 0 FLG 8
+SW 1024 SH 768 MW 1024 MH 768
+HBS 129 HSS 130 HSE 141 HBE 176 HT 173
+VBS 769 VSS 770 VSE 783 VBE 805 VT 805
+
+; 1024 × 768, 4 Bit, 63202 Hz, 78 Hz
+ID 759528561 FQ 90000000 MD 0 FLG 8
+SW 1024 SH 768 MW 1024 MH 768
+HBS 129 HSS 130 HSE 141 HBE 176 HT 173
+VBS 769 VSS 770 VSE 783 VBE 805 VT 805
diff --git a/sys/arch/amiga/dev/scsi.c b/sys/arch/amiga/dev/scsi.c
index b1bd3fb855c..14f86f3c2ba 100644
--- a/sys/arch/amiga/dev/scsi.c
+++ b/sys/arch/amiga/dev/scsi.c
@@ -33,18 +33,11 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
-<<<<<<< scsi.c
- * from: @(#)scsi.c 7.5 (Berkeley) 5/4/91
- * $Id: scsi.c,v 1.3 1993/09/02 18:08:09 mw Exp $
-||||||| 1.1.1.2
- * @(#)scsi.c 7.5 (Berkeley) 5/4/91
-=======
* @(#)scsi.c 7.5 (Berkeley) 5/4/91
*
* MULTICONTROLLER support only working for multiple controllers of the
* same kind at the moment !!
*
->>>>>>> /tmp/T4009682
*/
/*
@@ -57,7 +50,7 @@
#if NSCSI > 0
#ifndef lint
-static char rcsid[] = "$Header: /cvsroot/src/sys/arch/amiga/dev/Attic/scsi.c,v 1.3 1993/09/02 18:08:09 mw Exp $";
+static char rcsid[] = "$Header: /cvsroot/src/sys/arch/amiga/dev/Attic/scsi.c,v 1.4 1993/10/30 23:41:33 mw Exp $";
#endif
#include "sys/param.h"
@@ -1247,6 +1240,24 @@ scsi_test_unit_rdy(ctlr, slave, unit)
}
int
+scsi_start_stop_unit (ctlr, slave, unit, start)
+ int ctlr, slave, unit;
+{
+ register struct scsi_softc *dev = &scsi_softc[ctlr];
+ static struct scsi_cdb6 cdb = { CMD_LOADUNLOAD };
+
+ cdb.lun = unit;
+ /* we don't set the immediate bit, so we wait for the
+ command to succeed.
+ We also don't touch the LoEj bit, which is primarily meant
+ for floppies. */
+ cdb.len = start & 0x01;
+ return (scsiicmd(dev, slave, (u_char *)&cdb, sizeof(cdb), (u_char *)0, 0,
+ STATUS_PHASE));
+}
+
+
+int
scsi_request_sense(ctlr, slave, unit, buf, len)
int ctlr, slave, unit;
u_char *buf;
diff --git a/sys/arch/amiga/dev/scsireg.h b/sys/arch/amiga/dev/scsireg.h
index ab673ccc977..1c34552ae6f 100644
--- a/sys/arch/amiga/dev/scsireg.h
+++ b/sys/arch/amiga/dev/scsireg.h
@@ -33,8 +33,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * from: @(#)scsireg.h 7.3 (Berkeley) 2/5/91
- * $Id: scsireg.h,v 1.3 1993/09/02 18:08:11 mw Exp $
+ * @(#)scsireg.h 7.3 (Berkeley) 2/5/91
*/
/*
diff --git a/sys/arch/amiga/dev/scsivar.h b/sys/arch/amiga/dev/scsivar.h
index 97fd7491852..46431bb41f1 100644
--- a/sys/arch/amiga/dev/scsivar.h
+++ b/sys/arch/amiga/dev/scsivar.h
@@ -33,8 +33,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * from: @(#)scsivar.h 7.1 (Berkeley) 5/8/90
- * $Id: scsivar.h,v 1.3 1993/09/02 18:08:12 mw Exp $
+ * @(#)scsivar.h 7.1 (Berkeley) 5/8/90
*/
struct scsi_softc {
diff --git a/sys/arch/amiga/dev/sd.c b/sys/arch/amiga/dev/sd.c
index c92ebc7ad06..0c6e0f7c0d5 100644
--- a/sys/arch/amiga/dev/sd.c
+++ b/sys/arch/amiga/dev/sd.c
@@ -33,8 +33,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * from: @(#)sd.c 7.8 (Berkeley) 6/9/91
- * $Id: sd.c,v 1.3 1993/09/02 18:08:13 mw Exp $
+ * @(#)sd.c 7.8 (Berkeley) 6/9/91
*/
/*
@@ -44,7 +43,7 @@
#if NSD > 0
#ifndef lint
-static char rcsid[] = "$Header: /cvsroot/src/sys/arch/amiga/dev/Attic/sd.c,v 1.3 1993/09/02 18:08:13 mw Exp $";
+static char rcsid[] = "$Header: /cvsroot/src/sys/arch/amiga/dev/Attic/sd.c,v 1.4 1993/10/30 23:41:36 mw Exp $";
#endif
#include "sys/param.h"
@@ -312,6 +311,10 @@ retry_TUR:
break;
sc->sc_idstr[i+1] = 0;
}
+
+ /* for those that have drives they only turn on for use under BSD... */
+ scsi_start_stop_unit (ctlr, slave, unit, 1);
+
i = scsi_immed_command(ctlr, slave, unit, &cap,
(u_char *)&capbuf, sizeof(capbuf), B_READ);
if (i) {
@@ -1164,7 +1167,7 @@ sddump(dev)
return (EINVAL);
if (dumplo + ctod(pages) > sc->sc_label.d_partitions[part].p_size)
pages = dtoc(sc->sc_label.d_partitions[part].p_size - dumplo);
- maddr = lowram;
+ maddr = ctob(lowram);
baddr = dumplo + sc->sc_label.d_partitions[part].p_offset;
/* scsi bus idle? */
if (!scsireq(&sc->sc_dq)) {
diff --git a/sys/arch/amiga/dev/ser.c b/sys/arch/amiga/dev/ser.c
index 8c04d16cb62..b2449018a92 100644
--- a/sys/arch/amiga/dev/ser.c
+++ b/sys/arch/amiga/dev/ser.c
@@ -30,8 +30,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * from: @(#)ser.c 7.12 (Berkeley) 6/27/91
- * $Id: ser.c,v 1.3 1993/09/02 18:08:14 mw Exp $
+ * @(#)ser.c 7.12 (Berkeley) 6/27/91
*/
#include "ser.h"
diff --git a/sys/arch/amiga/dev/serreg.h b/sys/arch/amiga/dev/serreg.h
index b9fd5cb91a1..b46c0e8efa1 100644
--- a/sys/arch/amiga/dev/serreg.h
+++ b/sys/arch/amiga/dev/serreg.h
@@ -30,8 +30,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * from: @(#)dcareg.h 7.3 (Berkeley) 5/7/91
- * $Id: serreg.h,v 1.2 1993/08/01 19:23:21 mycroft Exp $
+ * @(#)dcareg.h 7.3 (Berkeley) 5/7/91
*/
struct serdevice {
diff --git a/sys/arch/amiga/dev/st.c b/sys/arch/amiga/dev/st.c
index f2c6d303090..1028508fb47 100644
--- a/sys/arch/amiga/dev/st.c
+++ b/sys/arch/amiga/dev/st.c
@@ -35,9 +35,9 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * from: Utah Hdr: st.c 1.8 90/10/14
- * from: @(#)st.c 7.3 (Berkeley) 5/4/91
- * $Id: st.c,v 1.3 1993/09/02 18:08:16 mw Exp $
+ * from: Utah $Hdr: st.c 1.8 90/10/14$
+ *
+ * @(#)st.c 7.3 (Berkeley) 5/4/91
*/
/*
@@ -111,7 +111,7 @@ extern int stcommand (dev_t dev, u_int command, int cnt);
extern int sterror (int unit, struct st_softc *sc, int stat);
extern int stxsense (int ctlr, int slave, int unit, struct st_softc *sc);
extern int prtkey (int unit, struct st_softc *sc);
-extern int dumpxsense (struct st_xsense *sensebuf);
+extern int dumpxsense (struct st_xsense *sensebuf, struct st_softc *sc);
extern int prtmodsel (struct mode_select_data *msd, int modlen);
extern int prtmodstat (struct mode_sense *mode);
@@ -156,8 +156,13 @@ struct st_mode st_mode[NST];
*/
static struct st_xsense {
struct scsi_xsense sc_xsense; /* data from sense */
- struct exb_xsense exb_xsense; /* additional info from exabyte */
+ union {
+ struct exb_xsense uexb_xsense; /* additional info from exabyte */
+ struct cpr_xsense ucpr_xsense; /* additional info from caliper */
+ } u;
} st_xsense[NST];
+#define exb_xsense u.uexb_xsense
+#define cpr_xsense u.ucpr_xsense
static struct scsi_fmt_cdb stcmd[NST];
@@ -316,10 +321,10 @@ stident(sc, ad)
if (idstr[i] != ' ')
break;
idstr[i+1] = 0;
- printf("st%d: %s >%s< rev %s\n", ad->amiga_unit, idstr, &idstr[8],
+ printf("st%d: %s %s rev %s\n", ad->amiga_unit, idstr, &idstr[8],
&idstr[24]);
} else if (inqlen == 5)
- /* great it's a stupid device, doesn't know it's know name */
+ /* great it's a stupid device, doesn't know it's own name */
idstr[0] = idstr[8] = '\0';
else
idstr[8] = '\0';
@@ -362,6 +367,12 @@ stident(sc, ad)
sc->sc_datalen[CMD_INQUIRY] = 36;
sc->sc_datalen[CMD_MODE_SELECT] = 12;
sc->sc_datalen[CMD_MODE_SENSE] = 12;
+ } else if (bcmp("CP150", &idstr[8], 5) == 0) {
+ sc->sc_tapeid = MT_ISCALIPER;
+ sc->sc_datalen[CMD_REQUEST_SENSE] = 14;
+ sc->sc_datalen[CMD_INQUIRY] = 36;
+ sc->sc_datalen[CMD_MODE_SELECT] = 12;
+ sc->sc_datalen[CMD_MODE_SENSE] = 12;
} else {
if (idstr[8] == '\0')
printf("st%d: No ID, assuming Archive\n", ad->amiga_unit);
@@ -414,6 +425,7 @@ stopen(dev, flag, type, p)
struct mode_select_data msd;
struct mode_sense mode;
int modlen;
+ int skip_modsel = 0;
static struct scsi_fmt_cdb modsel = {
6,
CMD_MODE_SELECT, 0, 0, 0, sizeof(msd), 0
@@ -470,6 +482,13 @@ stopen(dev, flag, type, p)
sc->sc_blklen = 512;
break;
case MT_ISWANGTEK:
+ case MT_ISCALIPER:
+ stxsense(ctlr, slave, unit, sc);
+ /* Calipers can't handle a mode-select if the tape
+ * isn't rewound.
+ */
+ if (xsense->cpr_xsense.b11)
+ skip_modsel = 1;
sc->sc_blklen = 512;
break;
default:
@@ -483,6 +502,9 @@ stopen(dev, flag, type, p)
sc->sc_blklen = 512;
}
+ if (skip_modsel)
+ goto mode_selected;
+
/* setup for mode select */
msd.rsvd1 = 0;
msd.rsvd2 = 0;
@@ -511,6 +533,7 @@ stopen(dev, flag, type, p)
msd.density = 0x4;
}
break;
+ case MT_ISCALIPER:
case MT_ISWANGTEK:
if (minor (dev) & STDEV_HIDENSITY)
msd.density = 0x10;
@@ -584,6 +607,7 @@ retryselect:
goto retryselect;
}
+mode_selected:
/* drive ready ? */
stat = scsi_test_unit_rdy(ctlr, slave, unit);
@@ -620,6 +644,7 @@ retryselect:
case MT_ISHPDAT:
case MT_ISVIPER1:
case MT_ISPYTHON:
+ case MT_ISCALIPER:
case MT_ISWANGTEK:
if (xsense->sc_xsense.key == XSK_UNTATTEN)
stat = scsi_test_unit_rdy(ctlr, slave, unit);
@@ -652,7 +677,7 @@ retryselect:
stxsense(ctlr, slave, unit, sc);
#ifdef DEBUG
if (st_debug & ST_OPEN)
- dumpxsense(xsense);
+ dumpxsense(xsense, sc);
#endif
}
if (stat)
@@ -1385,8 +1410,9 @@ prtkey(unit, sc)
#ifdef DEBUG
-dumpxsense(sensebuf)
+dumpxsense(sensebuf, sc)
struct st_xsense *sensebuf;
+ struct st_softc *sc;
{
struct st_xsense *xp = sensebuf;
@@ -1402,29 +1428,44 @@ dumpxsense(sensebuf)
(xp->sc_xsense.info3<<8)|(xp->sc_xsense.info4)) );
printf("ASenseL 0x%x\n", xp->sc_xsense.len);
- if (xp->sc_xsense.len != 0x12) /* MT_ISEXB Exabyte only ?? */
- return; /* What about others */
-
- printf("ASenseC 0x%x\n", xp->exb_xsense.addsens);
- printf("AsenseQ 0x%x\n", xp->exb_xsense.addsensq);
- printf("R/W Errors 0x%lx\n",
- (u_long)((xp->exb_xsense.rwerrcnt2<<16)|
- (xp->exb_xsense.rwerrcnt1<<8)|
- (xp->exb_xsense.rwerrcnt1)) );
- printf("PF 0x%x BPE 0x%x FPE 0x%x ME 0x%x ECO 0x%x TME 0x%x TNP 0x%x BOT 0x%x\n",
- xp->exb_xsense.pf, xp->exb_xsense.bpe, xp->exb_xsense.fpe,
- xp->exb_xsense.me, xp->exb_xsense.eco, xp->exb_xsense.tme,
- xp->exb_xsense.tnp, xp->exb_xsense.bot);
- printf("XFR 0x%x TMD 0x%x WP 0x%x FMKE 0x%x URE 0x%x WE1 0x%x SSE 0x%x FE 0x%x\n",
- xp->exb_xsense.xfr, xp->exb_xsense.tmd, xp->exb_xsense.wp,
- xp->exb_xsense.fmke, xp->exb_xsense.ure, xp->exb_xsense.we1,
- xp->exb_xsense.sse, xp->exb_xsense.fe);
- printf("WSEB 0x%x WSEO 0x%x\n",
- xp->exb_xsense.wseb, xp->exb_xsense.wseo);
- printf("Remaining Tape 0x%lx\n",
- (u_long)((xp->exb_xsense.tplft2<<16)|
- (xp->exb_xsense.tplft1<<8)|
- (xp->exb_xsense.tplft0)) );
+ switch (sc->sc_tapeid) {
+ case MT_ISEXABYTE:
+ printf("ASenseC 0x%x\n", xp->exb_xsense.addsens);
+ printf("AsenseQ 0x%x\n", xp->exb_xsense.addsensq);
+ printf("R/W Errors 0x%lx\n",
+ (u_long)((xp->exb_xsense.rwerrcnt2<<16)|
+ (xp->exb_xsense.rwerrcnt1<<8)|
+ (xp->exb_xsense.rwerrcnt1)) );
+ printf("PF 0x%x BPE 0x%x FPE 0x%x ME 0x%x ECO 0x%x TME 0x%x TNP 0x%x BOT 0x%x\n",
+ xp->exb_xsense.pf, xp->exb_xsense.bpe,
+ xp->exb_xsense.fpe, xp->exb_xsense.me,
+ xp->exb_xsense.eco, xp->exb_xsense.tme,
+ xp->exb_xsense.tnp, xp->exb_xsense.bot);
+ printf("XFR 0x%x TMD 0x%x WP 0x%x FMKE 0x%x URE 0x%x WE1 0x%x SSE 0x%x FE 0x%x\n",
+ xp->exb_xsense.xfr, xp->exb_xsense.tmd,
+ xp->exb_xsense.wp, xp->exb_xsense.fmke,
+ xp->exb_xsense.ure, xp->exb_xsense.we1,
+ xp->exb_xsense.sse, xp->exb_xsense.fe);
+ printf("WSEB 0x%x WSEO 0x%x\n",
+ xp->exb_xsense.wseb, xp->exb_xsense.wseo);
+ printf("Remaining Tape 0x%lx\n",
+ (u_long)((xp->exb_xsense.tplft2<<16)|
+ (xp->exb_xsense.tplft1<<8)|
+ (xp->exb_xsense.tplft0)) );
+ break;
+
+ case MT_ISWANGTEK:
+ case MT_ISCALIPER:
+ printf("b8 0x%x (wp 0x%x) b9 0x%x b10 0x%x b11 0x%x b12 0x%x b13 0x%x\n",
+ xp->cpr_xsense.b8, xp->cpr_xsense.b8 & CPR_WP,
+ xp->cpr_xsense.b9, xp->cpr_xsense.b10,
+ xp->cpr_xsense.b11, xp->cpr_xsense.b12,
+ xp->cpr_xsense.b13);
+ break;
+
+ default:
+ break;
+ }
}
prtmodsel(msd, modlen)
diff --git a/sys/arch/amiga/dev/stvar.h b/sys/arch/amiga/dev/stvar.h
index fb87c7ab577..b312194b274 100644
--- a/sys/arch/amiga/dev/stvar.h
+++ b/sys/arch/amiga/dev/stvar.h
@@ -35,8 +35,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * from: @(#)stvar.h 7.1 (Berkeley) 2/5/91
- * $Id: stvar.h,v 1.2 1993/08/01 19:23:23 mycroft Exp $
+ * @(#)stvar.h 7.1 (Berkeley) 2/5/91
*/
/*
@@ -102,6 +101,16 @@ struct exb_inquiry {
char venderunique[16];
};
+struct cpr_xsense {
+ u_char b8;
+#define CPR_WP 0x10
+ u_char b9;
+ u_char b10;
+ u_char b11;
+ u_char b12;
+ u_char b13;
+};
+
struct st_mode {
u_char sdl;
u_char medtype;
diff --git a/sys/arch/amiga/dev/transmon b/sys/arch/amiga/dev/transmon
new file mode 100644
index 00000000000..7301895aade
--- /dev/null
+++ b/sys/arch/amiga/dev/transmon
@@ -0,0 +1,76 @@
+#!/usr/local/bin/perl
+
+# font width
+$FW=8;
+# font height
+$FH=8;
+# font name
+$FN="kernel_font";
+# font lo,hi
+$FLO=32; $FHI=255;
+
+printf "static struct MonDef monitor_defs[] = {\n";
+printf " /*%9s, %3s, %4s, %4s\n","FQ","FLG","MW","MH";
+printf " %3s, %3s, %3s, %3s, %3s, %3s, %3s, %3s, %3s, %3s\n",
+ "HBS","HSS","HSE","HBE","HT","VBS","VSS","VSE","VBE","VT";
+printf " %5s, %13s, %3s, %3s, %5s, %2s, %2s, %12s, %3s, %3s*/\n\n",
+ "Depth","PAL","TX","TY","XY","FX","FY","FontData","FLo","FHi";
+
+while (<>)
+ {
+ if (/^;/)
+ {
+ /^.*Bit,\s+([0-9]+)[^0-9]+([0-9]+)\s+Hz\s+(.*)\n/;
+ $HF=$1; $VF=$2; $FF=$3;
+ $FF="doublescan" if $FF eq "d";
+ $FF="interlace" if $FF eq "i";
+ $l1=<STDIN>;
+ $l2=<STDIN>;
+ $l3=<STDIN>;
+ $l4=<STDIN>;
+
+ ($d,$ID,$d,$FQ,$d,$MD,$d,$FLG) = split(/\s+/,$l1);
+ ($d,$SW,$d,$SH,$d,$MW,$d,$MH) = split(/\s+/,$l2);
+ ($d,$HBS,$d,$HSS,$d,$HSE,$d,$HBE,$d,$HT) = split(/\s+/,$l3);
+ ($d,$VBS,$d,$VSS,$d,$VSE,$d,$VBE,$d,$VT) = split(/\s+/,$l4);
+
+ # convert to chip text-mode
+ $HBS=($HBS * 4) / $FW;
+ $HSS=($HSS * 4) / $FW;
+ $HSE=($HSE * 4) / $FW;
+ $HBE=($HBE * 4) / $FW;
+ $HT =($HT * 4) / $FW;
+
+ # hmm.. this flag seems to be supported only by not-yet-released
+ # DefineMonitor programs, and I don't know what it does. It's not
+ # used by the current BSD driver anyway.
+ $FLG|=16;
+
+ die "MW not multiple of FW" unless ($MW % $FW) == 0;
+ die "MH not multiple of FH" unless ($MH % $FH) == 0;
+
+ $FF=" ".$FF if $FF ne "";
+ $buf1=sprintf("%dx%d (%dx%d) %.1fkHz %dHz%s",
+ ($MW/$FW,$MH/$FH,$MW,$MH,$HF/1000.,$VF,$FF));
+ $buf2="";
+ $buf2=" ***EXCEEDS CHIP LIMIT!!!***" if $FQ > 90000000;
+ $mondesc[$nummon++]=$buf1.$buf2;
+ printf " /* %s */\n",$buf1.$buf2;
+ printf " { %9u, %3d, %4d, %4d,\n",$FQ,$FLG,$MW,$MH;
+ printf " %3d, %3d, %3d, %3d, %3d, %3d, %3d, %3d, %3d, %3d,\n",
+ $HBS,$HSS,$HSE,$HBE,$HT,$VBS,$VSS,$VSE,$VBE,$VT;
+
+ printf " %5d, %13s, %3d, %3d, %5d, %2d, %2d, %12s, %3d, %3d },\n\n",
+ 4,"NCRStdPalette",$MW/$FW,$MH/$FH,($MW/$FW)*($MH/$FH),
+ $FW,$FH,$FN,$FLO,$FHI;
+ }
+
+ }
+
+printf "};\n\nstatic const char *monitor_descr[] = {\n";
+while ($nummon-- > 0)
+ {
+ printf " \"%s\",\n", $mondesc[$xx++];
+ }
+printf "};\n\n";
+
diff --git a/sys/arch/amiga/dev/vn.c b/sys/arch/amiga/dev/vn.c
index 945905159a9..99519357951 100644
--- a/sys/arch/amiga/dev/vn.c
+++ b/sys/arch/amiga/dev/vn.c
@@ -35,9 +35,9 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * from: Utah Hdr: vn.c 1.1 91/04/30
- * from: @(#)vn.c 7.6 (Berkeley) 6/21/91
- * $Id: vn.c,v 1.2 1993/08/01 19:23:24 mycroft Exp $
+ * from: Utah $Hdr: vn.c 1.1 91/04/30$
+ *
+ * @(#)vn.c 7.6 (Berkeley) 6/21/91
*/
/*
@@ -288,7 +288,7 @@ vnread(dev, uio, flags, p)
#if 0
return(physio(vnstrategy, &vnbuf[unit], dev, B_READ, minphys, uio));
#else
- return rawread (dev, uio);
+ return(physio(vnstrategy, 0, dev, B_READ, minphys, uio));
#endif
}
@@ -307,7 +307,7 @@ vnwrite(dev, uio, flags, p)
#if 0
return(physio(vnstrategy, &vnbuf[unit], dev, B_WRITE, minphys, uio));
#else
- return rawwrite (dev, uio);
+ return(physio(vnstrategy, 0, dev, B_WRITE, minphys, uio));
#endif
}
@@ -350,6 +350,7 @@ vnioctl(dev, cmd, data, flag, p)
* weed out directories, sockets, etc. so we don't
* have to worry about them.
*/
+ bzero (&nd, sizeof (nd));
nd.ni_segflg = UIO_USERSPACE;
nd.ni_dirp = vio->vn_file;
if (error = vn_open(&nd, p, FREAD|FWRITE, 0))
diff --git a/sys/arch/amiga/dev/vnioctl.h b/sys/arch/amiga/dev/vnioctl.h
index 0c4d4c14fd0..1615e29e029 100644
--- a/sys/arch/amiga/dev/vnioctl.h
+++ b/sys/arch/amiga/dev/vnioctl.h
@@ -35,9 +35,9 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * from: Utah Hdr: fdioctl.h 1.1 90/07/09
- * from: @(#)vnioctl.h 7.3 (Berkeley) 5/7/91
- * $Id: vnioctl.h,v 1.2 1993/08/01 19:23:25 mycroft Exp $
+ * from: Utah $Hdr: fdioctl.h 1.1 90/07/09$
+ *
+ * @(#)vnioctl.h 7.3 (Berkeley) 5/7/91
*/
/*