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"

Classes

struct  _syssram
struct  _syssramex
struct  _sys_fontheader
struct  _sys_resetinfo

Defines

#define SYS_WD_NULL   0xffffffff
#define SYS_RESTART   0
#define SYS_HOTRESET   1
#define SYS_SHUTDOWN   2
#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 MEM_VIRTUAL_TO_PHYSICAL(x)   (((u32)(x))&~0xC0000000)
#define MEM_PHYSICAL_TO_K0(x)   (void*)((u32)(x)|0x80000000)
#define MEM_PHYSICAL_TO_K1(x)   (void*)((u32)(x)|0xC0000000)
#define MEM_K0_TO_K1(x)   (void*)((u32)(x)|0x40000000)
#define MEM_K1_TO_K0(x)   (void*)((u32)(x)&~0x40000000)

Typedefs

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

Functions

void SYS_Init ()
void * SYS_AllocateFramebuffer (GXRModeObj *rmode)
 Allocate cacheline aligned memory for the external framebuffer based on the rendermode object.
s32 SYS_ConsoleInit (GXRModeObj *rmode, s32 conXOrigin, s32 conYOrigin, s32 conWidth, s32 conHeight)
 Initialize stdout console.
void SYS_ProtectRange (u32 chan, void *addr, u32 bytes, u32 cntrl)
resetcallback SYS_SetResetCallback (resetcallback cb)
void SYS_StartPMC (u32 mcr0val, u32 mcr1val)
void SYS_DumpPMC ()
void SYS_StopPMC ()
s32 SYS_CreateAlarm (syswd_t *thealarm)
 Create/initialize sysalarm structure.
s32 SYS_SetAlarm (syswd_t thealarm, const struct timespec *tp, alarmcallback cb)
 Set the alarm parameters for a one-shot alarm, add to the list of alarms and start.
s32 SYS_SetPeriodicAlarm (syswd_t thealarm, const struct timespec *tp_start, const struct timespec *tp_period, alarmcallback cb)
 Set the alarm parameters for a periodioc alarm, add to the list of alarms and start. The alarm and interval persists as long as SYS_CancelAlarm() isn't called.
s32 SYS_RemoveAlarm (syswd_t thealarm)
 Remove the given alarm context from the list of contexts and destroy it.
s32 SYS_CancelAlarm (syswd_t thealarm)
 Cancel the alarm, but do not remove from the list of contexts.
void SYS_SetWirelessID (u32 chan, u32 id)
u32 SYS_GetWirelessID (u32 chan)
u32 SYS_GetFontEncoding ()
u32 SYS_InitFont (sys_fontheader *font_header)
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)


Detailed Description

OS functions and initialization.


Typedef Documentation

struct _syssram syssram

holds the stored configuration value from the system SRAM area

Parameters:
checksum holds the block checksum.
checksum_in holds the inverse block checksum
ead0 unknown attribute
ead1 unknown attribute
counter_bias bias value for the realtime clock
display_offsetH pixel offset for the VI
ntd unknown attribute
lang language of system
flags device and operations flag

struct _syssramex syssramex

holds the stored configuration value from the extended SRAM area

Parameters:
flash_id[2][12] 96bit memorycard unlock flash ID
wirelessKbd_id Device ID of last connected wireless keyboard
wirelessPad_id[4] 16bit device ID of last connected pad.
dvderr_code last non-recoverable error from DVD interface
__padding0 padding
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] rmode pointer 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] thealarm identifier to the alram context to be canceled
Returns:
0 on succuess, non-zero on error

s32 SYS_ConsoleInit ( GXRModeObj rmode,
s32  conXOrigin,
s32  conYOrigin,
s32  conWidth,
s32  conHeight 
)

Initialize stdout console.

Parameters:
[in] rmode pointer to the video/render mode configuration
[in] conXOrigin starting pixel in X direction of the console output on the external framebuffer
[in] conYOrigin starting pixel in Y direction of the console output on the external framebuffer
[in] conWidth width of the console output 'window' to be drawn
[in] conHeight height of the console output 'window' to be drawn
Returns:
0 on success, <0 on error

s32 SYS_CreateAlarm ( syswd_t thealarm  ) 

Create/initialize sysalarm structure.

Parameters:
[in] thealarm pointer 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] thealarm identifier to the alarm context to be removed and destroyed
Returns:
0 on succuess, non-zero on error

s32 SYS_SetAlarm ( syswd_t  thealarm,
const struct timespec *  tp,
alarmcallback  cb 
)

Set the alarm parameters for a one-shot alarm, add to the list of alarms and start.

Parameters:
[in] thealarm identifier to the alarm context to be initialize for a one-shot alarm
[in] tp pointer to timespec structure holding the time to fire the alarm
[in] cb pointer to callback which is called when the alarm fires.
Returns:
0 on succuess, non-zero on error

s32 SYS_SetPeriodicAlarm ( syswd_t  thealarm,
const struct timespec *  tp_start,
const struct timespec *  tp_period,
alarmcallback  cb 
)

Set the alarm parameters for a periodioc alarm, add to the list of alarms and start. The alarm and interval persists as long as SYS_CancelAlarm() isn't called.

Parameters:
[in] thealarm identifier to the alarm context to be initialized for a periodic alarm
[in] tp_start pointer to timespec structure holding the time to fire first time the alarm
[in] tp_period pointer to timespec structure holding the interval for all following alarm triggers.
[in] cb pointer to callback which is called when the alarm fires.
Returns:
0 on succuess, non-zero on error


Generated on Sun Feb 4 18:14:34 2007 for libOGC by  doxygen 1.4.7