RetroArch
Classes | Macros | Typedefs | Functions | Variables
system.h File Reference

OS functions and initialization. More...

#include <gctypes.h>
#include <gcutil.h>
#include <time.h>
#include <ogc/lwp_queue.h>
#include "gx_struct.h"
Include dependency graph for system.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  _syssram
 
struct  _syssramex
 
struct  _sys_fontheader
 
struct  _sys_resetinfo
 

Macros

#define SYS_BASE_CACHED   (0x80000000)
 
#define SYS_BASE_UNCACHED   (0xC0000000)
 
#define SYS_WD_NULL   0xffffffff
 
#define SYS_RESTART   0
 
#define SYS_HOTRESET   1
 
#define SYS_SHUTDOWN   2
 
#define SYS_RETURNTOMENU   3
 
#define SYS_POWEROFF   4
 
#define SYS_POWEROFF_STANDBY   5
 
#define SYS_POWEROFF_IDLE   6
 
#define SYS_PROTECTCHAN0   0
 
#define SYS_PROTECTCHAN1   1
 
#define SYS_PROTECTCHAN2   2
 
#define SYS_PROTECTCHAN3   3
 
#define SYS_PROTECTCHANMAX   4
 
#define SYS_PROTECTNONE   0x00000000
 
#define SYS_PROTECTREAD   0x00000001
 
#define SYS_PROTECTWRITE   0x00000002
 
#define SYS_PROTECTRDWR   (SYS_PROTECTREAD|SYS_PROTECTWRITE)
 
#define SYS_FONTSIZE_ANSI   (288 + 131072)
 
#define SYS_FONTSIZE_SJIS   (3840 + 1179648)
 
#define MEM_VIRTUAL_TO_PHYSICAL(x)   (((u32)(x)) & ~SYS_BASE_UNCACHED)
 
#define MEM_PHYSICAL_TO_K0(x)   (void*)((u32)(x) + SYS_BASE_CACHED)
 
#define MEM_PHYSICAL_TO_K1(x)   (void*)((u32)(x) + SYS_BASE_UNCACHED)
 
#define MEM_K0_TO_PHYSICAL(x)   (void*)((u32)(x) - SYS_BASE_CACHED)
 
#define MEM_K1_TO_PHYSICAL(x)   (void*)((u32)(x) - SYS_BASE_UNCACHED)
 
#define MEM_K0_TO_K1(x)   (void*)((u32)(x) + (SYS_BASE_UNCACHED - SYS_BASE_CACHED))
 
#define MEM_K1_TO_K0(x)   (void*)((u32)(x) - (SYS_BASE_UNCACHED - SYS_BASE_CACHED))
 
#define SYS_GetArenaLo   SYS_GetArena1Lo
 
#define SYS_SetArenaLo   SYS_SetArena1Lo
 
#define SYS_GetArenaHi   SYS_GetArena1Hi
 
#define SYS_SetArenaHi   SYS_SetArena1Hi
 
#define SYS_GetArenaSize   SYS_GetArena1Size
 

Typedefs

typedef u32 syswd_t
 handle typedef for the alarm context More...
 
typedef struct _syssram syssram
 holds the stored configuration value from the system SRAM area More...
 
typedef struct _syssramex syssramex
 holds the stored configuration value from the extended SRAM area More...
 
typedef void(* alarmcallback) (syswd_t alarm, void *cb_arg)
 
typedef struct _sys_fontheader sys_fontheader
 
typedef void(* resetcallback) (void)
 
typedef void(* powercallback) (void)
 
typedef s32(* resetfunction) (s32 final)
 
typedef struct _sys_resetinfo sys_resetinfo
 

Functions

void SYS_Init ()
 
voidSYS_AllocateFramebuffer (GXRModeObj *rmode)
 Allocate cacheline aligned memory for the external framebuffer based on the rendermode object. More...
 
void SYS_ProtectRange (u32 chan, void *addr, u32 bytes, u32 cntrl)
 
void SYS_StartPMC (u32 mcr0val, u32 mcr1val)
 
void SYS_DumpPMC ()
 
void SYS_StopPMC ()
 
s32 SYS_CreateAlarm (syswd_t *thealarm)
 Create/initialize sysalarm structure. More...
 
s32 SYS_SetAlarm (syswd_t thealarm, const struct timespec *tp, alarmcallback cb, void *cbarg)
 
s32 SYS_SetPeriodicAlarm (syswd_t thealarm, const struct timespec *tp_start, const struct timespec *tp_period, alarmcallback cb, void *cbarg)
 
