Deleted Added
full compact
clock.c (247086) clock.c (247463)
1/*-
2 * Copyright (c) 1990 The Regents of the University of California.
3 * Copyright (c) 2010 Alexander Motin <mav@FreeBSD.org>
4 * All rights reserved.
5 *
6 * This code is derived from software contributed to Berkeley by
7 * William Jolitz and Don Ahn.
8 *

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

29 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
30 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
31 * SUCH DAMAGE.
32 *
33 * from: @(#)clock.c 7.2 (Berkeley) 5/12/91
34 */
35
36#include <sys/cdefs.h>
1/*-
2 * Copyright (c) 1990 The Regents of the University of California.
3 * Copyright (c) 2010 Alexander Motin <mav@FreeBSD.org>
4 * All rights reserved.
5 *
6 * This code is derived from software contributed to Berkeley by
7 * William Jolitz and Don Ahn.
8 *

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

29 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
30 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
31 * SUCH DAMAGE.
32 *
33 * from: @(#)clock.c 7.2 (Berkeley) 5/12/91
34 */
35
36#include <sys/cdefs.h>
37__FBSDID("$FreeBSD: head/sys/x86/isa/clock.c 247086 2013-02-21 06:38:24Z imp $");
37__FBSDID("$FreeBSD: head/sys/x86/isa/clock.c 247463 2013-02-28 13:46:03Z mav $");
38
39/*
40 * Routines to handle clock hardware.
41 */
42
43#include "opt_clock.h"
44#include "opt_isa.h"
45#include "opt_mca.h"

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

584 }
585 i8254_lastcount = count;
586 count += i8254_offset;
587 mtx_unlock_spin(&clock_lock);
588 return (count);
589}
590
591static int
38
39/*
40 * Routines to handle clock hardware.
41 */
42
43#include "opt_clock.h"
44#include "opt_isa.h"
45#include "opt_mca.h"

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

584 }
585 i8254_lastcount = count;
586 count += i8254_offset;
587 mtx_unlock_spin(&clock_lock);
588 return (count);
589}
590
591static int
592attimer_start(struct eventtimer *et,
593 struct bintime *first, struct bintime *period)
592attimer_start(struct eventtimer *et, sbintime_t first, sbintime_t period)
594{
595 device_t dev = (device_t)et->et_priv;
596 struct attimer_softc *sc = device_get_softc(dev);
597
593{
594 device_t dev = (device_t)et->et_priv;
595 struct attimer_softc *sc = device_get_softc(dev);
596
598 if (period != NULL) {
597 if (period != 0) {
599 sc->mode = MODE_PERIODIC;
598 sc->mode = MODE_PERIODIC;
600 sc->period = period->frac >> 32;
599 sc->period = period;
601 } else {
602 sc->mode = MODE_ONESHOT;
600 } else {
601 sc->mode = MODE_ONESHOT;
603 sc->period = first->frac >> 32;
602 sc->period = first;
604 }
605 if (!sc->intr_en) {
606 i8254_intsrc->is_pic->pic_enable_source(i8254_intsrc);
607 sc->intr_en = 1;
608 }
609 set_i8254_freq(sc->mode, sc->period);
610 return (0);
611}

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

750 i8254_intsrc->is_handlers--;
751 i8254_intsrc->is_pic->pic_enable_intr(i8254_intsrc);
752 sc->et.et_name = "i8254";
753 sc->et.et_flags = ET_FLAGS_PERIODIC;
754 if (!i8254_timecounter)
755 sc->et.et_flags |= ET_FLAGS_ONESHOT;
756 sc->et.et_quality = 100;
757 sc->et.et_frequency = i8254_freq;
603 }
604 if (!sc->intr_en) {
605 i8254_intsrc->is_pic->pic_enable_source(i8254_intsrc);
606 sc->intr_en = 1;
607 }
608 set_i8254_freq(sc->mode, sc->period);
609 return (0);
610}

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

749 i8254_intsrc->is_handlers--;
750 i8254_intsrc->is_pic->pic_enable_intr(i8254_intsrc);
751 sc->et.et_name = "i8254";
752 sc->et.et_flags = ET_FLAGS_PERIODIC;
753 if (!i8254_timecounter)
754 sc->et.et_flags |= ET_FLAGS_ONESHOT;
755 sc->et.et_quality = 100;
756 sc->et.et_frequency = i8254_freq;
758 sc->et.et_min_period.sec = 0;
759 sc->et.et_min_period.frac =
760 ((0x0002LLU << 48) / i8254_freq) << 16;
761 sc->et.et_max_period.sec = 0xffff / i8254_freq;
762 sc->et.et_max_period.frac =
763 ((0xfffeLLU << 48) / i8254_freq) << 16;
757 sc->et.et_min_period = (0x0002LLU << 32) / i8254_freq;
758 sc->et.et_max_period = (0xfffeLLU << 32) / i8254_freq;
764 sc->et.et_start = attimer_start;
765 sc->et.et_stop = attimer_stop;
766 sc->et.et_priv = dev;
767 et_register(&sc->et);
768 }
769 return(0);
770}
771

--- 31 unchanged lines hidden ---
759 sc->et.et_start = attimer_start;
760 sc->et.et_stop = attimer_stop;
761 sc->et.et_priv = dev;
762 et_register(&sc->et);
763 }
764 return(0);
765}
766

--- 31 unchanged lines hidden ---