kern_tc.c (304974) | kern_tc.c (305866) |
---|---|
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 * | 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 The FreeBSD Foundation | 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. | 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. |
|
14 */ 15 16#include <sys/cdefs.h> | 17 */ 18 19#include <sys/cdefs.h> |
17__FBSDID("$FreeBSD: stable/11/sys/kern/kern_tc.c 304974 2016-08-29 04:45:58Z kib $"); | 20__FBSDID("$FreeBSD: stable/11/sys/kern/kern_tc.c 305866 2016-09-16 10:04:28Z kib $"); |
18 19#include "opt_compat.h" 20#include "opt_ntp.h" 21#include "opt_ffclock.h" 22 23#include <sys/param.h> 24#include <sys/kernel.h> 25#include <sys/limits.h> --- 2103 unchanged lines hidden (view full) --- 2129 2130uint32_t 2131tc_fill_vdso_timehands(struct vdso_timehands *vdso_th) 2132{ 2133 struct timehands *th; 2134 uint32_t enabled; 2135 2136 th = timehands; | 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; |
2137 vdso_th->th_algo = VDSO_TH_ALGO_1; | |
2138 vdso_th->th_scale = th->th_scale; 2139 vdso_th->th_offset_count = th->th_offset_count; 2140 vdso_th->th_counter_mask = th->th_counter->tc_counter_mask; 2141 vdso_th->th_offset = th->th_offset; 2142 vdso_th->th_boottime = th->th_boottime; | 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; |
2143 enabled = cpu_fill_vdso_timehands(vdso_th, th->th_counter); | 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; |
2144 if (!vdso_th_enable) 2145 enabled = 0; 2146 return (enabled); 2147} 2148 2149#ifdef COMPAT_FREEBSD32 2150uint32_t 2151tc_fill_vdso_timehands32(struct vdso_timehands32 *vdso_th32) 2152{ 2153 struct timehands *th; 2154 uint32_t enabled; 2155 2156 th = timehands; | 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; |
2157 vdso_th32->th_algo = VDSO_TH_ALGO_1; | |
2158 *(uint64_t *)&vdso_th32->th_scale[0] = th->th_scale; 2159 vdso_th32->th_offset_count = th->th_offset_count; 2160 vdso_th32->th_counter_mask = th->th_counter->tc_counter_mask; 2161 vdso_th32->th_offset.sec = th->th_offset.sec; 2162 *(uint64_t *)&vdso_th32->th_offset.frac[0] = th->th_offset.frac; 2163 vdso_th32->th_boottime.sec = th->th_boottime.sec; 2164 *(uint64_t *)&vdso_th32->th_boottime.frac[0] = th->th_boottime.frac; | 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; |
2165 enabled = cpu_fill_vdso_timehands32(vdso_th32, th->th_counter); | 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; |
2166 if (!vdso_th_enable) 2167 enabled = 0; 2168 return (enabled); 2169} 2170#endif | 2175 if (!vdso_th_enable) 2176 enabled = 0; 2177 return (enabled); 2178} 2179#endif |