linux-mips
[Top] [All Lists]

Re: Removal of ____raw_readq() and ____raw_writeq() from asm-mips/io.h

To: Ladislav Michl <ladis@linux-mips.org>
Subject: Re: Removal of ____raw_readq() and ____raw_writeq() from asm-mips/io.h
From: Jes Sorensen <jes@wildopensource.com>
Date: 29 Jan 2004 05:35:47 -0500
Cc: Kevin Paul Herbert <kph@cisco.com>, linux-mips@linux-mips.org
In-reply-to: <20040128150828.A19525@linux-mips.org>
Original-recipient: rfc822;linux-mips@linux-mips.org
References: <1075255111.8744.4.camel@shakedown> <20040128094032.GB900@kopretinka> <yq07jzcz6sp.fsf@wildopensource.com> <20040128150828.A19525@linux-mips.org>
Sender: linux-mips-bounce@linux-mips.org
User-agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.2
>>>>> "Ladislav" == Ladislav Michl <ladis@linux-mips.org> writes:

Ladislav> On Wed, Jan 28, 2004 at 05:49:58AM -0500, Jes Sorensen
Ladislav> wrote:
>> If you are accessing memory mapped registers or memory on a PCI
>> device, ie. likely on a 1250, you *must* use the readX/__raw_readX
>> macros. Anybody just doing *reg = val on a PCI device should be
>> banned from writing code for life!

Ladislav> eh? I said nothing about PCI device. These ____raw_writeq
Ladislav> are used in board specific code. Anyway, defining struct
Ladislav> sb_registers and ioremaping it would be nice solution (I
Ladislav> didn't read code too carefully, so maybye not in this
Ladislav> particular case where registers are 64bit width, but I
Ladislav> definitely prefer it in board specific code over
Ladislav> read[bwl]/write[bwl]). Also readq/writeq seems mips
Ladislav> specific, so rants about portability doesn't apply.

Very wrong!

the readX/writeX macro names are for PCI and busses with similar
properties. One should never access anything through readX/writeX
without ioremaping it first.

readq/writeq are not mips specific, they are available on all/most 64
bit architectures, so portability rants do apply.

Jes

<Prev in Thread] Current Thread [Next in Thread>