diff options
author | dwilder <dwilder> | 2007-03-01 19:04:18 +0000 |
---|---|---|
committer | dwilder <dwilder> | 2007-03-01 19:04:18 +0000 |
commit | 40f533d201117f801af6ef4e4c71709df07eec64 (patch) | |
tree | 1575b86bd08353d8da241737a0eb3d476849d812 | |
parent | 6bd37f05b056713f3f1985e52b7e9610d2e84732 (diff) | |
download | systemtap-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.
-rw-r--r-- | runtime/ChangeLog | 4 | ||||
-rw-r--r-- | runtime/loc2c-runtime.h | 51 |
2 files changed, 21 insertions, 34 deletions
diff --git a/runtime/ChangeLog b/runtime/ChangeLog index c609f71f..bb018c01 100644 --- a/runtime/ChangeLog +++ b/runtime/ChangeLog @@ -1,3 +1,7 @@ +2007-03-01 David Wilder <dwilder@us.ibm.com> + * loc2c-runtime.h: rewrote s390x version of __stp_put_asm + and __stp_put_asm to do single byte writes. + 2007-02-27 David Wilder <dwilder@us.ibm.com> * loc2c-runtime.h: Added defines for EX_TABLE needed by older 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) \ |