summaryrefslogtreecommitdiff
path: root/sys/arch/amd64/stand/libsa
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>2007-04-28 19:23:11 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>2007-04-28 19:23:11 +0000
commit8408ac10a18e8acbd4c400a7af41ce7bc814e573 (patch)
tree2b66f5a43dc13ee0a38baf2a648ea7747d693b11 /sys/arch/amd64/stand/libsa
parent4d00462555fb47e13c9cf5d48e0132c98eeee5cc (diff)
clone "Control key" logic from i386 written by tom; tested by art
Diffstat (limited to 'sys/arch/amd64/stand/libsa')
-rw-r--r--sys/arch/amd64/stand/libsa/bioscons.c13
-rw-r--r--sys/arch/amd64/stand/libsa/biosdev.h3
-rw-r--r--sys/arch/amd64/stand/libsa/libsa.h4
-rw-r--r--sys/arch/amd64/stand/libsa/machdep.c9
4 files changed, 25 insertions, 4 deletions
diff --git a/sys/arch/amd64/stand/libsa/bioscons.c b/sys/arch/amd64/stand/libsa/bioscons.c
index 4998ba101e9..6f9e25329b9 100644
--- a/sys/arch/amd64/stand/libsa/bioscons.c
+++ b/sys/arch/amd64/stand/libsa/bioscons.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: bioscons.c,v 1.2 2007/01/02 16:34:16 tom Exp $ */
+/* $OpenBSD: bioscons.c,v 1.3 2007/04/28 19:23:10 deraadt Exp $ */
/*
* Copyright (c) 1997-1999 Michael Shalayeff
@@ -93,6 +93,17 @@ pc_getc(dev_t dev)
return (rv & 0xff);
}
+int
+pc_getshifts(dev_t dev)
+{
+ register int rv;
+
+ __asm __volatile(DOINT(0x16) : "=a" (rv) : "0" (0x200) :
+ "%ecx", "%edx", "cc" );
+
+ return (rv & 0xff);
+}
+
void
pc_putc(dev_t dev, int c)
{
diff --git a/sys/arch/amd64/stand/libsa/biosdev.h b/sys/arch/amd64/stand/libsa/biosdev.h
index 3c00bc6d9a1..4f2287d7948 100644
--- a/sys/arch/amd64/stand/libsa/biosdev.h
+++ b/sys/arch/amd64/stand/libsa/biosdev.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: biosdev.h,v 1.1 2004/02/03 12:09:47 mickey Exp $ */
+/* $OpenBSD: biosdev.h,v 1.2 2007/04/28 19:23:10 deraadt Exp $ */
/*
* Copyright (c) 1996 Michael Shalayeff
@@ -60,6 +60,7 @@ bios_diskinfo_t *bios_dklookup(int);
void pc_probe(struct consdev *);
void pc_init(struct consdev *);
int pc_getc(dev_t);
+int pc_getshifts(dev_t);
void pc_putc(dev_t, int);
void pc_pollc(dev_t, int);
void com_probe(struct consdev *);
diff --git a/sys/arch/amd64/stand/libsa/libsa.h b/sys/arch/amd64/stand/libsa/libsa.h
index 6d2aa967207..5ac8d7b5be8 100644
--- a/sys/arch/amd64/stand/libsa/libsa.h
+++ b/sys/arch/amd64/stand/libsa/libsa.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: libsa.h,v 1.4 2006/09/18 21:15:33 mpf Exp $ */
+/* $OpenBSD: libsa.h,v 1.5 2007/04/28 19:23:10 deraadt Exp $ */
/*
* Copyright (c) 1996-1999 Michael Shalayeff
@@ -74,3 +74,5 @@ extern bios_diskinfo_t bios_diskinfo[];
extern u_int32_t bios_cksumlen;
#define MACHINE_CMD cmd_machine /* we have i386 specific sommands */
+
+#define CHECK_SKIP_CONF check_skip_conf /* we can skip boot.conf with Ctrl */
diff --git a/sys/arch/amd64/stand/libsa/machdep.c b/sys/arch/amd64/stand/libsa/machdep.c
index 97ec8d544e5..6733ec0c633 100644
--- a/sys/arch/amd64/stand/libsa/machdep.c
+++ b/sys/arch/amd64/stand/libsa/machdep.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: machdep.c,v 1.3 2004/03/21 21:37:41 tom Exp $ */
+/* $OpenBSD: machdep.c,v 1.4 2007/04/28 19:23:10 deraadt Exp $ */
/*
* Copyright (c) 2004 Tom Cosgrove
@@ -28,6 +28,7 @@
*/
#include "libsa.h"
+#include "biosdev.h"
#include <machine/apmvar.h>
#include <machine/biosvar.h>
@@ -61,3 +62,9 @@ machdep(void)
}
}
}
+
+int check_skip_conf(void)
+{
+ /* Return non-zero (skip boot.conf) if Control "shift" key down */
+ return (pc_getshifts(0) & 0x04);
+}