summaryrefslogtreecommitdiffstats
path: root/runtime
diff options
context:
space:
mode:
authorJosh Stone <jistone@redhat.com>2010-04-01 15:18:01 -0700
committerJosh Stone <jistone@redhat.com>2010-04-01 15:21:05 -0700
commitb70cb5c663255b46ece13e6758a5cb3e58d9a95c (patch)
treebe609dbec8fccba9febc5e988dd467962edc3b75 /runtime
parentcba1d02def7a84d79dc8b40506b661db0973ccf5 (diff)
downloadsystemtap-steved-b70cb5c663255b46ece13e6758a5cb3e58d9a95c.tar.gz
systemtap-steved-b70cb5c663255b46ece13e6758a5cb3e58d9a95c.tar.xz
systemtap-steved-b70cb5c663255b46ece13e6758a5cb3e58d9a95c.zip
Add kernel-writing functions for guru only
* runtime/loc2c-runtime.h (store_deref_string): New. * tapset/conversions-guru.stp (set_kernel_*): New guru functions.
Diffstat (limited to 'runtime')
-rw-r--r--runtime/loc2c-runtime.h11
1 files changed, 11 insertions, 0 deletions
diff --git a/runtime/loc2c-runtime.h b/runtime/loc2c-runtime.h
index c75639ee..bd1faa51 100644
--- a/runtime/loc2c-runtime.h
+++ b/runtime/loc2c-runtime.h
@@ -1011,6 +1011,17 @@ extern void __store_deref_bad(void);
(dst); \
})
+#define store_deref_string(src, addr, maxbytes) \
+ ({ \
+ uintptr_t _addr; \
+ size_t _len; \
+ char *_s = (src); \
+ for (_len = (maxbytes), _addr = (uintptr_t)(addr); \
+ _len > 1 && _s && *_s != '\0'; --_len, ++_addr) \
+ store_deref(1, _addr, *_s++); \
+ store_deref(1, _addr, '\0'); \
+ })
+
#define CATCH_DEREF_FAULT() \
if (0) { \
deref_fault: ; \