PERFORCE change 150279 for review
Ed Schouten
ed at FreeBSD.org
Mon Sep 22 16:51:24 UTC 2008
http://perforce.freebsd.org/chv.cgi?CH=150279
Change 150279 by ed at ed_dull on 2008/09/22 16:50:42
Document function parameter names in TTY header files.
Requested by: attilio
Affected files ...
.. //depot/projects/mpsafetty/sys/sys/tty.h#17 edit
.. //depot/projects/mpsafetty/sys/sys/ttydevsw.h#10 edit
.. //depot/projects/mpsafetty/sys/sys/ttydisc.h#9 edit
.. //depot/projects/mpsafetty/sys/sys/ttyhook.h#7 edit
.. //depot/projects/mpsafetty/sys/sys/ttyqueue.h#10 edit
Differences ...
==== //depot/projects/mpsafetty/sys/sys/tty.h#17 (text+ko) ====
@@ -147,51 +147,52 @@
#ifdef _KERNEL
/* Allocation and deallocation. */
-struct tty *tty_alloc(struct ttydevsw *, void *, struct mtx *);
-void tty_rel_pgrp(struct tty *, struct pgrp *);
-void tty_rel_sess(struct tty *, struct session *);
-void tty_rel_gone(struct tty *);
+struct tty *tty_alloc(struct ttydevsw *tsw, void *softc, struct mtx *mtx);
+void tty_rel_pgrp(struct tty *tp, struct pgrp *pgrp);
+void tty_rel_sess(struct tty *tp, struct session *sess);
+void tty_rel_gone(struct tty *tp);
#define tty_lock(tp) mtx_lock((tp)->t_mtx)
#define tty_unlock(tp) mtx_unlock((tp)->t_mtx)
#define tty_lock_assert(tp,ma) mtx_assert((tp)->t_mtx, (ma))
/* Device node creation. */
-void tty_makedev(struct tty *, struct ucred *, const char *, ...)
+void tty_makedev(struct tty *tp, struct ucred *cred, const char *fmt, ...)
__printflike(3, 4);
#define tty_makealias(tp,fmt,...) \
make_dev_alias((tp)->t_dev, fmt, ## __VA_ARGS__)
/* Signalling processes. */
-void tty_signal_sessleader(struct tty *, int);
-void tty_signal_pgrp(struct tty *, int);
+void tty_signal_sessleader(struct tty *tp, int signal);
+void tty_signal_pgrp(struct tty *tp, int signal);
/* Waking up readers/writers. */
-int tty_wait(struct tty *, struct cv *);
-int tty_timedwait(struct tty *, struct cv *, int);
-void tty_wakeup(struct tty *, int);
+int tty_wait(struct tty *tp, struct cv *cv);
+int tty_timedwait(struct tty *tp, struct cv *cv, int timo);
+void tty_wakeup(struct tty *tp, int flags);
/* System messages. */
-int tty_checkoutq(struct tty *);
-int tty_putchar(struct tty *, char);
+int tty_checkoutq(struct tty *tp);
+int tty_putchar(struct tty *tp, char c);
-int tty_ioctl(struct tty *, u_long, void *, struct thread *);
-int tty_ioctl_compat(struct tty *, u_long, caddr_t, struct thread *);
-void tty_init_console(struct tty *, speed_t);
-void tty_flush(struct tty *, int);
-void tty_hiwat_in_block(struct tty *);
-void tty_hiwat_in_unblock(struct tty *);
-dev_t tty_udev(struct tty *);
+int tty_ioctl(struct tty *tp, u_long cmd, void *data, struct thread *td);
+int tty_ioctl_compat(struct tty *tp, u_long cmd, caddr_t data,
+ struct thread *td);
+void tty_init_console(struct tty *tp, speed_t speed);
+void tty_flush(struct tty *tp, int flags);
+void tty_hiwat_in_block(struct tty *tp);
+void tty_hiwat_in_unblock(struct tty *tp);
+dev_t tty_udev(struct tty *tp);
#define tty_opened(tp) ((tp)->t_flags & TF_OPENED)
#define tty_gone(tp) ((tp)->t_flags & TF_GONE)
#define tty_softc(tp) ((tp)->t_devswsoftc)
#define tty_devname(tp) devtoname((tp)->t_dev)
/* Status line printing. */
-void tty_info(struct tty *);
+void tty_info(struct tty *tp);
/* Pseudo-terminal hooks. */
-int pts_alloc_external(int, struct thread *, struct file *,
- struct cdev *, const char *);
+int pts_alloc_external(int fd, struct thread *td, struct file *fp,
+ struct cdev *dev, const char *name);
/* Drivers and line disciplines also need to call these. */
#include <sys/ttydisc.h>
==== //depot/projects/mpsafetty/sys/sys/ttydevsw.h#10 (text+ko) ====
@@ -40,16 +40,18 @@
* Driver routines that are called from the line discipline to adjust
* hardware parameters and such.
*/
-typedef int tsw_open_t(struct tty *);
-typedef void tsw_close_t(struct tty *);
-typedef void tsw_outwakeup_t(struct tty *);
-typedef void tsw_inwakeup_t(struct tty *);
-typedef int tsw_ioctl_t(struct tty *, u_long, caddr_t, struct thread *);
-typedef int tsw_param_t(struct tty *, struct termios *);
-typedef int tsw_modem_t(struct tty *, int, int);
-typedef int tsw_mmap_t(struct tty *, vm_offset_t, vm_paddr_t *, int);
-typedef void tsw_pktnotify_t(struct tty *, char);
-typedef void tsw_free_t(void *);
+typedef int tsw_open_t(struct tty *tp);
+typedef void tsw_close_t(struct tty *tp);
+typedef void tsw_outwakeup_t(struct tty *tp);
+typedef void tsw_inwakeup_t(struct tty *tp);
+typedef int tsw_ioctl_t(struct tty *tp, u_long cmd, caddr_t data,
+ struct thread *td);
+typedef int tsw_param_t(struct tty *tp, struct termios *t);
+typedef int tsw_modem_t(struct tty *tp, int sigon, int sigoff);
+typedef int tsw_mmap_t(struct tty *tp, vm_offset_t offset,
+ vm_paddr_t * paddr, int nprot);
+typedef void tsw_pktnotify_t(struct tty *tp, char event);
+typedef void tsw_free_t(void *softc);
struct ttydevsw {
unsigned int tsw_flags; /* Default TTY flags. */
==== //depot/projects/mpsafetty/sys/sys/ttydisc.h#9 (text+ko) ====
@@ -42,22 +42,22 @@
struct uio;
/* Top half routines. */
-void ttydisc_open(struct tty *);
-void ttydisc_close(struct tty *);
-int ttydisc_read(struct tty *, struct uio *, int);
-int ttydisc_write(struct tty *, struct uio *, int);
-void ttydisc_optimize(struct tty *);
+void ttydisc_open(struct tty *tp);
+void ttydisc_close(struct tty *tp);
+int ttydisc_read(struct tty *tp, struct uio *uio, int ioflag);
+int ttydisc_write(struct tty *tp, struct uio *uio, int ioflag);
+void ttydisc_optimize(struct tty *tp);
/* Bottom half routines. */
-void ttydisc_modem(struct tty *, int);
+void ttydisc_modem(struct tty *tp, int open);
#define ttydisc_can_bypass(tp) ((tp)->t_flags & TF_BYPASS)
-int ttydisc_rint(struct tty *, char, int);
-size_t ttydisc_rint_bypass(struct tty *, const void *, size_t);
-void ttydisc_rint_done(struct tty *);
-size_t ttydisc_rint_poll(struct tty *);
-size_t ttydisc_getc(struct tty *, void *, size_t);
-int ttydisc_getc_uio(struct tty *, struct uio *);
-size_t ttydisc_getc_poll(struct tty *);
+int ttydisc_rint(struct tty *tp, char c, int flags);
+size_t ttydisc_rint_bypass(struct tty *tp, const void *buf, size_t len);
+void ttydisc_rint_done(struct tty *tp);
+size_t ttydisc_rint_poll(struct tty *tp);
+size_t ttydisc_getc(struct tty *tp, void *buf, size_t len);
+int ttydisc_getc_uio(struct tty *tp, struct uio *uio);
+size_t ttydisc_getc_poll(struct tty *tp);
/* Error codes for ttydisc_rint(). */
#define TRE_FRAMING 0x01
==== //depot/projects/mpsafetty/sys/sys/ttyhook.h#7 (text+ko) ====
@@ -40,15 +40,15 @@
* input and output paths of a TTY.
*/
-typedef int th_rint_t(struct tty *, char, int);
-typedef size_t th_rint_bypass_t(struct tty *, const void *, size_t);
-typedef size_t th_rint_poll_t(struct tty *);
+typedef int th_rint_t(struct tty *tp, char c, int flags);
+typedef size_t th_rint_bypass_t(struct tty *tp, const void *buf, size_t len);
+typedef size_t th_rint_poll_t(struct tty *tp);
-typedef size_t th_getc_inject_t(struct tty *, void *, size_t);
-typedef void th_getc_capture_t(struct tty *, const void *, size_t);
-typedef size_t th_getc_poll_t(struct tty *);
+typedef size_t th_getc_inject_t(struct tty *tp, void *buf, size_t len);
+typedef void th_getc_capture_t(struct tty *tp, const void *buf, size_t len);
+typedef size_t th_getc_poll_t(struct tty *tp);
-typedef void th_close_t(struct tty *);
+typedef void th_close_t(struct tty *tp);
struct ttyhook {
/* Character input. */
==== //depot/projects/mpsafetty/sys/sys/ttyqueue.h#10 (text+ko) ====
@@ -69,19 +69,22 @@
#ifdef _KERNEL
/* Input queue handling routines. */
-void ttyinq_setsize(struct ttyinq *, struct tty *, size_t);
-void ttyinq_free(struct ttyinq *);
-int ttyinq_read_uio(struct ttyinq *, struct tty *, struct uio *,
- size_t, size_t);
-size_t ttyinq_write(struct ttyinq *, const void *, size_t, int);
-int ttyinq_write_nofrag(struct ttyinq *, const void *, size_t, int);
-void ttyinq_canonicalize(struct ttyinq *);
-size_t ttyinq_findchar(struct ttyinq *, const char *, size_t, char *);
-void ttyinq_flush(struct ttyinq *);
-int ttyinq_peekchar(struct ttyinq *, char *, int *);
-void ttyinq_unputchar(struct ttyinq *);
-void ttyinq_reprintpos_set(struct ttyinq *);
-void ttyinq_reprintpos_reset(struct ttyinq *);
+void ttyinq_setsize(struct ttyinq *ti, struct tty *tp, size_t len);
+void ttyinq_free(struct ttyinq *ti);
+int ttyinq_read_uio(struct ttyinq *ti, struct tty *tp, struct uio *uio,
+ size_t readlen, size_t flushlen);
+size_t ttyinq_write(struct ttyinq *ti, const void *buf, size_t len,
+ int quote);
+int ttyinq_write_nofrag(struct ttyinq *ti, const void *buf, size_t len,
+ int quote);
+void ttyinq_canonicalize(struct ttyinq *ti);
+size_t ttyinq_findchar(struct ttyinq *ti, const char *breakc, size_t maxlen,
+ char *lastc);
+void ttyinq_flush(struct ttyinq *ti);
+int ttyinq_peekchar(struct ttyinq *ti, char *c, int *quote);
+void ttyinq_unputchar(struct ttyinq *ti);
+void ttyinq_reprintpos_set(struct ttyinq *ti);
+void ttyinq_reprintpos_reset(struct ttyinq *ti);
static __inline void
ttyinq_init(struct ttyinq *ti)
@@ -125,20 +128,20 @@
}
/* Input buffer iteration. */
-typedef void ttyinq_line_iterator_t(void *, char, int);
-void ttyinq_line_iterate_from_linestart(struct ttyinq *,
- ttyinq_line_iterator_t *, void *);
-void ttyinq_line_iterate_from_reprintpos(struct ttyinq *,
- ttyinq_line_iterator_t *, void *);
+typedef void ttyinq_line_iterator_t(void *data, char c, int flags);
+void ttyinq_line_iterate_from_linestart(struct ttyinq *ti,
+ ttyinq_line_iterator_t *iterator, void *data);
+void ttyinq_line_iterate_from_reprintpos(struct ttyinq *ti,
+ ttyinq_line_iterator_t *iterator, void *data);
/* Output queue handling routines. */
-void ttyoutq_flush(struct ttyoutq *);
-void ttyoutq_setsize(struct ttyoutq *, struct tty *, size_t);
-void ttyoutq_free(struct ttyoutq *);
-size_t ttyoutq_read(struct ttyoutq *, void *, size_t);
-int ttyoutq_read_uio(struct ttyoutq *, struct tty *, struct uio *);
-size_t ttyoutq_write(struct ttyoutq *, const void *, size_t);
-int ttyoutq_write_nofrag(struct ttyoutq *, const void *, size_t);
+void ttyoutq_flush(struct ttyoutq *to);
+void ttyoutq_setsize(struct ttyoutq *to, struct tty *tp, size_t len);
+void ttyoutq_free(struct ttyoutq *to);
+size_t ttyoutq_read(struct ttyoutq *to, void *buf, size_t len);
+int ttyoutq_read_uio(struct ttyoutq *to, struct tty *tp, struct uio *uio);
+size_t ttyoutq_write(struct ttyoutq *to, const void *buf, size_t len);
+int ttyoutq_write_nofrag(struct ttyoutq *to, const void *buf, size_t len);
static __inline void
ttyoutq_init(struct ttyoutq *to)
More information about the p4-projects
mailing list