svc_common.h 646 B

1234567891011121314151617181920212223242526272829
  1. // Copyright 2020 yuzu emulator team
  2. // Licensed under GPLv2 or any later version
  3. // Refer to the license.txt file included.
  4. #pragma once
  5. #include "common/common_types.h"
  6. namespace Kernel {
  7. using Handle = u32;
  8. }
  9. namespace Kernel::Svc {
  10. constexpr s32 ArgumentHandleCountMax = 0x40;
  11. constexpr u32 HandleWaitMask{1u << 30};
  12. constexpr inline Handle InvalidHandle = Handle(0);
  13. enum PseudoHandle : Handle {
  14. CurrentThread = 0xFFFF8000,
  15. CurrentProcess = 0xFFFF8001,
  16. };
  17. constexpr bool IsPseudoHandle(Handle handle) {
  18. return handle == PseudoHandle::CurrentProcess || handle == PseudoHandle::CurrentThread;
  19. }
  20. } // namespace Kernel::Svc