svc.h 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. // Copyright 2018 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. struct MemoryInfo {
  8. u64 base_address;
  9. u64 size;
  10. u32 type;
  11. u32 attributes;
  12. u32 permission;
  13. u32 device_refcount;
  14. u32 ipc_refcount;
  15. INSERT_PADDING_WORDS(1);
  16. };
  17. static_assert(sizeof(MemoryInfo) == 0x28, "MemoryInfo has incorrect size.");
  18. struct PageInfo {
  19. u64 flags;
  20. };
  21. /// Values accepted by svcGetInfo
  22. enum class GetInfoType : u64 {
  23. // 1.0.0+
  24. AllowedCpuIdBitmask = 0,
  25. AllowedThreadPrioBitmask = 1,
  26. MapRegionBaseAddr = 2,
  27. MapRegionSize = 3,
  28. HeapRegionBaseAddr = 4,
  29. HeapRegionSize = 5,
  30. TotalMemoryUsage = 6,
  31. TotalHeapUsage = 7,
  32. IsCurrentProcessBeingDebugged = 8,
  33. ResourceHandleLimit = 9,
  34. IdleTickCount = 10,
  35. RandomEntropy = 11,
  36. PerformanceCounter = 0xF0000002,
  37. // 2.0.0+
  38. AddressSpaceBaseAddr = 12,
  39. AddressSpaceSize = 13,
  40. NewMapRegionBaseAddr = 14,
  41. NewMapRegionSize = 15,
  42. // 3.0.0+
  43. IsVirtualAddressMemoryEnabled = 16,
  44. PersonalMmHeapUsage = 17,
  45. TitleId = 18,
  46. // 4.0.0+
  47. PrivilegedProcessId = 19,
  48. // 5.0.0+
  49. UserExceptionContextAddr = 20,
  50. };
  51. void CallSVC(u32 immediate);
  52. } // namespace Kernel