The Design and Implementation of the FreeBSD Operating System, Second Edition
Now available: The Design and Implementation of the FreeBSD Operating System (Second Edition)


[ source navigation ] [ diff markup ] [ identifier search ] [ freetext search ] [ file search ] [ list types ] [ track identifier ]

FreeBSD/Linux Kernel Cross Reference
sys/mips/adm5120/adm5120_machdep.c

Version: -  FREEBSD  -  FREEBSD-12-STABLE  -  FREEBSD-12-0  -  FREEBSD-11-STABLE  -  FREEBSD-11-2  -  FREEBSD-11-1  -  FREEBSD-11-0  -  FREEBSD-10-STABLE  -  FREEBSD-10-4  -  FREEBSD-10-3  -  FREEBSD-10-2  -  FREEBSD-10-1  -  FREEBSD-10-0  -  FREEBSD-9-STABLE  -  FREEBSD-9-3  -  FREEBSD-9-2  -  FREEBSD-9-1  -  FREEBSD-9-0  -  FREEBSD-8-STABLE  -  FREEBSD-8-4  -  FREEBSD-8-3  -  FREEBSD-8-2  -  FREEBSD-8-1  -  FREEBSD-8-0  -  FREEBSD-7-STABLE  -  FREEBSD-7-4  -  FREEBSD-7-3  -  FREEBSD-7-2  -  FREEBSD-7-1  -  FREEBSD-7-0  -  FREEBSD-6-STABLE  -  FREEBSD-6-4  -  FREEBSD-6-3  -  FREEBSD-6-2  -  FREEBSD-6-1  -  FREEBSD-6-0  -  FREEBSD-5-STABLE  -  FREEBSD-5-5  -  FREEBSD-5-4  -  FREEBSD-5-3  -  FREEBSD-5-2  -  FREEBSD-5-1  -  FREEBSD-5-0  -  FREEBSD-4-STABLE  -  FREEBSD-3-STABLE  -  FREEBSD22  -  linux-2.6  -  linux-2.4.22  -  MK83  -  MK84  -  PLAN9  -  DFBSD  -  NETBSD  -  NETBSD5  -  NETBSD4  -  NETBSD3  -  NETBSD20  -  OPENBSD  -  xnu-517  -  xnu-792  -  xnu-792.6.70  -  xnu-1228  -  xnu-1456.1.26  -  xnu-1699.24.8  -  xnu-2050.18.24  -  OPENSOLARIS  -  minix-3-1-1 
SearchContext: -  none  -  3  -  10 

    1 /*-
    2  * Copyright (C) 2007 by Oleksandr Tymoshenko. All rights reserved.
    3  *
    4  * Redistribution and use in source and binary forms, with or without
    5  * modification, are permitted provided that the following conditions
    6  * are met:
    7  * 1. Redistributions of source code must retain the above copyright
    8  *    notice, this list of conditions and the following disclaimer.
    9  * 2. Redistributions in binary form must reproduce the above copyright
   10  *    notice, this list of conditions and the following disclaimer in the
   11  *    documentation and/or other materials provided with the distribution.
   12  *
   13  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
   14  * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
   15  * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
   16  * IN NO EVENT SHALL THE AUTHOR OR HIS RELATIVES BE LIABLE FOR ANY DIRECT,
   17  * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
   18  * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
   19  * SERVICES; LOSS OF MIND, USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
   20  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
   21  * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
   22  * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
   23  * THE POSSIBILITY OF SUCH DAMAGE.
   24  *
   25  */
   26 
   27 #include <sys/cdefs.h>
   28 __FBSDID("$FreeBSD: stable/10/sys/mips/adm5120/adm5120_machdep.c 247297 2013-02-26 01:00:11Z attilio $");
   29 
   30 #include "opt_ddb.h"
   31 
   32 #include <sys/param.h>
   33 #include <sys/conf.h>
   34 #include <sys/kernel.h>
   35 #include <sys/systm.h>
   36 #include <sys/imgact.h>
   37 #include <sys/bio.h>
   38 #include <sys/buf.h>
   39 #include <sys/bus.h>
   40 #include <sys/cpu.h>
   41 #include <sys/cons.h>
   42 #include <sys/exec.h>
   43 #include <sys/ucontext.h>
   44 #include <sys/proc.h>
   45 #include <sys/kdb.h>
   46 #include <sys/ptrace.h>
   47 #include <sys/reboot.h>
   48 #include <sys/signalvar.h>
   49 #include <sys/sysent.h>
   50 #include <sys/sysproto.h>
   51 #include <sys/user.h>
   52 
   53 #include <vm/vm.h>
   54 #include <vm/vm_object.h>
   55 #include <vm/vm_page.h>
   56 
   57 #include <machine/cache.h>
   58 #include <machine/clock.h>
   59 #include <machine/cpu.h>
   60 #include <machine/cpuinfo.h>
   61 #include <machine/cpufunc.h>
   62 #include <machine/cpuregs.h>
   63 #include <machine/hwfunc.h>
   64 #include <machine/intr_machdep.h>
   65 #include <machine/locore.h>
   66 #include <machine/md_var.h>
   67 #include <machine/pte.h>
   68 #include <machine/sigframe.h>
   69 #include <machine/trap.h>
   70 #include <machine/vmparam.h>
   71 
   72 extern int      *edata;
   73 extern int      *end;
   74 
   75 void
   76 platform_cpu_init()
   77 {
   78         /* Nothing special */
   79 }
   80 
   81 static void
   82 mips_init(void)
   83 {
   84         int i;
   85 
   86         printf("entry: mips_init()\n");
   87 
   88         bootverbose = 1;
   89         realmem = btoc(16 << 20);
   90 
   91         for (i = 0; i < 10; i++) {
   92                 phys_avail[i] = 0;
   93         }
   94 
   95         /* phys_avail regions are in bytes */
   96         phys_avail[0] = MIPS_KSEG0_TO_PHYS(kernel_kseg0_end);
   97         phys_avail[1] = ctob(realmem);
   98 
   99         dump_avail[0] = phys_avail[0];
  100         dump_avail[1] = phys_avail[1];
  101 
  102         physmem = realmem;
  103 
  104         init_param1();
  105         init_param2(physmem);
  106         mips_cpu_init();
  107         pmap_bootstrap();
  108         mips_proc0_init();
  109         mutex_init();
  110         kdb_init();
  111 #ifdef KDB
  112         if (boothowto & RB_KDB)
  113                 kdb_enter(KDB_WHY_BOOTFLAGS, "Boot flags requested debugger");
  114 #endif
  115 }
  116 
  117 void
  118 platform_reset(void)
  119 {
  120 
  121         __asm __volatile("li    $25, 0xbfc00000");
  122         __asm __volatile("j     $25");
  123 }
  124 
  125 void
  126 platform_start(__register_t a0 __unused, __register_t a1 __unused, 
  127     __register_t a2 __unused, __register_t a3 __unused)
  128 {
  129         vm_offset_t kernend;
  130         uint64_t platform_counter_freq = 175 * 1000 * 1000;
  131 
  132         /* clear the BSS and SBSS segments */
  133         kernend = (vm_offset_t)&end;
  134         memset(&edata, 0, kernend - (vm_offset_t)(&edata));
  135 
  136         mips_postboot_fixup();
  137 
  138         /* Initialize pcpu stuff */
  139         mips_pcpu0_init();
  140 
  141         cninit();
  142         mips_init();
  143         mips_timer_init_params(platform_counter_freq, 0);
  144 }

Cache object: 48677ec1fcbf20eb113b3d7fc260e261


[ source navigation ] [ diff markup ] [ identifier search ] [ freetext search ] [ file search ] [ list types ] [ track identifier ]


This page is part of the FreeBSD/Linux Linux Kernel Cross-Reference, and was automatically generated using a modified version of the LXR engine.