static int mmioctl(struct dev_ioctl_args *ap) { cdev_t dev = ap->a_head.a_dev; int error; get_mplock(); switch (minor(dev)) { case 0: error = mem_ioctl(dev, ap->a_cmd, ap->a_data, ap->a_fflag, ap->a_cred); break; case 3: case 4: error = random_ioctl(dev, ap->a_cmd, ap->a_data, ap->a_fflag, ap->a_cred); break; default: error = ENODEV; break; } rel_mplock(); return (error); }
int mmioctl(dev_t dev, u_long cmd, caddr_t data, int flags, struct proc *p) { #ifdef MTRR switch (minor(dev)) { case 0: case 4: return mem_ioctl(dev, cmd, data, flags, p); } #endif return (ENODEV); }
int mmioctl(dev_t dev, u_long cmd, caddr_t data, int flags, struct proc *p) { switch (cmd) { case FIONBIO: case FIOASYNC: /* handled by fd layer */ return 0; } #ifdef MTRR switch (minor(dev)) { case 0: case 4: return mem_ioctl(dev, cmd, data, flags, p); } #endif return (ENODEV); }