Date: Wed, 28 Dec 2016 14:05:58 +1100 From: Nathanial Sloss <[email protected]>
Please see ftp://ftp.netbsd.org/pub/NetBSD/misc/nat/audio-clone.diff The audio device is cloned and their is no longer a limitation of one device per process and file descriptors may be shared among processes. The only function that gave me trouble was audiommap which still has to be changed. Some quick comments and questions after a five-minute skim: - Pass `-p' to diff to make the patch easier to review. - For an example of a cloning device mmap routine, see sys/external/bsd/drm2/drm/drm_drv.c and drm_vm.c. You may be able to get away with just doing udv_attach like drm_mmap_object in drm_vm.c. - You seem to have replaced some `struct lwp *l' parameters by curlwp. That's OK, but it should be in a separate change to make it easier to review. Where struct cdevsw prototypes got replaced by struct fileops prototypes, just add `struct lwp *l = curlwp' to the top of the function to reduce changes later. - I don't understand the filt_audioread/filt_audiowrite changes: why is it correct to replace n by 0 here? - Does struct audio_pid actually need to store a pid or lwpid any more? Does anything initialize those fields now? - Why is struct audio_pid exposed to userland in audioio.h?
