summaryrefslogtreecommitdiffstats
path: root/sys/boot/i386/gptboot
diff options
context:
space:
mode:
authorrnordier <rnordier@FreeBSD.org>1998-10-13 22:17:05 +0000
committerrnordier <rnordier@FreeBSD.org>1998-10-13 22:17:05 +0000
commita168d3cb175f2652b0ac1ce9a09ed50482e46d8e (patch)
tree01cf24071613b6cd06e7c890141e6fead3da0d11 /sys/boot/i386/gptboot
parentc81149bfaf6bc959dc6c3ab37be79d6f2e396818 (diff)
downloadFreeBSD-src-a168d3cb175f2652b0ac1ce9a09ed50482e46d8e.zip
FreeBSD-src-a168d3cb175f2652b0ac1ce9a09ed50482e46d8e.tar.gz
Adjust NDEV value.
Optimize reading of system time.
Diffstat (limited to 'sys/boot/i386/gptboot')
-rw-r--r--sys/boot/i386/gptboot/gptboot.c19
1 files changed, 8 insertions, 11 deletions
diff --git a/sys/boot/i386/gptboot/gptboot.c b/sys/boot/i386/gptboot/gptboot.c
index a715d76..2845ada 100644
--- a/sys/boot/i386/gptboot/gptboot.c
+++ b/sys/boot/i386/gptboot/gptboot.c
@@ -14,7 +14,7 @@
*/
/*
- * $Id: boot2.c,v 1.2 1998/10/13 17:41:06 rnordier Exp $
+ * $Id: boot2.c,v 1.3 1998/10/13 21:35:42 rnordier Exp $
*/
#include <sys/param.h>
@@ -51,7 +51,7 @@
#define ARGS 0x800
#define NOPT 8
#define BSIZEMAX 8192
-#define NDEV 3
+#define NDEV 5
#define MEM_BASE 0x12
#define MEM_EXT 0x15
#define V86_CY(x) ((x) & 1)
@@ -712,22 +712,19 @@ drvread(void *buf, unsigned lba, unsigned nblk)
static int
keyhit(unsigned ticks)
{
- uint32_t x;
+ uint32_t t0, t1;
- x = 0;
+ t0 = 0;
for (;;) {
v86.addr = 0x16;
v86.eax = 0x100;
v86int();
if (!V86_ZR(v86.efl))
return 1;
- v86.addr = 0x1a;
- v86.eax = 0;
- v86.edx = 0;
- v86int();
- if (!x)
- x = v86.edx;
- else if (v86.edx < x || v86.edx > x + ticks)
+ t1 = *(uint32_t *)PTOV(0x46c);
+ if (!t0)
+ t0 = t1;
+ if (t1 < t0 || t1 >= t0 + ticks)
return 0;
}
}
OpenPOWER on IntegriCloud