VxWorks Reference Manual : Libraries
rebootLib - reboot support library
reboot( ) - reset network devices and transfer control to boot ROMs
rebootHookAdd( ) - add a routine to be called at reboot
This library provides reboot support. To restart VxWorks, the routine reboot( ) can be called at any time by typing CTRL-X from the shell. Shutdown routines can be added with rebootHookAdd( ). These are typically used to reset or synchronize hardware. For example, netLib adds a reboot hook to cause all network interfaces to be reset. Once the reboot hooks have been run, sysToMonitor( ) is called to transfer control to the boot ROMs. For more information, see the manual entry for bootInit.
The order in which hooks are added is the order in which they are run. As a result, netLib will kill the network, and no user-added hook routines will be able to use the network. There is no rebootHookDelete( ) routine.
rebootLib.h
rebootLib, sysLib, bootConfig, bootInit
reboot( ) - reset network devices and transfer control to boot ROMs
void reboot ( int startType /* how the boot ROMS will reboot */ )
This routine returns control to the boot ROMs after calling a series of preliminary shutdown routines that have been added via rebootHookAdd( ), including routines to reset all network devices. After calling the shutdown routines, interrupts are locked, all caches are cleared, and control is transferred to the boot ROMs.
The bit values for startType are defined in sysLib.h:
- BOOT_NORMAL (0x00)
- causes the system to go through the countdown sequence and try to reboot VxWorks automatically. Memory is not cleared.
- BOOT_NO_AUTOBOOT (0x01)
- causes the system to display the VxWorks boot prompt and wait for user input to the boot ROM monitor. Memory is not cleared.
- BOOT_CLEAR (0x02)
- the same as BOOT_NORMAL, except that memory is cleared.
- BOOT_QUICK_AUTOBOOT (0x04)
- the same as BOOT_NORMAL, except the countdown is shorter.
N/A
rebootLib, sysToMonitor( ), rebootHookAdd( ), VxWorks Programmer's Guide: Target Shell, windsh, Tornado User's Guide: Shell
rebootHookAdd( ) - add a routine to be called at reboot
STATUS rebootHookAdd ( FUNCPTR rebootHook /* routine to be called at reboot */ )
This routine adds the specified routine to a list of routines to be called when VxWorks is rebooted. The specified routine should be declared as follows:
void rebootHook ( int startType /* startType is passed to all hooks */ )
OK, or ERROR if memory is insufficient.