summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSamuel Thibault <samuel.thibault@ens-lyon.org>2019-12-16 21:26:29 +0100
committerSamuel Thibault <samuel.thibault@ens-lyon.org>2019-12-16 21:30:41 +0100
commit212c386ddfa97a8c77572d7fcc617d078030d565 (patch)
tree712e5678ebbad3ed92d4a9e386a1aff750f3cd34
parent10f1958417a4944a60a08230eae6a639209d52f8 (diff)
Subject: [PATCH] fixes-2.31fixes-2.31
* sysdeps/mach/hurd/profil-counter.h: New file * sysdeps/mach/hurd/i386/sigcontextinfo.h: Switch to siginfo version.
-rw-r--r--.topdeps2
-rw-r--r--.topmsg19
-rw-r--r--sysdeps/mach/hurd/i386/sigcontextinfo.h5
-rw-r--r--sysdeps/mach/hurd/profil-counter.h32
4 files changed, 40 insertions, 18 deletions
diff --git a/.topdeps b/.topdeps
index df7c3c6e56..045951300c 100644
--- a/.topdeps
+++ b/.topdeps
@@ -1 +1 @@
-9a869d822025be8e43b78234997b10bf0cf9d859
+upstream
diff --git a/.topmsg b/.topmsg
index dd6634c886..4b484ff570 100644
--- a/.topmsg
+++ b/.topmsg
@@ -1,16 +1,7 @@
-Subject: Baseline for our topic branches.
+From: Samuel Thibault <samuel.thibault@ens-lyon.org>
+Subject: [PATCH] fixes-2.31
----
+* sysdeps/mach/hurd/profil-counter.h: New file
+* sysdeps/mach/hurd/i386/sigcontextinfo.h: Switch to siginfo version.
-This need not strictly be a TopGit branch, but it is for easy synchronization
-between different machines.
-
-As the baseline is merged into the topic branches, it is forward-only.
-
-To advance it:
-
- $ echo [SHA1] > .topdeps
- $ git commit -m Advance. -- .topdeps
- $ tg update
-
----
+Signed-off-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
diff --git a/sysdeps/mach/hurd/i386/sigcontextinfo.h b/sysdeps/mach/hurd/i386/sigcontextinfo.h
index 42004f0041..145f848312 100644
--- a/sysdeps/mach/hurd/i386/sigcontextinfo.h
+++ b/sysdeps/mach/hurd/i386/sigcontextinfo.h
@@ -18,11 +18,10 @@
#ifndef _SIGCONTEXTINFO_H
#define _SIGCONTEXTINFO_H
-#define SIGCONTEXT struct sigcontext
static inline uintptr_t
-sigcontext_get_pc (struct sigcontext ctx)
+sigcontext_get_pc (const ucontext_t *ctx)
{
- return ctx.sc_eip;
+ return ctx->uc_mcontext.gregs[REG_EIP];
}
#endif
diff --git a/sysdeps/mach/hurd/profil-counter.h b/sysdeps/mach/hurd/profil-counter.h
new file mode 100644
index 0000000000..71cec0854e
--- /dev/null
+++ b/sysdeps/mach/hurd/profil-counter.h
@@ -0,0 +1,32 @@
+/* Machine-dependent SIGPROF signal handler. Hurd version.
+ Copyright (C) 1996-2019 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, see
+ <https://www.gnu.org/licenses/>. */
+
+#include <signal.h>
+#include <sigcontextinfo.h>
+
+/* sa_sigaction signature to use along SA_SIGINFO. */
+static void
+__profil_counter (int signo, siginfo_t *info, void *ctx)
+{
+ profil_count (sigcontext_get_pc (ctx));
+
+ /* This is a hack to prevent the compiler from implementing the
+ above function call as a sibcall. The sibcall would overwrite
+ the signal context. */
+ asm volatile ("");
+}