commit 52231be034160c786735c6ae2f51ac7723c2e1fd
Author: Dmitry V. Levin <ldv@altlinux.org>
Date: Fri Sep 15 16:06:14 2017 +0000
Update MEMBARRIER_CMD_* constants
* xlat/membarrier_cmds.in: Add MEMBARRIER_CMD_PRIVATE_EXPEDITED
introduced by kernel commit v4.14-rc1~174^2^2^4.
* NEWS: Mention this.
* tests/membarrier.c (main): Update expected output.
diff -rup a/tests/membarrier.c b/tests/membarrier.c
--- a/tests/membarrier.c 2016-12-20 00:10:21.000000000 -0500
+++ b/tests/membarrier.c 2018-03-07 16:08:39.803150889 -0500
@@ -44,10 +44,23 @@ main(void)
printf("membarrier(0x3 /* MEMBARRIER_CMD_??? */, 255) = %s\n",
sprintrc(-1));
if (saved_errno != ENOSYS) {
- /* the test needs to be updated? */
- assert(syscall(__NR_membarrier, 0, 0) == 1);
- puts("membarrier(MEMBARRIER_CMD_QUERY, 0)"
- " = 0x1 (MEMBARRIER_CMD_SHARED)");
+ const char *text;
+ int rc = syscall(__NR_membarrier, 0, 0);
+
+ switch (rc) {
+ case 1:
+ text = "MEMBARRIER_CMD_SHARED";
+ break;
+ case 1|8:
+ text = "MEMBARRIER_CMD_SHARED|"
+ "MEMBARRIER_CMD_PRIVATE_EXPEDITED";
+ break;
+ default:
+ error_msg_and_fail("membarrier returned %#x, does"
+ " the test have to be updated?", rc);
+ }
+ printf("membarrier(MEMBARRIER_CMD_QUERY, 0) = %#x (%s)\n",
+ rc, text);
}
puts("+++ exited with 0 +++");
return 0;
diff -rup a/xlat/membarrier_cmds.h b/xlat/membarrier_cmds.h
--- a/xlat/membarrier_cmds.h 2017-05-24 15:55:51.000000000 -0400
+++ b/xlat/membarrier_cmds.h 2018-03-07 16:08:54.883976263 -0500
@@ -5,6 +5,9 @@
#if !(defined(MEMBARRIER_CMD_SHARED) || (defined(HAVE_DECL_MEMBARRIER_CMD_SHARED) && HAVE_DECL_MEMBARRIER_CMD_SHARED))
# define MEMBARRIER_CMD_SHARED 1
#endif
+#if !(defined(MEMBARRIER_CMD_PRIVATE_EXPEDITED) || (defined(HAVE_DECL_MEMBARRIER_CMD_PRIVATE_EXPEDITED) && HAVE_DECL_MEMBARRIER_CMD_PRIVATE_EXPEDITED))
+# define MEMBARRIER_CMD_PRIVATE_EXPEDITED 8
+#endif
#ifdef IN_MPERS
@@ -16,6 +19,7 @@ static
const struct xlat membarrier_cmds[] = {
XLAT(MEMBARRIER_CMD_QUERY),
XLAT(MEMBARRIER_CMD_SHARED),
+ XLAT(MEMBARRIER_CMD_PRIVATE_EXPEDITED),
XLAT_END
};
diff -rup a/xlat/membarrier_cmds.in b/xlat/membarrier_cmds.in
--- a/xlat/membarrier_cmds.in 2015-11-16 19:40:22.000000000 -0500
+++ b/xlat/membarrier_cmds.in 2018-03-07 16:08:39.804150878 -0500
@@ -1,2 +1,3 @@
-MEMBARRIER_CMD_QUERY 0
-MEMBARRIER_CMD_SHARED 1
+MEMBARRIER_CMD_QUERY 0
+MEMBARRIER_CMD_SHARED 1
+MEMBARRIER_CMD_PRIVATE_EXPEDITED 8