--- In Jim Jackson <> wrote:
>
>
>
>
> On Sun, 31 May 2009, naturalwatt wrote:
>
> > --- In "j.chitte" <j.chitte@> wrote:
> >>
> >> Hi,
> >>
> >> I'm trying to recompile something based on Jim Jackson's adc_logger with
> >> an upto date toolchain. I get:
> >>
> >> implicit declaration of function 'getpagesize'
> >>
> >> the offending line being:
> >>
> >> #define IOMMAP(A) (mmap(0,getpagesize(),PROT_READ|PROT_WRITE, MAP_SHARED,
> >> iofd,A))
> >> ...
> >> adc_io_cntl=(unsigned char *)IOMMAP(0x22400000);
> >> if ( ! (*adc_io_cntl & 1) ) { return(ENXIO); }
> >>
> >> adc_io_cntl=(unsigned char *)IOMMAP(0x10c00000);
> >> adc_io_stat=(unsigned short *)IOMMAP(0x10800000);
> >> adc_io_read=(unsigned short *)IOMMAP(0x10c00000);
> >>
> >>
> >> This function seems to have disappeared and I'm not sure what to replace
> >> it with since I was not sure why such a large value was used.
> >>
> >> Can someone suggest a fix?
> >>
> > I use code like that, and assume you need #include <sys/mman.h> in there,
> > although the man page for getpagesize says it is in unistd.h.
> >
> > Martin
> >
> > ps - I'm still using a 2.4 environment.
>
> Jacques,
>
> In the man pages for my reasonably uptodate x86 development environment,
> the manpage for getpagesize does in fact say to include unistd.h
> Unfortunately adc_logger doesn't - so add a suitable #include and it should
> go. I've not compiled it for anything other than the TS 2.4 setups.
>
> I've just added
>
> #include <unistd.h>
>
> before the include stdio.h and it still compiles fine in my cross
> compilation setup for the TS on board 2.4 image.
>
> cheers
> Jim
>
Thanks Jim,
in fact I'd already added that line but found it was not needed for 2.4 with
the cronky old Sarge toolchain, so I commented it out. For some reason I had
not uncommented it when rebuilding for 2.6 with a recent gcc. Dumb question ,
sorry for noise.
------------------------------------
Yahoo! Groups Links
<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/ts-7000/
<*> Your email settings:
Individual Email | Traditional
<*> To change settings online go to:
http://groups.yahoo.com/group/ts-7000/join
(Yahoo! ID required)
<*> To change settings via email:
<*> To unsubscribe from this group, send an email to:
<*> Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/
|