isahint.c (47398) | isahint.c (47578) |
---|---|
1/*- 2 * Copyright (c) 1999 Doug Rabson 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 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 19 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 20 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 21 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 22 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 23 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 24 * SUCH DAMAGE. 25 * | 1/*- 2 * Copyright (c) 1999 Doug Rabson 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 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 19 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 20 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 21 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 22 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 23 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 24 * SUCH DAMAGE. 25 * |
26 * $Id: isahint.c,v 1.1 1999/05/14 11:22:33 dfr Exp $ | 26 * $Id: isahint.c,v 1.2 1999/05/22 15:18:26 dfr Exp $ |
27 */ 28 29#include <sys/param.h> 30#include <sys/systm.h> 31#include <sys/kernel.h> 32#include <sys/bus.h> 33#include <sys/module.h> 34#include <isa/isavar.h> 35#include <machine/resource.h> 36 37static void 38isahint_add_device(device_t parent, const char *name, int unit) 39{ 40 device_t child; 41 int sensitive, start, count, t; | 27 */ 28 29#include <sys/param.h> 30#include <sys/systm.h> 31#include <sys/kernel.h> 32#include <sys/bus.h> 33#include <sys/module.h> 34#include <isa/isavar.h> 35#include <machine/resource.h> 36 37static void 38isahint_add_device(device_t parent, const char *name, int unit) 39{ 40 device_t child; 41 int sensitive, start, count, t; |
42 static device_t last_sensitive; | 42 int order; |
43 44 /* device-specific flag overrides any wildcard */ 45 sensitive = 0; 46 if (resource_int_value(name, unit, "sensitive", &sensitive) != 0) 47 resource_int_value(name, -1, "sensitive", &sensitive); 48 49 if (sensitive) | 43 44 /* device-specific flag overrides any wildcard */ 45 sensitive = 0; 46 if (resource_int_value(name, unit, "sensitive", &sensitive) != 0) 47 resource_int_value(name, -1, "sensitive", &sensitive); 48 49 if (sensitive) |
50 child = BUS_ADD_CHILD(parent, last_sensitive, name, unit); | 50 order = ISA_ORDER_SENSITIVE; |
51 else | 51 else |
52 child = BUS_ADD_CHILD(parent, 0, name, unit); | 52 order = ISA_ORDER_SPECULATIVE; 53 54 child = BUS_ADD_CHILD(parent, order, name, unit); |
53 if (child == 0) 54 return; | 55 if (child == 0) 56 return; |
55 else if (sensitive) 56 last_sensitive = child; | |
57 58 start = 0; 59 count = 0; 60 if (resource_int_value(name, unit, "port", &start) == 0 61 || resource_int_value(name, unit, "portsize", &count) == 0) 62 ISA_SET_RESOURCE(parent, child, SYS_RES_IOPORT, 0, 63 start, count); 64 --- 70 unchanged lines hidden --- | 57 58 start = 0; 59 count = 0; 60 if (resource_int_value(name, unit, "port", &start) == 0 61 || resource_int_value(name, unit, "portsize", &count) == 0) 62 ISA_SET_RESOURCE(parent, child, SYS_RES_IOPORT, 0, 63 start, count); 64 --- 70 unchanged lines hidden --- |