[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[microblaze-uclinux] Re: [PATCH 24/56] microblaze_v2: time support
- To: John Williams <john.williams@xxxxxxxxxxxxx>
- Subject: [microblaze-uclinux] Re: [PATCH 24/56] microblaze_v2: time support
- From: Michal Simek <monstr@xxxxxxxxx>
- Date: Tue, 06 May 2008 11:56:51 +0200
- Cc: monstr@xxxxxxxxx, linux-kernel@xxxxxxxxxxxxxxx, arnd@xxxxxxxx, linux-arch@xxxxxxxxxxxxxxx, stephen.neuendorffer@xxxxxxxxxx, John.Linn@xxxxxxxxxx, matthew@xxxxxx, will.newton@xxxxxxxxx, drepper@xxxxxxxxxx, microblaze-uclinux@xxxxxxxxxxxxxx, grant.likely@xxxxxxxxxxxx
- In-reply-to: <1210033811.5798.188.camel@localhost>
- References: <1209901305-6404-1-git-send-email-monstr@xxxxxxxxx> <d883a8d8da812d77fefd47730d28d0bdb7b504e0.1209897266.git.monstr@xxxxxxxxx> <625ef466cf121d655539eedc919dd39166087e0c.1209897266.git.monstr@xxxxxxxxx> <b5067a1846075ddd1035966ea1edc908579e2e88.1209897266.git.monstr@xxxxxxxxx> <378157891bac535dbc55e658d5f03fdd332e85cf.1209897266.git.monstr@xxxxxxxxx> <eadcc6f4754df78b69d6d54c404624d0390c8558.1209897266.git.monstr@xxxxxxxxx> <4df4022e06b9056202cc2fdf0b99deb01563a0fa.1209897266.git.monstr@xxxxxxxxx> <6b0c9864dc80776ae48d6488a6892e5d698751b7.1209897266.git.monstr@xxxxxxxxx> <ea5cbbca49c38c506960fddba29cbd8cb24e1a8d.1209897266.git.monstr@xxxxxxxxx> <4f4d6ed3fce9b21cdd6dcacb2d72fff7e9830628.1209897266.git.monstr@xxxxxxxxx> <35e662a81eb86c7ffb2aaa6141ca38a07789f382.1209897266.git.monstr@xxxxxxxxx> <1209953949.5798.66.camel@localhost> <481F1830.5090309@xxxxxxxxx> <1210033811.5798.188.camel@localhost>
- Reply-to: microblaze-uclinux@xxxxxxxxxxxxxx
- Sender: owner-microblaze-uclinux@xxxxxxxxxxxxxx
- User-agent: Thunderbird 2.0.0.14 (Windows/20080421)
Hi John,
> Hi Michal,
>
> On Mon, 2008-05-05 at 16:22 +0200, Michal Simek wrote:
>> Hi John,
>>
>> you wrote me you have smarter implementation that xilinx did. Can you find it
>> and send me it?
>
> It's not much (any?) better? One less multiply I think? Attached
> anyway - feel free to discard for now.
>
> We could do a nice asm implementation with the optional mulhi
> instruction, but that can wait.
>
> Cheers,
>
> John
+extern __inline__ void __udelay(unsigned int x)
{
- unsigned long long tmp = usec;
- unsigned long loops = (tmp * 4295 * HZ * loops_per_jiffy) >> 32;
+ unsigned long long tmp=(unsigned long long)x*(unsigned long
long)loops_per_jiffy*226LL;
+ unsigned loops=tmp>>32;
+
__delay(loops);
}
-#endif /* _ASM_MICROBLAZE_DELAY_H */
+extern __inline__ void __ndelay(unsigned int x)
+{
+ unsigned long long tmp=(unsigned long long)x*(unsigned long
long)loops_per_jiffy*226LL;
+ unsigned loops=tmp>>32;
+
+ __delay(loops);
+}
Why is __ndelay implementation the same with __udelay? This is weird for me.
+
+extern void __bad_udelay(void); /* deliberately undefined */
+extern void __bad_ndelay(void); /* deliberately undefined */
Are these function used anywhere?
+#define udelay(n) (__builtin_constant_p(n)? \
+ ((n) > __MAX_UDELAY? __bad_udelay(): __udelay((n) * (19 * HZ))) : \
+ __udelay((n) * (19 * HZ)))
+
+#define ndelay(n) (__builtin_constant_p(n)? \
+ ((n) > __MAX_NDELAY? __bad_ndelay(): __ndelay((n) * HZ)) : \
+ __ndelay((n) * HZ))
+#define muldiv(a, b, c) (((a)*(b))/(c))
muldiv: Where is this use?
Michal
___________________________
microblaze-uclinux mailing list
microblaze-uclinux@xxxxxxxxxxxxxx
Project Home Page : http://www.itee.uq.edu.au/~jwilliams/mblaze-uclinux
Mailing List Archive : http://www.itee.uq.edu.au/~listarch/microblaze-uclinux/