[fpc-pascal] fpmmap arm-linux issue

Jonas Maebe jonas at freepascal.org
Sat Feb 1 17:46:52 CET 2020


On 31/01/2020 22:17, Fabio Luis Girardi via fpc-pascal wrote:
> In C: 
> 
> CM_BaseAddr = mmap(NULL, 0x4000, PROT_READ | PROT_WRITE,               
>         MAP_SHARED,  devmemfd, *0x44e00000*); 
> 
> to get the "same" code working in FPC I have to change some constants.
> 
> CM_BaseAddr := Fpmmap(NULL, $4000, PROT_READ + PROT_WRITE,             
>           MAP_SHARED,  devmemfd, *$44e00*); 
> 
> I did a strace in the FPC executable, and the in line above, the base
> address is "multiplied" by 4096 dec ($1000 hex)  becoming back equal to
> the C constant.
> 
> The question is: this is intentional? Has some technical point that's
> not mentioned on the fpmmap documentation? Or it's simply a bug?

It sounds like a bug. I don't see anything in the RTL that intentially
does this.


Jonas


More information about the fpc-pascal mailing list