Print this page
XXX Rearchitect and replace interrupt distribution


  70 #include <sys/exacct.h>
  71 #include <sys/autoconf.h>
  72 #include <sys/errorq.h>
  73 #include <sys/class.h>
  74 #include <sys/stack.h>
  75 #include <sys/brand.h>
  76 #include <sys/mmapobj.h>
  77 
  78 #include <vm/as.h>
  79 #include <vm/seg_kmem.h>
  80 #include <sys/dc_ki.h>
  81 
  82 #include <c2/audit.h>
  83 #include <sys/bootprops.h>
  84 
  85 /* well known processes */
  86 proc_t *proc_sched;             /* memory scheduler */
  87 proc_t *proc_init;              /* init */
  88 proc_t *proc_pageout;           /* pageout daemon */
  89 proc_t *proc_fsflush;           /* fsflush daemon */

  90 
  91 pgcnt_t maxmem;         /* Maximum available memory in pages.   */
  92 pgcnt_t freemem;        /* Current available memory in pages.   */
  93 int     interrupts_unleashed;   /* set when we do the first spl0() */
  94 
  95 kmem_cache_t *process_cache;    /* kmem cache for proc structures */
  96 
  97 /*
  98  * Indicates whether the auditing module (c2audit) is loaded. Possible
  99  * values are:
 100  * 0 - c2audit module is excluded in /etc/system and cannot be loaded
 101  * 1 - c2audit module is not loaded but can be anytime
 102  * 2 - c2audit module is loaded
 103  */
 104 int audit_active = C2AUDIT_DISABLED;
 105 
 106 /*
 107  * Process 0's lwp directory and lwpid hash table.
 108  */
 109 lwpdir_t p0_lwpdir[2];


 346  */
 347 static void
 348 start_init(void)
 349 {
 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);


 605          * Note that we manually assign the pids for these processes, for
 606          * historical reasons.  If more pre-assigned pids are needed,
 607          * FAMOUS_PIDS will have to be updated.
 608          */
 609 
 610         /* create init process */
 611         if (newproc(start_init, NULL, defaultcid, 59, NULL,
 612             FAMOUS_PID_INIT))
 613                 panic("main: unable to fork init.");
 614 
 615         /* create pageout daemon */
 616         if (newproc(pageout, NULL, syscid, maxclsyspri - 1, NULL,
 617             FAMOUS_PID_PAGEOUT))
 618                 panic("main: unable to fork pageout()");
 619 
 620         /* create fsflush daemon */
 621         if (newproc(fsflush, NULL, syscid, minclsyspri, NULL,
 622             FAMOUS_PID_FSFLUSH))
 623                 panic("main: unable to fork fsflush()");
 624 




 625         /* create cluster process if we're a member of one */
 626         if (cluster_bootflags & CLUSTER_BOOTED) {
 627                 if (newproc(cluster_wrapper, NULL, syscid, minclsyspri,
 628                     NULL, 0)) {
 629                         panic("main: unable to fork cluster()");
 630                 }
 631         }
 632 
 633         /*
 634          * Create system threads (threads are associated with p0)
 635          */
 636 
 637         /* create module uninstall daemon */
 638         /* BugID 1132273. If swapping over NFS need a bigger stack */
 639         (void) thread_create(NULL, 0, (void (*)())mod_uninstall_daemon,
 640             NULL, 0, &p0, TS_RUN, minclsyspri);
 641 
 642         (void) thread_create(NULL, 0, seg_pasync_thread,
 643             NULL, 0, &p0, TS_RUN, minclsyspri);
 644 


  70 #include <sys/exacct.h>
  71 #include <sys/autoconf.h>
  72 #include <sys/errorq.h>
  73 #include <sys/class.h>
  74 #include <sys/stack.h>
  75 #include <sys/brand.h>
  76 #include <sys/mmapobj.h>
  77 
  78 #include <vm/as.h>
  79 #include <vm/seg_kmem.h>
  80 #include <sys/dc_ki.h>
  81 
  82 #include <c2/audit.h>
  83 #include <sys/bootprops.h>
  84 
  85 /* well known processes */
  86 proc_t *proc_sched;             /* memory scheduler */
  87 proc_t *proc_init;              /* init */
  88 proc_t *proc_pageout;           /* pageout daemon */
  89 proc_t *proc_fsflush;           /* fsflush daemon */
  90 proc_t *proc_intrd;             /* interrupt daemon */
  91 
  92 pgcnt_t maxmem;         /* Maximum available memory in pages.   */
  93 pgcnt_t freemem;        /* Current available memory in pages.   */
  94 int     interrupts_unleashed;   /* set when we do the first spl0() */
  95 
  96 kmem_cache_t *process_cache;    /* kmem cache for proc structures */
  97 
  98 /*
  99  * Indicates whether the auditing module (c2audit) is loaded. Possible
 100  * values are:
 101  * 0 - c2audit module is excluded in /etc/system and cannot be loaded
 102  * 1 - c2audit module is not loaded but can be anytime
 103  * 2 - c2audit module is loaded
 104  */
 105 int audit_active = C2AUDIT_DISABLED;
 106 
 107 /*
 108  * Process 0's lwp directory and lwpid hash table.
 109  */
 110 lwpdir_t p0_lwpdir[2];


 347  */
 348 static void
 349 start_init(void)
 350 {
 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 void     interrupt_balancer();
 368         extern int      (*init_tbl[])();
 369         extern int      (*mp_init_tbl[])();
 370         extern id_t     syscid, defaultcid;
 371         extern int      swaploaded;
 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);


 607          * Note that we manually assign the pids for these processes, for
 608          * historical reasons.  If more pre-assigned pids are needed,
 609          * FAMOUS_PIDS will have to be updated.
 610          */
 611 
 612         /* create init process */
 613         if (newproc(start_init, NULL, defaultcid, 59, NULL,
 614             FAMOUS_PID_INIT))
 615                 panic("main: unable to fork init.");
 616 
 617         /* create pageout daemon */
 618         if (newproc(pageout, NULL, syscid, maxclsyspri - 1, NULL,
 619             FAMOUS_PID_PAGEOUT))
 620                 panic("main: unable to fork pageout()");
 621 
 622         /* create fsflush daemon */
 623         if (newproc(fsflush, NULL, syscid, minclsyspri, NULL,
 624             FAMOUS_PID_FSFLUSH))
 625                 panic("main: unable to fork fsflush()");
 626 
 627         /* create interrupt balancer process */
 628         if (newproc(interrupt_balancer, NULL, syscid, minclsyspri, NULL, 0))
 629                 panic("main: unable to fork interrupt_balancer()");
 630 
 631         /* create cluster process if we're a member of one */
 632         if (cluster_bootflags & CLUSTER_BOOTED) {
 633                 if (newproc(cluster_wrapper, NULL, syscid, minclsyspri,
 634                     NULL, 0)) {
 635                         panic("main: unable to fork cluster()");
 636                 }
 637         }
 638 
 639         /*
 640          * Create system threads (threads are associated with p0)
 641          */
 642 
 643         /* create module uninstall daemon */
 644         /* BugID 1132273. If swapping over NFS need a bigger stack */
 645         (void) thread_create(NULL, 0, (void (*)())mod_uninstall_daemon,
 646             NULL, 0, &p0, TS_RUN, minclsyspri);
 647 
 648         (void) thread_create(NULL, 0, seg_pasync_thread,
 649             NULL, 0, &p0, TS_RUN, minclsyspri);
 650