From: Benjamin Herrenschmidt <bh40@calva.net>
To: Gabriel Paubert <paubert@iram.es>
Cc: <linuxppc-dev@lists.linuxppc.org>, <paulus@linuxcare.com.au>
Subject: Re: 2.2.18pre17 again
Date: Tue, 31 Oct 2000 15:48:44 +0100 [thread overview]
Message-ID: <19340925082028.17042@192.168.1.2> (raw)
In-Reply-To: <Pine.HPX.4.10.10010311315380.15431-100000@gra-ux1.iram.es>
>
>Why isn't udelay based on the timebase then ? Easy to scale
>microseconds to timebase.
Because you didn't implement it yet ? :)
>There is a multiplier for mulhwu somewhere in a global variable, I should
>remember the name since I wrote the code, tb_to_us if I'm not messing up.
Do we have that code in 2.2 ? Your time management patches are in 2.4
only AFAIK (nice code BTW).
>It needs some care for 601 because of the different registers (RTC) that
>has the bad habit of jumping from 1e9 to 0. It is trivial to implement as
>a subroutine and check for CPU inside the subroutine. After all it's a
>delay, so performance should not be critical.
>
>udelay:
> lis r4,tb_to_us@ha
> mfpvr r5
> lwz r4,tb_to_us@l(r4)
> srwi r5,r5,16
> mulhwu r4,r3,r4
> cmpwi cr0,r5,1
> beq 2f
> mftbl r5
>1: mftbl r3
> sub r3,r3,r5
> cmplw cr0,r3,r4 # works for delays of up to almost 2^32 tb ticks
> blt cr0,1b
> blr
>
>2: mfrtcl r5
>3: mfrtcl r3
> sub. r3,r3,r5 # if wraparound has occurred
> bnl+ 4f # bump elapsed time by one second
> addis r3,r3,1000000000@ha
> addi r3,r3,1000000000@l
>4: cmplw r3,r3,r4 # works for delays of up to almost 1 second
> blt cr0,3b
> blr
>
>Caution, untested... BTW, that's the kind of routine in which I'd like to
>tell the compiler that it only uses r3/r4/r5/cr0 so that it can keep more
>variables in the registers of the caller.
What is the max delay supported ? I beleive we should implement it as
__udelay and keept the macro mecanism to catch too high delays.
> Gabriel.
>
** Sent via the linuxppc-dev mail list. See http://lists.linuxppc.org/
next prev parent reply other threads:[~2000-10-31 14:48 UTC|newest]
Thread overview: 42+ messages / expand[flat|nested] mbox.gz Atom feed top
2000-10-26 6:30 2.2.18pre17 again Paul Mackerras
2000-10-26 14:19 ` Gabriel Paubert
2000-10-27 1:51 ` Paul Mackerras
2000-10-27 6:21 ` Martin Costabel
2000-10-27 11:59 ` Lombard Sleep Crash (Was: 2.2.18pre17 again) Albrecht Dre_
2000-10-27 14:39 ` Olaf Hering
2000-11-02 12:34 ` Albrecht Dreß
2000-11-02 15:07 ` Claus
2000-11-02 15:28 ` Albrecht Dre_
2000-11-02 18:09 ` Benjamin Herrenschmidt
2000-11-03 10:13 ` Albrecht Dre_
2000-11-03 12:22 ` Michael Schmitz
2000-11-03 12:32 ` Albrecht Dre_
2000-11-03 12:52 ` Michael Schmitz
2000-11-03 14:11 ` Albrecht Dre_
2000-11-03 14:52 ` Michael Schmitz
2000-11-03 21:51 ` Michael Schmitz
2000-11-02 15:35 ` Benjamin Herrenschmidt
2000-11-02 15:43 ` Michael Schmitz
2000-11-02 16:11 ` Benjamin Herrenschmidt
2000-11-02 17:13 ` Michael Schmitz
2000-11-03 15:22 ` Claus
2000-11-03 15:55 ` Benjamin Herrenschmidt
2000-11-03 21:53 ` Michael Schmitz
2000-11-09 1:22 ` Claus
2000-11-09 8:26 ` Michael Schmitz
2000-11-02 17:23 ` Joseph P. Garcia
2000-11-02 18:06 ` Benjamin Herrenschmidt
2000-11-02 22:18 ` Michael Schmitz
2000-11-02 22:56 ` Olaf Hering
2000-11-08 20:35 ` Michael Schmitz
2000-11-08 20:54 ` Benjamin Herrenschmidt
2000-11-08 21:48 ` Michael Schmitz
2000-10-27 19:02 ` 2.2.18pre17 again Olaf Hering
2000-10-28 0:14 ` Olaf Hering
2000-10-31 6:49 ` Michel Lanners
2000-10-31 11:53 ` Benjamin Herrenschmidt
2000-10-31 14:03 ` Gabriel Paubert
2000-10-31 14:48 ` Benjamin Herrenschmidt [this message]
2000-10-31 17:20 ` Gabriel Paubert
2000-11-01 1:20 ` Dan Malek
2000-11-01 7:33 ` Michel Lanners
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=19340925082028.17042@192.168.1.2 \
--to=bh40@calva.net \
--cc=linuxppc-dev@lists.linuxppc.org \
--cc=paubert@iram.es \
--cc=paulus@linuxcare.com.au \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.