svn commit: r368112 - in head/sys: kern sys

Mark Johnston markj at FreeBSD.org
Fri Nov 27 20:46:03 UTC 2020


Author: markj
Date: Fri Nov 27 20:46:02 2020
New Revision: 368112
URL: https://svnweb.freebsd.org/changeset/base/368112

Log:
  callout(9): Remove some leftover APM BIOS support
  
  This code is obsolete since r366546.
  
  Reviewed by:	imp
  Sponsored by:	The FreeBSD Foundation
  Differential Revision:	https://reviews.freebsd.org/D27267

Modified:
  head/sys/kern/kern_timeout.c
  head/sys/sys/systm.h

Modified: head/sys/kern/kern_timeout.c
==============================================================================
--- head/sys/kern/kern_timeout.c	Fri Nov 27 18:40:51 2020	(r368111)
+++ head/sys/kern/kern_timeout.c	Fri Nov 27 20:46:02 2020	(r368112)
@@ -1339,71 +1339,6 @@ _callout_init_lock(struct callout *c, struct lock_obje
 	c->c_cpu = cc_default_cpu;
 }
 
-#ifdef APM_FIXUP_CALLTODO
-/* 
- * Adjust the kernel calltodo timeout list.  This routine is used after 
- * an APM resume to recalculate the calltodo timer list values with the 
- * number of hz's we have been sleeping.  The next hardclock() will detect 
- * that there are fired timers and run softclock() to execute them.
- *
- * Please note, I have not done an exhaustive analysis of what code this
- * might break.  I am motivated to have my select()'s and alarm()'s that
- * have expired during suspend firing upon resume so that the applications
- * which set the timer can do the maintanence the timer was for as close
- * as possible to the originally intended time.  Testing this code for a 
- * week showed that resuming from a suspend resulted in 22 to 25 timers 
- * firing, which seemed independent on whether the suspend was 2 hours or
- * 2 days.  Your milage may vary.   - Ken Key <key at cs.utk.edu>
- */
-void
-adjust_timeout_calltodo(struct timeval *time_change)
-{
-	struct callout *p;
-	unsigned long delta_ticks;
-
-	/* 
-	 * How many ticks were we asleep?
-	 * (stolen from tvtohz()).
-	 */
-
-	/* Don't do anything */
-	if (time_change->tv_sec < 0)
-		return;
-	else if (time_change->tv_sec <= LONG_MAX / 1000000)
-		delta_ticks = howmany(time_change->tv_sec * 1000000 +
-		    time_change->tv_usec, tick) + 1;
-	else if (time_change->tv_sec <= LONG_MAX / hz)
-		delta_ticks = time_change->tv_sec * hz +
-		    howmany(time_change->tv_usec, tick) + 1;
-	else
-		delta_ticks = LONG_MAX;
-
-	if (delta_ticks > INT_MAX)
-		delta_ticks = INT_MAX;
-
-	/* 
-	 * Now rip through the timer calltodo list looking for timers
-	 * to expire.
-	 */
-
-	/* don't collide with softclock() */
-	CC_LOCK(cc);
-	for (p = calltodo.c_next; p != NULL; p = p->c_next) {
-		p->c_time -= delta_ticks;
-
-		/* Break if the timer had more time on it than delta_ticks */
-		if (p->c_time > 0)
-			break;
-
-		/* take back the ticks the timer didn't use (p->c_time <= 0) */
-		delta_ticks = -p->c_time;
-	}
-	CC_UNLOCK(cc);
-
-	return;
-}
-#endif /* APM_FIXUP_CALLTODO */
-
 static int
 flssbt(sbintime_t sbt)
 {

Modified: head/sys/sys/systm.h
==============================================================================
--- head/sys/sys/systm.h	Fri Nov 27 18:40:51 2020	(r368111)
+++ head/sys/sys/systm.h	Fri Nov 27 20:46:02 2020	(r368112)
@@ -482,11 +482,6 @@ extern cpu_tick_f *cpu_ticks;
 uint64_t cpu_tickrate(void);
 uint64_t cputick2usec(uint64_t tick);
 
-#ifdef APM_FIXUP_CALLTODO
-struct timeval;
-void	adjust_timeout_calltodo(struct timeval *time_change);
-#endif /* APM_FIXUP_CALLTODO */
-
 #include <sys/libkern.h>
 
 /* Initialize the world */


More information about the svn-src-all mailing list