- cmpb *16(fp),reiins # returning to an "rei"?
- bneq 1f
- movab 3f,16(fp) # do return w/ psl-pc pop
- brw 2f
-1:
- movab 4f,16(fp) # do standard return
-2:
- ret # unwind stack before signals enabled
+
+#ifndef NOCOMPAT
+/*
+ * This code checks to see if it can use the new sigreturn.
+ * If it finds that sigtramp is using the new system call,
+ * it will also use it. Otherwise it uses the old system call
+ * to preserve compatibility.
+ */
+#include <vax/machparam.h>
+#define U (0x80000000-UPAGES*NBPG)
+#define PCB_SIGC 0x6c
+#define CHMKINS 7
+ cmpl 3f,U+PCB_SIGC+CHMKINS # check to see how sigtramp returns
+ beql 4f # sigtramp uses the new system call
+ pushl r1 # must use the old signal return
+ chmk $139 # restore previous context
+ jmp *20(r1) # done, return