s32 SYS_RemoveAlarm (syswd_t thealarm)
 Remove the given alarm context from the list of contexts and destroy it. More...
 
s32 SYS_CancelAlarm (syswd_t thealarm)
 Cancel the alarm, but do not remove from the list of contexts. More...
 
void SYS_SetWirelessID (u32 chan, u32 id)
 
u32 SYS_GetWirelessID (u32 chan)
 
u32 SYS_GetFontEncoding ()
 
u32 SYS_InitFont (sys_fontheader *font_data)
 
void SYS_GetFontTexture (s32 c, void **image, s32 *xpos, s32 *ypos, s32 *width)
 
void SYS_GetFontTexel (s32 c, void *image, s32 pos, s32 stride, s32 *width)
 
void SYS_ResetSystem (s32 reset, u32 reset_code, s32 force_menu)
 
void SYS_RegisterResetFunc (sys_resetinfo *info)
 
void SYS_UnregisterResetFunc (sys_resetinfo *info)
 
void SYS_SwitchFiber (u32 arg0, u32 arg1, u32 arg2, u32 arg3, u32 pc, u32 newsp)
 
voidSYS_GetArena1Lo ()
 
void SYS_SetArena1Lo (void *newLo)
 
voidSYS_GetArena1Hi ()
 
void SYS_SetArena1Hi (void *newHi)
 
u32 SYS_GetArena1Size ()
 
resetcallback SYS_SetResetCallback (resetcallback cb)
 
u32 SYS_ResetButtonDown ()
 
u64 SYS_Time ()
 
void kprintf (const char *str,...)
 

Variables

struct _syssram ATTRIBUTE_PACKED
 

Detailed Description

OS functions and initialization.

Macro Definition Documentation

◆ SYS_BASE_CACHED

#define SYS_BASE_CACHED   (0x80000000)

◆ SYS_BASE_UNCACHED

#define SYS_BASE_UNCACHED   (0xC0000000)

◆ SYS_FONTSIZE_ANSI

#define SYS_FONTSIZE_ANSI   (288 + 131072)

◆ SYS_FONTSIZE_SJIS

#define SYS_FONTSIZE_SJIS   (3840 + 1179648)

◆ SYS_GetArenaHi

#define SYS_GetArenaHi   SYS_GetArena1Hi

◆ SYS_GetArenaLo

#define SYS_GetArenaLo   SYS_GetArena1Lo

◆ SYS_GetArenaSize

#define SYS_GetArenaSize   SYS_GetArena1Size

◆ SYS_SetArenaHi

#define SYS_SetArenaHi   SYS_SetArena1Hi

◆ SYS_SetArenaLo

#define SYS_SetArenaLo   SYS_SetArena1Lo

◆ SYS_WD_NULL

#define SYS_WD_NULL   0xffffffff

Typedef Documentation

◆ alarmcallback

typedef void(* alarmcallback) (syswd_t alarm, void *cb_arg)

◆ powercallback

typedef void(* powercallback) (void)

◆ resetcallback

typedef void(* resetcallback) (void)

◆ resetfunction

typedef s32(* resetfunction) (s32 final)

◆ sys_fontheader

◆ sys_resetinfo

typedef struct _sys_resetinfo sys_resetinfo

◆ syssram

struct _syssram syssram

holds the stored configuration value from the system SRAM area

Parameters
checksumholds the block checksum.
checksum_inholds the inverse block checksum
ead0unknown attribute
ead1unknown attribute
counter_biasbias value for the realtime clock
display_offsetHpixel offset for the VI
ntdunknown attribute
langlanguage of system
flagsdevice and operations flag

◆ syssramex

holds the stored configuration value from the extended SRAM area

Parameters
flash_id[2][12]96bit memorycard unlock flash ID
wirelessKbd_idDevice ID of last connected wireless keyboard
wirelessPad_id[4]16bit device ID of last connected pad.
dvderr_codelast non-recoverable error from DVD interface

◆ syswd_t

handle typedef for the alarm context

Function Documentation

◆ kprintf()

void kprintf ( const char *  str,
  ... 
)
Here is the caller graph for this function:

◆ SYS_AllocateFramebuffer()

void * SYS_AllocateFramebuffer ( GXRModeObj rmode)

Allocate cacheline aligned memory for the external framebuffer based on the rendermode object.

