$NetBSD: patch-ab,v 1.9 2014/10/01 01:17:33 jmcneill Exp $

--- estd.c.orig	2009-10-20 16:18:28.000000000 +0000
+++ estd.c	2014-09-30 11:10:54.000000000 +0000
@@ -55,7 +55,10 @@
 #define TECH_EST 1
 #define TECH_POWERNOW 2
 #define TECH_ACPI 3
-#define TECH_MAX 3
+#define TECH_INTREPID 4
+#define TECH_LOONGSON 5
+#define TECH_GENERIC 6
+#define TECH_MAX 6
 
 /* this is ugly, but... <shrug> */
 #define MAX_FREQS 32
@@ -116,26 +119,35 @@ int             ndomains;
  static size_t cp_time_size = sizeof(cp_time[0]) * CPUSTATES;
 #endif
 
-static char	*techdesc[4] = {"Unknown",
+static char	*techdesc[7] = {"Unknown",
 				"Enhanced SpeedStep",
 				"PowerNow",
-				"ACPI P-States"
+				"ACPI P-States",
+				"Intrepid",
+				"Loongson",
+				"Generic"
 				};
-static char	*freqctl[4] = {	"",	
+static char	*freqctl[7] = {	"",	
 				"machdep.est.frequency.available",
 				"machdep.powernow.frequency.available",
-				"hw.acpi.cpu.px_dom0.available"
+				"hw.acpi.cpu.px_dom0.available",
+				"machdep.intrepid.frequency.available",
+				"machdep.loongson.frequency.available",
+				"machdep.frequency.available"
 				};
-static char	*setctl[4] = {	"",
+static char	*setctl[7] = {	"",
 				"machdep.est.frequency.target",
 				"machdep.powernow.frequency.target",
-				"hw.acpi.cpu.px_dom0.select"
+				"hw.acpi.cpu.px_dom0.select",
+				"machdep.intrepid.frequency.target",
+				"machdep.loongson.frequency.target",
+				"machdep.frequency.current"
 				};
 
 void
 usage()
 {
-	printf("usage: estd [-d] [-o] [-n] [-A] [-C] [-E] [-P] [-a] [-s] [-b] [-p poll interval in us] [-g grace period] [-l low watermark percentage] [-h high watermark percentage] [-m minimum MHz] [-M maximum MHz]\n");
+	printf("usage: estd [-d] [-o] [-n] [-A] [-C] [-E] [-P] [-I] [-L] [-G] [-a] [-s] [-b] [-p poll interval in us] [-g grace period] [-l low watermark percentage] [-h high watermark percentage] [-m minimum MHz] [-M maximum MHz]\n");
 	printf("       estd -v\n");
 	printf("       estd -f\n");
 	exit(1);
@@ -367,7 +379,7 @@ main(int argc, char *argv[])
 	FILE           *fexists;
 
 	/* get command-line options */
-	while ((ch = getopt(argc, argv, "vfdonACEPasbp:h:l:g:m:M:")) != -1)
+	while ((ch = getopt(argc, argv, "vfdonACEPILGasbp:h:l:g:m:M:")) != -1)
 		switch (ch) {
 		case 'v':
 			version();
@@ -400,6 +412,16 @@ main(int argc, char *argv[])
 			break;
 		case 'P':
 			tech = TECH_POWERNOW;
+			break;
+		case 'I':
+			tech = TECH_INTREPID;
+			break;
+                case 'L':
+                        tech = TECH_LOONGSON;
+                        break;
+		case 'G':
+			tech = TECH_GENERIC;
+			break;
 		case 'a':
 			strategy = AGGRESSIVE;
 			break;
