/*
* Copyright (c) 2000-2004 Apple Computer, Inc. All rights reserved.
*
- * @APPLE_LICENSE_HEADER_START@
+ * @APPLE_OSREFERENCE_LICENSE_HEADER_START@
*
- * The contents of this file constitute Original Code as defined in and
- * are subject to the Apple Public Source License Version 1.1 (the
- * "License"). You may not use this file except in compliance with the
- * License. Please obtain a copy of the License at
- * http://www.apple.com/publicsource and read it before using this file.
+ * This file contains Original Code and/or Modifications of Original Code
+ * as defined in and that are subject to the Apple Public Source License
+ * Version 2.0 (the 'License'). You may not use this file except in
+ * compliance with the License. The rights granted to you under the License
+ * may not be used to create, or enable the creation or redistribution of,
+ * unlawful or unlicensed copies of an Apple operating system, or to
+ * circumvent, violate, or enable the circumvention or violation of, any
+ * terms of an Apple operating system software license agreement.
*
- * This Original Code and all software distributed under the License are
- * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER
+ * Please obtain a copy of the License at
+ * http://www.opensource.apple.com/apsl/ and read it before using this file.
+ *
+ * The Original Code and all software distributed under the License are
+ * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
* EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
* INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the
- * License for the specific language governing rights and limitations
- * under the License.
+ * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
+ * Please see the License for the specific language governing rights and
+ * limitations under the License.
*
- * @APPLE_LICENSE_HEADER_END@
+ * @APPLE_OSREFERENCE_LICENSE_HEADER_END@
*/
/*
* Copyright (c) 1982, 1986, 1989, 1991, 1992, 1993
#include <net/init.h>
-#include <machine/exec.h>
-
extern int app_profile; /* on/off switch for pre-heat cache */
char copyright[] =
int hostnamelen;
char domainname[MAXDOMNAMELEN];
int domainnamelen;
-#if __i386__
-struct exec_archhandler exec_archhandler_ppc = {
- .path = "/usr/libexec/oah/translate",
-};
-#else /* __i386__ */
-struct exec_archhandler exec_archhandler_ppc;
-#endif /* __i386__ */
+char classichandler[32] = {0};
+uint32_t classichandler_fsid = -1L;
+long classichandler_fileid = -1L;
char rootdevice[16]; /* hfs device names have at least 9 chars */
semaphore_t execve_semaphore;
int cmask = CMASK;
-extern int customnbuf;
int parse_bsd_args(void);
extern int bsd_hardclockinit;
extern void sysv_msg_lock_init(void);
extern void pshm_lock_init();
extern void psem_lock_init();
-extern int maxprocperuid;
-
-/* kmem access not enabled by default; can be changed with boot-args */
-int setup_kmem = 0;
-
-extern void stackshot_lock_init();
/*
* Initialization code.
extern kauth_cred_t rootcred;
register int i;
int s;
- int error;
thread_t th;
struct vfs_context context;
void lightning_bolt(void );
/* give kernproc a name */
process_name("kernel_task", p);
+
/* allocate proc lock group attribute and group */
proc_lck_grp_attr= lck_grp_attr_alloc_init();
-
+ lck_grp_attr_setstat(proc_lck_grp_attr);
+
proc_lck_grp = lck_grp_alloc_init("proc", proc_lck_grp_attr);
+
/* Allocate proc lock attribute */
proc_lck_attr = lck_attr_alloc_init();
+ //lck_attr_setdebug(proc_lck_attr);
lck_mtx_init(&p->p_mlock, proc_lck_grp, proc_lck_attr);
lck_mtx_init(&p->p_fdmlock, proc_lck_grp, proc_lck_attr);
limit0.pl_rlimit[i].rlim_cur =
limit0.pl_rlimit[i].rlim_max = RLIM_INFINITY;
limit0.pl_rlimit[RLIMIT_NOFILE].rlim_cur = NOFILE;
- limit0.pl_rlimit[RLIMIT_NPROC].rlim_cur = maxprocperuid;
+ limit0.pl_rlimit[RLIMIT_NPROC].rlim_cur = MAXUPRC;
limit0.pl_rlimit[RLIMIT_NPROC].rlim_max = maxproc;
limit0.pl_rlimit[RLIMIT_STACK] = vm_initial_limit_stack;
limit0.pl_rlimit[RLIMIT_DATA] = vm_initial_limit_data;
psem_cache_init();
time_zone_slock_init();
- /* Stack snapshot facility lock */
- stackshot_lock_init();
/*
* Initialize protocols. Block reception of incoming packets
* until everything is ready.
bsd_utaskbootstrap();
-#if __i386__
- // this should be done after the root filesystem is mounted
- error = set_archhandler(p, CPU_TYPE_POWERPC);
- if (error)
- exec_archhandler_ppc.path[0] = 0;
-#endif
-
/* invoke post-root-mount hook */
if (mountroot_post_hook != NULL)
mountroot_post_hook();
ut = (uthread_t)get_bsdthread_info(th_act);
+ ut->uu_ar0 = (void *)get_user_regs(th_act);
bsd_hardclockinit = 1; /* Start bsd hardclock */
bsd_init_task = get_threadtask(th_act);
PE_parse_boot_arg("srv", &srv);
PE_parse_boot_arg("ncl", &ncl);
- if (PE_parse_boot_arg("nbuf", &max_nbuf_headers))
- customnbuf = 1;
- PE_parse_boot_arg("kmem", &setup_kmem);
+ PE_parse_boot_arg("nbuf", &nbuf);
return 0;
}