db_exception.c 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. /* Copyright (C) 2014 Stony Brook University
  2. This file is part of Graphene Library OS.
  3. Graphene Library OS is free software: you can redistribute it and/or
  4. modify it under the terms of the GNU Lesser General Public License
  5. as published by the Free Software Foundation, either version 3 of the
  6. License, or (at your option) any later version.
  7. Graphene Library OS is distributed in the hope that it will be useful,
  8. but WITHOUT ANY WARRANTY; without even the implied warranty of
  9. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  10. GNU Lesser General Public License for more details.
  11. You should have received a copy of the GNU Lesser General Public License
  12. along with this program. If not, see <http://www.gnu.org/licenses/>. */
  13. /*
  14. * db_signal.c
  15. *
  16. * This file contains APIs to set up handlers of exceptions issued by the
  17. * host, and the methods to pass the exceptions to the upcalls.
  18. */
  19. #include "api.h"
  20. #include "pal.h"
  21. #include "pal_defs.h"
  22. #include "pal_error.h"
  23. #include "pal_internal.h"
  24. typedef void (*PAL_UPCALL)(PAL_PTR, PAL_NUM, PAL_CONTEXT*);
  25. int (*_DkExceptionHandlers[PAL_EVENT_NUM_BOUND])(int, PAL_UPCALL, int) = {
  26. /* reserved */ NULL,
  27. /* DivZero */ NULL,
  28. /* MemFault */ NULL,
  29. /* Illegal */ NULL,
  30. /* Quit */ NULL,
  31. /* Suspend */ NULL,
  32. /* Resume */ NULL,
  33. /* Failure */ NULL,
  34. };
  35. void _DkRaiseFailure(int error) {
  36. /* needs to be implemented */
  37. }
  38. void _DkExceptionReturn(void* event) {
  39. /* needs to be implemented */
  40. }