svc_common.h 808 B

123456789101112131415161718192021222324252627282930313233343536
  1. // SPDX-FileCopyrightText: Copyright 2020 yuzu Emulator Project
  2. // SPDX-License-Identifier: GPL-2.0-or-later
  3. #pragma once
  4. #include "common/common_types.h"
  5. #include "common/literals.h"
  6. namespace Kernel {
  7. using Handle = u32;
  8. }
  9. namespace Kernel::Svc {
  10. using namespace Common::Literals;
  11. constexpr inline s32 ArgumentHandleCountMax = 0x40;
  12. constexpr inline u32 HandleWaitMask = 1u << 30;
  13. constexpr inline s64 WaitInfinite = -1;
  14. constexpr inline std::size_t HeapSizeAlignment = 2_MiB;
  15. constexpr inline Handle InvalidHandle = Handle(0);
  16. enum PseudoHandle : Handle {
  17. CurrentThread = 0xFFFF8000,
  18. CurrentProcess = 0xFFFF8001,
  19. };
  20. constexpr bool IsPseudoHandle(Handle handle) {
  21. return handle == PseudoHandle::CurrentProcess || handle == PseudoHandle::CurrentThread;
  22. }
  23. } // namespace Kernel::Svc