coprocessor.cpp 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. // Copyright 2014 Citra Emulator Project
  2. // Licensed under GPLv2
  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. #include "core/core.h"
  8. namespace HLE {
  9. /// Data synchronization barrier
  10. u32 DataSynchronizationBarrier() {
  11. return 0;
  12. }
  13. /// Returns the coprocessor (in this case, syscore) command buffer pointer
  14. Addr GetThreadCommandBuffer() {
  15. // Called on insruction: mrc p15, 0, r0, c13, c0, 3
  16. return Memory::KERNEL_MEMORY_VADDR;
  17. }
  18. /// Call an MCR (move to coprocessor from ARM register) instruction in HLE
  19. s32 CallMCR(u32 instruction, u32 value) {
  20. CoprocessorOperation operation = (CoprocessorOperation)((instruction >> 20) & 0xFF);
  21. ERROR_LOG(OSHLE, "unimplemented MCR instruction=0x%08X, operation=%02X, value=%08X",
  22. instruction, operation, value);
  23. return 0;
  24. }
  25. /// Call an MRC (move to ARM register from coprocessor) instruction in HLE
  26. s32 CallMRC(u32 instruction) {
  27. CoprocessorOperation operation = (CoprocessorOperation)((instruction >> 20) & 0xFF);
  28. switch (operation) {
  29. case DATA_SYNCHRONIZATION_BARRIER:
  30. return DataSynchronizationBarrier();
  31. case CALL_GET_THREAD_COMMAND_BUFFER:
  32. return GetThreadCommandBuffer();
  33. default:
  34. ERROR_LOG(OSHLE, "unimplemented MRC instruction 0x%08X", instruction);
  35. break;
  36. }
  37. return 0;
  38. }
  39. } // namespace