aboutsummaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorPeter Wemm <peter@FreeBSD.org>2004-09-24 01:08:34 +0000
committerPeter Wemm <peter@FreeBSD.org>2004-09-24 01:08:34 +0000
commit2169193596db9cc30586af31a507cc6e09cd440e (patch)
tree0d32e80a39f47cf18ed420b2e7f40883dd23012c /sys
parentc3277f936c2472a67b1fa6210b8f09ddcc674744 (diff)
downloadsrc-2169193596db9cc30586af31a507cc6e09cd440e.tar.gz
src-2169193596db9cc30586af31a507cc6e09cd440e.zip
Converge towards i386. I originally resisted creating <machine/pc/bios.h>
because it was mostly irrelevant - except for the silly BIOS_PADDRTOVADDR etc macros. Along the way of working around this, I missed a few things. * Make syscons properly inherit the bios capslock/shiftlock/etc state like i386 does. Note that we cannot inherit the bios key repeat rate because that requires a bios call (which is impossible for us). * Give syscons the ability to beep on amd64. Oops. While here, make bios.c compile and add it to files.amd64.
Notes
Notes: svn path=/head/; revision=135690
Diffstat (limited to 'sys')
-rw-r--r--sys/amd64/amd64/bios.c5
-rw-r--r--sys/conf/files.amd641
-rw-r--r--sys/dev/fb/vga.c6
-rw-r--r--sys/isa/syscons_isa.c15
4 files changed, 13 insertions, 14 deletions
diff --git a/sys/amd64/amd64/bios.c b/sys/amd64/amd64/bios.c
index b34da4d83d05..d08f5ccd160c 100644
--- a/sys/amd64/amd64/bios.c
+++ b/sys/amd64/amd64/bios.c
@@ -37,6 +37,9 @@ __FBSDID("$FreeBSD$");
#include <sys/param.h>
#include <sys/systm.h>
#include <sys/kernel.h>
+#include <vm/vm.h>
+#include <vm/pmap.h>
+#include <machine/vmparam.h>
#include <machine/pc/bios.h>
#define BIOS_START 0xe0000
@@ -84,7 +87,7 @@ bios_sigsearch(u_int32_t start, u_char *sig, int siglen, int paralen, int sigofs
/* compare here */
if (!bcmp(sp + sigofs, sig, siglen)) {
/* convert back to physical address */
- return((u_int32_t)BIOS_VADDRTOPADDR(sp));
+ return((u_int32_t)(uintptr_t)BIOS_VADDRTOPADDR(sp));
}
sp += paralen;
}
diff --git a/sys/conf/files.amd64 b/sys/conf/files.amd64
index 4413e82f9f6b..800c9b863547 100644
--- a/sys/conf/files.amd64
+++ b/sys/conf/files.amd64
@@ -56,6 +56,7 @@ amd64/amd64/amd64_mem.c standard
#amd64/amd64/apic_vector.S standard
amd64/amd64/atomic.c standard
amd64/amd64/autoconf.c standard
+amd64/amd64/bios.c standard
amd64/amd64/busdma_machdep.c standard
amd64/amd64/cpu_switch.S standard
amd64/amd64/critical.c standard
diff --git a/sys/dev/fb/vga.c b/sys/dev/fb/vga.c
index 3af5fda458dc..53b67b87bd72 100644
--- a/sys/dev/fb/vga.c
+++ b/sys/dev/fb/vga.c
@@ -48,7 +48,7 @@ __FBSDID("$FreeBSD$");
#include <vm/pmap.h>
#include <machine/md_var.h>
-#ifdef __i386__
+#if defined(__i386__) || defined(__amd64__)
#include <machine/pc/bios.h>
#endif
#include <machine/bus.h>
@@ -64,11 +64,7 @@ __FBSDID("$FreeBSD$");
/* XXX machine/pc/bios.h has got too much i386-specific stuff in it */
#ifndef BIOS_PADDRTOVADDR
-#if !defined(__amd64__)
#define BIOS_PADDRTOVADDR(x) (x)
-#else
-#define BIOS_PADDRTOVADDR(x) ((x) + KERNBASE)
-#endif
#endif
int
diff --git a/sys/isa/syscons_isa.c b/sys/isa/syscons_isa.c
index a0f00c37e634..d271d0903e9b 100644
--- a/sys/isa/syscons_isa.c
+++ b/sys/isa/syscons_isa.c
@@ -39,7 +39,7 @@ __FBSDID("$FreeBSD$");
#include <sys/consio.h>
#include <sys/sysctl.h>
-#ifdef __i386__
+#if defined(__i386__) || defined(__amd64__)
#include <machine/clock.h>
#include <machine/md_var.h>
@@ -56,7 +56,7 @@ __FBSDID("$FreeBSD$");
#define BIOS_SLKED (1 << 4)
#define BIOS_ALKED 0
-#endif /* __i386__ */
+#endif
#include <dev/syscons/syscons.h>
@@ -234,7 +234,7 @@ sc_get_cons_priority(int *unit, int *flags)
void
sc_get_bios_values(bios_values_t *values)
{
-#ifdef __i386__
+#if defined(__i386__) || defined(__amd64__)
u_int8_t shift;
values->cursor_start = *(u_int8_t *)BIOS_PADDRTOVADDR(0x461);
@@ -244,19 +244,18 @@ sc_get_bios_values(bios_values_t *values)
| ((shift & BIOS_NLKED) ? NLKED : 0)
| ((shift & BIOS_SLKED) ? SLKED : 0)
| ((shift & BIOS_ALKED) ? ALKED : 0);
- values->bell_pitch = BELL_PITCH;
-#else /* !__i386__ */
+#else
values->cursor_start = 0;
values->cursor_end = 32;
values->shift_state = 0;
+#endif
values->bell_pitch = BELL_PITCH;
-#endif /* __i386__ */
}
int
sc_tone(int herz)
{
-#ifdef __i386__
+#if defined(__i386__) || defined(__amd64__)
int pitch;
if (herz) {
@@ -274,7 +273,7 @@ sc_tone(int herz)
outb(IO_PPI, inb(IO_PPI) & 0xFC);
release_timer2();
}
-#endif /* __i386__ */
+#endif
return 0;
}