Deleted Added
full compact
proto_bus_isa.c (285058) proto_bus_isa.c (285707)
1/*-
2 * Copyright (c) 2015 Marcel Moolenaar
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

--- 10 unchanged lines hidden (view full) ---

19 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
20 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
21 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
22 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
23 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
24 */
25
26#include <sys/cdefs.h>
1/*-
2 * Copyright (c) 2015 Marcel Moolenaar
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

--- 10 unchanged lines hidden (view full) ---

19 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
20 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
21 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
22 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
23 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
24 */
25
26#include <sys/cdefs.h>
27__FBSDID("$FreeBSD: head/sys/dev/proto/proto_bus_isa.c 285058 2015-07-02 19:21:29Z marcel $");
27__FBSDID("$FreeBSD: head/sys/dev/proto/proto_bus_isa.c 285707 2015-07-19 23:37:45Z marcel $");
28
29#include <sys/param.h>
30#include <sys/systm.h>
31#include <sys/bus.h>
32#include <sys/conf.h>
33#include <sys/kernel.h>
34#include <sys/module.h>
35#include <machine/bus.h>

--- 18 unchanged lines hidden (view full) ---

54};
55
56static driver_t proto_isa_driver = {
57 proto_driver_name,
58 proto_isa_methods,
59 sizeof(struct proto_softc),
60};
61
28
29#include <sys/param.h>
30#include <sys/systm.h>
31#include <sys/bus.h>
32#include <sys/conf.h>
33#include <sys/kernel.h>
34#include <sys/module.h>
35#include <machine/bus.h>

--- 18 unchanged lines hidden (view full) ---

54};
55
56static driver_t proto_isa_driver = {
57 proto_driver_name,
58 proto_isa_methods,
59 sizeof(struct proto_softc),
60};
61
62static char proto_isa_prefix[] = "isa";
63static char **proto_isa_devnames;
64
62static int
63proto_isa_probe(device_t dev)
64{
65 struct sbuf *sb;
66 struct resource *res;
67 int rid, type;
68
69 rid = 0;
70 type = SYS_RES_IOPORT;
71 res = bus_alloc_resource_any(dev, type, &rid, RF_ACTIVE);
72 if (res == NULL) {
73 type = SYS_RES_MEMORY;
74 res = bus_alloc_resource_any(dev, type, &rid, RF_ACTIVE);
75 }
76 if (res == NULL)
77 return (ENODEV);
78
79 sb = sbuf_new_auto();
65static int
66proto_isa_probe(device_t dev)
67{
68 struct sbuf *sb;
69 struct resource *res;
70 int rid, type;
71
72 rid = 0;
73 type = SYS_RES_IOPORT;
74 res = bus_alloc_resource_any(dev, type, &rid, RF_ACTIVE);
75 if (res == NULL) {
76 type = SYS_RES_MEMORY;
77 res = bus_alloc_resource_any(dev, type, &rid, RF_ACTIVE);
78 }
79 if (res == NULL)
80 return (ENODEV);
81
82 sb = sbuf_new_auto();
80 sbuf_printf(sb, "isa:%#lx", rman_get_start(res));
83 sbuf_printf(sb, "%s:%#lx", proto_isa_prefix, rman_get_start(res));
81 sbuf_finish(sb);
82 device_set_desc_copy(dev, sbuf_data(sb));
83 sbuf_delete(sb);
84 bus_release_resource(dev, type, rid, res);
84 sbuf_finish(sb);
85 device_set_desc_copy(dev, sbuf_data(sb));
86 sbuf_delete(sb);
87 bus_release_resource(dev, type, rid, res);
85 return (BUS_PROBE_HOOVER);
88 return (proto_probe(dev, proto_isa_prefix, &proto_isa_devnames));
86}
87
88static int
89proto_isa_alloc(device_t dev, int type, int nrids)
90{
91 struct resource *res;
92 struct proto_softc *sc;
93 int count, rid;

--- 28 unchanged lines hidden ---
89}
90
91static int
92proto_isa_alloc(device_t dev, int type, int nrids)
93{
94 struct resource *res;
95 struct proto_softc *sc;
96 int count, rid;

--- 28 unchanged lines hidden ---