diff options
| author | 2017-05-20 21:54:27 -0700 | |
|---|---|---|
| committer | 2017-05-24 21:06:00 -0700 | |
| commit | 743d18f0e463aa25af53ceaa25231800453810ea (patch) | |
| tree | 63855ef6247eaf0566da4ac1d82315c82442c003 /src | |
| parent | FileSys: Move all result description to errors.h (diff) | |
| download | yuzu-743d18f0e463aa25af53ceaa25231800453810ea.tar.gz yuzu-743d18f0e463aa25af53ceaa25231800453810ea.tar.xz yuzu-743d18f0e463aa25af53ceaa25231800453810ea.zip | |
GSP_GPU: Move error codes from result.h to local file
Diffstat (limited to 'src')
| -rw-r--r-- | src/core/hle/result.h | 3 | ||||
| -rw-r--r-- | src/core/hle/service/gsp_gpu.cpp | 37 |
2 files changed, 23 insertions, 17 deletions
diff --git a/src/core/hle/result.h b/src/core/hle/result.h index b066b7d4e..e76be606e 100644 --- a/src/core/hle/result.h +++ b/src/core/hle/result.h | |||
| @@ -26,9 +26,6 @@ enum class ErrorDescription : u32 { | |||
| 26 | OS_InvalidBufferDescriptor = 48, | 26 | OS_InvalidBufferDescriptor = 48, |
| 27 | MaxConnectionsReached = 52, | 27 | MaxConnectionsReached = 52, |
| 28 | WrongAddress = 53, | 28 | WrongAddress = 53, |
| 29 | OutofRangeOrMisalignedAddress = | ||
| 30 | 513, // TODO(purpasmart): Check if this name fits its actual usage | ||
| 31 | GPU_FirstInitialization = 519, | ||
| 32 | 29 | ||
| 33 | // Codes 1000 and above are considered "well-known" and have common values between all modules. | 30 | // Codes 1000 and above are considered "well-known" and have common values between all modules. |
| 34 | InvalidSection = 1000, | 31 | InvalidSection = 1000, |
diff --git a/src/core/hle/service/gsp_gpu.cpp b/src/core/hle/service/gsp_gpu.cpp index a960778a7..46c4ed01a 100644 --- a/src/core/hle/service/gsp_gpu.cpp +++ b/src/core/hle/service/gsp_gpu.cpp | |||
| @@ -25,13 +25,24 @@ namespace GSP { | |||
| 25 | // Beginning address of HW regs | 25 | // Beginning address of HW regs |
| 26 | const u32 REGS_BEGIN = 0x1EB00000; | 26 | const u32 REGS_BEGIN = 0x1EB00000; |
| 27 | 27 | ||
| 28 | const ResultCode ERR_GSP_REGS_OUTOFRANGE_OR_MISALIGNED( | 28 | namespace ErrCodes { |
| 29 | ErrorDescription::OutofRangeOrMisalignedAddress, ErrorModule::GX, ErrorSummary::InvalidArgument, | 29 | enum { |
| 30 | ErrorLevel::Usage); // 0xE0E02A01 | 30 | // TODO(purpasmart): Check if this name fits its actual usage |
| 31 | const ResultCode ERR_GSP_REGS_MISALIGNED(ErrorDescription::MisalignedSize, ErrorModule::GX, | 31 | OutofRangeOrMisalignedAddress = 513, |
| 32 | FirstInitialization = 519, | ||
| 33 | }; | ||
| 34 | } | ||
| 35 | |||
| 36 | constexpr ResultCode RESULT_FIRST_INITIALIZATION(ErrCodes::FirstInitialization, ErrorModule::GX, | ||
| 37 | ErrorSummary::Success, ErrorLevel::Success); | ||
| 38 | constexpr ResultCode ERR_REGS_OUTOFRANGE_OR_MISALIGNED(ErrCodes::OutofRangeOrMisalignedAddress, | ||
| 39 | ErrorModule::GX, | ||
| 40 | ErrorSummary::InvalidArgument, | ||
| 41 | ErrorLevel::Usage); // 0xE0E02A01 | ||
| 42 | constexpr ResultCode ERR_REGS_MISALIGNED(ErrorDescription::MisalignedSize, ErrorModule::GX, | ||
| 32 | ErrorSummary::InvalidArgument, | 43 | ErrorSummary::InvalidArgument, |
| 33 | ErrorLevel::Usage); // 0xE0E02BF2 | 44 | ErrorLevel::Usage); // 0xE0E02BF2 |
| 34 | const ResultCode ERR_GSP_REGS_INVALID_SIZE(ErrorDescription::InvalidSize, ErrorModule::GX, | 45 | constexpr ResultCode ERR_REGS_INVALID_SIZE(ErrorDescription::InvalidSize, ErrorModule::GX, |
| 35 | ErrorSummary::InvalidArgument, | 46 | ErrorSummary::InvalidArgument, |
| 36 | ErrorLevel::Usage); // 0xE0E02BEC | 47 | ErrorLevel::Usage); // 0xE0E02BEC |
| 37 | 48 | ||
| @@ -93,11 +104,11 @@ static ResultCode WriteHWRegs(u32 base_address, u32 size_in_bytes, VAddr data_va | |||
| 93 | LOG_ERROR(Service_GSP, | 104 | LOG_ERROR(Service_GSP, |
| 94 | "Write address was out of range or misaligned! (address=0x%08x, size=0x%08x)", | 105 | "Write address was out of range or misaligned! (address=0x%08x, size=0x%08x)", |
| 95 | base_address, size_in_bytes); | 106 | base_address, size_in_bytes); |
| 96 | return ERR_GSP_REGS_OUTOFRANGE_OR_MISALIGNED; | 107 | return ERR_REGS_OUTOFRANGE_OR_MISALIGNED; |
| 97 | } else if (size_in_bytes <= max_size_in_bytes) { | 108 | } else if (size_in_bytes <= max_size_in_bytes) { |
| 98 | if (size_in_bytes & 3) { | 109 | if (size_in_bytes & 3) { |
| 99 | LOG_ERROR(Service_GSP, "Misaligned size 0x%08x", size_in_bytes); | 110 | LOG_ERROR(Service_GSP, "Misaligned size 0x%08x", size_in_bytes); |
| 100 | return ERR_GSP_REGS_MISALIGNED; | 111 | return ERR_REGS_MISALIGNED; |
| 101 | } else { | 112 | } else { |
| 102 | while (size_in_bytes > 0) { | 113 | while (size_in_bytes > 0) { |
| 103 | WriteSingleHWReg(base_address, Memory::Read32(data_vaddr)); | 114 | WriteSingleHWReg(base_address, Memory::Read32(data_vaddr)); |
| @@ -111,7 +122,7 @@ static ResultCode WriteHWRegs(u32 base_address, u32 size_in_bytes, VAddr data_va | |||
| 111 | 122 | ||
| 112 | } else { | 123 | } else { |
| 113 | LOG_ERROR(Service_GSP, "Out of range size 0x%08x", size_in_bytes); | 124 | LOG_ERROR(Service_GSP, "Out of range size 0x%08x", size_in_bytes); |
| 114 | return ERR_GSP_REGS_INVALID_SIZE; | 125 | return ERR_REGS_INVALID_SIZE; |
| 115 | } | 126 | } |
| 116 | } | 127 | } |
| 117 | 128 | ||
| @@ -134,11 +145,11 @@ static ResultCode WriteHWRegsWithMask(u32 base_address, u32 size_in_bytes, VAddr | |||
| 134 | LOG_ERROR(Service_GSP, | 145 | LOG_ERROR(Service_GSP, |
| 135 | "Write address was out of range or misaligned! (address=0x%08x, size=0x%08x)", | 146 | "Write address was out of range or misaligned! (address=0x%08x, size=0x%08x)", |
| 136 | base_address, size_in_bytes); | 147 | base_address, size_in_bytes); |
| 137 | return ERR_GSP_REGS_OUTOFRANGE_OR_MISALIGNED; | 148 | return ERR_REGS_OUTOFRANGE_OR_MISALIGNED; |
| 138 | } else if (size_in_bytes <= max_size_in_bytes) { | 149 | } else if (size_in_bytes <= max_size_in_bytes) { |
| 139 | if (size_in_bytes & 3) { | 150 | if (size_in_bytes & 3) { |
| 140 | LOG_ERROR(Service_GSP, "Misaligned size 0x%08x", size_in_bytes); | 151 | LOG_ERROR(Service_GSP, "Misaligned size 0x%08x", size_in_bytes); |
| 141 | return ERR_GSP_REGS_MISALIGNED; | 152 | return ERR_REGS_MISALIGNED; |
| 142 | } else { | 153 | } else { |
| 143 | while (size_in_bytes > 0) { | 154 | while (size_in_bytes > 0) { |
| 144 | const u32 reg_address = base_address + REGS_BEGIN; | 155 | const u32 reg_address = base_address + REGS_BEGIN; |
| @@ -164,7 +175,7 @@ static ResultCode WriteHWRegsWithMask(u32 base_address, u32 size_in_bytes, VAddr | |||
| 164 | 175 | ||
| 165 | } else { | 176 | } else { |
| 166 | LOG_ERROR(Service_GSP, "Out of range size 0x%08x", size_in_bytes); | 177 | LOG_ERROR(Service_GSP, "Out of range size 0x%08x", size_in_bytes); |
| 167 | return ERR_GSP_REGS_INVALID_SIZE; | 178 | return ERR_REGS_INVALID_SIZE; |
| 168 | } | 179 | } |
| 169 | } | 180 | } |
| 170 | 181 | ||
| @@ -372,9 +383,7 @@ static void RegisterInterruptRelayQueue(Interface* self) { | |||
| 372 | if (first_initialization) { | 383 | if (first_initialization) { |
| 373 | // This specific code is required for a successful initialization, rather than 0 | 384 | // This specific code is required for a successful initialization, rather than 0 |
| 374 | first_initialization = false; | 385 | first_initialization = false; |
| 375 | cmd_buff[1] = ResultCode(ErrorDescription::GPU_FirstInitialization, ErrorModule::GX, | 386 | cmd_buff[1] = RESULT_FIRST_INITIALIZATION.raw; |
| 376 | ErrorSummary::Success, ErrorLevel::Success) | ||
| 377 | .raw; | ||
| 378 | } else { | 387 | } else { |
| 379 | cmd_buff[1] = RESULT_SUCCESS.raw; | 388 | cmd_buff[1] = RESULT_SUCCESS.raw; |
| 380 | } | 389 | } |