@@ -80,7 +80,7 @@ static signed int ArchID = -1;
80
80
module_param (ArchID , int , S_IRUSR |S_IWUSR |S_IRGRP |S_IROTH );
81
81
MODULE_PARM_DESC (ArchID , "Force an architecture (ID)" );
82
82
83
- static signed int AutoClock = /*TODO: 0b11*/ 0b00 ;
83
+ static signed int AutoClock = 0b11 ;
84
84
module_param (AutoClock , int , S_IRUSR |S_IWUSR |S_IRGRP |S_IROTH );
85
85
MODULE_PARM_DESC (AutoClock , "Estimate Clock Frequency 0:Spec; 1:Once; 2:Auto" );
86
86
@@ -506,11 +506,13 @@ static signed int SearchArchitectureID(void)
506
506
static void Query_Features (void * pArg )
507
507
{
508
508
INIT_ARG * iArg = (INIT_ARG * ) pArg ;
509
- /* volatile unsigned long long cntfrq; TODO*/
509
+ volatile unsigned long long cntfrq ;
510
510
511
511
iArg -> Features -> Info .Vendor .CRC = CRC_RESERVED ;
512
512
iArg -> SMT_Count = 1 ;
513
513
iArg -> HypervisorID = HYPERV_NONE ;
514
+
515
+ RDTSC64 (cntfrq );
514
516
/*TODO(Cycles)
515
517
__asm__ __volatile__(
516
518
"csrr %[cntfrq], mcycle" "\n\t"
@@ -539,14 +541,9 @@ static void Query_Features(void *pArg)
539
541
#else
540
542
iArg -> Features -> ACPI = 0 ;
541
543
#endif
542
- /*
543
544
iArg -> Features -> TSC = \
544
545
iArg -> Features -> Inv_TSC = \
545
546
iArg -> Features -> RDTSCP = cntfrq != 0 ;
546
- */
547
- iArg -> Features -> TSC = \
548
- iArg -> Features -> Inv_TSC = \
549
- iArg -> Features -> RDTSCP = 0 ;
550
547
551
548
iArg -> Features -> PerfMon .FixCtrs = \
552
549
iArg -> Features -> PerfMon .MonCtrs = \
@@ -1716,6 +1713,7 @@ static void Generic_Core_Counters_Clear(union SAVE_AREA_CORE *Save,
1716
1713
1717
1714
#define Counters_Generic (Core , T ) \
1718
1715
({ \
1716
+ RDTSC64(Core->Counter[T].TSC); \
1719
1717
/*TODO(Cycles) \
1720
1718
RDTSC_COUNTERx3(Core->Counter[T].TSC, \
1721
1719
pmevcntr2_el0:mcycle, Core->Counter[T].C0.UCC,\
@@ -1818,7 +1816,8 @@ static void Generic_Core_Counters_Clear(union SAVE_AREA_CORE *Save,
1818
1816
1819
1817
#define PKG_Counters_Generic (Core , T ) \
1820
1818
({ \
1821
- /*TODO(Cycles) \
1819
+ RDTSC64(PUBLIC(RO(Proc))->Counter[T].PCLK); \
1820
+ /*TODO(CleanUp) \
1822
1821
volatile unsigned long long cntpct; \
1823
1822
__asm__ volatile \
1824
1823
( \
0 commit comments