Matthew Poremba has uploaded this change for review. ( https://gem5-review.googlesource.com/c/public/gem5/+/57669 )

Change subject: dev-hsa: Properly mask HSA packet header bits
......................................................................

dev-hsa: Properly mask HSA packet header bits

The HSA packet macros were not actually masking the header bits
properly. Add a mask call around the width (number of bits) of the field
being masked.

Change-Id: Ia5e5fb0451296e99a85fb12a5f73b27aea72fc2e
---
M src/dev/hsa/hsa_packet_processor.cc
1 file changed, 16 insertions(+), 2 deletions(-)



diff --git a/src/dev/hsa/hsa_packet_processor.cc b/src/dev/hsa/hsa_packet_processor.cc
index 89fc3c1..1236256 100644
--- a/src/dev/hsa/hsa_packet_processor.cc
+++ b/src/dev/hsa/hsa_packet_processor.cc
@@ -60,12 +60,13 @@
   }

 #define PKT_TYPE(PKT) ((hsa_packet_type_t)(((PKT->header) >> \
-            HSA_PACKET_HEADER_TYPE) & (HSA_PACKET_HEADER_WIDTH_TYPE - 1)))
+            HSA_PACKET_HEADER_TYPE) & mask(HSA_PACKET_HEADER_WIDTH_TYPE)))

 // checks if the barrier bit is set in the header -- shift the barrier bit
 // to LSB, then bitwise "and" to mask off all other bits
 #define IS_BARRIER(PKT) ((hsa_packet_header_t)(((PKT->header) >> \
-            HSA_PACKET_HEADER_BARRIER) & HSA_PACKET_HEADER_WIDTH_BARRIER))
+            HSA_PACKET_HEADER_BARRIER) & \
+            mask(HSA_PACKET_HEADER_WIDTH_BARRIER)))

 namespace gem5
 {

--
To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/57669
To unsubscribe, or for help writing mail filters, visit https://gem5-review.googlesource.com/settings

Gerrit-Project: public/gem5
Gerrit-Branch: develop
Gerrit-Change-Id: Ia5e5fb0451296e99a85fb12a5f73b27aea72fc2e
Gerrit-Change-Number: 57669
Gerrit-PatchSet: 1
Gerrit-Owner: Matthew Poremba <matthew.pore...@amd.com>
Gerrit-MessageType: newchange
_______________________________________________
gem5-dev mailing list -- gem5-dev@gem5.org
To unsubscribe send an email to gem5-dev-le...@gem5.org
%(web_page_url)slistinfo%(cgiext)s/%(_internal_name)s

Reply via email to