vga_isa.c (114384) | vga_isa.c (115549) |
---|---|
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 * | 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 114384 2003-05-01 04:23:15Z peter $ | 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; | 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 device_t bus; | |
97 int error; 98 99 /* No pnp support */ 100 if (isa_get_vendorid(dev)) 101 return (ENXIO); 102 103 device_set_desc(dev, "Generic ISA VGA"); 104 error = vga_probe_unit(device_get_unit(dev), &adp, device_get_flags(dev)); 105 if (error == 0) { | 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) { |
106 bus = device_get_parent(dev); | |
107 bus_set_resource(dev, SYS_RES_IOPORT, 0, 108 adp.va_io_base, adp.va_io_size); 109 bus_set_resource(dev, SYS_RES_MEMORY, 0, 110 adp.va_mem_base, adp.va_mem_size); 111#if 0 112 isa_set_port(dev, adp.va_io_base); 113 isa_set_portsize(dev, adp.va_io_size); 114 isa_set_maddr(dev, adp.va_mem_base); 115 isa_set_msize(dev, adp.va_mem_size); 116#endif 117 } 118 return error; 119} 120 121static int 122isavga_attach(device_t dev) 123{ 124 vga_softc_t *sc; | 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; |
125 struct resource *port; 126 struct resource *mem; | |
127 int unit; 128 int rid; 129 int error; 130 131 unit = device_get_unit(dev); 132 sc = device_get_softc(dev); 133 134 rid = 0; | 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; |
135 port = bus_alloc_resource(dev, SYS_RES_IOPORT, &rid, | 131 bus_alloc_resource(dev, SYS_RES_IOPORT, &rid, |
136 0, ~0, 0, RF_ACTIVE | RF_SHAREABLE); 137 rid = 0; | 132 0, ~0, 0, RF_ACTIVE | RF_SHAREABLE); 133 rid = 0; |
138 mem = bus_alloc_resource(dev, SYS_RES_MEMORY, &rid, | 134 bus_alloc_resource(dev, SYS_RES_MEMORY, &rid, |
139 0, ~0, 0, RF_ACTIVE | RF_SHAREABLE); 140 141 error = vga_attach_unit(unit, sc, device_get_flags(dev)); 142 if (error) 143 return error; 144 145#ifdef FB_INSTALL_CDEV 146 /* attach a virtual frame buffer device */ --- 72 unchanged lines hidden --- | 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 --- |