summaryrefslogtreecommitdiff
path: root/arch/x86/machine/tcb.h
diff options
context:
space:
mode:
authorRichard Braun <rbraun@sceen.net>2013-06-03 21:35:42 +0200
committerRichard Braun <rbraun@sceen.net>2013-06-03 21:36:06 +0200
commit7b712748e94fadbcb9131c5c1b19caa3d360db5c (patch)
tree2a04067dbc0c850f7d2ab2475e92b3b092c6e336 /arch/x86/machine/tcb.h
parent556c2c3b96f848d407ad002af434eee309dcc9b3 (diff)
x86/tcb: new tcb_trace function
This function dumps the stack trace of a thread from its TCB. In order to do that, the base pointer is now included in the TCB, along with the stack and instruction pointers.
Diffstat (limited to 'arch/x86/machine/tcb.h')
-rw-r--r--arch/x86/machine/tcb.h10
1 files changed, 9 insertions, 1 deletions
diff --git a/arch/x86/machine/tcb.h b/arch/x86/machine/tcb.h
index 886237e..bd0a793 100644
--- a/arch/x86/machine/tcb.h
+++ b/arch/x86/machine/tcb.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2012 Richard Braun.
+ * Copyright (c) 2012, 2013 Richard Braun.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -31,6 +31,7 @@
* Architecture specific thread data.
*/
struct tcb {
+ unsigned long bp;
unsigned long sp;
unsigned long ip;
};
@@ -82,6 +83,13 @@ tcb_switch(struct tcb *prev, struct tcb *next)
}
/*
+ * Dump the stack trace of a TCB.
+ *
+ * The thread associated to the TCB should not be running.
+ */
+void tcb_trace(const struct tcb *tcb);
+
+/*
* Send a rescheduling interrupt to a remote processor.
*/
static inline void