svc.h 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. // Copyright 2014 Citra Emulator Project
  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. ////////////////////////////////////////////////////////////////////////////////////////////////////
  7. // SVC types
  8. struct MemoryInfo {
  9. u32 base_address;
  10. u32 size;
  11. u32 permission;
  12. u32 state;
  13. };
  14. struct PageInfo {
  15. u32 flags;
  16. };
  17. ////////////////////////////////////////////////////////////////////////////////////////////////////
  18. // Namespace SVC
  19. namespace SVC {
  20. /// Values accepted by svcGetSystemInfo's type parameter.
  21. enum class SystemInfoType {
  22. /**
  23. * Reports total used memory for all regions or a specific one, according to the extra
  24. * parameter. See `SystemInfoMemUsageRegion`.
  25. */
  26. REGION_MEMORY_USAGE = 0,
  27. /**
  28. * Returns the memory usage for certain allocations done internally by the kernel.
  29. */
  30. KERNEL_ALLOCATED_PAGES = 2,
  31. /**
  32. * "This returns the total number of processes which were launched directly by the kernel.
  33. * For the ARM11 NATIVE_FIRM kernel, this is 5, for processes sm, fs, pm, loader, and pxi."
  34. */
  35. KERNEL_SPAWNED_PIDS = 26,
  36. };
  37. /**
  38. * Accepted by svcGetSystemInfo param with REGION_MEMORY_USAGE type. Selects a region to query
  39. * memory usage of.
  40. */
  41. enum class SystemInfoMemUsageRegion {
  42. ALL = 0,
  43. APPLICATION = 1,
  44. SYSTEM = 2,
  45. BASE = 3,
  46. };
  47. void CallSVC(u32 immediate);
  48. } // namespace