1/*- 2 * Copyright (c) 1999 Kazutaka YOKOTA <yokota@zodiac.mech.utsunomiya-u.ac.jp> 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 9 unchanged lines hidden (view full) --- 18 * IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY DIRECT, INDIRECT, 19 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 20 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 21 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 22 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 23 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 24 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 25 * |
26 * $FreeBSD: head/sys/isa/vga_isa.c 115549 2003-05-31 20:29:34Z phk $ |
27 */ 28 29#include "opt_vga.h" 30#include "opt_fb.h" 31#include "opt_syscons.h" /* should be removed in the future, XXX */ 32 33#include <sys/param.h> 34#include <sys/systm.h> --- 53 unchanged lines hidden (view full) --- 88{ 89 BUS_ADD_CHILD(parent, ISA_ORDER_SPECULATIVE, VGA_DRIVER_NAME, 0); 90} 91 92static int 93isavga_probe(device_t dev) 94{ 95 video_adapter_t adp; |
96 int error; 97 98 /* No pnp support */ 99 if (isa_get_vendorid(dev)) 100 return (ENXIO); 101 102 device_set_desc(dev, "Generic ISA VGA"); 103 error = vga_probe_unit(device_get_unit(dev), &adp, device_get_flags(dev)); 104 if (error == 0) { |
105 bus_set_resource(dev, SYS_RES_IOPORT, 0, 106 adp.va_io_base, adp.va_io_size); 107 bus_set_resource(dev, SYS_RES_MEMORY, 0, 108 adp.va_mem_base, adp.va_mem_size); 109#if 0 110 isa_set_port(dev, adp.va_io_base); 111 isa_set_portsize(dev, adp.va_io_size); 112 isa_set_maddr(dev, adp.va_mem_base); 113 isa_set_msize(dev, adp.va_mem_size); 114#endif 115 } 116 return error; 117} 118 119static int 120isavga_attach(device_t dev) 121{ 122 vga_softc_t *sc; |
123 int unit; 124 int rid; 125 int error; 126 127 unit = device_get_unit(dev); 128 sc = device_get_softc(dev); 129 130 rid = 0; |
131 bus_alloc_resource(dev, SYS_RES_IOPORT, &rid, |
132 0, ~0, 0, RF_ACTIVE | RF_SHAREABLE); 133 rid = 0; |
134 bus_alloc_resource(dev, SYS_RES_MEMORY, &rid, |
135 0, ~0, 0, RF_ACTIVE | RF_SHAREABLE); 136 137 error = vga_attach_unit(unit, sc, device_get_flags(dev)); 138 if (error) 139 return error; 140 141#ifdef FB_INSTALL_CDEV 142 /* attach a virtual frame buffer device */ --- 72 unchanged lines hidden --- |