summaryrefslogtreecommitdiffstats
path: root/sys/ia64/ia64/critical.c
diff options
context:
space:
mode:
Diffstat (limited to 'sys/ia64/ia64/critical.c')
-rw-r--r--sys/ia64/ia64/critical.c58
1 files changed, 58 insertions, 0 deletions
diff --git a/sys/ia64/ia64/critical.c b/sys/ia64/ia64/critical.c
new file mode 100644
index 0000000..77a6c83
--- /dev/null
+++ b/sys/ia64/ia64/critical.c
@@ -0,0 +1,58 @@
+/*-
+ * Copyright (c) 2001 Matthew Dillon. This code is distributed under
+ * the BSD copyright, /usr/src/COPYRIGHT.
+ *
+ * $FreeBSD$
+ */
+
+#include <sys/param.h>
+#include <sys/systm.h>
+#include <sys/pcpu.h>
+#include <sys/eventhandler.h> /* XX */
+#include <sys/ktr.h> /* XX */
+#include <sys/signalvar.h>
+#include <sys/sysproto.h> /* XX */
+#include <sys/kernel.h>
+#include <sys/proc.h>
+#include <sys/lock.h>
+#include <sys/mutex.h>
+#include <sys/sysctl.h>
+#include <sys/ucontext.h>
+
+void
+cpu_critical_enter(void)
+{
+ struct thread *td = curthread;
+
+ td->td_md.md_savecrit = intr_disable();
+}
+
+void
+cpu_critical_exit(void)
+{
+ struct thread *td = curthread;
+
+ intr_restore(td->td_md.md_savecrit);
+}
+
+/*
+ * cpu_critical_fork_exit() - cleanup after fork
+ */
+void
+cpu_critical_fork_exit(void)
+{
+ struct thread *td = curthread;
+
+ td->td_critnest = 1;
+ td->td_md.md_savecrit = (ia64_get_psr() | IA64_PSR_I);
+}
+
+/*
+ * cpu_thread_link() - thread linkup, initialize machine-dependant fields
+ */
+void
+cpu_thread_link(struct thread *td)
+{
+ td->td_md.md_savecrit = 0;
+}
+
OpenPOWER on IntegriCloud