lkml.org 
[lkml]   [1998]   [Dec]   [18]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: ioremap() address alignment problem
Hello,

> When I do vremap(0xf420 1400), I get an error. So I try a range of addresses
> around (from 0xf420 1000 to 0xf420 1000 + 5000), and it seems like vremap()
> only works for page aligned addresses. Is it normal ?

In 2.0.x kernels vremap() works only for page-aligned addresses (2.1.x
ioremap() has been patched recently to allow non-aligned ones). Either
call turn vremap(x) to (x & (PAGE_SIZE-1)) | vremap(x & ~(PAGE_SIZE-1))
or modify vremap() to do this automatically.

[Note to Alan: I think we should modify vremap() in 2.0 to handle
this automatically since there are BIOSes which don't page-align
base addresses (not a bug, only a rare feature) and it could bite
even for usual devices.]

Have a nice fortnight
--
Martin `MJ' Mares <mj@ucw.cz> http://atrey.karlin.mff.cuni.cz/~mj/
Faculty of Math and Physics, Charles University, Prague, Czech Rep., Earth
"The number of UNIX installations has grown to 10, with more expected. (6/72)"

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 13:46    [W:0.769 / U:0.476 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site