This is the mail archive of the newlib@sourceware.org mailing list for the newlib project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH, RTEMS] Fix CLOCKS_PER_SEC


Hi Gedera,

On Mar  3 11:24, Gedare Bloom wrote:
> RTEMS use of _SC_CLK_TCK for CLOCKS_PER_SEC is broken [1]. Attached
> patch makes RTEMS use the constant value of 1000000 like Linux and
> BSD.
> 
> Gedare
> 
> [1] https://devel.rtems.org/ticket/2182

> 2015-02-25  Gedare Bloom  <gedare@rtems.org>
> 
> 	* libc/include/machine/time.h (_CLOCKS_PER_SEC_): redefine for RTEMS.

> From bf650325848624a2b680a3cbe759e77616f84c9c Mon Sep 17 00:00:00 2001
> From: Gedare Bloom <gedare@rtems.org>
> Date: Wed, 25 Feb 2015 14:47:58 -0500
> Subject: [PATCH] rtems: fix CLOCKS_PER_SEC
> 
> ---
>  newlib/libc/include/machine/time.h | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/newlib/libc/include/machine/time.h b/newlib/libc/include/machine/time.h
> index 3057c81..2880e71 100644
> --- a/newlib/libc/include/machine/time.h
> +++ b/newlib/libc/include/machine/time.h
> @@ -2,7 +2,7 @@
>  #define	_MACHTIME_H_
>  
>  #if defined(__rtems__)
> -#define _CLOCKS_PER_SEC_  sysconf(_SC_CLK_TCK)
> +#define _CLOCKS_PER_SEC_ 1000000
>  #elif defined(__aarch64__) || defined(__arm__) || defined(__thumb__)
>  #define _CLOCKS_PER_SEC_ 100
>  #elif defined (__VISIUM__)

The __VISUM__ branch already defines _CLOCKS_PER_SEC_ as 1000000.
Please merge the __rtems__ brach with the __VISUM__ branch.

With that change, the patch is ok.


Thanks,
Corinna

-- 
Corinna Vinschen
Cygwin Maintainer
Red Hat

Attachment: pgpXXuu1vPDLH.pgp
Description: PGP signature


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]