Author: markj
Date: Thu Nov 19 02:50:48 2020
New Revision: 367826
URL: https://svnweb.freebsd.org/changeset/base/367826

Log:
  Remove NO_EVENTTIMERS support
  
  The arm configs that required it have been removed from the tree.
  Removing this option makes the callout code easier to read and
  discourages developers from adding new configs without eventtimer
  drivers.
  
  Reviewed by:  ian, imp, mav
  Sponsored by: The FreeBSD Foundation
  Differential Revision:        https://reviews.freebsd.org/D27270

Modified:
  head/sys/arm/arm/machdep.c
  head/sys/arm/include/machdep.h
  head/sys/conf/options
  head/sys/conf/options.arm
  head/sys/kern/kern_et.c
  head/sys/kern/kern_timeout.c

Modified: head/sys/arm/arm/machdep.c
==============================================================================
--- head/sys/arm/arm/machdep.c  Thu Nov 19 02:44:08 2020        (r367825)
+++ head/sys/arm/arm/machdep.c  Thu Nov 19 02:50:48 2020        (r367826)
@@ -48,7 +48,6 @@
 #include "opt_kstack_pages.h"
 #include "opt_platform.h"
 #include "opt_sched.h"
-#include "opt_timer.h"
 
 #include <sys/cdefs.h>
 __FBSDID("$FreeBSD$");
@@ -304,16 +303,12 @@ cpu_idle(int busy)
 
        CTR2(KTR_SPARE2, "cpu_idle(%d) at %d", busy, curcpu);
        spinlock_enter();
-#ifndef NO_EVENTTIMERS
        if (!busy)
                cpu_idleclock();
-#endif
        if (!sched_runnable())
                cpu_sleep(0);
-#ifndef NO_EVENTTIMERS
        if (!busy)
                cpu_activeclock();
-#endif
        spinlock_exit();
        CTR2(KTR_SPARE2, "cpu_idle(%d) at %d done", busy, curcpu);
 }
@@ -325,22 +320,7 @@ cpu_idle_wakeup(int cpu)
        return (0);
 }
 
-#ifdef NO_EVENTTIMERS
-/*
- * Most ARM platforms don't need to do anything special to init their clocks
- * (they get intialized during normal device attachment), and by not defining a
- * cpu_initclocks() function they get this generic one.  Any platform that 
needs
- * to do something special can just provide their own implementation, which 
will
- * override this one due to the weak linkage.
- */
 void
-arm_generic_initclocks(void)
-{
-}
-__weak_reference(arm_generic_initclocks, cpu_initclocks);
-
-#else
-void
 cpu_initclocks(void)
 {
 
@@ -353,7 +333,6 @@ cpu_initclocks(void)
        cpu_initclocks_bsp();
 #endif
 }
-#endif
 
 #ifdef PLATFORM
 void

