[syslinux] pxelinux/mboot confused about e820 memory maps on HP Proliant BIOS's

Michael Walker Michael.Walker at cassatt.com
Fri May 26 06:53:49 PDT 2006

H. Peter Anvin wrote:
> CLK_TCK and CLOCKS_PER_SEC reflect different things.  That part of the 
> patch is definitely wrong.  The current code should have a fallback for 
> CLK_TCK for host mode.
>     -hpa

Well - the important change in my diffs are the mboot one, so let's not
loose that.  That get's us around a bug/feature found in HP (and other) BIOS's.

The CLK_TCK was was just trying to solve that on FC5 the syslinux
build fails with the following:

[root at shasta libutil]# make
gcc -I./include -W -Wall -O -g -c -o get_key.lo get_key.c
get_key.c:57: warning: pointer targets in initialization differ in signedness
get_key.c:58: warning: pointer targets in initialization differ in signedness
get_key.c: In function ‘get_key’:
get_key.c:140: error: ‘CLK_TCK’ undeclared (first use in this function)
get_key.c:140: error: (Each undeclared identifier is reported only once
get_key.c:140: error: for each function it appears in.)
make: *** [get_key.lo] Error 1
[root at shasta libutil]#

If you'd like to more clearly define what you mean by a
'fallback' in 'host mode' I'd be happy to take a stab at
it.  If this is a fix that is obvious to you and you've got
it covered - then no worries.

I always get very confused when we start talking about POSIC, ANSI and
other whatnot in header files - but on the FC5 headers I see:

If I look in /usr/include/bits/time.h I see:
/* ISO/IEC 9899:1990 7.12.1: <time.h>
   The macro `CLOCKS_PER_SEC' is the number per second of the value
   returned by the `clock' function. */
/* CAE XSH, Issue 4, Version 2: <time.h>
   The value of CLOCKS_PER_SEC is required to be 1 million on all
   XSI-conformant systems. */
#  define CLOCKS_PER_SEC  1000000l

#  if !defined __STRICT_ANSI__ && !defined __USE_XOPEN2K
/* Even though CLOCKS_PER_SEC has such a strange value CLK_TCK
   presents the real value for clock ticks per second for the system.  */
#   include <bits/types.h>
extern long int __sysconf (int);
#   define CLK_TCK ((__clock_t) __sysconf (2))  /* 2 is _SC_CLK_TCK */
#  endif

And in /usr/include/time.h I see:

/* This is the obsolete POSIX.1-1988 name for the same constant.  */
# if !defined __STRICT_ANSI__ && !defined __USE_XOPEN2K
#  ifndef CLK_TCK
#   define CLK_TCK      CLOCKS_PER_SEC
#  endif
# endif

It could be that this issue arises because gcc4.1 is the default
compiler on FC5 - not sure.  A quick test program confirms that
__USE_XOPEN2K is defined by default and hence the failure.



More information about the Syslinux mailing list