=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/kdump/mksubr,v retrieving revision 1.28 retrieving revision 1.29 diff -c -r1.28 -r1.29 *** src/usr.bin/kdump/mksubr 2015/05/17 01:22:01 1.28 --- src/usr.bin/kdump/mksubr 2016/01/14 05:27:42 1.29 *************** *** 1,5 **** #!/bin/sh ! # $OpenBSD: mksubr,v 1.28 2015/05/17 01:22:01 deraadt Exp $ # # Copyright (c) 2006 David Kirchner # --- 1,5 ---- #!/bin/sh ! # $OpenBSD: mksubr,v 1.29 2016/01/14 05:27:42 guenther Exp $ # # Copyright (c) 2006 David Kirchner # *************** *** 261,266 **** --- 261,267 ---- cat <<_EOF_ #include #include + #include #include #include #include *************** *** 353,360 **** --- 354,365 ---- auto_if_type "sockipprotoname" "IPPROTO_[[:alnum:]]+[[:space:]]+" "netinet/in.h" auto_switch_type "sockoptname" "SO_[A-Z]+[[:space:]]+0x[0-9]+" "sys/socket.h" #auto_switch_type "ptraceopname" "PT_[[:alnum:]_]+[[:space:]]+[0-9]+" "sys/ptrace.h" + # exclude KTRFAC_MASK auto_orz_type "ktracefacname" "KTRFAC_[^M][[:alnum:]_]+" "sys/ktrace.h" auto_switch_type "itimername" "ITIMER_[[:alnum:]_]+" "sys/time.h" + auto_switch_type "evfiltername" "EVFILT_[[:alnum:]_]+[[:space:]]+[(]" "sys/event.h" + # exclude EV_{SYSFLAGS,FLAG1} + auto_orz_type "evflagsname" "EV_[^S][A-Z]+[[:space:]]+0x" "sys/event.h" cat <<_EOF_ /* *************** *** 496,501 **** --- 501,553 ---- printf(",%#x)>", cmd & SUBCMDMASK); break; } + } + + /* + * AUTO - Special + * + * kevent() NOTE_* interpretation depends on the filter type + */ + void + evfflagsname (int filter, int fflags) + { + int or = 0; + + if (fflags == 0) { + printf("0<>"); + return; + } + printf("%#x<", fflags); + switch (filter) { + case EVFILT_READ: + case EVFILT_WRITE: + if_print_or(fflags, NOTE_LOWAT, or); + if_print_or(fflags, NOTE_EOF, or); + break; + case EVFILT_VNODE: + _EOF_ + egrep "^#[[:space:]]*define[[:space:]]+NOTE_.[^O][A-Z]+[[:space:]]+0x[01248]{4}[^[:alnum:]]" \ + $include_dir/sys/event.h | \ + awk '{ for (i = 1; i <= NF; i++) \ + if ($i ~ /define/) \ + break; \ + ++i; \ + printf "\t\tif_print_or(fflags, %s, or);\n", $i }' + cat <<_EOF_ + break; + case EVFILT_PROC: + _EOF_ + egrep "^#[[:space:]]*define[[:space:]]+NOTE_[^S][A-Z]+[[:space:]]+0x[01248]{8}" \ + $include_dir/sys/event.h | \ + awk '{ for (i = 1; i <= NF; i++) \ + if ($i ~ /define/) \ + break; \ + ++i; \ + printf "\t\tif_print_or(fflags, %s, or);\n", $i }' + cat <<_EOF_ + break; + } + printf(">"); } _EOF_