Deleted Added
full compact
dcons_os.c (136898) dcons_os.c (137013)
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 136898 2004-10-24 12:41:04Z simokawa $
34 * $FreeBSD: head/sys/dev/dcons/dcons_os.c 137013 2004-10-28 12:18:22Z 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>

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

483 struct dcons_softc *dc = (struct dcons_softc *)dev->si_drv1;
484 dcons_os_putc(dc, c);
485}
486#endif
487
488static int
489dcons_drv_init(int stage)
490{
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>

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

483 struct dcons_softc *dc = (struct dcons_softc *)dev->si_drv1;
484 dcons_os_putc(dc, c);
485}
486#endif
487
488static int
489dcons_drv_init(int stage)
490{
491#ifdef __i386__
491#if defined(__i386__) || defined(__amd64__)
492 quad_t addr, size;
493#endif
494
495 if (drv_init)
496 return(drv_init);
497
498 drv_init = -1;
499
500 bzero(&dg, sizeof(dg));
501 dcons_conf = &dg;
502 dg.cdev = &dcons_consdev;
503 dg.buf = NULL;
504 dg.size = DCONS_BUF_SIZE;
505
492 quad_t addr, size;
493#endif
494
495 if (drv_init)
496 return(drv_init);
497
498 drv_init = -1;
499
500 bzero(&dg, sizeof(dg));
501 dcons_conf = &dg;
502 dg.cdev = &dcons_consdev;
503 dg.buf = NULL;
504 dg.size = DCONS_BUF_SIZE;
505
506#ifdef __i386__
506#if defined(__i386__) || defined(__amd64__)
507 if (getenv_quad("dcons.addr", &addr) > 0 &&
508 getenv_quad("dcons.size", &size) > 0) {
507 if (getenv_quad("dcons.addr", &addr) > 0 &&
508 getenv_quad("dcons.size", &size) > 0) {
509#ifdef __i386__
509 vm_paddr_t pa;
510 /*
511 * Allow read/write access to dcons buffer.
512 */
513 for (pa = trunc_page(addr); pa < addr + size; pa += PAGE_SIZE)
514 *vtopte(KERNBASE + pa) |= PG_RW;
515 invltlb();
510 vm_paddr_t pa;
511 /*
512 * Allow read/write access to dcons buffer.
513 */
514 for (pa = trunc_page(addr); pa < addr + size; pa += PAGE_SIZE)
515 *vtopte(KERNBASE + pa) |= PG_RW;
516 invltlb();
517#endif
516 /* XXX P to V */
517 dg.buf = (struct dcons_buf *)(vm_offset_t)(KERNBASE + addr);
518 dg.size = size;
519 if (dcons_load_buffer(dg.buf, dg.size, sc) < 0)
520 dg.buf = NULL;
521 }
522#endif
523 if (dg.buf != NULL)

--- 227 unchanged lines hidden ---
518 /* XXX P to V */
519 dg.buf = (struct dcons_buf *)(vm_offset_t)(KERNBASE + addr);
520 dg.size = size;
521 if (dcons_load_buffer(dg.buf, dg.size, sc) < 0)
522 dg.buf = NULL;
523 }
524#endif
525 if (dg.buf != NULL)

--- 227 unchanged lines hidden ---