Permalink
Switch branches/tags
master projects/altix projects/altix2 projects/amd64_xen_pv projects/arm_eabi_vfp projects/arm_eabi projects/arm_intrng projects/arm64 projects/armv6 projects/arpv2_merge_1 projects/ath_hal projects/atomic64 projects/bectl projects/bhyve_graphics projects/bhyve_npt_pmap projects/bhyve_ref projects/bhyve_svm projects/bhyve projects/bigbb projects/binutils-2.17 projects/bmake projects/bpfjit projects/bsd_rdma_4_9_stable_11 projects/bsd_rdma_4_9 projects/bsnmp-improved-ipv6-support projects/bsnmp-ipv6-mib projects/building-blocks projects/calloutng projects/cambria projects/camlock projects/capabilities8 projects/ci20_mips projects/cider projects/clang-sparc64 projects/clang-trunk projects/clang350-import projects/clang360-import projects/clang370-import projects/clang380-import projects/clang390-import projects/clang391-import projects/clang400-import projects/clang500-import projects/clang600-import projects/clang700-import projects/clangbsd-import projects/clangbsd projects/collation projects/contrib-netbsd-update-12 projects/counters projects/csup_wip projects/cxl_iscsi projects/diffused_head projects/doctools projects/dtrace projects/efi projects/efika_mx projects/elftoolchain-update-r3130 projects/elftoolchain projects/em_mq projects/enhanced_coredumps projects/etc_ipv6 projects/fix-libarchive-tests-after-r304075 projects/flex-sf projects/fuse projects/geom-events projects/geom_raid5 projects/graid/head projects/graid/7 projects/graid/8 projects/gvinum projects/hastd_wan projects/head_mfi projects/hid projects/hps_head projects/hwpmc projects/hyperv projects/ifnet projects/ifq projects/ino64 projects/intel_net_refactor projects/iosched projects/ipfw projects/ipsec projects/iscsi_opt projects/jailconf projects/jbuild projects/jeff_mbuf projects/jeff_mbuf2 projects/krb5 projects/l2filter projects/libpcap-update projects/libprocstat projects/libzfs_core projects/lld-import projects/lldb-r201577 projects/llvm-ia64 projects/lua-bootloader projects/lwref projects/make-check-sandbox projects/mbuf_iovec projects/mips projects/mips64-clang projects/mpsutil projects/mtree projects/multi-fibv6 projects/nand projects/net80211_testsuite projects/netbsd-tests-update-12 projects/netbsd-tests-upstream-01-2017 projects/nfsv4-packrats projects/nfsv4.1-client projects/nfsv4.1-server projects/nfsv42 projects/ngroups projects/numa projects/numa2 projects/ofed/base projects/ofed/head projects/onewire projects/openssl-1.0.2 projects/openssl_098_merge_8 projects/openssl111 projects/paravirt projects/pciehp projects/pf projects/physbio projects/pmac_pmu projects/pms projects/pnet projects/pnfs-planb-server-stable11 projects/pnfs-planb-server projects/pnfs-server projects/portbuild projects/power8_bringup_hacks projects/powernv projects/powerpcspe projects/ppc_linuxemu projects/ppc64 projects/pseries projects/quota64 projects/random_number_generator projects/release-arm-redux projects/release-arm64 projects/release-debugdist projects/release-embedded projects/release-install-debug projects/release-mips projects/release-noxdev projects/release-pkg projects/release-vmimage projects/release_6_3_xen projects/releng_6_xen projects/releng_7_xen projects/relnotes-restructure projects/routing_mpath projects/routing projects/rrs_mqueue projects/rrs_socrypto_tls projects/rtentry_cache projects/runtime-coverage projects/sbruno_firewire projects/sbruno_64cpus projects/sendfile projects/specific_leg projects/stable-10-backport-test-changes projects/stable-10-opts-mk projects/stable_7_xen projects/stress2 projects/suj projects/sv projects/tcp_cc_head projects/tcp_cc_7.x projects/tcp_cc_8.x projects/tcp_ffcaia2008_head projects/tcp_ffcaia2008_8.x projects/uefi projects/umtx projects/utrace2 projects/vap7 projects/varsym projects/virtio projects/vmware_pvscsi projects/vmxnet projects/vnet projects/vps projects/vxlan projects/x2apic projects/zfsd release/2.0 release/2.0.5 release/2.1.0 release/2.1.5 release/2.1.6 release/2.1.6.1 release/2.1.7 release/2.2.0 release/2.2.1 release/2.2.2 release/2.2.5 release/2.2.6 release/2.2.7 release/2.2.8 release/3.0.0 release/3.1.0 release/3.2.0 release/3.3.0 release/3.4.0 release/3.5.0 release/4.0.0 release/4.1.0 release/4.1.1 release/4.2.0 release/4.3.0 release/4.4.0 release/4.5.0 release/4.6.0 release/4.6.1 release/4.6.2 release/4.7.0 release/4.8.0 release/4.9.0 release/4.10.0 release/4.11.0 release/5.0.0 release/5.1.0 release/5.2.0 release/5.2.1 release/5.3.0 release/5.4.0 release/5.5.0 release/6.0.0 release/6.1.0 release/6.2.0 release/6.3.0 release/6.4.0 release/7.0.0 release/7.1.0 release/7.2.0 release/7.3.0 release/7.4.0 release/8.0.0 release/8.1.0 release/8.2.0 release/8.3.0 release/8.4.0 release/9.0.0 release/9.1.0 release/9.2.0 release/9.3.0 release/10.0.0 release/10.1.0 release/10.2.0 release/10.3.0 release/10.4.0 release/11.0.0 release/11.0.1 release/11.1.0 release/11.2.0 release/12.0.0 releng/2.0a releng/2.0b releng/2.0.5 releng/4.3 releng/4.4 releng/4.5 releng/4.6 releng/4.7 releng/4.8 releng/4.9 releng/4.10 releng/4.11 releng/5.0 releng/5.1 releng/5.2 releng/5.3 releng/5.4 releng/5.5 releng/6.0 releng/6.1 releng/6.2 releng/6.3 releng/6.4 releng/7.0 releng/7.1 releng/7.2 releng/7.3 releng/7.4 releng/8.0 releng/8.1 releng/8.2 releng/8.3 releng/8.4 releng/9.0 releng/9.1 releng/9.2 releng/9.3 releng/10.0 releng/10.1 releng/10.2 releng/10.3 releng/10.4 releng/11.0 releng/11.1 releng/11.2 releng/12.0 stable/2.0.5 stable/2.1 stable/2.2 stable/3 stable/4 stable/5 stable/6 stable/7 stable/8 stable/9 stable/10 stable/11 stable/12 svn_head user/adrian/ath_radar_stuff user/adrian/if_ath_devel user/adrian/if_ath_tx user/adrian/net80211_amsdu_ff user/adrian/net80211_tx user/adrian/spoof_bind user/ae/bootcode user/ae/inet6 user/ae/usr.sbin user/alc/PG_CACHED user/alc/PQ_LAUNDRY user/alc/cachefree user/alc/pagelock user/alc/pmap user/alc/pvh_global_lock user/alc/superpages user/alc/zerocopy user/alfred/ewatchdog user/alfred/so_discard user/alfred/9-alfred user/andre/mbuf_staging user/andre/routelocking user/andre/tcp-ao user/andre/tcp_workqueue user/asomers/style9 user/attilio/jeff-numa user/attilio/membarclean user/attilio/rm_vmobj_cache user/attilio/vmc-playground user/attilio/vmcontention user/attilio/vmobj-fullread user/attilio/vmobj-readlock user/attilio/vmobj-rwlock user/avg/xcpu user/bapt/diff user/brooks/openssh-hpn user/brooks/tchacks user/bryanv/vtnetmq user/bugmeister/gnats user/bz/unbound_dns64 user/cperciva/EC2-build user/cperciva/freebsd-update-build user/cperciva/freebsd-update-mirror user/cperciva/panicmail user/cperciva/pkesh user/cperciva/portsnap-build user/cperciva/portsnap-mirror user/crees/rclint user/davidxu/libthr user/davidxu/pth_objdestroy user/dchagin/lemul user/delphij/libz-8 user/delphij/patch user/delphij/zfs-arc-rebase user/delphij/zfs-lz4 user/des/bsddom user/des/compat user/des/fbce user/des/fbp user/des/fetch user/des/fmerge user/des/ndr user/des/phybs user/des/refetch user/des/sizes user/des/struct user/des/svnsup user/des/tinderbox user/des/zfs-backup user/dfr/gssapi user/dfr/xenhvm user/dim/merge-test user/dim/merge-test2 user/dougb/portmaster user/ed/newcons user/edwin/calendar user/edwin/locale user/edwin/releasenotes user/edwin/tftpd user/edwin/top user/edwin/tzcode user/eri/net user/eri/netinet user/eri/pf45 user/fabient/svctest user/gabor/grep user/gabor/tre-integration user/gad/singlemod user/gjb/hacking user/gjb/release-embedded user/gjb/thermite-v2 user/gjb/thermite user/glebius/course user/gnn/fasttrap user/gnn/geom user/gonzo/bugzilla-freebsd user/hrs/arm user/hrs/ipv6 user/hrs/rc.d user/hrs/releng user/imp/camdoc user/imp/config_reorg_sys user/imp/ext_comp user/imp/extern_cc user/imp/masq user/imp/newcard user/imp/nopriv user/imp/tbemd user/jceel/soc2012_armv6 user/jceel/soc2014_evdev user/jchandra/xlp-merge user/jchandra/8-stable-mips user/jeff/numa user/jgh/committers-guide user/jgh/icedtea6 user/jimharris/ioat user/jimharris/isci user/jmallett/octeon user/jmmv/autotest user/keramida/tzcode user/keramida/vendor user/kib/vm6 user/kmacy/HEAD_ECMP user/kmacy/HEAD_fast_multi_xmit user/kmacy/HEAD_fast_net_merge user/kmacy/HEAD_fast_net user/kmacy/HEAD_fast_xmit user/kmacy/HEAD_flowtable user/kmacy/HEAD_multi_tx user/kmacy/head_arpv2 user/kmacy/head_flowtable_v6 user/kmacy/head_page_lock_incr user/kmacy/head_page_lock user/kmacy/head_page_lock_2 user/kmacy/head_ppacket user/kmacy/head_zfs_merge user/kmacy/head_zfs_updates user/kmacy/head_zlib user/kmacy/releng_7_fast_net user/kmacy/releng_7_2_fast_net user/kmacy/releng_7_2_fcs user/kmacy/releng_7_2_fcs_1 user/kmacy/releng_7_2_xen user/kmacy/releng_7_2_zfs user/kmacy/releng_8_fcs_buf_xen user/kmacy/releng_8_fcs_buf user/kmacy/releng_8_fcs user/kmacy/releng_8_page_lock user/kmacy/releng_8_rump user/kmacy/stable_7_page_lock user/lstewart/alq_varlen_7.x user/lstewart/alq_varlen_8.x user/lstewart/dummynet_7.x user/lstewart/dummynet_8.x user/lstewart/misc_7.x user/lstewart/misc_8.x user/luigi/geom_sched user/luigi/ipfw user/luigi/ipfw_80 user/luigi/netmap user/marcel/altix-eol user/marcel/ia64-eol user/marcel/libvdsk user/marcel/mkimg user/marcel/vtc.sys user/markj/PQ_LAUNDRY_11 user/markj/netdump user/markj/vm-playground user/mjacob/sys user/mlaier/pf44head user/mr/ficl user/netchild/calendar-utf8 user/netchild/coverity user/netchild/deskjail user/netchild/doxygen user/netchild/jailmount user/netchild/linuxaio user/netchild/linuxulator-dtrace user/netchild/misc user/netchild/obsolete user/ngie/add-pjdfstest user/ngie/bsnmp_cleanup user/ngie/bug203673 user/ngie/checkdpadd-fixes user/ngie/detangle-rc user/ngie/fix-progs user/ngie/github-test-cherrypicks user/ngie/make_check user/ngie/more-tests.broken user/ngie/more-tests user/ngie/more-tests2 user/ngie/ntb-hacking user/ngie/optional-require user/ngie/release-pkg-fix-tests user/ngie/socket-tests user/ngie/stable-10-fix-LINT-NOINET user/ngie/stable-10-ixgbe-upgrade user/ngie/stable-10-libnv user/ngie/10.1-bug-198062 user/np/cxl_tuning user/np/stable_9_toe user/np/toe_iwarp user/nwhitehorn/bsdinstall user/nwhitehorn/ps3 user/nyan/pc98 user/obrien/krb5bld user/obrien/libmd-ossl user/peter/kinfo user/peter/long_cpumask user/pho/stress2 user/piso/ipfw_old user/piso/ipfw user/rafan/ncurses user/rpaulo/aird user/rpaulo/armpmc user/rpaulo/eeemon user/rpaulo/ubthidctl user/sam/wifi user/sbruno/ard user/sbruno/head_146698 user/sbruno/head_177038 user/sbruno/head_189017 user/sbruno/mfid user/sbruno/mptd user/sbruno/pxe_http-gsoc2007 user/sbruno/pxe_http_head user/sbruno/pxe_http user/sbruno/pxestuff user/sbruno/1394dev user/syuu/bhyve_standalone_guest_test1 user/syuu/bhyve_standalone_guest user/syuu/mq_bpf user/thompsa/usb user/thompsa/vaptq user/uqs/scan-world user/weongyo/usb user/yar/rcguard
Nothing to show
Find file Copy path
d8596f6 Nov 27, 2017
1 recent contributor

