qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH] sparc64: fix helper_st_asi little endian case typo
@ 2009-07-11 18:22 Igor Kovalenko
  2009-07-11 20:43 ` Stuart Brady
  0 siblings, 1 reply; 4+ messages in thread
From: Igor Kovalenko @ 2009-07-11 18:22 UTC (permalink / raw)
  To: qemu-devel

[-- Attachment #1: Type: text/plain, Size: 139 bytes --]

It is clear that intention is to byte-swap value to be written, not
the target address.
Please apply.

-- 
Kind regards,
Igor V. Kovalenko

[-- Attachment #2: sparc64-le-typo --]
[-- Type: application/octet-stream, Size: 1147 bytes --]

Index: qemu-trunk/target-sparc/op_helper.c
===================================================================
--- qemu-trunk.orig/target-sparc/op_helper.c
+++ qemu-trunk/target-sparc/op_helper.c
@@ -1949,13 +1949,13 @@ void helper_st_asi(target_ulong addr, ta
     case 0x89: // Secondary LE
         switch(size) {
         case 2:
-            addr = bswap16(addr);
+            addr = bswap16(val);
             break;
         case 4:
-            addr = bswap32(addr);
+            addr = bswap32(val);
             break;
         case 8:
-            addr = bswap64(addr);
+            addr = bswap64(val);
             break;
         default:
             break;
@@ -2375,13 +2375,13 @@ void helper_st_asi(target_ulong addr, ta
     case 0x89: // Secondary LE
         switch(size) {
         case 2:
-            addr = bswap16(addr);
+            val = bswap16(val);
             break;
         case 4:
-            addr = bswap32(addr);
+            val = bswap32(val);
             break;
         case 8:
-            addr = bswap64(addr);
+            val = bswap64(val);
             break;
         default:
             break;

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [Qemu-devel] [PATCH] sparc64: fix helper_st_asi little endian case typo
  2009-07-11 18:22 [Qemu-devel] [PATCH] sparc64: fix helper_st_asi little endian case typo Igor Kovalenko
@ 2009-07-11 20:43 ` Stuart Brady
  2009-07-11 20:57   ` Igor Kovalenko
  0 siblings, 1 reply; 4+ messages in thread
From: Stuart Brady @ 2009-07-11 20:43 UTC (permalink / raw)
  To: Igor Kovalenko; +Cc: qemu-devel

On Sat, Jul 11, 2009 at 10:22:18PM +0400, Igor Kovalenko wrote:
> It is clear that intention is to byte-swap value to be written, not
> the target address.

@@ -1949,13 +1949,13 @@ void helper_st_asi(target_ulong addr, ta
     case 0x89: // Secondary LE
         switch(size) {
         case 2:
-            addr = bswap16(addr);
+            addr = bswap16(val);
             ^^^^
Shouldn't that be 'val = bswap16(val)' (and likewise for the 32-bit and
64-bit cases)?  Also needs a 'signed-off-by:'...

Cheers,
-- 
Stuart Brady

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [Qemu-devel] [PATCH] sparc64: fix helper_st_asi little endian case typo
  2009-07-11 20:43 ` Stuart Brady
@ 2009-07-11 20:57   ` Igor Kovalenko
  2009-07-12  7:53     ` Blue Swirl
  0 siblings, 1 reply; 4+ messages in thread
From: Igor Kovalenko @ 2009-07-11 20:57 UTC (permalink / raw)
  To: qemu-devel

