usr/src/uts/i86pc/os/startup.c
changeset 1676 37f4a3e2bd99
parent 1582 eb879d43ab47
child 1841 9d7ebafcda38
equal deleted inserted replaced
1675:5791e75682d0 1676:37f4a3e2bd99
    47 #include <sys/buf.h>
    47 #include <sys/buf.h>
    48 #include <sys/kmem.h>
    48 #include <sys/kmem.h>
    49 #include <sys/kstat.h>
    49 #include <sys/kstat.h>
    50 
    50 
    51 #include <sys/reboot.h>
    51 #include <sys/reboot.h>
    52 #include <sys/uadmin.h>
       
    53 
    52 
    54 #include <sys/cred.h>
    53 #include <sys/cred.h>
    55 #include <sys/vnode.h>
    54 #include <sys/vnode.h>
    56 #include <sys/file.h>
    55 #include <sys/file.h>
    57 
    56 
    58 #include <sys/procfs.h>
    57 #include <sys/procfs.h>
    59 #include <sys/acct.h>
       
    60 
    58 
    61 #include <sys/vfs.h>
    59 #include <sys/vfs.h>
    62 #include <sys/dnlc.h>
       
    63 #include <sys/var.h>
       
    64 #include <sys/cmn_err.h>
    60 #include <sys/cmn_err.h>
    65 #include <sys/utsname.h>
    61 #include <sys/utsname.h>
    66 #include <sys/debug.h>
    62 #include <sys/debug.h>
    67 #include <sys/kdi.h>
    63 #include <sys/kdi.h>
    68 
    64 
    69 #include <sys/dumphdr.h>
    65 #include <sys/dumphdr.h>
    70 #include <sys/bootconf.h>
    66 #include <sys/bootconf.h>
    71 #include <sys/varargs.h>
    67 #include <sys/varargs.h>
    72 #include <sys/promif.h>
    68 #include <sys/promif.h>
    73 #include <sys/prom_emul.h>	/* for create_prom_prop */
       
    74 #include <sys/modctl.h>		/* for "procfs" hack */
    69 #include <sys/modctl.h>		/* for "procfs" hack */
    75 
       
    76 #include <sys/consdev.h>
       
    77 #include <sys/frame.h>
       
    78 
    70 
    79 #include <sys/sunddi.h>
    71 #include <sys/sunddi.h>
    80 #include <sys/sunndi.h>
    72 #include <sys/sunndi.h>
    81 #include <sys/ndi_impldefs.h>
    73 #include <sys/ndi_impldefs.h>
    82 #include <sys/ddidmareq.h>
    74 #include <sys/ddidmareq.h>
    83 #include <sys/psw.h>
    75 #include <sys/psw.h>
    84 #include <sys/regset.h>
    76 #include <sys/regset.h>
    85 #include <sys/clock.h>
    77 #include <sys/clock.h>
    86 #include <sys/pte.h>
    78 #include <sys/pte.h>
    87 #include <sys/mmu.h>
       
    88 #include <sys/tss.h>
    79 #include <sys/tss.h>
    89 #include <sys/stack.h>
    80 #include <sys/stack.h>
    90 #include <sys/trap.h>
    81 #include <sys/trap.h>
    91 #include <sys/pic.h>
       
    92 #include <sys/fp.h>
    82 #include <sys/fp.h>
    93 #include <vm/anon.h>
    83 #include <vm/anon.h>
    94 #include <vm/as.h>
    84 #include <vm/as.h>
    95 #include <vm/page.h>
    85 #include <vm/page.h>
    96 #include <vm/seg.h>
    86 #include <vm/seg.h>
   100 #include <vm/seg_map.h>
    90 #include <vm/seg_map.h>
   101 #include <vm/seg_vn.h>
    91 #include <vm/seg_vn.h>
   102 #include <vm/seg_kp.h>
    92 #include <vm/seg_kp.h>
   103 #include <sys/memnode.h>
    93 #include <sys/memnode.h>
   104 #include <vm/vm_dep.h>
    94 #include <vm/vm_dep.h>
   105 #include <sys/swap.h>
       
   106 #include <sys/thread.h>
    95 #include <sys/thread.h>
   107 #include <sys/sysconf.h>
    96 #include <sys/sysconf.h>
   108 #include <sys/vm_machparam.h>
    97 #include <sys/vm_machparam.h>
   109 #include <sys/archsystm.h>
    98 #include <sys/archsystm.h>
   110 #include <sys/machsystm.h>
    99 #include <sys/machsystm.h>
   111 #include <vm/hat.h>
   100 #include <vm/hat.h>
   112 #include <vm/hat_i86.h>
   101 #include <vm/hat_i86.h>
   113 #include <sys/pmem.h>
   102 #include <sys/pmem.h>
   114 #include <sys/instance.h>
       
   115 #include <sys/smp_impldefs.h>
   103 #include <sys/smp_impldefs.h>
   116 #include <sys/x86_archext.h>
   104 #include <sys/x86_archext.h>
   117 #include <sys/segments.h>
   105 #include <sys/segments.h>
   118 #include <sys/clconf.h>
   106 #include <sys/clconf.h>
   119 #include <sys/kobj.h>
   107 #include <sys/kobj.h>
   120 #include <sys/kobj_lex.h>
   108 #include <sys/kobj_lex.h>
   121 #include <sys/prom_emul.h>
       
   122 #include <sys/cpc_impl.h>
   109 #include <sys/cpc_impl.h>
   123 #include <sys/chip.h>
   110 #include <sys/chip.h>
   124 #include <sys/x86_archext.h>
   111 #include <sys/x86_archext.h>
   125 #include <sys/cpu_module.h>
   112 #include <sys/cpu_module.h>
   126 #include <sys/smbios.h>
   113 #include <sys/smbios.h>
  1363 		halt("Can't load specfs");
  1350 		halt("Can't load specfs");
  1364 
  1351 
  1365 	if (modload("fs", "devfs") == -1)
  1352 	if (modload("fs", "devfs") == -1)
  1366 		halt("Can't load devfs");
  1353 		halt("Can't load devfs");
  1367 
  1354 
       
  1355 	(void) modloadonly("sys", "lbl_edition");
       
  1356 
  1368 	dispinit();
  1357 	dispinit();
  1369 
  1358 
  1370 	/*
  1359 	/*
  1371 	 * This is needed here to initialize hw_serial[] for cluster booting.
  1360 	 * This is needed here to initialize hw_serial[] for cluster booting.
  1372 	 */
  1361 	 */
  2409  * Disable reprogramming of MTRRs by default.
  2398  * Disable reprogramming of MTRRs by default.
  2410  */
  2399  */
  2411 int	enable_relaxed_mtrr = 0;
  2400 int	enable_relaxed_mtrr = 0;
  2412 
  2401 
  2413 void
  2402 void
  2414 setup_mtrr()
  2403 setup_mtrr(void)
  2415 {
  2404 {
  2416 	int i, ecx;
  2405 	int i, ecx;
  2417 	int vcnt;
  2406 	int vcnt;
  2418 	struct	mtrrvar	*mtrrphys;
  2407 	struct	mtrrvar	*mtrrphys;
  2419 
  2408 
  2461  * Currently we do not capture other cpu's. This is invoked on cpu0
  2450  * Currently we do not capture other cpu's. This is invoked on cpu0
  2462  * just after reading /etc/system.
  2451  * just after reading /etc/system.
  2463  * On other cpu's its invoked from mp_startup().
  2452  * On other cpu's its invoked from mp_startup().
  2464  */
  2453  */
  2465 void
  2454 void
  2466 mtrr_sync()
  2455 mtrr_sync(void)
  2467 {
  2456 {
  2468 	uint_t	crvalue, cr0_orig;
  2457 	uint_t	crvalue, cr0_orig;
  2469 	int	vcnt, i, ecx;
  2458 	int	vcnt, i, ecx;
  2470 	struct	mtrrvar	*mtrrphys;
  2459 	struct	mtrrvar	*mtrrphys;
  2471 
  2460 
  2510 
  2499 
  2511 /*
  2500 /*
  2512  * resync mtrr so that BIOS is happy. Called from mdboot
  2501  * resync mtrr so that BIOS is happy. Called from mdboot
  2513  */
  2502  */
  2514 void
  2503 void
  2515 mtrr_resync()
  2504 mtrr_resync(void)
  2516 {
  2505 {
  2517 	if ((x86_feature & X86_PAT) && enable_relaxed_mtrr) {
  2506 	if ((x86_feature & X86_PAT) && enable_relaxed_mtrr) {
  2518 		/*
  2507 		/*
  2519 		 * We could have changed the default mtrr definition.
  2508 		 * We could have changed the default mtrr definition.
  2520 		 * Put it back to uncached which is what it is at power on
  2509 		 * Put it back to uncached which is what it is at power on
  2523 		mtrr_sync();
  2512 		mtrr_sync();
  2524 	}
  2513 	}
  2525 }
  2514 }
  2526 
  2515 
  2527 void
  2516 void
  2528 get_system_configuration()
  2517 get_system_configuration(void)
  2529 {
  2518 {
  2530 	char	prop[32];
  2519 	char	prop[32];
  2531 	u_longlong_t nodes_ll, cpus_pernode_ll, lvalue;
  2520 	u_longlong_t nodes_ll, cpus_pernode_ll, lvalue;
  2532 
  2521 
  2533 	if (((BOP_GETPROPLEN(bootops, "nodes") > sizeof (prop)) ||
  2522 	if (((BOP_GETPROPLEN(bootops, "nodes") > sizeof (prop)) ||