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 732B

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