Deleted Added
sdiff udiff text old ( 8018:f3975c1b6009 ) new ( 8019:4af5d8f5ce56 )
full compact
1/*
2 * Copyright (c) 2003, 2004
3 * The Regents of The University of Michigan
4 * All Rights Reserved
5 *
6 * This code is part of the M5 simulator, developed by Nathan Binkert,
7 * Erik Hallnor, Steve Raasch, and Steve Reinhardt, with contributions
8 * from Ron Dreslinski, Dave Greene, Lisa Hsu, Ali Saidi, and Andrew

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

64#include "cserve.h"
65#include "rpb.h"
66
67#define CONS_INT_TX 0x01 /* interrupt enable / state bits */
68#define CONS_INT_RX 0x02
69
70#define PAGE_SIZE (8192)
71
72#define KSTACK_REGION_VA 0x20040000
73
74#define KSEG 0xfffffc0000000000
75#define K1BASE 0xfffffc8000000000
76#define KSEG_TO_PHYS(x) (((ulong)x) & ~KSEG)
77
78#define ROUNDUP8(x) ((ulong)(((ulong)x)+7) & ~7)
79#define ROUNDUP128(x) ((ulong)(((ulong)x) + 127) & ~127)
80#define ROUNDUP8K(x) ((ulong)(((ulong)(x)) + 8191) & ~8191)
81

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

510 }
511
512 /* Protect the PAL pages */
513 for (i = 1; i < PFN(first); i++)
514 third_rpb[HWRPB_PAGES + MDT_BITMAP_PAGES + i] = KPTE(i);
515
516 /* Set up third_kernel after it's loaded, when we know where it is */
517 kern_first_page = (KSEG_TO_PHYS(m5Conf.kernStart)/PAGE_SIZE);
518 kernel_end = ROUNDUP8K(m5Conf.kernEnd);
519 bootadr = m5Conf.entryPoint;
520
521 printf_lock("HWRPB 0x%x l1pt 0x%x l2pt 0x%x l3pt_rpb 0x%x l3pt_kernel 0x%x"
522 " l2reserv 0x%x\n",
523 rpb, first, second, third_rpb, third_kernel, reservedFixup);
524 if (kernel_end - m5Conf.kernStart > (0x800000*NUM_KERNEL_THIRD)) {
525 printf_lock("Kernel is more than 8MB 0x%x - 0x%x = 0x%x\n",
526 kernel_end, m5Conf.kernStart,
527 kernel_end - m5Conf.kernStart );
528 panic("kernel too big\n");
529 }
530 printf_lock("kstart = 0x%x, kend = 0x%x, kentry = 0x%x, numCPUs = 0x%x\n", m5Conf.kernStart, m5Conf.kernEnd, m5Conf.entryPoint, m5Conf.numCPUs);
531
532 ksp_bottom = (ulong)unix_boot_alloc(1);
533 ksp_top = ksp_bottom + PAGE_SIZE;
534
535 ptr = (ulong) ksp_bottom;
536 bzero((char *)ptr, PAGE_SIZE);
537 dbPage[THIRD(KSTACK_REGION_VA)] = 0; /* Stack Guard Page */
538 dbPage[THIRD(KSTACK_REGION_VA + PAGE_SIZE)] = KPTE(PFN(ptr)); /* Kernel Stack Page */
539 dbPage[THIRD(KSTACK_REGION_VA + 2*PAGE_SIZE)] = 0; /* Stack Guard Page */
540
541 /* put argv into the bottom of the stack - argv starts at 1 because
542 * the command thatr got us here (i.e. "unixboot) is in argv[0].
543 */
544 ksp = ksp_top - 8; /* Back up one longword */
545 ksp -= argc * sizeof(char *); /* Make room for argv */
546 kargv = (char **) ksp;
547 for (i = 1; i < argc; i++) { /* Copy arguments to stack */
548 ksp -= ((strlen(argv[i]) + 1) + 7) & ~0x7;
549 kargv[i-1] = (char *) ksp;
550 strcpy(kargv[i - 1], argv[i]);
551 }
552 kargc = i - 1;

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

595 for (i = 0; i < m5Conf.numCPUs; i++) {
596 struct rpb_percpu *thisCPU = (struct rpb_percpu*)
597 ((ulong)rpb_percpu + percpu_size * i);
598
599 bzero((char *)thisCPU, percpu_size);
600 bcopy((char *)&m5_rpb_percpu, (char *)thisCPU,
601 sizeof(struct rpb_percpu));
602
603 thisCPU->rpb_pcb.rpb_ksp = (KSTACK_REGION_VA + 2*PAGE_SIZE - (ksp_top - ksp));
604 thisCPU->rpb_pcb.rpb_ptbr = PFN(first);
605
606 thisCPU->rpb_logout = KSEG_TO_PHYS(percpu_logout);
607 thisCPU->rpb_logout_len = PAGE_SIZE;
608
609 printf_lock("KSP: 0x%x PTBR 0x%x\n",
610 thisCPU->rpb_pcb.rpb_ksp, thisCPU->rpb_pcb.rpb_ptbr);
611 }

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

618 rpb_ctb = (struct rpb_ctb *) nextPtr;
619 ctb_tt = (struct ctb_tt*) rpb_ctb;
620
621 rpb->rpb_ctb_off = ((ulong)rpb_ctb) - (ulong)rpb;
622 rpb->rpb_ctb_size = sizeof(struct rpb_ctb);
623
624 bzero((char *)rpb_ctb, sizeof(struct ctb_tt));
625
626 rpb_ctb->rpb_type = CONS_DZ;
627 rpb_ctb->rpb_length = sizeof(ctb_tt) - sizeof(rpb_ctb);
628
629 /*
630 * uart initizliation
631 */
632 ctb_tt->ctb_csr = 0;
633 ctb_tt->ctb_tivec = 0x6c0; /* matches tlaser pal code */
634 ctb_tt->ctb_rivec = 0x680; /* matches tlaser pal code */
635 ctb_tt->ctb_term_type = 2;
636 ctb_tt->ctb_put_sts = 0;
637 ctb_tt->ctb_get_sts = 0;
638
639 rpb_crb = (struct rpb_crb *) (((ulong)rpb_ctb) + sizeof(struct ctb_tt));
640 rpb->rpb_crb_off = ((ulong)rpb_crb) - (ulong)rpb;
641
642 bzero((char *)rpb_crb, sizeof(struct rpb_crb));
643
644 /*
645 * console callback stuff (m5)

--- 461 unchanged lines hidden ---