summaryrefslogtreecommitdiffstats
path: root/runtime/loc2c-runtime.h
diff options
context:
space:
mode:
authordwilder <dwilder>2007-03-01 19:04:18 +0000
committerdwilder <dwilder>2007-03-01 19:04:18 +0000
commit40f533d201117f801af6ef4e4c71709df07eec64 (patch)
tree1575b86bd08353d8da241737a0eb3d476849d812 /runtime/loc2c-runtime.h
parent6bd37f05b056713f3f1985e52b7e9610d2e84732 (diff)
downloadsystemtap-steved-40f533d201117f801af6ef4e4c71709df07eec64.tar.gz
systemtap-steved-40f533d201117f801af6ef4e4c71709df07eec64.tar.xz
systemtap-steved-40f533d201117f801af6ef4e4c71709df07eec64.zip
Rewrote s390x version of __stp_put_asm and __stp_put_asm to do single
byte writes.
Diffstat (limited to 'runtime/loc2c-runtime.h')
-rw-r--r--runtime/loc2c-runtime.h51
1 files changed, 17 insertions, 34 deletions
diff --git a/runtime/loc2c-runtime.h b/runtime/loc2c-runtime.h
index 0e0256a4..9c84f6df 100644
--- a/runtime/loc2c-runtime.h
+++ b/runtime/loc2c-runtime.h
@@ -331,19 +331,19 @@
: "cc"); \
})
-#define __stp_put_asm(x, addr, err, size) \
+#define __stp_put_asm(x, addr, err) \
({ \
asm volatile( \
- "0: mvc 0(%1,%2),0(%3)\n" \
+ "0: stc %2,0(%1)\n" \
"1:\n" \
".section .fixup,\"ax\"\n" \
- "2: lghi %0,%4\n" \
+ "2: lghi %0,%3\n" \
" jg 1b\n" \
".previous\n" \
EX_TABLE(0b,2b) \
: "+&d" (err) \
- : "i" (size),"a"(addr), \
- "a"(&(x)),"K"(-EFAULT) \
+ : "a"(addr), \
+ "r"(x),"K"(-EFAULT) \
: "cc"); \
})
@@ -381,36 +381,19 @@
_v; \
})
-#define store_deref(size, addr, value) \
-({ \
- int _bad = 0; \
- switch (size) { \
- case 1:{ \
- u8 _x = value; \
- __stp_put_asm(_x, addr, _bad,1); \
- break; \
- }; \
- case 2:{ \
- u16 _x = value; \
- __stp_put_asm(_x, addr, _bad,2); \
- break; \
- }; \
- case 4:{ \
- u32 _x = value; \
- __stp_put_asm(_x, addr, _bad,4); \
- break; \
- }; \
- case 8: { \
- u64 _x = value; \
- __stp_put_asm(_x, addr, _bad,8); \
- break; \
- }; \
- default: \
- break; \
- } \
- if (_bad) \
- goto deref_fault; \
+#define store_deref(size, addr, value) \
+({ \
+ int _bad = 0; \
+ int i; \
+ for(i=0;i<size;i++){ \
+ __stp_put_asm((u8)(value>>((size-i-1)*8)&0xff), \
+ (u64)addr+i,_bad); \
+ if (_bad) \
+ goto deref_fault; \
+ } \
})
+
+
#endif /* (s390) || (s390x) */
#define deref_string(dst, addr, maxbytes) \