pkgsrc/lang/icon/patches/patch-af
jtb 5119cf88dc * Fix mistake in location of powerpc.s
* new_context() instead of interp() in error message on i386
2003-06-29 23:06:47 +00:00

28 lines
615 B
Text

$NetBSD: patch-af,v 1.10 2003/06/29 23:06:47 jtb Exp $
--- /dev/null
+++ config/netbsd/i386.c
@@ -0,0 +1,23 @@
+/*
+ * coswitch for i386 architecture
+ */
+
+int
+coswitch (int *old_cs, int *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 ("new_context() returned in coswitch");
+ }
+ else {
+ asm ("movl 0(%eax),%esp");
+ asm ("movl 4(%eax),%ebp");
+ }
+}