summaryrefslogtreecommitdiffstats
path: root/tapset
diff options
context:
space:
mode:
authorWilliam Cohen <wcohen@redhat.com>2008-06-12 17:35:19 -0400
committerWilliam Cohen <wcohen@redhat.com>2008-06-12 17:35:19 -0400
commit53c08c2f0a7a03f755d04f0fec7749a0e83d8b45 (patch)
treecef2950bcd5d68be549df5bbc1b20b91d1173156 /tapset
parent3e169dc3f06f718eab93938c7a756104b846a1a6 (diff)
downloadsystemtap-steved-53c08c2f0a7a03f755d04f0fec7749a0e83d8b45.tar.gz
systemtap-steved-53c08c2f0a7a03f755d04f0fec7749a0e83d8b45.tar.xz
systemtap-steved-53c08c2f0a7a03f755d04f0fec7749a0e83d8b45.zip
Add user_mode function to tapset and document.
Diffstat (limited to 'tapset')
-rw-r--r--tapset/ChangeLog4
-rw-r--r--tapset/context.stp12
2 files changed, 16 insertions, 0 deletions
diff --git a/tapset/ChangeLog b/tapset/ChangeLog
index 91148d70..21cb5f31 100644
--- a/tapset/ChangeLog
+++ b/tapset/ChangeLog
@@ -1,3 +1,7 @@
+2008-06-12 Will Cohen <wcohen@redhat.com>
+
+ * tasks.stp: Add user_mode.
+
2008-06-11 Zhaolei <zhaolei@cn.fujitsu.com>
* syscalls.stp: Add sys_fchmodat.
diff --git a/tapset/context.stp b/tapset/context.stp
index 45e3be30..10c52226 100644
--- a/tapset/context.stp
+++ b/tapset/context.stp
@@ -140,6 +140,18 @@ function registers_valid:long () %{ /* pure */
THIS->__retvalue = (CONTEXT->regs != NULL);
%}
+function user_mode:long () %{ /* pure */ /* currently a user-mode address? */
+ if (CONTEXT->regs) {
+#if defined(__i386__) || defined(__x86_64__)
+ THIS->__retvalue = (uint64_t) user_mode_vm (CONTEXT->regs);
+#else
+ THIS->__retvalue = (uint64_t) user_mode (CONTEXT->regs);
+#endif
+ } else {
+ THIS->__retvalue = 0;
+ }
+%}
+
function is_return:long () %{ /* pure */
if (CONTEXT->pi)
THIS->__retvalue = 1;