summaryrefslogtreecommitdiffstats
path: root/sys/sys/time.h
Commit message (Collapse)AuthorAgeFilesLines
* Complete MFC of r270233, also unbreak the build.davide2014-08-201-0/+1
| | | | Reported by: grehan
* Use single underscore for all parameters name and local variables indavide2013-09-011-79/+80
| | | | | | | | | | bintime_* related functions. This commit completes what was already done by theraven@ for bintime_shift, and just uses a single underscore instead of two (which is a style bug according to Bruce). See r251855 for reference. Reported by: theraven Discussed with: bde Reviewed by: bde
* Rename a parameter in sys/time.h so that you don't get warnings for thingstheraven2013-06-171-9/+9
| | | | like libdialog that include both this header and math.h.
* - Make callout(9) tickless, relying on eventtimers(4) as backend fordavide2013-03-041-0/+44
| | | | | | | | | | | | | | | | | | | | | | | | | | | precise time event generation. This greatly improves granularity of callouts which are not anymore constrained to wait next tick to be scheduled. - Extend the callout KPI introducing a set of callout_reset_sbt* functions, which take a sbintime_t as timeout argument. The new KPI also offers a way for consumers to specify precision tolerance they allow, so that callout can coalesce events and reduce number of interrupts as well as potentially avoid scheduling a SWI thread. - Introduce support for dispatching callouts directly from hardware interrupt context, specifying an additional flag. This feature should be used carefully, as long as interrupt context has some limitations (e.g. no sleeping locks can be held). - Enhance mechanisms to gather informations about callwheel, introducing a new sysctl to obtain stats. This change breaks the KBI. struct callout fields has been changed, in particular 'int ticks' (4 bytes) has been replaced with 'sbintime_t' (8 bytes) and another 'sbintime_t' field was added for precision. Together with: mav Reviewed by: attilio, bde, luigi, phk Sponsored by: Google Summer of Code 2012, iXsystems inc. Tested by: flo (amd64, sparc64), marius (sparc64), ian (arm), markj (amd64), mav, Fabian Keil
* Polish few spaces/tabs.mav2013-03-021-2/+2
|
* Move the definition of sbintime_t type from <sys/time.h> to <sys/types.h>.davide2013-02-281-1/+0
| | | | | | | With this change we prevent gross namespace pollution. Reported by: bde Suggested by: attilio
* Introduce sbintime_t type -- the simplified version of struct bintime,mav2013-02-281-0/+85
| | | | | | | | using 32.32 fixed point in form of single int64_t. It is much easier to use in cases where additional precision and range of struct bintime is not required. Reviewed by: bde (previous version), davide
* Revert r247300 for now. I'll post a new changeset for review.delphij2013-02-261-1/+4
|
* Expose timespec and timeval macros when __BSD_VISIBLE is defined. Thisdelphij2013-02-261-4/+1
| | | | | | | | | | | allows userland application to use the following macros: timespecclear, timespecisset, timespeccmp, timespecadd, timespecsub; timevalclear, timevalisset, timevalcmp. MFC after: 1 month
* Mark 'ticks', 'time_second', and 'time_uptime' as volatile to prevent thejhb2013-01-281-2/+2
| | | | | | | compiler from caching their values in tight loops. Reviewed by: bde MFC after: 1 week
* While there, remove an unneeded blank line.ed2012-09-011-1/+0
| | | | MFC after: 1 month
* Fix whitespace.ed2012-09-011-25/+25
| | | | MFC after: 1 month
* Implement syscall clock_getcpuclockid2, so we can get a clock iddavidxu2012-08-171-0/+7
| | | | | | | | for process, thread or others we want to support. Use the syscall to implement POSIX API clock_getcpuclock and pthread_getcpuclockid. PR: 168417
* Remove timeval2timespec and its converse, since we already havejonathan2011-08-091-18/+0
| | | | | | | TIMEVAL_TO_TIMESPEC() in <sys/timespec.h>. Spotted by: bde Approved by: re (kib), mentor (rwatson)
* Create timeval2timespec() and timespec2timeval().jonathan2011-08-081-0/+18
| | | | | | | | | These functions will be used by process descriptors to convert process creation time into process descriptor [acm]time. Approved by: re (kib), mentor (rwatson) Suggested by: jhb Sponsored by: Google Inc
* Certain static code analysis tools (FlexeLint being one) are veryphk2010-10-041-2/+2
| | | | | | | | | suspicious about 'l' and '1' being confused in numeric constants. The fear being that some old fart programmer might still think that he is using a Remmington Noiseless as input terminal device. An easy way to placate this fear is to use capital 'L' or to put the 'u' in unsigned constants in front of the 'l'.
* Add few more bintime math macros.mav2010-09-081-0/+19
|
* Revert r210225 - turns out I was wrong; the "/*-" is not license-onlytrasz2010-07-181-1/+1
| | | | | | | thing; it's also used to indicate that the comment should not be automatically rewrapped. Explained by: cperciva@
* The "/*-" comment marker is supposed to denote copyrights. Remove non-copyrighttrasz2010-07-181-1/+1
| | | | occurences from sys/sys/ and sys/kern/.
* Implement flexible BPF timestamping framework.jkim2010-06-151-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | - Allow setting format, resolution and accuracy of BPF time stamps per listener. Previously, we were only able to use microtime(9). Now we can set various resolutions and accuracies with ioctl(2) BIOCSTSTAMP command. Similarly, we can get the current resolution and accuracy with BIOCGTSTAMP command. Document all supported options in bpf(4) and their uses. - Introduce new time stamp 'struct bpf_ts' and header 'struct bpf_xhdr'. The new time stamp has both 64-bit second and fractional parts. bpf_xhdr has this time stamp instead of 'struct timeval' for bh_tstamp. The new structures let us use bh_tstamp of same size on both 32-bit and 64-bit platforms without adding additional shims for 32-bit binaries. On 64-bit platforms, size of BPF header does not change compared to bpf_hdr as its members are already all 64-bit long. On 32-bit platforms, the size may increase by 8 bytes. For backward compatibility, struct bpf_hdr with struct timeval is still the default header unless new time stamp format is explicitly requested. However, the behaviour may change in the future and all relevant code is wrapped around "#ifdef BURN_BRIDGES" for now. - Add experimental support for tagging mbufs with time stamps from a lower layer, e.g., device driver. Currently, mbuf_tags(9) is used to tag mbufs. The time stamps must be uptime in 'struct bintime' format as binuptime(9) and getbinuptime(9) do. Reviewed by: net@
* HZ is now 1000 on most platforms, update a comment.ru2009-10-291-1/+1
| | | | Reviewed by: phk, markm
* Namespace: adjtime(), futimes(), futimesat(), lutimes(), and settimeofday()das2009-03-141-5/+13
| | | | | | | are BSD extensions. Also include <sys/select.h> in user code, since this header is also supposed to define most of the symbols there.
* Remove some DTrace hook definitions that are now in dtrace_bsd.hjb2008-05-181-2/+0
| | | | | | | | | which contains all the hook definitions rather than splattering them all over the header files. The definitions are only valid when the KDTRACE_HOOKS kernel option is defined, so other kernel sources have no need to see them.
* Now that all platforms use genclock, shuffle things around slightlyphk2008-04-221-0/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | for better structure. Much of this is related to <sys/clock.h>, which should really have been called <sys/calendar.h>, but unless and until we need the name, the repocopy can wait. In general the kernel does not know about minutes, hours, days, timezones, daylight savings time, leap-years and such. All that is theoretically a matter for userland only. Parts of kernel code does however care: badly designed filesystems store timestamps in local time and RTC chips almost universally track time in a YY-MM-DD HH:MM:SS format, and sometimes in local timezone instead of UTC. For this we have <sys/clock.h> <sys/time.h> on the other hand, deals with time_t, timeval, timespec and so on. These know only seconds and fractions thereof. Move inittodr() and resettodr() prototypes to <sys/time.h>. Retain the names as it is one of the few surviving PDP/VAX references. Move startrtclock() to <machine/clock.h> on relevant platforms, it is a MD call between machdep.c/clock.c. Remove references to it elsewhere. Remove a lot of unnecessary <sys/clock.h> includes. Move the machdep.disable_rtc_set sysctl to subr_rtc.c where it belongs. XXX: should be kern.disable_rtc_set really, it's not MD.
* Add the libc glue and headers definitions for the *at() syscalls.kib2008-03-311-0/+1
| | | | | | | Based on the submission by rdivacky, sponsored by Google Summer of Code 2007 Reviewed by: rwatson, rdivacky Tested by: pho
* Add POSIX clock id CLOCK_THREAD_CPUTIME_ID, this can be used to measuredavidxu2008-01-181-0/+1
| | | | per-thread runtime in user code.
* Remove _SOLARIS_C_SOURCE compatibility definitions. Unfortunately thejb2007-11-281-23/+0
| | | | | | | | ZFS porting style didn't extend this, instead using a heap of additional header files that don't get installed. My intention had been to allow OpenSolaris external code to build on FreeBSD out of the box (i.e. without a src tree).
* Solaris compatibility only: Be specific about the fact thatjb2006-10-031-1/+1
| | | | the inline function takes no arguments.
* Add some OpenSolaris compatibility definitions which are only visiblejb2006-08-041-0/+25
| | | | | | | | | | | | if _SOLARIS_C_SOURCE is defined. Add two function prototypes which are required to feed high-resolution times to DTrace. DTrace requires it's own functions with the dtrace_ prefix so that it knows not to try and trace them. This is a rule that code executed from the DTrace probe context must obey. The two functions are only be compiled if the KDTRACE option is defined to compile in kernel support for loading the DTrace modules.
* Add several aliases for existing clockid_t names to indicate that therwatson2005-11-271-1/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | application wishes to request high precision time stamps be returned: Alias Existing CLOCK_REALTIME_PRECISE CLOCK_REALTIME CLOCK_MONOTONIC_PRECISE CLOCK_MONOTONIC CLOCK_UPTIME_PRECISE CLOCK_UPTIME Add experimental low-precision clockid_t names corresponding to these clocks, but implemented using cached timestamps in kernel rather than a full time counter query. This offers a minimum update rate of 1/HZ, but in practice will often be more frequent due to the frequency of time stamping in the kernel: New clockid_t name Approximates existing clockid_t CLOCK_REALTIME_FAST CLOCK_REALTIME CLOCK_MONOTONIC_FAST CLOCK_MONOTONIC CLOCK_UPTIME_FAST CLOCK_UPTIME Add one additional new clockid_t, CLOCK_SECOND, which returns the current second without performing a full time counter query or cache lookup overhead to make sure the cached timestamp is stable. This is intended to support very low granularity consumers, such as time(3). The names, visibility, and implementation of the above are subject to change, and will not be MFC'd any time soon. The goal is to expose lower quality time measurement to applications willing to sacrifice accuracy in performance critical paths, such as when taking time stamps for the purpose of rescheduling select() and poll() timeouts. Future changes might include retrofitting the time counter infrastructure to allow the "fast" time query mechanisms to use a different time counter, rather than a cached time counter (i.e., TSC). NOTE: With different underlying time mechanisms exposed, using different time query mechanisms in the same application may result in relative non-monoticity or the appearance of clock stalling for a single clockid_t, as a cached time stamp queried after a precision time stamp lookup may be "before" the time returned by the earlier live time counter query.
* Add CLOCK_UPTIME to clock_gettime(2) reporting the currentandre2005-11-181-0/+1
| | | | | | uptime measured in SI seconds. Sponsored by: TCP/IP Optimization Fundraise 2005
* Define CLOCK_* and TIMER_* in time.h, where they are supposed to be.das2005-04-021-4/+3
|
* move kern_nanosleep to sys/syscallsubr.hps2005-01-191-4/+0
| | | | Requested by: jhb
* - rename nanosleep1 to kern_nanosleepps2005-01-191-0/+4
| | | | | | | - Add a 32bit syscall entry for nanosleep Reviewed by: peter Obtained from: Yahoo!
* /* -> /*- for license, minor formatting changesimp2005-01-071-1/+1
|
* Remove advertising clause from University of California Regent's license,imp2004-04-071-4/+0
| | | | | | per letter dated July 22, 1999. Approved by: core
* Move boottime from <sys/kernel.h> to <sys/time.h> where it belongs.phk2004-02-291-0/+1
|
* constify bintime_add, bintime_sub, bintime2timespec, timespec2bintime,alfred2003-10-261-6/+6
| | | | bintime2timeval and timeval2bintime.
* constify the second args to timevaladd() and timevalsub().alfred2003-10-261-2/+2
|
* Implement CLOCK_MONOTONIC.phk2003-02-231-0/+1
|
* Move struct timeval to its own header so that it can be shared betweenmike2002-12-311-9/+1
| | | | multiple headers.
* add generic rate limiting support from netbsd; ratelimit is purely time based,sam2002-12-201-0/+2
| | | | | | ppsratecheck is for controlling packets/second Obtained from: netbsd
* Introduce a "time_uptime" global variable which holds the time since bootphk2002-11-011-0/+1
| | | | in seconds.
* Fix visibility issues; use <sys/timespec.h>.wollman2002-06-151-19/+3
|
* Fixed breakage of binary compatibility of the kern.clockrate sysctl inbde2002-05-051-0/+1
| | | | | | sys/time.h rev.1.53, etc. Zero out the entire struct clkinfo and not just the new spare part of it so that there is no possibility of leaking kernel stack context to userland.
* Brucifixion ? Yes, out that door, row on the left, one patch each.phk2002-04-301-22/+15
|
* Various cleanup and sorting of clock reading functions. Add the twophk2002-04-261-6/+35
| | | | functions missing in the complete 12 function complement.
* Take the "tickadj" element out of struct clockinfo. Our adjtime(2)phk2002-04-151-1/+0
| | | | | implementation is being changed and the very concept of tickadj will no longer be meaningful.
* Various style issues from a recent brucification:phk2002-03-201-9/+28
| | | | | | | | | use uint_%dt not u_int%dt Avoid LL suffixed intergers where we can by using explicit casts. (The last two I don't know how to avoid.) Add an explanation why truncation rather than rounding is used. Inspired by: bde
* Remove __Palfred2002-03-191-21/+21
|
OpenPOWER on IntegriCloud