-/* $OpenBSD: dt_dev.c,v 1.12 2021/03/26 21:17:10 bluhm Exp $ */
+/* $OpenBSD: dt_dev.c,v 1.13 2021/04/23 07:21:02 bluhm Exp $ */
/*
* Copyright (c) 2019 Martin Pieuchot <mpi@openbsd.org>
struct rwlock dt_lock = RWLOCK_INITIALIZER("dtlk");
volatile uint32_t dt_tracing = 0; /* [K] # of processes tracing */
+int allowdt;
+
void dtattach(struct device *, struct device *, void *);
int dtopen(dev_t, int, int, struct proc *);
int dtclose(dev_t, int, int, struct proc *);
{
struct dt_softc *sc;
int unit = minor(dev);
- extern int allowdt;
if (!allowdt)
return EPERM;
-/* $OpenBSD: kern_sysctl.c,v 1.389 2021/02/08 10:51:02 mpi Exp $ */
+/* $OpenBSD: kern_sysctl.c,v 1.390 2021/04/23 07:21:02 bluhm Exp $ */
/* $NetBSD: kern_sysctl.c,v 1.17 1996/05/20 17:49:05 mrg Exp $ */
/*-
#endif
#include "audio.h"
-#include "video.h"
+#include "dt.h"
#include "pf.h"
+#include "video.h"
extern struct forkstat forkstat;
extern struct nchstats nchstats;
extern int nselcoll, fscale;
extern struct disklist_head disklist;
extern fixpt_t ccpu;
-extern long numvnodes;
-#if NAUDIO > 0
+extern long numvnodes;
+extern int allowdt;
extern int audio_record_enable;
-#endif
-#if NVIDEO > 0
extern int video_record_enable;
-#endif
int allowkmem;
-int allowdt;
int sysctl_diskinit(int, struct proc *);
int sysctl_proc_args(int *, u_int, void *, size_t *, struct proc *);
int sysctl_intrcnt(int *, u_int, void *, size_t *);
int sysctl_sensors(int *, u_int, void *, size_t *, void *, size_t);
int sysctl_cptime2(int *, u_int, void *, size_t *, void *, size_t);
-#if NAUDIO > 0
int sysctl_audio(int *, u_int, void *, size_t *, void *, size_t);
-#endif
-#if NVIDEO > 0
int sysctl_video(int *, u_int, void *, size_t *, void *, size_t);
-#endif
int sysctl_cpustats(int *, u_int, void *, size_t *, void *, size_t);
int sysctl_utc_offset(void *, size_t *, void *, size_t);
return (EPERM);
securelevel = level;
return (0);
+#if NDT > 0
case KERN_ALLOWDT:
if (securelevel > 0)
return (sysctl_rdint(oldp, oldlenp, newp, allowdt));
return (sysctl_int(oldp, oldlenp, newp, newlen, &allowdt));
+#endif
case KERN_ALLOWKMEM:
if (securelevel > 0)
return (sysctl_rdint(oldp, oldlenp, newp, allowkmem));