From owner-freebsd-alpha Mon Nov 23 12:34:07 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id MAA13251 for freebsd-alpha-outgoing; Mon, 23 Nov 1998 12:34:07 -0800 (PST) (envelope-from owner-freebsd-alpha@FreeBSD.ORG) Received: from nomis.simon-shapiro.org (nomis.simon-shapiro.org [209.86.126.163]) by hub.freebsd.org (8.8.8/8.8.8) with SMTP id MAA13192 for ; Mon, 23 Nov 1998 12:34:01 -0800 (PST) (envelope-from shimon@simon-shapiro.org) Received: (qmail 52759 invoked by uid 1000); 23 Nov 1998 21:38:09 -0000 Message-ID: X-Mailer: XFMail 1.3 [p0] on FreeBSD X-Priority: 3 (Normal) Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 8bit MIME-Version: 1.0 Date: Mon, 23 Nov 1998 16:38:09 -0500 (EST) X-Face: (&r=uR0&yvh>h^ZL4"-TH61PD}/|Y'~58Z# Gz&BK'&uLAf:2wLb~L7YcWfau{;N(#LR2)\i.l8'ZqVhv~$rNx$]Om6Sv36S'\~5m/U'"i/L)&t$R0&?,)tm0l5xZ!\hZU^yMyCdt!KTcQ376cCkQ^Q_n.GH;Dd-q+ O51^+.K-1Kq?WsP9;cw-Ki+b.iY-5@3!YB5{I$h;E][Xlg*sPO61^5=:5k)JdGet,M|$"lq!1!j_>? $0Yc? Reply-To: shimon@simon-shapiro.org Organization: The Simon Shapiro Foundation From: Simon Shapiro To: freebsd-alpha@FreeBSD.ORG Subject: UnAligned Access, but why? Sender: owner-freebsd-alpha@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org Am trying to get the DPT driver running on alpha. Narrowed down the problem to this: In sys/alpha/include/bus.h there is a series of static inline functions to do the equivalient of inb, inw, and inl, as well as outb, outw, outl. they are called bus_space_{read,write}_[124]. The bus_space_read_[14] are causing unaligned access panics. These panics can be eliminated by casting explicitly: return (inb((u_int32_t)(handle + offset))); and return (inl((u_int32_t)(handle + offset))); However, bus_space_write_[14] will panic on unaligned access even when modified to be: outb((u_int32_t)(bsh + offset), (u_int8_t)value); and outl((u_int32_t)(bsh + offset), (u_int32_t)value); I even tried to modify bus_space_write_4 to be: /* static __inline void */ void bus_space_write_4(bus_space_tag_t tag, bus_space_handle_t bsh, bus_size_t offset, u_int32_t value) { #if defined(_ALPHA_BUS_PIO_H_) #if defined(_ALPHA_BUS_MEMIO_H_) if (tag == ALPHA_BUS_SPACE_IO) #endif { u_int32_t port, data; port = (u_int32_t)bsh + (u_int32_t)offset; data = (u_int32_t)value; outl(port, data); } #endif #if defined(_ALPHA_BUS_MEMIO_H_) #if defined(_ALPHA_BUS_PIO_H_) else #endif writel(bsh + offset, value); #endif } I.E made the function non static, not inline and copied the values to local variables before doing the outl thing. The panic occurs right at the outl line. I can get the kernel to printf exactly to that point. Any help will be appreciated. I tried to trace the functions but end at the chipset structure. IS there a set of functions in ROM that is mapped in this manner? Simon To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-alpha" in the body of the message