subr_rman.c (158125) | subr_rman.c (159536) |
---|---|
1/*- 2 * Copyright 1998 Massachusetts Institute of Technology 3 * 4 * Permission to use, copy, modify, and distribute this software and 5 * its documentation for any purpose and without fee is hereby 6 * granted, provided that both the above copyright notice and this 7 * permission notice appear in all copies, that both the above 8 * copyright notice and this permission notice appear in all --- 42 unchanged lines hidden (view full) --- 51 * 52 * For array resources, we make one simplifying assumption: two clients 53 * sharing the same resource must use the same range of indices. That 54 * is to say, sharing of overlapping-but-not-identical regions is not 55 * permitted. 56 */ 57 58#include <sys/cdefs.h> | 1/*- 2 * Copyright 1998 Massachusetts Institute of Technology 3 * 4 * Permission to use, copy, modify, and distribute this software and 5 * its documentation for any purpose and without fee is hereby 6 * granted, provided that both the above copyright notice and this 7 * permission notice appear in all copies, that both the above 8 * copyright notice and this permission notice appear in all --- 42 unchanged lines hidden (view full) --- 51 * 52 * For array resources, we make one simplifying assumption: two clients 53 * sharing the same resource must use the same range of indices. That 54 * is to say, sharing of overlapping-but-not-identical regions is not 55 * permitted. 56 */ 57 58#include <sys/cdefs.h> |
59__FBSDID("$FreeBSD: head/sys/kern/subr_rman.c 158125 2006-04-28 21:23:09Z marcel $"); | 59__FBSDID("$FreeBSD: head/sys/kern/subr_rman.c 159536 2006-06-12 04:06:21Z imp $"); |
60 61#include <sys/param.h> 62#include <sys/systm.h> 63#include <sys/kernel.h> 64#include <sys/lock.h> 65#include <sys/malloc.h> 66#include <sys/mutex.h> 67#include <sys/bus.h> /* XXX debugging */ --- 110 unchanged lines hidden (view full) --- 178 TAILQ_INSERT_BEFORE(s, r, r_link); 179 } 180 181 mtx_unlock(rm->rm_mtx); 182 return 0; 183} 184 185int | 60 61#include <sys/param.h> 62#include <sys/systm.h> 63#include <sys/kernel.h> 64#include <sys/lock.h> 65#include <sys/malloc.h> 66#include <sys/mutex.h> 67#include <sys/bus.h> /* XXX debugging */ --- 110 unchanged lines hidden (view full) --- 178 TAILQ_INSERT_BEFORE(s, r, r_link); 179 } 180 181 mtx_unlock(rm->rm_mtx); 182 return 0; 183} 184 185int |
186rman_init_from_resource(struct rman *rm, struct resource *r) 187{ 188 int rv; 189 190 if ((rv = rman_init(rm)) != 0) 191 return (rv); 192 return (rman_manage_region(rm, r->__r_i->r_start, r->__r_i->r_end)); 193} 194 195int |
|
186rman_fini(struct rman *rm) 187{ 188 struct resource_i *r; 189 190 mtx_lock(rm->rm_mtx); 191 TAILQ_FOREACH(r, &rm->rm_list, r_link) { 192 if (r->r_flags & RF_ALLOCATED) { 193 mtx_unlock(rm->rm_mtx); --- 667 unchanged lines hidden --- | 196rman_fini(struct rman *rm) 197{ 198 struct resource_i *r; 199 200 mtx_lock(rm->rm_mtx); 201 TAILQ_FOREACH(r, &rm->rm_list, r_link) { 202 if (r->r_flags & RF_ALLOCATED) { 203 mtx_unlock(rm->rm_mtx); --- 667 unchanged lines hidden --- |