From: Andrew Morton <akpm@osdl.org>
To: Bernardo Innocenti <bernie@develer.com>
Cc: george@mvista.com, linux-kernel@vger.kernel.org, akpm@zip.com.au,
rmk@arm.linux.org.uk, torvalds@osdl.org
Subject: Re: do_div64 generic
Date: Mon, 14 Jul 2003 22:38:05 -0700 [thread overview]
Message-ID: <20030714223805.4e5bee3f.akpm@osdl.org> (raw)
In-Reply-To: <200307150717.54981.bernie@develer.com>
Bernardo Innocenti <bernie@develer.com> wrote:
>
> I see. do_div() which updates the dividend in-place did not quite apply
> to the usage pattern of the new timer code.
This is getting silly. The timer stuff has been an ongoing bug factory and
now it is colluding with the do_div() saga.
Can we just get the things working, without mangling every architecture
again?
> > The using code tests for the existance of div_long_long_rem and uses
> > the longer do_div() if it does not exist.
> >
> > Could you consider adding this to the generic code?
> >
> > /*
> > * (long)X = ((long long)divs) / (long)div
> > * (long)rem = ((long long)divs) % (long)div
> > *
> > * Warning, this will do an exception if X overflows.
> > */
> > #define div_long_long_rem(a,b,c) div_ll_X_l_rem(a,b,c)
> >
> > extern inline long
> > div_ll_X_l_rem(long long divs, long div, long *rem)
> > {
> > long dum2;
> > __asm__("divl %2":"=a"(dum2), "=d"(*rem)
> >
> > : "rm"(div), "A"(divs));
> >
> > return dum2;
> >
> > }
>
> Here's a patch that takes care of all architectures.
AFAICT, we can just rework posix-timers.c to use the standard do_div() and
be done with it, can we not? ie: no div_long_long_rem(), no
div_ll_X_l_rem(). Just do_div().
Please use `static inline', not `extern inline', btw.
next prev parent reply other threads:[~2003-07-15 5:23 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <3F1360F4.2040602@mvista.com>
2003-07-15 5:17 ` do_div64 generic Bernardo Innocenti
2003-07-15 5:38 ` Andrew Morton [this message]
2003-07-15 6:23 ` Bernardo Innocenti
2003-07-15 6:30 ` Andrew Morton
2003-07-15 21:52 ` george anzinger
2003-07-15 22:06 ` Andrew Morton
2003-07-16 0:07 ` george anzinger
2003-07-16 18:33 ` Bernardo Innocenti
2003-07-17 21:10 ` Bernardo Innocenti
2003-07-17 21:16 ` Andrew Morton
2003-07-17 22:43 ` Bernardo Innocenti
2003-07-17 23:10 ` george anzinger
2003-07-18 3:19 ` Andrew Morton
2003-07-18 4:14 ` Bernardo Innocenti
2003-07-17 23:09 ` george anzinger
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20030714223805.4e5bee3f.akpm@osdl.org \
--to=akpm@osdl.org \
--cc=akpm@zip.com.au \
--cc=bernie@develer.com \
--cc=george@mvista.com \
--cc=linux-kernel@vger.kernel.org \
--cc=rmk@arm.linux.org.uk \
--cc=torvalds@osdl.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).