device_desc_t device_desc_dup(devfs_handle_t dev) { #ifdef LATER device_desc_t orig_device_desc, new_device_desc; new_device_desc = device_desc_alloc(); orig_device_desc = device_desc_default_get(dev); if (orig_device_desc) *new_device_desc = *orig_device_desc;/* small structure copy */ else { device_driver_t driver; ilvl_t pri; /* * Use the driver's thread priority in * case the device thread priority has not * been given. */ if (driver = device_driver_getbydev(dev)) { pri = device_driver_thread_pri_get(driver); device_desc_intr_swlevel_set(new_device_desc,pri); } } new_device_desc->flags &= ~D_IS_ASSOC; return(new_device_desc); #else FIXME("device_desc_dup"); return((device_desc_t)0); #endif }
/* * hub_device_desc_update * Update the passed in device descriptor with the actual the * target cpu number and interrupt priority level. * NOTE : These might be the same as the ones passed in thru * the descriptor. */ static void hub_device_desc_update(device_desc_t dev_desc, ilvl_t intr_swlevel, cpuid_t cpu) { char cpuname[40]; /* Store the interrupt priority level in the device descriptor */ device_desc_intr_swlevel_set(dev_desc, intr_swlevel); /* Convert the cpuid to the vertex handle in the hwgraph and * save it in the device descriptor. */ sprintf(cpuname,"/hw/cpunum/%ld",cpu); device_desc_intr_target_set(dev_desc, hwgraph_path_to_dev(cpuname)); }