X-Git-Url: https://git.saurik.com/apple/xnu.git/blobdiff_plain/7e4a7d3939db04e70062ae6c7bf24b8c8b2f5a7c..b7266188b87f3620ec3f9f717e57194a7dd989fe:/bsd/kern/kern_sysctl.c diff --git a/bsd/kern/kern_sysctl.c b/bsd/kern/kern_sysctl.c index 7303287c1..842a3e572 100644 --- a/bsd/kern/kern_sysctl.c +++ b/bsd/kern/kern_sysctl.c @@ -2365,6 +2365,47 @@ SYSCTL_PROC(_kern, KERN_NETBOOT, netboot, 0, 0, sysctl_netboot, "I", ""); #endif +#ifdef CONFIG_IMGSRC_ACCESS +static int +sysctl_imgsrcdev +(__unused struct sysctl_oid *oidp, __unused void *arg1, __unused int arg2, struct sysctl_req *req) +{ + vfs_context_t ctx = vfs_context_current(); + vnode_t devvp; + int result; + + if (!vfs_context_issuser(ctx)) { + return EPERM; + } + + if (imgsrc_rootvnode == NULL) { + return ENOENT; + } + + result = vnode_getwithref(imgsrc_rootvnode); + if (result != 0) { + return result; + } + + devvp = vnode_mount(imgsrc_rootvnode)->mnt_devvp; + result = vnode_getwithref(devvp); + if (result != 0) { + goto out; + } + + result = sysctl_io_number(req, vnode_specrdev(devvp), sizeof(dev_t), NULL, NULL); + + vnode_put(devvp); +out: + vnode_put(imgsrc_rootvnode); + return result; +} + +SYSCTL_PROC(_kern, OID_AUTO, imgsrcdev, + CTLTYPE_INT | CTLFLAG_RD, + 0, 0, sysctl_imgsrcdev, "I", ""); +#endif /* CONFIG_IMGSRC_ACCESS */ + static int sysctl_usrstack (__unused struct sysctl_oid *oidp, __unused void *arg1, __unused int arg2, struct sysctl_req *req) @@ -2815,3 +2856,12 @@ SYSCTL_INT (_kern, OID_AUTO, stack_size, SYSCTL_INT (_kern, OID_AUTO, stack_depth_max, CTLFLAG_RD, (int *) &kernel_stack_depth_max, 0, "Max kernel stack depth at interrupt or context switch"); +/* + * enable back trace for port allocations + */ +extern int ipc_portbt; + +SYSCTL_INT(_kern, OID_AUTO, ipc_portbt, + CTLFLAG_RW | CTLFLAG_KERN, + &ipc_portbt, 0, ""); +