summaryrefslogtreecommitdiff
path: root/sys/arch
diff options
context:
space:
mode:
Diffstat (limited to 'sys/arch')
-rw-r--r--sys/arch/i386/i386/autoconf.c32
-rw-r--r--sys/arch/i386/i386/conf.c14
-rw-r--r--sys/arch/i386/i386/db_disasm.c19
-rw-r--r--sys/arch/i386/i386/db_interface.c27
-rw-r--r--sys/arch/i386/i386/db_trace.c49
-rw-r--r--sys/arch/i386/i386/disksubr.c11
-rw-r--r--sys/arch/i386/i386/freebsd_machdep.c8
-rw-r--r--sys/arch/i386/i386/gdt.c17
-rw-r--r--sys/arch/i386/i386/genassym.c4
-rw-r--r--sys/arch/i386/i386/in_cksum.c4
-rw-r--r--sys/arch/i386/i386/linux_machdep.c36
-rw-r--r--sys/arch/i386/i386/locore.s7
-rw-r--r--sys/arch/i386/i386/machdep.c40
-rw-r--r--sys/arch/i386/i386/mainbus.c6
-rw-r--r--sys/arch/i386/i386/math_emulate.c14
-rw-r--r--sys/arch/i386/i386/mem.c11
-rw-r--r--sys/arch/i386/i386/ns_cksum.c5
-rw-r--r--sys/arch/i386/i386/pmap.c34
-rw-r--r--sys/arch/i386/i386/pmap.old.c34
-rw-r--r--sys/arch/i386/i386/process_machdep.c11
-rw-r--r--sys/arch/i386/i386/svr4_machdep.c13
-rw-r--r--sys/arch/i386/i386/swapgeneric.c11
-rw-r--r--sys/arch/i386/i386/sys_machdep.c33
-rw-r--r--sys/arch/i386/i386/trap.c24
-rw-r--r--sys/arch/i386/i386/vm86.c22
-rw-r--r--sys/arch/i386/i386/vm_machdep.c8
-rw-r--r--sys/arch/i386/include/bus.h46
-rw-r--r--sys/arch/i386/include/conf.h62
-rw-r--r--sys/arch/i386/include/cpu.h57
-rw-r--r--sys/arch/i386/include/db_machdep.h12
-rw-r--r--sys/arch/i386/include/endian.h24
-rw-r--r--sys/arch/i386/include/linux_machdep.h3
-rw-r--r--sys/arch/i386/include/pmap.h12
-rw-r--r--sys/arch/i386/include/pmap.old.h12
-rw-r--r--sys/arch/i386/include/psl.h7
-rw-r--r--sys/arch/i386/include/vm86.h28
-rw-r--r--sys/arch/i386/isa/clock.c35
-rw-r--r--sys/arch/i386/isa/fd.c32
-rw-r--r--sys/arch/i386/isa/isa_machdep.c10
-rw-r--r--sys/arch/i386/isa/isa_machdep.h4
-rw-r--r--sys/arch/i386/isa/lms.c22
-rw-r--r--sys/arch/i386/isa/mms.c21
-rw-r--r--sys/arch/i386/isa/npx.c5
-rw-r--r--sys/arch/i386/isa/pccons.c103
-rw-r--r--sys/arch/i386/isa/pcvt/pcvt_drv.c16
-rw-r--r--sys/arch/i386/isa/pcvt/pcvt_hdr.h22
-rw-r--r--sys/arch/i386/isa/pcvt/pcvt_kbd.c9
-rw-r--r--sys/arch/i386/isa/pcvt/pcvt_kbd.h522
-rw-r--r--sys/arch/i386/isa/pcvt/pcvt_out.c3
49 files changed, 941 insertions, 620 deletions
diff --git a/sys/arch/i386/i386/autoconf.c b/sys/arch/i386/i386/autoconf.c
index 0358a729c9f..7be949a65f0 100644
--- a/sys/arch/i386/i386/autoconf.c
+++ b/sys/arch/i386/i386/autoconf.c
@@ -1,5 +1,5 @@
-/* $OpenBSD: autoconf.c,v 1.8 1996/04/21 22:16:22 deraadt Exp $ */
-/* $NetBSD: autoconf.c,v 1.19 1996/03/29 01:15:04 mycroft Exp $ */
+/* $OpenBSD: autoconf.c,v 1.9 1996/05/07 07:21:29 deraadt Exp $ */
+/* $NetBSD: autoconf.c,v 1.20 1996/05/03 19:41:56 christos Exp $ */
/*-
* Copyright (c) 1990 The Regents of the University of California.
@@ -58,13 +58,10 @@
#include <sys/device.h>
#include <machine/pte.h>
+#include <machine/cpu.h>
-void swapconf __P((void));
-void setroot __P((void));
-
-void setroot __P((void));
-void swapconf __P((void));
-void dumpconf __P((void));
+void swapconf __P((void));
+void setroot __P((void));
/*
* The following several variables are related to
@@ -135,11 +132,11 @@ swapconf()
u_long bootdev = 0; /* should be dev_t, but not until 32 bits */
static char devname[][2] = {
- 'w','d', /* 0 = wd */
- 's','w', /* 1 = sw */
- 'f','d', /* 2 = fd */
- 'w','t', /* 3 = wt */
- 's','d', /* 4 = sd -- new SCSI system */
+ { 'w','d' }, /* 0 = wd */
+ { 's','w' }, /* 1 = sw */
+ { 'f','d' }, /* 2 = fd */
+ { 'w','t' }, /* 3 = wt */
+ { 's','d' }, /* 4 = sd -- new SCSI system */
};
/*
@@ -151,10 +148,15 @@ void
setroot()
{
int majdev, mindev, unit, part, adaptor;
- dev_t temp, orootdev;
+ dev_t orootdev;
+#ifdef DOSWAP
+ dev_t temp = 0;
+#endif
struct swdevt *swp;
-/*printf("howto %x bootdev %x ", boothowto, bootdev);*/
+#if 0
+ printf("howto %x bootdev %x ", boothowto, bootdev);
+#endif
if (boothowto & RB_DFLTROOT ||
(bootdev & B_MAGICMASK) != (u_long)B_DEVMAGIC)
return;
diff --git a/sys/arch/i386/i386/conf.c b/sys/arch/i386/i386/conf.c
index c28ad9cc561..952f0fbf57e 100644
--- a/sys/arch/i386/i386/conf.c
+++ b/sys/arch/i386/i386/conf.c
@@ -1,5 +1,5 @@
-/* $OpenBSD: conf.c,v 1.14 1996/05/04 18:50:44 mickey Exp $ */
-/* $NetBSD: conf.c,v 1.74 1996/03/30 07:30:33 mycroft Exp $ */
+/* $OpenBSD: conf.c,v 1.15 1996/05/07 07:21:31 deraadt Exp $ */
+/* $NetBSD: conf.c,v 1.75 1996/05/03 19:40:20 christos Exp $ */
/*
* Copyright (c) 1994, 1995 Charles M. Hannum. All rights reserved.
@@ -38,15 +38,11 @@
#include <sys/conf.h>
#include <sys/vnode.h>
-int ttselect __P((dev_t, int, struct proc *));
-
#include "wdc.h"
bdev_decl(wd);
bdev_decl(sw);
#include "fdc.h"
-#define fdopen Fdopen /* conflicts with fdopen() in kern_descrip.c */
bdev_decl(fd);
-#undef fdopen
#include "wt.h"
bdev_decl(wt);
#include "sd.h"
@@ -71,9 +67,7 @@ struct bdevsw bdevsw[] =
{
bdev_disk_init(NWDC,wd), /* 0: ST506/ESDI/IDE disk */
bdev_swap_init(1,sw), /* 1: swap pseudo-device */
-#define fdopen Fdopen
bdev_disk_init(NFDC,fd), /* 2: floppy diskette */
-#undef fdopen
bdev_tape_init(NWT,wt), /* 3: QIC-02/QIC-36 tape */
bdev_disk_init(NSD,sd), /* 4: SCSI disk */
bdev_tape_init(NST,st), /* 5: SCSI tape */
@@ -142,9 +136,7 @@ cdev_decl(ptc);
cdev_decl(log);
#include "com.h"
cdev_decl(com);
-#define fdopen Fdopen
cdev_decl(fd);
-#undef fdopen
cdev_decl(wt);
cdev_decl(scd);
#include "pc.h"
@@ -208,9 +200,7 @@ struct cdevsw cdevsw[] =
cdev_ptc_init(NPTY,ptc), /* 6: pseudo-tty master */
cdev_log_init(1,log), /* 7: /dev/klog */
cdev_tty_init(NCOM,com), /* 8: serial port */
-#define fdopen Fdopen
cdev_disk_init(NFDC,fd), /* 9: floppy disk */
-#undef fdopen
cdev_tape_init(NWT,wt), /* 10: QIC-02/QIC-36 tape */
cdev_disk_init(NSCD,scd), /* 11: Sony CD-ROM */
cdev_pc_init(NPC + NVT,pc), /* 12: PC console */
diff --git a/sys/arch/i386/i386/db_disasm.c b/sys/arch/i386/i386/db_disasm.c
index 7959d5960b7..5ca93f4286e 100644
--- a/sys/arch/i386/i386/db_disasm.c
+++ b/sys/arch/i386/i386/db_disasm.c
@@ -1,4 +1,4 @@
-/* $NetBSD: db_disasm.c,v 1.10 1996/02/02 18:05:58 mycroft Exp $ */
+/* $NetBSD: db_disasm.c,v 1.11 1996/05/03 19:41:58 christos Exp $ */
/*
* Mach Operating System
@@ -37,6 +37,8 @@
#include <ddb/db_access.h>
#include <ddb/db_sym.h>
+#include <ddb/db_output.h>
+#include <ddb/db_interface.h>
/*
* Size attributes
@@ -826,9 +828,9 @@ char * db_index_reg_16[8] = {
};
char * db_reg[3][8] = {
- "%al", "%cl", "%dl", "%bl", "%ah", "%ch", "%dh", "%bh",
- "%ax", "%cx", "%dx", "%bx", "%sp", "%bp", "%si", "%di",
- "%eax", "%ecx", "%edx", "%ebx", "%esp", "%ebp", "%esi", "%edi"
+ { "%al", "%cl", "%dl", "%bl", "%ah", "%ch", "%dh", "%bh" },
+ { "%ax", "%cx", "%dx", "%bx", "%sp", "%bp", "%si", "%di" },
+ { "%eax", "%ecx", "%edx", "%ebx", "%esp", "%ebp", "%esi", "%edi" }
};
char * db_seg_reg[8] = {
@@ -854,6 +856,11 @@ int db_lengths[] = {
(loc) += (size); \
} while (0)
+
+db_addr_t db_read_address __P((db_addr_t, int, int, struct i_addr *));
+void db_print_address __P((char *, int, struct i_addr *));
+db_addr_t db_disasm_esc __P((db_addr_t, int, int, int, char *));
+
/*
* Read address at location and return updated location.
*/
@@ -864,7 +871,7 @@ db_read_address(loc, short_addr, regmodrm, addrp)
int regmodrm;
struct i_addr *addrp; /* out */
{
- int mod, rm, sib, index, ss, disp;
+ int mod, rm, sib, index, disp;
mod = f_mod(regmodrm);
rm = f_rm(regmodrm);
@@ -1064,7 +1071,7 @@ db_disasm(loc, altfmt)
char * i_name;
int i_size;
int i_mode;
- int regmodrm;
+ int regmodrm = 0;
boolean_t first;
int displ;
int prefix;
diff --git a/sys/arch/i386/i386/db_interface.c b/sys/arch/i386/i386/db_interface.c
index e9d0896da94..bda0b084dda 100644
--- a/sys/arch/i386/i386/db_interface.c
+++ b/sys/arch/i386/i386/db_interface.c
@@ -1,5 +1,5 @@
-/* $OpenBSD: db_interface.c,v 1.5 1996/04/21 22:16:24 deraadt Exp $ */
-/* $NetBSD: db_interface.c,v 1.21 1996/03/30 07:57:16 mycroft Exp $ */
+/* $OpenBSD: db_interface.c,v 1.6 1996/05/07 07:21:34 deraadt Exp $ */
+/* $NetBSD: db_interface.c,v 1.22 1996/05/03 19:42:00 christos Exp $ */
/*
* Mach Operating System
@@ -35,18 +35,29 @@
#include <sys/param.h>
#include <sys/proc.h>
#include <sys/reboot.h>
-#include <sys/systm.h> /* just for boothowto --eichin */
+#include <sys/systm.h>
#include <vm/vm.h>
+#include <dev/cons.h>
+
#include <machine/db_machdep.h>
+#include <ddb/db_sym.h>
+#include <ddb/db_command.h>
+#include <ddb/db_extern.h>
+#include <ddb/db_access.h>
+#include <ddb/db_output.h>
+
+
extern label_t *db_recover;
extern char *trap_type[];
extern int trap_types;
int db_active = 0;
+void kdbprinttrap __P((int, int));
+
/*
* Print trap reason.
*/
@@ -68,7 +79,7 @@ kdbprinttrap(type, code)
int
kdb_trap(type, code, regs)
int type, code;
- register db_regs_t *regs;
+ db_regs_t *regs;
{
int s;
@@ -136,13 +147,13 @@ kdb_trap(type, code, regs)
void
db_read_bytes(addr, size, data)
vm_offset_t addr;
- register int size;
+ register size_t size;
register char *data;
{
register char *src;
src = (char *)addr;
- while (--size >= 0)
+ while (size-- > 0)
*data++ = *src++;
}
@@ -154,7 +165,7 @@ pt_entry_t *pmap_pte __P((pmap_t, vm_offset_t));
void
db_write_bytes(addr, size, data)
vm_offset_t addr;
- register int size;
+ register size_t size;
register char *data;
{
register char *dst;
@@ -184,7 +195,7 @@ db_write_bytes(addr, size, data)
dst = (char *)addr;
- while (--size >= 0)
+ while (size-- > 0)
*dst++ = *data++;
if (ptep0) {
diff --git a/sys/arch/i386/i386/db_trace.c b/sys/arch/i386/i386/db_trace.c
index 7ea0e5a9a10..2a4acc02337 100644
--- a/sys/arch/i386/i386/db_trace.c
+++ b/sys/arch/i386/i386/db_trace.c
@@ -1,5 +1,5 @@
-/* $OpenBSD: db_trace.c,v 1.2 1996/03/11 11:16:44 mickey Exp $ */
-/* $NetBSD: db_trace.c,v 1.17 1995/10/11 04:19:35 mycroft Exp $ */
+/* $OpenBSD: db_trace.c,v 1.3 1996/05/07 07:21:35 deraadt Exp $ */
+/* $NetBSD: db_trace.c,v 1.18 1996/05/03 19:42:01 christos Exp $ */
/*
* Mach Operating System
@@ -28,32 +28,35 @@
*/
#include <sys/param.h>
+#include <sys/systm.h>
#include <sys/proc.h>
#include <machine/db_machdep.h>
-#include <ddb/db_access.h>
#include <ddb/db_sym.h>
+#include <ddb/db_access.h>
#include <ddb/db_variables.h>
+#include <ddb/db_output.h>
+#include <ddb/db_interface.h>
/*
* Machine register set.
*/
struct db_variable db_regs[] = {
- "es", &ddb_regs.tf_es, FCN_NULL,
- "ds", &ddb_regs.tf_ds, FCN_NULL,
- "edi", &ddb_regs.tf_edi, FCN_NULL,
- "esi", &ddb_regs.tf_esi, FCN_NULL,
- "ebp", &ddb_regs.tf_ebp, FCN_NULL,
- "ebx", &ddb_regs.tf_ebx, FCN_NULL,
- "edx", &ddb_regs.tf_edx, FCN_NULL,
- "ecx", &ddb_regs.tf_ecx, FCN_NULL,
- "eax", &ddb_regs.tf_eax, FCN_NULL,
- "eip", &ddb_regs.tf_eip, FCN_NULL,
- "cs", &ddb_regs.tf_cs, FCN_NULL,
- "eflags", &ddb_regs.tf_eflags, FCN_NULL,
- "esp", &ddb_regs.tf_esp, FCN_NULL,
- "ss", &ddb_regs.tf_ss, FCN_NULL,
+ { "es", &ddb_regs.tf_es, FCN_NULL },
+ { "ds", &ddb_regs.tf_ds, FCN_NULL },
+ { "edi", &ddb_regs.tf_edi, FCN_NULL },
+ { "esi", &ddb_regs.tf_esi, FCN_NULL },
+ { "ebp", &ddb_regs.tf_ebp, FCN_NULL },
+ { "ebx", &ddb_regs.tf_ebx, FCN_NULL },
+ { "edx", &ddb_regs.tf_edx, FCN_NULL },
+ { "ecx", &ddb_regs.tf_ecx, FCN_NULL },
+ { "eax", &ddb_regs.tf_eax, FCN_NULL },
+ { "eip", &ddb_regs.tf_eip, FCN_NULL },
+ { "cs", &ddb_regs.tf_cs, FCN_NULL },
+ { "eflags", &ddb_regs.tf_eflags, FCN_NULL },
+ { "esp", &ddb_regs.tf_esp, FCN_NULL },
+ { "ss", &ddb_regs.tf_ss, FCN_NULL },
};
struct db_variable *db_eregs = db_regs + sizeof(db_regs)/sizeof(db_regs[0]);
@@ -78,6 +81,10 @@ db_addr_t db_syscall_symbol_value = 0;
db_addr_t db_kdintr_symbol_value = 0;
boolean_t db_trace_symbols_found = FALSE;
+void db_find_trace_symbols __P((void));
+int db_numargs __P((struct i386_frame *));
+void db_nextframe __P((struct i386_frame **, db_addr_t *, int *, int));
+
void
db_find_trace_symbols()
{
@@ -178,7 +185,7 @@ db_stack_trace_cmd(addr, have_addr, count, modif)
struct i386_frame *frame, *lastframe;
int *argp;
db_addr_t callpc;
- int is_trap;
+ int is_trap = 0;
boolean_t kernel_only = TRUE;
boolean_t trace_thread = FALSE;
@@ -206,7 +213,7 @@ db_stack_trace_cmd(addr, have_addr, count, modif)
frame = (struct i386_frame *)ddb_regs.tf_ebp;
callpc = (db_addr_t)ddb_regs.tf_eip;
} else if (trace_thread) {
- printf ("db_trace.c: can't trace thread\n");
+ db_printf ("db_trace.c: can't trace thread\n");
} else {
frame = (struct i386_frame *)addr;
callpc = (db_addr_t)
@@ -308,7 +315,7 @@ db_stack_trace_cmd(addr, have_addr, count, modif)
if (INKERNEL((int)frame)) {
/* staying in kernel */
if (frame <= lastframe) {
- db_printf("Bad frame pointer: 0x%x\n", frame);
+ db_printf("Bad frame pointer: %p\n", frame);
break;
}
} else if (INKERNEL((int)lastframe)) {
@@ -318,7 +325,7 @@ db_stack_trace_cmd(addr, have_addr, count, modif)
} else {
/* in user */
if (frame <= lastframe) {
- db_printf("Bad user frame pointer: 0x%x\n",
+ db_printf("Bad user frame pointer: %p\n",
frame);
break;
}
diff --git a/sys/arch/i386/i386/disksubr.c b/sys/arch/i386/i386/disksubr.c
index e8f8d1677c2..92bb4096752 100644
--- a/sys/arch/i386/i386/disksubr.c
+++ b/sys/arch/i386/i386/disksubr.c
@@ -1,5 +1,5 @@
-/* $OpenBSD: disksubr.c,v 1.3 1996/04/21 22:16:25 deraadt Exp $ */
-/* $NetBSD: disksubr.c,v 1.20 1996/04/03 08:18:27 mycroft Exp $ */
+/* $OpenBSD: disksubr.c,v 1.4 1996/05/07 07:21:36 deraadt Exp $ */
+/* $NetBSD: disksubr.c,v 1.21 1996/05/03 19:42:03 christos Exp $ */
/*
* Copyright (c) 1982, 1986, 1988 Regents of the University of California.
@@ -65,7 +65,7 @@ int fat_types[] = { DOSPTYP_FAT12, DOSPTYP_FAT16S,
char *
readdisklabel(dev, strat, lp, osdep)
dev_t dev;
- void (*strat)();
+ void (*strat) __P((struct buf *));
register struct disklabel *lp;
struct cpu_disklabel *osdep;
{
@@ -229,7 +229,6 @@ setdisklabel(olp, nlp, openmask, osdep)
u_long openmask;
struct cpu_disklabel *osdep;
{
- struct dos_partition *dp = osdep->dosparts;
register i;
register struct partition *opp, *npp;
@@ -283,7 +282,7 @@ setdisklabel(olp, nlp, openmask, osdep)
int
writedisklabel(dev, strat, lp, osdep)
dev_t dev;
- void (*strat)();
+ void (*strat) __P((struct buf *));
register struct disklabel *lp;
struct cpu_disklabel *osdep;
{
@@ -341,7 +340,7 @@ writedisklabel(dev, strat, lp, osdep)
(*strat)(bp);
/* if successful, locate disk label within block and validate */
- if (error = biowait(bp))
+ if ((error = biowait(bp)) != 0)
goto done;
for (dlp = (struct disklabel *)bp->b_data;
dlp <= (struct disklabel *)(bp->b_data + lp->d_secsize - sizeof(*dlp));
diff --git a/sys/arch/i386/i386/freebsd_machdep.c b/sys/arch/i386/i386/freebsd_machdep.c
index 565990173b5..c226e0f5f90 100644
--- a/sys/arch/i386/i386/freebsd_machdep.c
+++ b/sys/arch/i386/i386/freebsd_machdep.c
@@ -1,5 +1,5 @@
-/* $OpenBSD: freebsd_machdep.c,v 1.5 1996/05/02 13:41:14 deraadt Exp $ */
-/* $NetBSD: freebsd_machdep.c,v 1.9 1996/04/18 08:36:20 mycroft Exp $ */
+/* $OpenBSD: freebsd_machdep.c,v 1.6 1996/05/07 07:21:37 deraadt Exp $ */
+/* $NetBSD: freebsd_machdep.c,v 1.10 1996/05/03 19:42:05 christos Exp $ */
/*-
* Copyright (c) 1993, 1994, 1995, 1996 Charles M. Hannum. All rights reserved.
@@ -375,7 +375,7 @@ freebsd_ptrace_getregs(fregs, addr, datap)
return 0;
}
#ifdef DIAGNOSTIC
- printf("freebsd_ptrace_getregs: *(0x%08x)\n", offset);
+ printf("freebsd_ptrace_getregs: *(0x%08lx)\n", offset);
#endif
return EFAULT;
}
@@ -402,7 +402,7 @@ freebsd_ptrace_setregs(fregs, addr, data)
return 0;
}
#ifdef DIAGNOSTIC
- printf("freebsd_ptrace_setregs: *(0x%08x) = 0x%08x\n", offset, data);
+ printf("freebsd_ptrace_setregs: *(0x%08lx) = 0x%08x\n", offset, data);
#endif
return EFAULT;
}
diff --git a/sys/arch/i386/i386/gdt.c b/sys/arch/i386/i386/gdt.c
index 37361fba4a2..fc8a6dc18bb 100644
--- a/sys/arch/i386/i386/gdt.c
+++ b/sys/arch/i386/i386/gdt.c
@@ -1,5 +1,5 @@
-/* $OpenBSD: gdt.c,v 1.8 1996/04/29 14:12:48 hvozda Exp $ */
-/* $NetBSD: gdt.c,v 1.7 1996/02/27 22:45:01 jtc Exp $ */
+/* $OpenBSD: gdt.c,v 1.9 1996/05/07 07:21:38 deraadt Exp $ */
+/* $NetBSD: gdt.c,v 1.8 1996/05/03 19:42:06 christos Exp $ */
/*-
* Copyright (c) 1996 The NetBSD Foundation, Inc.
@@ -60,6 +60,15 @@ int gdt_flags;
#define GDT_LOCKED 0x1
#define GDT_WANTED 0x2
+static __inline void gdt_lock __P((void));
+static __inline void gdt_unlock __P((void));
+void gdt_compact __P((void));
+void gdt_init __P((void));
+void gdt_grow __P((void));
+void gdt_shrink __P((void));
+int gdt_get_slot __P((void));
+void gdt_put_slot __P((int));
+
/*
* Lock and unlock the GDT, to avoid races in case gdt_{ge,pu}t_slot() sleep
* waiting for memory.
@@ -69,7 +78,7 @@ int gdt_flags;
* some time after the GDT is unlocked, so gdt_compact() could attempt to
* reclaim it.
*/
-static inline void
+static __inline void
gdt_lock()
{
@@ -80,7 +89,7 @@ gdt_lock()
gdt_flags |= GDT_LOCKED;
}
-static inline void
+static __inline void
gdt_unlock()
{
diff --git a/sys/arch/i386/i386/genassym.c b/sys/arch/i386/i386/genassym.c
index 8bba187b0d9..9e2b234fdfd 100644
--- a/sys/arch/i386/i386/genassym.c
+++ b/sys/arch/i386/i386/genassym.c
@@ -1,4 +1,4 @@
-/* $NetBSD: genassym.c,v 1.48 1996/03/28 23:44:04 mycroft Exp $ */
+/* $NetBSD: genassym.c,v 1.49 1996/05/03 19:42:07 christos Exp $ */
/*-
* Copyright (c) 1995 Charles M. Hannum. All rights reserved.
@@ -76,6 +76,8 @@
#include <stdio.h>
#include <stddef.h>
+int main __P((void));
+
int
main()
{
diff --git a/sys/arch/i386/i386/in_cksum.c b/sys/arch/i386/i386/in_cksum.c
index 95a82ae502c..91bfee78410 100644
--- a/sys/arch/i386/i386/in_cksum.c
+++ b/sys/arch/i386/i386/in_cksum.c
@@ -1,4 +1,4 @@
-/* $NetBSD: in_cksum.c,v 1.8 1995/05/01 01:24:04 mycroft Exp $ */
+/* $NetBSD: in_cksum.c,v 1.9 1996/05/03 19:42:09 christos Exp $ */
/*-
* Copyright (c) 1994, 1995 Charles M. Hannum. All rights reserved.
@@ -38,7 +38,9 @@
*/
#include <sys/param.h>
+#include <sys/systm.h>
#include <sys/mbuf.h>
+#include <netinet/in.h>
/*
* Checksum routine for Internet Protocol family headers.
diff --git a/sys/arch/i386/i386/linux_machdep.c b/sys/arch/i386/i386/linux_machdep.c
index af6bd27e0f5..163dc0d4710 100644
--- a/sys/arch/i386/i386/linux_machdep.c
+++ b/sys/arch/i386/i386/linux_machdep.c
@@ -1,5 +1,5 @@
-/* $OpenBSD: linux_machdep.c,v 1.7 1996/05/02 13:41:16 deraadt Exp $ */
-/* $NetBSD: linux_machdep.c,v 1.28 1996/04/18 08:36:22 mycroft Exp $ */
+/* $OpenBSD: linux_machdep.c,v 1.8 1996/05/07 07:21:42 deraadt Exp $ */
+/* $NetBSD: linux_machdep.c,v 1.29 1996/05/03 19:42:11 christos Exp $ */
/*
* Copyright (c) 1995 Frank van der Linden
@@ -58,6 +58,7 @@
#include <compat/linux/linux_signal.h>
#include <compat/linux/linux_syscallargs.h>
#include <compat/linux/linux_util.h>
+#include <compat/linux/linux_ioctl.h>
#include <machine/cpu.h>
#include <machine/cpufunc.h>
@@ -77,6 +78,14 @@
#include <arch/i386/isa/pcvt/pcvt_ioctl.h>
#endif
+#ifdef USER_LDT
+#include <machine/cpu.h>
+int linux_read_ldt __P((struct proc *, struct linux_sys_modify_ldt_args *,
+ register_t *));
+int linux_write_ldt __P((struct proc *, struct linux_sys_modify_ldt_args *,
+ register_t *));
+#endif
+
/*
* Deal with some i386-specific things in the Linux emulation code.
* This means just signals for now, will include stuff like
@@ -285,10 +294,10 @@ linux_read_ldt(p, uap, retval)
parms = stackgap_alloc(&sg, sizeof(gl));
- if (error = copyout(&gl, parms, sizeof(gl)))
+ if ((error = copyout(&gl, parms, sizeof(gl))) != 0)
return (error);
- if (error = i386_get_ldt(p, parms, retval))
+ if ((error = i386_get_ldt(p, parms, retval)) != 0)
return (error);
*retval *= sizeof(union descriptor);
@@ -325,7 +334,7 @@ linux_write_ldt(p, uap, retval)
if (SCARG(uap, bytecount) != sizeof(ldt_info))
return (EINVAL);
- if (error = copyin(SCARG(uap, ptr), &ldt_info, sizeof(ldt_info)))
+ if ((error = copyin(SCARG(uap, ptr), &ldt_info, sizeof(ldt_info))) != 0)
return error;
if (ldt_info.contents == 3)
return (EINVAL);
@@ -354,12 +363,12 @@ linux_write_ldt(p, uap, retval)
parms = stackgap_alloc(&sg, sizeof(sl));
- if (error = copyout(&sd, sl.desc, sizeof(sd)))
+ if ((error = copyout(&sd, sl.desc, sizeof(sd))) != 0)
return (error);
- if (error = copyout(&sl, parms, sizeof(sl)))
+ if ((error = copyout(&sl, parms, sizeof(sl))) != 0)
return (error);
- if (error = i386_set_ldt(p, parms, retval))
+ if ((error = i386_set_ldt(p, parms, retval)) != 0)
return (error);
*retval = 0;
@@ -424,15 +433,12 @@ linux_machdepioctl(p, v, retval)
syscallarg(u_long) com;
syscallarg(caddr_t) data;
} */ *uap = v;
- struct sys_ioctl_args bia, tmparg;
+ struct sys_ioctl_args bia;
u_long com;
#if NVT > 0
- int error, mode;
+ int error;
struct vt_mode lvt;
caddr_t bvtp, sg;
- u_int fd;
- struct file *fp;
- struct filedesc *fdp;
#endif
SCARG(&bia, fd) = SCARG(uap, fd);
@@ -507,7 +513,7 @@ linux_machdepioctl(p, v, retval)
break;
#endif
default:
- printf("linux_machdepioctl: invalid ioctl %08x\n", com);
+ printf("linux_machdepioctl: invalid ioctl %08lx\n", com);
return EINVAL;
}
SCARG(&bia, com) = com;
@@ -525,9 +531,11 @@ linux_sys_iopl(p, v, retval)
void *v;
register_t *retval;
{
+#if 0
struct linux_sys_iopl_args /* {
syscallarg(int) level;
} */ *uap = v;
+#endif
struct trapframe *fp = p->p_md.md_regs;
if (suser(p->p_ucred, &p->p_acflag) != 0)
diff --git a/sys/arch/i386/i386/locore.s b/sys/arch/i386/i386/locore.s
index 98da327862b..bc0a63fa4ea 100644
--- a/sys/arch/i386/i386/locore.s
+++ b/sys/arch/i386/i386/locore.s
@@ -1,4 +1,4 @@
-/* $NetBSD: locore.s,v 1.144 1996/04/03 05:48:35 mycroft Exp $ */
+/* $NetBSD: locore.s,v 1.145 1996/05/03 19:41:19 christos Exp $ */
/*-
* Copyright (c) 1993, 1994, 1995 Charles M. Hannum. All rights reserved.
@@ -1913,9 +1913,8 @@ ENTRY(switch_exit)
jmp switch_search
/*
- * savectx(struct pcb *pcb, int altreturn);
- * Update pcb, saving current processor state and arranging for alternate
- * return in cpu_switch() if altreturn is true.
+ * savectx(struct pcb *pcb);
+ * Update pcb, saving current processor state.
*/
ENTRY(savectx)
movl 4(%esp),%edx # edx = p->p_addr
diff --git a/sys/arch/i386/i386/machdep.c b/sys/arch/i386/i386/machdep.c
index bf9bc18274d..4cadab7b1b5 100644
--- a/sys/arch/i386/i386/machdep.c
+++ b/sys/arch/i386/i386/machdep.c
@@ -1,5 +1,5 @@
-/* $OpenBSD: machdep.c,v 1.15 1996/05/02 13:41:18 deraadt Exp $ */
-/* $NetBSD: machdep.c,v 1.199 1996/04/18 09:58:13 mycroft Exp $ */
+/* $OpenBSD: machdep.c,v 1.16 1996/05/07 07:21:46 deraadt Exp $ */
+/* $NetBSD: machdep.c,v 1.200 1996/05/03 19:42:15 christos Exp $ */
/*-
* Copyright (c) 1993, 1994, 1995, 1996 Charles M. Hannum. All rights reserved.
@@ -78,6 +78,8 @@
#include <vm/vm_kern.h>
#include <vm/vm_page.h>
+#include <sys/sysctl.h>
+
#include <machine/cpu.h>
#include <machine/cpufunc.h>
#include <machine/gdt.h>
@@ -99,6 +101,13 @@
#include <machine/apmvar.h>
#endif
+#ifdef DDB
+#include <machine/db_machdep.h>
+#include <ddb/db_access.h>
+#include <ddb/db_sym.h>
+#include <ddb/db_extern.h>
+#endif
+
#ifdef VM86
#include <machine/vm86.h>
#endif
@@ -142,11 +151,14 @@ extern vm_offset_t avail_start, avail_end;
static vm_offset_t hole_start, hole_end;
static vm_offset_t avail_next;
-void identifycpu __P((void));
-caddr_t allocsys __P((caddr_t));
-void dumpsys __P((void));
-void cpu_reset __P((void));
-void identifycpu __P((void));
+caddr_t allocsys __P((caddr_t));
+void dumpsys __P((void));
+void identifycpu __P((void));
+void init386 __P((vm_offset_t));
+void consinit __P((void));
+#ifdef COMPAT_NOMID
+static int exec_nomid __P((struct proc *, struct exec_package *));
+#endif
/*
* Machine-dependent startup code
@@ -252,7 +264,7 @@ cpu_startup()
for (i = 1; i < ncallout; i++)
callout[i-1].c_next = &callout[i];
- printf("avail mem = %d\n", ptoa(cnt.v_free_count));
+ printf("avail mem = %ld\n", ptoa(cnt.v_free_count));
printf("using %d buffers containing %d bytes of memory\n",
nbuf, bufpages * CLBYTES);
@@ -371,7 +383,6 @@ struct cpu_nameclass i386_cpus[] = {
void
identifycpu()
{
- int len;
extern char cpu_vendor[];
printf("CPU: ");
@@ -500,6 +511,8 @@ cpu_sysctl(name, namelen, oldp, oldlenp, newp, newlen, p)
}
#ifdef COMPAT_IBCS2
+void ibcs2_sendsig __P((sig_t, int, int, u_long));
+
void
ibcs2_sendsig(catcher, sig, mask, code)
sig_t catcher;
@@ -831,8 +844,7 @@ dumpsys()
int maddr, psize;
daddr_t blkno;
int (*dump) __P((dev_t, daddr_t, caddr_t, size_t));
- int error = 0;
- int c;
+ int error;
/* Save registers. */
savectx(&dumppcb);
@@ -849,7 +861,7 @@ dumpsys()
dumpconf();
if (dumplo < 0)
return;
- printf("\ndumping to dev %x, offset %d\n", dumpdev, dumplo);
+ printf("\ndumping to dev %x, offset %ld\n", dumpdev, dumplo);
psize = (*bdevsw[major(dumpdev)].d_psize)(dumpdev);
printf("dump ");
@@ -867,6 +879,7 @@ dumpsys()
maddr = 0;
blkno = dumplo;
dump = bdevsw[major(dumpdev)].d_dump;
+ error = 0;
for (i = 0; i < bytes; i += n) {
/*
* Avoid dumping the ISA memory hole, and areas that
@@ -1076,9 +1089,7 @@ init386(first_avail)
int x;
unsigned biosbasemem, biosextmem;
struct region_descriptor region;
- extern char etext[], sigcode[], esigcode[];
extern void consinit __P((void));
- extern void lgdt();
proc0.p_addr = proc0paddr;
@@ -1333,7 +1344,6 @@ cpu_exec_aout_prep_oldzmagic(p, epp)
struct exec_package *epp;
{
struct exec *execp = epp->ep_hdr;
- struct exec_vmcmd *ccmdp;
epp->ep_taddr = 0;
epp->ep_tsize = execp->a_text;
diff --git a/sys/arch/i386/i386/mainbus.c b/sys/arch/i386/i386/mainbus.c
index c20a774c307..c820ad08cea 100644
--- a/sys/arch/i386/i386/mainbus.c
+++ b/sys/arch/i386/i386/mainbus.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: mainbus.c,v 1.3 1996/04/29 14:13:25 hvozda Exp $ */
+/* $OpenBSD: mainbus.c,v 1.4 1996/05/07 07:21:47 deraadt Exp $ */
/* $NetBSD: mainbus.c,v 1.8 1996/04/11 22:13:37 cgd Exp $ */
/*
@@ -105,7 +105,11 @@ mainbus_attach(parent, self, aux)
config_found(self, &mba.mba_iba, mainbus_print);
}
+#ifndef AHA284X_HACK
if (!bcmp(ISA_HOLE_VADDR(EISA_ID_PADDR), EISA_ID, EISA_ID_LEN)) {
+#else
+ {
+#endif
mba.mba_eba.eba_busname = "eisa";
mba.mba_eba.eba_bc = NULL;
mba.mba_eba.eba_ec = NULL;
diff --git a/sys/arch/i386/i386/math_emulate.c b/sys/arch/i386/i386/math_emulate.c
index 28afdbd6703..b8df8fef771 100644
--- a/sys/arch/i386/i386/math_emulate.c
+++ b/sys/arch/i386/i386/math_emulate.c
@@ -1,5 +1,5 @@
-/* $OpenBSD: math_emulate.c,v 1.3 1996/03/19 21:09:19 mickey Exp $ */
-/* $NetBSD: math_emulate.c,v 1.16 1996/02/02 18:06:01 mycroft Exp $ */
+/* $OpenBSD: math_emulate.c,v 1.4 1996/05/07 07:21:48 deraadt Exp $ */
+/* $NetBSD: math_emulate.c,v 1.17 1996/05/03 19:42:17 christos Exp $ */
/*
* expediant "port" of linux 8087 emulator to 386BSD, with apologies -wfj
@@ -69,7 +69,9 @@ static temp_real_unaligned * __st(int i);
I387.twd = 0x0000; \
} while (0)
-math_emulate(struct trapframe *info)
+int
+math_emulate(info)
+ struct trapframe *info;
{
u_short code;
temp_real tmp;
@@ -653,7 +655,7 @@ void get_short_int(temp_real * tmp,
addr = ea(info,code);
ti.a = (signed short) fusword((u_short *) addr);
ti.b = 0;
- if (ti.sign = (ti.a < 0))
+ if ((ti.sign = (ti.a < 0)) != 0)
ti.a = - ti.a;
int_to_real(&ti,tmp);
}
@@ -667,7 +669,7 @@ void get_long_int(temp_real * tmp,
addr = ea(info,code);
ti.a = fuword((u_long *) addr);
ti.b = 0;
- if (ti.sign = (ti.a < 0))
+ if ((ti.sign = (ti.a < 0)) != 0)
ti.a = - ti.a;
int_to_real(&ti,tmp);
}
@@ -681,7 +683,7 @@ void get_longlong_int(temp_real * tmp,
addr = ea(info,code);
ti.a = fuword((u_long *) addr);
ti.b = fuword((u_long *) addr + 1);
- if (ti.sign = (ti.b < 0))
+ if ((ti.sign = (ti.b < 0)) != 0)
__asm__("notl %0 ; notl %1\n\t"
"addl $1,%0 ; adcl $0,%1"
:"=r" (ti.a),"=r" (ti.b)
diff --git a/sys/arch/i386/i386/mem.c b/sys/arch/i386/i386/mem.c
index 65805055598..175b016f334 100644
--- a/sys/arch/i386/i386/mem.c
+++ b/sys/arch/i386/i386/mem.c
@@ -1,4 +1,4 @@
-/* $NetBSD: mem.c,v 1.30 1995/10/11 04:19:46 mycroft Exp $ */
+/* $NetBSD: mem.c,v 1.31 1996/05/03 19:42:19 christos Exp $ */
/*
* Copyright (c) 1988 University of Utah.
@@ -45,7 +45,6 @@
*/
#include <sys/param.h>
-#include <sys/conf.h>
#include <sys/buf.h>
#include <sys/systm.h>
#include <sys/uio.h>
@@ -54,6 +53,7 @@
#include <sys/fcntl.h>
#include <machine/cpu.h>
+#include <machine/conf.h>
#include <vm/vm.h>
@@ -62,9 +62,10 @@ caddr_t zeropage;
/*ARGSUSED*/
int
-mmopen(dev, flag, mode)
+mmopen(dev, flag, mode, p)
dev_t dev;
int flag, mode;
+ struct proc *p;
{
switch (minor(dev)) {
@@ -87,9 +88,10 @@ mmopen(dev, flag, mode)
/*ARGSUSED*/
int
-mmclose(dev, flag, mode)
+mmclose(dev, flag, mode, p)
dev_t dev;
int flag, mode;
+ struct proc *p;
{
return (0);
@@ -185,7 +187,6 @@ mmrw(dev, uio, flags)
uio->uio_resid -= c;
}
if (minor(dev) == 0) {
-unlock:
if (physlock > 1)
wakeup((caddr_t)&physlock);
physlock = 0;
diff --git a/sys/arch/i386/i386/ns_cksum.c b/sys/arch/i386/i386/ns_cksum.c
index 1a555f898f9..50accfe6e85 100644
--- a/sys/arch/i386/i386/ns_cksum.c
+++ b/sys/arch/i386/i386/ns_cksum.c
@@ -1,5 +1,5 @@
-/* $OpenBSD: ns_cksum.c,v 1.3 1996/03/19 21:09:21 mickey Exp $ */
-/* $NetBSD: ns_cksum.c,v 1.4 1996/02/02 18:06:03 mycroft Exp $ */
+/* $OpenBSD: ns_cksum.c,v 1.4 1996/05/07 07:21:50 deraadt Exp $ */
+/* $NetBSD: ns_cksum.c,v 1.5 1996/05/03 19:42:20 christos Exp $ */
/*
* Copyright (c) 1982, 1988 Regents of the University of California.
@@ -38,6 +38,7 @@
#include <sys/param.h>
#include <sys/mbuf.h>
+#include <netns/ns_var.h>
/*
* Checksum routine for Network Systems Protocol Packets (Big-Endian).
diff --git a/sys/arch/i386/i386/pmap.c b/sys/arch/i386/i386/pmap.c
index fbc1e161d44..e525220592b 100644
--- a/sys/arch/i386/i386/pmap.c
+++ b/sys/arch/i386/i386/pmap.c
@@ -1,5 +1,5 @@
-/* $OpenBSD: pmap.c,v 1.8 1996/04/21 22:16:33 deraadt Exp $ */
-/* $NetBSD: pmap.c,v 1.35 1996/04/03 08:21:05 mycroft Exp $ */
+/* $OpenBSD: pmap.c,v 1.9 1996/05/07 07:21:51 deraadt Exp $ */
+/* $NetBSD: pmap.c,v 1.36 1996/05/03 19:42:22 christos Exp $ */
/*
* Copyright (c) 1993, 1994, 1995 Charles M. Hannum. All rights reserved.
@@ -80,6 +80,7 @@
*/
#include <sys/param.h>
+#include <sys/systm.h>
#include <sys/proc.h>
#include <sys/malloc.h>
#include <sys/user.h>
@@ -183,7 +184,14 @@ int pv_nfree;
void i386_protection_init __P((void));
pt_entry_t *pmap_pte __P((pmap_t, vm_offset_t));
+struct pv_entry * pmap_alloc_pv __P((void));
+void pmap_free_pv __P((struct pv_entry *));
void i386_protection_init __P((void));
+void pmap_collect_pv __P((void));
+__inline void pmap_remove_pv __P((pmap_t, vm_offset_t, u_int));
+__inline void pmap_enter_pv __P((pmap_t, vm_offset_t, u_int));
+void pmap_deactivate __P((pmap_t, struct pcb *));
+void pmap_remove_all __P((vm_offset_t));
#if BSDVM_COMPAT
#include <sys/msgbuf.h>
@@ -216,9 +224,6 @@ pmap_bootstrap(virtual_start)
vm_offset_t va;
pt_entry_t *pte;
#endif
- extern int physmem;
- extern vm_offset_t reserve_dumppages(vm_offset_t);
-
/* XXX: allow for msgbuf */
avail_end -= i386_round_page(sizeof(struct msgbuf));
@@ -311,9 +316,8 @@ pmap_virtual_space(startp, endp)
void
pmap_init()
{
- vm_offset_t addr, addr2;
+ vm_offset_t addr;
vm_size_t s;
- int rv;
if (PAGE_SIZE != NBPG)
panic("pmap_init: CLSIZE != 1");
@@ -378,7 +382,6 @@ pmap_free_pv(pv)
struct pv_entry *pv;
{
register struct pv_page *pvp;
- register int i;
pvp = (struct pv_page *) trunc_page(pv);
switch (++pvp->pvp_pgi.pgi_nfree) {
@@ -838,7 +841,9 @@ reduce wiring count on page table pages as references drop
*pte = 0;
+#ifndef __GNUC__
next:
+#endif
sva += NBPG;
pte++;
}
@@ -1016,7 +1021,9 @@ pmap_protect(pmap, sva, eva, prot)
i386prot |= PG_u | PG_RW;
pmap_pte_set_prot(pte, i386prot);
+#ifndef __GNUC__
next:
+#endif
sva += NBPG;
pte++;
}
@@ -1089,7 +1096,8 @@ pmap_enter(pmap, va, pa, prot, wired)
/*
* Check for wiring change and adjust statistics.
*/
- if (wired && !pmap_pte_w(pte) || !wired && pmap_pte_w(pte)) {
+ if ((wired && !pmap_pte_w(pte)) ||
+ (!wired && pmap_pte_w(pte))) {
/*
* We don't worry about wiring PT pages as they remain
* resident as long as there are valid mappings in them.
@@ -1255,7 +1263,7 @@ pmap_change_wiring(pmap, va, wired)
}
#endif
- if (wired && !pmap_pte_w(pte) || !wired && pmap_pte_w(pte)) {
+ if ((wired && !pmap_pte_w(pte)) || (!wired && pmap_pte_w(pte))) {
if (wired)
pmap->pm_stats.wired_count++;
else
@@ -1371,12 +1379,6 @@ void
pmap_collect(pmap)
pmap_t pmap;
{
- register vm_offset_t pa;
- register struct pv_entry *pv;
- register pt_entry_t *pte;
- vm_offset_t kpa;
- int s;
-
#ifdef DEBUG
if (pmapdebug & PDB_FOLLOW)
printf("pmap_collect(%x) ", pmap);
diff --git a/sys/arch/i386/i386/pmap.old.c b/sys/arch/i386/i386/pmap.old.c
index f9e2ecca669..81acff1a817 100644
--- a/sys/arch/i386/i386/pmap.old.c
+++ b/sys/arch/i386/i386/pmap.old.c
@@ -1,5 +1,5 @@
-/* $OpenBSD: pmap.old.c,v 1.8 1996/04/21 22:16:33 deraadt Exp $ */
-/* $NetBSD: pmap.c,v 1.35 1996/04/03 08:21:05 mycroft Exp $ */
+/* $OpenBSD: pmap.old.c,v 1.9 1996/05/07 07:21:51 deraadt Exp $ */
+/* $NetBSD: pmap.c,v 1.36 1996/05/03 19:42:22 christos Exp $ */
/*
* Copyright (c) 1993, 1994, 1995 Charles M. Hannum. All rights reserved.
@@ -80,6 +80,7 @@
*/
#include <sys/param.h>
+#include <sys/systm.h>
#include <sys/proc.h>
#include <sys/malloc.h>
#include <sys/user.h>
@@ -183,7 +184,14 @@ int pv_nfree;
void i386_protection_init __P((void));
pt_entry_t *pmap_pte __P((pmap_t, vm_offset_t));
+struct pv_entry * pmap_alloc_pv __P((void));
+void pmap_free_pv __P((struct pv_entry *));
void i386_protection_init __P((void));
+void pmap_collect_pv __P((void));
+__inline void pmap_remove_pv __P((pmap_t, vm_offset_t, u_int));
+__inline void pmap_enter_pv __P((pmap_t, vm_offset_t, u_int));
+void pmap_deactivate __P((pmap_t, struct pcb *));
+void pmap_remove_all __P((vm_offset_t));
#if BSDVM_COMPAT
#include <sys/msgbuf.h>
@@ -216,9 +224,6 @@ pmap_bootstrap(virtual_start)
vm_offset_t va;
pt_entry_t *pte;
#endif
- extern int physmem;
- extern vm_offset_t reserve_dumppages(vm_offset_t);
-
/* XXX: allow for msgbuf */
avail_end -= i386_round_page(sizeof(struct msgbuf));
@@ -311,9 +316,8 @@ pmap_virtual_space(startp, endp)
void
pmap_init()
{
- vm_offset_t addr, addr2;
+ vm_offset_t addr;
vm_size_t s;
- int rv;
if (PAGE_SIZE != NBPG)
panic("pmap_init: CLSIZE != 1");
@@ -378,7 +382,6 @@ pmap_free_pv(pv)
struct pv_entry *pv;
{
register struct pv_page *pvp;
- register int i;
pvp = (struct pv_page *) trunc_page(pv);
switch (++pvp->pvp_pgi.pgi_nfree) {
@@ -838,7 +841,9 @@ reduce wiring count on page table pages as references drop
*pte = 0;
+#ifndef __GNUC__
next:
+#endif
sva += NBPG;
pte++;
}
@@ -1016,7 +1021,9 @@ pmap_protect(pmap, sva, eva, prot)
i386prot |= PG_u | PG_RW;
pmap_pte_set_prot(pte, i386prot);
+#ifndef __GNUC__
next:
+#endif
sva += NBPG;
pte++;
}
@@ -1089,7 +1096,8 @@ pmap_enter(pmap, va, pa, prot, wired)
/*
* Check for wiring change and adjust statistics.
*/
- if (wired && !pmap_pte_w(pte) || !wired && pmap_pte_w(pte)) {
+ if ((wired && !pmap_pte_w(pte)) ||
+ (!wired && pmap_pte_w(pte))) {
/*
* We don't worry about wiring PT pages as they remain
* resident as long as there are valid mappings in them.
@@ -1255,7 +1263,7 @@ pmap_change_wiring(pmap, va, wired)
}
#endif
- if (wired && !pmap_pte_w(pte) || !wired && pmap_pte_w(pte)) {
+ if ((wired && !pmap_pte_w(pte)) || (!wired && pmap_pte_w(pte))) {
if (wired)
pmap->pm_stats.wired_count++;
else
@@ -1371,12 +1379,6 @@ void
pmap_collect(pmap)
pmap_t pmap;
{
- register vm_offset_t pa;
- register struct pv_entry *pv;
- register pt_entry_t *pte;
- vm_offset_t kpa;
- int s;
-
#ifdef DEBUG
if (pmapdebug & PDB_FOLLOW)
printf("pmap_collect(%x) ", pmap);
diff --git a/sys/arch/i386/i386/process_machdep.c b/sys/arch/i386/i386/process_machdep.c
index 77f72d55bc4..8d2c12dc019 100644
--- a/sys/arch/i386/i386/process_machdep.c
+++ b/sys/arch/i386/i386/process_machdep.c
@@ -1,5 +1,5 @@
-/* $OpenBSD: process_machdep.c,v 1.4 1996/04/21 22:16:34 deraadt Exp $ */
-/* $NetBSD: process_machdep.c,v 1.21 1996/04/11 07:47:48 mycroft Exp $ */
+/* $OpenBSD: process_machdep.c,v 1.5 1996/05/07 07:21:53 deraadt Exp $ */
+/* $NetBSD: process_machdep.c,v 1.22 1996/05/03 19:42:25 christos Exp $ */
/*
* Copyright (c) 1995, 1996 Charles M. Hannum. All rights reserved.
@@ -81,7 +81,10 @@
#include <machine/vm86.h>
#endif
-static inline struct trapframe *
+static __inline struct trapframe *process_frame __P((struct proc *));
+static __inline struct save87 *process_fpframe __P((struct proc *));
+
+static __inline struct trapframe *
process_frame(p)
struct proc *p;
{
@@ -89,7 +92,7 @@ process_frame(p)
return (p->p_md.md_regs);
}
-static inline struct save87 *
+static __inline struct save87 *
process_fpframe(p)
struct proc *p;
{
diff --git a/sys/arch/i386/i386/svr4_machdep.c b/sys/arch/i386/i386/svr4_machdep.c
index 86611d50679..d365cfcf0d3 100644
--- a/sys/arch/i386/i386/svr4_machdep.c
+++ b/sys/arch/i386/i386/svr4_machdep.c
@@ -1,5 +1,5 @@
-/* $OpenBSD: svr4_machdep.c,v 1.5 1996/05/02 13:41:20 deraadt Exp $ */
-/* $NetBSD: svr4_machdep.c,v 1.23 1996/04/18 08:36:31 mycroft Exp $ */
+/* $OpenBSD: svr4_machdep.c,v 1.6 1996/05/07 07:21:54 deraadt Exp $ */
+/* $NetBSD: svr4_machdep.c,v 1.24 1996/05/03 19:42:26 christos Exp $ */
/*
* Copyright (c) 1994 Christos Zoulas
@@ -138,7 +138,6 @@ svr4_setcontext(p, uc)
struct proc *p;
struct svr4_ucontext *uc;
{
- struct sigcontext *scp, context;
struct sigacts *psp = p->p_sigacts;
register struct trapframe *tf;
svr4_greg_t *r = uc->uc_mcontext.greg;
@@ -298,7 +297,7 @@ svr4_getsiginfo(si, sig, code, addr)
si->si_code = 0;
si->si_trap = 0;
#ifdef DIAGNOSTIC
- printf("sig %d code %d\n", sig, code);
+ printf("sig %d code %ld\n", sig, code);
panic("svr4_getsiginfo");
#endif
break;
@@ -360,8 +359,10 @@ svr4_sendsig(catcher, sig, mask, code)
frame.sf_sip = &fp->sf_si;
frame.sf_ucp = &fp->sf_uc;
frame.sf_handler = catcher;
- printf("sig = %d, sip %x, ucp = %x, handler = %x\n",
+#ifdef DEBUG_SVR4
+ printf("sig = %d, sip %p, ucp = %p, handler = %p\n",
frame.sf_signum, frame.sf_sip, frame.sf_ucp, frame.sf_handler);
+#endif
if (copyout(&frame, fp, sizeof(frame)) != 0) {
/*
@@ -471,7 +472,7 @@ svr4_sys_sysarch(p, v, retval)
#endif
default:
- printf("svr4_sysarch(%d), a1 %x\n", SCARG(uap, op),
+ printf("svr4_sysarch(%d), a1 %p\n", SCARG(uap, op),
SCARG(uap, a1));
return 0;
}
diff --git a/sys/arch/i386/i386/swapgeneric.c b/sys/arch/i386/i386/swapgeneric.c
index cdacbffb6b0..43ea663cdbf 100644
--- a/sys/arch/i386/i386/swapgeneric.c
+++ b/sys/arch/i386/i386/swapgeneric.c
@@ -1,5 +1,5 @@
-/* $OpenBSD: swapgeneric.c,v 1.4 1996/04/21 22:16:39 deraadt Exp $ */
-/* $NetBSD: swapgeneric.c,v 1.11 1996/04/03 09:15:26 mycroft Exp $ */
+/* $OpenBSD: swapgeneric.c,v 1.5 1996/05/07 07:21:55 deraadt Exp $ */
+/* $NetBSD: swapgeneric.c,v 1.12 1996/05/03 19:42:28 christos Exp $ */
/*-
* Copyright (c) 1990 The Regents of the University of California.
@@ -47,7 +47,10 @@
#include <sys/device.h>
#include <sys/disklabel.h>
+#include <dev/cons.h>
+
#include <machine/pte.h>
+#include <machine/cpu.h>
#include "wdc.h"
#include "fdc.h"
@@ -108,8 +111,8 @@ struct genericconf {
{ 0 }
};
-extern int ffs_mountroot();
-int (*mountroot)() = ffs_mountroot;
+extern int ffs_mountroot __P((void *));
+int (*mountroot) __P((void *)) = ffs_mountroot;
void gets __P((char *));
diff --git a/sys/arch/i386/i386/sys_machdep.c b/sys/arch/i386/i386/sys_machdep.c
index 412f5f128a9..bf9981887a1 100644
--- a/sys/arch/i386/i386/sys_machdep.c
+++ b/sys/arch/i386/i386/sys_machdep.c
@@ -1,4 +1,4 @@
-/* $NetBSD: sys_machdep.c,v 1.27 1996/01/08 13:51:36 mycroft Exp $ */
+/* $NetBSD: sys_machdep.c,v 1.28 1996/05/03 19:42:29 christos Exp $ */
/*-
* Copyright (c) 1995 Charles M. Hannum. All rights reserved.
@@ -72,9 +72,18 @@
extern vm_map_t kernel_map;
+#ifdef USER_LDT
+int i386_get_ldt __P((struct proc *, char *, register_t *));
+int i386_set_ldt __P((struct proc *, char *, register_t *));
+#endif
+int i386_iopl __P((struct proc *, char *, register_t *));
+int i386_get_ioperm __P((struct proc *, char *, register_t *));
+int i386_set_ioperm __P((struct proc *, char *, register_t *));
+
#ifdef TRACE
int nvualarm;
+int
sys_vtrace(p, v, retval)
struct proc *p;
void *v;
@@ -160,7 +169,7 @@ i386_get_ldt(p, args, retval)
union descriptor *lp;
struct i386_get_ldt_args ua;
- if (error = copyin(args, &ua, sizeof(ua)))
+ if ((error = copyin(args, &ua, sizeof(ua))) != 0)
return (error);
#ifdef DEBUG
@@ -185,7 +194,8 @@ i386_get_ldt(p, args, retval)
lp += ua.start;
num = min(ua.num, nldt - ua.start);
- if (error = copyout(lp, ua.desc, num * sizeof(union descriptor)))
+ error = copyout(lp, ua.desc, num * sizeof(union descriptor));
+ if (error)
return (error);
*retval = num;
@@ -205,7 +215,7 @@ i386_set_ldt(p, args, retval)
struct i386_set_ldt_args ua;
union descriptor desc;
- if (error = copyin(args, &ua, sizeof(ua)))
+ if ((error = copyin(args, &ua, sizeof(ua))) != 0)
return (error);
#ifdef DEBUG
@@ -258,10 +268,11 @@ i386_set_ldt(p, args, retval)
savectx(curpcb);
fsslot = IDXSEL(pcb->pcb_fs);
gsslot = IDXSEL(pcb->pcb_gs);
+ error = 0;
/* Check descriptors for access violations. */
for (i = 0, n = ua.start; i < ua.num; i++, n++) {
- if (error = copyin(&ua.desc[i], &desc, sizeof(desc)))
+ if ((error = copyin(&ua.desc[i], &desc, sizeof(desc))) != 0)
return (error);
switch (desc.sd.sd_type) {
@@ -315,7 +326,7 @@ i386_set_ldt(p, args, retval)
/* Now actually replace the descriptors. */
for (i = 0, n = ua.start; i < ua.num; i++, n++) {
- if (error = copyin(&ua.desc[i], &desc, sizeof(desc)))
+ if ((error = copyin(&ua.desc[i], &desc, sizeof(desc))) != 0)
goto out;
pcb->pcb_ldt[n] = desc;
@@ -339,10 +350,10 @@ i386_iopl(p, args, retval)
struct trapframe *tf = p->p_md.md_regs;
struct i386_iopl_args ua;
- if (error = suser(p->p_ucred, &p->p_acflag))
+ if ((error = suser(p->p_ucred, &p->p_acflag)) != 0)
return error;
- if (error = copyin(args, &ua, sizeof(ua)))
+ if ((error = copyin(args, &ua, sizeof(ua))) != 0)
return error;
if (ua.iopl)
@@ -363,7 +374,7 @@ i386_get_ioperm(p, args, retval)
struct pcb *pcb = &p->p_addr->u_pcb;
struct i386_get_ioperm_args ua;
- if (error = copyin(args, &ua, sizeof(ua)))
+ if ((error = copyin(args, &ua, sizeof(ua))) != 0)
return (error);
return copyout(pcb->pcb_iomap, ua.iomap, sizeof(pcb->pcb_iomap));
@@ -379,10 +390,10 @@ i386_set_ioperm(p, args, retval)
struct pcb *pcb = &p->p_addr->u_pcb;
struct i386_set_ioperm_args ua;
- if (error = suser(p->p_ucred, &p->p_acflag))
+ if ((error = suser(p->p_ucred, &p->p_acflag)) != 0)
return error;
- if (error = copyin(args, &ua, sizeof(ua)))
+ if ((error = copyin(args, &ua, sizeof(ua))) != 0)
return (error);
return copyin(ua.iomap, pcb->pcb_iomap, sizeof(pcb->pcb_iomap));
diff --git a/sys/arch/i386/i386/trap.c b/sys/arch/i386/i386/trap.c
index d6032193441..6a71ed55b46 100644
--- a/sys/arch/i386/i386/trap.c
+++ b/sys/arch/i386/i386/trap.c
@@ -1,5 +1,5 @@
-/* $OpenBSD: trap.c,v 1.8 1996/05/04 09:24:07 deraadt Exp $ */
-/* $NetBSD: trap.c,v 1.93 1996/04/15 00:20:32 mycroft Exp $ */
+/* $OpenBSD: trap.c,v 1.9 1996/05/07 07:21:57 deraadt Exp $ */
+/* $NetBSD: trap.c,v 1.94 1996/05/03 19:42:31 christos Exp $ */
#undef DEBUG
#define DEBUG
@@ -67,6 +67,9 @@
#include <machine/psl.h>
#include <machine/reg.h>
#include <machine/trap.h>
+#ifdef DDB
+#include <machine/db_machdep.h>
+#endif
#ifdef COMPAT_IBCS2
#include <compat/ibcs2/ibcs2_errno.h>
@@ -84,11 +87,16 @@ extern struct emul emul_freebsd;
#include "npx.h"
+static __inline void userret __P((struct proc *, int, u_quad_t));
+void trap __P((struct trapframe));
+int trapwrite __P((unsigned));
+void syscall __P((struct trapframe));
+
/*
* Define the code needed before returning to user mode, for
* trap and syscall.
*/
-static inline void
+static __inline void
userret(p, pc, oticks)
register struct proc *p;
int pc;
@@ -173,7 +181,7 @@ trap(frame)
register struct proc *p = curproc;
int type = frame.tf_trapno;
u_quad_t sticks;
- struct pcb *pcb;
+ struct pcb *pcb = NULL;
extern char fusubail[],
resume_iret[], resume_pop_ds[], resume_pop_es[];
struct trapframe *vframe;
@@ -186,7 +194,7 @@ trap(frame)
printf("trap %d code %x eip %x cs %x eflags %x cr2 %x cpl %x\n",
frame.tf_trapno, frame.tf_err, frame.tf_eip, frame.tf_cs,
frame.tf_eflags, rcr2(), cpl);
- printf("curproc %x\n", curproc);
+ printf("curproc %p\n", curproc);
}
#endif
@@ -363,7 +371,7 @@ trap(frame)
#ifdef DIAGNOSTIC
if (map == kernel_map && va == 0) {
- printf("trap: bad kernel access at %x\n", va);
+ printf("trap: bad kernel access at %lx\n", va);
goto we_re_toast;
}
#endif
@@ -409,7 +417,7 @@ trap(frame)
if (type == T_PAGEFLT) {
if (pcb->pcb_onfault != 0)
goto copyfault;
- printf("vm_fault(%x, %x, %x, 0) -> %x\n",
+ printf("vm_fault(%p, %lx, %x, 0) -> %x\n",
map, va, ftype, rv);
goto we_re_toast;
}
@@ -426,7 +434,9 @@ trap(frame)
case T_BPTFLT|T_USER: /* bpt instruction fault */
case T_TRCTRAP|T_USER: /* trace trap */
+#ifdef MATH_EMULATE
trace:
+#endif
trapsignal(p, SIGTRAP, type &~ T_USER);
break;
diff --git a/sys/arch/i386/i386/vm86.c b/sys/arch/i386/i386/vm86.c
index 9dda35ab6de..18cf71c06d8 100644
--- a/sys/arch/i386/i386/vm86.c
+++ b/sys/arch/i386/i386/vm86.c
@@ -1,5 +1,5 @@
-/* $OpenBSD: vm86.c,v 1.5 1996/05/02 13:42:56 deraadt Exp $ */
-/* $NetBSD: vm86.c,v 1.13 1996/04/25 13:50:21 mycroft Exp $ */
+/* $OpenBSD: vm86.c,v 1.6 1996/05/07 07:21:58 deraadt Exp $ */
+/* $NetBSD: vm86.c,v 1.15 1996/05/03 19:42:33 christos Exp $ */
/*-
* Copyright (c) 1996 The NetBSD Foundation, Inc.
@@ -73,6 +73,7 @@
#include <machine/vm86.h>
static void fast_intxx __P((struct proc *, int));
+static __inline int is_bitset __P((int, caddr_t));
#define SETDIRECT ((~(PSL_USERSTATIC|PSL_NT)) & 0xffff)
#define GETDIRECT (SETDIRECT|0x02a) /* add in two MBZ bits */
@@ -143,7 +144,7 @@ __asm__ __volatile__( \
__res; })
-static __inline__ int
+static __inline int
is_bitset(nr, bitmap)
int nr;
caddr_t bitmap;
@@ -178,7 +179,6 @@ fast_intxx(p, intrno)
struct vm86_struct *u_vm86p;
struct { u_short ip, cs; } ihand;
- u_short cs;
u_long ss, sp;
/*
@@ -189,12 +189,10 @@ fast_intxx(p, intrno)
u_vm86p = (struct vm86_struct *)p->p_addr->u_pcb.vm86_userp;
/*
- * If coming from BIOS segment, or going to BIOS segment, or user
- * requested special handling, return to user space with indication
- * of which INT was requested.
+ * If user requested special handling, return to user space with
+ * indication of which INT was requested.
*/
- cs = CS(tf);
- if (cs == BIOSSEG || is_bitset(intrno, &u_vm86p->int_byuser[0]))
+ if (is_bitset(intrno, &u_vm86p->int_byuser[0]))
goto vector;
/*
@@ -212,9 +210,6 @@ fast_intxx(p, intrno)
if (copyin((caddr_t)(intrno * sizeof(ihand)), &ihand, sizeof(ihand)))
goto bad;
- if (ihand.cs == BIOSSEG)
- goto vector;
-
/*
* Otherwise, push flags, cs, eip, and jump to handler to
* simulate direct INT call.
@@ -230,9 +225,6 @@ fast_intxx(p, intrno)
IP(tf) = ihand.ip;
CS(tf) = ihand.cs;
- /* disable further "hardware" interrupts, turn off any tracing. */
- tf->tf_eflags &= ~PSL_T;
- clr_vif(p);
return;
vector:
diff --git a/sys/arch/i386/i386/vm_machdep.c b/sys/arch/i386/i386/vm_machdep.c
index 36ccc371555..1e53a0a5b9d 100644
--- a/sys/arch/i386/i386/vm_machdep.c
+++ b/sys/arch/i386/i386/vm_machdep.c
@@ -1,5 +1,5 @@
-/* $OpenBSD: vm_machdep.c,v 1.10 1996/05/02 13:40:28 deraadt Exp $ */
-/* $NetBSD: vm_machdep.c,v 1.60 1996/04/25 01:15:41 christos Exp $ */
+/* $OpenBSD: vm_machdep.c,v 1.11 1996/05/07 07:21:59 deraadt Exp $ */
+/* $NetBSD: vm_machdep.c,v 1.61 1996/05/03 19:42:35 christos Exp $ */
/*-
* Copyright (c) 1995 Charles M. Hannum. All rights reserved.
@@ -55,6 +55,7 @@
#include <sys/user.h>
#include <sys/core.h>
#include <sys/exec.h>
+#include <sys/ptrace.h>
#include <vm/vm.h>
#include <vm/vm_kern.h>
@@ -69,6 +70,8 @@
extern struct proc *npxproc;
#endif
+void setredzone __P((u_short *, caddr_t));
+
/*
* Finish a fork operation, with process p2 nearly set up.
* Copy and update the kernel stack and pcb, making the child
@@ -85,7 +88,6 @@ cpu_fork(p1, p2)
register struct pcb *pcb = &p2->p_addr->u_pcb;
register struct trapframe *tf;
register struct switchframe *sf;
- extern void proc_trampoline(), child_return();
#if NNPX > 0
/*
diff --git a/sys/arch/i386/include/bus.h b/sys/arch/i386/include/bus.h
index 9be52434632..b4009050c5b 100644
--- a/sys/arch/i386/include/bus.h
+++ b/sys/arch/i386/include/bus.h
@@ -1,5 +1,5 @@
-/* $OpenBSD: bus.h,v 1.3 1996/04/27 22:18:16 niklas Exp $ */
-/* $NetBSD: bus.h,v 1.2 1996/04/05 23:59:37 thorpej Exp $ */
+/* $OpenBSD: bus.h,v 1.4 1996/05/07 07:22:03 deraadt Exp $ */
+/* $NetBSD: bus.h,v 1.3 1996/05/03 19:22:18 christos Exp $ */
/*
* Copyright (c) 1996 Christopher G. Demetriou. All rights reserved.
@@ -56,40 +56,40 @@ typedef u_long bus_io_handle_t;
typedef caddr_t bus_mem_handle_t;
#define bus_io_map(t, port, size, iohp) \
- (*iohp = port, 0)
+ ((void) t, *iohp = port, 0)
#define bus_io_unmap(t, ioh, size)
-#define bus_io_read_1(t, h, o) inb((h) + (o))
-#define bus_io_read_2(t, h, o) inw((h) + (o))
-#define bus_io_read_4(t, h, o) inl((h) + (o))
+#define bus_io_read_1(t, h, o) ((void) t, inb((h) + (o)))
+#define bus_io_read_2(t, h, o) ((void) t, inw((h) + (o)))
+#define bus_io_read_4(t, h, o) ((void) t, inl((h) + (o)))
#if 0 /* Cause a link error for bus_io_read_8 */
#define bus_io_read_8(t, h, o) !!! bus_io_read_8 unimplemented !!!
#endif
#define bus_io_read_multi_1(t, h, o, a, c) \
- insb((h) + (o), (a), (c))
+ ((void) t, insb((h) + (o), (a), (c)))
#define bus_io_read_multi_2(t, h, o, a, c) \
- insw((h) + (o), (a), (c))
+ ((void) t, insw((h) + (o), (a), (c)))
#define bus_io_read_multi_4(t, h, o, a, c) \
- insl((h) + (o), (a), (c))
+ ((void) t, insl((h) + (o), (a), (c)))
#if 0 /* Cause a link error for bus_io_read_multi_8 */
#define bus_io_read_multi_8(t, h, o, a, c) \
!!! bus_io_read_multi_8 unimplemented !!!
#endif
-#define bus_io_write_1(t, h, o, v) outb((h) + (o), (v))
-#define bus_io_write_2(t, h, o, v) outw((h) + (o), (v))
-#define bus_io_write_4(t, h, o, v) outl((h) + (o), (v))
+#define bus_io_write_1(t, h, o, v) ((void) t, outb((h) + (o), (v)))
+#define bus_io_write_2(t, h, o, v) ((void) t, outw((h) + (o), (v)))
+#define bus_io_write_4(t, h, o, v) ((void) t, outl((h) + (o), (v)))
#if 0 /* Cause a link error for bus_io_write_8 */
#define bus_io_write_8(t, h, o, v) !!! bus_io_write_8 unimplemented !!!
#endif
#define bus_io_write_multi_1(t, h, o, a, c) \
- outsb((h) + (o), (a), (c))
+ ((void) t, outsb((h) + (o), (a), (c)))
#define bus_io_write_multi_2(t, h, o, a, c) \
- outsw((h) + (o), (a), (c))
+ ((void) t, outsw((h) + (o), (a), (c)))
#define bus_io_write_multi_4(t, h, o, a, c) \
- outsl((h) + (o), (a), (c))
+ ((void) t, outsl((h) + (o), (a), (c)))
#if 0 /* Cause a link error for bus_io_write_multi_8 */
#define bus_io_write_multi_8(t, h, o, a, c) \
!!! bus_io_write_multi_8 unimplimented !!!
@@ -100,19 +100,19 @@ int bus_mem_map __P((bus_chipset_tag_t t, bus_mem_addr_t bpa,
void bus_mem_unmap __P((bus_chipset_tag_t t, bus_mem_handle_t memh,
bus_mem_size_t size));
-#define bus_mem_read_1(t, h, o) (*(volatile u_int8_t *)((h) + (o)))
-#define bus_mem_read_2(t, h, o) (*(volatile u_int16_t *)((h) + (o)))
-#define bus_mem_read_4(t, h, o) (*(volatile u_int32_t *)((h) + (o)))
-#define bus_mem_read_8(t, h, o) (*(volatile u_int64_t *)((h) + (o)))
+#define bus_mem_read_1(t, h, o) ((void) t, (*(volatile u_int8_t *)((h) + (o))))
+#define bus_mem_read_2(t, h, o) ((void) t, (*(volatile u_int16_t *)((h) + (o))))
+#define bus_mem_read_4(t, h, o) ((void) t, (*(volatile u_int32_t *)((h) + (o))))
+#define bus_mem_read_8(t, h, o) ((void) t, (*(volatile u_int64_t *)((h) + (o))))
#define bus_mem_write_1(t, h, o, v) \
- ((void)(*(volatile u_int8_t *)((h) + (o)) = (v)))
+ ((void) t, ((void)(*(volatile u_int8_t *)((h) + (o)) = (v))))
#define bus_mem_write_2(t, h, o, v) \
- ((void)(*(volatile u_int16_t *)((h) + (o)) = (v)))
+ ((void) t, ((void)(*(volatile u_int16_t *)((h) + (o)) = (v))))
#define bus_mem_write_4(t, h, o, v) \
- ((void)(*(volatile u_int32_t *)((h) + (o)) = (v)))
+ ((void) t, ((void)(*(volatile u_int32_t *)((h) + (o)) = (v))))
#define bus_mem_write_8(t, h, o, v) \
- ((void)(*(volatile u_int64_t *)((h) + (o)) = (v)))
+ ((void) t, ((void)(*(volatile u_int64_t *)((h) + (o)) = (v))))
/* These are extensions to the general NetBSD bus interface. */
#define bus_to_host_2(t, v) (v)
diff --git a/sys/arch/i386/include/conf.h b/sys/arch/i386/include/conf.h
new file mode 100644
index 00000000000..2b9ef1b6157
--- /dev/null
+++ b/sys/arch/i386/include/conf.h
@@ -0,0 +1,62 @@
+/* $NetBSD: conf.h,v 1.1 1996/05/03 19:34:11 christos Exp $ */
+
+/*
+ * Copyright (c) 1996 Christos Zoulas. All rights reserved.
+ *
+ * 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 Christos Zoulas.
+ * 4. The name of the author may not be used to endorse or promote products
+ * derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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.
+ */
+
+#include <sys/conf.h>
+
+#define mmread mmrw
+#define mmwrite mmrw
+cdev_decl(mm);
+cdev_decl(pms);
+
+bdev_decl(fd);
+cdev_decl(fd);
+
+/* open, close, read, write, ioctl, tty, mmap */
+#define cdev_pc_init(c,n) { \
+ dev_init(c,n,open), dev_init(c,n,close), dev_init(c,n,read), \
+ dev_init(c,n,write), dev_init(c,n,ioctl), dev_init(c,n,stop), \
+ dev_init(c,n,tty), ttselect, dev_init(c,n,mmap), D_TTY }
+
+cdev_decl(pc);
+
+/* open, close, write, ioctl */
+#define cdev_spkr_init(c,n) { \
+ dev_init(c,n,open), dev_init(c,n,close), (dev_type_read((*))) enodev, \
+ dev_init(c,n,write), dev_init(c,n,ioctl), (dev_type_stop((*))) enodev, \
+ 0, seltrue, (dev_type_mmap((*))) enodev }
+
+cdev_decl(spkr);
+
+cdev_decl(mms);
+
+cdev_decl(lms);
+
+cdev_decl(pms);
diff --git a/sys/arch/i386/include/cpu.h b/sys/arch/i386/include/cpu.h
index 373fc86995a..00810f898c6 100644
--- a/sys/arch/i386/include/cpu.h
+++ b/sys/arch/i386/include/cpu.h
@@ -1,4 +1,4 @@
-/* $NetBSD: cpu.h,v 1.33 1996/03/29 00:23:28 mycroft Exp $ */
+/* $NetBSD: cpu.h,v 1.34 1996/05/03 19:22:49 christos Exp $ */
/*-
* Copyright (c) 1990 The Regents of the University of California.
@@ -141,8 +141,63 @@ extern struct cpu_nameclass i386_cpus[];
#ifdef I586_CPU
extern int pentium_mhz;
#endif
+
+/* autoconf.c */
+void configure __P((void));
+
+/* machdep.c */
+void delay __P((int));
+void dumpconf __P((void));
+void cpu_reset __P((void));
+
+/* locore.s */
+struct region_descriptor;
+void lgdt __P((struct region_descriptor *));
+void fillw __P((int, caddr_t, size_t));
+
+struct pcb;
+void savectx __P((struct pcb *));
+void switch_exit __P((struct proc *));
+void proc_trampoline __P((void));
+
+/* clock.c */
+void startrtclock __P((void));
+
+/* npx.c */
+void npxdrop __P((void));
+void npxsave __P((void));
+
+#ifdef MATH_EMULATE
+/* math_emulate.c */
+int math_emulate __P((struct trapframe *));
#endif
+#ifdef USER_LDT
+/* sys_machdep.h */
+void i386_user_cleanup __P((struct pcb *));
+int i386_get_ldt __P((struct proc *, char *, register_t *));
+int i386_set_ldt __P((struct proc *, char *, register_t *));
+#endif
+
+/* isa_machdep.c */
+void isa_defaultirq __P((void));
+int isa_nmi __P((void));
+
+#ifdef VM86
+/* vm86.c */
+void vm86_gpfault __P((struct proc *, int));
+#endif /* VM86 */
+
+/* trap.c */
+void child_return __P((struct proc *, struct trapframe));
+
+#ifdef GENERIC
+/* swapgeneric.c */
+void setconf __P((void));
+#endif /* GENERIC */
+
+#endif /* _KERNEL */
+
/*
* CTL_MACHDEP definitions.
*/
diff --git a/sys/arch/i386/include/db_machdep.h b/sys/arch/i386/include/db_machdep.h
index 45ddf8cdef2..a2d26ded1f0 100644
--- a/sys/arch/i386/include/db_machdep.h
+++ b/sys/arch/i386/include/db_machdep.h
@@ -1,4 +1,4 @@
-/* $NetBSD: db_machdep.h,v 1.8 1994/10/27 04:16:02 cgd Exp $ */
+/* $NetBSD: db_machdep.h,v 1.9 1996/05/03 19:23:59 christos Exp $ */
/*
* Mach Operating System
@@ -85,8 +85,10 @@ db_regs_t ddb_regs; /* register state */
((!(user) && DB_VALID_KERN_ADDR(addr)) || \
((user) && (addr) < VM_MAX_ADDRESS))
-boolean_t db_check_access(/* vm_offset_t, int, task_t */);
-boolean_t db_phys_eq(/* task_t, vm_offset_t, task_t, vm_offset_t */);
+#if 0
+boolean_t db_check_access __P((vm_offset_t, int, task_t));
+boolean_t db_phys_eq __P((task_t, vm_offset_t, task_t, vm_offset_t));
+#endif
/* macros for printing OS server dependent task name */
@@ -95,10 +97,14 @@ boolean_t db_phys_eq(/* task_t, vm_offset_t, task_t, vm_offset_t */);
#define DB_TASK_NAME_LEN 23
#define DB_NULL_TASK_NAME "? "
+#if 0
void db_task_name(/* task_t */);
+#endif
/* macro for checking if a thread has used floating-point */
#define db_thread_fp_used(thread) ((thread)->pcb->ims.ifps != 0)
+int kdb_trap __P((int, int, db_regs_t *));
+
#endif /* _I386_DB_MACHDEP_H_ */
diff --git a/sys/arch/i386/include/endian.h b/sys/arch/i386/include/endian.h
index 056a456a205..73581faea19 100644
--- a/sys/arch/i386/include/endian.h
+++ b/sys/arch/i386/include/endian.h
@@ -1,4 +1,4 @@
-/* $NetBSD: endian.h,v 1.16 1995/06/01 17:19:18 mycroft Exp $ */
+/* $NetBSD: endian.h,v 1.17 1996/05/03 19:25:23 christos Exp $ */
/*
* Copyright (c) 1995 Charles M. Hannum. All rights reserved.
@@ -60,10 +60,10 @@
#include <sys/cdefs.h>
__BEGIN_DECLS
-unsigned long htonl __P((unsigned long));
-unsigned short htons __P((unsigned short));
-unsigned long ntohl __P((unsigned long));
-unsigned short ntohs __P((unsigned short));
+u_int32_t htonl __P((u_int32_t));
+u_int16_t htons __P((u_int16_t));
+u_int32_t ntohl __P((u_int32_t));
+u_int16_t ntohs __P((u_int16_t));
__END_DECLS
@@ -71,14 +71,14 @@ __END_DECLS
#if defined(_KERNEL) && !defined(I386_CPU)
#define __byte_swap_long_variable(x) \
-({ register unsigned long __x = (x); \
+({ register u_int32_t __x = (x); \
__asm ("bswap %1" \
: "=r" (__x) \
: "0" (__x)); \
__x; })
#else
#define __byte_swap_long_variable(x) \
-({ register unsigned long __x = (x); \
+({ register u_int32_t __x = (x); \
__asm ("rorw $8, %w1\n\trorl $16, %1\n\trorw $8, %w1" \
: "=r" (__x) \
: "0" (__x)); \
@@ -86,7 +86,7 @@ __END_DECLS
#endif /* _KERNEL && ... */
#define __byte_swap_word_variable(x) \
-({ register unsigned short __x = (x); \
+({ register u_int16_t __x = (x); \
__asm ("rorw $8, %w1" \
: "=r" (__x) \
: "0" (__x)); \
@@ -127,10 +127,10 @@ __END_DECLS
/*
* Macros for network/external number representation conversion.
*/
-#define NTOHL(x) (x) = ntohl((unsigned long)(x))
-#define NTOHS(x) (x) = ntohs((unsigned short)(x))
-#define HTONL(x) (x) = htonl((unsigned long)(x))
-#define HTONS(x) (x) = htons((unsigned short)(x))
+#define NTOHL(x) (x) = ntohl((u_int32_t)(x))
+#define NTOHS(x) (x) = ntohs((u_int16_t)(x))
+#define HTONL(x) (x) = htonl((u_int32_t)(x))
+#define HTONS(x) (x) = htons((u_int16_t)(x))
#endif /* _POSIX_SOURCE */
diff --git a/sys/arch/i386/include/linux_machdep.h b/sys/arch/i386/include/linux_machdep.h
index 4b81becda32..1c26026594f 100644
--- a/sys/arch/i386/include/linux_machdep.h
+++ b/sys/arch/i386/include/linux_machdep.h
@@ -1,4 +1,4 @@
-/* $NetBSD: linux_machdep.h,v 1.4 1995/08/27 20:57:18 fvdl Exp $ */
+/* $NetBSD: linux_machdep.h,v 1.5 1996/05/03 19:26:28 christos Exp $ */
/*
* Copyright (c) 1995 Frank van der Linden
@@ -77,6 +77,7 @@ struct linux_sigframe {
};
void linux_sendsig __P((sig_t, int, int, u_long));
+dev_t linux_fakedev __P((dev_t));
/*
* Major device numbers of VT device on both Linux and NetBSD. Used in
diff --git a/sys/arch/i386/include/pmap.h b/sys/arch/i386/include/pmap.h
index af53627a5ed..157c6f55b8a 100644
--- a/sys/arch/i386/include/pmap.h
+++ b/sys/arch/i386/include/pmap.h
@@ -1,5 +1,5 @@
-/* $OpenBSD: pmap.h,v 1.3 1996/03/19 21:09:27 mickey Exp $ */
-/* $NetBSD: pmap.h,v 1.22 1996/02/12 21:12:29 christos Exp $ */
+/* $OpenBSD: pmap.h,v 1.4 1996/05/07 07:22:09 deraadt Exp $ */
+/* $NetBSD: pmap.h,v 1.23 1996/05/03 19:26:30 christos Exp $ */
/*
* Copyright (c) 1995 Charles M. Hannum. All rights reserved.
@@ -68,7 +68,11 @@
*/
#define PTDPTDI 0x3df /* ptd entry that points to ptd! */
#define KPTDI 0x3e0 /* start of kernel virtual pde's */
+#ifdef BABY
+#define NKPDE 31
+#else
#define NKPDE 12
+#endif
#define APTDPTDI 0x3ff /* start of alternate page directory */
/*
@@ -160,6 +164,8 @@ struct pv_entry *pv_table; /* array of entries, one per page */
#define pmap_resident_count(pmap) ((pmap)->pm_stats.resident_count)
#define pmap_update() tlbflush()
+vm_offset_t reserve_dumppages __P((vm_offset_t));
+
static __inline void
pmap_clear_modify(vm_offset_t pa)
{
@@ -196,6 +202,8 @@ pmap_phys_address(int ppn)
return i386_ptob(ppn);
}
+void pmap_activate __P((pmap_t, struct pcb *));
+
#endif /* _KERNEL */
#endif /* _I386_PMAP_H_ */
diff --git a/sys/arch/i386/include/pmap.old.h b/sys/arch/i386/include/pmap.old.h
index 20e1d3ff2da..bf8f761ddeb 100644
--- a/sys/arch/i386/include/pmap.old.h
+++ b/sys/arch/i386/include/pmap.old.h
@@ -1,5 +1,5 @@
-/* $OpenBSD: pmap.old.h,v 1.3 1996/03/19 21:09:27 mickey Exp $ */
-/* $NetBSD: pmap.h,v 1.22 1996/02/12 21:12:29 christos Exp $ */
+/* $OpenBSD: pmap.old.h,v 1.4 1996/05/07 07:22:09 deraadt Exp $ */
+/* $NetBSD: pmap.h,v 1.23 1996/05/03 19:26:30 christos Exp $ */
/*
* Copyright (c) 1995 Charles M. Hannum. All rights reserved.
@@ -68,7 +68,11 @@
*/
#define PTDPTDI 0x3df /* ptd entry that points to ptd! */
#define KPTDI 0x3e0 /* start of kernel virtual pde's */
+#ifdef BABY
+#define NKPDE 31
+#else
#define NKPDE 12
+#endif
#define APTDPTDI 0x3ff /* start of alternate page directory */
/*
@@ -160,6 +164,8 @@ struct pv_entry *pv_table; /* array of entries, one per page */
#define pmap_resident_count(pmap) ((pmap)->pm_stats.resident_count)
#define pmap_update() tlbflush()
+vm_offset_t reserve_dumppages __P((vm_offset_t));
+
static __inline void
pmap_clear_modify(vm_offset_t pa)
{
@@ -196,6 +202,8 @@ pmap_phys_address(int ppn)
return i386_ptob(ppn);
}
+void pmap_activate __P((pmap_t, struct pcb *));
+
#endif /* _KERNEL */
#endif /* _I386_PMAP_H_ */
diff --git a/sys/arch/i386/include/psl.h b/sys/arch/i386/include/psl.h
index 8f9fbd87901..b0041b9f670 100644
--- a/sys/arch/i386/include/psl.h
+++ b/sys/arch/i386/include/psl.h
@@ -1,4 +1,4 @@
-/* $NetBSD: psl.h,v 1.27 1996/02/01 22:30:56 mycroft Exp $ */
+/* $NetBSD: psl.h,v 1.28 1996/05/03 19:26:31 christos Exp $ */
/*-
* Copyright (c) 1990 The Regents of the University of California.
@@ -104,6 +104,11 @@ int imask[5];
extern void Xspllower __P((void));
+static __inline int splraise __P((int));
+static __inline int spllower __P((int));
+static __inline void splx __P((int));
+static __inline void softintr __P((int));
+
/*
* Add a mask to cpl, and return the old value of cpl.
*/
diff --git a/sys/arch/i386/include/vm86.h b/sys/arch/i386/include/vm86.h
index 93e3f5abb66..58069b33dc9 100644
--- a/sys/arch/i386/include/vm86.h
+++ b/sys/arch/i386/include/vm86.h
@@ -1,7 +1,7 @@
-/* $OpenBSD: vm86.h,v 1.5 1996/05/02 13:44:03 deraadt Exp $ */
-/* $NetBSD: vm86.h,v 1.6 1996/04/18 10:04:32 mycroft Exp $ */
+/* $OpenBSD: vm86.h,v 1.6 1996/05/07 07:22:11 deraadt Exp $ */
+/* $NetBSD: vm86.h,v 1.8 1996/05/03 19:26:32 christos Exp $ */
-#define VM86_USE_VIF
+#undef VM86_USE_VIF
/*-
* Copyright (c) 1996 The NetBSD Foundation, Inc.
@@ -76,8 +76,6 @@ struct vm86_struct {
unsigned char int21_byuser[32]; /* otherwise, handle directly */
};
-#define BIOSSEG 0x0f000
-
#define VCPU_086 0
#define VCPU_186 1
#define VCPU_286 2
@@ -89,8 +87,14 @@ struct vm86_struct {
int i386_vm86 __P((struct proc *, char *, register_t *));
void vm86_gpfault __P((struct proc *, int));
void vm86_return __P((struct proc *, int));
-
-static __inline__ void
+static __inline void clr_vif __P((struct proc *));
+static __inline void set_vif __P((struct proc *));
+static __inline void set_vflags __P((struct proc *, int));
+static __inline int get_vflags __P((struct proc *));
+static __inline void set_vflags_short __P((struct proc *, int));
+static __inline int get_vflags_short __P((struct proc *));
+
+static __inline void
clr_vif(p)
struct proc *p;
{
@@ -103,7 +107,7 @@ clr_vif(p)
#endif
}
-static __inline__ void
+static __inline void
set_vif(p)
struct proc *p;
{
@@ -119,7 +123,7 @@ set_vif(p)
vm86_return(p, VM86_STI);
}
-static __inline__ void
+static __inline void
set_vflags(p, flags)
struct proc *p;
int flags;
@@ -138,7 +142,7 @@ set_vflags(p, flags)
vm86_return(p, VM86_STI);
}
-static __inline__ int
+static __inline int
get_vflags(p)
struct proc *p;
{
@@ -151,7 +155,7 @@ get_vflags(p)
return (flags);
}
-static __inline__ void
+static __inline void
set_vflags_short(p, flags)
struct proc *p;
int flags;
@@ -168,7 +172,7 @@ set_vflags_short(p, flags)
#endif
}
-static __inline__ int
+static __inline int
get_vflags_short(p)
struct proc *p;
{
diff --git a/sys/arch/i386/isa/clock.c b/sys/arch/i386/isa/clock.c
index 8d099499732..05c8d060e65 100644
--- a/sys/arch/i386/isa/clock.c
+++ b/sys/arch/i386/isa/clock.c
@@ -1,4 +1,4 @@
-/* $NetBSD: clock.c,v 1.37 1996/04/11 22:15:13 cgd Exp $ */
+/* $NetBSD: clock.c,v 1.38 1996/05/03 19:14:50 christos Exp $ */
/*-
* Copyright (c) 1993, 1994 Charles Hannum.
@@ -105,8 +105,22 @@ WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
#include <i386/isa/timerreg.h>
#include <i386/isa/spkrreg.h>
-void spinwait __P((int));
-void findcpuspeed __P((void));
+void spinwait __P((int));
+void findcpuspeed __P((void));
+int clockintr __P((void *));
+int gettick __P((void));
+void sysbeepstop __P((void *));
+void sysbeep __P((int, int));
+void rtcinit __P((void));
+int rtcget __P((mc_todregs *));
+void rtcput __P((mc_todregs *));
+static int yeartoday __P((int));
+int hexdectodec __P((int));
+int dectohexdec __P((int));
+
+
+__inline u_int mc146818_read __P((void *, u_int));
+__inline void mc146818_write __P((void *, u_int, u_int));
#ifdef I586_CPU
int pentium_mhz;
@@ -152,8 +166,9 @@ startrtclock()
outb(IO_TIMER1, TIMER_DIV(hz) / 256);
/* Check diagnostic status */
- if (s = mc146818_read(NULL, NVRAM_DIAG)) /* XXX softc */
- printf("RTC BIOS diagnostic error %b\n", s, NVRAM_DIAG_BITS);
+ if ((s = mc146818_read(NULL, NVRAM_DIAG)) != 0) /* XXX softc */
+ printf("RTC BIOS diagnostic error %b\n", (unsigned int) s,
+ NVRAM_DIAG_BITS);
}
int
@@ -287,7 +302,7 @@ sysbeep(pitch, period)
unsigned int delaycount; /* calibrated loop variable (1 millisecond) */
-#define FIRST_GUESS 0x2000
+#define FIRST_GUESS 0x2000
void
findcpuspeed()
@@ -355,7 +370,7 @@ rtcget(regs)
{
rtcinit();
- if (mc146818_read(NULL, MC_REGD) & MC_REGD_VRT == 0) /* XXX softc */
+ if ((mc146818_read(NULL, MC_REGD) & MC_REGD_VRT) == 0) /* XXX softc */
return (-1);
MC146818_GETTOD(NULL, regs); /* XXX softc */
return (0);
@@ -382,18 +397,18 @@ yeartoday(year)
int
hexdectodec(n)
- char n;
+ int n;
{
return (((n >> 4) & 0x0f) * 10 + (n & 0x0f));
}
-char
+int
dectohexdec(n)
int n;
{
- return ((char)(((n / 10) << 4) & 0xf0) | ((n % 10) & 0x0f));
+ return ((u_char)(((n / 10) << 4) & 0xf0) | ((n % 10) & 0x0f));
}
static int timeset;
diff --git a/sys/arch/i386/isa/fd.c b/sys/arch/i386/isa/fd.c
index a7b07df07c7..0120048c001 100644
--- a/sys/arch/i386/isa/fd.c
+++ b/sys/arch/i386/isa/fd.c
@@ -1,5 +1,5 @@
-/* $OpenBSD: fd.c,v 1.13 1996/04/21 22:16:52 deraadt Exp $ */
-/* $NetBSD: fd.c,v 1.87 1996/04/11 22:15:16 cgd Exp $ */
+/* $OpenBSD: fd.c,v 1.14 1996/05/07 07:22:16 deraadt Exp $ */
+/* $NetBSD: fd.c,v 1.88 1996/05/03 19:14:53 christos Exp $ */
/*-
* Copyright (c) 1993, 1994, 1995 Charles Hannum.
@@ -43,7 +43,6 @@
#include <sys/param.h>
#include <sys/systm.h>
#include <sys/kernel.h>
-#include <sys/conf.h>
#include <sys/file.h>
#include <sys/ioctl.h>
#include <sys/device.h>
@@ -57,6 +56,7 @@
#include <machine/cpu.h>
#include <machine/pio.h>
+#include <machine/conf.h>
#include <dev/isa/isavar.h>
#include <dev/isa/isadmavar.h>
@@ -107,6 +107,7 @@ struct fdc_softc {
/* controller driver configuration */
int fdcprobe __P((struct device *, void *, void *));
+int fdprint __P((void *, char *));
#ifdef NEWCONFIG
void fdcforceintr __P((void *));
#endif
@@ -211,6 +212,7 @@ void fdcpseudointr __P((void *arg));
int fdcintr __P((void *));
void fdcretry __P((struct fdc_softc *fdc));
void fdfinish __P((struct fd_softc *fd, struct buf *bp));
+__inline struct fd_type *fd_dev_to_type __P((struct fd_softc *, dev_t));
int
fdcprobe(parent, match, aux)
@@ -463,7 +465,7 @@ fd_nvtotype(fdc, nvraminfo, drive)
}
}
-inline struct fd_type *
+__inline struct fd_type *
fd_dev_to_type(fd, dev)
struct fd_softc *fd;
dev_t dev;
@@ -595,18 +597,20 @@ fdfinish(fd, bp)
}
int
-fdread(dev, uio)
+fdread(dev, uio, flags)
dev_t dev;
struct uio *uio;
+ int flags;
{
return (physio(fdstrategy, NULL, dev, B_READ, minphys, uio));
}
int
-fdwrite(dev, uio)
+fdwrite(dev, uio, flags)
dev_t dev;
struct uio *uio;
+ int flags;
{
return (physio(fdstrategy, NULL, dev, B_WRITE, minphys, uio));
@@ -621,7 +625,7 @@ fd_set_motor(fdc, reset)
u_char status;
int n;
- if (fd = fdc->sc_drives.tqh_first)
+ if ((fd = fdc->sc_drives.tqh_first) != NULL)
status = fd->sc_drive;
else
status = 0;
@@ -704,9 +708,11 @@ out_fdc(iobase, x)
}
int
-Fdopen(dev, flags)
+fdopen(dev, flags, mode, p)
dev_t dev;
int flags;
+ int mode;
+ struct proc *p;
{
int unit;
struct fd_softc *fd;
@@ -734,9 +740,11 @@ Fdopen(dev, flags)
}
int
-fdclose(dev, flags)
+fdclose(dev, flags, mode, p)
dev_t dev;
int flags;
+ int mode;
+ struct proc *p;
{
struct fd_softc *fd = fd_cd.cd_devs[FDUNIT(dev)];
@@ -767,7 +775,6 @@ fdcstatus(dv, n, s)
char *s;
{
struct fdc_softc *fdc = (void *)dv->dv_parent;
- int iobase = fdc->sc_iobase;
if (n == 0) {
out_fdc(fdc->sc_iobase, NE7CMD_SENSEI);
@@ -843,7 +850,7 @@ fdcintr(arg)
struct fd_softc *fd;
struct buf *bp;
int iobase = fdc->sc_iobase;
- int read, head, trac, sec, i, s, nblks;
+ int read, head, sec, i, nblks;
struct fd_type *type;
loop:
@@ -1171,11 +1178,12 @@ fddump(dev, blkno, va, size)
}
int
-fdioctl(dev, cmd, addr, flag)
+fdioctl(dev, cmd, addr, flag, p)
dev_t dev;
u_long cmd;
caddr_t addr;
int flag;
+ struct proc *p;
{
struct fd_softc *fd = fd_cd.cd_devs[FDUNIT(dev)];
struct disklabel buffer;
diff --git a/sys/arch/i386/isa/isa_machdep.c b/sys/arch/i386/isa/isa_machdep.c
index cbf5756e1aa..eeecec8bca9 100644
--- a/sys/arch/i386/isa/isa_machdep.c
+++ b/sys/arch/i386/isa/isa_machdep.c
@@ -1,5 +1,5 @@
-/* $OpenBSD: isa_machdep.c,v 1.13 1996/04/22 20:03:07 hannken Exp $ */
-/* $NetBSD: isa_machdep.c,v 1.12 1996/04/11 22:11:32 cgd Exp $ */
+/* $OpenBSD: isa_machdep.c,v 1.14 1996/05/07 07:22:17 deraadt Exp $ */
+/* $NetBSD: isa_machdep.c,v 1.13 1996/05/03 19:14:55 christos Exp $ */
/*-
* Copyright (c) 1993, 1994 Charles Hannum.
@@ -41,6 +41,7 @@
*/
#include <sys/param.h>
+#include <sys/systm.h>
#include <sys/syslog.h>
#include <sys/device.h>
#include <sys/malloc.h>
@@ -58,9 +59,12 @@
#define IDTVEC(name) __CONCAT(X,name)
/* default interrupt vector table entries */
-typedef (*vector)();
+typedef (*vector) __P((void));
extern vector IDTVEC(intr)[], IDTVEC(fast)[];
extern struct gate_descriptor idt[];
+void isa_strayintr __P((int));
+void intr_calculatemasks __P((void));
+int fakeintr __P((void *));
/*
* Fill in default interrupt table (in case of spuruious interrupt
diff --git a/sys/arch/i386/isa/isa_machdep.h b/sys/arch/i386/isa/isa_machdep.h
index 756221c630b..6476195efb7 100644
--- a/sys/arch/i386/isa/isa_machdep.h
+++ b/sys/arch/i386/isa/isa_machdep.h
@@ -1,4 +1,4 @@
-/* $NetBSD: isa_machdep.h,v 1.5 1996/04/11 22:10:11 cgd Exp $ */
+/* $NetBSD: isa_machdep.h,v 1.6 1996/05/03 19:14:56 christos Exp $ */
/*-
* Copyright (c) 1990 The Regents of the University of California.
@@ -111,7 +111,7 @@ void isa_intr_disestablish __P((isa_chipset_tag_t ic, void *handler));
*/
struct intrhand {
- int (*ih_fun)();
+ int (*ih_fun) __P((void *));
void *ih_arg;
u_long ih_count;
struct intrhand *ih_next;
diff --git a/sys/arch/i386/isa/lms.c b/sys/arch/i386/isa/lms.c
index efd24305e52..70f54385c7e 100644
--- a/sys/arch/i386/isa/lms.c
+++ b/sys/arch/i386/isa/lms.c
@@ -1,4 +1,4 @@
-/* $NetBSD: lms.c,v 1.24 1996/04/11 22:15:18 cgd Exp $ */
+/* $NetBSD: lms.c,v 1.25 1996/05/03 20:12:01 christos Exp $ */
/*-
* Copyright (c) 1993, 1994 Charles Hannum.
@@ -39,6 +39,7 @@
#include <machine/cpu.h>
#include <machine/bus.h>
#include <machine/mouse.h>
+#include <machine/conf.h>
#include <dev/isa/isavar.h>
@@ -129,7 +130,6 @@ lmsattach(parent, self, aux)
{
struct lms_softc *sc = (void *)self;
struct isa_attach_args *ia = aux;
- int iobase = ia->ia_iobase;
printf("\n");
@@ -143,9 +143,11 @@ lmsattach(parent, self, aux)
}
int
-lmsopen(dev, flag)
+lmsopen(dev, flag, mode, p)
dev_t dev;
int flag;
+ int mode;
+ struct proc *p;
{
int unit = LMSUNIT(dev);
struct lms_softc *sc;
@@ -173,9 +175,11 @@ lmsopen(dev, flag)
}
int
-lmsclose(dev, flag)
+lmsclose(dev, flag, mode, p)
dev_t dev;
int flag;
+ int mode;
+ struct proc *p;
{
struct lms_softc *sc = lms_cd.cd_devs[LMSUNIT(dev)];
@@ -197,7 +201,7 @@ lmsread(dev, uio, flag)
{
struct lms_softc *sc = lms_cd.cd_devs[LMSUNIT(dev)];
int s;
- int error;
+ int error = 0;
size_t length;
u_char buffer[LMS_CHUNK];
@@ -210,7 +214,8 @@ lmsread(dev, uio, flag)
return EWOULDBLOCK;
}
sc->sc_state |= LMS_ASLP;
- if (error = tsleep((caddr_t)sc, PZERO | PCATCH, "lmsrea", 0)) {
+ error = tsleep((caddr_t)sc, PZERO | PCATCH, "lmsrea", 0);
+ if (error) {
sc->sc_state &= ~LMS_ASLP;
splx(s);
return error;
@@ -229,7 +234,7 @@ lmsread(dev, uio, flag)
(void) q_to_b(&sc->sc_q, buffer, length);
/* Copy the data to the user process. */
- if (error = uiomove(buffer, length, uio))
+ if ((error = uiomove(buffer, length, uio)) != 0)
break;
}
@@ -237,11 +242,12 @@ lmsread(dev, uio, flag)
}
int
-lmsioctl(dev, cmd, addr, flag)
+lmsioctl(dev, cmd, addr, flag, p)
dev_t dev;
u_long cmd;
caddr_t addr;
int flag;
+ struct proc *p;
{
struct lms_softc *sc = lms_cd.cd_devs[LMSUNIT(dev)];
struct mouseinfo info;
diff --git a/sys/arch/i386/isa/mms.c b/sys/arch/i386/isa/mms.c
index 6dc4a533fc8..36382e30692 100644
--- a/sys/arch/i386/isa/mms.c
+++ b/sys/arch/i386/isa/mms.c
@@ -1,4 +1,4 @@
-/* $NetBSD: mms.c,v 1.22 1996/04/11 22:15:20 cgd Exp $ */
+/* $NetBSD: mms.c,v 1.23 1996/05/03 20:11:57 christos Exp $ */
/*-
* Copyright (c) 1993, 1994 Charles Hannum.
@@ -39,6 +39,7 @@
#include <machine/cpu.h>
#include <machine/pio.h>
#include <machine/mouse.h>
+#include <machine/conf.h>
#include <dev/isa/isavar.h>
@@ -118,9 +119,11 @@ mmsattach(parent, self, aux)
}
int
-mmsopen(dev, flag)
+mmsopen(dev, flag, mode, p)
dev_t dev;
int flag;
+ int mode;
+ struct proc *p;
{
int unit = MMSUNIT(dev);
struct mms_softc *sc;
@@ -149,9 +152,11 @@ mmsopen(dev, flag)
}
int
-mmsclose(dev, flag)
+mmsclose(dev, flag, mode, p)
dev_t dev;
int flag;
+ int mode;
+ struct proc *p;
{
struct mms_softc *sc = mms_cd.cd_devs[MMSUNIT(dev)];
@@ -173,7 +178,7 @@ mmsread(dev, uio, flag)
{
struct mms_softc *sc = mms_cd.cd_devs[MMSUNIT(dev)];
int s;
- int error;
+ int error = 0;
size_t length;
u_char buffer[MMS_CHUNK];
@@ -186,7 +191,8 @@ mmsread(dev, uio, flag)
return EWOULDBLOCK;
}
sc->sc_state |= MMS_ASLP;
- if (error = tsleep((caddr_t)sc, PZERO | PCATCH, "mmsrea", 0)) {
+ error = tsleep((caddr_t)sc, PZERO | PCATCH, "mmsrea", 0);
+ if (error) {
sc->sc_state &= ~MMS_ASLP;
splx(s);
return error;
@@ -205,7 +211,7 @@ mmsread(dev, uio, flag)
(void) q_to_b(&sc->sc_q, buffer, length);
/* Copy the data to the user process. */
- if (error = uiomove(buffer, length, uio))
+ if ((error = uiomove(buffer, length, uio)) != 0)
break;
}
@@ -213,11 +219,12 @@ mmsread(dev, uio, flag)
}
int
-mmsioctl(dev, cmd, addr, flag)
+mmsioctl(dev, cmd, addr, flag, p)
dev_t dev;
u_long cmd;
caddr_t addr;
int flag;
+ struct proc *p;
{
struct mms_softc *sc = mms_cd.cd_devs[MMSUNIT(dev)];
struct mouseinfo info;
diff --git a/sys/arch/i386/isa/npx.c b/sys/arch/i386/isa/npx.c
index 1eac3fca162..1ffa07086a1 100644
--- a/sys/arch/i386/isa/npx.c
+++ b/sys/arch/i386/isa/npx.c
@@ -1,4 +1,4 @@
-/* $NetBSD: npx.c,v 1.55 1996/04/11 22:15:22 cgd Exp $ */
+/* $NetBSD: npx.c,v 1.56 1996/05/03 19:14:58 christos Exp $ */
#if 0
#define iprintf(x) printf x
@@ -104,7 +104,6 @@ int npxdna __P((struct proc *));
void npxexit __P((void));
int npxintr __P((void *));
static int npxprobe1 __P((struct isa_attach_args *));
-void npxsave __P((void));
static void npxsave1 __P((void));
struct npx_softc {
@@ -339,6 +338,8 @@ npxattach(parent, self, aux)
printf(": error reporting broken; not using\n");
npx_type = NPX_NONE;
return;
+ case NPX_NONE:
+ return;
}
lcr0(rcr0() & ~(CR0_EM|CR0_TS));
diff --git a/sys/arch/i386/isa/pccons.c b/sys/arch/i386/isa/pccons.c
index 70c50329c7e..e0cd32945d9 100644
--- a/sys/arch/i386/isa/pccons.c
+++ b/sys/arch/i386/isa/pccons.c
@@ -1,5 +1,5 @@
-/* $OpenBSD: pccons.c,v 1.11 1996/04/24 18:16:55 mickey Exp $ */
-/* $NetBSD: pccons.c,v 1.96 1996/04/11 22:15:25 cgd Exp $ */
+/* $OpenBSD: pccons.c,v 1.12 1996/05/07 07:22:23 deraadt Exp $ */
+/* $NetBSD: pccons.c,v 1.97 1996/05/03 19:15:00 christos Exp $ */
/*-
* Copyright (c) 1993, 1994, 1995 Charles Hannum. All rights reserved.
@@ -46,7 +46,6 @@
#include <sys/param.h>
#include <sys/systm.h>
-#include <sys/conf.h>
#include <sys/ioctl.h>
#include <sys/proc.h>
#include <sys/user.h>
@@ -64,6 +63,7 @@
#include <machine/pio.h>
#include <machine/pc/display.h>
#include <machine/pccons.h>
+#include <machine/conf.h>
#include <dev/isa/isareg.h>
#include <dev/isa/isavar.h>
@@ -140,19 +140,36 @@ void sput __P((u_char *, int));
void pc_xmode_on __P((void));
void pc_xmode_off __P((void));
-void pcstart();
-int pcparam();
+void pcstart __P((struct tty *));
+int pcparam __P((struct tty *, struct termios *));
+
char partab[];
-extern pcopen(dev_t, int, int, struct proc *);
+int kbd_cmd __P((u_char, u_char));
+void set_cursor_shape __P((void));
+void get_cursor_shape __P((void));
+void do_async_update __P((void *));
+void async_update __P((void));
+
+static __inline int kbd_wait_output __P((void));
+static __inline int kbd_wait_input __P((void));
+static __inline void kbd_flush_input __P((void));
+static u_char kbc_get8042cmd __P((void));
+static int kbc_put8042cmd __P((u_char));
+
+void pccnprobe __P((struct consdev *));
+void pccninit __P((struct consdev *));
+void pccnputc __P((dev_t, char));
+int pccngetc __P((dev_t));
+void pccnpollc __P((dev_t, int));
#define KBD_DELAY \
- { u_char x = inb(0x84); } \
- { u_char x = inb(0x84); } \
- { u_char x = inb(0x84); } \
- { u_char x = inb(0x84); }
+ { u_char x = inb(0x84); (void) x; } \
+ { u_char x = inb(0x84); (void) x; } \
+ { u_char x = inb(0x84); (void) x; } \
+ { u_char x = inb(0x84); (void) x; }
-static inline int
+static __inline int
kbd_wait_output()
{
u_int i;
@@ -165,7 +182,7 @@ kbd_wait_output()
return 0;
}
-static inline int
+static __inline int
kbd_wait_input()
{
u_int i;
@@ -178,7 +195,7 @@ kbd_wait_input()
return 0;
}
-static inline void
+static __inline void
kbd_flush_input()
{
u_int i;
@@ -311,9 +328,10 @@ get_cursor_shape()
}
void
-do_async_update(poll)
- u_char poll;
+do_async_update(v)
+ void *v;
{
+ u_char poll = v ? 1 : 0;
int pos;
static int old_pos = -1;
@@ -359,7 +377,7 @@ async_update()
if (kernel || polling) {
if (async)
untimeout(do_async_update, NULL);
- do_async_update(1);
+ do_async_update((void *)1);
} else {
if (async)
return;
@@ -462,7 +480,7 @@ pcattach(parent, self, aux)
struct isa_attach_args *ia = aux;
printf(": %s\n", vs.color ? "color" : "mono");
- do_async_update(1);
+ do_async_update((void *)1);
screen_restore(0);
sc->sc_ih = isa_intr_establish(ia->ia_ic, ia->ia_irq, IST_EDGE,
@@ -688,7 +706,7 @@ pcstart(tp)
struct tty *tp;
{
struct clist *cl;
- int s, len, n;
+ int s, len;
u_char buf[PCBURST];
s = spltty();
@@ -720,12 +738,12 @@ out:
splx(s);
}
-void
+int
pcstop(tp, flag)
struct tty *tp;
int flag;
{
-
+ return 0;
}
void
@@ -967,7 +985,7 @@ sput(cp, n)
else
vs.so_at = FG_YELLOW | BG_BLACK;
- fillw((vs.at << 8) | ' ', crtat, vs.nchr - cursorat);
+ fillw((vs.at << 8) | ' ', (caddr_t) crtat, vs.nchr - cursorat);
}
while (n--) {
@@ -1015,7 +1033,6 @@ sput(cp, n)
break;
default:
- bypass:
switch (vs.state) {
case 0:
if (c == '\a')
@@ -1054,8 +1071,8 @@ sput(cp, n)
vs.cx = vs.cy = 0;
vs.state = VSS_EBRACE;
} else if (c == 'c') { /* Clear screen & home */
- fillw((vs.at << 8) | ' ', Crtat,
- vs.nchr);
+ fillw((vs.at << 8) | ' ',
+ (caddr_t) Crtat, vs.nchr);
crtat = Crtat;
vs.col = 0;
vs.state = 0;
@@ -1145,17 +1162,20 @@ sput(cp, n)
switch (vs.cx) {
case 0:
/* ... to end of display */
- fillw((vs.at << 8) | ' ', crtat,
+ fillw((vs.at << 8) | ' ',
+ (caddr_t) crtat,
Crtat + vs.nchr - crtat);
break;
case 1:
/* ... to next location */
- fillw((vs.at << 8) | ' ', Crtat,
+ fillw((vs.at << 8) | ' ',
+ (caddr_t) Crtat,
crtat - Crtat + 1);
break;
case 2:
/* ... whole display */
- fillw((vs.at << 8) | ' ', Crtat,
+ fillw((vs.at << 8) | ' ',
+ (caddr_t) Crtat,
vs.nchr);
break;
}
@@ -1165,19 +1185,21 @@ sput(cp, n)
switch (vs.cx) {
case 0:
/* ... current to EOL */
- fillw((vs.at << 8) | ' ', crtat,
+ fillw((vs.at << 8) | ' ',
+ (caddr_t) crtat,
vs.ncol - vs.col);
break;
case 1:
/* ... beginning to next */
fillw((vs.at << 8) | ' ',
- crtat - vs.col,
+ (caddr_t) (crtat - vs.col),
vs.col + 1);
break;
case 2:
/* ... entire line */
fillw((vs.at << 8) | ' ',
- crtat - vs.col, vs.ncol);
+ (caddr_t) (crtat - vs.col),
+ vs.ncol);
break;
}
vs.state = 0;
@@ -1215,7 +1237,7 @@ sput(cp, n)
crtAt, vs.ncol * (nrow -
cx) * CHR);
fillw((vs.at << 8) | ' ',
- crtAt + vs.ncol * (nrow - cx),
+ (caddr_t) (crtAt + vs.ncol * (nrow - cx)),
vs.ncol * cx);
vs.state = 0;
break;
@@ -1231,9 +1253,11 @@ sput(cp, n)
Crtat, vs.ncol * (vs.nrow -
cx) * CHR);
fillw((vs.at << 8) | ' ',
- Crtat + vs.ncol * (vs.nrow - cx),
+ (caddr_t) (Crtat + vs.ncol * (vs.nrow - cx)),
vs.ncol * cx);
- /* crtat -= vs.ncol * cx; /* XXX */
+#if 0
+ crtat -= vs.ncol * cx; /* XXX */
+#endif
vs.state = 0;
break;
}
@@ -1251,7 +1275,8 @@ sput(cp, n)
crtAt + vs.ncol * cx,
vs.ncol * (nrow - cx) *
CHR);
- fillw((vs.at << 8) | ' ', crtAt,
+ fillw((vs.at << 8) | ' ',
+ (caddr_t) crtAt,
vs.ncol * cx);
vs.state = 0;
break;
@@ -1267,9 +1292,12 @@ sput(cp, n)
Crtat + vs.ncol * cx,
vs.ncol * (vs.nrow - cx) *
CHR);
- fillw((vs.at << 8) | ' ', Crtat,
+ fillw((vs.at << 8) | ' ',
+ (caddr_t) Crtat,
vs.ncol * cx);
- /* crtat += vs.ncol * cx; /* XXX */
+#if 0
+ crtat += vs.ncol * cx; /* XXX */
+#endif
vs.state = 0;
break;
}
@@ -1339,7 +1367,8 @@ sput(cp, n)
bcopy(Crtat + vs.ncol, Crtat,
(vs.nchr - vs.ncol) * CHR);
fillw((vs.at << 8) | ' ',
- Crtat + vs.nchr - vs.ncol, vs.ncol);
+ (caddr_t) (Crtat + vs.nchr - vs.ncol),
+ vs.ncol);
crtat -= vs.ncol;
}
}
diff --git a/sys/arch/i386/isa/pcvt/pcvt_drv.c b/sys/arch/i386/isa/pcvt/pcvt_drv.c
index 23ef40a2dfc..52dbd89b9c9 100644
--- a/sys/arch/i386/isa/pcvt/pcvt_drv.c
+++ b/sys/arch/i386/isa/pcvt/pcvt_drv.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: pcvt_drv.c,v 1.11 1996/04/24 18:16:57 mickey Exp $ */
+/* $OpenBSD: pcvt_drv.c,v 1.12 1996/05/07 07:22:26 deraadt Exp $ */
/*
* Copyright (c) 1992, 1995 Hellmuth Michaelis and Joerg Wunsch.
@@ -100,6 +100,7 @@ static nrow;
#endif
static void vgapelinit(void); /* read initial VGA DAC palette */
+int getchar(void);
#if PCVT_FREEBSD > 205
static struct kern_devconf kdc_vt[];
@@ -109,6 +110,17 @@ static char vt_description[];
#define VT_DESCR_LEN 40
#endif /* PCVT_FREEBSD > 205 */
+#if PCVT_NETBSD > 100
+void pccnpollc(Dev_t, int);
+#endif
+#if PCVT_NETBSD > 100
+int pcprobe(struct device *, void *, void *);
+#endif
+#if PCVT_NETBSD > 9
+void pcattach(struct device *, struct device *, void *);
+#endif
+
+
#if PCVT_NETBSD > 100 /* NetBSD-current Feb 20 1995 */
int
pcprobe(struct device *parent, void *match, void *aux)
@@ -976,7 +988,7 @@ pcstart(register struct tty *tp)
* expensive and we don't want our serial ports to overflow.
*/
- while (len = q_to_b(&tp->t_outq, buf, PCVT_PCBURST))
+ while ((len = q_to_b(&tp->t_outq, buf, PCVT_PCBURST)) != 0)
sput(&buf[0], 0, len, minor(tp->t_dev));
s = spltty();
diff --git a/sys/arch/i386/isa/pcvt/pcvt_hdr.h b/sys/arch/i386/isa/pcvt/pcvt_hdr.h
index 222d09e839e..53590fe0ea9 100644
--- a/sys/arch/i386/isa/pcvt/pcvt_hdr.h
+++ b/sys/arch/i386/isa/pcvt/pcvt_hdr.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: pcvt_hdr.h,v 1.7 1996/04/21 22:17:09 deraadt Exp $ */
+/* $OpenBSD: pcvt_hdr.h,v 1.8 1996/05/07 07:22:27 deraadt Exp $ */
/*
* Copyright (c) 1992, 1995 Hellmuth Michaelis and Joerg Wunsch.
@@ -904,8 +904,12 @@ struct vt_softc {
};
#endif /* PCVT_NETBSD > 101 */
-int pcprobe ();
-void pcattach ();
+#if PCVT_NETBSD > 100
+int pcprobe(struct device *, void *, void *);
+#endif
+#if PCVT_NETBSD > 9
+void pcattach(struct device *, struct device *, void *);
+#endif
#if PCVT_NETBSD > 110
struct cfattach vt_ca = {
@@ -1400,12 +1404,12 @@ static __inline void vt_selattr(struct video_state *svsp)
/* 0x84 to produce keyboard controller */
/* access delays */
#define PCVT_KBD_DELAY() \
- { u_char x = inb(0x84); } \
- { u_char x = inb(0x84); } \
- { u_char x = inb(0x84); } \
- { u_char x = inb(0x84); } \
- { u_char x = inb(0x84); } \
- { u_char x = inb(0x84); }
+ { volatile u_char x = inb(0x84); (void) &x;} \
+ { volatile u_char x = inb(0x84); (void) &x;} \
+ { volatile u_char x = inb(0x84); (void) &x;} \
+ { volatile u_char x = inb(0x84); (void) &x;} \
+ { volatile u_char x = inb(0x84); (void) &x;} \
+ { volatile u_char x = inb(0x84); (void) &x;}
#else /* PCVT_PORTIO_DELAY */
/* use system supplied delay function for */
diff --git a/sys/arch/i386/isa/pcvt/pcvt_kbd.c b/sys/arch/i386/isa/pcvt/pcvt_kbd.c
index e2512494b38..e307429fcf1 100644
--- a/sys/arch/i386/isa/pcvt/pcvt_kbd.c
+++ b/sys/arch/i386/isa/pcvt/pcvt_kbd.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: pcvt_kbd.c,v 1.4 1996/04/18 17:48:33 niklas Exp $ */
+/* $OpenBSD: pcvt_kbd.c,v 1.5 1996/05/07 07:22:30 deraadt Exp $ */
/*
* Copyright (c) 1992, 1995 Hellmuth Michaelis and Joerg Wunsch.
@@ -94,6 +94,11 @@ static void cfkey1(void), cfkey2(void), cfkey3(void), cfkey4(void);
static void cfkey5(void), cfkey6(void), cfkey7(void), cfkey8(void);
static void cfkey9(void), cfkey10(void), cfkey11(void), cfkey12(void);
+static inline int kbd_wait_output(void);
+static inline int kbd_wait_input(void);
+int kbd_response(void);
+
+
static void doreset ( void );
static void ovlinit ( int force );
static void settpmrate ( int rate );
@@ -714,7 +719,7 @@ xlatkey2ascii(U_short key)
#endif
static Ovl_tbl thisdef;
int n;
- void (*fnc)();
+ void (*fnc)(void);
if(key==0) /* ignore the NON-KEY */
return 0;
diff --git a/sys/arch/i386/isa/pcvt/pcvt_kbd.h b/sys/arch/i386/isa/pcvt/pcvt_kbd.h
index d0621422114..7b80aa3d060 100644
--- a/sys/arch/i386/isa/pcvt/pcvt_kbd.h
+++ b/sys/arch/i386/isa/pcvt/pcvt_kbd.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: pcvt_kbd.h,v 1.2 1996/04/18 17:48:35 niklas Exp $ */
+/* $OpenBSD: pcvt_kbd.h,v 1.3 1996/05/07 07:22:31 deraadt Exp $ */
/*
* Copyright (c) 1992, 1995 Hellmuth Michaelis and Joerg Wunsch.
@@ -68,7 +68,7 @@ typedef struct
union what
{
u_char *string; /* ptr to string, null terminated */
- void (*func)(); /* ptr to function */
+ void (*func)(void); /* ptr to function */
} what;
} entry;
@@ -207,144 +207,144 @@ static Keycap_def key2ascii[] =
#define F FNC
#define I IDX0
-#define DFAULT {S, 0, C ""}
+#define DFAULT {S, 0, { "" }}
/* DONT EVER OVERLOAD KEY 0, THIS IS A KEY THAT MUSTN'T EXIST */
/* type index unshift shift ctrl alt alt_shift alt_ctrl alt_ctrl_shift */
/* -------------------------------------------------------------------------------------------------------------------------------------------------- */
-/* 0*/ KBD_NONE, I, DFAULT, DFAULT, DFAULT, DFAULT, DFAULT, DFAULT, DFAULT,
-/* 1*/ KBD_ASCII, I, {S,1,C "`"}, {S,1,C "~"}, {S,1,C "`"}, DFAULT, DFAULT, DFAULT, DFAULT,
-/* 2*/ KBD_ASCII, I, {S,1,C "1"}, {S,1,C "!"}, {S,1,C "1"}, DFAULT, DFAULT, DFAULT, DFAULT,
-/* 3*/ KBD_ASCII, I, {S,1,C "2"}, {S,1,C "@"}, {S,1,C "\000"}, DFAULT, DFAULT, DFAULT, DFAULT,
-/* 4*/ KBD_ASCII, I, {S,1,C "3"}, {S,1,C "#"}, {S,1,C "3"}, DFAULT, DFAULT, DFAULT, DFAULT,
-/* 5*/ KBD_ASCII, I, {S,1,C "4"}, {S,1,C "$"}, {S,1,C "4"}, DFAULT, DFAULT, DFAULT, DFAULT,
-/* 6*/ KBD_ASCII, I, {S,1,C "5"}, {S,1,C "%"}, {S,1,C "5"}, DFAULT, DFAULT, DFAULT, DFAULT,
-/* 7*/ KBD_ASCII, I, {S,1,C "6"}, {S,1,C "^"}, {S,1,C "\036"}, DFAULT, DFAULT, DFAULT, DFAULT,
-/* 8*/ KBD_ASCII, I, {S,1,C "7"}, {S,1,C "&"}, {S,1,C "7"}, DFAULT, DFAULT, DFAULT, DFAULT,
-/* 9*/ KBD_ASCII, I, {S,1,C "8"}, {S,1,C "*"}, {S,1,C "8"}, DFAULT, DFAULT, DFAULT, DFAULT,
-/* 10*/ KBD_ASCII, I, {S,1,C "9"}, {S,1,C "("}, {S,1,C "9"}, DFAULT, DFAULT, DFAULT, DFAULT,
-/* 11*/ KBD_ASCII, I, {S,1,C "0"}, {S,1,C ")"}, {S,1,C "0"}, DFAULT, DFAULT, DFAULT, DFAULT,
-/* 12*/ KBD_ASCII, I, {S,1,C "-"}, {S,1,C "_"}, {S,1,C "\037"}, DFAULT, DFAULT, DFAULT, DFAULT,
-/* 13*/ KBD_ASCII, I, {S,1,C "="}, {S,1,C "+"}, {S,1,C "="}, DFAULT, DFAULT, DFAULT, DFAULT,
-/* 14*/ KBD_NONE, I, DFAULT, DFAULT, DFAULT, DFAULT, DFAULT, DFAULT, DFAULT,
-/* 15*/ KBD_ASCII, I, {S,1,C "\177"}, {S,1,C "\010"}, {S,1,C "\177"}, DFAULT, DFAULT, DFAULT, DFAULT,
-/* 16*/ KBD_ASCII, I, {S,1,C "\t"}, {S,1,C "\t"}, {S,1,C "\t"}, DFAULT, DFAULT, DFAULT, DFAULT,
-/* 17*/ KBD_ASCII, I, {S,1,C "q"}, {S,1,C "Q"}, {S,1,C "\021"}, DFAULT, DFAULT, DFAULT, DFAULT,
-/* 18*/ KBD_ASCII, I, {S,1,C "w"}, {S,1,C "W"}, {S,1,C "\027"}, DFAULT, DFAULT, DFAULT, DFAULT,
-/* 19*/ KBD_ASCII, I, {S,1,C "e"}, {S,1,C "E"}, {S,1,C "\005"}, DFAULT, DFAULT, DFAULT, DFAULT,
-/* 20*/ KBD_ASCII, I, {S,1,C "r"}, {S,1,C "R"}, {S,1,C "\022"}, DFAULT, DFAULT, DFAULT, DFAULT,
-/* 21*/ KBD_ASCII, I, {S,1,C "t"}, {S,1,C "T"}, {S,1,C "\024"}, DFAULT, DFAULT, DFAULT, DFAULT,
-/* 22*/ KBD_ASCII, I, {S,1,C "y"}, {S,1,C "Y"}, {S,1,C "\031"}, DFAULT, DFAULT, DFAULT, DFAULT,
-/* 23*/ KBD_ASCII, I, {S,1,C "u"}, {S,1,C "U"}, {S,1,C "\025"}, DFAULT, DFAULT, DFAULT, DFAULT,
-/* 24*/ KBD_ASCII, I, {S,1,C "i"}, {S,1,C "I"}, {S,1,C "\011"}, DFAULT, DFAULT, DFAULT, DFAULT,
-/* 25*/ KBD_ASCII, I, {S,1,C "o"}, {S,1,C "O"}, {S,1,C "\017"}, DFAULT, DFAULT, DFAULT, DFAULT,
-/* 26*/ KBD_ASCII, I, {S,1,C "p"}, {S,1,C "P"}, {S,1,C "\020"}, DFAULT, DFAULT, DFAULT, DFAULT,
-/* 27*/ KBD_ASCII, I, {S,1,C "["}, {S,1,C "{"}, {S,1,C "\033"}, DFAULT, DFAULT, DFAULT, DFAULT,
-/* 28*/ KBD_ASCII, I, {S,1,C "]"}, {S,1,C "}"}, {S,1,C "\035"}, DFAULT, DFAULT, DFAULT, DFAULT,
-/* 29*/ KBD_ASCII, I, {S,1,C "\\"}, {S,1,C "|"}, {S,1,C "\034"}, DFAULT, DFAULT, DFAULT, DFAULT,
-/* 30*/ KBD_CAPS, I, DFAULT, DFAULT, DFAULT, DFAULT, DFAULT, DFAULT, DFAULT,
-/* 31*/ KBD_ASCII, I, {S,1,C "a"}, {S,1,C "A"}, {S,1,C "\001"}, DFAULT, DFAULT, DFAULT, DFAULT,
-/* 32*/ KBD_ASCII, I, {S,1,C "s"}, {S,1,C "S"}, {S,1,C "\023"}, DFAULT, DFAULT, DFAULT, DFAULT,
-/* 33*/ KBD_ASCII, I, {S,1,C "d"}, {S,1,C "D"}, {S,1,C "\004"}, DFAULT, DFAULT, DFAULT, DFAULT,
-/* 34*/ KBD_ASCII, I, {S,1,C "f"}, {S,1,C "F"}, {S,1,C "\006"}, DFAULT, DFAULT, DFAULT, DFAULT,
-/* 35*/ KBD_ASCII, I, {S,1,C "g"}, {S,1,C "G"}, {S,1,C "\007"}, DFAULT, DFAULT, DFAULT, DFAULT,
-/* 36*/ KBD_ASCII, I, {S,1,C "h"}, {S,1,C "H"}, {S,1,C "\010"}, DFAULT, DFAULT, DFAULT, DFAULT,
-/* 37*/ KBD_ASCII, I, {S,1,C "j"}, {S,1,C "J"}, {S,1,C "\n"}, DFAULT, DFAULT, DFAULT, DFAULT,
-/* 38*/ KBD_ASCII, I, {S,1,C "k"}, {S,1,C "K"}, {S,1,C "\013"}, DFAULT, DFAULT, DFAULT, DFAULT,
-/* 39*/ KBD_ASCII, I, {S,1,C "l"}, {S,1,C "L"}, {S,1,C "\014"}, DFAULT, DFAULT, DFAULT, DFAULT,
-/* 40*/ KBD_ASCII, I, {S,1,C ";"}, {S,1,C ":"}, {S,1,C ";"}, DFAULT, DFAULT, DFAULT, DFAULT,
-/* 41*/ KBD_ASCII, I, {S,1,C "'"}, {S,1,C "\""}, {S,1,C "'"}, DFAULT, DFAULT, DFAULT, DFAULT,
-/* 42*/ KBD_ASCII, I, {S,1,C "\\"}, {S,1,C "|"}, {S,1,C "\034"}, DFAULT, DFAULT, DFAULT, DFAULT,
-/* 43*/ KBD_RETURN,I, {S,1,C "\r"}, {S,1,C "\r"}, {S,1,C "\r"}, DFAULT, DFAULT, DFAULT, DFAULT,
-/* 44*/ KBD_SHIFT, I, DFAULT, DFAULT, DFAULT, DFAULT, DFAULT, DFAULT, DFAULT,
-/* 45*/ KBD_ASCII, I, {S,1,C "<"}, {S,1,C ">"}, DFAULT, DFAULT, DFAULT, DFAULT, DFAULT,
-/* 46*/ KBD_ASCII, I, {S,1,C "z"}, {S,1,C "Z"}, {S,1,C "\032"}, DFAULT, DFAULT, DFAULT, DFAULT,
-/* 47*/ KBD_ASCII, I, {S,1,C "x"}, {S,1,C "X"}, {S,1,C "\030"}, DFAULT, DFAULT, DFAULT, DFAULT,
-/* 48*/ KBD_ASCII, I, {S,1,C "c"}, {S,1,C "C"}, {S,1,C "\003"}, DFAULT, DFAULT, DFAULT, DFAULT,
-/* 49*/ KBD_ASCII, I, {S,1,C "v"}, {S,1,C "V"}, {S,1,C "\026"}, DFAULT, DFAULT, DFAULT, DFAULT,
-/* 50*/ KBD_ASCII, I, {S,1,C "b"}, {S,1,C "B"}, {S,1,C "\002"}, DFAULT, DFAULT, DFAULT, DFAULT,
-/* 51*/ KBD_ASCII, I, {S,1,C "n"}, {S,1,C "N"}, {S,1,C "\016"}, DFAULT, DFAULT, DFAULT, DFAULT,
-/* 52*/ KBD_ASCII, I, {S,1,C "m"}, {S,1,C "M"}, {S,1,C "\r"}, DFAULT, DFAULT, DFAULT, DFAULT,
-/* 53*/ KBD_ASCII, I, {S,1,C ","}, {S,1,C "<"}, {S,1,C ","}, DFAULT, DFAULT, DFAULT, DFAULT,
-/* 54*/ KBD_ASCII, I, {S,1,C "."}, {S,1,C ">"}, {S,1,C "."}, DFAULT, DFAULT, DFAULT, DFAULT,
-/* 55*/ KBD_ASCII, I, {S,1,C "/"}, {S,1,C "?"}, {S,1,C "/"}, DFAULT, DFAULT, DFAULT, DFAULT,
-/* 56*/ KBD_NONE, I, DFAULT, DFAULT, DFAULT, DFAULT, DFAULT, DFAULT, DFAULT,
-/* 57*/ KBD_SHIFT, I, DFAULT, DFAULT, DFAULT, DFAULT, DFAULT, DFAULT, DFAULT,
-/* 58*/ KBD_CTL, I, DFAULT, DFAULT, DFAULT, DFAULT, DFAULT, DFAULT, DFAULT,
-/* 59*/ KBD_ASCII, I, DFAULT, DFAULT, DFAULT, DFAULT, DFAULT, DFAULT, DFAULT,
-/* 60*/ KBD_META, I, DFAULT, DFAULT, DFAULT, DFAULT, DFAULT, DFAULT, DFAULT,
+/* 0*/ { KBD_NONE, I, DFAULT, DFAULT, DFAULT, DFAULT, DFAULT, DFAULT, DFAULT },
+/* 1*/ { KBD_ASCII, I, {S,1, { "`" }}, {S,1, { "~" }}, {S,1, { "`" }}, DFAULT, DFAULT, DFAULT, DFAULT },
+/* 2*/ { KBD_ASCII, I, {S,1, { "1" }}, {S,1, { "!" }}, {S,1, { "1" }}, DFAULT, DFAULT, DFAULT, DFAULT },
+/* 3*/ { KBD_ASCII, I, {S,1, { "2" }}, {S,1, { "@" }}, {S,1, { "\000" }}, DFAULT, DFAULT, DFAULT, DFAULT },
+/* 4*/ { KBD_ASCII, I, {S,1, { "3" }}, {S,1, { "#" }}, {S,1, { "3" }}, DFAULT, DFAULT, DFAULT, DFAULT },
+/* 5*/ { KBD_ASCII, I, {S,1, { "4" }}, {S,1, { "$" }}, {S,1, { "4" }}, DFAULT, DFAULT, DFAULT, DFAULT },
+/* 6*/ { KBD_ASCII, I, {S,1, { "5" }}, {S,1, { "%" }}, {S,1, { "5" }}, DFAULT, DFAULT, DFAULT, DFAULT },
+/* 7*/ { KBD_ASCII, I, {S,1, { "6" }}, {S,1, { "^" }}, {S,1, { "\036" }}, DFAULT, DFAULT, DFAULT, DFAULT },
+/* 8*/ { KBD_ASCII, I, {S,1, { "7" }}, {S,1, { "&" }}, {S,1, { "7" }}, DFAULT, DFAULT, DFAULT, DFAULT },
+/* 9*/ { KBD_ASCII, I, {S,1, { "8" }}, {S,1, { "*" }}, {S,1, { "8" }}, DFAULT, DFAULT, DFAULT, DFAULT },
+/* 10*/ { KBD_ASCII, I, {S,1, { "9" }}, {S,1, { "(" }}, {S,1, { "9" }}, DFAULT, DFAULT, DFAULT, DFAULT },
+/* 11*/ { KBD_ASCII, I, {S,1, { "0" }}, {S,1, { ")" }}, {S,1, { "0" }}, DFAULT, DFAULT, DFAULT, DFAULT },
+/* 12*/ { KBD_ASCII, I, {S,1, { "-" }}, {S,1, { "_" }}, {S,1, { "\037" }}, DFAULT, DFAULT, DFAULT, DFAULT },
+/* 13*/ { KBD_ASCII, I, {S,1, { "=" }}, {S,1, { "+" }}, {S,1, { "=" }}, DFAULT, DFAULT, DFAULT, DFAULT },
+/* 14*/ { KBD_NONE, I, DFAULT, DFAULT, DFAULT, DFAULT, DFAULT, DFAULT, DFAULT },
+/* 15*/ { KBD_ASCII, I, {S,1, { "\177" }}, {S,1, { "\010" }}, {S,1, { "\177" }}, DFAULT, DFAULT, DFAULT, DFAULT },
+/* 16*/ { KBD_ASCII, I, {S,1, { "\t" }}, {S,1, { "\t" }}, {S,1, { "\t" }}, DFAULT, DFAULT, DFAULT, DFAULT },
+/* 17*/ { KBD_ASCII, I, {S,1, { "q" }}, {S,1, { "Q" }}, {S,1, { "\021" }}, DFAULT, DFAULT, DFAULT, DFAULT },
+/* 18*/ { KBD_ASCII, I, {S,1, { "w" }}, {S,1, { "W" }}, {S,1, { "\027" }}, DFAULT, DFAULT, DFAULT, DFAULT },
+/* 19*/ { KBD_ASCII, I, {S,1, { "e" }}, {S,1, { "E" }}, {S,1, { "\005" }}, DFAULT, DFAULT, DFAULT, DFAULT },
+/* 20*/ { KBD_ASCII, I, {S,1, { "r" }}, {S,1, { "R" }}, {S,1, { "\022" }}, DFAULT, DFAULT, DFAULT, DFAULT },
+/* 21*/ { KBD_ASCII, I, {S,1, { "t" }}, {S,1, { "T" }}, {S,1, { "\024" }}, DFAULT, DFAULT, DFAULT, DFAULT },
+/* 22*/ { KBD_ASCII, I, {S,1, { "y" }}, {S,1, { "Y" }}, {S,1, { "\031" }}, DFAULT, DFAULT, DFAULT, DFAULT },
+/* 23*/ { KBD_ASCII, I, {S,1, { "u" }}, {S,1, { "U" }}, {S,1, { "\025" }}, DFAULT, DFAULT, DFAULT, DFAULT },
+/* 24*/ { KBD_ASCII, I, {S,1, { "i" }}, {S,1, { "I" }}, {S,1, { "\011" }}, DFAULT, DFAULT, DFAULT, DFAULT },
+/* 25*/ { KBD_ASCII, I, {S,1, { "o" }}, {S,1, { "O" }}, {S,1, { "\017" }}, DFAULT, DFAULT, DFAULT, DFAULT },
+/* 26*/ { KBD_ASCII, I, {S,1, { "p" }}, {S,1, { "P" }}, {S,1, { "\020" }}, DFAULT, DFAULT, DFAULT, DFAULT },
+/* 27*/ { KBD_ASCII, I, {S,1, { "[" }}, {S,1, { "{" }}, {S,1, { "\033" }}, DFAULT, DFAULT, DFAULT, DFAULT },
+/* 28*/ { KBD_ASCII, I, {S,1, { "]" }}, {S,1, { "}" }}, {S,1, { "\035" }}, DFAULT, DFAULT, DFAULT, DFAULT },
+/* 29*/ { KBD_ASCII, I, {S,1, { "\\" }}, {S,1, { "|" }}, {S,1, { "\034" }}, DFAULT, DFAULT, DFAULT, DFAULT },
+/* 30*/ { KBD_CAPS, I, DFAULT, DFAULT, DFAULT, DFAULT, DFAULT, DFAULT, DFAULT },
+/* 31*/ { KBD_ASCII, I, {S,1, { "a" }}, {S,1, { "A" }}, {S,1, { "\001" }}, DFAULT, DFAULT, DFAULT, DFAULT },
+/* 32*/ { KBD_ASCII, I, {S,1, { "s" }}, {S,1, { "S" }}, {S,1, { "\023" }}, DFAULT, DFAULT, DFAULT, DFAULT },
+/* 33*/ { KBD_ASCII, I, {S,1, { "d" }}, {S,1, { "D" }}, {S,1, { "\004" }}, DFAULT, DFAULT, DFAULT, DFAULT },
+/* 34*/ { KBD_ASCII, I, {S,1, { "f" }}, {S,1, { "F" }}, {S,1, { "\006" }}, DFAULT, DFAULT, DFAULT, DFAULT },
+/* 35*/ { KBD_ASCII, I, {S,1, { "g" }}, {S,1, { "G" }}, {S,1, { "\007" }}, DFAULT, DFAULT, DFAULT, DFAULT },
+/* 36*/ { KBD_ASCII, I, {S,1, { "h" }}, {S,1, { "H" }}, {S,1, { "\010" }}, DFAULT, DFAULT, DFAULT, DFAULT },
+/* 37*/ { KBD_ASCII, I, {S,1, { "j" }}, {S,1, { "J" }}, {S,1, { "\n" }}, DFAULT, DFAULT, DFAULT, DFAULT },
+/* 38*/ { KBD_ASCII, I, {S,1, { "k" }}, {S,1, { "K" }}, {S,1, { "\013" }}, DFAULT, DFAULT, DFAULT, DFAULT },
+/* 39*/ { KBD_ASCII, I, {S,1, { "l" }}, {S,1, { "L" }}, {S,1, { "\014" }}, DFAULT, DFAULT, DFAULT, DFAULT },
+/* 40*/ { KBD_ASCII, I, {S,1, { ";" }}, {S,1, { ":" }}, {S,1, { ";" }}, DFAULT, DFAULT, DFAULT, DFAULT },
+/* 41*/ { KBD_ASCII, I, {S,1, { "'" }}, {S,1, { "\" }"}, {S,1, { "'" }}, DFAULT, DFAULT, DFAULT, DFAULT },
+/* 42*/ { KBD_ASCII, I, {S,1, { "\\" }}, {S,1, { "|" }}, {S,1, { "\034" }}, DFAULT, DFAULT, DFAULT, DFAULT },
+/* 43*/ { KBD_RETURN,I, {S,1, { "\r" }}, {S,1, { "\r" }}, {S,1, { "\r" }}, DFAULT, DFAULT, DFAULT, DFAULT },
+/* 44*/ { KBD_SHIFT, I, DFAULT, DFAULT, DFAULT, DFAULT, DFAULT, DFAULT, DFAULT },
+/* 45*/ { KBD_ASCII, I, {S,1, { "<" }}, {S,1, { ">" }}, DFAULT, DFAULT, DFAULT, DFAULT, DFAULT },
+/* 46*/ { KBD_ASCII, I, {S,1, { "z" }}, {S,1, { "Z" }}, {S,1, { "\032" }}, DFAULT, DFAULT, DFAULT, DFAULT },
+/* 47*/ { KBD_ASCII, I, {S,1, { "x" }}, {S,1, { "X" }}, {S,1, { "\030" }}, DFAULT, DFAULT, DFAULT, DFAULT },
+/* 48*/ { KBD_ASCII, I, {S,1, { "c" }}, {S,1, { "C" }}, {S,1, { "\003" }}, DFAULT, DFAULT, DFAULT, DFAULT },
+/* 49*/ { KBD_ASCII, I, {S,1, { "v" }}, {S,1, { "V" }}, {S,1, { "\026" }}, DFAULT, DFAULT, DFAULT, DFAULT },
+/* 50*/ { KBD_ASCII, I, {S,1, { "b" }}, {S,1, { "B" }}, {S,1, { "\002" }}, DFAULT, DFAULT, DFAULT, DFAULT },
+/* 51*/ { KBD_ASCII, I, {S,1, { "n" }}, {S,1, { "N" }}, {S,1, { "\016" }}, DFAULT, DFAULT, DFAULT, DFAULT },
+/* 52*/ { KBD_ASCII, I, {S,1, { "m" }}, {S,1, { "M" }}, {S,1, { "\r" }}, DFAULT, DFAULT, DFAULT, DFAULT },
+/* 53*/ { KBD_ASCII, I, {S,1, { "," }}, {S,1, { "<" }}, {S,1, { "," }}, DFAULT, DFAULT, DFAULT, DFAULT },
+/* 54*/ { KBD_ASCII, I, {S,1, { "." }}, {S,1, { ">" }}, {S,1, { "." }}, DFAULT, DFAULT, DFAULT, DFAULT },
+/* 55*/ { KBD_ASCII, I, {S,1, { "/" }}, {S,1, { "?" }}, {S,1, { "/" }}, DFAULT, DFAULT, DFAULT, DFAULT },
+/* 56*/ { KBD_NONE, I, DFAULT, DFAULT, DFAULT, DFAULT, DFAULT, DFAULT, DFAULT },
+/* 57*/ { KBD_SHIFT, I, DFAULT, DFAULT, DFAULT, DFAULT, DFAULT, DFAULT, DFAULT },
+/* 58*/ { KBD_CTL, I, DFAULT, DFAULT, DFAULT, DFAULT, DFAULT, DFAULT, DFAULT },
+/* 59*/ { KBD_ASCII, I, DFAULT, DFAULT, DFAULT, DFAULT, DFAULT, DFAULT, DFAULT },
+/* 60*/ { KBD_META, I, DFAULT, DFAULT, DFAULT, DFAULT, DFAULT, DFAULT, DFAULT },
#if !PCVT_NULLCHARS
-/* 61*/ KBD_ASCII, I, DFAULT, DFAULT, DFAULT, DFAULT, DFAULT, DFAULT, DFAULT,
+/* 61*/ { KBD_ASCII, I, DFAULT, DFAULT, DFAULT, DFAULT, DFAULT, DFAULT, DFAULT },
#else
-/* 61*/ KBD_ASCII, I, DFAULT, DFAULT, {S,1,C "\000"}, DFAULT, DFAULT, DFAULT, DFAULT,
+/* 61*/ { KBD_ASCII, I, DFAULT, DFAULT, {S,1, { "\000" }}, DFAULT, DFAULT, DFAULT, DFAULT },
#endif /* PCVT_NULLCHARS */
-/* 62*/ KBD_META, I, DFAULT, DFAULT, DFAULT, DFAULT, DFAULT, DFAULT, DFAULT,
-/* 63*/ KBD_ASCII, I, DFAULT, DFAULT, DFAULT, DFAULT, DFAULT, DFAULT, DFAULT,
-/* 64*/ KBD_CTL, I, DFAULT, DFAULT, DFAULT, DFAULT, DFAULT, DFAULT, DFAULT,
-/* 65*/ KBD_NONE, I, DFAULT, DFAULT, DFAULT, DFAULT, DFAULT, DFAULT, DFAULT,
-/* 66*/ KBD_NONE, I, DFAULT, DFAULT, DFAULT, DFAULT, DFAULT, DFAULT, DFAULT,
-/* 67*/ KBD_NONE, I, DFAULT, DFAULT, DFAULT, DFAULT, DFAULT, DFAULT, DFAULT,
-/* 68*/ KBD_NONE, I, DFAULT, DFAULT, DFAULT, DFAULT, DFAULT, DFAULT, DFAULT,
-/* 69*/ KBD_NONE, I, DFAULT, DFAULT, DFAULT, DFAULT, DFAULT, DFAULT, DFAULT,
-/* 70*/ KBD_NONE, I, DFAULT, DFAULT, DFAULT, DFAULT, DFAULT, DFAULT, DFAULT,
-/* 71*/ KBD_NONE, I, DFAULT, DFAULT, DFAULT, DFAULT, DFAULT, DFAULT, DFAULT,
-/* 72*/ KBD_NONE, I, DFAULT, DFAULT, DFAULT, DFAULT, DFAULT, DFAULT, DFAULT,
-/* 73*/ KBD_NONE, I, DFAULT, DFAULT, DFAULT, DFAULT, DFAULT, DFAULT, DFAULT,
-/* 74*/ KBD_NONE, I, DFAULT, DFAULT, DFAULT, DFAULT, DFAULT, DFAULT, DFAULT,
-/* 75*/ KBD_FUNC, I, {S,4,C "\033[2~"}, {S,4,C "\033[2~"}, {S,4,C "\033[2~"}, DFAULT, DFAULT, DFAULT, DFAULT,
-/* 76*/ KBD_FUNC, I, {S,4,C "\033[3~"}, {S,4,C "\033[3~"}, {S,4,C "\033[3~"}, DFAULT, DFAULT, DFAULT, DFAULT,
-/* 77*/ KBD_NONE, I, DFAULT, DFAULT, DFAULT, DFAULT, DFAULT, DFAULT, DFAULT,
-/* 78*/ KBD_NONE, I, DFAULT, DFAULT, DFAULT, DFAULT, DFAULT, DFAULT, DFAULT,
-/* 79*/ KBD_CURSOR,I, {S,4,C "\033[D"}, {S,4,C "\033OD"}, {S,4,C "\033[D"}, DFAULT, DFAULT, DFAULT, DFAULT,
-/* 80*/ KBD_FUNC, I, {S,4,C "\033[1~"}, {S,4,C "\033[1~"}, {S,4,C "\033[1~"}, DFAULT, DFAULT, DFAULT, DFAULT,
-/* 81*/ KBD_FUNC, I, {S,4,C "\033[4~"}, {S,4,C "\033[4~"}, {S,4,C "\033[4~"}, DFAULT, DFAULT, DFAULT, DFAULT,
-/* 82*/ KBD_NONE, I, DFAULT, DFAULT, DFAULT, DFAULT, DFAULT, DFAULT, DFAULT,
-/* 83*/ KBD_CURSOR,I, {S,4,C "\033[A"}, {S,4,C "\033OA"}, {S,4,C "\033[A"}, DFAULT, DFAULT, DFAULT, DFAULT,
-/* 84*/ KBD_CURSOR,I, {S,4,C "\033[B"}, {S,4,C "\033OB"}, {S,4,C "\033[B"}, DFAULT, DFAULT, DFAULT, DFAULT,
-/* 85*/ KBD_FUNC, I, {S,4,C "\033[5~"}, {S,4,C "\033[5~"}, {S,4,C "\033[5~"}, DFAULT, DFAULT, DFAULT, DFAULT,
-/* 86*/ KBD_FUNC, I, {S,4,C "\033[6~"}, {S,4,C "\033[6~"}, {S,4,C "\033[6~"}, DFAULT, DFAULT, DFAULT, DFAULT,
-/* 87*/ KBD_NONE, I, DFAULT, DFAULT, DFAULT, DFAULT, DFAULT, DFAULT, DFAULT,
-/* 88*/ KBD_NONE, I, DFAULT, DFAULT, DFAULT, DFAULT, DFAULT, DFAULT, DFAULT,
-/* 89*/ KBD_CURSOR,I, {S,3,C "\033[C"}, {S,3,C "\033OC"}, {S,3,C "\033[C"}, DFAULT, DFAULT, DFAULT, DFAULT,
-/* 90*/ KBD_NUM, I, DFAULT, DFAULT, DFAULT, DFAULT, DFAULT, DFAULT, DFAULT,
-/* 91*/ KBD_KP, I, {S,1,C "7"}, {S,2,C "\033Ow"}, {S,1,C "7"}, DFAULT, DFAULT, DFAULT, DFAULT,
-/* 92*/ KBD_KP, I, {S,1,C "4"}, {S,2,C "\033Ot"}, {S,1,C "4"}, DFAULT, DFAULT, DFAULT, DFAULT,
-/* 93*/ KBD_KP, I, {S,1,C "1"}, {S,2,C "\033Oq"}, {S,1,C "1"}, DFAULT, DFAULT, DFAULT, DFAULT,
-/* 94*/ KBD_NONE, I, DFAULT, DFAULT, DFAULT, DFAULT, DFAULT, DFAULT, DFAULT,
-/* 95*/ KBD_KP, I, {S,1,C "/"}, {S,1,C "/"}, {S,1,C "/"}, DFAULT, DFAULT, DFAULT, DFAULT,
-/* 96*/ KBD_KP, I, {S,1,C "8"}, {S,2,C "\033Ox"}, {S,1,C "8"}, DFAULT, DFAULT, DFAULT, DFAULT,
-/* 97*/ KBD_KP, I, {S,1,C "5"}, {S,2,C "\033Ou"}, {S,1,C "5"}, DFAULT, DFAULT, DFAULT, DFAULT,
-/* 98*/ KBD_KP, I, {S,1,C "2"}, {S,2,C "\033Or"}, {S,1,C "2"}, DFAULT, DFAULT, DFAULT, DFAULT,
-/* 99*/ KBD_KP, I, {S,1,C "0"}, {S,2,C "\033Op"}, {S,1,C "0"}, DFAULT, DFAULT, DFAULT, DFAULT,
-/*100*/ KBD_KP, I, {S,1,C "*"}, {S,1,C "*"}, {S,1,C "*"}, DFAULT, DFAULT, DFAULT, DFAULT,
-/*101*/ KBD_KP, I, {S,1,C "9"}, {S,2,C "\033Oy"}, {S,1,C "9"}, DFAULT, DFAULT, DFAULT, DFAULT,
-/*102*/ KBD_KP, I, {S,1,C "6"}, {S,2,C "\033Ov"}, {S,1,C "6"}, DFAULT, DFAULT, DFAULT, DFAULT,
-/*103*/ KBD_KP, I, {S,1,C "3"}, {S,2,C "\033Os"}, {S,1,C "3"}, DFAULT, DFAULT, DFAULT, DFAULT,
-/*104*/ KBD_KP, I, {S,1,C "."}, {S,2,C "\033On"}, {S,1,C "."}, DFAULT, DFAULT, DFAULT, DFAULT,
-/*105*/ KBD_KP, I, {S,1,C "-"}, {S,2,C "\033Om"}, {S,1,C "-"}, DFAULT, DFAULT, DFAULT, DFAULT,
-/*106*/ KBD_KP, I, {S,1,C "+"}, {S,1,C "+"}, {S,1,C "+"}, DFAULT, DFAULT, DFAULT, DFAULT,
-/*107*/ KBD_NONE, I, DFAULT, DFAULT, DFAULT, DFAULT, DFAULT, DFAULT, DFAULT,
-/*108*/ KBD_RETURN,I, {S,1,C "\r"}, {S,2,C "\033OM"}, {S,1,C "\r"}, DFAULT, DFAULT, DFAULT, DFAULT,
-/*109*/ KBD_NONE, I, DFAULT, DFAULT, DFAULT, DFAULT, DFAULT, DFAULT, DFAULT,
-/*110*/ KBD_ASCII, I, {S,1,C "\033"}, {S,2,C "\033"}, {S,1,C "\033"}, DFAULT, DFAULT, DFAULT, DFAULT,
-/*111*/ KBD_NONE, I, DFAULT, DFAULT, DFAULT, DFAULT, DFAULT, DFAULT, DFAULT,
-/*112*/ KBD_FUNC, I, {F,0,V fkey1}, {F,0,V sfkey1}, {F,0,V cfkey1}, DFAULT, DFAULT, DFAULT, DFAULT,
-/*113*/ KBD_FUNC, I, {F,0,V fkey2}, {F,0,V sfkey2}, {F,0,V cfkey2}, DFAULT, DFAULT, DFAULT, DFAULT,
-/*114*/ KBD_FUNC, I, {F,0,V fkey3}, {F,0,V sfkey3}, {F,0,V cfkey3}, DFAULT, DFAULT, DFAULT, DFAULT,
-/*115*/ KBD_FUNC, I, {F,0,V fkey4}, {F,0,V sfkey4}, {F,0,V cfkey4}, DFAULT, DFAULT, DFAULT, DFAULT,
-/*116*/ KBD_FUNC, I, {F,0,V fkey5}, {F,0,V sfkey5}, {F,0,V cfkey5}, DFAULT, DFAULT, DFAULT, DFAULT,
-/*117*/ KBD_FUNC, I, {F,0,V fkey6}, {F,0,V sfkey6}, {F,0,V cfkey6}, DFAULT, DFAULT, DFAULT, DFAULT,
-/*118*/ KBD_FUNC, I, {F,0,V fkey7}, {F,0,V sfkey7}, {F,0,V cfkey7}, DFAULT, DFAULT, DFAULT, DFAULT,
-/*119*/ KBD_FUNC, I, {F,0,V fkey8}, {F,0,V sfkey8}, {F,0,V cfkey8}, DFAULT, DFAULT, DFAULT, DFAULT,
-/*120*/ KBD_FUNC, I, {F,0,V fkey9}, {F,0,V sfkey9}, {F,0,V cfkey9}, DFAULT, DFAULT, DFAULT, DFAULT,
-/*121*/ KBD_FUNC, I, {F,0,V fkey10}, {F,0,V sfkey10}, {F,0,V cfkey10}, DFAULT, DFAULT, DFAULT, DFAULT,
-/*122*/ KBD_FUNC, I, {F,0,V fkey11}, {F,0,V sfkey11}, {F,0,V cfkey11}, DFAULT, DFAULT, DFAULT, DFAULT,
-/*123*/ KBD_FUNC, I, {F,0,V fkey12}, {F,0,V sfkey12}, {F,0,V cfkey12}, DFAULT, DFAULT, DFAULT, DFAULT,
-/*124*/ KBD_KP, I, DFAULT, DFAULT, DFAULT, DFAULT, DFAULT, DFAULT, DFAULT,
-/*125*/ KBD_SCROLL,I, DFAULT, DFAULT, DFAULT, DFAULT, DFAULT, DFAULT, DFAULT,
-/*126*/ KBD_BREAK, I, DFAULT, DFAULT, DFAULT, DFAULT, DFAULT, DFAULT, DFAULT,
-/*127*/ KBD_FUNC, I, DFAULT, DFAULT, DFAULT, DFAULT, DFAULT, DFAULT, DFAULT,
+/* 62*/ { KBD_META, I, DFAULT, DFAULT, DFAULT, DFAULT, DFAULT, DFAULT, DFAULT },
+/* 63*/ { KBD_ASCII, I, DFAULT, DFAULT, DFAULT, DFAULT, DFAULT, DFAULT, DFAULT },
+/* 64*/ { KBD_CTL, I, DFAULT, DFAULT, DFAULT, DFAULT, DFAULT, DFAULT, DFAULT },
+/* 65*/ { KBD_NONE, I, DFAULT, DFAULT, DFAULT, DFAULT, DFAULT, DFAULT, DFAULT },
+/* 66*/ { KBD_NONE, I, DFAULT, DFAULT, DFAULT, DFAULT, DFAULT, DFAULT, DFAULT },
+/* 67*/ { KBD_NONE, I, DFAULT, DFAULT, DFAULT, DFAULT, DFAULT, DFAULT, DFAULT },
+/* 68*/ { KBD_NONE, I, DFAULT, DFAULT, DFAULT, DFAULT, DFAULT, DFAULT, DFAULT },
+/* 69*/ { KBD_NONE, I, DFAULT, DFAULT, DFAULT, DFAULT, DFAULT, DFAULT, DFAULT },
+/* 70*/ { KBD_NONE, I, DFAULT, DFAULT, DFAULT, DFAULT, DFAULT, DFAULT, DFAULT },
+/* 71*/ { KBD_NONE, I, DFAULT, DFAULT, DFAULT, DFAULT, DFAULT, DFAULT, DFAULT },
+/* 72*/ { KBD_NONE, I, DFAULT, DFAULT, DFAULT, DFAULT, DFAULT, DFAULT, DFAULT },
+/* 73*/ { KBD_NONE, I, DFAULT, DFAULT, DFAULT, DFAULT, DFAULT, DFAULT, DFAULT },
+/* 74*/ { KBD_NONE, I, DFAULT, DFAULT, DFAULT, DFAULT, DFAULT, DFAULT, DFAULT },
+/* 75*/ { KBD_FUNC, I, {S,4, { "\033[2~" }}, {S,4, { "\033[2~" }}, {S,4, { "\033[2~" }}, DFAULT, DFAULT, DFAULT, DFAULT },
+/* 76*/ { KBD_FUNC, I, {S,4, { "\033[3~" }}, {S,4, { "\033[3~" }}, {S,4, { "\033[3~" }}, DFAULT, DFAULT, DFAULT, DFAULT },
+/* 77*/ { KBD_NONE, I, DFAULT, DFAULT, DFAULT, DFAULT, DFAULT, DFAULT, DFAULT },
+/* 78*/ { KBD_NONE, I, DFAULT, DFAULT, DFAULT, DFAULT, DFAULT, DFAULT, DFAULT },
+/* 79*/ { KBD_CURSOR,I, {S,4, { "\033[D" }}, {S,4, { "\033OD" }}, {S,4, { "\033[D" }}, DFAULT, DFAULT, DFAULT, DFAULT },
+/* 80*/ { KBD_FUNC, I, {S,4, { "\033[1~" }}, {S,4, { "\033[1~" }}, {S,4, { "\033[1~" }}, DFAULT, DFAULT, DFAULT, DFAULT },
+/* 81*/ { KBD_FUNC, I, {S,4, { "\033[4~" }}, {S,4, { "\033[4~" }}, {S,4, { "\033[4~" }}, DFAULT, DFAULT, DFAULT, DFAULT },
+/* 82*/ { KBD_NONE, I, DFAULT, DFAULT, DFAULT, DFAULT, DFAULT, DFAULT, DFAULT },
+/* 83*/ { KBD_CURSOR,I, {S,4, { "\033[A" }}, {S,4, { "\033OA" }}, {S,4, { "\033[A" }}, DFAULT, DFAULT, DFAULT, DFAULT },
+/* 84*/ { KBD_CURSOR,I, {S,4, { "\033[B" }}, {S,4, { "\033OB" }}, {S,4, { "\033[B" }}, DFAULT, DFAULT, DFAULT, DFAULT },
+/* 85*/ { KBD_FUNC, I, {S,4, { "\033[5~" }}, {S,4, { "\033[5~" }}, {S,4, { "\033[5~" }}, DFAULT, DFAULT, DFAULT, DFAULT },
+/* 86*/ { KBD_FUNC, I, {S,4, { "\033[6~" }}, {S,4, { "\033[6~" }}, {S,4, { "\033[6~" }}, DFAULT, DFAULT, DFAULT, DFAULT },
+/* 87*/ { KBD_NONE, I, DFAULT, DFAULT, DFAULT, DFAULT, DFAULT, DFAULT, DFAULT },
+/* 88*/ { KBD_NONE, I, DFAULT, DFAULT, DFAULT, DFAULT, DFAULT, DFAULT, DFAULT },
+/* 89*/ { KBD_CURSOR,I, {S,3, { "\033[C" }}, {S,3, { "\033OC" }}, {S,3, { "\033[C" }}, DFAULT, DFAULT, DFAULT, DFAULT },
+/* 90*/ { KBD_NUM, I, DFAULT, DFAULT, DFAULT, DFAULT, DFAULT, DFAULT, DFAULT },
+/* 91*/ { KBD_KP, I, {S,1, { "7" }}, {S,2, { "\033Ow" }}, {S,1, { "7" }}, DFAULT, DFAULT, DFAULT, DFAULT },
+/* 92*/ { KBD_KP, I, {S,1, { "4" }}, {S,2, { "\033Ot" }}, {S,1, { "4" }}, DFAULT, DFAULT, DFAULT, DFAULT },
+/* 93*/ { KBD_KP, I, {S,1, { "1" }}, {S,2, { "\033Oq" }}, {S,1, { "1" }}, DFAULT, DFAULT, DFAULT, DFAULT },
+/* 94*/ { KBD_NONE, I, DFAULT, DFAULT, DFAULT, DFAULT, DFAULT, DFAULT, DFAULT },
+/* 95*/ { KBD_KP, I, {S,1, { "/" }}, {S,1, { "/" }}, {S,1, { "/" }}, DFAULT, DFAULT, DFAULT, DFAULT },
+/* 96*/ { KBD_KP, I, {S,1, { "8" }}, {S,2, { "\033Ox" }}, {S,1, { "8" }}, DFAULT, DFAULT, DFAULT, DFAULT },
+/* 97*/ { KBD_KP, I, {S,1, { "5" }}, {S,2, { "\033Ou" }}, {S,1, { "5" }}, DFAULT, DFAULT, DFAULT, DFAULT },
+/* 98*/ { KBD_KP, I, {S,1, { "2" }}, {S,2, { "\033Or" }}, {S,1, { "2" }}, DFAULT, DFAULT, DFAULT, DFAULT },
+/* 99*/ { KBD_KP, I, {S,1, { "0" }}, {S,2, { "\033Op" }}, {S,1, { "0" }}, DFAULT, DFAULT, DFAULT, DFAULT },
+/*100*/ { KBD_KP, I, {S,1, { "*" }}, {S,1, { "*" }}, {S,1, { "*" }}, DFAULT, DFAULT, DFAULT, DFAULT },
+/*101*/ { KBD_KP, I, {S,1, { "9" }}, {S,2, { "\033Oy" }}, {S,1, { "9" }}, DFAULT, DFAULT, DFAULT, DFAULT },
+/*102*/ { KBD_KP, I, {S,1, { "6" }}, {S,2, { "\033Ov" }}, {S,1, { "6" }}, DFAULT, DFAULT, DFAULT, DFAULT },
+/*103*/ { KBD_KP, I, {S,1, { "3" }}, {S,2, { "\033Os" }}, {S,1, { "3" }}, DFAULT, DFAULT, DFAULT, DFAULT },
+/*104*/ { KBD_KP, I, {S,1, { "." }}, {S,2, { "\033On" }}, {S,1, { "." }}, DFAULT, DFAULT, DFAULT, DFAULT },
+/*105*/ { KBD_KP, I, {S,1, { "-" }}, {S,2, { "\033Om" }}, {S,1, { "-" }}, DFAULT, DFAULT, DFAULT, DFAULT },
+/*106*/ { KBD_KP, I, {S,1, { "+" }}, {S,1, { "+" }}, {S,1, { "+" }}, DFAULT, DFAULT, DFAULT, DFAULT },
+/*107*/ { KBD_NONE, I, DFAULT, DFAULT, DFAULT, DFAULT, DFAULT, DFAULT, DFAULT },
+/*108*/ { KBD_RETURN,I, {S,1, { "\r" }}, {S,2, { "\033OM" }}, {S,1, { "\r" }}, DFAULT, DFAULT, DFAULT, DFAULT },
+/*109*/ { KBD_NONE, I, DFAULT, DFAULT, DFAULT, DFAULT, DFAULT, DFAULT, DFAULT },
+/*110*/ { KBD_ASCII, I, {S,1, { "\033" }}, {S,2, { "\033" }}, {S,1, { "\033" }}, DFAULT, DFAULT, DFAULT, DFAULT },
+/*111*/ { KBD_NONE, I, DFAULT, DFAULT, DFAULT, DFAULT, DFAULT, DFAULT, DFAULT },
+/*112*/ { KBD_FUNC, I, {F,0, { C fkey1 }}, {F,0, { C sfkey1 }}, {F,0, { C cfkey1 }}, DFAULT, DFAULT, DFAULT, DFAULT },
+/*113*/ { KBD_FUNC, I, {F,0, { C fkey2 }}, {F,0, { C sfkey2 }}, {F,0, { C cfkey2 }}, DFAULT, DFAULT, DFAULT, DFAULT },
+/*114*/ { KBD_FUNC, I, {F,0, { C fkey3 }}, {F,0, { C sfkey3 }}, {F,0, { C cfkey3 }}, DFAULT, DFAULT, DFAULT, DFAULT },
+/*115*/ { KBD_FUNC, I, {F,0, { C fkey4 }}, {F,0, { C sfkey4 }}, {F,0, { C cfkey4 }}, DFAULT, DFAULT, DFAULT, DFAULT },
+/*116*/ { KBD_FUNC, I, {F,0, { C fkey5 }}, {F,0, { C sfkey5 }}, {F,0, { C cfkey5 }}, DFAULT, DFAULT, DFAULT, DFAULT },
+/*117*/ { KBD_FUNC, I, {F,0, { C fkey6 }}, {F,0, { C sfkey6 }}, {F,0, { C cfkey6 }}, DFAULT, DFAULT, DFAULT, DFAULT },
+/*118*/ { KBD_FUNC, I, {F,0, { C fkey7 }}, {F,0, { C sfkey7 }}, {F,0, { C cfkey7 }}, DFAULT, DFAULT, DFAULT, DFAULT },
+/*119*/ { KBD_FUNC, I, {F,0, { C fkey8 }}, {F,0, { C sfkey8 }}, {F,0, { C cfkey8 }}, DFAULT, DFAULT, DFAULT, DFAULT },
+/*120*/ { KBD_FUNC, I, {F,0, { C fkey9 }}, {F,0, { C sfkey9 }}, {F,0, { C cfkey9 }}, DFAULT, DFAULT, DFAULT, DFAULT },
+/*121*/ { KBD_FUNC, I, {F,0, { C fkey10 }}, {F,0, { C sfkey10 }}, {F,0, { C cfkey10 }}, DFAULT, DFAULT, DFAULT, DFAULT },
+/*122*/ { KBD_FUNC, I, {F,0, { C fkey11 }}, {F,0, { C sfkey11 }}, {F,0, { C cfkey11 }}, DFAULT, DFAULT, DFAULT, DFAULT },
+/*123*/ { KBD_FUNC, I, {F,0, { C fkey12 }}, {F,0, { C sfkey12 }}, {F,0, { C cfkey12 }}, DFAULT, DFAULT, DFAULT, DFAULT },
+/*124*/ { KBD_KP, I, DFAULT, DFAULT, DFAULT, DFAULT, DFAULT, DFAULT, DFAULT },
+/*125*/ { KBD_SCROLL,I, DFAULT, DFAULT, DFAULT, DFAULT, DFAULT, DFAULT, DFAULT },
+/*126*/ { KBD_BREAK, I, DFAULT, DFAULT, DFAULT, DFAULT, DFAULT, DFAULT, DFAULT },
+/*127*/ { KBD_FUNC, I, DFAULT, DFAULT, DFAULT, DFAULT, DFAULT, DFAULT, DFAULT },
#undef C
#undef U
@@ -368,138 +368,138 @@ static Keycap_def key2ascii[] =
/* type index unshift shift ctrl */
/* ---------------------------------------------------------- */
-/* 0*/ KBD_NONE, I, {S,C "df"}, {S,C ""}, {S,C ""},
-/* 1*/ KBD_ASCII, I, {S,C "`"}, {S,C "~"}, {S,C "`"},
-/* 2*/ KBD_ASCII, I, {S,C "1"}, {S,C "!"}, {S,C "1"},
-/* 3*/ KBD_ASCII, I, {S,C "2"}, {S,C "@"}, {S,C "\000"},
-/* 4*/ KBD_ASCII, I, {S,C "3"}, {S,C "#"}, {S,C "3"},
-/* 5*/ KBD_ASCII, I, {S,C "4"}, {S,C "$"}, {S,C "4"},
-/* 6*/ KBD_ASCII, I, {S,C "5"}, {S,C "%"}, {S,C "5"},
-/* 7*/ KBD_ASCII, I, {S,C "6"}, {S,C "^"}, {S,C "\036"},
-/* 8*/ KBD_ASCII, I, {S,C "7"}, {S,C "&"}, {S,C "7"},
-/* 9*/ KBD_ASCII, I, {S,C "8"}, {S,C "*"}, {S,C "9"},
-/* 10*/ KBD_ASCII, I, {S,C "9"}, {S,C "("}, {S,C "9"},
-/* 11*/ KBD_ASCII, I, {S,C "0"}, {S,C ")"}, {S,C "0"},
-/* 12*/ KBD_ASCII, I, {S,C "-"}, {S,C "_"}, {S,C "\037"},
-/* 13*/ KBD_ASCII, I, {S,C "="}, {S,C "+"}, {S,C "="},
-/* 14*/ KBD_NONE, I, {S,C ""}, {S,C ""}, {S,C ""},
-/* 15*/ KBD_ASCII, I, {S,C "\177"}, {S,C "\010"}, {S,C "\177"}, /* BS */
-/* 16*/ KBD_ASCII, I, {S,C "\t"}, {S,C "\t"}, {S,C "\t"}, /* TAB */
-/* 17*/ KBD_ASCII, I, {S,C "q"}, {S,C "Q"}, {S,C "\021"},
-/* 18*/ KBD_ASCII, I, {S,C "w"}, {S,C "W"}, {S,C "\027"},
-/* 19*/ KBD_ASCII, I, {S,C "e"}, {S,C "E"}, {S,C "\005"},
-/* 20*/ KBD_ASCII, I, {S,C "r"}, {S,C "R"}, {S,C "\022"},
-/* 21*/ KBD_ASCII, I, {S,C "t"}, {S,C "T"}, {S,C "\024"},
-/* 22*/ KBD_ASCII, I, {S,C "y"}, {S,C "Y"}, {S,C "\031"},
-/* 23*/ KBD_ASCII, I, {S,C "u"}, {S,C "U"}, {S,C "\025"},
-/* 24*/ KBD_ASCII, I, {S,C "i"}, {S,C "I"}, {S,C "\011"},
-/* 25*/ KBD_ASCII, I, {S,C "o"}, {S,C "O"}, {S,C "\017"},
-/* 26*/ KBD_ASCII, I, {S,C "p"}, {S,C "P"}, {S,C "\020"},
-/* 27*/ KBD_ASCII, I, {S,C "["}, {S,C "{"}, {S,C "\033"},
-/* 28*/ KBD_ASCII, I, {S,C "]"}, {S,C "}"}, {S,C "\035"},
-/* 29*/ KBD_ASCII, I, {S,C "\\"}, {S,C "|"}, {S,C "\034"},
-/* 30*/ KBD_CAPS, I, {S,C ""}, {S,C ""}, {S,C ""},
-/* 31*/ KBD_ASCII, I, {S,C "a"}, {S,C "A"}, {S,C "\001"},
-/* 32*/ KBD_ASCII, I, {S,C "s"}, {S,C "S"}, {S,C "\023"},
-/* 33*/ KBD_ASCII, I, {S,C "d"}, {S,C "D"}, {S,C "\004"},
-/* 34*/ KBD_ASCII, I, {S,C "f"}, {S,C "F"}, {S,C "\006"},
-/* 35*/ KBD_ASCII, I, {S,C "g"}, {S,C "G"}, {S,C "\007"},
-/* 36*/ KBD_ASCII, I, {S,C "h"}, {S,C "H"}, {S,C "\010"},
-/* 37*/ KBD_ASCII, I, {S,C "j"}, {S,C "J"}, {S,C "\n"},
-/* 38*/ KBD_ASCII, I, {S,C "k"}, {S,C "K"}, {S,C "\013"},
-/* 39*/ KBD_ASCII, I, {S,C "l"}, {S,C "L"}, {S,C "\014"},
-/* 40*/ KBD_ASCII, I, {S,C ";"}, {S,C ":"}, {S,C ";"},
-/* 41*/ KBD_ASCII, I, {S,C "'"}, {S,C "\""}, {S,C "'"},
-/* 42*/ KBD_ASCII, I, {S,C "\\"}, {S,C "|"}, {S,C "\034"}, /* special */
-/* 43*/ KBD_RETURN,I, {S,C "\r"}, {S,C "\r"}, {S,C "\r"}, /* RETURN */
-/* 44*/ KBD_SHIFT, I, {S,C ""}, {S,C ""}, {S,C ""}, /* SHIFT left */
-/* 45*/ KBD_ASCII, I, {S,C "<"}, {S,C ">"}, {S,C ""},
-/* 46*/ KBD_ASCII, I, {S,C "z"}, {S,C "Z"}, {S,C "\032"},
-/* 47*/ KBD_ASCII, I, {S,C "x"}, {S,C "X"}, {S,C "\030"},
-/* 48*/ KBD_ASCII, I, {S,C "c"}, {S,C "C"}, {S,C "\003"},
-/* 49*/ KBD_ASCII, I, {S,C "v"}, {S,C "V"}, {S,C "\026"},
-/* 50*/ KBD_ASCII, I, {S,C "b"}, {S,C "B"}, {S,C "\002"},
-/* 51*/ KBD_ASCII, I, {S,C "n"}, {S,C "N"}, {S,C "\016"},
-/* 52*/ KBD_ASCII, I, {S,C "m"}, {S,C "M"}, {S,C "\r"},
-/* 53*/ KBD_ASCII, I, {S,C ","}, {S,C "<"}, {S,C ","},
-/* 54*/ KBD_ASCII, I, {S,C "."}, {S,C ">"}, {S,C "."},
-/* 55*/ KBD_ASCII, I, {S,C "/"}, {S,C "?"}, {S,C "/"},
-/* 56*/ KBD_NONE, I, {S,C ""}, {S,C ""}, {S,C ""},
-/* 57*/ KBD_SHIFT, I, {S,C ""}, {S,C ""}, {S,C ""}, /* SHIFT right */
-/* 58*/ KBD_CTL, I, {S,C ""}, {S,C ""}, {S,C ""}, /* CTL left */
-/* 59*/ KBD_ASCII, I, {S,C ""}, {S,C ""}, {S,C ""},
-/* 60*/ KBD_META, I, {S,C ""}, {S,C ""}, {S,C ""}, /* ALT left */
+/* 0*/ { KBD_NONE, I, {S, { "df" }}, {S, { "" }}, {S, { "" }} },
+/* 1*/ { KBD_ASCII, I, {S, { "`" }}, {S, { "~" }}, {S, { "`" }} },
+/* 2*/ { KBD_ASCII, I, {S, { "1" }}, {S, { "!" }}, {S, { "1" }} },
+/* 3*/ { KBD_ASCII, I, {S, { "2" }}, {S, { "@" }}, {S, { "\000" }} },
+/* 4*/ { KBD_ASCII, I, {S, { "3" }}, {S, { "#" }}, {S, { "3" }} },
+/* 5*/ { KBD_ASCII, I, {S, { "4" }}, {S, { "$" }}, {S, { "4" }} },
+/* 6*/ { KBD_ASCII, I, {S, { "5" }}, {S, { "%" }}, {S, { "5" }} },
+/* 7*/ { KBD_ASCII, I, {S, { "6" }}, {S, { "^" }}, {S, { "\036" }} },
+/* 8*/ { KBD_ASCII, I, {S, { "7" }}, {S, { "&" }}, {S, { "7" }} },
+/* 9*/ { KBD_ASCII, I, {S, { "8" }}, {S, { "*" }}, {S, { "9" }} },
+/* 10*/ { KBD_ASCII, I, {S, { "9" }}, {S, { "(" }}, {S, { "9" }} },
+/* 11*/ { KBD_ASCII, I, {S, { "0" }}, {S, { ")" }}, {S, { "0" }} },
+/* 12*/ { KBD_ASCII, I, {S, { "-" }}, {S, { "_" }}, {S, { "\037" }} },
+/* 13*/ { KBD_ASCII, I, {S, { "=" }}, {S, { "+" }}, {S, { "=" }} },
+/* 14*/ { KBD_NONE, I, {S, { "" }}, {S, { "" }}, {S, { "" }} },
+/* 15*/ { KBD_ASCII, I, {S, { "\177" }}, {S, { "\010" }}, {S, { "\177" }} }, /* BS */
+/* 16*/ { KBD_ASCII, I, {S, { "\t" }}, {S, { "\t" }}, {S, { "\t" }} }, /* TAB */
+/* 17*/ { KBD_ASCII, I, {S, { "q" }}, {S, { "Q" }}, {S, { "\021" }} },
+/* 18*/ { KBD_ASCII, I, {S, { "w" }}, {S, { "W" }}, {S, { "\027" }} },
+/* 19*/ { KBD_ASCII, I, {S, { "e" }}, {S, { "E" }}, {S, { "\005" }} },
+/* 20*/ { KBD_ASCII, I, {S, { "r" }}, {S, { "R" }}, {S, { "\022" }} },
+/* 21*/ { KBD_ASCII, I, {S, { "t" }}, {S, { "T" }}, {S, { "\024" }} },
+/* 22*/ { KBD_ASCII, I, {S, { "y" }}, {S, { "Y" }}, {S, { "\031" }} },
+/* 23*/ { KBD_ASCII, I, {S, { "u" }}, {S, { "U" }}, {S, { "\025" }} },
+/* 24*/ { KBD_ASCII, I, {S, { "i" }}, {S, { "I" }}, {S, { "\011" }} },
+/* 25*/ { KBD_ASCII, I, {S, { "o" }}, {S, { "O" }}, {S, { "\017" }} },
+/* 26*/ { KBD_ASCII, I, {S, { "p" }}, {S, { "P" }}, {S, { "\020" }} },
+/* 27*/ { KBD_ASCII, I, {S, { "[" }}, {S, { "{" }}, {S, { "\033" }} },
+/* 28*/ { KBD_ASCII, I, {S, { "]" }}, {S, { "}" }}, {S, { "\035" }} },
+/* 29*/ { KBD_ASCII, I, {S, { "\\" }}, {S, { "|" }}, {S, { "\034" }} },
+/* 30*/ { KBD_CAPS, I, {S, { "" }}, {S, { "" }}, {S, { "" }} },
+/* 31*/ { KBD_ASCII, I, {S, { "a" }}, {S, { "A" }}, {S, { "\001" }} },
+/* 32*/ { KBD_ASCII, I, {S, { "s" }}, {S, { "S" }}, {S, { "\023" }} },
+/* 33*/ { KBD_ASCII, I, {S, { "d" }}, {S, { "D" }}, {S, { "\004" }} },
+/* 34*/ { KBD_ASCII, I, {S, { "f" }}, {S, { "F" }}, {S, { "\006" }} },
+/* 35*/ { KBD_ASCII, I, {S, { "g" }}, {S, { "G" }}, {S, { "\007" }} },
+/* 36*/ { KBD_ASCII, I, {S, { "h" }}, {S, { "H" }}, {S, { "\010" }} },
+/* 37*/ { KBD_ASCII, I, {S, { "j" }}, {S, { "J" }}, {S, { "\n" }} },
+/* 38*/ { KBD_ASCII, I, {S, { "k" }}, {S, { "K" }}, {S, { "\013" }} },
+/* 39*/ { KBD_ASCII, I, {S, { "l" }}, {S, { "L" }}, {S, { "\014" }} },
+/* 40*/ { KBD_ASCII, I, {S, { ";" }}, {S, { ":" }}, {S, { ";" }} },
+/* 41*/ { KBD_ASCII, I, {S, { "'" }}, {S, { "\"" }}, {S, { "'" }} },
+/* 42*/ { KBD_ASCII, I, {S, { "\\" }}, {S, { "|" }}, {S, { "\034" }} }, /* special */
+/* 43*/ { KBD_RETURN,I, {S, { "\r" }}, {S, { "\r" }}, {S, { "\r" }} }, /* RETURN */
+/* 44*/ { KBD_SHIFT, I, {S, { "" }}, {S, { "" }}, {S, { "" }} }, /* SHIFT left */
+/* 45*/ { KBD_ASCII, I, {S, { "<" }}, {S, { ">" }}, {S, { "" }} },
+/* 46*/ { KBD_ASCII, I, {S, { "z" }}, {S, { "Z" }}, {S, { "\032" }} },
+/* 47*/ { KBD_ASCII, I, {S, { "x" }}, {S, { "X" }}, {S, { "\030" }} },
+/* 48*/ { KBD_ASCII, I, {S, { "c" }}, {S, { "C" }}, {S, { "\003" }} },
+/* 49*/ { KBD_ASCII, I, {S, { "v" }}, {S, { "V" }}, {S, { "\026" }} },
+/* 50*/ { KBD_ASCII, I, {S, { "b" }}, {S, { "B" }}, {S, { "\002" }} },
+/* 51*/ { KBD_ASCII, I, {S, { "n" }}, {S, { "N" }}, {S, { "\016" }} },
+/* 52*/ { KBD_ASCII, I, {S, { "m" }}, {S, { "M" }}, {S, { "\r" }} },
+/* 53*/ { KBD_ASCII, I, {S, { "," }}, {S, { "<" }}, {S, { "," }} },
+/* 54*/ { KBD_ASCII, I, {S, { "." }}, {S, { ">" }}, {S, { "." }} },
+/* 55*/ { KBD_ASCII, I, {S, { "/" }}, {S, { "?" }}, {S, { "/" }} },
+/* 56*/ { KBD_NONE, I, {S, { "" }}, {S, { "" }}, {S, { "" }} },
+/* 57*/ { KBD_SHIFT, I, {S, { "" }}, {S, { "" }}, {S, { "" }} }, /* SHIFT right */
+/* 58*/ { KBD_CTL, I, {S, { "" }}, {S, { "" }}, {S, { "" }} }, /* CTL left */
+/* 59*/ { KBD_ASCII, I, {S, { "" }}, {S, { "" }}, {S, { "" }} },
+/* 60*/ { KBD_META, I, {S, { "" }}, {S, { "" }}, {S, { "" }} }, /* ALT left */
#if !PCVT_NULLCHARS
-/* 61*/ KBD_ASCII, I, {S,C " "}, {S,C " "}, {S,C " "}, /* SPACE */
+/* 61*/ { KBD_ASCII, I, {S, { " " }}, {S, { " " }}, {S, { " " }} }, /* SPACE */
#else
-/* 61*/ KBD_ASCII, I, {S,C " "}, {S,C " "}, {S,C "\000"}, /* SPACE */
+/* 61*/ { KBD_ASCII, I, {S, { " " }}, {S, { " " }}, {S, { "\000" }} }, /* SPACE */
#endif /* PCVT_NULLCHARS */
-/* 62*/ KBD_META, I, {S,C ""}, {S,C ""}, {S,C ""}, /* ALT right */
-/* 63*/ KBD_ASCII, I, {S,C ""}, {S,C ""}, {S,C ""},
-/* 64*/ KBD_CTL, I, {S,C ""}, {S,C ""}, {S,C ""}, /* CTL right */
-/* 65*/ KBD_NONE, I, {S,C ""}, {S,C ""}, {S,C ""},
-/* 66*/ KBD_NONE, I, {S,C ""}, {S,C ""}, {S,C ""},
-/* 67*/ KBD_NONE, I, {S,C ""}, {S,C ""}, {S,C ""},
-/* 68*/ KBD_NONE, I, {S,C ""}, {S,C ""}, {S,C ""},
-/* 69*/ KBD_NONE, I, {S,C ""}, {S,C ""}, {S,C ""},
-/* 70*/ KBD_NONE, I, {S,C ""}, {S,C ""}, {S,C ""},
-/* 71*/ KBD_NONE, I, {S,C ""}, {S,C ""}, {S,C ""},
-/* 72*/ KBD_NONE, I, {S,C ""}, {S,C ""}, {S,C ""},
-/* 73*/ KBD_NONE, I, {S,C ""}, {S,C ""}, {S,C ""},
-/* 74*/ KBD_NONE, I, {S,C ""}, {S,C ""}, {S,C ""},
-/* 75*/ KBD_FUNC, I, {S,C "\033[2~"},{S,C "\033[2~"},{S,C "\033[2~"},/* INS */
-/* 76*/ KBD_FUNC, I, {S,C "\033[3~"},{S,C "\033[3~"},{S,C "\033[3~"},/* DEL */
-/* 77*/ KBD_NONE, I, {S,C ""}, {S,C ""}, {S,C ""},
-/* 78*/ KBD_NONE, I, {S,C ""}, {S,C ""}, {S,C ""},
-/* 79*/ KBD_CURSOR,I, {S,C "\033[D"},{S,C "\033OD"},{S,C "\033[D"}, /* CU <- */
-/* 80*/ KBD_FUNC, I, {S,C "\033[1~"},{S,C "\033[1~"},{S,C "\033[1~"},/* HOME = FIND*/
-/* 81*/ KBD_FUNC, I, {S,C "\033[4~"},{S,C "\033[4~"},{S,C "\033[4~"},/* END = SELECT */
-/* 82*/ KBD_NONE, I, {S,C ""}, {S,C ""}, {S,C ""},
-/* 83*/ KBD_CURSOR,I, {S,C "\033[A"},{S,C "\033OA"},{S,C "\033[A"}, /* CU ^ */
-/* 84*/ KBD_CURSOR,I, {S,C "\033[B"},{S,C "\033OB"},{S,C "\033[B"}, /* CU v */
-/* 85*/ KBD_FUNC, I, {S,C "\033[5~"},{S,C "\033[5~"},{S,C "\033[5~"},/*PG UP*/
-/* 86*/ KBD_FUNC, I, {S,C "\033[6~"},{S,C "\033[6~"},{S,C "\033[6~"},/*PG DN*/
-/* 87*/ KBD_NONE, I, {S,C ""}, {S,C ""}, {S,C ""},
-/* 88*/ KBD_NONE, I, {S,C ""}, {S,C ""}, {S,C ""},
-/* 89*/ KBD_CURSOR,I, {S,C "\033[C"},{S,C "\033OC"},{S,C "\033[C"}, /* CU -> */
-/* 90*/ KBD_NUM, I, {S,C ""}, {S,C ""}, {S,C ""},
-/* 91*/ KBD_KP, I, {S,C "7"}, {S,C "\033Ow"},{S,C "7"},
-/* 92*/ KBD_KP, I, {S,C "4"}, {S,C "\033Ot"},{S,C "4"},
-/* 93*/ KBD_KP, I, {S,C "1"}, {S,C "\033Oq"},{S,C "1"},
-/* 94*/ KBD_NONE, I, {S,C ""}, {S,C ""}, {S,C ""},
-/* 95*/ KBD_KP, I, {S,C "/"}, {S,C "/"}, {S,C "/"},
-/* 96*/ KBD_KP, I, {S,C "8"}, {S,C "\033Ox"},{S,C "8"},
-/* 97*/ KBD_KP, I, {S,C "5"}, {S,C "\033Ou"},{S,C "5"},
-/* 98*/ KBD_KP, I, {S,C "2"}, {S,C "\033Or"},{S,C "2"},
-/* 99*/ KBD_KP, I, {S,C "0"}, {S,C "\033Op"},{S,C "0"},
-/*100*/ KBD_KP, I, {S,C "*"}, {S,C "*"}, {S,C "*"},
-/*101*/ KBD_KP, I, {S,C "9"}, {S,C "\033Oy"},{S,C "9"},
-/*102*/ KBD_KP, I, {S,C "6"}, {S,C "\033Ov"},{S,C "6"},
-/*103*/ KBD_KP, I, {S,C "3"}, {S,C "\033Os"},{S,C "3"},
-/*104*/ KBD_KP, I, {S,C "."}, {S,C "\033On"},{S,C "."},
-/*105*/ KBD_KP, I, {S,C "-"}, {S,C "\033Om"},{S,C "-"},
-/*106*/ KBD_KP, I, {S,C "+"}, {S,C "+"}, {S,C "+"},
-/*107*/ KBD_NONE, I, {S,C ""}, {S,C ""}, {S,C ""},
-/*108*/ KBD_RETURN,I, {S,C "\r"}, {S,C "\033OM"},{S,C "\r"}, /* KP ENTER */
-/*109*/ KBD_NONE, I, {S,C ""}, {S,C ""}, {S,C ""},
-/*110*/ KBD_ASCII, I, {S,C "\033"}, {S,C "\033"}, {S,C "\033"},
-/*111*/ KBD_NONE, I, {S,C ""}, {S,C ""}, {S,C ""},
-/*112*/ KBD_FUNC, I, {F,V fkey1}, {F,V sfkey1}, {F,V cfkey1}, /* F1 */
-/*113*/ KBD_FUNC, I, {F,V fkey2}, {F,V sfkey2}, {F,V cfkey2}, /* F2 */
-/*114*/ KBD_FUNC, I, {F,V fkey3}, {F,V sfkey3}, {F,V cfkey3}, /* F3 */
-/*115*/ KBD_FUNC, I, {F,V fkey4}, {F,V sfkey4}, {F,V cfkey4}, /* F4 */
-/*116*/ KBD_FUNC, I, {F,V fkey5}, {F,V sfkey5}, {F,V cfkey5}, /* F5 */
-/*117*/ KBD_FUNC, I, {F,V fkey6}, {F,V sfkey6}, {F,V cfkey6}, /* F6 */
-/*118*/ KBD_FUNC, I, {F,V fkey7}, {F,V sfkey7}, {F,V cfkey7}, /* F7 */
-/*119*/ KBD_FUNC, I, {F,V fkey8}, {F,V sfkey8}, {F,V cfkey8}, /* F8 */
-/*120*/ KBD_FUNC, I, {F,V fkey9}, {F,V sfkey9}, {F,V cfkey9}, /* F9 */
-/*121*/ KBD_FUNC, I, {F,V fkey10}, {F,V sfkey10}, {F,V cfkey10}, /* F10 */
-/*122*/ KBD_FUNC, I, {F,V fkey11}, {F,V sfkey11}, {F,V cfkey11}, /* F11 */
-/*123*/ KBD_FUNC, I, {F,V fkey12}, {F,V sfkey12}, {F,V cfkey12}, /* F12 */
-/*124*/ KBD_KP, I, {S,C ""}, {S,C ""}, {S,C ""},
-/*125*/ KBD_SCROLL,I, {S,C ""}, {S,C ""}, {S,C ""},
-/*126*/ KBD_BREAK, I, {S,C ""}, {S,C ""}, {S,C ""},
-/*127*/ KBD_FUNC, I, {S,C ""}, {S,C ""}, {S,C ""}, /* SysRq */
+/* 62*/ { KBD_META, I, {S, { "" }}, {S, { "" }}, {S, { "" }} }, /* ALT right */
+/* 63*/ { KBD_ASCII, I, {S, { "" }}, {S, { "" }}, {S, { "" }} },
+/* 64*/ { KBD_CTL, I, {S, { "" }}, {S, { "" }}, {S, { "" }} }, /* CTL right */
+/* 65*/ { KBD_NONE, I, {S, { "" }}, {S, { "" }}, {S, { "" }} },
+/* 66*/ { KBD_NONE, I, {S, { "" }}, {S, { "" }}, {S, { "" }} },
+/* 67*/ { KBD_NONE, I, {S, { "" }}, {S, { "" }}, {S, { "" }} },
+/* 68*/ { KBD_NONE, I, {S, { "" }}, {S, { "" }}, {S, { "" }} },
+/* 69*/ { KBD_NONE, I, {S, { "" }}, {S, { "" }}, {S, { "" }} },
+/* 70*/ { KBD_NONE, I, {S, { "" }}, {S, { "" }}, {S, { "" }} },
+/* 71*/ { KBD_NONE, I, {S, { "" }}, {S, { "" }}, {S, { "" }} },
+/* 72*/ { KBD_NONE, I, {S, { "" }}, {S, { "" }}, {S, { "" }} },
+/* 73*/ { KBD_NONE, I, {S, { "" }}, {S, { "" }}, {S, { "" }} },
+/* 74*/ { KBD_NONE, I, {S, { "" }}, {S, { "" }}, {S, { "" }} },
+/* 75*/ { KBD_FUNC, I, {S, { "\033[2~" }},{S, { "\033[2~" }},{S, { "\033[2~" }} },/* INS */
+/* 76*/ { KBD_FUNC, I, {S, { "\033[3~" }},{S, { "\033[3~" }},{S, { "\033[3~" }} },/* DEL */
+/* 77*/ { KBD_NONE, I, {S, { "" }}, {S, { "" }}, {S, { "" }} },
+/* 78*/ { KBD_NONE, I, {S, { "" }}, {S, { "" }}, {S, { "" }} },
+/* 79*/ { KBD_CURSOR,I, {S, { "\033[D" }},{S, { "\033OD" }},{S, { "\033[D" }} }, /* CU <- */
+/* 80*/ { KBD_FUNC, I, {S, { "\033[1~" }},{S, { "\033[1~" }},{S, { "\033[1~" }} },/* HOME = FIND*/
+/* 81*/ { KBD_FUNC, I, {S, { "\033[4~" }},{S, { "\033[4~" }},{S, { "\033[4~" }} },/* END = SELECT */
+/* 82*/ { KBD_NONE, I, {S, { "" }}, {S, { "" }}, {S, { "" }} },
+/* 83*/ { KBD_CURSOR,I, {S, { "\033[A" }},{S, { "\033OA" }},{S, { "\033[A" }} }, /* CU ^ */
+/* 84*/ { KBD_CURSOR,I, {S, { "\033[B" }},{S, { "\033OB" }},{S, { "\033[B" }} }, /* CU v */
+/* 85*/ { KBD_FUNC, I, {S, { "\033[5~" }},{S, { "\033[5~" }},{S, { "\033[5~" }} },/*PG UP*/
+/* 86*/ { KBD_FUNC, I, {S, { "\033[6~" }},{S, { "\033[6~" }},{S, { "\033[6~" }} },/*PG DN*/
+/* 87*/ { KBD_NONE, I, {S, { "" }}, {S, { "" }}, {S, { "" }} },
+/* 88*/ { KBD_NONE, I, {S, { "" }}, {S, { "" }}, {S, { "" }} },
+/* 89*/ { KBD_CURSOR,I, {S, { "\033[C" }},{S, { "\033OC" }},{S, { "\033[C" }} }, /* CU -> */
+/* 90*/ { KBD_NUM, I, {S, { "" }}, {S, { "" }}, {S, { "" }} },
+/* 91*/ { KBD_KP, I, {S, { "7" }}, {S, { "\033Ow" }},{S, { "7" }} },
+/* 92*/ { KBD_KP, I, {S, { "4" }}, {S, { "\033Ot" }},{S, { "4" }} },
+/* 93*/ { KBD_KP, I, {S, { "1" }}, {S, { "\033Oq" }},{S, { "1" }} },
+/* 94*/ { KBD_NONE, I, {S, { "" }}, {S, { "" }}, {S, { "" }} },
+/* 95*/ { KBD_KP, I, {S, { "/" }}, {S, { "/" }}, {S, { "/" }} },
+/* 96*/ { KBD_KP, I, {S, { "8" }}, {S, { "\033Ox" }},{S, { "8" }} },
+/* 97*/ { KBD_KP, I, {S, { "5" }}, {S, { "\033Ou" }},{S, { "5" }} },
+/* 98*/ { KBD_KP, I, {S, { "2" }}, {S, { "\033Or" }},{S, { "2" }} },
+/* 99*/ { KBD_KP, I, {S, { "0" }}, {S, { "\033Op" }},{S, { "0" }} },
+/*100*/ { KBD_KP, I, {S, { "*" }}, {S, { "*" }}, {S, { "*" }} },
+/*101*/ { KBD_KP, I, {S, { "9" }}, {S, { "\033Oy" }},{S, { "9" }} },
+/*102*/ { KBD_KP, I, {S, { "6" }}, {S, { "\033Ov" }},{S, { "6" }} },
+/*103*/ { KBD_KP, I, {S, { "3" }}, {S, { "\033Os" }},{S, { "3" }} },
+/*104*/ { KBD_KP, I, {S, { "." }}, {S, { "\033On" }},{S, { "." }} },
+/*105*/ { KBD_KP, I, {S, { "-" }}, {S, { "\033Om" }},{S, { "-" }} },
+/*106*/ { KBD_KP, I, {S, { "+" }}, {S, { "+" }}, {S, { "+" }} },
+/*107*/ { KBD_NONE, I, {S, { "" }}, {S, { "" }}, {S, { "" }} },
+/*108*/ { KBD_RETURN,I, {S, { "\r" }}, {S, { "\033OM" }},{S, { "\r" }} }, /* KP ENTER */
+/*109*/ { KBD_NONE, I, {S, { "" }}, {S, { "" }}, {S, { "" }} },
+/*110*/ { KBD_ASCII, I, {S, { "\033" }}, {S, { "\033" }}, {S, { "\033" }} },
+/*111*/ { KBD_NONE, I, {S, { "" }}, {S, { "" }}, {S, { "" }} },
+/*112*/ { KBD_FUNC, I, {F, { C fkey1 }}, {F, { C sfkey1 }}, {F, { C cfkey1 }} }, /* F1 */
+/*113*/ { KBD_FUNC, I, {F, { C fkey2 }}, {F, { C sfkey2 }}, {F, { C cfkey2 }} }, /* F2 */
+/*114*/ { KBD_FUNC, I, {F, { C fkey3 }}, {F, { C sfkey3 }}, {F, { C cfkey3 }} }, /* F3 */
+/*115*/ { KBD_FUNC, I, {F, { C fkey4 }}, {F, { C sfkey4 }}, {F, { C cfkey4 }} }, /* F4 */
+/*116*/ { KBD_FUNC, I, {F, { C fkey5 }}, {F, { C sfkey5 }}, {F, { C cfkey5 }} }, /* F5 */
+/*117*/ { KBD_FUNC, I, {F, { C fkey6 }}, {F, { C sfkey6 }}, {F, { C cfkey6 }} }, /* F6 */
+/*118*/ { KBD_FUNC, I, {F, { C fkey7 }}, {F, { C sfkey7 }}, {F, { C cfkey7 }} }, /* F7 */
+/*119*/ { KBD_FUNC, I, {F, { C fkey8 }}, {F, { C sfkey8 }}, {F, { C cfkey8 }} }, /* F8 */
+/*120*/ { KBD_FUNC, I, {F, { C fkey9 }}, {F, { C sfkey9 }}, {F, { C cfkey9 }} }, /* F9 */
+/*121*/ { KBD_FUNC, I, {F, { C fkey10 }}, {F, { C sfkey10 }}, {F, { C cfkey10 }} }, /* F10 */
+/*122*/ { KBD_FUNC, I, {F, { C fkey11 }}, {F, { C sfkey11 }}, {F, { C cfkey11 }} }, /* F11 */
+/*123*/ { KBD_FUNC, I, {F, { C fkey12 }}, {F, { C sfkey12 }}, {F, { C cfkey12 }} }, /* F12 */
+/*124*/ { KBD_KP, I, {S, { "" }}, {S, { "" }}, {S, { "" }} },
+/*125*/ { KBD_SCROLL,I, {S, { "" }}, {S, { "" }}, {S, { "" }} },
+/*126*/ { KBD_BREAK, I, {S, { "" }}, {S, { "" }}, {S, { "" }} },
+/*127*/ { KBD_FUNC, I, {S, { "" }}, {S, { "" }}, {S, { "" }} }, /* SysRq */
#undef C
#undef V
diff --git a/sys/arch/i386/isa/pcvt/pcvt_out.c b/sys/arch/i386/isa/pcvt/pcvt_out.c
index 167dd8f0c80..cdee5507df2 100644
--- a/sys/arch/i386/isa/pcvt/pcvt_out.c
+++ b/sys/arch/i386/isa/pcvt/pcvt_out.c
@@ -76,6 +76,7 @@ static void check_scroll ( struct video_state *svsp );
static void hp_entry ( U_char ch, struct video_state *svsp );
static void wrfkl ( int num, u_char *string, struct video_state *svsp );
static void writefkl ( int num, u_char *string, struct video_state *svsp );
+static __inline void write_char (struct video_state *, u_short, u_short ch);
/*---------------------------------------------------------------------------*
@@ -171,7 +172,7 @@ sput (u_char *s, U_char kernel, int len, int page)
attrib = kernel ? kern_attr : svsp->c_attr;
while (len-- > 0)
- if (ch = (*(s++)))
+ if ((ch = (*(s++))) != 0)
{
if(svsp->sevenbit)
ch &= 0x7f;