You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

reboot.h 1.4KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. #ifndef _IPXE_REBOOT_H
  2. #define _IPXE_REBOOT_H
  3. /** @file
  4. *
  5. * iPXE reboot API
  6. *
  7. */
  8. FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL );
  9. #include <ipxe/api.h>
  10. #include <config/reboot.h>
  11. /**
  12. * Calculate static inline reboot API function name
  13. *
  14. * @v _prefix Subsystem prefix
  15. * @v _api_func API function
  16. * @ret _subsys_func Subsystem API function
  17. */
  18. #define REBOOT_INLINE( _subsys, _api_func ) \
  19. SINGLE_API_INLINE ( REBOOT_PREFIX_ ## _subsys, _api_func )
  20. /**
  21. * Provide an reboot API implementation
  22. *
  23. * @v _prefix Subsystem prefix
  24. * @v _api_func API function
  25. * @v _func Implementing function
  26. */
  27. #define PROVIDE_REBOOT( _subsys, _api_func, _func ) \
  28. PROVIDE_SINGLE_API ( REBOOT_PREFIX_ ## _subsys, _api_func, _func )
  29. /**
  30. * Provide a static inline reboot API implementation
  31. *
  32. * @v _prefix Subsystem prefix
  33. * @v _api_func API function
  34. */
  35. #define PROVIDE_REBOOT_INLINE( _subsys, _api_func ) \
  36. PROVIDE_SINGLE_API_INLINE ( REBOOT_PREFIX_ ## _subsys, _api_func )
  37. /* Include all architecture-independent reboot API headers */
  38. #include <ipxe/null_reboot.h>
  39. #include <ipxe/efi/efi_reboot.h>
  40. /* Include all architecture-dependent reboot API headers */
  41. #include <bits/reboot.h>
  42. /**
  43. * Reboot system
  44. *
  45. * @v warm Perform a warm reboot
  46. */
  47. void reboot ( int warm );
  48. /**
  49. * Power off system
  50. *
  51. * @ret rc Return status code
  52. *
  53. * This function may fail, since not all systems support being powered
  54. * off by software.
  55. */
  56. int poweroff ( void );
  57. #endif /* _IPXE_REBOOT_H */