--- zzzz-none-000/linux-2.6.19.2/include/asm-powerpc/time.h 2007-01-10 19:10:37.000000000 +0000 +++ davinci-8020-5505/linux-2.6.19.2/include/asm-powerpc/time.h 2007-01-11 07:38:19.000000000 +0000 @@ -39,6 +39,10 @@ extern void wakeup_decrementer(void); extern void snapshot_timebase(void); +#ifdef CONFIG_RTC_CLASS +extern int __init rtc_class_hookup(void); +#endif + /* Some sane defaults: 125 MHz timebase, 1GHz processor */ extern unsigned long ppc_proc_freq; #define DEFAULT_PROC_FREQ (DEFAULT_TB_FREQ * 8) @@ -78,35 +82,30 @@ #define __USE_RTC() 0 #endif -#ifdef CONFIG_PPC64 - -/* For compatibility, get_tbl() is defined as get_tb() on ppc64 */ -#define get_tbl get_tb - -#else - +/* On ppc64 this gets us the whole timebase; on ppc32 just the lower half */ static inline unsigned long get_tbl(void) { -#if defined(CONFIG_403GCX) unsigned long tbl; + +#if defined(CONFIG_403GCX) asm volatile("mfspr %0, 0x3dd" : "=r" (tbl)); - return tbl; #else - return mftbl(); + asm volatile("mftb %0" : "=r" (tbl)); #endif + return tbl; } static inline unsigned int get_tbu(void) { -#ifdef CONFIG_403GCX unsigned int tbu; + +#if defined(CONFIG_403GCX) asm volatile("mfspr %0, 0x3dc" : "=r" (tbu)); - return tbu; #else - return mftbu(); + asm volatile("mftbu %0" : "=r" (tbu)); #endif + return tbu; } -#endif /* !CONFIG_PPC64 */ static inline unsigned int get_rtcl(void) { @@ -132,7 +131,7 @@ { return mftb(); } -#else /* CONFIG_PPC64 */ +#else static inline u64 get_tb(void) { unsigned int tbhi, tblo, tbhi2; @@ -145,7 +144,7 @@ return ((u64)tbhi << 32) | tblo; } -#endif /* !CONFIG_PPC64 */ +#endif static inline void set_tb(unsigned int upper, unsigned int lower) {