config_mem.h 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  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. // Configuration memory stores various hardware/kernel configuration settings. This memory page is
  6. // read-only for ARM11 processes. I'm guessing this would normally be written to by the firmware/
  7. // bootrom. Because we're not emulating this, and essentially just "stubbing" the functionality, I'm
  8. // putting this as a subset of HLE for now.
  9. #include "common/common_funcs.h"
  10. #include "common/common_types.h"
  11. #include "common/swap.h"
  12. #include "core/memory.h"
  13. ////////////////////////////////////////////////////////////////////////////////////////////////////
  14. namespace ConfigMem {
  15. struct ConfigMemDef {
  16. u8 kernel_unk; // 0
  17. u8 kernel_version_rev; // 1
  18. u8 kernel_version_min; // 2
  19. u8 kernel_version_maj; // 3
  20. u32_le update_flag; // 4
  21. u64_le ns_tid; // 8
  22. u32_le sys_core_ver; // 10
  23. u8 unit_info; // 14
  24. u8 boot_firm; // 15
  25. u8 prev_firm; // 16
  26. INSERT_PADDING_BYTES(0x1); // 17
  27. u32_le ctr_sdk_ver; // 18
  28. INSERT_PADDING_BYTES(0x30 - 0x1C); // 1C
  29. u32_le app_mem_type; // 30
  30. INSERT_PADDING_BYTES(0x40 - 0x34); // 34
  31. u32_le app_mem_alloc; // 40
  32. u32_le sys_mem_alloc; // 44
  33. u32_le base_mem_alloc; // 48
  34. INSERT_PADDING_BYTES(0x60 - 0x4C); // 4C
  35. u8 firm_unk; // 60
  36. u8 firm_version_rev; // 61
  37. u8 firm_version_min; // 62
  38. u8 firm_version_maj; // 63
  39. u32_le firm_sys_core_ver; // 64
  40. u32_le firm_ctr_sdk_ver; // 68
  41. INSERT_PADDING_BYTES(0x1000 - 0x6C); // 6C
  42. };
  43. static_assert(sizeof(ConfigMemDef) == Memory::CONFIG_MEMORY_SIZE,
  44. "Config Memory structure size is wrong");
  45. extern ConfigMemDef config_mem;
  46. void Init();
  47. } // namespace ConfigMem