Users who have contributed to this file recently

137 lines (113 sloc) 3.74 KB
/*-
* SPDX-License-Identifier: BSD-2-Clause-FreeBSD
*
* Copyright 2012 Konstantin Belousov <kib@FreeBSD.ORG>.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
* IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* $FreeBSD$
*/
#ifndef _SYS_VDSO_H
#define _SYS_VDSO_H
#include <sys/types.h>
#include <machine/vdso.h>
struct vdso_timehands {
uint32_t th_algo;
uint32_t th_gen;
uint64_t th_scale;
uint32_t th_offset_count;
uint32_t th_counter_mask;
struct bintime th_offset;
struct bintime th_boottime;
VDSO_TIMEHANDS_MD
};
struct vdso_timekeep {
uint32_t tk_ver;
uint32_t tk_enabled;
uint32_t tk_current;
struct vdso_timehands tk_th[];
};
#define VDSO_TK_CURRENT_BUSY 0xffffffff
#define VDSO_TK_VER_1 0x1
#define VDSO_TK_VER_CURR VDSO_TK_VER_1
#define VDSO_TH_ALGO_1 0x1
#define VDSO_TH_ALGO_2 0x2
#define VDSO_TH_ALGO_3 0x3
#define VDSO_TH_ALGO_4 0x4
#ifndef _KERNEL
struct timespec;
struct timeval;
struct timezone;
int __vdso_clock_gettime(clockid_t clock_id, struct timespec *ts);
int __vdso_gettimeofday(struct timeval *tv, struct timezone *tz);
int __vdso_gettc(const struct vdso_timehands *vdso_th, u_int *tc);
int __vdso_gettimekeep(struct vdso_timekeep **tk);
#endif
#ifdef _KERNEL
struct timecounter;
struct vdso_sv_tk {
int sv_timekeep_off;
int sv_timekeep_curr;
uint32_t sv_timekeep_gen;
};
void timekeep_push_vdso(void);
uint32_t tc_fill_vdso_timehands(struct vdso_timehands *vdso_th);
/*
* The cpu_fill_vdso_timehands() function should fill MD-part of the
* struct vdso_timehands, which is both machine- and
* timecounter-depended. The return value should be 1 if fast
* userspace timecounter is enabled by hardware, and 0 otherwise. The
* global sysctl enable override is handled by machine-independed code
* after cpu_fill_vdso_timehands() call is made.
*/
uint32_t cpu_fill_vdso_timehands(struct vdso_timehands *vdso_th,
struct timecounter *tc);
struct vdso_sv_tk *alloc_sv_tk(void);
#define VDSO_TH_NUM 4
#ifdef COMPAT_FREEBSD32
struct bintime32 {
uint32_t sec;
uint32_t frac[2];
};
struct vdso_timehands32 {
uint32_t th_algo;
uint32_t th_gen;
uint32_t th_scale[2];
uint32_t th_offset_count;
uint32_t th_counter_mask;
struct bintime32 th_offset;
struct bintime32 th_boottime;
VDSO_TIMEHANDS_MD32
};
struct vdso_timekeep32 {
uint32_t tk_ver;
uint32_t tk_enabled;
uint32_t tk_current;
struct vdso_timehands32 tk_th[];
};
uint32_t tc_fill_vdso_timehands32(struct vdso_timehands32 *vdso_th32);
uint32_t cpu_fill_vdso_timehands32(struct vdso_timehands32 *vdso_th32,
struct timecounter *tc);
struct vdso_sv_tk *alloc_sv_tk_compat32(void);
#endif
#endif
#endif