Deleted Added
sdiff udiff text old ( 304974 ) new ( 305866 )
full compact
1/*-
2 * ----------------------------------------------------------------------------
3 * "THE BEER-WARE LICENSE" (Revision 42):
4 * <phk@FreeBSD.ORG> wrote this file. As long as you retain this notice you
5 * can do whatever you want with this stuff. If we meet some day, and you think
6 * this stuff is worth it, you can buy me a beer in return. Poul-Henning Kamp
7 * ----------------------------------------------------------------------------
8 *
9 * Copyright (c) 2011, 2015, 2016 The FreeBSD Foundation
10 * All rights reserved.
11 *
12 * Portions of this software were developed by Julien Ridoux at the University
13 * of Melbourne under sponsorship from the FreeBSD Foundation.
14 *
15 * Portions of this software were developed by Konstantin Belousov
16 * under sponsorship from the FreeBSD Foundation.
17 */
18
19#include <sys/cdefs.h>
20__FBSDID("$FreeBSD: stable/11/sys/kern/kern_tc.c 305866 2016-09-16 10:04:28Z kib $");
21
22#include "opt_compat.h"
23#include "opt_ntp.h"
24#include "opt_ffclock.h"
25
26#include <sys/param.h>
27#include <sys/kernel.h>
28#include <sys/limits.h>

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

2132
2133uint32_t
2134tc_fill_vdso_timehands(struct vdso_timehands *vdso_th)
2135{
2136 struct timehands *th;
2137 uint32_t enabled;
2138
2139 th = timehands;
2140 vdso_th->th_scale = th->th_scale;
2141 vdso_th->th_offset_count = th->th_offset_count;
2142 vdso_th->th_counter_mask = th->th_counter->tc_counter_mask;
2143 vdso_th->th_offset = th->th_offset;
2144 vdso_th->th_boottime = th->th_boottime;
2145 if (th->th_counter->tc_fill_vdso_timehands != NULL) {
2146 enabled = th->th_counter->tc_fill_vdso_timehands(vdso_th,
2147 th->th_counter);
2148 } else
2149 enabled = 0;
2150 if (!vdso_th_enable)
2151 enabled = 0;
2152 return (enabled);
2153}
2154
2155#ifdef COMPAT_FREEBSD32
2156uint32_t
2157tc_fill_vdso_timehands32(struct vdso_timehands32 *vdso_th32)
2158{
2159 struct timehands *th;
2160 uint32_t enabled;
2161
2162 th = timehands;
2163 *(uint64_t *)&vdso_th32->th_scale[0] = th->th_scale;
2164 vdso_th32->th_offset_count = th->th_offset_count;
2165 vdso_th32->th_counter_mask = th->th_counter->tc_counter_mask;
2166 vdso_th32->th_offset.sec = th->th_offset.sec;
2167 *(uint64_t *)&vdso_th32->th_offset.frac[0] = th->th_offset.frac;
2168 vdso_th32->th_boottime.sec = th->th_boottime.sec;
2169 *(uint64_t *)&vdso_th32->th_boottime.frac[0] = th->th_boottime.frac;
2170 if (th->th_counter->tc_fill_vdso_timehands32 != NULL) {
2171 enabled = th->th_counter->tc_fill_vdso_timehands32(vdso_th32,
2172 th->th_counter);
2173 } else
2174 enabled = 0;
2175 if (!vdso_th_enable)
2176 enabled = 0;
2177 return (enabled);
2178}
2179#endif