Print this page
XXX Rearchitect and replace interrupt distribution
Split |
Close |
Expand all |
Collapse all |
--- old/usr/src/uts/common/os/main.c
+++ new/usr/src/uts/common/os/main.c
1 1 /*
2 2 * CDDL HEADER START
3 3 *
4 4 * The contents of this file are subject to the terms of the
5 5 * Common Development and Distribution License (the "License").
6 6 * You may not use this file except in compliance with the License.
7 7 *
8 8 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9 9 * or http://www.opensolaris.org/os/licensing.
10 10 * See the License for the specific language governing permissions
11 11 * and limitations under the License.
12 12 *
13 13 * When distributing Covered Code, include this CDDL HEADER in each
14 14 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15 15 * If applicable, add the following below this CDDL HEADER, with the
16 16 * fields enclosed by brackets "[]" replaced with your own identifying
17 17 * information: Portions Copyright [yyyy] [name of copyright owner]
18 18 *
19 19 * CDDL HEADER END
20 20 */
21 21
22 22 /*
23 23 * Copyright (c) 1988, 2010, Oracle and/or its affiliates. All rights reserved.
24 24 */
25 25
26 26 /* Copyright (c) 1988 AT&T */
27 27 /* All Rights Reserved */
28 28
29 29 #include <sys/types.h>
30 30 #include <sys/param.h>
31 31 #include <sys/sysmacros.h>
32 32 #include <sys/pcb.h>
33 33 #include <sys/systm.h>
34 34 #include <sys/signal.h>
35 35 #include <sys/cred.h>
36 36 #include <sys/user.h>
37 37 #include <sys/vfs.h>
38 38 #include <sys/vnode.h>
39 39 #include <sys/proc.h>
40 40 #include <sys/time.h>
41 41 #include <sys/file.h>
42 42 #include <sys/priocntl.h>
43 43 #include <sys/procset.h>
44 44 #include <sys/disp.h>
45 45 #include <sys/callo.h>
46 46 #include <sys/callb.h>
47 47 #include <sys/debug.h>
48 48 #include <sys/conf.h>
49 49 #include <sys/bootconf.h>
50 50 #include <sys/utsname.h>
51 51 #include <sys/cmn_err.h>
52 52 #include <sys/vmparam.h>
53 53 #include <sys/modctl.h>
54 54 #include <sys/vm.h>
55 55 #include <sys/callb.h>
56 56 #include <sys/ddi_timer.h>
57 57 #include <sys/kmem.h>
58 58 #include <sys/vmem.h>
59 59 #include <sys/cpuvar.h>
60 60 #include <sys/cladm.h>
61 61 #include <sys/corectl.h>
62 62 #include <sys/exec.h>
63 63 #include <sys/syscall.h>
64 64 #include <sys/reboot.h>
65 65 #include <sys/task.h>
66 66 #include <sys/exacct.h>
67 67 #include <sys/autoconf.h>
68 68 #include <sys/errorq.h>
69 69 #include <sys/class.h>
70 70 #include <sys/stack.h>
71 71 #include <sys/brand.h>
72 72 #include <sys/mmapobj.h>
73 73
74 74 #include <vm/as.h>
75 75 #include <vm/seg_kmem.h>
↓ open down ↓ |
75 lines elided |
↑ open up ↑ |
76 76 #include <sys/dc_ki.h>
77 77
78 78 #include <c2/audit.h>
79 79 #include <sys/bootprops.h>
80 80
81 81 /* well known processes */
82 82 proc_t *proc_sched; /* memory scheduler */
83 83 proc_t *proc_init; /* init */
84 84 proc_t *proc_pageout; /* pageout daemon */
85 85 proc_t *proc_fsflush; /* fsflush daemon */
86 +proc_t *proc_intrd; /* interrupt daemon */
86 87
87 88 pgcnt_t maxmem; /* Maximum available memory in pages. */
88 89 pgcnt_t freemem; /* Current available memory in pages. */
89 90 int interrupts_unleashed; /* set when we do the first spl0() */
90 91
91 92 kmem_cache_t *process_cache; /* kmem cache for proc structures */
92 93
93 94 /*
94 95 * Indicates whether the auditing module (c2audit) is loaded. Possible
95 96 * values are:
96 97 * 0 - c2audit module is excluded in /etc/system and cannot be loaded
97 98 * 1 - c2audit module is not loaded but can be anytime
98 99 * 2 - c2audit module is loaded
99 100 */
100 101 int audit_active = C2AUDIT_DISABLED;
101 102
102 103 /*
103 104 * Process 0's lwp directory and lwpid hash table.
104 105 */
105 106 lwpdir_t p0_lwpdir[2];
106 107 tidhash_t p0_tidhash[2];
107 108 lwpent_t p0_lep;
108 109
109 110 /*
110 111 * Machine-independent initialization code
111 112 * Called from cold start routine as
112 113 * soon as a stack and segmentation
113 114 * have been established.
114 115 * Functions:
115 116 * clear and free user core
116 117 * turn on clock
117 118 * hand craft 0th process
118 119 * call all initialization routines
119 120 * fork - process 0 to schedule
120 121 * - process 1 execute bootstrap
121 122 * - process 2 to page out
122 123 * create system threads
123 124 */
124 125
125 126 int cluster_bootflags = 0;
126 127
127 128 void
128 129 cluster_wrapper(void)
129 130 {
130 131 cluster();
131 132 panic("cluster() returned");
132 133 }
133 134
134 135 char initname[INITNAME_SZ] = "/sbin/init"; /* also referenced by zone0 */
135 136 char initargs[BOOTARGS_MAX] = ""; /* also referenced by zone0 */
136 137
137 138 /*
138 139 * Construct a stack for init containing the arguments to it, then
139 140 * pass control to exec_common.
140 141 */
141 142 int
142 143 exec_init(const char *initpath, const char *args)
143 144 {
144 145 caddr32_t ucp;
145 146 caddr32_t *uap;
146 147 caddr32_t *argv;
147 148 caddr32_t exec_fnamep;
148 149 char *scratchargs;
149 150 int i, sarg;
150 151 size_t argvlen, alen;
151 152 boolean_t in_arg;
152 153 int argc = 0;
153 154 int error = 0, count = 0;
154 155 proc_t *p = ttoproc(curthread);
155 156 klwp_t *lwp = ttolwp(curthread);
156 157 int brand_action;
157 158
158 159 if (args == NULL)
159 160 args = "";
160 161
161 162 alen = strlen(initpath) + 1 + strlen(args) + 1;
162 163 scratchargs = kmem_alloc(alen, KM_SLEEP);
163 164 (void) snprintf(scratchargs, alen, "%s %s", initpath, args);
164 165
165 166 /*
166 167 * We do a quick two state parse of the string to sort out how big
167 168 * argc should be.
168 169 */
169 170 in_arg = B_FALSE;
170 171 for (i = 0; i < strlen(scratchargs); i++) {
171 172 if (scratchargs[i] == ' ' || scratchargs[i] == '\0') {
172 173 if (in_arg) {
173 174 in_arg = B_FALSE;
174 175 argc++;
175 176 }
176 177 } else {
177 178 in_arg = B_TRUE;
178 179 }
179 180 }
180 181 argvlen = sizeof (caddr32_t) * (argc + 1);
181 182 argv = kmem_zalloc(argvlen, KM_SLEEP);
182 183
183 184 /*
184 185 * We pull off a bit of a hack here. We work our way through the
185 186 * args string, putting nulls at the ends of space delimited tokens
186 187 * (boot args don't support quoting at this time). Then we just
187 188 * copy the whole mess to userland in one go. In other words, we
188 189 * transform this: "init -s -r\0" into this on the stack:
189 190 *
190 191 * -0x00 \0
191 192 * -0x01 r
192 193 * -0x02 - <--------.
193 194 * -0x03 \0 |
194 195 * -0x04 s |
195 196 * -0x05 - <------. |
196 197 * -0x06 \0 | |
197 198 * -0x07 t | |
198 199 * -0x08 i | |
199 200 * -0x09 n | |
200 201 * -0x0a i <---. | |
201 202 * -0x10 NULL | | | (argv[3])
202 203 * -0x14 -----|--|-' (argv[2])
203 204 * -0x18 ------|--' (argv[1])
204 205 * -0x1c -------' (argv[0])
205 206 *
206 207 * Since we know the value of ucp at the beginning of this process,
207 208 * we can trivially compute the argv[] array which we also need to
208 209 * place in userland: argv[i] = ucp - sarg(i), where ucp is the
209 210 * stack ptr, and sarg is the string index of the start of the
210 211 * argument.
211 212 */
212 213 ucp = (caddr32_t)(uintptr_t)p->p_usrstack;
213 214
214 215 argc = 0;
215 216 in_arg = B_FALSE;
216 217 sarg = 0;
217 218
218 219 for (i = 0; i < alen; i++) {
219 220 if (scratchargs[i] == ' ' || scratchargs[i] == '\0') {
220 221 if (in_arg == B_TRUE) {
221 222 in_arg = B_FALSE;
222 223 scratchargs[i] = '\0';
223 224 argv[argc++] = ucp - (alen - sarg);
224 225 }
225 226 } else if (in_arg == B_FALSE) {
226 227 in_arg = B_TRUE;
227 228 sarg = i;
228 229 }
229 230 }
230 231 ucp -= alen;
231 232 error |= copyout(scratchargs, (caddr_t)(uintptr_t)ucp, alen);
232 233
233 234 uap = (caddr32_t *)P2ALIGN((uintptr_t)ucp, sizeof (caddr32_t));
234 235 uap--; /* advance to be below the word we're in */
235 236 uap -= (argc + 1); /* advance argc words down, plus one for NULL */
236 237 error |= copyout(argv, uap, argvlen);
237 238
238 239 if (error != 0) {
239 240 zcmn_err(p->p_zone->zone_id, CE_WARN,
240 241 "Could not construct stack for init.\n");
241 242 kmem_free(argv, argvlen);
242 243 kmem_free(scratchargs, alen);
243 244 return (EFAULT);
244 245 }
245 246
246 247 exec_fnamep = argv[0];
247 248 kmem_free(argv, argvlen);
248 249 kmem_free(scratchargs, alen);
249 250
250 251 /*
251 252 * Point at the arguments.
252 253 */
253 254 lwp->lwp_ap = lwp->lwp_arg;
254 255 lwp->lwp_arg[0] = (uintptr_t)exec_fnamep;
255 256 lwp->lwp_arg[1] = (uintptr_t)uap;
256 257 lwp->lwp_arg[2] = NULL;
257 258 curthread->t_post_sys = 1;
258 259 curthread->t_sysnum = SYS_execve;
259 260
260 261 /*
261 262 * If we are executing init from zsched, we may have inherited its
262 263 * parent process's signal mask. Clear it now so that we behave in
263 264 * the same way as when started from the global zone.
264 265 */
265 266 sigemptyset(&curthread->t_hold);
266 267
267 268 brand_action = ZONE_IS_BRANDED(p->p_zone) ? EBA_BRAND : EBA_NONE;
268 269 again:
269 270 error = exec_common((const char *)(uintptr_t)exec_fnamep,
270 271 (const char **)(uintptr_t)uap, NULL, brand_action);
271 272
272 273 /*
273 274 * Normally we would just set lwp_argsaved and t_post_sys and
274 275 * let post_syscall reset lwp_ap for us. Unfortunately,
275 276 * exec_init isn't always called from a system call. Instead
276 277 * of making a mess of trap_cleanup, we just reset the args
277 278 * pointer here.
278 279 */
279 280 reset_syscall_args();
280 281
281 282 switch (error) {
282 283 case 0:
283 284 return (0);
284 285
285 286 case ENOENT:
286 287 zcmn_err(p->p_zone->zone_id, CE_WARN,
287 288 "exec(%s) failed (file not found).\n", initpath);
288 289 return (ENOENT);
289 290
290 291 case EAGAIN:
291 292 case EINTR:
292 293 ++count;
293 294 if (count < 5) {
294 295 zcmn_err(p->p_zone->zone_id, CE_WARN,
295 296 "exec(%s) failed with errno %d. Retrying...\n",
296 297 initpath, error);
297 298 goto again;
298 299 }
299 300 }
300 301
301 302 zcmn_err(p->p_zone->zone_id, CE_WARN,
302 303 "exec(%s) failed with errno %d.", initpath, error);
303 304 return (error);
304 305 }
305 306
306 307 /*
307 308 * This routine does all of the common setup for invoking init; global
308 309 * and non-global zones employ this routine for the functionality which is
309 310 * in common.
310 311 *
311 312 * This program (init, presumably) must be a 32-bit process.
312 313 */
313 314 int
314 315 start_init_common()
315 316 {
316 317 proc_t *p = curproc;
317 318 ASSERT_STACK_ALIGNED();
318 319 p->p_zone->zone_proc_initpid = p->p_pid;
319 320
320 321 p->p_cstime = p->p_stime = p->p_cutime = p->p_utime = 0;
321 322 p->p_usrstack = (caddr_t)USRSTACK32;
322 323 p->p_model = DATAMODEL_ILP32;
323 324 p->p_stkprot = PROT_ZFOD & ~PROT_EXEC;
324 325 p->p_datprot = PROT_ZFOD & ~PROT_EXEC;
325 326 p->p_stk_ctl = INT32_MAX;
326 327
327 328 p->p_as = as_alloc();
328 329 p->p_as->a_proc = p;
329 330 p->p_as->a_userlimit = (caddr_t)USERLIMIT32;
330 331 (void) hat_setup(p->p_as->a_hat, HAT_INIT);
331 332
332 333 init_core();
333 334
334 335 init_mstate(curthread, LMS_SYSTEM);
335 336 return (exec_init(p->p_zone->zone_initname, p->p_zone->zone_bootargs));
336 337 }
337 338
338 339 /*
339 340 * Start the initial user process for the global zone; once running, if
340 341 * init should subsequently fail, it will be automatically be caught in the
341 342 * exit(2) path, and restarted by restart_init().
342 343 */
343 344 static void
344 345 start_init(void)
345 346 {
346 347 proc_init = curproc;
347 348
348 349 ASSERT(curproc->p_zone->zone_initname != NULL);
349 350
350 351 if (start_init_common() != 0)
351 352 halt("unix: Could not start init");
↓ open down ↓ |
256 lines elided |
↑ open up ↑ |
352 353 lwp_rtt();
353 354 }
354 355
355 356 void
356 357 main(void)
357 358 {
358 359 proc_t *p = ttoproc(curthread); /* &p0 */
359 360 int (**initptr)();
360 361 extern void sched();
361 362 extern void fsflush();
363 + extern void intrd();
362 364 extern int (*init_tbl[])();
363 365 extern int (*mp_init_tbl[])();
364 366 extern id_t syscid, defaultcid;
365 367 extern int swaploaded;
366 368 extern int netboot;
367 369 extern ib_boot_prop_t *iscsiboot_prop;
368 370 extern void vm_init(void);
369 371 extern void cbe_init_pre(void);
370 372 extern void cbe_init(void);
371 373 extern void clock_tick_init_pre(void);
372 374 extern void clock_tick_init_post(void);
373 375 extern void clock_init(void);
374 376 extern void physio_bufs_init(void);
375 377 extern void pm_cfb_setup_intr(void);
376 378 extern int pm_adjust_timestamps(dev_info_t *, void *);
377 379 extern void start_other_cpus(int);
378 380 extern void sysevent_evc_thrinit();
379 381 extern kmutex_t ualock;
380 382 #if defined(__x86)
381 383 extern void fastboot_post_startup(void);
382 384 extern void progressbar_start(void);
383 385 #endif
384 386 /*
385 387 * In the horrible world of x86 in-lines, you can't get symbolic
386 388 * structure offsets a la genassym. This assertion is here so
387 389 * that the next poor slob who innocently changes the offset of
388 390 * cpu_thread doesn't waste as much time as I just did finding
389 391 * out that it's hard-coded in i86/ml/i86.il. Similarly for
390 392 * curcpup. You're welcome.
391 393 */
392 394 ASSERT(CPU == CPU->cpu_self);
393 395 ASSERT(curthread == CPU->cpu_thread);
394 396 ASSERT_STACK_ALIGNED();
395 397
396 398 /*
397 399 * We take the ualock until we have completed the startup
398 400 * to prevent kadmin() from disrupting this work. In particular,
399 401 * we don't want kadmin() to bring the system down while we are
400 402 * trying to start it up.
401 403 */
402 404 mutex_enter(&ualock);
403 405
404 406 /*
405 407 * Setup root lgroup and leaf lgroup for CPU 0
406 408 */
407 409 lgrp_init(LGRP_INIT_STAGE2);
408 410
409 411 /*
410 412 * Once 'startup()' completes, the thread_reaper() daemon would be
411 413 * created(in thread_init()). After that, it is safe to create threads
412 414 * that could exit. These exited threads will get reaped.
413 415 */
414 416 startup();
415 417 segkmem_gc();
416 418 callb_init();
417 419 cbe_init_pre(); /* x86 must initialize gethrtimef before timer_init */
418 420 timer_init(); /* timer must be initialized before cyclic starts */
419 421 cbe_init();
420 422 callout_init(); /* callout table MUST be init'd after cyclics */
421 423 clock_tick_init_pre();
422 424 clock_init();
423 425
424 426 #if defined(__x86)
425 427 /*
426 428 * The progressbar thread uses cv_reltimedwait() and hence needs to be
427 429 * started after the callout mechanism has been initialized.
428 430 */
429 431 progressbar_start();
430 432 #endif
431 433 /*
432 434 * On some platforms, clkinitf() changes the timing source that
433 435 * gethrtime_unscaled() uses to generate timestamps. cbe_init() calls
434 436 * clkinitf(), so re-initialize the microstate counters after the
435 437 * timesource has been chosen.
436 438 */
437 439 init_mstate(&t0, LMS_SYSTEM);
438 440 init_cpu_mstate(CPU, CMS_SYSTEM);
439 441
440 442 /*
441 443 * May need to probe to determine latencies from CPU 0 after
442 444 * gethrtime() comes alive in cbe_init() and before enabling interrupts
443 445 * and copy and release any temporary memory allocated with BOP_ALLOC()
444 446 * before release_bootstrap() frees boot memory
445 447 */
446 448 lgrp_init(LGRP_INIT_STAGE3);
447 449
448 450 /*
449 451 * Call all system initialization functions.
450 452 */
451 453 for (initptr = &init_tbl[0]; *initptr; initptr++)
452 454 (**initptr)();
453 455 /*
454 456 * Load iSCSI boot properties
455 457 */
456 458 ld_ib_prop();
457 459 /*
458 460 * initialize vm related stuff.
459 461 */
460 462 vm_init();
461 463
462 464 /*
463 465 * initialize buffer pool for raw I/O requests
464 466 */
465 467 physio_bufs_init();
466 468
467 469 ttolwp(curthread)->lwp_error = 0; /* XXX kludge for SCSI driver */
468 470
469 471 /*
470 472 * Drop the interrupt level and allow interrupts. At this point
471 473 * the DDI guarantees that interrupts are enabled.
472 474 */
473 475 (void) spl0();
474 476 interrupts_unleashed = 1;
475 477
476 478 /*
477 479 * Create kmem cache for proc structures
478 480 */
479 481 process_cache = kmem_cache_create("process_cache", sizeof (proc_t),
480 482 0, NULL, NULL, NULL, NULL, NULL, 0);
481 483
482 484 vfs_mountroot(); /* Mount the root file system */
483 485 errorq_init(); /* after vfs_mountroot() so DDI root is ready */
484 486 cpu_kstat_init(CPU); /* after vfs_mountroot() so TOD is valid */
485 487 ddi_walk_devs(ddi_root_node(), pm_adjust_timestamps, NULL);
486 488 /* after vfs_mountroot() so hrestime is valid */
487 489
488 490 post_startup();
489 491 swaploaded = 1;
490 492
491 493 /*
492 494 * Initialize Solaris Audit Subsystem
493 495 */
494 496 audit_init();
495 497
496 498 /*
497 499 * Plumb the protocol modules and drivers only if we are not
498 500 * networked booted, in this case we already did it in rootconf().
499 501 */
500 502 if (netboot == 0 && iscsiboot_prop == NULL)
501 503 (void) strplumb();
502 504
503 505 gethrestime(&PTOU(curproc)->u_start);
504 506 curthread->t_start = PTOU(curproc)->u_start.tv_sec;
505 507 p->p_mstart = gethrtime();
506 508
507 509 /*
508 510 * Perform setup functions that can only be done after root
509 511 * and swap have been set up.
510 512 */
511 513 consconfig();
512 514 #ifndef __sparc
513 515 release_bootstrap();
514 516 #endif
515 517
516 518 /*
517 519 * attach drivers with ddi-forceattach prop
518 520 * It must be done early enough to load hotplug drivers (e.g.
519 521 * pcmcia nexus) so that devices enumerated via hotplug is
520 522 * available before I/O subsystem is fully initialized.
521 523 */
522 524 i_ddi_forceattach_drivers();
523 525
524 526 /*
525 527 * Set the scan rate and other parameters of the paging subsystem.
526 528 */
527 529 setupclock(0);
528 530
529 531 /*
530 532 * Initialize process 0's lwp directory and lwpid hash table.
531 533 */
532 534 p->p_lwpdir = p->p_lwpfree = p0_lwpdir;
533 535 p->p_lwpdir->ld_next = p->p_lwpdir + 1;
534 536 p->p_lwpdir_sz = 2;
535 537 p->p_tidhash = p0_tidhash;
536 538 p->p_tidhash_sz = 2;
537 539 p0_lep.le_thread = curthread;
538 540 p0_lep.le_lwpid = curthread->t_tid;
539 541 p0_lep.le_start = curthread->t_start;
540 542 lwp_hash_in(p, &p0_lep, p0_tidhash, 2, 0);
541 543
542 544 /*
543 545 * Initialize extended accounting.
544 546 */
545 547 exacct_init();
546 548
547 549 /*
548 550 * Initialize threads of sysevent event channels
549 551 */
550 552 sysevent_evc_thrinit();
551 553
552 554 /*
553 555 * This must be done after post_startup() but before
554 556 * start_other_cpus()
555 557 */
556 558 lgrp_init(LGRP_INIT_STAGE4);
557 559
558 560 /*
559 561 * Perform MP initialization, if any.
560 562 */
561 563 start_other_cpus(0);
562 564
563 565 #ifdef __sparc
564 566 /*
565 567 * Release bootstrap here since PROM interfaces are
566 568 * used to start other CPUs above.
567 569 */
568 570 release_bootstrap();
569 571 #endif
570 572
571 573 /*
572 574 * Finish lgrp initialization after all CPUS are brought online.
573 575 */
574 576 lgrp_init(LGRP_INIT_STAGE5);
575 577
576 578 /*
577 579 * After mp_init(), number of cpus are known (this is
578 580 * true for the time being, when there are actually
579 581 * hot pluggable cpus then this scheme would not do).
580 582 * Any per cpu initialization is done here.
581 583 */
582 584 kmem_mp_init();
583 585 vmem_update(NULL);
584 586
585 587 clock_tick_init_post();
586 588
587 589 for (initptr = &mp_init_tbl[0]; *initptr; initptr++)
588 590 (**initptr)();
589 591
590 592 /*
591 593 * These must be called after start_other_cpus
592 594 */
593 595 pm_cfb_setup_intr();
594 596 #if defined(__x86)
595 597 fastboot_post_startup();
596 598 #endif
597 599
598 600 /*
599 601 * Make init process; enter scheduling loop with system process.
600 602 *
601 603 * Note that we manually assign the pids for these processes, for
602 604 * historical reasons. If more pre-assigned pids are needed,
603 605 * FAMOUS_PIDS will have to be updated.
604 606 */
605 607
606 608 /* create init process */
607 609 if (newproc(start_init, NULL, defaultcid, 59, NULL,
608 610 FAMOUS_PID_INIT))
609 611 panic("main: unable to fork init.");
610 612
↓ open down ↓ |
239 lines elided |
↑ open up ↑ |
611 613 /* create pageout daemon */
612 614 if (newproc(pageout, NULL, syscid, maxclsyspri - 1, NULL,
613 615 FAMOUS_PID_PAGEOUT))
614 616 panic("main: unable to fork pageout()");
615 617
616 618 /* create fsflush daemon */
617 619 if (newproc(fsflush, NULL, syscid, minclsyspri, NULL,
618 620 FAMOUS_PID_FSFLUSH))
619 621 panic("main: unable to fork fsflush()");
620 622
623 + /* create interrupt balancer daemon */
624 + if (newproc(intrd, NULL, syscid, minclsyspri, NULL, 0))
625 + panic("main: unable to fork intrd()");
626 +
621 627 /* create cluster process if we're a member of one */
622 628 if (cluster_bootflags & CLUSTER_BOOTED) {
623 629 if (newproc(cluster_wrapper, NULL, syscid, minclsyspri,
624 630 NULL, 0)) {
625 631 panic("main: unable to fork cluster()");
626 632 }
627 633 }
628 634
629 635 /*
630 636 * Create system threads (threads are associated with p0)
631 637 */
632 638
633 639 /* create module uninstall daemon */
634 640 /* BugID 1132273. If swapping over NFS need a bigger stack */
635 641 (void) thread_create(NULL, 0, (void (*)())mod_uninstall_daemon,
636 642 NULL, 0, &p0, TS_RUN, minclsyspri);
637 643
638 644 (void) thread_create(NULL, 0, seg_pasync_thread,
639 645 NULL, 0, &p0, TS_RUN, minclsyspri);
640 646
641 647 pid_setmin();
642 648
643 649 /* system is now ready */
644 650 mutex_exit(&ualock);
645 651
646 652 bcopy("sched", PTOU(curproc)->u_psargs, 6);
647 653 bcopy("sched", PTOU(curproc)->u_comm, 5);
648 654 sched();
649 655 /* NOTREACHED */
650 656 }
↓ open down ↓ |
20 lines elided |
↑ open up ↑ |
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX