osbasea.S 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105
  1. /*++
  2. Copyright (c) 2015 Minoca Corp. All Rights Reserved
  3. Module Name:
  4. osbasea.S
  5. Abstract:
  6. This module implements assembly support for the OS Base library.
  7. Author:
  8. Evan Green 17-Jan-2015
  9. Environment:
  10. User Mode
  11. --*/
  12. ##
  13. ## ------------------------------------------------------------------- Includes
  14. ##
  15. #include <minoca/x64.inc>
  16. ##
  17. ## ---------------------------------------------------------------- Definitions
  18. ##
  19. ##
  20. ## ----------------------------------------------------------------------- Code
  21. ##
  22. ASSEMBLY_FILE_HEADER
  23. ##
  24. ## INTN
  25. ## OspSystemCallFull (
  26. ## ULONG SystemCallNumber,
  27. ## PVOID SystemCallParameter
  28. ## )
  29. ##
  30. /*++
  31. Routine Description:
  32. This routine executes a system call using the traditional "int x" method.
  33. This method is highly compatible, but slow.
  34. Arguments:
  35. SystemCallNumber - Supplies the system call number.
  36. SystemCallParameter - Supplies the system call parameter.
  37. Return Value:
  38. STATUS_SUCCESS or positive integer on success.
  39. Error status code on failure.
  40. --*/
  41. FUNCTION(OspSystemCallFull)
  42. syscall # Just do that system call, params in rdi, rsi.
  43. ret # Return.
  44. END_FUNCTION(OspSystemCallFull)
  45. ##
  46. ## VOID
  47. ## OspSignalHandler (
  48. ## )
  49. ##
  50. /*++
  51. Routine Description:
  52. This routine is called directly by the kernel when a signal occurs. It
  53. marshals the parameters and calls the C routine for handling the signal.
  54. The parameters are stored on the stack with the signal parameters followed
  55. by the signal context.
  56. Arguments:
  57. None. The parameters are stored in registers, but do not conform to any C
  58. calling convention.
  59. Return Value:
  60. None.
  61. --*/
  62. FUNCTION(OspSignalHandler)
  63. call OspProcessSignal # Call the processing routine.
  64. int $3 # Execution should never get back here.
  65. END_FUNCTION(OspSignalHandler)