[-- Attachment #1: Type: text/plain, Size: 900 bytes --]

On Sun, Jul 12, 2009 at 12:43 AM, Stuart Brady<sdbrady@ntlworld.com> wrote:
> On Sat, Jul 11, 2009 at 10:22:18PM +0400, Igor Kovalenko wrote:
>> It is clear that intention is to byte-swap value to be written, not
>> the target address.
>
> @@ -1949,13 +1949,13 @@ void helper_st_asi(target_ulong addr, ta
>     case 0x89: // Secondary LE
>         switch(size) {
>         case 2:
> -            addr = bswap16(addr);
> +            addr = bswap16(val);
>             ^^^^
> Shouldn't that be 'val = bswap16(val)' (and likewise for the 32-bit and
> 64-bit cases)?  Also needs a 'signed-off-by:'...
>
> Cheers,
> --
> Stuart Brady
>

Thanks, that part I did not runtime-tested.
Not sure if those asi stores are of any use for user-mode emulator.

Please find attached the corrected version.

Signed-off-by: igor.v.kovalenko@gmail.com

-- 
Kind regards,
Igor V. Kovalenko

[-- Attachment #2: sparc64-le-typo --]
[-- Type: application/octet-stream, Size: 1144 bytes --]

Index: qemu-trunk/target-sparc/op_helper.c
===================================================================
--- qemu-trunk.orig/target-sparc/op_helper.c
+++ qemu-trunk/target-sparc/op_helper.c
@@ -1949,13 +1949,13 @@ void helper_st_asi(target_ulong addr, ta
     case 0x89: // Secondary LE
         switch(size) {
         case 2:
-            addr = bswap16(addr);
+            val = bswap16(val);
             break;
         case 4:
-            addr = bswap32(addr);
+            val = bswap32(val);
             break;
         case 8:
-            addr = bswap64(addr);
+            val = bswap64(val);
             break;
         default:
             break;
@@ -2375,13 +2375,13 @@ void helper_st_asi(target_ulong addr, ta
     case 0x89: // Secondary LE
         switch(size) {
         case 2:
-            addr = bswap16(addr);
+            val = bswap16(val);
             break;
         case 4:
-            addr = bswap32(addr);
+            val = bswap32(val);
             break;
         case 8:
-            addr = bswap64(addr);
+            val = bswap64(val);
             break;
         default:
             break;

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [Qemu-devel] [PATCH] sparc64: fix helper_st_asi little endian case typo
  2009-07-11 20:57   ` Igor Kovalenko
@ 2009-07-12  7:53     ` Blue Swirl
  0 siblings, 0 replies; 4+ messages in thread
From: Blue Swirl @ 2009-07-12  7:53 UTC (permalink / raw)
  To: Igor Kovalenko; +Cc: qemu-devel

On 7/11/09, Igor Kovalenko <igor.v.kovalenko@gmail.com> wrote:
> On Sun, Jul 12, 2009 at 12:43 AM, Stuart Brady<sdbrady@ntlworld.com> wrote:
>  > On Sat, Jul 11, 2009 at 10:22:18PM +0400, Igor Kovalenko wrote:
>  >> It is clear that intention is to byte-swap value to be written, not
>  >> the target address.
>  >
>  > @@ -1949,13 +1949,13 @@ void helper_st_asi(target_ulong addr, ta
>  >     case 0x89: // Secondary LE
>  >         switch(size) {
>  >         case 2:
>  > -            addr = bswap16(addr);
>  > +            addr = bswap16(val);
>  >             ^^^^
>  > Shouldn't that be 'val = bswap16(val)' (and likewise for the 32-bit and
>  > 64-bit cases)?  Also needs a 'signed-off-by:'...
>  >
>  > Cheers,
>  > --
>  > Stuart Brady
>  >
>
>
> Thanks, that part I did not runtime-tested.
>  Not sure if those asi stores are of any use for user-mode emulator.
>
>  Please find attached the corrected version.
>
>  Signed-off-by: igor.v.kovalenko@gmail.com

Thanks, I applied most of your patches.

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2009-07-12  7:53 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-07-11 18:22 [Qemu-devel] [PATCH] sparc64: fix helper_st_asi little endian case typo Igor Kovalenko
2009-07-11 20:43 ` Stuart Brady
2009-07-11 20:57   ` Igor Kovalenko
2009-07-12  7:53     ` Blue Swirl

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).