Modified: head/sys/arm/include/machdep.h
==============================================================================
--- head/sys/arm/include/machdep.h      Thu Nov 19 02:44:08 2020        
(r367825)
+++ head/sys/arm/include/machdep.h      Thu Nov 19 02:50:48 2020        
(r367826)
@@ -39,7 +39,6 @@ vm_offset_t parse_boot_param(struct arm_boot_params *a
 void arm_parse_fdt_bootargs(void);
 void arm_print_kenv(void);
 
-void arm_generic_initclocks(void);
 int arm_get_vfpstate(struct thread *td, void *args);
 
 /* Board-specific attributes */

Modified: head/sys/conf/options
==============================================================================
--- head/sys/conf/options       Thu Nov 19 02:44:08 2020        (r367825)
+++ head/sys/conf/options       Thu Nov 19 02:50:48 2020        (r367826)
@@ -180,7 +180,6 @@ NEW_PCIB    opt_global.h
 NO_ADAPTIVE_MUTEXES    opt_adaptive_mutexes.h
 NO_ADAPTIVE_RWLOCKS
 NO_ADAPTIVE_SX
-NO_EVENTTIMERS         opt_timer.h
 NO_OBSOLETE_CODE       opt_global.h
 NO_SYSCTL_DESCR        opt_global.h
 NSWBUF_MIN     opt_param.h

Modified: head/sys/conf/options.arm
==============================================================================
--- head/sys/conf/options.arm   Thu Nov 19 02:44:08 2020        (r367825)
+++ head/sys/conf/options.arm   Thu Nov 19 02:50:48 2020        (r367826)
@@ -6,7 +6,6 @@ ARM_KERN_DIRECTMAP      opt_vm.h
 ARM_L2_PIPT            opt_global.h
 ARM_MANY_BOARD         opt_global.h
 ARM_WANT_TP_ADDRESS    opt_global.h
-COUNTS_PER_SEC         opt_timer.h
 CPSW_ETHERSWITCH       opt_cpsw.h
 CPU_ARM9E              opt_global.h
 CPU_ARM1176            opt_global.h
@@ -61,7 +60,6 @@ SOC_ROCKCHIP_RK3188   opt_global.h
 SOC_TI_AM335X          opt_global.h
 SOC_TEGRA2             opt_global.h
 XSCALE_CACHE_READ_WRITE_ALLOCATE       opt_global.h
-XSACLE_DISABLE_CCNT    opt_timer.h
 VERBOSE_INIT_ARM       opt_global.h
 VM_MAXUSER_ADDRESS     opt_global.h
 GFB_DEBUG              opt_gfb.h

Modified: head/sys/kern/kern_et.c
==============================================================================
--- head/sys/kern/kern_et.c     Thu Nov 19 02:44:08 2020        (r367825)
+++ head/sys/kern/kern_et.c     Thu Nov 19 02:50:48 2020        (r367826)
@@ -37,8 +37,6 @@ __FBSDID("$FreeBSD$");
 #include <sys/queue.h>
 #include <sys/timeet.h>
 
-#include "opt_timer.h"
-
 SLIST_HEAD(et_eventtimers_list, eventtimer);
 static struct et_eventtimers_list eventtimers = 
SLIST_HEAD_INITIALIZER(et_eventtimers);
 
@@ -130,9 +128,7 @@ void
 et_change_frequency(struct eventtimer *et, uint64_t newfreq)
 {
 
-#ifndef NO_EVENTTIMERS
        cpu_et_frequency(et, newfreq);
-#endif
 }
 
 /*

Modified: head/sys/kern/kern_timeout.c
==============================================================================
--- head/sys/kern/kern_timeout.c        Thu Nov 19 02:44:08 2020        
(r367825)
+++ head/sys/kern/kern_timeout.c        Thu Nov 19 02:50:48 2020        
(r367826)
@@ -41,9 +41,6 @@ __FBSDID("$FreeBSD$");
 
 #include "opt_callout_profiling.h"
 #include "opt_ddb.h"
-#if defined(__arm__)
-#include "opt_timer.h"
-#endif
 #include "opt_rss.h"
 
 #include <sys/param.h>
@@ -74,9 +71,7 @@ __FBSDID("$FreeBSD$");
 #include <machine/cpu.h>
 #endif
 
-#ifndef NO_EVENTTIMERS
 DPCPU_DECLARE(sbintime_t, hardclocktime);
-#endif
 
 SDT_PROVIDER_DEFINE(callout_execute);
 SDT_PROBE_DEFINE1(callout_execute, , , callout__start, "struct callout *");
@@ -527,9 +522,8 @@ next:
                 */
        } while (((int)(firstb - lastb)) <= 0);
        cc->cc_firstevent = last;
-#ifndef NO_EVENTTIMERS
        cpu_new_callout(curcpu, last, first);
-#endif
+
 #ifdef CALLOUT_PROFILING
        avg_depth_dir += (depth_dir * 1000 - avg_depth_dir) >> 8;
        avg_mpcalls_dir += (mpcalls_dir * 1000 - avg_mpcalls_dir) >> 8;
@@ -594,7 +588,7 @@ callout_cc_add(struct callout *c, struct callout_cpu *
        LIST_INSERT_HEAD(&cc->cc_callwheel[bucket], c, c_links.le);
        if (cc->cc_bucket == bucket)
                cc_exec_next(cc) = c;
-#ifndef NO_EVENTTIMERS
+
        /*
         * Inform the eventtimers(4) subsystem there's a new callout
         * that has been inserted, but only if really required.
@@ -606,7 +600,6 @@ callout_cc_add(struct callout *c, struct callout_cpu *
                cc->cc_firstevent = sbt;
                cpu_new_callout(cpu, sbt, c->c_time);
        }
-#endif
 }
 
 static void
@@ -851,15 +844,7 @@ callout_when(sbintime_t sbt, sbintime_t precision, int
        }
        if ((flags & C_HARDCLOCK) != 0 && sbt < tick_sbt)
                sbt = tick_sbt;
-       if ((flags & C_HARDCLOCK) != 0 ||
-#ifdef NO_EVENTTIMERS
-           sbt >= sbt_timethreshold) {
-               to_sbt = getsbinuptime();
-
-               /* Add safety belt for the case of hz > 1000. */
-               to_sbt += tc_tick_sbt - tick_sbt;
-#else
-           sbt >= sbt_tickthreshold) {
+       if ((flags & C_HARDCLOCK) != 0 || sbt >= sbt_tickthreshold) {
                /*
                 * Obtain the time of the last hardclock() call on
                 * this CPU directly from the kern_clocksource.c.
@@ -872,7 +857,6 @@ callout_when(sbintime_t sbt, sbintime_t precision, int
                spinlock_enter();
                to_sbt = DPCPU_GET(hardclocktime);
                spinlock_exit();
-#endif
 #endif
                if (cold && to_sbt == 0)
                        to_sbt = sbinuptime();
_______________________________________________
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"

Reply via email to