1 /* $NetBSD: parsestreams.h,v 1.2 2003/12/04 16:23:36 drochner Exp $ */
4 * /src/NTP/ntp4-dev/kernel/sys/parsestreams.h,v 4.5 2005/06/25 10:52:47 kardel RELEASE_20050625_A
6 * parsestreams.h,v 4.5 2005/06/25 10:52:47 kardel RELEASE_20050625_A
8 * Copyright (c) 1995-2005 by Frank Kardel <kardel <AT> ntp.org>
9 * Copyright (c) 1989-1994 by Frank Kardel, Friedrich-Alexander Universität Erlangen-Nürnberg, Germany
11 * Redistribution and use in source and binary forms, with or without
12 * modification, are permitted provided that the following conditions
14 * 1. Redistributions of source code must retain the above copyright
15 * notice, this list of conditions and the following disclaimer.
16 * 2. Redistributions in binary form must reproduce the above copyright
17 * notice, this list of conditions and the following disclaimer in the
18 * documentation and/or other materials provided with the distribution.
19 * 3. Neither the name of the author nor the names of its contributors
20 * may be used to endorse or promote products derived from this software
21 * without specific prior written permission.
23 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
24 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
25 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
26 * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
27 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
28 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
29 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
30 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
31 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
32 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
36 #if !(defined(lint) || defined(__GNUC__))
37 static char sysparsehrcsid
[] = "parsestreams.h,v 4.5 2005/06/25 10:52:47 kardel RELEASE_20050625_A";
41 #if defined(KERNEL) || defined(_KERNEL)
46 #if defined(PARSESTREAM) && defined(HAVE_SYS_STREAM_H)
49 #ifdef HAVE_SYS_TERMIOS_H
50 #include <sys/termios.h>
53 #include <sys/ppsclock.h>
59 #if defined(PARSESTREAM) && (defined(_sun) || defined(__sun)) && defined(HAVE_SYS_STREAM_H)
61 * Sorry, but in SunOS 4.x AND Solaris 2.x kernels there are no
62 * mem* operations. I don't want them - bcopy, bzero
63 * are fine in the kernel
65 #undef HAVE_STRING_H /* don't include that at kernel level - prototype mismatch in Solaris 2.6 */
66 #include "ntp_string.h"
71 struct parsestream
/* parse module local data */
73 queue_t
*parse_queue
; /* read stream for this channel */
74 queue_t
*parse_dqueue
; /* driver queue entry (PPS support) */
75 unsigned long parse_status
; /* operation flags */
76 void *parse_data
; /* local data space (PPS support) */
77 parse_t parse_io
; /* io structure */
78 struct ppsclockev parse_ppsclockev
; /* copy of last pps event */
81 typedef struct parsestream parsestream_t
;
83 #define PARSE_ENABLE 0x0001
85 /*--------------- debugging support ---------------------------------*/
87 #define DD_OPEN 0x00000001
88 #define DD_CLOSE 0x00000002
89 #define DD_RPUT 0x00000004
90 #define DD_WPUT 0x00000008
91 #define DD_RSVC 0x00000010
92 #define DD_PARSE 0x00000020
93 #define DD_INSTALL 0x00000040
94 #define DD_ISR 0x00000080
95 #define DD_RAWDCF 0x00000100
97 extern int parsedebug
;
101 #define parseprintf(X, Y) if ((X) & parsedebug) printf Y
105 #define parseprintf(X, Y)
114 * Revision 4.5 2005/06/25 10:52:47 kardel
115 * fix version id / add version log
117 * Revision 4.4 1998/06/14 21:09:32 kardel
120 * Revision 4.3 1998/06/13 18:14:32 kardel
121 * make mem*() to b*() mapping magic work on Solaris too
123 * Revision 4.2 1998/06/13 15:16:22 kardel
124 * fix mem*() to b*() function macro emulation
126 * Revision 4.1 1998/06/13 11:50:37 kardel
127 * STREAM macro gone in favor of HAVE_SYS_STREAM_H
129 * Revision 4.0 1998/04/10 19:51:30 kardel
130 * Start 4.0 release version numbering
132 * Revision 1.2 1998/04/10 19:27:42 kardel
133 * initial NTP VERSION 4 integration of PARSE with GPS166 binary support