libOGC  1.0
Data Structures | Defines | 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"

Data Structures

struct  _sys_fontheader
struct  _sys_resetinfo
struct  _syssram
struct  _syssramex

Defines

#define MEM_K0_TO_K1(x)   (void*)((u32)(x) + (SYS_BASE_UNCACHED - SYS_BASE_CACHED))
#define MEM_K0_TO_PHYSICAL(x)   (void*)((u32)(x) - SYS_BASE_CACHED)
#define MEM_K1_TO_K0(x)   (void*)((u32)(x) - (SYS_BASE_UNCACHED - SYS_BASE_CACHED))
#define MEM_K1_TO_PHYSICAL(x)   (void*)((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_VIRTUAL_TO_PHYSICAL(x)   (((u32)(x)) & ~SYS_BASE_UNCACHED)
#define SYS_BASE_CACHED   (0x80000000)
#define SYS_BASE_UNCACHED   (0xC0000000)
#define SYS_FONTSIZE_ANSI   (288 + 131072)
#define SYS_FONTSIZE_SJIS   (3840 + 1179648)
#define SYS_GetArenaHi   SYS_GetArena1Hi
#define SYS_GetArenaLo   SYS_GetArena1Lo
#define SYS_GetArenaSize   SYS_GetArena1Size
#define SYS_HOTRESET   1
#define SYS_POWEROFF   4
#define SYS_POWEROFF_IDLE   6
#define SYS_POWEROFF_STANDBY   5
#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_PROTECTRDWR   (SYS_PROTECTREAD|SYS_PROTECTWRITE)
#define SYS_PROTECTREAD   0x00000001
#define SYS_PROTECTWRITE   0x00000002
#define SYS_RESTART   0
#define SYS_RETURNTOMENU   3
#define SYS_SetArenaHi   SYS_SetArena1Hi
#define SYS_SetArenaLo   SYS_SetArena1Lo
#define SYS_SHUTDOWN   2
#define SYS_WD_NULL   0xffffffff

Typedefs

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

Functions

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

Variables

struct _syssram ATTRIBUTE_PACKED

Detailed Description

OS functions and initialization.


Typedef Documentation

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

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
__padding0padding
flashID_chksum[2]16bit checksum of unlock flash ID
__padding1[4]padding

Function Documentation

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!
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
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
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
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
 All Data Structures Files Functions Variables Typedefs Defines