Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/dev/usb Replace evil pointer casts that cause unaligned ...
details: https://anonhg.NetBSD.org/src/rev/7fc674e702e2
branches: trunk
changeset: 755902:7fc674e702e2
user: tsutsui <tsutsui%NetBSD.org@localhost>
date: Sun Jun 27 11:53:59 2010 +0000
description:
Replace evil pointer casts that cause unaligned access panic on ARM and
MIPS with proper le16dec(9) and le32dec(9) functions for byte stream.
Now kue(4) works on hpcarm W-ZERO3.
diffstat:
sys/dev/usb/if_kuereg.h | 10 +++++-----
1 files changed, 5 insertions(+), 5 deletions(-)
diffs (27 lines):
diff -r 7fd813d02ff9 -r 7fc674e702e2 sys/dev/usb/if_kuereg.h
--- a/sys/dev/usb/if_kuereg.h Sun Jun 27 10:41:26 2010 +0000
+++ b/sys/dev/usb/if_kuereg.h Sun Jun 27 11:53:59 2010 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: if_kuereg.h,v 1.11 2001/01/21 02:35:31 augustss Exp $ */
+/* $NetBSD: if_kuereg.h,v 1.12 2010/06/27 11:53:59 tsutsui Exp $ */
/*
* Copyright (c) 1997, 1998, 1999, 2000
* Bill Paul <wpaul%ee.columbia.edu@localhost>. All rights reserved.
@@ -69,13 +69,13 @@
};
#define KUE_ETHERSTATS(x) \
- (*(u_int32_t *)&(x)->kue_desc.kue_etherstats)
+ le32dec((x)->kue_desc.kue_etherstats)
#define KUE_MAXSEG(x) \
- (*(u_int16_t *)&(x)->kue_desc.kue_maxseg)
+ le16dec((x)->kue_desc.kue_maxseg)
#define KUE_MCFILTCNT(x) \
- ((*(u_int16_t *)&(x)->kue_desc.kue_mcastfilt) & 0x7FFF)
+ (le16dec((x)->kue_desc.kue_mcastfilt) & 0x7FFF)
#define KUE_MCFILT(x, y) \
- (char *)&(sc->kue_mcfilters[y * ETHER_ADDR_LEN])
+ (uint8_t *)&(sc->kue_mcfilters[y * ETHER_ADDR_LEN])
#define KUE_STAT_TX_OK 0x00000001
#define KUE_STAT_RX_OK 0x00000002
Home |
Main Index |
Thread Index |
Old Index