svn commit: r184455 - in stable/6/sys: . amd64/amd64 i386/i386

Maxim Sobolev sobomax at FreeBSD.org
Wed Oct 29 21:12:20 UTC 2008


Author: sobomax
Date: Wed Oct 29 21:12:19 2008
New Revision: 184455
URL: http://svn.freebsd.org/changeset/base/184455

Log:
  MFC: don't panic when HZ value is below 32. This change may need a bit
  of refinement later, as bde says that 4BSD expects stathz of 128, while
  in this case stathz would be in the range 40-128.
  
  Approved by:	re (kib, kensmith)

Modified:
  stable/6/sys/   (props changed)
  stable/6/sys/amd64/amd64/local_apic.c
  stable/6/sys/i386/i386/local_apic.c

Modified: stable/6/sys/amd64/amd64/local_apic.c
==============================================================================
--- stable/6/sys/amd64/amd64/local_apic.c	Wed Oct 29 21:08:34 2008	(r184454)
+++ stable/6/sys/amd64/amd64/local_apic.c	Wed Oct 29 21:12:19 2008	(r184455)
@@ -392,7 +392,10 @@ lapic_setup_clock(void)
 		lapic_timer_hz = hz * 2;
 	else
 		lapic_timer_hz = hz * 4;
-	stathz = lapic_timer_hz / (lapic_timer_hz / 128);
+	if (lapic_timer_hz < 128)
+		stathz = lapic_timer_hz;
+	else
+		stathz = lapic_timer_hz / (lapic_timer_hz / 128);
 	profhz = lapic_timer_hz;
 	lapic_timer_period = value / lapic_timer_hz;
 

Modified: stable/6/sys/i386/i386/local_apic.c
==============================================================================
--- stable/6/sys/i386/i386/local_apic.c	Wed Oct 29 21:08:34 2008	(r184454)
+++ stable/6/sys/i386/i386/local_apic.c	Wed Oct 29 21:12:19 2008	(r184455)
@@ -393,7 +393,10 @@ lapic_setup_clock(void)
 		lapic_timer_hz = hz * 2;
 	else
 		lapic_timer_hz = hz * 4;
-	stathz = lapic_timer_hz / (lapic_timer_hz / 128);
+	if (lapic_timer_hz < 128)
+		stathz = lapic_timer_hz;
+	else
+		stathz = lapic_timer_hz / (lapic_timer_hz / 128);
 	profhz = lapic_timer_hz;
 	lapic_timer_period = value / lapic_timer_hz;
 


More information about the svn-src-stable-6 mailing list