Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F168125412
D27325.id79929.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
6 KB
Referenced Files
None
Subscribers
None
D27325.id79929.diff
View Options
Index: lib/libc/sys/_umtx_op.2
===================================================================
--- lib/libc/sys/_umtx_op.2
+++ lib/libc/sys/_umtx_op.2
@@ -28,7 +28,7 @@
.\"
.\" $FreeBSD$
.\"
-.Dd November 16, 2020
+.Dd November 23, 2020
.Dt _UMTX_OP 2
.Os
.Sh NAME
@@ -1272,6 +1272,79 @@
.Sx ROBUST UMUTEXES
subsection for details.
.El
+.Pp
+The
+.Fa op
+argument may be a bitwise OR of a single command from above with one or more of
+the following flags:
+.Bl -tag -width indent
+.It Dv UMTX_OP__I386
+Request i386 ABI compatibility from the native
+.Nm
+system call.
+Specifically, this implies that:
+.Bl -hang -offset indent
+.It
+.Fa obj
+arguments that point to a word, point to a 32-bit integer.
+.It
+The
+.Dv UMTX_OP_NWAKE_PRIVATE
+.Fa obj
+argument is a pointer to an array of 32-bit pointers.
+.It
+The
+.Dv m_rb_lnk
+member of
+.Vt struct umutex
+is a 32-bit pointer.
+.It
+.Vt struct timespec
+uses a 32-bit time_t.
+.El
+.Pp
+.Dv UMTX_OP__32BIT
+has no effect if this flag is set.
+This flag is valid for all architectures, but it is ignored on i386.
+.It Dv UMTX_OP__32BIT
+Request non-i386, 32-bit ABI compatibility from the native
+.Nm
+system call.
+Specifically, this implies that:
+.Bl -hang -offset indent
+.It
+.Fa obj
+arguments that point to a word, point to a 32-bit integer.
+.It
+The
+.Dv UMTX_OP_NWAKE_PRIVATE
+.Fa obj
+argument is a pointer to an array of 32-bit pointers.
+.It
+The
+.Dv m_rb_lnk
+member of
+.Vt struct umutex
+is a 32-bit pointer.
+.It
+.Vt struct timespec
+uses a 64-bit time_t.
+.El
+.Pp
+This flag has no effect if
+.Dv UMTX_OP__I386
+is set.
+This flag is valid for all architectures.
+.El
+.Pp
+Note that if any 32-bit ABI compatibility is being requested, then care must be
+taken with robust lists.
+A single thread may not mix 32-bit compatible robust lists with native
+robust lists.
+The first
+.Dv UMTX_OP_ROBUST_LISTS
+call in a given thread determines which ABI that thread will use for robust
+lists going forward.
.Sh RETURN VALUES
If successful,
all requests, except
Index: lib/libsysdecode/flags.c
===================================================================
--- lib/libsysdecode/flags.c
+++ lib/libsysdecode/flags.c
@@ -941,6 +941,20 @@
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)
{
Index: lib/libsysdecode/mktables
===================================================================
--- lib/libsysdecode/mktables
+++ lib/libsysdecode/mktables
@@ -145,7 +145,8 @@
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"
Index: lib/libsysdecode/sysdecode.h
===================================================================
--- lib/libsysdecode/sysdecode.h
+++ lib/libsysdecode/sysdecode.h
@@ -121,6 +121,7 @@
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);
Index: usr.bin/kdump/kdump.c
===================================================================
--- usr.bin/kdump/kdump.c
+++ usr.bin/kdump/kdump.c
@@ -254,14 +254,21 @@
}
}
+static bool
+print_mask_arg_part(bool (*decoder)(FILE *, int, int *), int value, int *rem)
+{
+
+ printf("%#x<", value);
+ return (decoder(stdout, value, rem));
+}
+
static void
print_mask_arg(bool (*decoder)(FILE *, int, int *), int value)
{
bool invalid;
int rem;
- printf("%#x<", value);
- invalid = !decoder(stdout, value, &rem);
+ invalid = !print_mask_arg_part(decoder, value, &rem);
printf(">");
if (invalid)
printf("<invalid>%u", rem);
@@ -1455,10 +1462,16 @@
ip++;
narg--;
break;
- case SYS__umtx_op:
+ case SYS__umtx_op: {
+ int op;
+
print_number(ip, narg, c);
putchar(',');
- print_integer_arg(sysdecode_umtx_op, *ip);
+ if (print_mask_arg_part(sysdecode_umtx_op_flags,
+ *ip, &op))
+ putchar('|');
+ print_integer_arg(sysdecode_umtx_op, op);
+ putchar('>');
switch (*ip) {
case UMTX_OP_CV_WAIT:
ip++;
@@ -1478,6 +1491,7 @@
ip++;
narg--;
break;
+ }
case SYS_ftruncate:
case SYS_truncate:
print_number(ip, narg, c);
Index: usr.bin/truss/syscalls.c
===================================================================
--- usr.bin/truss/syscalls.c
+++ usr.bin/truss/syscalls.c
@@ -888,12 +888,20 @@
fprintf(fp, "%d", value);
}
+static bool
+print_mask_arg_part(bool (*decoder)(FILE *, int, int *), FILE *fp, int value,
+ int *rem)
+{
+
+ return (decoder(fp, value, rem));
+}
+
static void
print_mask_arg(bool (*decoder)(FILE *, int, int *), FILE *fp, int value)
{
int rem;
- if (!decoder(fp, value, &rem))
+ if (!print_mask_arg_part(decoder, fp, value, &rem))
fprintf(fp, "0x%x", rem);
else if (rem != 0)
fprintf(fp, "|0x%x", rem);
@@ -2303,9 +2311,15 @@
case Procctl:
print_integer_arg(sysdecode_procctl_cmd, fp, args[sc->offset]);
break;
- case Umtxop:
- print_integer_arg(sysdecode_umtx_op, fp, args[sc->offset]);
+ case Umtxop: {
+ int rem;
+
+ if (print_mask_arg_part(sysdecode_umtx_op_flags, fp,
+ args[sc->offset], &rem))
+ fprintf(fp, "|");
+ print_integer_arg(sysdecode_umtx_op, fp, rem);
break;
+ }
case Atfd:
print_integer_arg(sysdecode_atfd, fp, args[sc->offset]);
break;
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Thu, Aug 27, 12:12 PM (18 h, 44 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
37383064
Default Alt Text
D27325.id79929.diff (6 KB)
Attached To
Mode
D27325: _umtx_op: final touches (manpage / libsysdecode / truss / kdump)
Attached
Detach File
Event Timeline
Log In to Comment