Leaked source code of windows server 2003
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.

80 lines
1.3 KiB

  1. #ifndef __EFI_MISC_STUFF__
  2. #define __EFI_MISC_STUFF__
  3. /*++
  4. Copyright (c) 1999 Microsoft Corporation
  5. Module Name:
  6. efimisc.hxx
  7. Abstract:
  8. a couple things to make our lives easier
  9. Revision History:
  10. --*/
  11. extern "C" {
  12. #include <efi.h>
  13. #include <efilib.h>
  14. }
  15. // a couple things to make our lives easier
  16. // BUGBUG
  17. // There doesn't seem to be any interlockedexchange compexchg or interlocked decrement/increment.
  18. // so we define some here that work.
  19. //
  20. // Note that these won't work since they aren't really atomic, but my assumption is that
  21. // EFI is a single threaded environment so this won't really matter.
  22. LONG
  23. InterlockedIncrement (
  24. IN OUT LONG* Addend
  25. );
  26. LONG
  27. InterlockedDecrement (
  28. IN OUT LONG* Addend
  29. );
  30. LONG
  31. InterlockedExchange (
  32. IN OUT LONG* Target,
  33. LONG Value
  34. );
  35. LONG
  36. InterlockedCompareExchange (
  37. IN OUT LONG* Destination,
  38. IN LONG ExChange,
  39. IN LONG Comperand
  40. );
  41. NTSTATUS
  42. NtDelayExecution (
  43. IN BOOLEAN Alertable,
  44. IN PLARGE_INTEGER DelayInterval
  45. );
  46. // this is in qsort.c in efisrc.
  47. void __cdecl qsort (
  48. void *base,
  49. unsigned num,
  50. unsigned width,
  51. int (__cdecl *comp)(const void *, const void *)
  52. );
  53. void
  54. _chkstk();
  55. void
  56. _aNchkstk();
  57. VOID
  58. EfiWaitForKey();
  59. #endif //__EFI_MISC_STUFF__