Dear MIPS specialists,
I just got the "IRAF" package accepted into Debian [1]. Although the
code is claimed to be portable, it needs a piece of assembler
code for each platform that provides a (sort of) setjmp() to their
Fortran variant.
A "C" implementation for this looks like:
#include <setjmp.h>
int zsvjmp_( long *buf, long *status ) {
*status = 0;
((long **)buf)[0] = status;
return sigsetjmp ((void *)((long **)buf+1),0);
}
however this does not work, since the "sigsetjmp" call needs to be
replaced by a jump to sigsetjmp instead.
For the 32 bit platforms, I asked this already 3 years ago [2], and got
an implementation by David Kuehling:
The "zdojmp" counterpart is a portable C function.
I created a small repository [3] that contains the assembler I collected
so far as well as two test programs.
However, I have no idea how to write the same for the 64-bit platform mips64el. Maybe someone could help me here? Preferably under the IRAF
license [4], so that it can be included upstream later.
I think the attached code will work for all MIPS variants (32-bit and 64-bit). To do this it uses some headers from glibc and therefore needs
to be compiled using "gcc" instead of "as" (arguably userspace apps
should never use "as" directly anyway).
Sysop: | Keyop |
---|---|
Location: | Huddersfield, West Yorkshire, UK |
Users: | 307 |
Nodes: | 16 (2 / 14) |
Uptime: | 96:03:15 |
Calls: | 6,849 |
Files: | 12,352 |
Messages: | 5,414,943 |