Parameters
[in]rmodepointer to the video/render mode configuration
Returns
pointer to the framebuffer's startaddress. NOTE: Address returned is aligned to a 32byte boundery!
Here is the call graph for this function:
Here is the caller graph for this function:

◆ SYS_CancelAlarm()

s32 SYS_CancelAlarm ( syswd_t  thealarm)

Cancel the alarm, but do not remove from the list of contexts.

Parameters
[in]thealarmidentifier to the alram context to be canceled
Returns
0 on succuess, non-zero on error
Here is the call graph for this function:
Here is the caller graph for this function:

◆ SYS_CreateAlarm()

s32 SYS_CreateAlarm ( syswd_t thealarm)

Create/initialize sysalarm structure.

Parameters
[in]thealarmpointer to the handle to store the created alarm context identifier
Returns
0 on succuess, non-zero on error
Here is the call graph for this function:
Here is the caller graph for this function:

◆ SYS_DumpPMC()

void SYS_DumpPMC ( )

◆ SYS_GetArena1Hi()

void* SYS_GetArena1Hi ( )

◆ SYS_GetArena1Lo()

void* SYS_GetArena1Lo ( )
Here is the caller graph for this function:

◆ SYS_GetArena1Size()

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

◆ SYS_GetFontEncoding()

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

◆ SYS_GetFontTexel()

void SYS_GetFontTexel ( s32  c,
void image,
s32  pos,
s32  stride,
s32 width 
)

◆ SYS_GetFontTexture()

void SYS_GetFontTexture ( s32  c,
void **  image,
s32 xpos,
s32 ypos,
s32 width 
)

◆ SYS_GetWirelessID()

u32 SYS_GetWirelessID ( u32  chan)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ SYS_Init()

void SYS_Init ( )
Deprecated:
Performs basic system initialization such as EXI init etc. This function is called from within the crt0 startup code.
Returns
none
Here is the call graph for this function:

◆ SYS_InitFont()

u32 SYS_InitFont ( sys_fontheader font_data)
Here is the call graph for this function:

◆ SYS_ProtectRange()

void SYS_ProtectRange ( u32  chan,
void addr,
u32  bytes,
u32  cntrl 
)
Here is the call graph for this function:

◆ SYS_RegisterResetFunc()

void SYS_RegisterResetFunc ( sys_resetinfo info)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ SYS_RemoveAlarm()

s32 SYS_RemoveAlarm ( syswd_t  thealarm)

Remove the given alarm context from the list of contexts and destroy it.

Parameters
[in]thealarmidentifier to the alarm context to be removed and destroyed
Returns
0 on succuess, non-zero on error
Here is the call graph for this function:
Here is the caller graph for this function:

◆ SYS_ResetButtonDown()

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

◆ SYS_ResetSystem()

void SYS_ResetSystem ( s32  reset,
u32  reset_code,
s32  force_menu 
)
Here is the caller graph for this function:

◆ SYS_SetAlarm()

s32 SYS_SetAlarm ( syswd_t  thealarm,
const struct timespec *  tp,
alarmcallback  cb,
void cbarg 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ SYS_SetArena1Hi()

void SYS_SetArena1Hi ( void newHi)

◆ SYS_SetArena1Lo()

void SYS_SetArena1Lo ( void newLo)
Here is the caller graph for this function:

◆ SYS_SetPeriodicAlarm()

s32 SYS_SetPeriodicAlarm ( syswd_t  thealarm,
const struct timespec *  tp_start,
const struct timespec *  tp_period,
alarmcallback  cb,
void cbarg 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ SYS_SetResetCallback()

resetcallback SYS_SetResetCallback ( resetcallback  cb)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ SYS_SetWirelessID()

void SYS_SetWirelessID ( u32  chan,
u32  id 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ SYS_StartPMC()

void SYS_StartPMC ( u32  mcr0val,
u32  mcr1val 
)

◆ SYS_StopPMC()

void SYS_StopPMC ( )

◆ SYS_SwitchFiber()

void SYS_SwitchFiber ( u32  arg0,
u32  arg1,
u32  arg2,
u32  arg3,
u32  pc,
u32  newsp 
)
Here is the caller graph for this function:

◆ SYS_Time()

u64 SYS_Time ( )
Here is the call graph for this function:

◆ SYS_UnregisterResetFunc()

void SYS_UnregisterResetFunc ( sys_resetinfo info)
Here is the call graph for this function:

Variable Documentation

◆ ATTRIBUTE_PACKED

struct _sys_fontheader ATTRIBUTE_PACKED