diff options
author | Igor Pashev <pashev.igor@gmail.com> | 2013-01-27 23:51:56 +0000 |
---|---|---|
committer | Igor Pashev <pashev.igor@gmail.com> | 2013-01-27 23:51:56 +0000 |
commit | 6ab0c0f5bf14ed9c15370407b9ee7e0b4b089ae1 (patch) | |
tree | 926065cf45450116098db664e3c61dced9e1f21a /config/bsd/i386.c | |
download | icon-upstream/9.4.3.tar.gz |
Initial upstream version 9.4.3upstream/9.4.3
Diffstat (limited to 'config/bsd/i386.c')
-rw-r--r-- | config/bsd/i386.c | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/config/bsd/i386.c b/config/bsd/i386.c new file mode 100644 index 0000000..1eecd7c --- /dev/null +++ b/config/bsd/i386.c @@ -0,0 +1,23 @@ +/* + * coswitch for the 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"); + } +} |