summaryrefslogtreecommitdiff
path: root/lang/icon/patches/patch-af
blob: 16ef09a563826ac5ee7bdbb929b40e985ec038c1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
$NetBSD: patch-af,v 1.6 2001/06/25 19:28:42 jtb Exp $

--- /dev/null	Sat Jun 23 16:44:55 2001
+++ config/unix/netbsd/rswitch.c.i386
@@ -0,0 +1,28 @@
+/*
+ * This is the co-expression context switch for the Intel 80386
+ * under Microport Unix System V/386
+ */
+
+/*
+ * coswitch
+ */
+
+coswitch(old_cs, new_cs, first)
+int *old_cs, *new_cs;
+int first;
+   {
+   asm("  movl 8(%ebp),%eax");
+   asm("  movl %esp,0(%eax)");
+   asm("  movl %ebp,4(%eax)");
+   asm("  movl 12(%ebp),%eax");
+   if (first == 0) {		/* this is the first activation */
+      asm("  movl 0(%eax),%esp");
+      asm("  movl $0,%ebp");
+      new_context(0, 0);
+      syserr("interp() returned in coswitch");
+      }
+   else {
+      asm("  movl 0(%eax),%esp");
+      asm("  movl 4(%eax),%ebp");
+      }
+   }