From owner-svn-src-head@FreeBSD.ORG Fri Mar 26 12:56:03 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 811811065673; Fri, 26 Mar 2010 12:56:03 +0000 (UTC) (envelope-from netchild@freebsd.org) Received: from mail.ebusiness-leidinger.de (mail.ebusiness-leidinger.de [217.11.53.44]) by mx1.freebsd.org (Postfix) with ESMTP id 30B518FC19; Fri, 26 Mar 2010 12:56:02 +0000 (UTC) Received: from outgoing.leidinger.net (pD9E2C1F3.dip.t-dialin.net [217.226.193.243]) by mail.ebusiness-leidinger.de (Postfix) with ESMTPSA id 5B40F844054; Fri, 26 Mar 2010 13:36:21 +0100 (CET) Received: from webmail.leidinger.net (webmail.leidinger.net [192.168.1.102]) by outgoing.leidinger.net (Postfix) with ESMTP id EC412512C; Fri, 26 Mar 2010 13:36:17 +0100 (CET) Received: (from www@localhost) by webmail.leidinger.net (8.14.3/8.13.8/Submit) id o2QCaHXZ055211; Fri, 26 Mar 2010 13:36:17 +0100 (CET) (envelope-from netchild@FreeBSD.org) Received: from pslux.cec.eu.int (pslux.cec.eu.int [158.169.9.14]) by webmail.leidinger.net (Horde Framework) with HTTP; Fri, 26 Mar 2010 13:36:17 +0100 Message-ID: <20100326133617.34413032k064412c@webmail.leidinger.net> Date: Fri, 26 Mar 2010 13:36:17 +0100 From: Alexander Leidinger To: Kostik Belousov , Petr Salinger References: <201003261143.o2QBhFhK034688@svn.freebsd.org> <20100326114925.GS2415@deviant.kiev.zoral.com.ua> In-Reply-To: <20100326114925.GS2415@deviant.kiev.zoral.com.ua> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8; DelSp="Yes"; format="flowed" Content-Disposition: inline Content-Transfer-Encoding: 7bit User-Agent: Dynamic Internet Messaging Program (DIMP) H3 (1.1.4) X-EBL-MailScanner-Information: Please contact the ISP for more information X-EBL-MailScanner-ID: 5B40F844054.AF25A X-EBL-MailScanner: Found to be clean X-EBL-MailScanner-SpamCheck: not spam, spamhaus-ZEN, SpamAssassin (not cached, score=-1.363, required 6, autolearn=disabled, ALL_TRUSTED -1.44, TW_SV 0.08) X-EBL-MailScanner-From: netchild@freebsd.org X-EBL-MailScanner-Watermark: 1270211782.3622@cXXEANNTM9oCBNhXSYnK+A X-EBL-Spam-Status: No Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r205683 - head/sys/compat/linprocfs X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 26 Mar 2010 12:56:03 -0000 Quoting Kostik Belousov (from Fri, 26 Mar 2010 13:49:25 +0200): > On Fri, Mar 26, 2010 at 11:43:15AM +0000, Alexander Leidinger wrote: >> Author: netchild >> Date: Fri Mar 26 11:43:15 2010 >> New Revision: 205683 >> URL: http://svn.freebsd.org/changeset/base/205683 >> >> Log: >> Fix some bogus values in linprocfs. >> >> Submitted by: Petr Salinger >> Verified on: GNU/kFreeBSD debian 8.0-1-686 (by submitter) >> PR: 144584 >> >> Modified: >> head/sys/compat/linprocfs/linprocfs.c >> >> Modified: head/sys/compat/linprocfs/linprocfs.c >> ============================================================================== >> --- head/sys/compat/linprocfs/linprocfs.c Fri Mar 26 11:33:12 2010 (r205682) >> +++ head/sys/compat/linprocfs/linprocfs.c Fri Mar 26 11:43:15 2010 (r205683) >> @@ -110,13 +110,36 @@ __FBSDID("$FreeBSD$"); >> /* >> * Various conversion macros >> */ >> + >> +/* The LINUX_USER_HZ is assumed 100 for now */ >> + >> +#if defined(__i386__) && defined(__GNUCLIKE_ASM) >> +/* we need intermediate result as 64 bit, otherwise it overflows >> too early */ >> +#define DO64_MULDIV(v,m,d) \ >> +({ \ >> + unsigned long rv0; \ >> + unsigned long rv1; \ >> + __asm__ __volatile__( \ >> + "mull %1\n\t" \ >> + "divl %2\n\t" \ >> + :"=a" (rv0), "=d" (rv1) \ >> + :"r" (d), "0" (v), "1" (m) \ >> + :"cc" ); \ >> + rv0; \ >> +}) > > Why it is impossible to express the calculation in C ? You forgot to CC the submitter... CCed. What do you have in mind, (unsinged long)((uint64_t)v * (uint64_t)m / (uint64_t)d)? Conditionally on the architecture or not? Bye, Alexander. -- http://www.Leidinger.net Alexander @ Leidinger.net: PGP ID = B0063FE7 http://www.FreeBSD.org netchild @ FreeBSD.org : PGP ID = 72077137 When reviewing your notes before an exam, the most important ones will be illegible.