summaryrefslogtreecommitdiff
path: root/include/uapi/linux/kfd_ioctl.h
diff options
context:
space:
mode:
authorFelix Kuehling <Felix.Kuehling@amd.com>2017-11-15 00:41:20 +0300
committerOded Gabbay <oded.gabbay@gmail.com>2017-11-15 00:41:20 +0300
commitd7b9bd2248d794275b53d34e665f7c5a08c4b396 (patch)
treee35653cbbad4c82fe569f6ab0f2b47ad1c580651 /include/uapi/linux/kfd_ioctl.h
parent373d7080896a3cb3b28ae3a2abdafb7bb87552b1 (diff)
downloadlinux-d7b9bd2248d794275b53d34e665f7c5a08c4b396.tar.xz
drm/amdkfd: Add support for user-mode trap handlers
A second-level user mode trap handler can be installed. The CWSR trap handler jumps to the secondary trap handler conditionally for any conditions not handled by it. This can be used e.g. for debugging or catching math exceptions. When CWSR is disabled, the user mode trap handler is installed as first level trap handler. Signed-off-by: Shaoyun.liu <shaoyun.liu@amd.com> Signed-off-by: Jay Cornwall <Jay.Cornwall@amd.com> Signed-off-by: Felix Kuehling <Felix.Kuehling@amd.com> Signed-off-by: Oded Gabbay <oded.gabbay@gmail.com>
Diffstat (limited to 'include/uapi/linux/kfd_ioctl.h')
-rw-r--r--include/uapi/linux/kfd_ioctl.h12
1 files changed, 11 insertions, 1 deletions
diff --git a/include/uapi/linux/kfd_ioctl.h b/include/uapi/linux/kfd_ioctl.h
index f7563ef2e883..f4cab5b3ba9a 100644
--- a/include/uapi/linux/kfd_ioctl.h
+++ b/include/uapi/linux/kfd_ioctl.h
@@ -262,6 +262,13 @@ struct kfd_ioctl_get_tile_config_args {
*/
};
+struct kfd_ioctl_set_trap_handler_args {
+ uint64_t tba_addr; /* to KFD */
+ uint64_t tma_addr; /* to KFD */
+ uint32_t gpu_id; /* to KFD */
+ uint32_t pad;
+};
+
#define AMDKFD_IOCTL_BASE 'K'
#define AMDKFD_IO(nr) _IO(AMDKFD_IOCTL_BASE, nr)
#define AMDKFD_IOR(nr, type) _IOR(AMDKFD_IOCTL_BASE, nr, type)
@@ -322,7 +329,10 @@ struct kfd_ioctl_get_tile_config_args {
#define AMDKFD_IOC_GET_TILE_CONFIG \
AMDKFD_IOWR(0x12, struct kfd_ioctl_get_tile_config_args)
+#define AMDKFD_IOC_SET_TRAP_HANDLER \
+ AMDKFD_IOW(0x13, struct kfd_ioctl_set_trap_handler_args)
+
#define AMDKFD_COMMAND_START 0x01
-#define AMDKFD_COMMAND_END 0x13
+#define AMDKFD_COMMAND_END 0x14
#endif