Add functions to get the kfd debugger version info

To support adding new features to the kfd debugger, and not break
functionality, we need to be able to check the kfd debugger support
version info from the kernel.

Change-Id: Icd88e4edab8430c35eaed588e62d892c1b5c62ec
Signed-off-by: Philip Cox <Philip.Cox@amd.com>
Этот коммит содержится в:
Philip Cox
2019-10-07 11:25:24 -04:00
родитель 35d56297d3
Коммит dbbd189b33
3 изменённых файлов: 81 добавлений и 1 удалений
+30
Просмотреть файл
@@ -917,6 +917,36 @@ hsaKmtSetWaveLaunchMode(
HSA_DBG_WAVE_LAUNCH_MODE WaveLaunchMode //IN
);
/**
* Get the major and minor version of the kernel debugger support.
*
* Returns:
* - HSAKMT_STATUS_SUCCESS if successful.
*
* - HSAKMT_STATUS_INVALID_HANDLE if NodeId is invalid.
*
* - HSAKMT_STATUS_NOT_SUPPORTED if debug trap not supported for NodeId.
*/
HSAKMT_STATUS
HSAKMTAPI
hsaKmtGetKernelDebugTrapVersionInfo(
HSAuint32 *Major, //Out
HSAuint32 *Minor //Out
);
/**
* Get the major and minor version of the thunk debugger support.
*/
void
HSAKMTAPI
hsaKmtGetThunkDebugTrapVersionInfo(
HSAuint32 *Major, //Out
HSAuint32 *Minor //Out
);
/**
Set a debug memory access watch point. A memory access of the kind
specified by WatchMode to an matching address will cause the trap
+49 -1
Просмотреть файл
@@ -286,7 +286,8 @@ static HSAKMT_STATUS debug_trap(HSAuint32 NodeId,
CHECK_KFD_OPEN();
if (op == KFD_IOC_DBG_TRAP_NODE_SUSPEND ||
op == KFD_IOC_DBG_TRAP_NODE_RESUME) {
op == KFD_IOC_DBG_TRAP_NODE_RESUME ||
op == KFD_IOC_DBG_TRAP_GET_VERSION) {
if (NodeId != INVALID_NODEID)
return HSAKMT_STATUS_INVALID_HANDLE;
@@ -596,3 +597,50 @@ hsaKmtQueryDebugEvent(
return result;
}
/**
* Get the major and minor version of the kernel debugger support.
*
* Returns:
* - HSAKMT_STATUS_SUCCESS if successful.
*
* - HSAKMT_STATUS_INVALID_HANDLE if NodeId is invalid.
*
* - HSAKMT_STATUS_NOT_SUPPORTED if debug trap not supported for NodeId.
*/
HSAKMT_STATUS
HSAKMTAPI
hsaKmtGetKernelDebugTrapVersionInfo(
HSAuint32 *Major, //Out
HSAuint32 *Minor //Out
)
{
HSAKMT_STATUS result;
struct kfd_ioctl_dbg_trap_args argout = {0};
result = debug_trap(INVALID_NODEID,
KFD_IOC_DBG_TRAP_GET_VERSION,
0,
0,
0,
INVALID_PID,
0,
&argout);
*Major = argout.data1;
*Minor = argout.data2;
return result;
}
/**
* Get the major and minor version of the Thunk debugger support.
*/
void
HSAKMTAPI
hsaKmtGetThunkDebugTrapVersionInfo(
HSAuint32 *Major, //Out
HSAuint32 *Minor //Out
)
{
*Major = KFD_IOCTL_DBG_MAJOR_VERSION;
*Minor = KFD_IOCTL_DBG_MINOR_VERSION;
}
+2
Просмотреть файл
@@ -67,6 +67,8 @@ hsaKmtSetWaveLaunchMode;
hsaKmtQueueSuspend;
hsaKmtQueueResume;
hsaKmtAllocQueueGWS;
hsaKmtGetKernelDebugTrapVersionInfo;
hsaKmtGetThunkDebugTrapVersionInfo;
local: *;
};