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.

hooks.c 821B

123456789101112131415161718192021222324252627282930313233343536
  1. #include "registers.h"
  2. #include "main.h"
  3. #include "etherboot.h"
  4. #include "hooks.h"
  5. /* Symbols defined by the linker */
  6. extern char _bss[], _ebss[];
  7. /*
  8. * This file provides the basic entry points from assembly code. See
  9. * README.i386 for a description of the entry code path.
  10. *
  11. */
  12. /*
  13. * arch_main() : call main() and then exit via whatever exit mechanism
  14. * the prefix requested.
  15. *
  16. */
  17. void arch_main ( struct i386_all_regs *regs ) {
  18. void (*exit_path) ( struct i386_all_regs *regs );
  19. /* Determine exit path requested by prefix */
  20. exit_path = ( typeof ( exit_path ) ) regs->eax;
  21. /* Call to main() */
  22. regs->eax = main();
  23. if ( exit_path ) {
  24. /* Prefix requested that we use a particular function
  25. * as the exit path, so we call this function, which
  26. * must not return.
  27. */
  28. exit_path ( regs );
  29. }
  30. }