Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/dev/ic More big-endian fixes from Izumi Tsutsui.



details:   https://anonhg.NetBSD.org/src/rev/3a5b5db0fae7
branches:  trunk
changeset: 485424:3a5b5db0fae7
user:      bouyer <bouyer%NetBSD.org@localhost>
date:      Thu Apr 27 16:49:07 2000 +0000

description:
More big-endian fixes from Izumi Tsutsui.

diffstat:

 sys/dev/ic/siop.c |  13 ++++++-------
 1 files changed, 6 insertions(+), 7 deletions(-)

diffs (44 lines):

diff -r 25fe1331f623 -r 3a5b5db0fae7 sys/dev/ic/siop.c
--- a/sys/dev/ic/siop.c Thu Apr 27 16:48:42 2000 +0000
+++ b/sys/dev/ic/siop.c Thu Apr 27 16:49:07 2000 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: siop.c,v 1.5 2000/04/27 14:06:57 bouyer Exp $  */
+/*     $NetBSD: siop.c,v 1.6 2000/04/27 16:49:07 bouyer Exp $  */
 
 /*
  * Copyright (c) 2000 Manuel Bouyer.
@@ -495,7 +495,7 @@
                if (siop_cmd)
                        printf("last msg_in=0x%x status=0x%x\n",
                            siop_cmd->siop_table->msg_in[0],
-                           htole32(siop_cmd->siop_table->status));
+                           le32toh(siop_cmd->siop_table->status));
                need_reset = 1;
                }
        }
@@ -1145,7 +1145,6 @@
        struct siop_cmd *siop_cmd;
        u_int32_t *scr;
        u_int32_t dsa;
-       u_int8_t *dsap = (u_int8_t *)&dsa;
        int timeout;
        int target, slot;
        int newcmd = 0; 
@@ -1196,13 +1195,13 @@
                         * second octet, reg offset is the third.
                         */
                        scr[Ent_idsa0 / 4] =
-                           htole32(0x78100000 | (dsap[0] << 8));
+                           htole32(0x78100000 | ((dsa & 0x000000ff) <<  8));
                        scr[Ent_idsa1 / 4] =
-                           htole32(0x78110000 | (dsap[1] << 8));
+                           htole32(0x78110000 | ( dsa & 0x0000ff00       ));
                        scr[Ent_idsa2 / 4] =
-                           htole32(0x78120000 | (dsap[2] << 8));
+                           htole32(0x78120000 | ((dsa & 0x00ff0000) >>  8));
                        scr[Ent_idsa3 / 4] =
-                           htole32(0x78130000 | (dsap[3] << 8));
+                           htole32(0x78130000 | ((dsa & 0xff000000) >> 16));
                        /* change status of cmd */
                        if (siop_cmd->status == CMDST_ACTIVE) {
                                if ((siop_cmd->xs->xs_control & XS_CTL_POLL)



Home | Main Index | Thread Index | Old Index