Print this page
Adding AoE support to nza-kernel


   3  *
   4  * The contents of this file are subject to the terms of the
   5  * Common Development and Distribution License (the "License").
   6  * You may not use this file except in compliance with the License.
   7  *
   8  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
   9  * or http://www.opensolaris.org/os/licensing.
  10  * See the License for the specific language governing permissions
  11  * and limitations under the License.
  12  *
  13  * When distributing Covered Code, include this CDDL HEADER in each
  14  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
  15  * If applicable, add the following below this CDDL HEADER, with the
  16  * fields enclosed by brackets "[]" replaced with your own identifying
  17  * information: Portions Copyright [yyyy] [name of copyright owner]
  18  *
  19  * CDDL HEADER END
  20  */
  21 
  22 /*

  23  * Copyright (c) 1988, 2010, Oracle and/or its affiliates. All rights reserved.
  24  */
  25 
  26 /*      Copyright (c) 1988 AT&T     */
  27 /*        All Rights Reserved   */
  28 
  29 /*
  30  * Copyright (c) 2013, Joyent, Inc. All rights reserved.
  31  */
  32 
  33 #include <sys/types.h>
  34 #include <sys/param.h>
  35 #include <sys/sysmacros.h>
  36 #include <sys/pcb.h>
  37 #include <sys/systm.h>
  38 #include <sys/signal.h>
  39 #include <sys/cred.h>
  40 #include <sys/user.h>
  41 #include <sys/vfs.h>
  42 #include <sys/vnode.h>


 350         proc_init = curproc;
 351 
 352         ASSERT(curproc->p_zone->zone_initname != NULL);
 353 
 354         if (start_init_common() != 0)
 355                 halt("unix: Could not start init");
 356         lwp_rtt();
 357 }
 358 
 359 void
 360 main(void)
 361 {
 362         proc_t          *p = ttoproc(curthread);        /* &p0 */
 363         int             (**initptr)();
 364         extern void     sched();
 365         extern void     fsflush();
 366         extern int      (*init_tbl[])();
 367         extern int      (*mp_init_tbl[])();
 368         extern id_t     syscid, defaultcid;
 369         extern int      swaploaded;

 370         extern int      netboot;
 371         extern ib_boot_prop_t *iscsiboot_prop;
 372         extern void     vm_init(void);
 373         extern void     cbe_init_pre(void);
 374         extern void     cbe_init(void);
 375         extern void     clock_tick_init_pre(void);
 376         extern void     clock_tick_init_post(void);
 377         extern void     clock_init(void);
 378         extern void     physio_bufs_init(void);
 379         extern void     pm_cfb_setup_intr(void);
 380         extern int      pm_adjust_timestamps(dev_info_t *, void *);
 381         extern void     start_other_cpus(int);
 382         extern void     sysevent_evc_thrinit();
 383         extern kmutex_t ualock;
 384 #if defined(__x86)
 385         extern void     fastboot_post_startup(void);
 386         extern void     progressbar_start(void);
 387 #endif
 388         /*
 389          * In the horrible world of x86 in-lines, you can't get symbolic


 484             0, NULL, NULL, NULL, NULL, NULL, 0);
 485 
 486         vfs_mountroot();        /* Mount the root file system */
 487         errorq_init();          /* after vfs_mountroot() so DDI root is ready */
 488         cpu_kstat_init(CPU);    /* after vfs_mountroot() so TOD is valid */
 489         ddi_walk_devs(ddi_root_node(), pm_adjust_timestamps, NULL);
 490                                 /* after vfs_mountroot() so hrestime is valid */
 491 
 492         post_startup();
 493         swaploaded = 1;
 494 
 495         /*
 496          * Initialize Solaris Audit Subsystem
 497          */
 498         audit_init();
 499 
 500         /*
 501          * Plumb the protocol modules and drivers only if we are not
 502          * networked booted, in this case we already did it in rootconf().
 503          */
 504         if (netboot == 0 && iscsiboot_prop == NULL)
 505                 (void) strplumb();
 506 
 507         gethrestime(&PTOU(curproc)->u_start);
 508         curthread->t_start = PTOU(curproc)->u_start.tv_sec;
 509         p->p_mstart = gethrtime();
 510 
 511         /*
 512          * Perform setup functions that can only be done after root
 513          * and swap have been set up.
 514          */
 515         consconfig();
 516 #ifndef __sparc
 517         release_bootstrap();
 518 #endif
 519 
 520         /*
 521          * attach drivers with ddi-forceattach prop
 522          * It must be done early enough to load hotplug drivers (e.g.
 523          * pcmcia nexus) so that devices enumerated via hotplug is
 524          * available before I/O subsystem is fully initialized.




   3  *
   4  * The contents of this file are subject to the terms of the
   5  * Common Development and Distribution License (the "License").
   6  * You may not use this file except in compliance with the License.
   7  *
   8  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
   9  * or http://www.opensolaris.org/os/licensing.
  10  * See the License for the specific language governing permissions
  11  * and limitations under the License.
  12  *
  13  * When distributing Covered Code, include this CDDL HEADER in each
  14  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
  15  * If applicable, add the following below this CDDL HEADER, with the
  16  * fields enclosed by brackets "[]" replaced with your own identifying
  17  * information: Portions Copyright [yyyy] [name of copyright owner]
  18  *
  19  * CDDL HEADER END
  20  */
  21 
  22 /*
  23  * Copyright 2012 Nexenta Systems, Inc.  All rights reserved.
  24  * Copyright (c) 1988, 2010, Oracle and/or its affiliates. All rights reserved.
  25  */
  26 
  27 /*      Copyright (c) 1988 AT&T     */
  28 /*        All Rights Reserved   */
  29 
  30 /*
  31  * Copyright (c) 2013, Joyent, Inc. All rights reserved.
  32  */
  33 
  34 #include <sys/types.h>
  35 #include <sys/param.h>
  36 #include <sys/sysmacros.h>
  37 #include <sys/pcb.h>
  38 #include <sys/systm.h>
  39 #include <sys/signal.h>
  40 #include <sys/cred.h>
  41 #include <sys/user.h>
  42 #include <sys/vfs.h>
  43 #include <sys/vnode.h>


 351         proc_init = curproc;
 352 
 353         ASSERT(curproc->p_zone->zone_initname != NULL);
 354 
 355         if (start_init_common() != 0)
 356                 halt("unix: Could not start init");
 357         lwp_rtt();
 358 }
 359 
 360 void
 361 main(void)
 362 {
 363         proc_t          *p = ttoproc(curthread);        /* &p0 */
 364         int             (**initptr)();
 365         extern void     sched();
 366         extern void     fsflush();
 367         extern int      (*init_tbl[])();
 368         extern int      (*mp_init_tbl[])();
 369         extern id_t     syscid, defaultcid;
 370         extern int      swaploaded;
 371         extern char     *aoepath_prop;
 372         extern int      netboot;
 373         extern ib_boot_prop_t *iscsiboot_prop;
 374         extern void     vm_init(void);
 375         extern void     cbe_init_pre(void);
 376         extern void     cbe_init(void);
 377         extern void     clock_tick_init_pre(void);
 378         extern void     clock_tick_init_post(void);
 379         extern void     clock_init(void);
 380         extern void     physio_bufs_init(void);
 381         extern void     pm_cfb_setup_intr(void);
 382         extern int      pm_adjust_timestamps(dev_info_t *, void *);
 383         extern void     start_other_cpus(int);
 384         extern void     sysevent_evc_thrinit();
 385         extern kmutex_t ualock;
 386 #if defined(__x86)
 387         extern void     fastboot_post_startup(void);
 388         extern void     progressbar_start(void);
 389 #endif
 390         /*
 391          * In the horrible world of x86 in-lines, you can't get symbolic


 486             0, NULL, NULL, NULL, NULL, NULL, 0);
 487 
 488         vfs_mountroot();        /* Mount the root file system */
 489         errorq_init();          /* after vfs_mountroot() so DDI root is ready */
 490         cpu_kstat_init(CPU);    /* after vfs_mountroot() so TOD is valid */
 491         ddi_walk_devs(ddi_root_node(), pm_adjust_timestamps, NULL);
 492                                 /* after vfs_mountroot() so hrestime is valid */
 493 
 494         post_startup();
 495         swaploaded = 1;
 496 
 497         /*
 498          * Initialize Solaris Audit Subsystem
 499          */
 500         audit_init();
 501 
 502         /*
 503          * Plumb the protocol modules and drivers only if we are not
 504          * networked booted, in this case we already did it in rootconf().
 505          */
 506         if (aoepath_prop == NULL && iscsiboot_prop == NULL && !netboot)
 507                 (void) strplumb();
 508 
 509         gethrestime(&PTOU(curproc)->u_start);
 510         curthread->t_start = PTOU(curproc)->u_start.tv_sec;
 511         p->p_mstart = gethrtime();
 512 
 513         /*
 514          * Perform setup functions that can only be done after root
 515          * and swap have been set up.
 516          */
 517         consconfig();
 518 #ifndef __sparc
 519         release_bootstrap();
 520 #endif
 521 
 522         /*
 523          * attach drivers with ddi-forceattach prop
 524          * It must be done early enough to load hotplug drivers (e.g.
 525          * pcmcia nexus) so that devices enumerated via hotplug is
 526          * available before I/O subsystem is fully initialized.