kern_clock.c (55e0987aea18d0b97fc0444c7678cbca1c7761d0) kern_clock.c (fdce57a04219d7a36c6646950fde6c8bcd97c044)
1/*-
2 * Copyright (c) 1982, 1986, 1991, 1993
3 * The Regents of the University of California. All rights reserved.
4 * (c) UNIX System Laboratories, Inc.
5 * All or some portions of this file are derived from material licensed
6 * to the University of California by American Telephone and Telegraph
7 * Co. or Unix System Laboratories, Inc. and are reproduced herein with
8 * the permission of UNIX System Laboratories, Inc.

--- 377 unchanged lines hidden (view full) ---

386/*
387 * Initialize clock frequencies and start both clocks running.
388 */
389/* ARGSUSED*/
390static void
391initclocks(dummy)
392 void *dummy;
393{
1/*-
2 * Copyright (c) 1982, 1986, 1991, 1993
3 * The Regents of the University of California. All rights reserved.
4 * (c) UNIX System Laboratories, Inc.
5 * All or some portions of this file are derived from material licensed
6 * to the University of California by American Telephone and Telegraph
7 * Co. or Unix System Laboratories, Inc. and are reproduced herein with
8 * the permission of UNIX System Laboratories, Inc.

--- 377 unchanged lines hidden (view full) ---

386/*
387 * Initialize clock frequencies and start both clocks running.
388 */
389/* ARGSUSED*/
390static void
391initclocks(dummy)
392 void *dummy;
393{
394#ifdef EARLY_AP_STARTUP
395 struct proc *p;
396 struct thread *td;
397#endif
394 register int i;
395
396 /*
397 * Set divisors to 1 (normal case) and let the machine-specific
398 * code do its bit.
399 */
400 mtx_init(&time_lock, "time lock", NULL, MTX_DEF);
401 cpu_initclocks();

--- 8 unchanged lines hidden (view full) ---

410#ifdef SW_WATCHDOG
411 EVENTHANDLER_REGISTER(watchdog_list, watchdog_config, NULL, 0);
412#endif
413 /*
414 * Arrange for ticks to wrap 10 minutes after boot to help catch
415 * sign problems sooner.
416 */
417 ticks = INT_MAX - (hz * 10 * 60);
398 register int i;
399
400 /*
401 * Set divisors to 1 (normal case) and let the machine-specific
402 * code do its bit.
403 */
404 mtx_init(&time_lock, "time lock", NULL, MTX_DEF);
405 cpu_initclocks();

--- 8 unchanged lines hidden (view full) ---

414#ifdef SW_WATCHDOG
415 EVENTHANDLER_REGISTER(watchdog_list, watchdog_config, NULL, 0);
416#endif
417 /*
418 * Arrange for ticks to wrap 10 minutes after boot to help catch
419 * sign problems sooner.
420 */
421 ticks = INT_MAX - (hz * 10 * 60);
422
423#ifdef EARLY_AP_STARTUP
424 /*
425 * Fixup the tick counts in any blocked or sleeping threads to
426 * account for the jump above.
427 */
428 sx_slock(&allproc_lock);
429 FOREACH_PROC_IN_SYSTEM(p) {
430 PROC_LOCK(p);
431 if (p->p_state == PRS_NEW) {
432 PROC_UNLOCK(p);
433 continue;
434 }
435 FOREACH_THREAD_IN_PROC(p, td) {
436 thread_lock(td);
437 if (TD_ON_LOCK(td)) {
438 MPASS(td->td_blktick == 0);
439 td->td_blktick = ticks;
440 }
441 if (TD_ON_SLEEPQ(td)) {
442 MPASS(td->td_slptick == 0);
443 td->td_slptick = ticks;
444 }
445 thread_unlock(td);
446 }
447 PROC_UNLOCK(p);
448 }
449 sx_sunlock(&allproc_lock);
450#endif
418}
419
420/*
421 * Each time the real-time timer fires, this function is called on all CPUs.
422 * Note that hardclock() calls hardclock_cpu() for the boot CPU, so only
423 * the other CPUs in the system need to call this function.
424 */
425void

--- 471 unchanged lines hidden ---
451}
452
453/*
454 * Each time the real-time timer fires, this function is called on all CPUs.
455 * Note that hardclock() calls hardclock_cpu() for the boot CPU, so only
456 * the other CPUs in the system need to call this function.
457 */
458void

--- 471 unchanged lines hidden ---