coprocessor.cpp 878 B

123456789101112131415161718192021222324252627282930313233
  1. // Copyright 2014 Citra Emulator Project
  2. // Licensed under GPLv2 or any later version
  3. // Refer to the license.txt file included.
  4. #include "core/hle/coprocessor.h"
  5. #include "core/hle/hle.h"
  6. #include "core/mem_map.h"
  7. namespace HLE {
  8. /// Returns the coprocessor (in this case, syscore) command buffer pointer
  9. Addr GetThreadCommandBuffer() {
  10. // Called on insruction: mrc p15, 0, r0, c13, c0, 3
  11. return Memory::KERNEL_MEMORY_VADDR;
  12. }
  13. /// Call an MRC (move to ARM register from coprocessor) instruction in HLE
  14. s32 CallMRC(u32 instruction) {
  15. CoprocessorOperation operation = (CoprocessorOperation)((instruction >> 20) & 0xFF);
  16. switch (operation) {
  17. case CALL_GET_THREAD_COMMAND_BUFFER:
  18. return GetThreadCommandBuffer();
  19. default:
  20. DEBUG_LOG(OSHLE, "unknown MRC call 0x%08X", instruction);
  21. break;
  22. }
  23. return -1;
  24. }
  25. } // namespace