diff options
author | peter <peter@FreeBSD.org> | 2003-05-01 04:21:05 +0000 |
---|---|---|
committer | peter <peter@FreeBSD.org> | 2003-05-01 04:21:05 +0000 |
commit | 42a3e790d10389251800732cf690e8fb73542a6f (patch) | |
tree | b455277e1ff3827597e6f431676413f956d1b164 /sys/dev/fb/vga.c | |
parent | 5f8dcd11b4b8ea6a21c9e1d66fdb7a301b720d77 (diff) | |
download | FreeBSD-src-42a3e790d10389251800732cf690e8fb73542a6f.zip FreeBSD-src-42a3e790d10389251800732cf690e8fb73542a6f.tar.gz |
Add AMD64 support to dev/fb. It isn't optimized.
Diffstat (limited to 'sys/dev/fb/vga.c')
-rw-r--r-- | sys/dev/fb/vga.c | 20 |
1 files changed, 14 insertions, 6 deletions
diff --git a/sys/dev/fb/vga.c b/sys/dev/fb/vga.c index 410b1f5..b42016d 100644 --- a/sys/dev/fb/vga.c +++ b/sys/dev/fb/vga.c @@ -46,7 +46,9 @@ #include <vm/pmap.h> #include <machine/md_var.h> +#ifdef __i386__ #include <machine/pc/bios.h> +#endif #include <machine/bus.h> #include <dev/fb/fbreg.h> @@ -58,6 +60,10 @@ #define VGA_DEBUG 0 #endif +/* machine/pc/bios.h has got too much i386-specific stuff in it */ +#ifndef BIOS_PADDRTOVADDR +#define BIOS_PADDRTOVADDR(x) (((x) - ISA_HOLE_START) + atdevbase) +#endif int vga_probe_unit(int unit, video_adapter_t *buf, int flags) { @@ -143,7 +149,9 @@ vga_mmap(dev_t dev, vga_softc_t *sc, vm_offset_t offset, vm_offset_t *paddr, /* LOW-LEVEL */ #include <machine/clock.h> +#ifdef __i386__ #include <machine/pc/vesa.h> +#endif #define probe_done(adp) ((adp)->va_flags & V_ADP_PROBED) #define init_done(adp) ((adp)->va_flags & V_ADP_INITIALIZED) @@ -163,7 +171,7 @@ vga_mmap(dev_t dev, vga_softc_t *sc, vm_offset_t offset, vm_offset_t *paddr, #endif /* architecture dependent option */ -#if defined(__alpha__) || defined(__ia64__) +#ifndef __i386__ #define VGA_NO_BIOS 1 #endif @@ -1315,7 +1323,7 @@ set_display_start(video_adapter_t *adp, int x, int y) return 0; } -#ifdef __i386__ /* XXX */ +#if defined(__i386__) || defined(__amd64__) /* XXX */ static void fill(int val, void *d, size_t size) { @@ -1820,10 +1828,10 @@ vga_save_font(video_adapter_t *adp, int page, int fontsize, u_char *data, set_font_mode(adp, buf); if (fontsize == 32) { - bcopy_fromio(segment + ch*32, data, fontsize*count); + bcopy_fromio((uintptr_t)segment + ch*32, data, fontsize*count); } else { for (c = ch; count > 0; ++c, --count) { - bcopy_fromio(segment + c*32, data, fontsize); + bcopy_fromio((uintptr_t)segment + c*32, data, fontsize); data += fontsize; } } @@ -1900,10 +1908,10 @@ vga_load_font(video_adapter_t *adp, int page, int fontsize, u_char *data, set_font_mode(adp, buf); if (fontsize == 32) { - bcopy_toio(data, segment + ch*32, fontsize*count); + bcopy_toio(data, (uintptr_t)segment + ch*32, fontsize*count); } else { for (c = ch; count > 0; ++c, --count) { - bcopy_toio(data, segment + c*32, fontsize); + bcopy_toio(data, (uintptr_t)segment + c*32, fontsize); data += fontsize; } } |