Source-Changes-HG archive

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

[src/trunk]: src/sys/dev/marvell Support big endian machines.



details:   https://anonhg.NetBSD.org/src/rev/274f17ab91f9
branches:  trunk
changeset: 755506:274f17ab91f9
user:      kiyohara <kiyohara%NetBSD.org@localhost>
date:      Tue Jun 08 05:15:52 2010 +0000

description:
Support big endian machines.

diffstat:

 sys/dev/marvell/gtidmacreg.h |  17 ++++++++++++++++-
 1 files changed, 16 insertions(+), 1 deletions(-)

diffs (38 lines):

diff -r 0f320874bf50 -r 274f17ab91f9 sys/dev/marvell/gtidmacreg.h
--- a/sys/dev/marvell/gtidmacreg.h      Tue Jun 08 05:06:10 2010 +0000
+++ b/sys/dev/marvell/gtidmacreg.h      Tue Jun 08 05:15:52 2010 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: gtidmacreg.h,v 1.1 2010/04/28 13:51:56 kiyohara Exp $  */
+/*     $NetBSD: gtidmacreg.h,v 1.2 2010/06/08 05:15:52 kiyohara Exp $  */
 /*
  * Copyright (c) 2008, 2009 KIYOHARA Takashi
  * All rights reserved.
@@ -226,6 +226,7 @@
 
 
 struct gtidmac_desc {
+#if BYTE_ORDER == LITTLE_ENDIAN
        union {
                struct {
                        uint16_t rbc;   /* Remind BC */
@@ -238,6 +239,20 @@
        uint32_t srcaddr;       /* Source Address */
        uint32_t dstaddr;       /* Destination Address */
        uint32_t nextdp;        /* Next Descriptor Pointer */
+#else
+       uint32_t srcaddr;       /* Source Address */
+       union {
+               struct {
+                       uint16_t rbc;   /* Remind BC */
+                       uint16_t bcnt;
+               } mode64k;
+               struct {
+                       uint32_t bcnt;
+               } mode16m;
+       } bc;                   /* Byte Count */
+       uint32_t nextdp;        /* Next Descriptor Pointer */
+       uint32_t dstaddr;       /* Destination Address */
+#endif
 } __packed;
 
 #define GTIDMAC_DESC_BYTECOUNT_MASK    0x00ffffff



Home | Main Index | Thread Index | Old Index