L0Debug - extract memory access params validation

- remove duplication of code by moving common code
to DebugSessionImp

Signed-off-by: Mateusz Hoppe <mateusz.hoppe@intel.com>
This commit is contained in:
Mateusz Hoppe
2022-07-13 16:05:36 +00:00
committed by Compute-Runtime-Automation
parent ca4ecdfb06
commit d139d307f0
4 changed files with 19 additions and 26 deletions

View File

@@ -1263,12 +1263,7 @@ ze_result_t DebugSessionLinux::readMemory(ze_device_thread_t thread, const zet_d
return ZE_RESULT_ERROR_UNINITIALIZED;
}
if (!isValidGpuAddress(desc->address)) {
return ZE_RESULT_ERROR_INVALID_ARGUMENT;
}
ze_result_t status = ZE_RESULT_ERROR_UNINITIALIZED;
status = sanityMemAccessThreadCheck(thread, desc);
ze_result_t status = validateThreadAndDescForMemoryAccess(thread, desc);
if (status != ZE_RESULT_SUCCESS) {
return status;
}
@@ -1333,12 +1328,7 @@ ze_result_t DebugSessionLinux::writeMemory(ze_device_thread_t thread, const zet_
return ZE_RESULT_ERROR_UNINITIALIZED;
}
if (!isValidGpuAddress(desc->address)) {
return ZE_RESULT_ERROR_INVALID_ARGUMENT;
}
ze_result_t status = ZE_RESULT_ERROR_UNINITIALIZED;
status = sanityMemAccessThreadCheck(thread, desc);
ze_result_t status = validateThreadAndDescForMemoryAccess(thread, desc);
if (status != ZE_RESULT_SUCCESS) {
return status;
}