/** Cached DHCPACK startup function */
struct startup_fn cachedhcp_startup_fn __startup_fn ( STARTUP_LATE ) = {
+ .name = "cachedhcp",
.startup = cachedhcp_startup,
};
/** Command line and initrd initialisation function */
struct startup_fn runtime_startup_fn __startup_fn ( STARTUP_NORMAL ) = {
+ .name = "runtime",
.startup = runtime_init,
};
}
struct startup_fn startup_undionly __startup_fn ( STARTUP_LATE ) = {
+ .name = "undionly",
.shutdown = undionly_shutdown,
};
/** initrd startup function */
struct startup_fn startup_initrd __startup_fn ( STARTUP_LATE ) = {
+ .name = "initrd",
.startup = initrd_startup,
};
/** Keypress injection startup function */
struct startup_fn bios_inject_startup_fn __startup_fn ( STARTUP_NORMAL ) = {
+ .name = "bios_inject",
.startup = bios_inject_startup,
.shutdown = bios_inject_shutdown,
};
/** Hide Etherboot startup function */
struct startup_fn hide_etherboot_startup_fn __startup_fn ( STARTUP_EARLY ) = {
+ .name = "hidemem",
.startup = hide_etherboot,
.shutdown = unhide_etherboot,
};
}
struct startup_fn startup_devices __startup_fn ( STARTUP_NORMAL ) = {
+ .name = "devices",
.startup = probe_devices,
.shutdown = remove_devices,
};
/** "startup() has been called" flag */
static int started = 0;
+/** Colour for debug messages */
+#define colour table_start ( INIT_FNS )
+
/**
* Initialise iPXE
*
/* Call registered startup functions */
for_each_table_entry ( startup_fn, STARTUP_FNS ) {
- if ( startup_fn->startup )
+ if ( startup_fn->startup ) {
+ DBGC ( colour, "INIT startup %s...\n",
+ startup_fn->name );
startup_fn->startup();
+ }
}
started = 1;
+ DBGC ( colour, "INIT startup complete\n" );
}
/**
/* Call registered shutdown functions (in reverse order) */
for_each_table_entry_reverse ( startup_fn, STARTUP_FNS ) {
- if ( startup_fn->shutdown )
+ if ( startup_fn->shutdown ) {
+ DBGC ( colour, "INIT shutdown %s...\n",
+ startup_fn->name );
startup_fn->shutdown ( flags );
+ }
}
/* Reset console */
console_reset();
started = 0;
+ DBGC ( colour, "INIT shutdown complete\n" );
}
/** Memory allocator shutdown function */
struct startup_fn heap_startup_fn __startup_fn ( STARTUP_EARLY ) = {
+ .name = "heap",
.shutdown = shutdown_cache,
};
/** Serial console startup function */
struct startup_fn serial_startup_fn __startup_fn ( STARTUP_EARLY ) = {
+ .name = "serial",
.shutdown = serial_shutdown,
};
/** RBG startup table entry */
struct startup_fn startup_rbg __startup_fn ( STARTUP_NORMAL ) = {
+ .name = "rbg",
.startup = rbg_startup_fn,
.shutdown = rbg_shutdown_fn,
};
/** Root certificate initialiser */
struct startup_fn rootcert_startup_fn __startup_fn ( STARTUP_LATE ) = {
+ .name = "rootcert",
.startup = rootcert_init,
};
/** Startup/shutdown function */
struct startup_fn ehci_startup __startup_fn ( STARTUP_LATE ) = {
+ .name = "ehci",
.shutdown = ehci_shutdown,
};
/** Startup/shutdown function */
struct startup_fn xhci_startup __startup_fn ( STARTUP_LATE ) = {
+ .name = "xhci",
.shutdown = xhci_shutdown,
};
}
struct startup_fn startup_linux_args __startup_fn(STARTUP_EARLY) = {
+ .name = "linux_args",
.startup = linux_args_parse,
.shutdown = linux_args_cleanup,
};
* part of the calls to startup() and shutdown().
*/
struct startup_fn {
+ const char *name;
void ( * startup ) ( void );
void ( * shutdown ) ( int booting );
};
/** Timer tick startup function */
struct startup_fn efi_tick_startup_fn __startup_fn ( STARTUP_EARLY ) = {
+ .name = "efi_tick",
.startup = efi_tick_startup,
.shutdown = efi_tick_shutdown,
};
}
struct startup_fn linux_console_startup_fn __startup_fn(STARTUP_EARLY) = {
+ .name = "linux_console",
.startup = linux_console_startup,
.shutdown = linux_console_shutdown,
};
/** TCP shutdown function */
struct startup_fn tcp_startup_fn __startup_fn ( STARTUP_LATE ) = {
+ .name = "tcp",
.shutdown = tcp_shutdown,
};