OS_RebootSystem

Syntax

#include <nitro/os.h>

BOOL OS_RebootSystem( void );

Arguments

None.

Return Values

Returns FALSE if the reboot fails for the following reasons.

- This function was called while in NITRO mode.
- POWER was pressed and the system is already shutting down.

Control will not return from this function if the reset was successful. Thus, the function does not return TRUE.

Description

Performs a hardware reset and restarts the calling application.

From an application's point of view, this is the same as manually restarting the same application after running the OS_JumpToSystemMenu function.

Use the OS_IsRebooted function to determine whether the running application was booted directly from the System Menu or was restarted with this function.

This function uses the PM_ForceToResetHardware function from the PM library. If the purpose is to have the application restart itself, do not directly call the PM_ForceToResetHardware function. Call the OS_RebootSystem function instead.

This function cannot be called when interrupts are disabled.
Because this function cannot be called during the exit process either, take care that it is not executed from within an exit callback registered using functions such as the PM_Append*ExitCallback functions.

This function only executes in TWL mode. In NITRO mode (when NITRO ROM is running and when HYBRID ROM is running on the NITRO), the function returns FALSE.

The function does not return TRUE because if it executes successfully control will not return. FALSE is returned either because, as mentioned above, the function has been called in NITRO mode, or because POWER has been pressed and the system is already shutting down. The specifications do not allow the function to execute in NITRO mode, so a return of FALSE for this reason does not indicate a problem within the program. On the actual console, the latter cause is the only reason FALSE is returned. The next step must be either a shutdown or hardware reset. If FALSE is returned, end all game processes and immediately prepare for quitting.

See Also

PM_ForceToResetHardware
OS_IsRebooted
PM_Append*ExitCallback
PM_Prepend*ExitCallback
PM_Insert*ExitCallback

Revision History

2008/12/08 Described the conditions for return of FALSE.
2008/10/22 Added mention that execution is prohibited during the ending process.
2008/09/09 Initial version.


CONFIDENTIAL