Re: mmap() with an offset > 32 bits on a 32-bit CPU

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 08:18 Sat 28 Jun     , Abdul Basit wrote:
> Michael Blizek wrote:
> > On 00:10 Sat 28 Jun     , Abdul Basit wrote:
> >   
> >> Hi Folks,
> >>
> >>     I am trying to bring Xorg 7.x on PowerPC 440EPx Sequoia board, X is
> >> configured to use sisfb for video and the sisfb is loaded properly in
> >> kernel and registered as fb0, running X causes a machine check exception
> >> / BUS error by kernel.
> >>

...

> >> the pci I/O memory in my case is 36-bits but the CPU is 32-bits so the
> >> ioBase_phys is getting truncated as long is 32-bits and when later X try
> >> to write to this address causes a BUS error.
> >>
> >> Since i know the ioBase_phys address which is 0x1E8000000, I could hard
> >> code it but the mmap(..) offset size is 32-bits as well, so I could not
> >> pass it as an offset.
> >>
> >> How would i pass a large offset to mmap on PPC32? is there any other way
> >> to do it?
> >>     
> >
> > You can call mmap2 if the offset is a multiply of 4096. (see the manpage)
> > 	-Michi
> >   
> The type for offset in both mmap() and mmap2() if off_t which is
> sizeof(off_t) = 4, infact i can not find mmap2 for powerpc in uclibc,
> there is mmap()
> which takes __off_t and mmap64() which takes __off64_t but that is only
> enabled
> if you use __FILE_OFFSET_SIZE=64 which i do not know if i turn it on
> what are the consequences?
> also internally mmap64() truncates the off64_t to off_t and a comment in
> there
> to implement architecture specific code in there.
> 
> 
> Thanks,
> ~basit

http://www.uclibc.org/cgi-bin/viewcvs.cgi/trunk/uClibc/include/sys/mman.h?rev=22198&view=auto
Seems like uclibc does not have mmap2. You can try to copy the mmap2 of
glibc somewhere into your project.
	-Michi
-- 
programing a layer 3+4 network protocol for mesh networks
see http://michaelblizek.twilightparadox.com


--
To unsubscribe from this list: send an email with
"unsubscribe kernelnewbies" to ecartis@xxxxxxxxxxxx
Please read the FAQ at http://kernelnewbies.org/FAQ


[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux