Author: cem
Date: Wed Oct  4 23:35:10 2017
New Revision: 324291
URL: https://svnweb.freebsd.org/changeset/base/324291

Log:
  hwpmc(4): Add support for extended AMD events
  
  Sponsored by: Dell EMC Isilon

Modified:
  head/sys/dev/hwpmc/hwpmc_amd.c
  head/sys/dev/hwpmc/hwpmc_amd.h

Modified: head/sys/dev/hwpmc/hwpmc_amd.c
==============================================================================
--- head/sys/dev/hwpmc/hwpmc_amd.c      Wed Oct  4 23:03:09 2017        
(r324290)
+++ head/sys/dev/hwpmc/hwpmc_amd.c      Wed Oct  4 23:35:10 2017        
(r324291)
@@ -108,7 +108,7 @@ static  struct amd_descr amd_pmcdesc[AMD_NPMCS] =
 
 struct amd_event_code_map {
        enum pmc_event  pe_ev;   /* enum value */
-       uint8_t         pe_code; /* encoded event mask */
+       uint16_t        pe_code; /* encoded event mask */
        uint8_t         pe_mask; /* bits allowed in unit mask */
 };
 

Modified: head/sys/dev/hwpmc/hwpmc_amd.h
==============================================================================
--- head/sys/dev/hwpmc/hwpmc_amd.h      Wed Oct  4 23:03:09 2017        
(r324290)
+++ head/sys/dev/hwpmc/hwpmc_amd.h      Wed Oct  4 23:35:10 2017        
(r324291)
@@ -64,10 +64,10 @@
 #define        AMD_PMC_UNITMASK_MOESI  0x1F
 
 #define        AMD_PMC_UNITMASK        0xFF00
-#define        AMD_PMC_EVENTMASK       0x00FF
+#define        AMD_PMC_EVENTMASK       0xF000000FF
 
 #define        AMD_PMC_TO_UNITMASK(x)  (((x) << 8) & AMD_PMC_UNITMASK)
-#define        AMD_PMC_TO_EVENTMASK(x) ((x) & 0xFF)
+#define        AMD_PMC_TO_EVENTMASK(x) (((x) & 0xFF) | (((x) & 0xF00) << 24))
 #define        AMD_VALID_BITS          (AMD_PMC_COUNTERMASK | AMD_PMC_INVERT | 
\
        AMD_PMC_ENABLE | AMD_PMC_INT | AMD_PMC_PC | AMD_PMC_EDGE |      \
        AMD_PMC_OS | AMD_PMC_USR | AMD_PMC_UNITMASK | AMD_PMC_EVENTMASK)
_______________________________________________
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"

Reply via email to