From mboxrd@z Thu Jan 1 00:00:00 1970 From: James Hogan Subject: Re: [PATCH 01/25] asm-generic: Change time_t and clock_t to 64 bit Date: Tue, 13 May 2014 11:22:22 +0100 Message-ID: <5371F25E.6020805@imgtec.com> References: <1399971456-3941-1-git-send-email-lftan@altera.com> <1399971749-4004-1-git-send-email-lftan@altera.com> <5371EAEB.5030100@imgtec.com> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: Sender: linux-kernel-owner@vger.kernel.org To: Ley Foon Tan Cc: Linux-Arch , LKML , Chung-Lin Tang , Arnd Bergmann , Thomas Gleixner List-Id: linux-arch.vger.kernel.org On 13/05/14 11:17, Ley Foon Tan wrote: > On Tue, May 13, 2014 at 5:50 PM, James Hogan wrote: >> Hi, >> >> On 13/05/14 10:32, Ley Foon Tan wrote: >>> On Tue, May 13, 2014 at 5:15 PM, James Hogan wrote: >>>> On 13 May 2014 10:02, Ley Foon Tan wrote: >>>>> /* >>>>> + * Use 64 bit time_t and clock_t as default. 32 bit users can provide an override to >>>>> + * define these as "long" if needed. >>>>> + */ >>>>> +#ifndef __kernel_time_t >>>>> +typedef long long __kernel_time_t; >>>>> +#endif >>>>> + >>>>> +#ifndef __kernel_clock_t >>>>> +typedef long long __kernel_clock_t; >>>>> +#endif >>>> >>>> I think having this as the first patch in the series will break >>>> bisection for existing 32-bit arches. This needs to be done in such a >>>> way that at no intermediate commit are __kernel_time_t or >>>> __kernel_clock_t the wrong size for existing arches, e.g. by having a >>>> first patch which makes the typedefs conditional but leaves them as >>>> __kernel_long_t, and a final patch that changes the default after all >>>> the arches have got their overrides in place. >>> >>> Your suggestion is something as below? >> >> Yeh, although I like Thomas' idea better, then each existing 32-bit arch >> can just select the Kconfig symbol to get the smaller type. >> >> IIRC Kconfig won't even complain if you select a symbol which doesn't >> exist yet. > When we export this posix_types.h file for user software, they need to > define this config, eg: CONFIG_32BIT_TIME to use 32 bit time. Is this > what we want to do? Yeh, good point, that won't work. Cheers James From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mailapp01.imgtec.com ([195.59.15.196]:33157 "EHLO mailapp01.imgtec.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1759324AbaEMKWh (ORCPT ); Tue, 13 May 2014 06:22:37 -0400 Message-ID: <5371F25E.6020805@imgtec.com> Date: Tue, 13 May 2014 11:22:22 +0100 From: James Hogan MIME-Version: 1.0 Subject: Re: [PATCH 01/25] asm-generic: Change time_t and clock_t to 64 bit References: <1399971456-3941-1-git-send-email-lftan@altera.com> <1399971749-4004-1-git-send-email-lftan@altera.com> <5371EAEB.5030100@imgtec.com> In-Reply-To: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit Sender: linux-arch-owner@vger.kernel.org List-ID: To: Ley Foon Tan Cc: Linux-Arch , LKML , Chung-Lin Tang , Arnd Bergmann , Thomas Gleixner Message-ID: <20140513102222.Rf8j25rSNkWrVezPecsM08UDSBtE_y35PrVuumbJTLo@z> On 13/05/14 11:17, Ley Foon Tan wrote: > On Tue, May 13, 2014 at 5:50 PM, James Hogan wrote: >> Hi, >> >> On 13/05/14 10:32, Ley Foon Tan wrote: >>> On Tue, May 13, 2014 at 5:15 PM, James Hogan wrote: >>>> On 13 May 2014 10:02, Ley Foon Tan wrote: >>>>> /* >>>>> + * Use 64 bit time_t and clock_t as default. 32 bit users can provide an override to >>>>> + * define these as "long" if needed. >>>>> + */ >>>>> +#ifndef __kernel_time_t >>>>> +typedef long long __kernel_time_t; >>>>> +#endif >>>>> + >>>>> +#ifndef __kernel_clock_t >>>>> +typedef long long __kernel_clock_t; >>>>> +#endif >>>> >>>> I think having this as the first patch in the series will break >>>> bisection for existing 32-bit arches. This needs to be done in such a >>>> way that at no intermediate commit are __kernel_time_t or >>>> __kernel_clock_t the wrong size for existing arches, e.g. by having a >>>> first patch which makes the typedefs conditional but leaves them as >>>> __kernel_long_t, and a final patch that changes the default after all >>>> the arches have got their overrides in place. >>> >>> Your suggestion is something as below? >> >> Yeh, although I like Thomas' idea better, then each existing 32-bit arch >> can just select the Kconfig symbol to get the smaller type. >> >> IIRC Kconfig won't even complain if you select a symbol which doesn't >> exist yet. > When we export this posix_types.h file for user software, they need to > define this config, eg: CONFIG_32BIT_TIME to use 32 bit time. Is this > what we want to do? Yeh, good point, that won't work. Cheers James