RetroArch
Classes | Macros | Typedefs | Functions | Variables
lwp_watchdog.h File Reference
#include <gctypes.h>
#include "lwp_queue.h"
#include <time.h>
Include dependency graph for lwp_watchdog.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  _wdcntrl
 

Macros

#define TB_TIMER_CLOCK   (TB_BUS_CLOCK/4000)
 
#define TB_SECSPERMIN   60
 
#define TB_MINSPERHR   60
 
#define TB_MONSPERYR   12
 
#define TB_DAYSPERYR   365
 
#define TB_HRSPERDAY   24
 
#define TB_SECSPERDAY   (TB_SECSPERMIN*TB_MINSPERHR*TB_HRSPERDAY)
 
#define TB_SECSPERNYR   (365*TB_SECSPERDAY)
 
#define TB_MSPERSEC   1000
 
#define TB_USPERSEC   1000000
 
#define TB_NSPERSEC   1000000000
 
#define TB_NSPERMS   1000000
 
#define TB_NSPERUS   1000
 
#define TB_USPERTICK   10000
 
#define ticks_to_cycles(ticks)   ((((u64)(ticks)*(u64)((TB_CORE_CLOCK*2)/TB_TIMER_CLOCK))/2))
 
#define ticks_to_secs(ticks)   (((u64)(ticks)/(u64)(TB_TIMER_CLOCK*1000)))
 
#define ticks_to_millisecs(ticks)   (((u64)(ticks)/(u64)(TB_TIMER_CLOCK)))
 
#define ticks_to_microsecs(ticks)   ((((u64)(ticks)*8)/(u64)(TB_TIMER_CLOCK/125)))
 
#define ticks_to_nanosecs(ticks)   ((((u64)(ticks)*8000)/(u64)(TB_TIMER_CLOCK/125)))
 
#define tick_microsecs(ticks)   ((((u64)(ticks)*8)%(u64)(TB_TIMER_CLOCK/125)))
 
#define tick_nanosecs(ticks)   ((((u64)(ticks)*8000)%(u64)(TB_TIMER_CLOCK/125)))
 
#define secs_to_ticks(sec)   ((u64)(sec)*(TB_TIMER_CLOCK*1000))
 
#define millisecs_to_ticks(msec)   ((u64)(msec)*(TB_TIMER_CLOCK))
 
#define microsecs_to_ticks(usec)   (((u64)(usec)*(TB_TIMER_CLOCK/125))/8)
 
#define nanosecs_to_ticks(nsec)   (((u64)(nsec)*(TB_TIMER_CLOCK/125))/8000)
 
#define diff_ticks(tick0, tick1)   (((u64)(tick1)<(u64)(tick0))?((u64)-1-(u64)(tick0)+(u64)(tick1)):((u64)(tick1)-(u64)(tick0)))
 
#define LWP_WD_INACTIVE   0
 
#define LWP_WD_INSERTED   1
 
#define LWP_WD_ACTIVE   2
 
#define LWP_WD_REMOVE   3
 
#define LWP_WD_FORWARD   0
 
#define LWP_WD_BACKWARD   1
 
#define LWP_WD_NOTIMEOUT   0
 
#define LWP_WD_ABS(x)   ((s64)(x)>0?(s64)(x):-((s64)(x)))
 

Typedefs

typedef void(* wd_service_routine) (void *)
 
typedef struct _wdcntrl wd_cntrl
 

Functions

u32 gettick ()
 
u64 gettime ()
 
void settime (u64)
 
u32 diff_sec (u64 start, u64 end)
 
u32 diff_msec (u64 start, u64 end)
 
u32 diff_usec (u64 start, u64 end)
 
u32 diff_nsec (u64 start, u64 end)
 
void __lwp_watchdog_init ()
 
void __lwp_watchdog_settimer (wd_cntrl *wd)
 
void __lwp_wd_insert (lwp_queue *header, wd_cntrl *wd)
 
u32 __lwp_wd_remove (lwp_queue *header, wd_cntrl *wd)
 
void __lwp_wd_tickle (lwp_queue *queue)
 
void __lwp_wd_adjust (lwp_queue *queue, u32 dir, s64 interval)
 

Variables

vu32 _wd_sync_level
 
vu32 _wd_sync_count
 
u32 _wd_ticks_since_boot
 
lwp_queue _wd_ticks_queue
 

Macro Definition Documentation

◆ diff_ticks

#define diff_ticks (   tick0,
  tick1 
)    (((u64)(tick1)<(u64)(tick0))?((u64)-1-(u64)(tick0)+(u64)(tick1)):((u64)(tick1)-(u64)(tick0)))

◆ LWP_WD_ABS

#define LWP_WD_ABS (   x)    ((s64)(x)>0?(s64)(x):-((s64)(x)))

◆ LWP_WD_ACTIVE

#define LWP_WD_ACTIVE   2

◆ LWP_WD_BACKWARD

#define LWP_WD_BACKWARD   1

◆ LWP_WD_FORWARD

#define LWP_WD_FORWARD   0

◆ LWP_WD_INACTIVE

#define LWP_WD_INACTIVE   0

◆ LWP_WD_INSERTED

