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
This commit is contained in:
Mark Johnston 2020-11-19 02:50:48 +00:00
parent bc7ed46b63
commit a28c28e6ef
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=367826
6 changed files with 3 additions and 48 deletions

View File

@ -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,21 +320,6 @@ 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

View File

@ -39,7 +39,6 @@ vm_offset_t parse_boot_param(struct arm_boot_params *abp);
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 */

View File

@ -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

View File

@ -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

View File

@ -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
}
/*

View File

@ -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 @@ callout_process(sbintime_t now)
*/
} 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 *cc,
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->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 flags,
}
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 flags,
spinlock_enter();
to_sbt = DPCPU_GET(hardclocktime);
spinlock_exit();
#endif
#endif
if (cold && to_sbt == 0)
to_sbt = sbinuptime();