summaryrefslogtreecommitdiffstats
path: root/sys
diff options
context:
space:
mode:
authorkato <kato@FreeBSD.org>1999-04-01 13:44:15 +0000
committerkato <kato@FreeBSD.org>1999-04-01 13:44:15 +0000
commit5724f1f4047f3bc9f63ace6399920f1d6a357ee0 (patch)
treed76b7f9618212e573ea13f96d5ec0f97c557d711 /sys
parentdcb1ee177c81221cf4fd417a8c69a70c0601e3fc (diff)
downloadFreeBSD-src-5724f1f4047f3bc9f63ace6399920f1d6a357ee0.zip
FreeBSD-src-5724f1f4047f3bc9f63ace6399920f1d6a357ee0.tar.gz
Sync with sys/i386/isa/sio.c revision up to 1.233.
Diffstat (limited to 'sys')
-rw-r--r--sys/pc98/cbus/sio.c24
-rw-r--r--sys/pc98/pc98/sio.c24
2 files changed, 44 insertions, 4 deletions
diff --git a/sys/pc98/cbus/sio.c b/sys/pc98/cbus/sio.c
index 33f0ff2..6a21b5b 100644
--- a/sys/pc98/cbus/sio.c
+++ b/sys/pc98/cbus/sio.c
@@ -31,7 +31,7 @@
* SUCH DAMAGE.
*
* from: @(#)com.c 7.5 (Berkeley) 5/16/91
- * $Id: sio.c,v 1.82 1999/03/04 10:37:30 kato Exp $
+ * $Id: sio.c,v 1.83 1999/03/25 08:26:50 kato Exp $
*/
#include "opt_comconsole.h"
@@ -151,6 +151,7 @@
#ifdef DEVFS
#include <sys/devfsext.h>
#endif
+#include <sys/timepps.h>
#include <machine/clock.h>
#include <machine/ipl.h>
@@ -381,6 +382,7 @@ struct com_s {
bool_t do_dcd_timestamp;
struct timeval timestamp;
struct timeval dcd_timestamp;
+ struct pps_state pps;
u_long bytes_in; /* statistics */
u_long bytes_out;
@@ -1810,6 +1812,8 @@ determined_type: ;
UID_UUCP, GID_DIALER, 0660, "cuala%r", unit);
#endif
com->id_flags = isdp->id_flags; /* Heritate id_flags for later */
+ com->pps.ppscap = PPS_CAPTUREASSERT | PPS_CAPTURECLEAR;
+ pps_init(&com->pps);
return (1);
}
@@ -2118,6 +2122,7 @@ comhardclose(com)
com->poll_output = FALSE;
com->do_timestamp = FALSE;
com->do_dcd_timestamp = FALSE;
+ com->pps.ppsparam.mode = 0;
#ifdef PC98
if (IS_8251(com->pc98_if_type))
com_send_break_off(com);
@@ -2473,6 +2478,8 @@ siointr1(com)
u_char recv_data;
u_char int_ctl;
u_char int_ctl_new;
+ struct timecounter *tc;
+ u_int count;
#ifdef PC98
u_char tmp=0;
@@ -2500,6 +2507,16 @@ more_intr:
if (tmp & STS8251_BD_SD) line_status |= LSR_BI;
} else
#endif /* PC98 */
+ if (com->pps.ppsparam.mode & PPS_CAPTUREBOTH) {
+ modem_status = inb(com->modem_status_port);
+ if ((modem_status ^ com->last_modem_status) & MSR_DCD) {
+ tc = timecounter;
+ count = tc->tc_get_timecount(tc);
+ pps_event(&com->pps, tc, count,
+ (modem_status & MSR_DCD) ?
+ PPS_CAPTUREASSERT : PPS_CAPTURECLEAR);
+ }
+ }
line_status = inb(com->line_status_port);
#ifdef PC98
if (com->pc98_if_type == COM_IF_RSA98III)
@@ -2981,7 +2998,10 @@ sioioctl(dev, cmd, data, flag, p)
break;
default:
splx(s);
- return (ENOTTY);
+ error = pps_ioctl(cmd, data, &com->pps);
+ if (error == ENODEV)
+ error = ENOTTY;
+ return (error);
}
#ifdef PC98
}
diff --git a/sys/pc98/pc98/sio.c b/sys/pc98/pc98/sio.c
index 33f0ff2..6a21b5b 100644
--- a/sys/pc98/pc98/sio.c
+++ b/sys/pc98/pc98/sio.c
@@ -31,7 +31,7 @@
* SUCH DAMAGE.
*
* from: @(#)com.c 7.5 (Berkeley) 5/16/91
- * $Id: sio.c,v 1.82 1999/03/04 10:37:30 kato Exp $
+ * $Id: sio.c,v 1.83 1999/03/25 08:26:50 kato Exp $
*/
#include "opt_comconsole.h"
@@ -151,6 +151,7 @@
#ifdef DEVFS
#include <sys/devfsext.h>
#endif
+#include <sys/timepps.h>
#include <machine/clock.h>
#include <machine/ipl.h>
@@ -381,6 +382,7 @@ struct com_s {
bool_t do_dcd_timestamp;
struct timeval timestamp;
struct timeval dcd_timestamp;
+ struct pps_state pps;
u_long bytes_in; /* statistics */
u_long bytes_out;
@@ -1810,6 +1812,8 @@ determined_type: ;
UID_UUCP, GID_DIALER, 0660, "cuala%r", unit);
#endif
com->id_flags = isdp->id_flags; /* Heritate id_flags for later */
+ com->pps.ppscap = PPS_CAPTUREASSERT | PPS_CAPTURECLEAR;
+ pps_init(&com->pps);
return (1);
}
@@ -2118,6 +2122,7 @@ comhardclose(com)
com->poll_output = FALSE;
com->do_timestamp = FALSE;
com->do_dcd_timestamp = FALSE;
+ com->pps.ppsparam.mode = 0;
#ifdef PC98
if (IS_8251(com->pc98_if_type))
com_send_break_off(com);
@@ -2473,6 +2478,8 @@ siointr1(com)
u_char recv_data;
u_char int_ctl;
u_char int_ctl_new;
+ struct timecounter *tc;
+ u_int count;
#ifdef PC98
u_char tmp=0;
@@ -2500,6 +2507,16 @@ more_intr:
if (tmp & STS8251_BD_SD) line_status |= LSR_BI;
} else
#endif /* PC98 */
+ if (com->pps.ppsparam.mode & PPS_CAPTUREBOTH) {
+ modem_status = inb(com->modem_status_port);
+ if ((modem_status ^ com->last_modem_status) & MSR_DCD) {
+ tc = timecounter;
+ count = tc->tc_get_timecount(tc);
+ pps_event(&com->pps, tc, count,
+ (modem_status & MSR_DCD) ?
+ PPS_CAPTUREASSERT : PPS_CAPTURECLEAR);
+ }
+ }
line_status = inb(com->line_status_port);
#ifdef PC98
if (com->pc98_if_type == COM_IF_RSA98III)
@@ -2981,7 +2998,10 @@ sioioctl(dev, cmd, data, flag, p)
break;
default:
splx(s);
- return (ENOTTY);
+ error = pps_ioctl(cmd, data, &com->pps);
+ if (error == ENODEV)
+ error = ENOTTY;
+ return (error);
}
#ifdef PC98
}
OpenPOWER on IntegriCloud