1 /*-
2 * Copyright (c) 2001 Matthew Dillon. This code is distributed under
3 * the BSD copyright, /usr/src/COPYRIGHT.
4 *
5 * $FreeBSD: releng/5.0/sys/powerpc/powerpc/critical.c 93607 2002-04-01 23:51:23Z dillon $
6 */
7
8 #include <sys/param.h>
9 #include <sys/systm.h>
10 #include <sys/pcpu.h>
11 #include <sys/eventhandler.h> /* XX */
12 #include <sys/ktr.h> /* XX */
13 #include <sys/signalvar.h>
14 #include <sys/sysproto.h> /* XX */
15 #include <sys/kernel.h>
16 #include <sys/proc.h>
17 #include <sys/lock.h>
18 #include <sys/mutex.h>
19 #include <sys/sysctl.h>
20 #include <sys/ucontext.h>
21
22 /*
23 * cpu_critical_fork_exit() - cleanup after fork
24 */
25 void
26 cpu_critical_fork_exit(void)
27 {
28 struct thread *td = curthread;
29
30 td->td_critnest = 1;
31 td->td_md.md_savecrit = (mfmsr() | PSL_EE | PSL_RI);
32 }
33
34 /*
35 * cpu_thread_link() - thread linkup, initialize machine-dependant fields
36 */
37 void
38 cpu_thread_link(struct thread *td)
39 {
40 td->td_md.md_savecrit = 0;
41 }
42
Cache object: 9450e6ff54bd0d7ab511e0f9d0acf3a7
|