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

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

484 dcons_os_putc(dc, c);
485}
486#endif
487
488static int
489dcons_drv_init(int stage)
490{
491#ifdef __i386__
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>

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

484 dcons_os_putc(dc, c);
485}
486#endif
487
488static int
489dcons_drv_init(int stage)
490{
491#ifdef __i386__
492 int addr, size;
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__
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__
507 if (getenv_int("dcons.addr", &addr) > 0 &&
508 getenv_int("dcons.size", &size) > 0) {
507 if (getenv_quad("dcons.addr", &addr) > 0 &&
508 getenv_quad("dcons.size", &size) > 0) {
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();
509 /* XXX P to V */
516 /* XXX P to V */
510 dg.buf = (struct dcons_buf *)(KERNBASE + addr);
517 dg.buf = (struct dcons_buf *)(vm_offset_t)(KERNBASE + addr);
511 dg.size = size;
512 if (dcons_load_buffer(dg.buf, dg.size, sc) < 0)
513 dg.buf = NULL;
514 }
515#endif
516 if (dg.buf != NULL)
517 goto ok;
518

--- 225 unchanged lines hidden ---
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)
524 goto ok;
525

--- 225 unchanged lines hidden ---