Deleted Added
full compact
dcons_os.c (170537) dcons_os.c (171867)
1/*-
2 * Copyright (C) 2003,2004
3 * Hidetoshi Shimokawa. All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright

--- 17 unchanged lines hidden (view full) ---

26 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
27 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
28 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
29 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
30 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
31 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
32 * SUCH DAMAGE.
33 *
1/*-
2 * Copyright (C) 2003,2004
3 * Hidetoshi Shimokawa. All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright

--- 17 unchanged lines hidden (view full) ---

26 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
27 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
28 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
29 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
30 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
31 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
32 * SUCH DAMAGE.
33 *
34 * $FreeBSD: head/sys/dev/dcons/dcons_os.c 170537 2007-06-11 04:08:50Z simokawa $
34 * $FreeBSD: head/sys/dev/dcons/dcons_os.c 171867 2007-08-17 05:32:39Z simokawa $
35 */
36
37#include <sys/param.h>
38#if __FreeBSD_version >= 502122
39#include <sys/kdb.h>
40#include <gdb/gdb.h>
41#endif
42#include <sys/kernel.h>

--- 193 unchanged lines hidden (view full) ---

236#endif
237 return (c);
238}
239#else
240#define dcons_check_break(dc, c) (c)
241#endif
242
243static int
35 */
36
37#include <sys/param.h>
38#if __FreeBSD_version >= 502122
39#include <sys/kdb.h>
40#include <gdb/gdb.h>
41#endif
42#include <sys/kernel.h>

--- 193 unchanged lines hidden (view full) ---

236#endif
237 return (c);
238}
239#else
240#define dcons_check_break(dc, c) (c)
241#endif
242
243static int
244dcons_os_checkc(struct dcons_softc *dc)
244dcons_os_checkc_nopoll(struct dcons_softc *dc)
245{
246 int c;
247
245{
246 int c;
247
248 EVENTHANDLER_INVOKE(dcons_poll, 0);
249 if (dg.dma_tag != NULL)
250 bus_dmamap_sync(dg.dma_tag, dg.dma_map, BUS_DMASYNC_POSTREAD);
251
252 c = dcons_check_break(dc, dcons_checkc(dc));
253
254 if (dg.dma_tag != NULL)
255 bus_dmamap_sync(dg.dma_tag, dg.dma_map, BUS_DMASYNC_PREREAD);
256
257 return (c);
258}
259
248 if (dg.dma_tag != NULL)
249 bus_dmamap_sync(dg.dma_tag, dg.dma_map, BUS_DMASYNC_POSTREAD);
250
251 c = dcons_check_break(dc, dcons_checkc(dc));
252
253 if (dg.dma_tag != NULL)
254 bus_dmamap_sync(dg.dma_tag, dg.dma_map, BUS_DMASYNC_PREREAD);
255
256 return (c);
257}
258
259static int
260dcons_os_checkc(struct dcons_softc *dc)
261{
262 EVENTHANDLER_INVOKE(dcons_poll, 0);
263 return (dcons_os_checkc_nopoll(dc));
264}
265
260#if defined(GDB) || !defined(CONS_NODEV)
261static int
262dcons_os_getc(struct dcons_softc *dc)
263{
264 int c;
265
266 while ((c = dcons_os_checkc(dc)) == -1);
267

--- 135 unchanged lines hidden (view full) ---

403{
404 struct tty *tp;
405 struct dcons_softc *dc;
406 int i, c, polltime;
407
408 for (i = 0; i < DCONS_NPORT; i ++) {
409 dc = &sc[i];
410 tp = ((DEV)dc->dev)->si_tty;
266#if defined(GDB) || !defined(CONS_NODEV)
267static int
268dcons_os_getc(struct dcons_softc *dc)
269{
270 int c;
271
272 while ((c = dcons_os_checkc(dc)) == -1);
273

--- 135 unchanged lines hidden (view full) ---

409{
410 struct tty *tp;
411 struct dcons_softc *dc;
412 int i, c, polltime;
413
414 for (i = 0; i < DCONS_NPORT; i ++) {
415 dc = &sc[i];
416 tp = ((DEV)dc->dev)->si_tty;
411 while ((c = dcons_os_checkc(dc)) != -1)
417 while ((c = dcons_os_checkc_nopoll(dc)) != -1)
412 if (tp->t_state & TS_ISOPEN)
413#if __FreeBSD_version < 502113
414 (*linesw[tp->t_line].l_rint)(c, tp);
415#else
416 ttyld_rint(tp, c);
417#endif
418 }
419 polltime = hz / poll_hz;

--- 338 unchanged lines hidden ---
418 if (tp->t_state & TS_ISOPEN)
419#if __FreeBSD_version < 502113
420 (*linesw[tp->t_line].l_rint)(c, tp);
421#else
422 ttyld_rint(tp, c);
423#endif
424 }
425 polltime = hz / poll_hz;

--- 338 unchanged lines hidden ---