From: Jun Sun <jsun@mvista.com>
To: "Maciej W. Rozycki" <macro@ds2.pg.gda.pl>
Cc: Guido Guenther <guido.guenther@gmx.net>, linux-mips@oss.sgi.com
Subject: Re: Should /dev/kmem support above 0x80000000 area?
Date: Tue, 12 Dec 2000 10:53:48 -0800 [thread overview]
Message-ID: <3A36743C.77A7651E@mvista.com> (raw)
In-Reply-To: Pine.GSO.3.96.1001212121526.9082A-100000@delta.ds2.pg.gda.pl
"Maciej W. Rozycki" wrote:
>
> On Mon, 11 Dec 2000, Jun Sun wrote:
>
> > I see. It is funny that you cannot read/write memory beyond high_memory
> > through /dev/mem, but you can re-map it and then read/write through the
> > remapped region.
>
> I see it consistent. The system memory can be treated like a stream of
> bytes. That's much like any random-access file. Other devices do not
> necessarily exhibit this behaviour. They may implement side effects,
> values read may be different from what was written previously. You may
> even achieve different effects by performing transfers of different
> widths.
>
> > How do you control the width of bus transfers? If you have direct access to
> > the device memory, the userland "drivers" should be able to deal with the bus
> > access width correctly.
>
> If you declare a location int32_t, gcc will perform a 32-bit access on
> assignment (lw/sw for MIPS). If you declare a location int16_t, gcc will
> perform a 16-bit access (lh/sh for MIPS). Ditto for int8_t (and for
> int64_t for 64-bit configurations). Names of types do not matter, of
> course, sizeof -- does. I just used the ISO C portable names for
> fixed-size types. Please note you might need to use the "volatile"
> keyword or gcc might reorder or even optimize out certain accesses.
>
I see the point now. It is not such a good idea to map IO memory through a
file API, especially given that we have a working /dev/mem.
Ralf, I "officially" retract my previous patch.
Jun
next prev parent reply other threads:[~2000-12-12 19:06 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2000-12-08 3:13 Should /dev/kmem support above 0x80000000 area? Jun Sun
2000-12-08 23:32 ` Ralf Baechle
2000-12-11 11:28 ` Maciej W. Rozycki
2000-12-11 12:41 ` Guido Guenther
2000-12-12 2:26 ` Jun Sun
2000-12-11 18:56 ` Guido Guenther
2000-12-11 19:05 ` Maciej W. Rozycki
2000-12-12 6:16 ` Jun Sun
2000-12-12 11:58 ` Maciej W. Rozycki
2000-12-12 18:53 ` Jun Sun [this message]
2000-12-12 7:38 ` Jun Sun
2000-12-12 13:23 ` Maciej W. Rozycki
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=3A36743C.77A7651E@mvista.com \
--to=jsun@mvista.com \
--cc=guido.guenther@gmx.net \
--cc=linux-mips@oss.sgi.com \
--cc=macro@ds2.pg.gda.pl \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox