summaryrefslogtreecommitdiffstats
path: root/runtime/loc2c-runtime.h
diff options
context:
space:
mode:
authorfche <fche>2006-12-18 11:31:26 +0000
committerfche <fche>2006-12-18 11:31:26 +0000
commit6d7aee59de0264b0bcaabd85498b8bb7f977cebe (patch)
tree6d851d241155606476e8550992c01dbf0f06ec17 /runtime/loc2c-runtime.h
parentee6dda6f1fc2a8f952b69153fe7c1a6d0c73a7a3 (diff)
downloadsystemtap-steved-6d7aee59de0264b0bcaabd85498b8bb7f977cebe.tar.gz
systemtap-steved-6d7aee59de0264b0bcaabd85498b8bb7f977cebe.tar.xz
systemtap-steved-6d7aee59de0264b0bcaabd85498b8bb7f977cebe.zip
2006-12-18 Frank Ch. Eigler <fche@elastic.org>
PR 3079 * loc2c-runtime.h (deref, store_deref): Fork x86 and x86-64 variants. Remove dysfunctional 64-bit ops from x86. 2006-12-18 Frank Ch. Eigler <fche@elastic.org> * vfs.stp (ppos_pos): Protect contents with deref(), though this blocks operation on i686 due to bug #3079.
Diffstat (limited to 'runtime/loc2c-runtime.h')
-rw-r--r--runtime/loc2c-runtime.h36
1 files changed, 35 insertions, 1 deletions
diff --git a/runtime/loc2c-runtime.h b/runtime/loc2c-runtime.h
index 493f0193..c51908a9 100644
--- a/runtime/loc2c-runtime.h
+++ b/runtime/loc2c-runtime.h
@@ -120,7 +120,41 @@
#endif
-#if defined __i386__ || defined __x86_64__
+#if defined __i386__
+
+#define deref(size, addr) \
+ ({ \
+ int _bad = 0; \
+ u8 _b; u16 _w; u32 _l; \
+ intptr_t _v; \
+ switch (size) \
+ { \
+ case 1: __get_user_asm(_b,addr,_bad,"b","b","=q",1); _v = _b; break; \
+ case 2: __get_user_asm(_w,addr,_bad,"w","w","=r",1); _v = _w; break; \
+ case 4: __get_user_asm(_l,addr,_bad,"l","","=r",1); _v = _l; break; \
+ default: _v = __get_user_bad(); \
+ } \
+ if (_bad) \
+ goto deref_fault; \
+ _v; \
+ })
+
+#define store_deref(size, addr, value) \
+ ({ \
+ int _bad = 0; \
+ switch (size) \
+ { \
+ case 1: __put_user_asm(((u8)(value)),addr,_bad,"b","b","iq",1); break; \
+ case 2: __put_user_asm(((u16)(value)),addr,_bad,"w","w","ir",1); break; \
+ case 4: __put_user_asm(((u32)(value)),addr,_bad,"l","k","ir",1); break; \
+ default: __put_user_bad(); \
+ } \
+ if (_bad) \
+ goto deref_fault; \
+ })
+
+
+#elif defined __x86_64__
#define deref(size, addr) \
({ \