1 #ifndef _MVME_FAST_TICKER_LIB_H
2 #define _MVME_FAST_TICKER_LIB_H
6 #include <MVME/ppcIOLib.h>
8 #define MVME_FAST_TICKER_DIV ((UINT32 *)0xfc0010f0)
9 #define MVME_FAST_TICKER_LOAD ((UINT32 *)0xfc001110)
10 #define MVME_FAST_TICKER_READ ((UINT32 *)0xfc001100)
11 #define MVME_FAST_TICKER_VECTOR ((UINT32 *)0xfc001120)
12 #define MVME_FAST_TICKER_DEST ((UINT32 *)0xfc001130)
14 extern void mvmeFastTickerInit(
void) ;
15 extern UINT32 mvmeFastTickerGet(
void) ;
17 extern inline volatile unsigned int mvmeFastTickerMark(
void)
19 return rs32(MVME_FAST_TICKER_READ) & 0x7FFFFFFF ;
23 extern inline volatile unsigned int mvmeFastTickerDelta(
unsigned int old)
25 volatile unsigned int cur = rs32(MVME_FAST_TICKER_READ) & 0x7FFFFFFF ;
28 if(old >= cur) ret = (old-cur) ;
29 else ret = (((
unsigned int)0x7FFFFFFF-cur)+old) ;
31 return (ret*4 + 17)/33 ;