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
This commit is contained in:
Kyle Evans 2020-12-09 03:22:44 +00:00
parent e04a83a3e1
commit 3b27074b25
3 changed files with 17 additions and 1 deletions

View File

@ -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)
{

View File

@ -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"

View File

@ -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);