#define LWP_WD_INSERTED   1

◆ LWP_WD_NOTIMEOUT

#define LWP_WD_NOTIMEOUT   0

◆ LWP_WD_REMOVE

#define LWP_WD_REMOVE   3

◆ microsecs_to_ticks

#define microsecs_to_ticks (   usec)    (((u64)(usec)*(TB_TIMER_CLOCK/125))/8)

◆ millisecs_to_ticks

#define millisecs_to_ticks (   msec)    ((u64)(msec)*(TB_TIMER_CLOCK))

◆ nanosecs_to_ticks

#define nanosecs_to_ticks (   nsec)    (((u64)(nsec)*(TB_TIMER_CLOCK/125))/8000)

◆ secs_to_ticks

#define secs_to_ticks (   sec)    ((u64)(sec)*(TB_TIMER_CLOCK*1000))

◆ TB_DAYSPERYR

#define TB_DAYSPERYR   365

◆ TB_HRSPERDAY

#define TB_HRSPERDAY   24

◆ TB_MINSPERHR

#define TB_MINSPERHR   60

◆ TB_MONSPERYR

#define TB_MONSPERYR   12

◆ TB_MSPERSEC

#define TB_MSPERSEC   1000

◆ TB_NSPERMS

#define TB_NSPERMS   1000000

◆ TB_NSPERSEC

#define TB_NSPERSEC   1000000000

◆ TB_NSPERUS

#define TB_NSPERUS   1000

◆ TB_SECSPERDAY

#define TB_SECSPERDAY   (TB_SECSPERMIN*TB_MINSPERHR*TB_HRSPERDAY)

◆ TB_SECSPERMIN

#define TB_SECSPERMIN   60

◆ TB_SECSPERNYR

#define TB_SECSPERNYR   (365*TB_SECSPERDAY)

◆ TB_TIMER_CLOCK

#define TB_TIMER_CLOCK   (TB_BUS_CLOCK/4000)

◆ TB_USPERSEC

#define TB_USPERSEC   1000000

◆ TB_USPERTICK

#define TB_USPERTICK   10000

◆ tick_microsecs

#define tick_microsecs (   ticks)    ((((u64)(ticks)*8)%(u64)(TB_TIMER_CLOCK/125)))

◆ tick_nanosecs

#define tick_nanosecs (   ticks)    ((((u64)(ticks)*8000)%(u64)(TB_TIMER_CLOCK/125)))

◆ ticks_to_cycles

#define ticks_to_cycles (   ticks)    ((((u64)(ticks)*(u64)((TB_CORE_CLOCK*2)/TB_TIMER_CLOCK))/2))

◆ ticks_to_microsecs

#define ticks_to_microsecs (   ticks)    ((((u64)(ticks)*8)/(u64)(TB_TIMER_CLOCK/125)))

◆ ticks_to_millisecs

#define ticks_to_millisecs (   ticks)    (((u64)(ticks)/(u64)(TB_TIMER_CLOCK)))

◆ ticks_to_nanosecs

#define ticks_to_nanosecs (   ticks)    ((((u64)(ticks)*8000)/(u64)(TB_TIMER_CLOCK/125)))

◆ ticks_to_secs

#define ticks_to_secs (   ticks)    (((u64)(ticks)/(u64)(TB_TIMER_CLOCK*1000)))

Typedef Documentation

◆ wd_cntrl

typedef struct _wdcntrl wd_cntrl

◆ wd_service_routine

typedef void(* wd_service_routine) (void *)

Function Documentation

◆ __lwp_watchdog_init()

void __lwp_watchdog_init ( )
Here is the call graph for this function:
Here is the caller graph for this function:

◆ __lwp_watchdog_settimer()

void __lwp_watchdog_settimer ( wd_cntrl wd)

◆ __lwp_wd_adjust()

void __lwp_wd_adjust ( lwp_queue queue,
u32  dir,
s64  interval 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ __lwp_wd_insert()

void __lwp_wd_insert ( lwp_queue header,
wd_cntrl wd 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ __lwp_wd_remove()

u32 __lwp_wd_remove ( lwp_queue header,
wd_cntrl wd 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ __lwp_wd_tickle()

void __lwp_wd_tickle ( lwp_queue queue)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ diff_msec()

u32 diff_msec ( u64  start,
u64  end 
)

◆ diff_nsec()

u32 diff_nsec ( u64  start,
u64  end 
)

◆ diff_sec()

u32 diff_sec ( u64  start,
u64  end 
)

◆ diff_usec()

u32 diff_usec ( u64  start,
u64  end 
)
Here is the caller graph for this function:

◆ gettick()

u32 gettick ( )
Here is the caller graph for this function:

◆ gettime()

u64 gettime ( )
Here is the caller graph for this function:

◆ settime()

void settime ( u64  )
Here is the caller graph for this function:

Variable Documentation

◆ _wd_sync_count

vu32 _wd_sync_count

◆ _wd_sync_level

vu32 _wd_sync_level

◆ _wd_ticks_queue

lwp_queue _wd_ticks_queue

◆ _wd_ticks_since_boot

u32 _wd_ticks_since_boot