From: Kyle Roarty Date: Fri, 28 Aug 2020 22:34:10 +0000 (-0500) Subject: misc: Use VPtr in hsa_driver.cc X-Git-Tag: v20.1.0.0~193 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=b00b98635308dc423094c2902ad446556a5497b7;p=gem5.git misc: Use VPtr in hsa_driver.cc 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 Reviewed-by: Gabe Black Reviewed-by: Matthew Poremba Maintainer: Matt Sinclair Tested-by: kokoro --- diff --git a/src/dev/hsa/hsa_driver.cc b/src/dev/hsa/hsa_driver.cc index a1215c405..3b271496c 100644 --- a/src/dev/hsa/hsa_driver.cc +++ b/src/dev/hsa/hsa_driver.cc @@ -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 args(ioc_buf); - args.copyIn(mem_proxy); + VPtr 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); } diff --git a/src/dev/hsa/hsa_driver.hh b/src/dev/hsa/hsa_driver.hh index abf79abfc..19982f757 100644 --- a/src/dev/hsa/hsa_driver.hh +++ b/src/dev/hsa/hsa_driver.hh @@ -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__ diff --git a/src/gpu-compute/gpu_compute_driver.cc b/src/gpu-compute/gpu_compute_driver.cc index 6bdb3140e..b4d65ce65 100644 --- a/src/gpu-compute/gpu_compute_driver.cc +++ b/src/gpu-compute/gpu_compute_driver.cc @@ -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); }