2008-09-14 22:40:26 +02:00
|
|
|
/****************************************************************************
|
|
|
|
* tmbinc msec timer
|
|
|
|
****************************************************************************/
|
|
|
|
#ifndef __TMBINCTIMER__
|
|
|
|
#define __TMBINCTIMER__
|
2008-09-16 07:42:21 +02:00
|
|
|
#ifdef HW_RVL
|
2008-09-14 22:40:26 +02:00
|
|
|
#define TB_CLOCK 60750000 //WII
|
2008-09-16 07:42:21 +02:00
|
|
|
#else
|
2008-09-14 22:40:26 +02:00
|
|
|
#define TB_CLOCK 40500000
|
|
|
|
#endif
|
|
|
|
#define mftb(rval) ({unsigned long u; do { \
|
|
|
|
asm volatile ("mftbu %0" : "=r" (u)); \
|
|
|
|
asm volatile ("mftb %0" : "=r" ((rval)->l)); \
|
|
|
|
asm volatile ("mftbu %0" : "=r" ((rval)->u)); \
|
|
|
|
} while(u != ((rval)->u)); })
|
|
|
|
|
|
|
|
typedef struct
|
|
|
|
{
|
|
|
|
unsigned long l, u;
|
|
|
|
}
|
|
|
|
tb_t;
|
|
|
|
|
|
|
|
unsigned long tb_diff_msec (tb_t * end, tb_t * start);
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|