On Fri, Nov 07, 2008 at 01:59:36AM +0100, Uwe Hermann wrote: > Hi, > > I've updated the OpenOCD Debian package to r1130 yesterday, and the > Debian autobuild daemons found a compile problem with ep93xx on the > 'armel' architecture, see > > http://buildd.debian.org/fetch.cgi?pkg=openocd;ver=0.0%2Br1130-1;arch=armel;stamp=1225973025 > > The problem is how nanosleep() is being called. I'm actually surprised > that it ever worked and doesn't break on other architectures. > > My Linux nanosleep(2) manpage says this: > > #include <time.h> > int nanosleep(const struct timespec *req, struct timespec *rem); > > The /usr/include/time.h file says: > > extern int nanosleep (__const struct timespec *__requested_time, > struct timespec *__remaining); > > However, in src/jtag/ep93xx.c nanosleep() is always called as > > struct timespec ep93xx_zzzz; > nanosleep(ep93xx_zzzz); > > which doesn't really work, as (a) the first argument should be a > pointer (not a struct), and (b) there are two arguments, not only one. > > The fix is probably: > > nanosleep(&ep93xx_zzzz, NULL); > > > See attached patch for a fix. I've tested it on an ARM box and confirmed > that it really fixes the compile.
*ping* Can somebody please review/commit this patch? Thanks! > HTH, Uwe. > -- > http://www.hermann-uwe.de | http://www.holsham-traders.de > http://www.crazy-hacks.org | http://www.unmaintained-free-software.org > Index: src/jtag/ep93xx.c > =================================================================== > --- src/jtag/ep93xx.c (Revision 1142) > +++ src/jtag/ep93xx.c (Arbeitskopie) > @@ -40,6 +40,7 @@ > #include <sys/mman.h> > #include <unistd.h> > #include <fcntl.h> > +#include <time.h> > > static u8 output_value = 0x0; > static int dev_mem_fd; > @@ -103,7 +104,7 @@ > output_value &= TDI_BIT; > > *gpio_data_register = output_value; > - nanosleep(ep93xx_zzzz); > + nanosleep(&ep93xx_zzzz, NULL); > } > > /* (1) assert or (0) deassert reset lines */ > @@ -120,7 +121,7 @@ > output_value &= SRST_BIT; > > *gpio_data_register = output_value; > - nanosleep(ep93xx_zzzz); > + nanosleep(&ep93xx_zzzz, NULL); > } > > int ep93xx_speed(int speed) > @@ -218,7 +219,7 @@ > */ > output_value = TMS_BIT | TRST_BIT | SRST_BIT | VCC_BIT; > *gpio_data_register = output_value; > - nanosleep(ep93xx_zzzz); > + nanosleep(&ep93xx_zzzz, NULL); > > /* > * Configure the direction register. 1 = output, 0 = input. > @@ -226,7 +227,7 @@ > *gpio_data_direction_register = > TDI_BIT | TCK_BIT | TMS_BIT | TRST_BIT | SRST_BIT | VCC_BIT; > > - nanosleep(ep93xx_zzzz); > + nanosleep(&ep93xx_zzzz, NULL); > return ERROR_OK; > } > > _______________________________________________ > Openocd-development mailing list > Openocd-development@lists.berlios.de > https://lists.berlios.de/mailman/listinfo/openocd-development -- http://www.hermann-uwe.de | http://www.holsham-traders.de http://www.crazy-hacks.org | http://www.unmaintained-free-software.org _______________________________________________ Openocd-development mailing list Openocd-development@lists.berlios.de https://lists.berlios.de/mailman/listinfo/openocd-development