From 89188a6d6c8ea92f44113438513570b2a1b9318e Mon Sep 17 00:00:00 2001 From: Yair Shachar Date: Sun, 8 Feb 2015 21:44:47 +0200 Subject: [PATCH] Modify HW dbg thunk,to adapt to new KFD-thunk interface Signed-off-by: Yair Shachar --- include/linux/kfd_ioctl.h | 4 ++-- src/debug.c | 6 ++++++ 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/include/linux/kfd_ioctl.h b/include/linux/kfd_ioctl.h index a8b750f30a..08558f6678 100644 --- a/include/linux/kfd_ioctl.h +++ b/include/linux/kfd_ioctl.h @@ -145,13 +145,13 @@ struct kfd_ioctl_dbg_unregister_args { struct kfd_ioctl_dbg_address_watch_args { uint32_t gpu_id; /* to KFD */ uint32_t buf_size_in_bytes; /*including gpu_id and buf_size */ - unsigned char content[0]; + void *content_ptr; /* a pointer to the actual content */ }; struct kfd_ioctl_dbg_wave_control_args { uint32_t gpu_id; /* to KFD */ uint32_t buf_size_in_bytes; /*including gpu_id and buf_size */ - unsigned char content[0]; + void *content_ptr; /* a pointer to the actual content */ }; /* Matching HSA_EVENTTYPE */ diff --git a/src/debug.c b/src/debug.c index 155222570e..eff9023d90 100644 --- a/src/debug.c +++ b/src/debug.c @@ -129,6 +129,9 @@ hsaKmtDbgWavefrontControl( unsigned char* run_ptr = (unsigned char*)args + sizeof(*args); + /* save variable content pointer for kfd */ + args->content_ptr = (void *)run_ptr; + /* insert items, and increment pointer accordingly */ *((HSA_DBG_WAVEOP*)run_ptr) = Operand; @@ -220,10 +223,13 @@ hsaKmtDbgAddressWatch( args->gpu_id = gpu_id; args->buf_size_in_bytes = buff_size; + /* increment pointer to the start of the non fixed part */ unsigned char* run_ptr = (unsigned char*)args + sizeof(*args); + /* save variable content pointer for kfd */ + args->content_ptr = (void *)run_ptr; /* insert items, and increment pointer accordingly */ *((HSAuint32*)run_ptr) = NumWatchPoints;