misc: Use VPtr in hsa_driver.cc
authorKyle Roarty <kyleroarty1716@gmail.com>
Fri, 28 Aug 2020 22:34:10 +0000 (17:34 -0500)
committerMatthew Poremba <matthew.poremba@amd.com>
Mon, 31 Aug 2020 17:44:11 +0000 (17:44 +0000)
This change updates HSADriver::allocateQueue to take in a ThreadContext
pointer as opposed to a PortProxy ref. This allows the TypedBufferArg
to be replaced with VPtr.

This also fixes building GCN3_X86

Change-Id: I1fea26b10c7344daf54a0cb05337e961f834a5fd
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/33655
Reviewed-by: Matt Sinclair <mattdsinclair@gmail.com>
Reviewed-by: Gabe Black <gabeblack@google.com>
Reviewed-by: Matthew Poremba <matthew.poremba@amd.com>
Maintainer: Matt Sinclair <mattdsinclair@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
src/dev/hsa/hsa_driver.cc
src/dev/hsa/hsa_driver.hh
src/gpu-compute/gpu_compute_driver.cc

index a1215c4058c13ca81fff575d50b0fbc8f39a2bd4..3b271496ce73ad0c716ccae6697fbe2e39ab43b7 100644 (file)
@@ -101,10 +101,9 @@ HSADriver::mmap(ThreadContext *tc, Addr start, uint64_t length, int prot,
  * be mapped into that page.
  */
 void
-HSADriver::allocateQueue(PortProxy &mem_proxy, Addr ioc_buf)
+HSADriver::allocateQueue(ThreadContext *tc, Addr ioc_buf)
 {
-    TypedBufferArg<kfd_ioctl_create_queue_args> args(ioc_buf);
-    args.copyIn(mem_proxy);
+    VPtr<kfd_ioctl_create_queue_args> args(ioc_buf, tc);
 
     if (queueId >= 0x1000) {
         fatal("%s: Exceeded maximum number of HSA queues allowed\n", name());
@@ -115,5 +114,4 @@ HSADriver::allocateQueue(PortProxy &mem_proxy, Addr ioc_buf)
     hsa_pp.setDeviceQueueDesc(args->read_pointer_address,
                               args->ring_base_address, args->queue_id,
                               args->ring_size);
-    args.copyOut(mem_proxy);
 }
index abf79abfc26ace334c017e414d83bb8a109a981e..19982f75746cb27e1e67680bcbc130d8425b28aa 100644 (file)
@@ -74,7 +74,7 @@ class HSADriver : public EmulatedDriver
     HSADevice *device;
     uint32_t queueId;
 
-    void allocateQueue(PortProxy &mem_proxy, Addr ioc_buf);
+    void allocateQueue(ThreadContext *tc, Addr ioc_buf);
 };
 
 #endif // __DEV_HSA_HSA_DRIVER_HH__
index 6bdb3140ec530d717136bcef52f148d17cbffa0b..b4d65ce659e5dfd414fa05add688ac76fb8790e0 100644 (file)
@@ -71,7 +71,7 @@ GPUComputeDriver::ioctl(ThreadContext *tc, unsigned req, Addr ioc_buf)
           {
             DPRINTF(GPUDriver, "ioctl: AMDKFD_IOC_CREATE_QUEUE\n");
 
-            allocateQueue(virt_proxy, ioc_buf);
+            allocateQueue(tc, ioc_buf);
 
             DPRINTF(GPUDriver, "Creating queue %d\n", queueId);
           }