syscall.c 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  1. /*++
  2. Copyright (c) 2014 Minoca Corp. All Rights Reserved
  3. Module Name:
  4. syscall.c
  5. Abstract:
  6. This module implements support infrastructure for system calls in the OS
  7. base library.
  8. Author:
  9. Evan Green 11-Nov-2014
  10. Environment:
  11. User Mode
  12. --*/
  13. //
  14. // ------------------------------------------------------------------- Includes
  15. //
  16. #include "../osbasep.h"
  17. //
  18. // ---------------------------------------------------------------- Definitions
  19. //
  20. //
  21. // ------------------------------------------------------ Data Type Definitions
  22. //
  23. //
  24. // ----------------------------------------------- Internal Function Prototypes
  25. //
  26. INTN
  27. OspSysenterSystemCall (
  28. ULONG SystemCallNumber,
  29. PVOID SystemCallParameter
  30. );
  31. //
  32. // -------------------------------------------------------------------- Globals
  33. //
  34. POS_SYSTEM_CALL OsSystemCall = OspSystemCallFull;
  35. //
  36. // ------------------------------------------------------------------ Functions
  37. //
  38. VOID
  39. OspSetUpSystemCalls (
  40. VOID
  41. )
  42. /*++
  43. Routine Description:
  44. This routine sets up the system call handler.
  45. Arguments:
  46. None.
  47. Return Value:
  48. None.
  49. --*/
  50. {
  51. PUSER_SHARED_DATA UserData;
  52. UserData = OspGetUserSharedData();
  53. if ((UserData->ProcessorFeatures & X86_FEATURE_SYSENTER) != 0) {
  54. OsSystemCall = OspSysenterSystemCall;
  55. }
  56. return;
  57. }
  58. //
  59. // --------------------------------------------------------- Internal Functions
  60. //