From 0fd75a66226d20b255e371aeb2f61d077776a60f Mon Sep 17 00:00:00 2001 From: Visa Hankala Date: Sun, 13 Aug 2023 08:29:29 +0000 Subject: kevent: Add precision and abstimer flags for EVFILT_TIMER Add timer precision flags NOTE_SECONDS, NOTE_MSECONDS, NOTE_USECONDS and NOTE_NSECONDS for EVFILT_TIMER. Also, add an initial implementation of NOTE_ABSTIME timers. Similar kevent(2) flags exist on FreeBSD, NetBSD and XNU. Initial diff by and OK aisha@ OK mpi@ --- usr.bin/kdump/mksubr | 25 ++++++++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) (limited to 'usr.bin/kdump') diff --git a/usr.bin/kdump/mksubr b/usr.bin/kdump/mksubr index 6dd94c00a45..2762a0d97a2 100644 --- a/usr.bin/kdump/mksubr +++ b/usr.bin/kdump/mksubr @@ -1,5 +1,5 @@ #!/bin/sh -# $OpenBSD: mksubr,v 1.39 2022/12/19 22:55:12 guenther Exp $ +# $OpenBSD: mksubr,v 1.40 2023/08/13 08:29:28 visa Exp $ # # Copyright (c) 2006 David Kirchner # @@ -560,6 +560,29 @@ _EOF_ printf "\t\tif_print_or(fflags, %s, or);\n", $i }' cat <<_EOF_ break; + case EVFILT_TIMER: +#define NOTE_TIMER_UNITMASK \ + (NOTE_SECONDS|NOTE_MSECONDS|NOTE_USECONDS|NOTE_NSECONDS) + switch (fflags & NOTE_TIMER_UNITMASK) { + case NOTE_SECONDS: + printf("NOTE_SECONDS"); + break; + case NOTE_MSECONDS: + printf("NOTE_MSECONDS"); + break; + case NOTE_USECONDS: + printf("NOTE_USECONDS"); + break; + case NOTE_NSECONDS: + printf("NOTE_NSECONDS"); + break; + default: + printf("invalid"); + break; + } + or = 1; + if_print_or(fflags, NOTE_ABSTIME, or); + break; } printf(">"); } -- cgit v1.2.3