diff options
author | Kyle Evans <kevans@FreeBSD.org> | 2020-12-09 03:22:44 +0000 |
---|---|---|
committer | Kyle Evans <kevans@FreeBSD.org> | 2020-12-09 03:22:44 +0000 |
commit | 3b27074b252cae3c7aee8f05f0c968dd26fa055b (patch) | |
tree | 72bd3b4ae7192bd7d05151e02092a9e40a346205 /lib/libsysdecode | |
parent | e04a83a3e1b40fc7c41b5938d2e432ba01facd74 (diff) | |
download | src-3b27074b252cae3c7aee8f05f0c968dd26fa055b.tar.gz src-3b27074b252cae3c7aee8f05f0c968dd26fa055b.zip |
libsysdecode: decode _UMTX_OP flags
Assume that UMTX_OP with a double underbar following is a flag, while any
underbar+alphanumeric combination immeiately following is an op.
This was a part of D27325.
Reviewed by: kib
Notes
Notes:
svn path=/head/; revision=368480
Diffstat (limited to 'lib/libsysdecode')
-rw-r--r-- | lib/libsysdecode/flags.c | 14 | ||||
-rw-r--r-- | lib/libsysdecode/mktables | 3 | ||||
-rw-r--r-- | lib/libsysdecode/sysdecode.h | 1 |
3 files changed, 17 insertions, 1 deletions
diff --git a/lib/libsysdecode/flags.c b/lib/libsysdecode/flags.c index 1eb48858fd88..df461cf0dca1 100644 --- a/lib/libsysdecode/flags.c +++ b/lib/libsysdecode/flags.c @@ -941,6 +941,20 @@ sysdecode_umtx_op(int op) return (lookup_value(umtxop, op)); } +bool +sysdecode_umtx_op_flags(FILE *fp, int op, int *rem) +{ + uintmax_t val; + bool printed; + + printed = false; + val = (unsigned)op; + print_mask_part(fp, umtxopflags, &val, &printed); + if (rem != NULL) + *rem = val; + return (printed); +} + const char * sysdecode_vmresult(int result) { diff --git a/lib/libsysdecode/mktables b/lib/libsysdecode/mktables index b42978d57c4d..3a0284a2deb4 100644 --- a/lib/libsysdecode/mktables +++ b/lib/libsysdecode/mktables @@ -145,7 +145,8 @@ gen_table "sockoptudp" "UDP_[[:alnum:]]+[[:space:]]+[0-9]+" "neti gen_table "sockoptudplite" "UDPLITE_[[:alnum:]_]+[[:space:]]+[0-9]+" "netinet/udplite.h" gen_table "socktype" "SOCK_[A-Z]+[[:space:]]+[1-9]+[0-9]*" "sys/socket.h" gen_table "thrcreateflags" "THR_[A-Z]+[[:space:]]+0x[0-9]+" "sys/thr.h" -gen_table "umtxop" "UMTX_OP_[[:alnum:]_]+[[:space:]]+[0-9]+" "sys/umtx.h" +gen_table "umtxop" "UMTX_OP_[[:alnum:]][[:alnum:]_]*[[:space:]]+[0-9]+" "sys/umtx.h" +gen_table "umtxopflags" "UMTX_OP__[[:alnum:]_]+[[:space:]]+[0-9]+" "sys/umtx.h" gen_table "vmprot" "VM_PROT_[A-Z]+[[:space:]]+\(\(vm_prot_t\)[[:space:]]+0x[0-9]+\)" "vm/vm.h" gen_table "vmresult" "KERN_[A-Z_]+[[:space:]]+[0-9]+" "vm/vm_param.h" gen_table "wait6opt" "W[A-Z]+[[:space:]]+[0-9]+" "sys/wait.h" diff --git a/lib/libsysdecode/sysdecode.h b/lib/libsysdecode/sysdecode.h index a01ac1243aa2..cdb9205f3da1 100644 --- a/lib/libsysdecode/sysdecode.h +++ b/lib/libsysdecode/sysdecode.h @@ -121,6 +121,7 @@ const char *sysdecode_sysarch_number(int _number); bool sysdecode_thr_create_flags(FILE *_fp, int _flags, int *_rem); bool sysdecode_umtx_cvwait_flags(FILE *_fp, u_long _flags, u_long *_rem); const char *sysdecode_umtx_op(int _op); +bool sysdecode_umtx_op_flags(FILE *_fp, int op, int *_rem); bool sysdecode_umtx_rwlock_flags(FILE *_fp, u_long _flags, u_long *_rem); int sysdecode_utrace(FILE *_fp, void *_buf, size_t _len); bool sysdecode_vmprot(FILE *_fp, int _type, int *_rem); |