Du kannst nicht mehr als 25 Themen auswählen Themen müssen mit entweder einem Buchstaben oder einer Ziffer beginnen. Sie können Bindestriche („-“) enthalten und bis zu 35 Zeichen lang sein.

init.h 1.7KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. #ifndef _GPXE_INIT_H
  2. #define _GPXE_INIT_H
  3. #include <gpxe/tables.h>
  4. /**
  5. * An initialisation function
  6. *
  7. * Initialisation functions are called exactly once, as part of the
  8. * call to initialise().
  9. */
  10. struct init_fn {
  11. void ( * initialise ) ( void );
  12. };
  13. /** Declare an initialisation functon */
  14. #define __init_fn( init_order ) \
  15. __table ( struct init_fn, init_fns, init_order )
  16. /** @defgroup initfn_order Initialisation function ordering
  17. * @{
  18. */
  19. #define INIT_EARLY 01 /**< Early initialisation */
  20. #define INIT_SERIAL 02 /**< Serial driver initialisation */
  21. #define INIT_CONSOLE 03 /**< Console initialisation */
  22. #define INIT_NORMAL 04 /**< Normal initialisation */
  23. /** @} */
  24. /** Shutdown flags */
  25. enum shutdown_flags {
  26. /** Shutdown is in order to exit (return to gPXE's caller) */
  27. SHUTDOWN_EXIT = 0x0001,
  28. /** Shutdown is in order to boot an OS */
  29. SHUTDOWN_BOOT = 0x0002,
  30. /** Do not remove devices */
  31. SHUTDOWN_KEEP_DEVICES = 0x0004,
  32. };
  33. /**
  34. * A startup/shutdown function
  35. *
  36. * Startup and shutdown functions may be called multiple times, as
  37. * part of the calls to startup() and shutdown().
  38. */
  39. struct startup_fn {
  40. void ( * startup ) ( void );
  41. void ( * shutdown ) ( int flags );
  42. };
  43. /** Declare a startup/shutdown function */
  44. #define __startup_fn( startup_order ) \
  45. __table ( struct startup_fn, startup_fns, startup_order )
  46. /** @defgroup startfn_order Startup/shutdown function ordering
  47. *
  48. * Shutdown functions are called in the reverse order to startup
  49. * functions.
  50. *
  51. * @{
  52. */
  53. #define STARTUP_EARLY 01 /**< Early startup */
  54. #define STARTUP_NORMAL 02 /**< Normal startup */
  55. /** @} */
  56. extern void initialise ( void );
  57. extern void startup ( void );
  58. extern void shutdown ( int flags );
  59. #endif /* _GPXE_INIT_H */