summaryrefslogtreecommitdiff
path: root/hurd
diff options
context:
space:
mode:
Diffstat (limited to 'hurd')
-rw-r--r--hurd/ChangeLog9
-rw-r--r--hurd/lock.h4
-rw-r--r--hurd/thread.h8
-rw-r--r--hurd/trace.h10
4 files changed, 30 insertions, 1 deletions
diff --git a/hurd/ChangeLog b/hurd/ChangeLog
index 659488a..90abee2 100644
--- a/hurd/ChangeLog
+++ b/hurd/ChangeLog
@@ -1,5 +1,14 @@
2009-01-16 Neal H. Walfield <neal@gnu.org>
+ * lock.h (ss_mutex_trace_add) [! USE_L4]: Set SS_LOCK_TRACE[I].TID
+ to zero.
+ * thread.h (hurd_myself) [USE_L4]: Return l4_myself.
+ * trace.h (trace_buffer_add) [! USE_L4 && ! RM_INTERN]: Use
+ hurd_myself, not l4_myself.
+ [! USE_L4 && RM_INTERN]: Don't print a tid.
+
+2009-01-16 Neal H. Walfield <neal@gnu.org>
+
* thread.h (AF_REGS_FMT): New macro.
(AF_REGS_PRINTF): Likewise.
diff --git a/hurd/lock.h b/hurd/lock.h
index 18aacfb..4a5ab30 100644
--- a/hurd/lock.h
+++ b/hurd/lock.h
@@ -141,7 +141,11 @@ ss_mutex_trace_add (int func, __const char *caller, int line, void *lock)
ss_lock_trace[i].caller = caller;
ss_lock_trace[i].line = line;
ss_lock_trace[i].lock = lock;
+# ifdef USE_L4
ss_lock_trace[i].tid = l4_myself ();
+# else
+ ss_lock_trace[i].tid = 0;
+# endif
#endif /* NDEBUG */
}
diff --git a/hurd/thread.h b/hurd/thread.h
index 653bbf6..1ca8ebe 100644
--- a/hurd/thread.h
+++ b/hurd/thread.h
@@ -259,8 +259,16 @@ extern void hurd_fault_catcher_unregister (struct hurd_fault_catcher *catcher);
static inline vg_thread_id_t
hurd_myself (void)
{
+#ifdef USE_L4
+ /* XXX: Annoyingly, we need the tid before UTCB->TID is initialized.
+ This needs to be fixed, but for now... */
+ return l4_myself ();
+#endif
struct hurd_utcb *utcb = hurd_utcb ();
+ assert (utcb);
+ assert (utcb->tid);
+
return utcb->tid;
}
diff --git a/hurd/trace.h b/hurd/trace.h
index 24c1c89..c566e9f 100644
--- a/hurd/trace.h
+++ b/hurd/trace.h
@@ -86,7 +86,15 @@ trace_buffer_add (const char *func, const int lineno,
ss_mutex_lock (&buffer->lock);
if (! buffer->notid)
- s_cprintf (pc, "%x:", l4_myself ());
+ {
+#ifdef USE_L4
+ s_cprintf (pc, "%x:", l4_myself ());
+#elif !defined (RM_INTERN)
+ s_cprintf (pc, "%x:", hurd_myself ());
+#else
+# warning Don't know how to get tid.
+#endif
+ }
s_cprintf (pc, "%s:%d: ", func, lineno);
va_start (ap, fmt);