--- wikisrc/users/mlelstv/disk-driver-template.mdwn 2015/12/21 11:44:20 1.5 +++ wikisrc/users/mlelstv/disk-driver-template.mdwn 2015/12/21 12:28:21 1.6 @@ -344,17 +344,22 @@ xxx_modcmd(modcmd_t cmd, void *data) } // some global initialization +#ifdef PSEUDODEVICE + xxxattach(0); + // devices instances are created by xxxconfig utility + // and some private ioctl +#else // magic happens to create device instances - - // sometimes by calling config_attach_pseudo - // sometimes by faking structures manually - // using config_attach_loc might be possible - // sometimes by calling xxxattach(0) which - // uses one of the methods +#endif #endif break; case MODULE_CMD_FINI: + // outside of #ifdef _MODULE to allow removal of builtins +#ifdef PSEUDODEVICE // magic happens to destroy device instances +#else + // magic happens to destroy device instances +#endif // some global finalization #ifdef _MODULE