66 #include <sys/exacct.h>
67 #include <sys/autoconf.h>
68 #include <sys/errorq.h>
69 #include <sys/class.h>
70 #include <sys/stack.h>
71 #include <sys/brand.h>
72 #include <sys/mmapobj.h>
73
74 #include <vm/as.h>
75 #include <vm/seg_kmem.h>
76 #include <sys/dc_ki.h>
77
78 #include <c2/audit.h>
79 #include <sys/bootprops.h>
80
81 /* well known processes */
82 proc_t *proc_sched; /* memory scheduler */
83 proc_t *proc_init; /* init */
84 proc_t *proc_pageout; /* pageout daemon */
85 proc_t *proc_fsflush; /* fsflush daemon */
86
87 pgcnt_t maxmem; /* Maximum available memory in pages. */
88 pgcnt_t freemem; /* Current available memory in pages. */
89 int interrupts_unleashed; /* set when we do the first spl0() */
90
91 kmem_cache_t *process_cache; /* kmem cache for proc structures */
92
93 /*
94 * Indicates whether the auditing module (c2audit) is loaded. Possible
95 * values are:
96 * 0 - c2audit module is excluded in /etc/system and cannot be loaded
97 * 1 - c2audit module is not loaded but can be anytime
98 * 2 - c2audit module is loaded
99 */
100 int audit_active = C2AUDIT_DISABLED;
101
102 /*
103 * Process 0's lwp directory and lwpid hash table.
104 */
105 lwpdir_t p0_lwpdir[2];
342 */
343 static void
344 start_init(void)
345 {
346 proc_init = curproc;
347
348 ASSERT(curproc->p_zone->zone_initname != NULL);
349
350 if (start_init_common() != 0)
351 halt("unix: Could not start init");
352 lwp_rtt();
353 }
354
355 void
356 main(void)
357 {
358 proc_t *p = ttoproc(curthread); /* &p0 */
359 int (**initptr)();
360 extern void sched();
361 extern void fsflush();
362 extern int (*init_tbl[])();
363 extern int (*mp_init_tbl[])();
364 extern id_t syscid, defaultcid;
365 extern int swaploaded;
366 extern int netboot;
367 extern ib_boot_prop_t *iscsiboot_prop;
368 extern void vm_init(void);
369 extern void cbe_init_pre(void);
370 extern void cbe_init(void);
371 extern void clock_tick_init_pre(void);
372 extern void clock_tick_init_post(void);
373 extern void clock_init(void);
374 extern void physio_bufs_init(void);
375 extern void pm_cfb_setup_intr(void);
376 extern int pm_adjust_timestamps(dev_info_t *, void *);
377 extern void start_other_cpus(int);
378 extern void sysevent_evc_thrinit();
379 extern kmutex_t ualock;
380 #if defined(__x86)
381 extern void fastboot_post_startup(void);
601 * Note that we manually assign the pids for these processes, for
602 * historical reasons. If more pre-assigned pids are needed,
603 * FAMOUS_PIDS will have to be updated.
604 */
605
606 /* create init process */
607 if (newproc(start_init, NULL, defaultcid, 59, NULL,
608 FAMOUS_PID_INIT))
609 panic("main: unable to fork init.");
610
611 /* create pageout daemon */
612 if (newproc(pageout, NULL, syscid, maxclsyspri - 1, NULL,
613 FAMOUS_PID_PAGEOUT))
614 panic("main: unable to fork pageout()");
615
616 /* create fsflush daemon */
617 if (newproc(fsflush, NULL, syscid, minclsyspri, NULL,
618 FAMOUS_PID_FSFLUSH))
619 panic("main: unable to fork fsflush()");
620
621 /* create cluster process if we're a member of one */
622 if (cluster_bootflags & CLUSTER_BOOTED) {
623 if (newproc(cluster_wrapper, NULL, syscid, minclsyspri,
624 NULL, 0)) {
625 panic("main: unable to fork cluster()");
626 }
627 }
628
629 /*
630 * Create system threads (threads are associated with p0)
631 */
632
633 /* create module uninstall daemon */
634 /* BugID 1132273. If swapping over NFS need a bigger stack */
635 (void) thread_create(NULL, 0, (void (*)())mod_uninstall_daemon,
636 NULL, 0, &p0, TS_RUN, minclsyspri);
637
638 (void) thread_create(NULL, 0, seg_pasync_thread,
639 NULL, 0, &p0, TS_RUN, minclsyspri);
640
|
66 #include <sys/exacct.h>
67 #include <sys/autoconf.h>
68 #include <sys/errorq.h>
69 #include <sys/class.h>
70 #include <sys/stack.h>
71 #include <sys/brand.h>
72 #include <sys/mmapobj.h>
73
74 #include <vm/as.h>
75 #include <vm/seg_kmem.h>
76 #include <sys/dc_ki.h>
77
78 #include <c2/audit.h>
79 #include <sys/bootprops.h>
80
81 /* well known processes */
82 proc_t *proc_sched; /* memory scheduler */
83 proc_t *proc_init; /* init */
84 proc_t *proc_pageout; /* pageout daemon */
85 proc_t *proc_fsflush; /* fsflush daemon */
86 proc_t *proc_intrd; /* interrupt daemon */
87
88 pgcnt_t maxmem; /* Maximum available memory in pages. */
89 pgcnt_t freemem; /* Current available memory in pages. */
90 int interrupts_unleashed; /* set when we do the first spl0() */
91
92 kmem_cache_t *process_cache; /* kmem cache for proc structures */
93
94 /*
95 * Indicates whether the auditing module (c2audit) is loaded. Possible
96 * values are:
97 * 0 - c2audit module is excluded in /etc/system and cannot be loaded
98 * 1 - c2audit module is not loaded but can be anytime
99 * 2 - c2audit module is loaded
100 */
101 int audit_active = C2AUDIT_DISABLED;
102
103 /*
104 * Process 0's lwp directory and lwpid hash table.
105 */
106 lwpdir_t p0_lwpdir[2];
343 */
344 static void
345 start_init(void)
346 {
347 proc_init = curproc;
348
349 ASSERT(curproc->p_zone->zone_initname != NULL);
350
351 if (start_init_common() != 0)
352 halt("unix: Could not start init");
353 lwp_rtt();
354 }
355
356 void
357 main(void)
358 {
359 proc_t *p = ttoproc(curthread); /* &p0 */
360 int (**initptr)();
361 extern void sched();
362 extern void fsflush();
363 extern void intrd();
364 extern int (*init_tbl[])();
365 extern int (*mp_init_tbl[])();
366 extern id_t syscid, defaultcid;
367 extern int swaploaded;
368 extern int netboot;
369 extern ib_boot_prop_t *iscsiboot_prop;
370 extern void vm_init(void);
371 extern void cbe_init_pre(void);
372 extern void cbe_init(void);
373 extern void clock_tick_init_pre(void);
374 extern void clock_tick_init_post(void);
375 extern void clock_init(void);
376 extern void physio_bufs_init(void);
377 extern void pm_cfb_setup_intr(void);
378 extern int pm_adjust_timestamps(dev_info_t *, void *);
379 extern void start_other_cpus(int);
380 extern void sysevent_evc_thrinit();
381 extern kmutex_t ualock;
382 #if defined(__x86)
383 extern void fastboot_post_startup(void);
603 * Note that we manually assign the pids for these processes, for
604 * historical reasons. If more pre-assigned pids are needed,
605 * FAMOUS_PIDS will have to be updated.
606 */
607
608 /* create init process */
609 if (newproc(start_init, NULL, defaultcid, 59, NULL,
610 FAMOUS_PID_INIT))
611 panic("main: unable to fork init.");
612
613 /* create pageout daemon */
614 if (newproc(pageout, NULL, syscid, maxclsyspri - 1, NULL,
615 FAMOUS_PID_PAGEOUT))
616 panic("main: unable to fork pageout()");
617
618 /* create fsflush daemon */
619 if (newproc(fsflush, NULL, syscid, minclsyspri, NULL,
620 FAMOUS_PID_FSFLUSH))
621 panic("main: unable to fork fsflush()");
622
623 /* create interrupt balancer daemon */
624 if (newproc(intrd, NULL, syscid, minclsyspri, NULL, 0))
625 panic("main: unable to fork intrd()");
626
627 /* create cluster process if we're a member of one */
628 if (cluster_bootflags & CLUSTER_BOOTED) {
629 if (newproc(cluster_wrapper, NULL, syscid, minclsyspri,
630 NULL, 0)) {
631 panic("main: unable to fork cluster()");
632 }
633 }
634
635 /*
636 * Create system threads (threads are associated with p0)
637 */
638
639 /* create module uninstall daemon */
640 /* BugID 1132273. If swapping over NFS need a bigger stack */
641 (void) thread_create(NULL, 0, (void (*)())mod_uninstall_daemon,
642 NULL, 0, &p0, TS_RUN, minclsyspri);
643
644 (void) thread_create(NULL, 0, seg_pasync_thread,
645 NULL, 0, &p0, TS_RUN, minclsyspri);
646
|