1 #ifndef __LWP_WATCHDOG_H__ 2 #define __LWP_WATCHDOG_H__ 9 #define TB_BUS_CLOCK 243000000u 10 #define TB_CORE_CLOCK 729000000u 12 #define TB_BUS_CLOCK 162000000u 13 #define TB_CORE_CLOCK 486000000u 15 #define TB_TIMER_CLOCK (TB_BUS_CLOCK/4000) //4th of the bus frequency 17 #define TB_SECSPERMIN 60 18 #define TB_MINSPERHR 60 19 #define TB_MONSPERYR 12 20 #define TB_DAYSPERYR 365 21 #define TB_HRSPERDAY 24 22 #define TB_SECSPERDAY (TB_SECSPERMIN*TB_MINSPERHR*TB_HRSPERDAY) 23 #define TB_SECSPERNYR (365*TB_SECSPERDAY) 25 #define TB_MSPERSEC 1000 26 #define TB_USPERSEC 1000000 27 #define TB_NSPERSEC 1000000000 28 #define TB_NSPERMS 1000000 29 #define TB_NSPERUS 1000 30 #define TB_USPERTICK 10000 32 #define ticks_to_cycles(ticks) ((((u64)(ticks)*(u64)((TB_CORE_CLOCK*2)/TB_TIMER_CLOCK))/2)) 33 #define ticks_to_secs(ticks) (((u64)(ticks)/(u64)(TB_TIMER_CLOCK*1000))) 34 #define ticks_to_millisecs(ticks) (((u64)(ticks)/(u64)(TB_TIMER_CLOCK))) 35 #define ticks_to_microsecs(ticks) ((((u64)(ticks)*8)/(u64)(TB_TIMER_CLOCK/125))) 36 #define ticks_to_nanosecs(ticks) ((((u64)(ticks)*8000)/(u64)(TB_TIMER_CLOCK/125))) 38 #define tick_microsecs(ticks) ((((u64)(ticks)*8)%(u64)(TB_TIMER_CLOCK/125))) 39 #define tick_nanosecs(ticks) ((((u64)(ticks)*8000)%(u64)(TB_TIMER_CLOCK/125))) 42 #define secs_to_ticks(sec) ((u64)(sec)*(TB_TIMER_CLOCK*1000)) 43 #define millisecs_to_ticks(msec) ((u64)(msec)*(TB_TIMER_CLOCK)) 44 #define microsecs_to_ticks(usec) (((u64)(usec)*(TB_TIMER_CLOCK/125))/8) 45 #define nanosecs_to_ticks(nsec) (((u64)(nsec)*(TB_TIMER_CLOCK/125))/8000) 47 #define diff_ticks(tick0,tick1) (((u64)(tick1)<(u64)(tick0))?((u64)-1-(u64)(tick0)+(u64)(tick1)):((u64)(tick1)-(u64)(tick0))) 49 #define LWP_WD_INACTIVE 0 50 #define LWP_WD_INSERTED 1 51 #define LWP_WD_ACTIVE 2 52 #define LWP_WD_REMOVE 3 54 #define LWP_WD_FORWARD 0 55 #define LWP_WD_BACKWARD 1 57 #define LWP_WD_NOTIMEOUT 0 59 #define LWP_WD_ABS(x) ((s64)(x)>0?(s64)(x):-((s64)(x))) 99 #ifdef LIBOGC_INTERNAL u32 __lwp_wd_remove(lwp_queue *header, wd_cntrl *wd)
Definition: lwp_watchdog.c:101
vu32 _wd_sync_level
Definition: lwp_watchdog.c:13
u32 id
Definition: lwp_watchdog.h:85
Definition: lwp_queue.h:21
u32 diff_nsec(u64 start, u64 end)
Definition: timesupp.c:99
GLuint start
Definition: glext.h:6292
u32 _wd_ticks_since_boot
Definition: lwp_watchdog.c:15
u64 start
Definition: lwp_watchdog.h:84
u64 fire
Definition: lwp_watchdog.h:87
vu32 _wd_sync_count
Definition: lwp_watchdog.c:14
Definition: lwp_queue.h:16
lwp_queue _wd_ticks_queue
Definition: lwp_watchdog.c:17
typedef void(__stdcall *PFN_DESTRUCTION_CALLBACK)(void *pData)
void __lwp_watchdog_settimer(wd_cntrl *wd)
Definition: lwp_watchdog.h:82
wd_service_routine routine
Definition: lwp_watchdog.h:88
u32 diff_sec(u64 start, u64 end)
Definition: timesupp.c:79
u32 diff_msec(u64 start, u64 end)
Definition: timesupp.c:87
void __lwp_watchdog_init()
Definition: lwp_watchdog.c:52
void * usr_data
Definition: lwp_watchdog.h:89
void __lwp_wd_tickle(lwp_queue *queue)
Definition: lwp_watchdog.c:130
void __lwp_wd_adjust(lwp_queue *queue, u32 dir, s64 interval)
Definition: lwp_watchdog.c:164
u32 diff_usec(u64 start, u64 end)
Definition: timesupp.c:93
uint64_t u64
64bit unsigned integer
Definition: gctypes.h:20
void(* wd_service_routine)(void *)
Definition: lwp_watchdog.h:80
void __lwp_wd_insert(lwp_queue *header, wd_cntrl *wd)
Definition: lwp_watchdog.c:61
volatile u32 vu32
32bit unsigned volatile integer
Definition: gctypes.h:29
lwp_node node
Definition: lwp_watchdog.h:83
u32 state
Definition: lwp_watchdog.h:86
GLuint GLuint end
Definition: glext.h:6292
uint32_t u32
32bit unsigned integer
Definition: gctypes.h:19
int64_t s64
64bit signed integer
Definition: gctypes.h:25