* Question about generic\time.c 2.4.17
@ 2002-07-23 22:05 Nick Zajerko-McKee
2002-07-24 14:38 ` Maciej W. Rozycki
2002-07-24 18:23 ` Jun Sun
0 siblings, 2 replies; 5+ messages in thread
From: Nick Zajerko-McKee @ 2002-07-23 22:05 UTC (permalink / raw)
To: linux-mips
Hi,
I'm working on a new 4Kc platform and was looking at the
arch\mips\mips-boards\generic\time.c sources. Can someone explain to me
the function of do_fast_gettimeoffset(), especially the do_div64_32()
assembler routine? One of the requirements I have will be not modify
the timer resolution for my platform to something in the msec range w/o
disturbing the underlying jiffie setup found in linux.
Thanks.
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: Question about generic\time.c 2.4.17
2002-07-23 22:05 Question about generic\time.c 2.4.17 Nick Zajerko-McKee
@ 2002-07-24 14:38 ` Maciej W. Rozycki
2002-07-24 18:23 ` Jun Sun
1 sibling, 0 replies; 5+ messages in thread
From: Maciej W. Rozycki @ 2002-07-24 14:38 UTC (permalink / raw)
To: Nick Zajerko-McKee; +Cc: linux-mips
On 23 Jul 2002, Nick Zajerko-McKee wrote:
> I'm working on a new 4Kc platform and was looking at the
> arch\mips\mips-boards\generic\time.c sources. Can someone explain to me
> the function of do_fast_gettimeoffset(), especially the do_div64_32()
> assembler routine? One of the requirements I have will be not modify
> the timer resolution for my platform to something in the msec range w/o
> disturbing the underlying jiffie setup found in linux.
That's a traditional double-precision division, i.e. in this case it's a
64-bit dividend by a 32-bit divisor with a 32-bit quotient and a 32-bit
remainder (hmm, the code should be obvious). It isn't used in the file,
though.
--
+ Maciej W. Rozycki, Technical University of Gdansk, Poland +
+--------------------------------------------------------------+
+ e-mail: macro@ds2.pg.gda.pl, PGP key available +
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: Question about generic\time.c 2.4.17
2002-07-23 22:05 Question about generic\time.c 2.4.17 Nick Zajerko-McKee
2002-07-24 14:38 ` Maciej W. Rozycki
@ 2002-07-24 18:23 ` Jun Sun
1 sibling, 0 replies; 5+ messages in thread
From: Jun Sun @ 2002-07-24 18:23 UTC (permalink / raw)
To: Nick Zajerko-McKee; +Cc: linux-mips
Nick Zajerko-McKee wrote:
> Hi,
>
> I'm working on a new 4Kc platform and was looking at the
> arch\mips\mips-boards\generic\time.c sources. Can someone explain to me
> the function of do_fast_gettimeoffset(), especially the do_div64_32()
> assembler routine? One of the requirements I have will be not modify
> the timer resolution for my platform to something in the msec range w/o
> disturbing the underlying jiffie setup found in linux.
>
do_div64_32() emulate 64bit division with 32bit registers/values.
do_fast_gettimeoffset() gives the intra-jiffy time offset, which yields higher
timer resolution.
Take a look of /Documentation/mips/time.README.
Jun
^ permalink raw reply [flat|nested] 5+ messages in thread
* RE: Question about generic\time.c 2.4.17
@ 2002-07-24 15:02 Zajerko-McKee, Nick
2002-07-24 15:19 ` Maciej W. Rozycki
0 siblings, 1 reply; 5+ messages in thread
From: Zajerko-McKee, Nick @ 2002-07-24 15:02 UTC (permalink / raw)
To: 'Maciej W. Rozycki', Zajerko-McKee, Nick; +Cc: linux-mips
Thanks for the reply. No, the code wasn't too obvious. I went through the
gas info page to try to understand the inline assembler options + see mips
run. I believe the code is used in the MIPS32 condition, which is what mode
I'm building for...
so the result is res = (high |low)/ base ?
What had me confused was high and low are also modified as part of the
function.
-----Original Message-----
From: Maciej W. Rozycki [mailto:macro@ds2.pg.gda.pl]
Sent: Wednesday, July 24, 2002 10:38 AM
To: Nick Zajerko-McKee
Cc: linux-mips@oss.sgi.com
Subject: Re: Question about generic\time.c 2.4.17
On 23 Jul 2002, Nick Zajerko-McKee wrote:
> I'm working on a new 4Kc platform and was looking at the
> arch\mips\mips-boards\generic\time.c sources. Can someone explain to me
> the function of do_fast_gettimeoffset(), especially the do_div64_32()
> assembler routine? One of the requirements I have will be not modify
> the timer resolution for my platform to something in the msec range w/o
> disturbing the underlying jiffie setup found in linux.
That's a traditional double-precision division, i.e. in this case it's a
64-bit dividend by a 32-bit divisor with a 32-bit quotient and a 32-bit
remainder (hmm, the code should be obvious). It isn't used in the file,
though.
--
+ Maciej W. Rozycki, Technical University of Gdansk, Poland +
+--------------------------------------------------------------+
+ e-mail: macro@ds2.pg.gda.pl, PGP key available +
^ permalink raw reply [flat|nested] 5+ messages in thread
* RE: Question about generic\time.c 2.4.17
2002-07-24 15:02 Zajerko-McKee, Nick
@ 2002-07-24 15:19 ` Maciej W. Rozycki
0 siblings, 0 replies; 5+ messages in thread
From: Maciej W. Rozycki @ 2002-07-24 15:19 UTC (permalink / raw)
To: Zajerko-McKee, Nick; +Cc: linux-mips
On Wed, 24 Jul 2002, Zajerko-McKee, Nick wrote:
> Thanks for the reply. No, the code wasn't too obvious. I went through the
> gas info page to try to understand the inline assembler options + see mips
> run. I believe the code is used in the MIPS32 condition, which is what mode
> I'm building for...
For the 32-bit mode, not necessarily on a MIPS32 processor.
> so the result is res = (high |low)/ base ?
Strictly speaking, res = (high:low) / base and the result is (high:low) %
base. That's a macro, hence a bit weird semantics (two results are
actually provided), but it makes the use easier. A few architectures
provide such an operation in hardware.
> What had me confused was high and low are also modified as part of the
> function.
That's just how the algorithm works. These are local variables anyway.
--
+ Maciej W. Rozycki, Technical University of Gdansk, Poland +
+--------------------------------------------------------------+
+ e-mail: macro@ds2.pg.gda.pl, PGP key available +
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2002-07-24 18:36 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2002-07-23 22:05 Question about generic\time.c 2.4.17 Nick Zajerko-McKee
2002-07-24 14:38 ` Maciej W. Rozycki
2002-07-24 18:23 ` Jun Sun
-- strict thread matches above, loose matches on Subject: below --
2002-07-24 15:02 Zajerko-McKee, Nick
2002-07-24 15:19 ` Maciej W. Rozycki
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox