iPXE
reboot.h
Go to the documentation of this file.
00001 #ifndef _IPXE_REBOOT_H
00002 #define _IPXE_REBOOT_H
00003 
00004 /** @file
00005  *
00006  * iPXE reboot API
00007  *
00008  */
00009 
00010 FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL );
00011 
00012 #include <ipxe/api.h>
00013 #include <config/reboot.h>
00014 
00015 /**
00016  * Calculate static inline reboot API function name
00017  *
00018  * @v _prefix           Subsystem prefix
00019  * @v _api_func         API function
00020  * @ret _subsys_func    Subsystem API function
00021  */
00022 #define REBOOT_INLINE( _subsys, _api_func ) \
00023         SINGLE_API_INLINE ( REBOOT_PREFIX_ ## _subsys, _api_func )
00024 
00025 /**
00026  * Provide an reboot API implementation
00027  *
00028  * @v _prefix           Subsystem prefix
00029  * @v _api_func         API function
00030  * @v _func             Implementing function
00031  */
00032 #define PROVIDE_REBOOT( _subsys, _api_func, _func ) \
00033         PROVIDE_SINGLE_API ( REBOOT_PREFIX_ ## _subsys, _api_func, _func )
00034 
00035 /**
00036  * Provide a static inline reboot API implementation
00037  *
00038  * @v _prefix           Subsystem prefix
00039  * @v _api_func         API function
00040  */
00041 #define PROVIDE_REBOOT_INLINE( _subsys, _api_func ) \
00042         PROVIDE_SINGLE_API_INLINE ( REBOOT_PREFIX_ ## _subsys, _api_func )
00043 
00044 /* Include all architecture-independent reboot API headers */
00045 #include <ipxe/null_reboot.h>
00046 #include <ipxe/efi/efi_reboot.h>
00047 
00048 /* Include all architecture-dependent reboot API headers */
00049 #include <bits/reboot.h>
00050 
00051 /**
00052  * Reboot system
00053  *
00054  * @v warm              Perform a warm reboot
00055  */
00056 void reboot ( int warm );
00057 
00058 /**
00059  * Power off system
00060  *
00061  * @ret rc              Return status code
00062  *
00063  * This function may fail, since not all systems support being powered
00064  * off by software.
00065  */
00066 int poweroff ( void );
00067 
00068 #endif /* _IPXE_REBOOT_H */