summaryrefslogtreecommitdiff
path: root/src/xlat/madvise_hppa_generic_cmds.in
diff options
context:
space:
mode:
authorEugene Syromyatnikov <evgsyr@gmail.com>2023-04-30 15:53:58 +0200
committerEugene Syromyatnikov <evgsyr@gmail.com>2023-04-30 16:41:13 +0200
commit69a2a407b998a629e13e309eab3fb4364c0284fd (patch)
treeece298545101134543b4c4e3bc7235d8b07ed413 /src/xlat/madvise_hppa_generic_cmds.in
parent471f3593bf491e9296b9b889a15ba636460850c2 (diff)
downloadstrace-esyr/hppa-madvise.tar.gz
mem: handle hppa MADV_* UAPI breakageesyr/hppa-madvise
Linux commit v6.2-rc1~39^2~7 has broken UAPI on PA-RISC by changing the values of some MADV_* constants; that forces some special handling for them, since we cannot have any assumptions about the version of the kernel headers and/or kernel both strace and tracees are built and/or being run on. * src/mem.c: Include "xlat/madvise_hppa_generic_cmds.h". [HPPA]: Include "xlat/madvise_hppa_old_cmds.h". (SYS_FUNC(madvise)) <advice>: New local variable, set to tcp->u_arg[2]. [HPPA] (SYS_FUNC(madvise)): Check madvise_hppa_old_cmds for the advice value and print it appropriately if it is there; then check madvise_hppa_generic_cmds and print it appropriately if it is there; then fallback to printing advice as madvise_cmds xval. [!HPPA] (SYS_FUNC(madvise)): Print advice as madvise_cmds and madvise_hppa_generic_cmds xval. * src/xlat/madvise_cmds.in: Add sorted; remove "Generated ..." comment; move hppa-specific values to madvise_hppa_old_cmds.in and their generic counterparts to madvise_hppa_generic_cmds.in. * src/xlat/madvise_hppa_generic_cmds.in: New file. * src/xlat/madvise_hppa_old_cmds.in: Likewise. * tests/.gitignore: Add madvise-Xabbrev, madvise-Xraw, and madvise-Xverbose. * tests/pure_executables.list: Likewise. * tests/gen_tests.in (advise-Xabbrev, madvise-Xraw, madvise-Xverbos): New tests. * tests/madvise.c: Add checks for the advice argument decoding. * tests/madvise-Xabbrev.c: New file. * tests/madvise-Xraw.c: Likewise. * tests/madvise-Xverbose.c: Likewise. * NEWS: Mention it. Reported-by: Matoro Mahri <matoro@users.noreply.github.com> Closes: https://github.com/strace/strace/issues/241
Diffstat (limited to 'src/xlat/madvise_hppa_generic_cmds.in')
-rw-r--r--src/xlat/madvise_hppa_generic_cmds.in16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/xlat/madvise_hppa_generic_cmds.in b/src/xlat/madvise_hppa_generic_cmds.in
new file mode 100644
index 000000000..9740cab9b
--- /dev/null
+++ b/src/xlat/madvise_hppa_generic_cmds.in
@@ -0,0 +1,16 @@
+#unconditional
+#nocheckval
+/*
+ * These values are used on hppa since v6.2-rc1~39^2~7
+ * and on other architectures since their introduction;
+ * see madvise_hppa_old_cmds for the old values.
+ */
+MADV_MERGEABLE 12
+MADV_UNMERGEABLE 13
+MADV_HUGEPAGE 14
+MADV_NOHUGEPAGE 15
+MADV_DONTDUMP 16
+MADV_DODUMP 17
+MADV_WIPEONFORK 18
+MADV_KEEPONFORK 19
+MADV_COLLAPSE 25