+morph_t*
+resolve_device_morph(void* maybe_dev)
+{
+ struct device_alias* da = NULL;
+ morph_t *morphed;
+
+ morphed = morphed_ptr(maybe_dev);
+
+ if (!is_changeling(morphed)) {
+ return NULL;
+ }
+
+ if (morph_type_of(morphed, device_morpher))
+ {
+ return morphed;
+ }
+
+ if (morph_type_of(morphed, devcat_morpher))
+ {
+ return morphed;
+ }
+
+ while(morph_type_of(morphed, devalias_morpher))
+ {
+ da = changeling_reveal(morphed, devalias_morpher);
+ morphed = &da->alias->mobj;
+ }
+
+ return da ? morphed : NULL;
+}
+
+void
+device_alert_poller(struct device* dev, int poll_evt)
+{
+ dev->poll_evflags = poll_evt;
+ iopoll_wake_pollers(&dev->pollers);
+}
+
+void
+device_chain_loader(struct device_def* def, devdef_ldfn fn)
+{
+ struct device_ldfn_chain* node;
+
+ node = valloc(sizeof(*node));
+ node->load = fn;
+
+ if (!def->load_chain) {
+ node->chain = NULL;
+ }
+ else {
+ node->chain = def->load_chain;
+ }
+
+ def->load_chain = node;
+}
+
+void
+device_chain_load_once(struct device_def* def)