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 | |
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')
-rw-r--r-- | sys/dev/fb/fbreg.h | 9 | ||||
-rw-r--r-- | sys/dev/fb/vga.c | 20 |
2 files changed, 22 insertions, 7 deletions
diff --git a/sys/dev/fb/fbreg.h b/sys/dev/fb/fbreg.h index f17e362..082b93d 100644 --- a/sys/dev/fb/fbreg.h +++ b/sys/dev/fb/fbreg.h @@ -43,6 +43,13 @@ #define fillw_io(p, d, c) fillw((p), (void *)(d), (c)) void generic_bcopy(const void *s, void *d, size_t c); void generic_bzero(void *d, size_t c); +#elif __amd64__ +#define bcopy_io(s, d, c) bcopy((void *)(s), (void *)(d), (c)) +#define bcopy_toio(s, d, c) bcopy((void *)(s), (void *)(d), (c)) +#define bcopy_fromio(s, d, c) bcopy((void *)(s), (void *)(d), (c)) +#define bzero_io(d, c) bzero((void *)(d), (c)) +#define fill_io(p, d, c) fill((p), (void *)(d), (c)) +#define fillw_io(p, d, c) fillw((p), (void *)(d), (c)) #elif __ia64__ #include <machine/bus.h> #define bcopy_fromio(s, d, c) \ @@ -69,7 +76,7 @@ fillw(int val, uint16_t *buf, size_t size) while (size--) *buf++ = val; } -#else /* !__i386__ && !__ia64__ */ +#else /* !__i386__ && !__ia64__ && !__amd64__ */ #define bcopy_io(s, d, c) memcpy_io((d), (s), (c)) #define bcopy_toio(s, d, c) memcpy_toio((d), (void *)(s), (c)) #define bcopy_fromio(s, d, c) memcpy_fromio((void *)(d), (s), (c)) 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; } } |