Skip to contentSkip to conversation

Question about generic\time.c 2.4.17

DISCUSSION Nick Zajerko-McKee 3 participants 3 messages Jul 23, 2002 – Jul 24, 2002 MIPS

lore
Share & tools
lore
#0 lore raw

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.

#1 lore raw
Quoted 6 lines · Nick Zajerko-McKee

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.

Signature · 3 lines
+  Maciej W. Rozycki, Technical University of Gdansk, Poland   +
+--------------------------------------------------------------+
+        e-mail: [email protected], PGP key available        +
#2 lore raw
In reply to Nick Zajerko-McKee
Quoted 9 lines · Nick Zajerko-McKee

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