Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F146593257
D17029.id.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
4 KB
Referenced Files
None
Subscribers
None
D17029.id.diff
View Options
Index: head/sys/kern/kern_clock.c
===================================================================
--- head/sys/kern/kern_clock.c
+++ head/sys/kern/kern_clock.c
@@ -421,85 +421,12 @@
#endif
}
-/*
- * Each time the real-time timer fires, this function is called on all CPUs.
- * Note that hardclock() calls hardclock_cpu() for the boot CPU, so only
- * the other CPUs in the system need to call this function.
- */
void
-hardclock_cpu(int usermode)
+hardclock(int cnt, int usermode)
{
struct pstats *pstats;
struct thread *td = curthread;
struct proc *p = td->td_proc;
- int flags;
-
- /*
- * Run current process's virtual and profile time, as needed.
- */
- pstats = p->p_stats;
- flags = 0;
- if (usermode &&
- timevalisset(&pstats->p_timer[ITIMER_VIRTUAL].it_value)) {
- PROC_ITIMLOCK(p);
- if (itimerdecr(&pstats->p_timer[ITIMER_VIRTUAL], tick) == 0)
- flags |= TDF_ALRMPEND | TDF_ASTPENDING;
- PROC_ITIMUNLOCK(p);
- }
- if (timevalisset(&pstats->p_timer[ITIMER_PROF].it_value)) {
- PROC_ITIMLOCK(p);
- if (itimerdecr(&pstats->p_timer[ITIMER_PROF], tick) == 0)
- flags |= TDF_PROFPEND | TDF_ASTPENDING;
- PROC_ITIMUNLOCK(p);
- }
- thread_lock(td);
- td->td_flags |= flags;
- thread_unlock(td);
-
-#ifdef HWPMC_HOOKS
- if (PMC_CPU_HAS_SAMPLES(PCPU_GET(cpuid)))
- PMC_CALL_HOOK_UNLOCKED(curthread, PMC_FN_DO_SAMPLES, NULL);
- if (td->td_intr_frame != NULL)
- PMC_SOFT_CALL_TF( , , clock, hard, td->td_intr_frame);
-#endif
- callout_process(sbinuptime());
- if (__predict_false(DPCPU_GET(epoch_cb_count)))
- GROUPTASK_ENQUEUE(DPCPU_PTR(epoch_cb_task));
-}
-
-/*
- * The real-time timer, interrupting hz times per second.
- */
-void
-hardclock(int usermode, uintfptr_t pc)
-{
-
- atomic_add_int(&ticks, 1);
- hardclock_cpu(usermode);
- tc_ticktock(1);
- cpu_tick_calibration();
- /*
- * If no separate statistics clock is available, run it from here.
- *
- * XXX: this only works for UP
- */
- if (stathz == 0) {
- profclock(usermode, pc);
- statclock(usermode);
- }
-#ifdef DEVICE_POLLING
- hardclock_device_poll(); /* this is very short and quick */
-#endif /* DEVICE_POLLING */
- if (watchdog_enabled > 0 && --watchdog_ticks <= 0)
- watchdog_fire();
-}
-
-void
-hardclock_cnt(int cnt, int usermode)
-{
- struct pstats *pstats;
- struct thread *td = curthread;
- struct proc *p = td->td_proc;
int *t = DPCPU_PTR(pcputicks);
int flags, global, newticks;
int i;
@@ -696,15 +623,8 @@
* This should be called by all active processors.
*/
void
-statclock(int usermode)
+statclock(int cnt, int usermode)
{
-
- statclock_cnt(1, usermode);
-}
-
-void
-statclock_cnt(int cnt, int usermode)
-{
struct rusage *ru;
struct vmspace *vm;
struct thread *td;
@@ -776,14 +696,7 @@
}
void
-profclock(int usermode, uintfptr_t pc)
-{
-
- profclock_cnt(1, usermode, pc);
-}
-
-void
-profclock_cnt(int cnt, int usermode, uintfptr_t pc)
+profclock(int cnt, int usermode, uintfptr_t pc)
{
struct thread *td;
#ifdef GPROF
Index: head/sys/kern/kern_clocksource.c
===================================================================
--- head/sys/kern/kern_clocksource.c
+++ head/sys/kern/kern_clocksource.c
@@ -183,7 +183,7 @@
hct = DPCPU_PTR(hardclocktime);
*hct = state->nexthard - tick_sbt;
if (fake < 2) {
- hardclock_cnt(runs, usermode);
+ hardclock(runs, usermode);
done = 1;
}
}
@@ -193,7 +193,7 @@
runs++;
}
if (runs && fake < 2) {
- statclock_cnt(runs, usermode);
+ statclock(runs, usermode);
done = 1;
}
if (profiling) {
@@ -203,7 +203,7 @@
runs++;
}
if (runs && !fake) {
- profclock_cnt(runs, usermode, TRAPF_PC(frame));
+ profclock(runs, usermode, TRAPF_PC(frame));
done = 1;
}
} else
Index: head/sys/sys/systm.h
===================================================================
--- head/sys/sys/systm.h
+++ head/sys/sys/systm.h
@@ -363,15 +363,11 @@
int sysbeep(int hertz, int period);
-void hardclock(int usermode, uintfptr_t pc);
-void hardclock_cnt(int cnt, int usermode);
-void hardclock_cpu(int usermode);
+void hardclock(int cnt, int usermode);
void hardclock_sync(int cpu);
void softclock(void *);
-void statclock(int usermode);
-void statclock_cnt(int cnt, int usermode);
-void profclock(int usermode, uintfptr_t pc);
-void profclock_cnt(int cnt, int usermode, uintfptr_t pc);
+void statclock(int cnt, int usermode);
+void profclock(int cnt, int usermode, uintfptr_t pc);
int hardclockintr(void);
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Wed, Mar 4, 10:43 PM (9 h, 15 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
29259096
Default Alt Text
D17029.id.diff (4 KB)
Attached To
Mode
D17029: Remove hardclock() and related subroutines.
Attached
Detach File
Event Timeline
Log In to Comment