version 1.233.2.6, 2016/07/09 20:25:20 |
version 1.233.2.7, 2016/10/05 20:56:03 |
Line 1369 config_devalloc(const device_t parent, c |
|
Line 1369 config_devalloc(const device_t parent, c |
|
if (ca == NULL) |
if (ca == NULL) |
return NULL; |
return NULL; |
|
|
if ((ca->ca_flags & DVF_PRIV_ALLOC) == 0 && |
|
ca->ca_devsize < sizeof(struct device)) |
|
panic("config_devalloc: %s (%zu < %zu)", cf->cf_atname, |
|
ca->ca_devsize, sizeof(struct device)); |
|
|
|
/* get memory for all device vars */ |
/* get memory for all device vars */ |
KASSERT((ca->ca_flags & DVF_PRIV_ALLOC) || ca->ca_devsize >= sizeof(struct device)); |
KASSERTMSG((ca->ca_flags & DVF_PRIV_ALLOC) |
|
|| ca->ca_devsize >= sizeof(struct device), |
|
"%s: %s (%zu < %zu)", __func__, cf->cf_atname, ca->ca_devsize, |
|
sizeof(struct device)); |
if (ca->ca_devsize > 0) { |
if (ca->ca_devsize > 0) { |
dev_private = kmem_zalloc(ca->ca_devsize, KM_SLEEP); |
dev_private = kmem_zalloc(ca->ca_devsize, KM_SLEEP); |
if (dev_private == NULL) |
if (dev_private == NULL) |
panic("config_devalloc: memory allocation for device softc failed"); |
panic("config_devalloc: memory allocation for device " |
|
"softc failed"); |
} else { |
} else { |
KASSERT(ca->ca_flags & DVF_PRIV_ALLOC); |
KASSERT(ca->ca_flags & DVF_PRIV_ALLOC); |
dev_private = NULL; |
dev_private = NULL; |
Line 1571 config_attach_loc(device_t parent, cfdat |
|
Line 1570 config_attach_loc(device_t parent, cfdat |
|
aprint_naive("%s (root)", device_xname(dev)); |
aprint_naive("%s (root)", device_xname(dev)); |
aprint_normal("%s (root)", device_xname(dev)); |
aprint_normal("%s (root)", device_xname(dev)); |
} else { |
} else { |
aprint_naive("%s at %s", device_xname(dev), device_xname(parent)); |
aprint_naive("%s at %s", device_xname(dev), |
aprint_normal("%s at %s", device_xname(dev), device_xname(parent)); |
device_xname(parent)); |
|
aprint_normal("%s at %s", device_xname(dev), |
|
device_xname(parent)); |
if (print) |
if (print) |
(void) (*print)(aux, NULL); |
(void) (*print)(aux, NULL); |
} |
} |
Line 1600 config_attach_loc(device_t parent, cfdat |
|
Line 1601 config_attach_loc(device_t parent, cfdat |
|
(*dev->dv_cfattach->ca_attach)(parent, dev, aux); |
(*dev->dv_cfattach->ca_attach)(parent, dev, aux); |
|
|
if (!device_pmf_is_registered(dev)) |
if (!device_pmf_is_registered(dev)) |
aprint_debug_dev(dev, "WARNING: power management not supported\n"); |
aprint_debug_dev(dev, "WARNING: power management not " |
|
"supported\n"); |
|
|
config_process_deferred(&deferred_config_queue, dev); |
config_process_deferred(&deferred_config_queue, dev); |
|
|
Line 1782 config_detach(device_t dev, int flags) |
|
Line 1784 config_detach(device_t dev, int flags) |
|
d = TAILQ_NEXT(d, dv_list)) { |
d = TAILQ_NEXT(d, dv_list)) { |
if (d->dv_parent == dev && d->dv_del_gen == 0) { |
if (d->dv_parent == dev && d->dv_del_gen == 0) { |
printf("config_detach: detached device %s" |
printf("config_detach: detached device %s" |
" has children %s\n", device_xname(dev), device_xname(d)); |
" has children %s\n", device_xname(dev), |
|
device_xname(d)); |
panic("config_detach"); |
panic("config_detach"); |
} |
} |
} |
} |
Line 2044 config_mountroot(device_t dev, void (*fu |
|
Line 2047 config_mountroot(device_t dev, void (*fu |
|
* Process a deferred configuration queue. |
* Process a deferred configuration queue. |
*/ |
*/ |
static void |
static void |
config_process_deferred(struct deferred_config_head *queue, |
config_process_deferred(struct deferred_config_head *queue, device_t parent) |
device_t parent) |
|
{ |
{ |
struct deferred_config *dc, *ndc; |
struct deferred_config *dc, *ndc; |
|
|
Line 2177 config_finalize(void) |
|
Line 2179 config_finalize(void) |
|
printf_nolog(" done.\n"); |
printf_nolog(" done.\n"); |
} |
} |
mutex_exit(&config_misc_lock); |
mutex_exit(&config_misc_lock); |
if (errcnt != 0) { |
} |
printf("WARNING: %d error%s while detecting hardware; " |
if (errcnt != 0) { |
"check system log.\n", errcnt, |
printf("WARNING: %d error%s while detecting hardware; " |
errcnt == 1 ? "" : "s"); |
"check system log.\n", errcnt, |
} |
errcnt == 1 ? "" : "s"); |
} |
} |
} |
} |
|
|
Line 2410 pmflock_debug(device_t dev, const char * |
|
Line 2412 pmflock_debug(device_t dev, const char * |
|
{ |
{ |
device_lock_t dvl = device_getlock(dev); |
device_lock_t dvl = device_getlock(dev); |
|
|
aprint_debug_dev(dev, "%s.%d, %s dvl_nlock %d dvl_nwait %d dv_flags %x\n", |
aprint_debug_dev(dev, |
func, line, curlwp_name(), dvl->dvl_nlock, dvl->dvl_nwait, |
"%s.%d, %s dvl_nlock %d dvl_nwait %d dv_flags %x\n", func, line, |
dev->dv_flags); |
curlwp_name(), dvl->dvl_nlock, dvl->dvl_nwait, dev->dv_flags); |
} |
} |
|
|
static bool |
static bool |