Red Hat axp-list: Linux on Alpha (1995-2022)
 help / color / mirror / Atom feed
* yellowfin buglet
@ 1999-06-29  6:54 Richard Henderson
  1999-06-30 15:18 ` linux 2.2.10-ac5 Joel J. Maisenhelder
  0 siblings, 1 reply; 4+ messages in thread
From: Richard Henderson @ 1999-06-29  6:54 UTC (permalink / raw)
  To: becker; +Cc: axp-list, torvalds

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",


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

end of thread, other threads:[~1999-07-08 10:20 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
1999-06-29  6:54 yellowfin buglet Richard Henderson
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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox