Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S261595AbTI3NCI (ORCPT ); Tue, 30 Sep 2003 09:02:08 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S261542AbTI3NBI (ORCPT ); Tue, 30 Sep 2003 09:01:08 -0400 Received: from petasus.isw.intel.com ([192.55.37.196]:5371 "EHLO petasus.isw.intel.com") by vger.kernel.org with ESMTP id S261631AbTI3Mx1 (ORCPT ); Tue, 30 Sep 2003 08:53:27 -0400 Date: Tue, 30 Sep 2003 14:53:25 +0200 (CEST) From: Artur Klauser To: linux-kernel@vger.kernel.org Subject: Re: div64.h:do_div() bug - SPARC, SH anbody? In-Reply-To: Message-ID: References: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Got confirmation that ARM and CRIS experience the problem, pending info from folks with access to SPARC or SH architectures... anybody? -r2r- On Mon, 29 Sep 2003, Artur Klauser wrote: > I've found that a bug in asm-arm/div64.h:do_div() is preventing correct > conversion of timestamps in smbfs (and probably ntfs as well) from NT to > Unix format. I'll post a patch that fixes the bug, but I think it is also > present in other architectures - at least SPARC, SH, and CRIS look > suspicious. > > If people with access to these architectures could run the following small > test and let me know the outcome, I can fix it there too - thanks. > > //----------------------------------------------------------------------------- > #define __KERNEL__ > #include // get kernel definition of u64, u32 > #undef __KERNEL__ > #include // get definition of do_div() > #include > > main () { > union { > u64 n64; > u32 n32[2]; > } in, out; > > in.n32[0] = 1; > in.n32[1] = 1; > out = in; > > do_div(out.n64, 1); > > if (in.n64 != out.n64) { > printf("FAILURE: asm/div64.h:do_div() is broken for 64-bit dividends\n"); > exit(1); > } else { > printf("Congratulations: asm/div64.h:do_div() handles 64-bit dividends\n"); > } > return 0; > } > //----------------------------------------------------------------------------- - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/