From: Richard Henderson <rth@twiddle.net>
To: becker@cesdis1.gsfc.nasa.gov
Cc: axp-list@redhat.com, torvalds@transmeta.com
Subject: yellowfin buglet
Date: Mon, 28 Jun 1999 23:54:28 -0700 [thread overview]
Message-ID: <19990628235428.A380@twiddle.net> (raw)
The answer to the comment's question is no. Pre-ev56, loading an
unaligned 16-bit quantity will silently fail if addr & 7 == 7. There
will be no unaligned trap to fix up.
With an ev56, we'll use the ldwu instruction, which does trap,
which is how I noticed.
r~
--- drivers/net/yellowfin.c.orig Mon Jun 28 23:43:36 1999
+++ drivers/net/yellowfin.c Mon Jun 28 23:44:38 1999
@@ -76,6 +76,7 @@ static int full_duplex[MAX_UNITS] = {-1,
#include <linux/pci.h>
#include <asm/processor.h> /* Processor type for cache alignment. */
#include <asm/bitops.h>
+#include <asm/unaligned.h>
#include <asm/io.h>
#include <linux/netdevice.h>
@@ -1054,7 +1055,7 @@ static int yellowfin_rx(struct device *d
u16 desc_status = desc->status;
int data_size = desc->request_cnt - desc->result_cnt;
u8 *buf_addr = bus_to_virt(desc->addr);
- s16 frame_status = *(s16*)&(buf_addr[data_size - 2]); /* ?Alpha safe on 885? */
+ s16 frame_status = get_unaligned((s16*)(buf_addr+data_size-2));
if (yellowfin_debug > 4)
printk(KERN_DEBUG " yellowfin_rx() status was %4.4x.\n",
next reply other threads:[~1999-07-08 10:20 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
1999-06-29 6:54 Richard Henderson [this message]
1999-06-30 15:18 ` linux 2.2.10-ac5 Joel J. Maisenhelder
1999-06-30 15:38 ` Dr. David Gilbert
1999-06-30 19:22 ` Tuff Guy
read-only archive
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox