Reset Functions and Shutdown Functions

Introduction

The Revolution SDK provides several functions for executing operations related to system state transitions such as reset/shutdown. An application needs to call these functions as appropriate when it detects that the Reset Button or Power Button has been pressed or when it wants to terminate the execution.

Functions


void OSRebootSystem(void);
void OSShutdownSystem(void);
void OSRestart(u32 resetCode);
void OSReturnToMenu(void);
  

Description

The four functions listed above are provided as APIs for implementing reset/shutdown processing. OSRebootSystem restarts the system; OSShutdownSystem shuts down the system; OSRestart restarts the current application; and OSReturnToMenu executes processes necessary to return to the system menu. For details on these functions, see the separate function description available for each.

When called, these reset/shutdown functions internally execute processes that terminate each sub-system.

Caution

Note the following before calling a reset/shutdown function.

[Required] Something that can result in a fatal error such as a system hang-up.
Callbacks: An error may occur when a reset/shutdown fuction is called if a user callback/handler that might call any of the following APIs is present.
  • Initialization APIs for audio related libraries (AXInit(), AIInit(), ARInit(), etc.)
  • GX API
These Reset/Shutdown functions shut down all subsystems before all interrupts are disabled and all user alarms are canceled. This means that if there's a unfinished asynchronous API or a valid alarm when this function is called, the associated callback/handler can be called after these subsystems are shut down from inside this function. If the callback/handler attempts to use any subsystem after shutdown, it fails and may cause a critical problem (for example, hangup) that depends on the particular subsystem. The above is the list of APIs that can cause a problem. If the system hangs after calling Reset/Shutdown functions, be sure to check if any of the callbacks or handlers are using one of the above APIs.
[Recommended] A recommended item is one that is recommended, but not fatal as reset may be delayed if not implemented.
Audio: We strongly recommend that all audio subsystems be terminated before calling a reset/shutdown function. This caution is taken for two reasons. First, it may take time to shut down the audio subsystem from within the API if they are not terminated before the Reset/Shutdown function is called. Second, there is no guarantee that the reset/shutdown function will stop the audio without generating noise.
NAND Flash, SD Memory Card, GC Memory Card We strongly recommend that reset/shutdown functions not be called until all NAND flash and Memory Card operations are complete. Otherwise, it may take a relatively long time for a hot reset to be issued. This is because the reset/shutdown functions unmount any currently mounted Memory Cards.
VI: Since it's not guaranteed that frame buffers are kept unchanged during reset/shutdown procedures, it's recommended that the application call VISetBlack(TRUE)(and call VIFlush(), VIWaitForRetrace() to wait until the screen turns into black) . Note that reset/shutdown functions do not call VISetBlack(TRUE) inside the API.
Optical Disc Drive: We recommend that any DVD functions not be called before calling a reset/shutdown function. There is no need to call DVDCancel(Async), DVDCancelAll(Async), or DVDClose for reset/shutdown. Reset/shutdown functions cancel all optical disc drive requests inside the API. For this reason, it may take a long time to issue a reset/shutdown to cancel them if there are incomplete optical disc drive processes.
[Other Notes]
Reset/shutdown functions suspend the thread scheduler inside the function. Once this API is called, user threads will never be executed.
The Revolution SDK does not use the Broadway's segmented address translation mechanism by MMU or access any related registers including SDR1 and SRn. If the application manually activates the segmented address translation mechanism, the register must be reverted to the original state before the restart via OS_RESET_RESTART. Otherwise, unexpected program behavior could occur.
The contents of all data in memory are not guaranteed if the system is rebooted.

CAUTION: These APIs must not be called from inside a callback. Its behavior in a callback is not guaranteed.

See Also

Reset/Shutdown Functions

Revision History

08/10/2006 Initial version.


CONFIDENTIAL