-/* $OpenBSD: audioio.h,v 1.3 1996/03/03 12:11:22 niklas Exp $ */
-/* $NetBSD: audioio.h,v 1.4 1996/02/17 02:28:56 jtk Exp $ */
+/* $OpenBSD: audioio.h,v 1.4 1996/04/18 21:40:43 niklas Exp $ */
+/* $NetBSD: audioio.h,v 1.5 1996/03/11 05:12:28 scottr Exp $ */
/*
* Copyright (c) 1991-1993 Regents of the University of California.
};
typedef struct audio_info audio_info_t;
+#ifdef _KERNEL
+#define AUDIO_INITINFO(p)\
+ { register int n = sizeof(struct audio_info); \
+ register u_char *q = (u_char *) p; \
+ while (n-- > 0) *q++ = 0xff; }
+
+#else
#define AUDIO_INITINFO(p)\
(void)memset((void *)(p), 0xff, sizeof(struct audio_info))
+#endif
/*
* Parameter for the AUDIO_GETDEV ioctl to determine current
-/* $OpenBSD: buf.h,v 1.3 1996/03/31 13:16:37 mickey Exp $ */
+/* $OpenBSD: buf.h,v 1.4 1996/04/18 21:40:46 niklas Exp $ */
/* $NetBSD: buf.h,v 1.24 1996/02/18 11:55:45 fvdl Exp $ */
/*
-/* $OpenBSD: conf.h,v 1.5 1996/03/31 13:16:40 mickey Exp $ */
+/* $OpenBSD: conf.h,v 1.6 1996/04/18 21:40:47 niklas Exp $ */
/* $NetBSD: conf.h,v 1.31 1996/03/14 18:59:07 christos Exp $ */
/*-
-/* $OpenBSD: cpu.h,v 1.3 1996/03/26 15:38:45 mickey Exp $ */
+/* $OpenBSD: cpu.h,v 1.4 1996/04/18 21:40:49 niklas Exp $ */
/* $NetBSD: cpu.h,v 1.4 1996/02/16 17:25:46 gwr Exp $ */
/*
-/* $OpenBSD: device.h,v 1.2 1996/03/03 12:11:30 niklas Exp $ */
-/* $NetBSD: device.h,v 1.9 1996/02/09 18:25:04 christos Exp $ */
+/* $OpenBSD: device.h,v 1.3 1996/04/18 21:40:51 niklas Exp $ */
+/* $NetBSD: device.h,v 1.11 1996/03/05 22:14:58 thorpej Exp $ */
/*
* Copyright (c) 1992, 1993
int pdev_count;
};
+#ifdef _KERNEL
struct device *alldevs; /* head of list of all devices */
struct evcnt *allevents; /* head of list of all events */
void *config_search __P((cfmatch_t, struct device *, void *));
void *config_rootsearch __P((cfmatch_t, char *, void *));
-int config_found __P((struct device *, void *, cfprint_t));
+int config_found_sm __P((struct device *, void *, cfprint_t, cfmatch_t));
int config_rootfound __P((char *, void *));
void config_scan __P((cfscan_t, struct device *));
void config_attach __P((struct device *, void *, void *, cfprint_t));
void evcnt_attach __P((struct device *, const char *, struct evcnt *));
+/* compatibility definitions */
+#define config_found(d, a, p) config_found_sm((d), (a), (p), NULL)
+#endif /* _KERNEL */
+
#endif /* !_SYS_DEVICE_H_ */
-/* $OpenBSD: dirent.h,v 1.2 1996/03/03 12:11:32 niklas Exp $ */
-/* $NetBSD: dirent.h,v 1.9 1994/12/13 15:58:20 mycroft Exp $ */
+/* $OpenBSD: dirent.h,v 1.3 1996/04/18 21:40:52 niklas Exp $ */
+/* $NetBSD: dirent.h,v 1.11 1996/03/08 18:13:05 scottr Exp $ */
/*-
* Copyright (c) 1989, 1993
*/
#define IFTODT(mode) (((mode) & 0170000) >> 12)
#define DTTOIF(dirtype) ((dirtype) << 12)
+
+#if defined(_KERNEL)
+/*
+ * The DIRENT_SIZE macro gives the minimum record length which will hold
+ * the directory entry. This requires the amount of space in struct dirent
+ * without the d_name field, plus enough space for the name with a terminating
+ * null byte (dp->d_namlen+1), rounded up to a 4 byte boundary.
+ */
+#define DIRENT_SIZE(dp) \
+ ((sizeof (struct dirent) - (MAXNAMLEN+1)) + (((dp)->d_namlen+1 + 3) &~ 3))
+
+#endif /* !_KERNEL */
-/* $OpenBSD: exec_ecoff.h,v 1.2 1996/03/03 12:11:42 niklas Exp $ */
-/* $NetBSD: exec_ecoff.h,v 1.7 1995/06/16 02:07:56 mellon Exp $ */
+/* $OpenBSD: exec_ecoff.h,v 1.3 1996/04/18 21:40:54 niklas Exp $ */
+/* $NetBSD: exec_ecoff.h,v 1.8 1996/03/07 14:29:44 christos Exp $ */
/*
* Copyright (c) 1994 Adam Glass
#ifdef _KERNEL
int exec_ecoff_makecmds __P((struct proc *, struct exec_package *));
+int cpu_exec_ecoff_hook __P((struct proc *, struct exec_package *,
+ struct ecoff_aouthdr *));
#endif /* _KERNEL */
#endif /* !_SYS_EXEC_ECOFF_H_ */
-/* $OpenBSD: filedesc.h,v 1.3 1996/03/03 12:11:46 niklas Exp $ */
-/* $NetBSD: filedesc.h,v 1.12 1996/02/09 18:25:11 christos Exp $ */
+/* $OpenBSD: filedesc.h,v 1.4 1996/04/18 21:40:55 niklas Exp $ */
+/* $NetBSD: filedesc.h,v 1.13 1996/03/14 18:59:09 christos Exp $ */
/*
* Copyright (c) 1990, 1993
*/
int dupfdopen __P((struct filedesc *fdp, int indx, int dfd, int mode,
int error));
-int fdopen __P((dev_t, int, int, struct proc *));
int fdalloc __P((struct proc *p, int want, int *result));
int fdavail __P((struct proc *p, int n));
int falloc __P((struct proc *p, struct file **resultfp, int *resultfd));
--- /dev/null
+/* $OpenBSD: kcore.h,v 1.1 1996/04/18 21:40:57 niklas Exp $ */
+/* $NetBSD: kcore.h,v 1.1 1996/03/10 21:56:00 leo Exp $ */
+
+/*
+ * Copyright (c) 1996 Leo Weppelman.
+ * 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.
+ * 3. All advertising materials mentioning features or use of this software
+ * must display the following acknowledgement:
+ * This product includes software developed by Leo Weppelman.
+ * 4. The name of the author may not be used to endorse or promote products
+ * derived from this software without specific prior written permission
+ *
+ * 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.
+ */
+#ifndef _SYS_KCORE_H_
+#define _SYS_KCORE_H_
+
+/*
+ * Definitions for the kernel crash-dump format. The structure of
+ * the files and headers is borrowed from the 'regular' core files
+ * as described in <sys/core.h>.
+ */
+#define KCORE_MAGIC 0x8fca
+#define KCORESEG_MAGIC 0x8fac
+
+/*
+ * Description of a memory segment. To make this suitable for sharing
+ * between all architectures, u_quad_t seems to be the necessary type...
+ */
+typedef struct {
+ u_quad_t start; /* Physical start address */
+ u_quad_t size; /* Size in bytes */
+} phys_ram_seg_t;
+
+typedef struct kcore_hdr {
+ u_int32_t c_midmag; /* Magic, id, flags */
+ u_int16_t c_hdrsize; /* Aligned header size */
+ u_int16_t c_seghdrsize; /* Aligned seg-header size */
+ u_int32_t c_nseg; /* Number of segments */
+} kcore_hdr_t;
+
+typedef struct kcore_seg {
+ u_int32_t c_midmag; /* Magic, id, flags */
+ u_int32_t c_size; /* Sizeof this segment */
+} kcore_seg_t;
+
+#endif /* _SYS_KCORE_H_ */
-/* $OpenBSD: malloc.h,v 1.4 1996/03/31 13:16:43 mickey Exp $ */
+/* $OpenBSD: malloc.h,v 1.5 1996/04/18 21:40:59 niklas Exp $ */
/* $NetBSD: malloc.h,v 1.22 1996/02/22 12:47:33 jtk Exp $ */
/*
-/* $OpenBSD: mount.h,v 1.6 1996/03/31 13:16:47 mickey Exp $ */
+/* $OpenBSD: mount.h,v 1.7 1996/04/18 21:41:00 niklas Exp $ */
/* $NetBSD: mount.h,v 1.48 1996/02/18 11:55:47 fvdl Exp $ */
/*
struct export_args export; /* network export information */
uid_t uid; /* uid that owns msdosfs files */
gid_t gid; /* gid that owns msdosfs files */
- mode_t mask; /* mask to be applied for msdosfs perms */
+ mode_t mask; /* mask to be applied for msdosfs perms */
int flags; /* see below */
};
+
/*
* Msdosfs mount options:
*/
-/* $OpenBSD: param.h,v 1.6 1996/03/19 21:10:48 mickey Exp $ */
-/* $NetBSD: param.h,v 1.18.2.1 1995/10/12 05:42:01 jtc Exp $ */
+/* $OpenBSD: param.h,v 1.7 1996/04/18 21:41:03 niklas Exp $ */
+/* $NetBSD: param.h,v 1.21 1996/03/16 05:35:45 thorpej Exp $ */
/*-
* Copyright (c) 1982, 1986, 1989, 1993
#define BSD4_3 1
#define BSD4_4 1
-#define NetBSD 199511 /* NetBSD version (year & month). */
-#define NetBSD1_1 1 /* NetBSD 1.1 */
+#define NetBSD 199603 /* NetBSD version (year & month). */
+#define NetBSD1_1 2 /* NetBSD 1.1A */
#ifndef NULL
#define NULL 0
-/* $OpenBSD: proc.h,v 1.5 1996/03/24 18:07:57 tholo Exp $ */
-/* $NetBSD: proc.h,v 1.42 1996/02/09 18:25:23 christos Exp $ */
+/* $OpenBSD: proc.h,v 1.6 1996/04/18 21:41:05 niklas Exp $ */
+/* $NetBSD: proc.h,v 1.43 1996/03/14 18:59:11 christos Exp $ */
/*-
* Copyright (c) 1986, 1989, 1991, 1993
#define p_startzero p_oppid
pid_t p_oppid; /* Save parent pid during ptrace. XXX */
- int p_dupfd; /* Sideways return value from fdopen. XXX */
+ int p_dupfd; /* Sideways return value from filedescopen. XXX */
/* scheduling */
u_int p_estcpu; /* Time averaged value of p_cpticks. */
-/* $OpenBSD: reboot.h,v 1.2 1996/03/03 12:12:11 niklas Exp $ */
-/* $NetBSD: reboot.h,v 1.7 1994/12/13 15:01:22 mycroft Exp $ */
+/* $OpenBSD: reboot.h,v 1.3 1996/04/18 21:41:07 niklas Exp $ */
+/* $NetBSD: reboot.h,v 1.8 1996/02/22 20:30:16 scottr Exp $ */
/*
* Copyright (c) 1982, 1986, 1988, 1993, 1994
*/
/*
- * Arguments to reboot system call. These are passed to boot program
- * in r11, and on to init.
+ * Arguments to reboot system call. These are passed to the boot program,
+ * and then on to init.
*/
#define RB_AUTOBOOT 0 /* flags for system auto-booting itself */
-/* $OpenBSD: scanio.h,v 1.2 1996/03/03 12:12:13 niklas Exp $ */
+/* $OpenBSD: scanio.h,v 1.3 1996/04/18 21:41:08 niklas Exp $ */
/* $NetBSD: scanio.h,v 1.1 1996/02/18 20:33:18 mycroft Exp $ */
/*
* System call numbers.
*
* DO NOT EDIT-- this file is automatically generated.
- * created from NetBSD: syscalls.master,v 1.30 1995/11/22 23:07:29 cgd Exp
+ * created from NetBSD: syscalls.master,v 1.31 1996/02/27 04:20:41 jonathan Exp
*/
#define SYS_syscall 0
/* 169 is compat_10 osemsys */
/* 170 is compat_10 omsgsys */
/* 171 is compat_10 oshmsys */
+#define SYS_ntp_gettime 175
#define SYS_ntp_adjtime 176
-#define SYS_ntp_gettime 177
#define SYS_setgid 181
#define SYS_setegid 182
#define SYS_seteuid 183
* System call argument lists.
*
* DO NOT EDIT-- this file is automatically generated.
- * created from NetBSD: syscalls.master,v 1.30 1995/11/22 23:07:29 cgd Exp
+ * created from NetBSD: syscalls.master,v 1.31 1996/02/27 04:20:41 jonathan Exp
*/
#define syscallarg(x) union { x datum; register_t pad; }
syscallarg(int) a4;
};
-struct sys_ntp_adjtime_args {
+struct ntp_gettime_args {
syscallarg(struct timex *) tp;
};
-struct sys_ntp_gettime_args {
- syscallarg(struct ntptimeval *) tp;
+struct ntp_adjtime_args {
+ syscallarg(struct timex *) tp;
};
struct sys_setgid_args {
int compat_10_sys_shmsys __P((struct proc *, void *, register_t *));
#else
#endif
-int sys_ntp_adjtime __P((struct proc *, void *, register_t *));
-int sys_ntp_gettime __P((struct proc *, void *, register_t *));
+int ntp_gettime __P((struct proc *, void *, register_t *));
+int ntp_adjtime __P((struct proc *, void *, register_t *));
int sys_setgid __P((struct proc *, void *, register_t *));
int sys_setegid __P((struct proc *, void *, register_t *));
int sys_seteuid __P((struct proc *, void *, register_t *));
-/* $OpenBSD: sysctl.h,v 1.3 1996/03/30 04:51:33 mickey Exp $ */
-/* $NetBSD: sysctl.h,v 1.11 1996/02/09 18:25:39 christos Exp $ */
+/* $OpenBSD: sysctl.h,v 1.4 1996/04/18 21:41:13 niklas Exp $ */
+/* $NetBSD: sysctl.h,v 1.14 1996/03/12 00:22:43 jonathan Exp $ */
/*
* Copyright (c) 1989, 1993
#define KERN_DOMAINNAME 22 /* string: (YP) domainname */
#define KERN_MAXPARTITIONS 23 /* int: number of partitions/disk */
#define KERN_RAWPARTITION 24 /* int: raw partition number */
-#define KERN_MAXID 25 /* number of valid kern ids */
+#define KERN_NTPTIME 25 /* struct: extended-precision time */
+#define KERN_TIMEX 26 /* struct: ntp timekeeping state */
+#define KERN_MAXID 27 /* number of valid kern ids */
#define CTL_KERN_NAMES { \
{ 0, 0 }, \
{ "domainname", CTLTYPE_STRING }, \
{ "maxpartitions", CTLTYPE_INT }, \
{ "rawpartition", CTLTYPE_INT }, \
+ { "ntptime", CTLTYPE_STRUCT }, \
+ { "timex", CTLTYPE_STRUCT }, \
}
/*
int sysctl_rdstring __P((void *, size_t *, void *, char *));
int sysctl_rdstruct __P((void *, size_t *, void *, void *, int));
int sysctl_vnode __P((char *, size_t *));
+int sysctl_ntptime __P((char *, size_t *));
void fill_eproc __P((struct proc *, struct eproc *));
-/* $OpenBSD: systm.h,v 1.2 1996/02/29 13:57:30 niklas Exp $ */
-/* $NetBSD: systm.h,v 1.40 1996/02/10 00:13:28 christos Exp $ */
+/* $OpenBSD: systm.h,v 1.3 1996/04/18 21:41:14 niklas Exp $ */
+/* $NetBSD: systm.h,v 1.43 1996/03/14 18:59:12 christos Exp $ */
/*-
* Copyright (c) 1982, 1988, 1991, 1993
int uiomove __P((caddr_t, int, struct uio *));
+int setjmp __P((label_t *));
+void longjmp __P((label_t *));
+
#include <lib/libkern/libkern.h>
#ifdef DDB
/* debugger entry points */
-#ifdef notyet /* XXX: Lots of local decls assume int Debugger */
void Debugger __P((void)); /* in DDB only */
-#endif
int read_symtab_from_file __P((struct proc *,struct vnode *,const char *));
#endif
-/* $OpenBSD: timex.h,v 1.2 1996/03/03 12:12:29 niklas Exp $ */
+/* $OpenBSD: timex.h,v 1.3 1996/04/18 21:41:16 niklas Exp $ */
+/* $NetBSD: timex.h,v 1.2 1996/02/27 04:20:34 jonathan Exp $ */
+
+/******************************************************************************
+ * *
+ * Copyright (c) David L. Mills 1993, 1994 *
+ * *
+ * Permission to use, copy, modify, and distribute this software and its *
+ * documentation for any purpose and without fee is hereby granted, provided *
+ * that the above copyright notice appears in all copies and that both the *
+ * copyright notice and this permission notice appear in supporting *
+ * documentation, and that the name University of Delaware not be used in *
+ * advertising or publicity pertaining to distribution of the software *
+ * without specific, written prior permission. The University of Delaware *
+ * makes no representations about the suitability this software for any *
+ * purpose. It is provided "as is" without express or implied warranty. *
+ * *
+ ******************************************************************************/
+
+/*
+ * Modification history timex.h
+ *
+ * 26 Sep 94 David L. Mills
+ * Added defines for hybrid phase/frequency-lock loop.
+ *
+ * 19 Mar 94 David L. Mills
+ * Moved defines from kernel routines to header file and added new
+ * defines for PPS phase-lock loop.
+ *
+ * 20 Feb 94 David L. Mills
+ * Revised status codes and structures for external clock and PPS
+ * signal discipline.
+ *
+ * 28 Nov 93 David L. Mills
+ * Adjusted parameters to improve stability and increase poll
+ * interval.
+ *
+ * 17 Sep 93 David L. Mills
+ * Created file
+ */
+/*
+ * This header file defines the Network Time Protocol (NTP) interfaces
+ * for user and daemon application programs. These are implemented using
+ * private syscalls and data structures and require specific kernel
+ * support.
+ *
+ * NAME
+ * ntp_gettime - NTP user application interface
+ *
+ * SYNOPSIS
+ * #include <sys/timex.h>
+ *
+ * int syscall(SYS_ntp_gettime, tptr)
+ *
+ * int SYS_ntp_gettime defined in syscall.h header file
+ * struct ntptimeval *tptr pointer to ntptimeval structure
+ *
+ * NAME
+ * ntp_adjtime - NTP daemon application interface
+ *
+ * SYNOPSIS
+ * #include <sys/timex.h>
+ *
+ * int syscall(SYS_ntp_adjtime, mode, tptr)
+ *
+ * int SYS_ntp_adjtime defined in syscall.h header file
+ * struct timex *tptr pointer to timex structure
+ *
+ */
+#ifndef _SYS_TIMEX_H_
+#define _SYS_TIMEX_H_ 1
+
+#ifndef MSDOS /* Microsoft specific */
+#include <sys/syscall.h>
+#endif /* MSDOS */
+
+/*
+ * The following defines establish the engineering parameters of the
+ * phase-lock loop (PLL) model used in the kernel implementation. These
+ * parameters have been carefully chosen by analysis for good stability
+ * and wide dynamic range.
+ *
+ * The hz variable is defined in the kernel build environment. It
+ * establishes the timer interrupt frequency, 100 Hz for the SunOS
+ * kernel, 256 Hz for the Ultrix kernel and 1024 Hz for the OSF/1
+ * kernel. SHIFT_HZ expresses the same value as the nearest power of two
+ * in order to avoid hardware multiply operations.
+ *
+ * SHIFT_KG and SHIFT_KF establish the damping of the PLL and are chosen
+ * for a slightly underdamped convergence characteristic. SHIFT_KH
+ * establishes the damping of the FLL and is chosen by wisdom and black
+ * art.
+ *
+ * MAXTC establishes the maximum time constant of the PLL. With the
+ * SHIFT_KG and SHIFT_KF values given and a time constant range from
+ * zero to MAXTC, the PLL will converge in 15 minutes to 16 hours,
+ * respectively.
+ */
+
+
+#define SHIFT_KG 6 /* phase factor (shift) */
+#define SHIFT_KF 16 /* PLL frequency factor (shift) */
+#define SHIFT_KH 2 /* FLL frequency factor (shift) */
+#define MAXTC 6 /* maximum time constant (shift) */
+
+/*
+ * The following defines establish the scaling of the various variables
+ * used by the PLL. They are chosen to allow the greatest precision
+ * possible without overflow of a 32-bit word.
+ *
+ * SHIFT_SCALE defines the scaling (shift) of the time_phase variable,
+ * which serves as a an extension to the low-order bits of the system
+ * clock variable time.tv_usec.
+ *
+ * SHIFT_UPDATE defines the scaling (shift) of the time_offset variable,
+ * which represents the current time offset with respect to standard
+ * time.
+ *
+ * SHIFT_USEC defines the scaling (shift) of the time_freq and
+ * time_tolerance variables, which represent the current frequency
+ * offset and maximum frequency tolerance.
+ *
+ * FINEUSEC is 1 us in SHIFT_UPDATE units of the time_phase variable.
+ */
+#define SHIFT_SCALE 22 /* phase scale (shift) */
+#define SHIFT_UPDATE (SHIFT_KG + MAXTC) /* time offset scale (shift) */
+#define SHIFT_USEC 16 /* frequency offset scale (shift) */
+#define FINEUSEC (1L << SHIFT_SCALE) /* 1 us in phase units */
+
+/*
+ * The following defines establish the performance envelope of the PLL.
+ * They insure it operates within predefined limits, in order to satisfy
+ * correctness assertions. An excursion which exceeds these bounds is
+ * clamped to the bound and operation proceeds accordingly. In practice,
+ * this can occur only if something has failed or is operating out of
+ * tolerance, but otherwise the PLL continues to operate in a stable
+ * mode.
+ *
+ * MAXPHASE must be set greater than or equal to CLOCK.MAX (128 ms), as
+ * defined in the NTP specification. CLOCK.MAX establishes the maximum
+ * time offset allowed before the system time is reset, rather than
+ * incrementally adjusted. Here, the maximum offset is clamped to
+ * MAXPHASE only in order to prevent overflow errors due to defective
+ * protocol implementations.
+ *
+ * MAXFREQ is the maximum frequency tolerance of the CPU clock
+ * oscillator plus the maximum slew rate allowed by the protocol. It
+ * should be set to at least the frequency tolerance of the oscillator
+ * plus 100 ppm for vernier frequency adjustments. If the kernel
+ * PPS discipline code is configured (PPS_SYNC), the oscillator time and
+ * frequency are disciplined to an external source, presumably with
+ * negligible time and frequency error relative to UTC, and MAXFREQ can
+ * be reduced.
+ *
+ * MAXTIME is the maximum jitter tolerance of the PPS signal if the
+ * kernel PPS discipline code is configured (PPS_SYNC).
+ *
+ * MINSEC and MAXSEC define the lower and upper bounds on the interval
+ * between protocol updates.
+ */
+#define MAXPHASE 512000L /* max phase error (us) */
+#ifdef PPS_SYNC
+#define MAXFREQ (512L << SHIFT_USEC) /* max freq error (100 ppm) */
+#define MAXTIME (200L << PPS_AVG) /* max PPS error (jitter) (200 us) */
+#else
+#define MAXFREQ (512L << SHIFT_USEC) /* max freq error (200 ppm) */
+#endif /* PPS_SYNC */
+#define MINSEC 16L /* min interval between updates (s) */
+#define MAXSEC 1200L /* max interval between updates (s) */
+
+#ifdef PPS_SYNC
+/*
+ * The following defines are used only if a pulse-per-second (PPS)
+ * signal is available and connected via a modem control lead, such as
+ * produced by the optional ppsclock feature incorporated in the Sun
+ * asynch driver. They establish the design parameters of the frequency-
+ * lock loop used to discipline the CPU clock oscillator to the PPS
+ * signal.
+ *
+ * PPS_AVG is the averaging factor for the frequency loop, as well as
+ * the time and frequency dispersion.
+ *
+ * PPS_SHIFT and PPS_SHIFTMAX specify the minimum and maximum
+ * calibration intervals, respectively, in seconds as a power of two.
+ *
+ * PPS_VALID is the maximum interval before the PPS signal is considered
+ * invalid and protocol updates used directly instead.
+ *
+ * MAXGLITCH is the maximum interval before a time offset of more than
+ * MAXTIME is believed.
+ */
+#define PPS_AVG 2 /* pps averaging constant (shift) */
+#define PPS_SHIFT 2 /* min interval duration (s) (shift) */
+#define PPS_SHIFTMAX 8 /* max interval duration (s) (shift) */
+#define PPS_VALID 120 /* pps signal watchdog max (s) */
+#define MAXGLITCH 30 /* pps signal glitch max (s) */
+#endif /* PPS_SYNC */
+
+/*
+ * The following defines and structures define the user interface for
+ * the ntp_gettime() and ntp_adjtime() system calls.
+ *
+ * Control mode codes (timex.modes)
+ */
+#define MOD_OFFSET 0x0001 /* set time offset */
+#define MOD_FREQUENCY 0x0002 /* set frequency offset */
+#define MOD_MAXERROR 0x0004 /* set maximum time error */
+#define MOD_ESTERROR 0x0008 /* set estimated time error */
+#define MOD_STATUS 0x0010 /* set clock status bits */
+#define MOD_TIMECONST 0x0020 /* set pll time constant */
+#define MOD_CLKB 0x4000 /* set clock B */
+#define MOD_CLKA 0x8000 /* set clock A */
+
+/*
+ * Status codes (timex.status)
+ */
+#define STA_PLL 0x0001 /* enable PLL updates (rw) */
+#define STA_PPSFREQ 0x0002 /* enable PPS freq discipline (rw) */
+#define STA_PPSTIME 0x0004 /* enable PPS time discipline (rw) */
+#define STA_FLL 0x0008 /* select frequency-lock mode (rw) */
+
+#define STA_INS 0x0010 /* insert leap (rw) */
+#define STA_DEL 0x0020 /* delete leap (rw) */
+#define STA_UNSYNC 0x0040 /* clock unsynchronized (rw) */
+#define STA_FREQHOLD 0x0080 /* hold frequency (rw) */
+
+#define STA_PPSSIGNAL 0x0100 /* PPS signal present (ro) */
+#define STA_PPSJITTER 0x0200 /* PPS signal jitter exceeded (ro) */
+#define STA_PPSWANDER 0x0400 /* PPS signal wander exceeded (ro) */
+#define STA_PPSERROR 0x0800 /* PPS signal calibration error (ro) */
+
+#define STA_CLOCKERR 0x1000 /* clock hardware fault (ro) */
+
+#define STA_RONLY (STA_PPSSIGNAL | STA_PPSJITTER | STA_PPSWANDER | \
+ STA_PPSERROR | STA_CLOCKERR) /* read-only bits */
+
+/*
+ * Clock states (time_state)
+ */
+#define TIME_OK 0 /* no leap second warning */
+#define TIME_INS 1 /* insert leap second warning */
+#define TIME_DEL 2 /* delete leap second warning */
+#define TIME_OOP 3 /* leap second in progress */
+#define TIME_WAIT 4 /* leap second has occured */
+#define TIME_ERROR 5 /* clock not synchronized */
+
+/*
+ * NTP user interface (ntp_gettime()) - used to read kernel clock values
+ *
+ * Note: maximum error = NTP synch distance = dispersion + delay / 2;
+ * estimated error = NTP dispersion.
+ */
+struct ntptimeval {
+ struct timeval time; /* current time (ro) */
+ long maxerror; /* maximum error (us) (ro) */
+ long esterror; /* estimated error (us) (ro) */
+};
+
+/*
+ * NTP daemon interface - (ntp_adjtime()) used to discipline CPU clock
+ * oscillator
+ */
+struct timex {
+ unsigned int modes; /* clock mode bits (wo) */
+ long offset; /* time offset (us) (rw) */
+ long freq; /* frequency offset (scaled ppm) (rw) */
+ long maxerror; /* maximum error (us) (rw) */
+ long esterror; /* estimated error (us) (rw) */
+ int status; /* clock status bits (rw) */
+ long constant; /* pll time constant (rw) */
+ long precision; /* clock precision (us) (ro) */
+ long tolerance; /* clock frequency tolerance (scaled
+ * ppm) (ro) */
+ /*
+ * The following read-only structure members are implemented
+ * only if the PPS signal discipline is configured in the
+ * kernel.
+ */
+ long ppsfreq; /* pps frequency (scaled ppm) (ro) */
+ long jitter; /* pps jitter (us) (ro) */
+ int shift; /* interval duration (s) (shift) (ro) */
+ long stabil; /* pps stability (scaled ppm) (ro) */
+ long jitcnt; /* jitter limit exceeded (ro) */
+ long calcnt; /* calibration intervals (ro) */
+ long errcnt; /* calibration errors (ro) */
+ long stbcnt; /* stability limit exceeded (ro) */
+
+};
+
+#if defined(__FreeBSD__) || defined(__NetBSD__)
+
+#ifndef _KERNEL
+#include <sys/cdefs.h>
+
+__BEGIN_DECLS
+extern int ntp_gettime __P((struct ntptimeval *));
+extern int ntp_adjtime __P((struct timex *));
+__END_DECLS
+
+#endif /* not _KERNEL */
+
+#endif /* __FreeBSD__ || __NetBSD__ */
+#endif /* _SYS_TIMEX_H_ */
+/* $OpenBSD: timex.h,v 1.3 1996/04/18 21:41:16 niklas Exp $ */
/******************************************************************************
* *
-/* $OpenBSD: types.h,v 1.6 1996/03/24 18:07:58 tholo Exp $ */
-/* $NetBSD: types.h,v 1.24 1995/12/29 01:15:13 jtc Exp $ */
+/* $OpenBSD: types.h,v 1.7 1996/04/18 21:41:17 niklas Exp $ */
+/* $NetBSD: types.h,v 1.25 1996/03/15 19:54:53 jtc Exp $ */
/*-
* Copyright (c) 1982, 1986, 1991, 1993
#include <machine/ansi.h>
#include <machine/endian.h>
-#ifndef _POSIX_SOURCE
+#if !defined(_POSIX_SOURCE) && !defined(_XOPEN_SOURCE)
typedef unsigned char u_char;
typedef unsigned short u_short;
typedef unsigned int u_int;
typedef unsigned long u_long;
+
+typedef unsigned char unchar; /* Sys V compatibility */
typedef unsigned short ushort; /* Sys V compatibility */
typedef unsigned int uint; /* Sys V compatibility */
+typedef unsigned long ulong; /* Sys V compatibility */
#endif
typedef u_int64_t u_quad_t; /* quads */
* long arguments will be promoted to off_t if the program fails to
* include that header or explicitly cast them to off_t.
*/
-#ifndef _POSIX_SOURCE
+#if !defined(_POSIX_SOURCE) && !defined(_XOPEN_SOURCE)
#ifndef _KERNEL
#include <sys/cdefs.h>
__BEGIN_DECLS
int truncate __P((const char *, off_t));
__END_DECLS
#endif /* !_KERNEL */
-#endif /* !_POSIX_SOURCE */
+#endif /* !defined(_POSIX_SOURCE) ... */
-#ifndef _POSIX_SOURCE
+#if !defined(_POSIX_SOURCE) && !defined(_XOPEN_SOURCE)
/* Major, minor numbers, dev_t's. */
#define major(x) ((int32_t)(((u_int32_t)(x) >> 8) & 0xff))
#define minor(x) ((int32_t)((x) & 0xff))
#undef _BSD_TIME_T_
#endif
-#ifndef _POSIX_SOURCE
+#if !defined(_POSIX_SOURCE) && !defined(_XOPEN_SOURCE)
#define NBBY 8 /* number of bits in a byte */
/*
struct uio;
#endif
-#endif /* !_POSIX_SOURCE */
+#endif /* !defined(_POSIX_SOURCE) ... */
#endif /* !_SYS_TYPES_H_ */
-/* $OpenBSD: vnode.h,v 1.3 1996/03/29 19:06:46 mickey Exp $ */
+/* $OpenBSD: vnode.h,v 1.4 1996/04/18 21:41:19 niklas Exp $ */
/* $NetBSD: vnode.h,v 1.38 1996/02/29 20:59:05 cgd Exp $ */
/*