Add APIs to support debugging vm fault

1. Add hsa ext api hsa_amd_register_vmfault_handler for debugger to register callback in case of VM fault.
2. Extend hsa_ven_amd_loader API to:
   (1) iterate loaded code objects in executable:
       hsa_ven_amd_loader_executable_iterate_loaded_code_objects
   (2) get loaded code object info:
       hsa_ven_amd_loader_loaded_code_object_get_info
3. Make the id of hsa_queue the same as the one used in communication with thunk (for amd_aql_queue)

Change-Id: I68910809e59e24297350d262606f00e96c14bcbd
This commit is contained in:
Qingchuan Shi
2017-09-29 12:45:24 -04:00
rodzic 6ee2ccb08b
commit ce6aee01ed
19 zmienionych plików z 675 dodań i 162 usunięć
+7 -3
Wyświetl plik
@@ -317,6 +317,8 @@ class Runtime {
ExtensionEntryPoints extensions_;
hsa_status_t SetCustomVMFaultHandler(hsa_status_t (*callback)(const void* event_specific_data, void* data), void* data);
protected:
static void AsyncEventsLoop(void*);
@@ -479,9 +481,6 @@ class Runtime {
AsyncEvents new_async_events_;
// Queue id counter.
uint32_t queue_count_;
// Starting address of SVM address space.
// On APU the cpu and gpu could access the area inside starting and end of
// the SVM address space.
@@ -502,6 +501,11 @@ class Runtime {
// @brief HSA signal to contain the VM fault event.
Signal* vm_fault_signal_;
// custom VM fault handler.
hsa_status_t (*vm_fault_handler_custom_)(const void* event_specific_data,
void* data);
void* vm_fault_handler_user_data_;
// Holds reference count to runtime object.
volatile uint32_t ref_count_;