public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* mmap not working?
@ 2001-11-16 21:34 Rogier Wolff
  2001-11-16 22:10 ` H. Peter Anvin
  0 siblings, 1 reply; 5+ messages in thread
From: Rogier Wolff @ 2001-11-16 21:34 UTC (permalink / raw)
  To: Linux kernel mailing list


Hi,

I want to mmap a device in an application, so I do: 

	base = mmap(NULL ,  DEV_LENGTH,  myprot , flags, kmem, dev_base); 

Turns out that some BIOSs put my device at an address like

	0xdffffc00

whereas others put it at 0xfa000000 . In the latter case, mmap works
as expected. However in the first case I get EINVAL: The base is
not page-aligned. 

However, in the latter case I get my requested 1k of memory, and the
following 3k for free. In the first case I'd want "3k for free,
followed by the 1k I requested".

effectively, provided "start" equals NULL, the kernel IMHO should:

	offset = dev_base & PAGE_MASK; 
	return mmap (NULL, length+offset, prot, flags, base - offset) + offset; 
Comments?

The "failure" was observed on 2.4.14 and/or 2.4.9. 

		Roger. 


P.S. I end up not being able to closely follow linux-kernel
lately. CCs to me appreciated.

-- 
** R.E.Wolff@BitWizard.nl ** http://www.BitWizard.nl/ ** +31-15-2137555 **
*-- BitWizard writes Linux device drivers for any device you may have! --*
* There are old pilots, and there are bold pilots. 
* There are also old, bald pilots. 

^ permalink raw reply	[flat|nested] 5+ messages in thread
[parent not found: <3BF623B7.1050607@zytor.com>]

end of thread, other threads:[~2001-11-17 19:06 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2001-11-16 21:34 mmap not working? Rogier Wolff
2001-11-16 22:10 ` H. Peter Anvin
     [not found] <3BF623B7.1050607@zytor.com>
2001-11-17  9:07 ` Rogier Wolff
2001-11-17 18:38   ` Rik van Riel
2001-11-17 18:47   ` Eric W. Biederman

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox