Skip to content

Instantly share code, notes, and snippets.

@postwait
Created March 26, 2012 13:18
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save postwait/2204995 to your computer and use it in GitHub Desktop.
Save postwait/2204995 to your computer and use it in GitHub Desktop.
diff --git a/usr/src/uts/common/conf/param.c b/usr/src/uts/common/conf/param.c
index d72cfb0..5372a78 100644
--- a/usr/src/uts/common/conf/param.c
+++ b/usr/src/uts/common/conf/param.c
@@ -21,6 +21,7 @@
/*
* Copyright (c) 1983, 2010, Oracle and/or its affiliates. All rights reserved.
* Copyright 2012 Milan Jurik. All rights reserved.
+ * Copyright 2012 OmniTI Computer Consulting, Inc. All rights reserved.
*/
#include <sys/types.h>
@@ -678,8 +679,39 @@ param_init(void)
/*
* calculations needed if hz was set in /etc/system
*/
- if (hires_tick)
- hz = hires_hz;
+ switch (hires_tick) {
+
+ case 0:
+
+ break;
+
+ case 1000:
+ case 2000:
+ case 4000:
+ case 5000:
+ case 8000:
+ case 10000:
+ case 20000:
+ case 25000:
+ case 40000:
+ case 50000:
+ case 100000:
+ case 125000:
+ case 200000:
+ case 250000:
+ case 500000:
+ case 1000000:
+
+ /* These are all valid "hires" (>= 1000Hz) rates.
+ * They must be both divisible by 1000 and into 1000000.
+ * Reset hires_hz and hz
+ */
+ hz = hires_hz = hires_tick;
+ break;
+
+ default:
+ hz = hires_hz;
+ }
tick_per_msec = hz / MILLISEC;
msec_per_tick = MILLISEC / hz;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment