Subject: Bogus asm in bus.h (mac68k-specific)
To: #List NetBSD current users <>
From: Paul Goyette <>
List: current-users
Date: 12/28/1998 06:30:17
For all of you who've been having all sorts of wierd crashes (ie, bus
errors or memory corruption or vm faults), I've found at least one

The mac68k version of bus.h defines several macros that read/write/copy
regions of bus_space.  Each of these macros has a count as one of its
arguments.  The macros expand into inline assembly code which treats the
count as a 32-bit integer.

Unfortunately, there are other places where these macros are invoked
with count argument of some other size.  For example, in routine
dp8390_ring_copy() a u_short is passed.  The inline assembly expansion
simply takes the u_short value and moves it into a register _without
clearing the high-order bits_!!  So, depending on what was previously
there, all sorts of wierd stuff can happen.

I've filed PR#mac68k/6665 which includes a patch to bus.h - if you're
seeing these kinds of crashes, you might want to give this a try.

| Paul Goyette      | PGP DSS Key fingerprint:   | E-mail addresses:        |
| Network Engineer  |   BCD7 5301 9513 58A6 0DBC |       |
| and kernel hacker |   91EB ADB1 A280 3B79 9221 | |