Discussion:
Help needed: Porting IRAF to s390
(too old to reply)
Ole Streicher
2014-05-05 09:00:02 UTC
Permalink
Hi,

since a while, I am working to bring the IRAF package [1] into Debian
[2]. I'd like to make the package working on as many Debian platforms as
possible.

The major problem here is that IRAF needs a small piece of assembler
code 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.

As example, I show here the assembler for x86-64 (from the IRAF sources):

.globl zsvjmp_
.type zsvjmp_, @function
zsvjmp_:
movq %rsi, (%rdi) # store &status in jmpbuf[0]
movl $0, (%rsi) # zero the value of status
addq $8, %rdi # change point to &jmpbuf[1]
movl $0, %esi # change arg2 to zero
jmp __sigsetjmp # let sigsetjmp do the rest
.section .note.GNU-stack,"",@progbits

The "zdojmp" counterpart is a portable C function.

I created a small tar file that contains the assembler I collected so
far as well as two test programs. The function of the Fortran test
program is still not so important since IRAF uses its own Fortran
calling interface.

Since I have no experience with s390 machines and no glue at all for
their assembler and the (C) calling conventions: could someone help me here?

Best regards

Ole

[1] http://http://iraf.noao.edu/
[2] http://bugs.debian.org/690531
Michael Holzheu
2014-05-05 15:10:02 UTC
Permalink
Hello Ole,

On Mon, 05 May 2014 10:52:16 +0200
Ole Streicher <debian-***@liska.ath.cx> wrote:

[snip]
Post by Ole Streicher
Since I have no experience with s390 machines and no glue at all for
their assembler and the (C) calling conventions: could someone help me here?
The s390(x) calling convention is that function parameters are passed in registers
R2-R6. Register 2 is used for the return code.

See "Function calling sequence" in the s390x (64 bit) ABI:

ftp://legacy.redhat.com/pub/redhat/linux/7.1/es/os/s390x/doc/lzsabi0.pdf

Here is the s390 (31 bit) ABI:

http://archive.download.redhat.com/pub/redhat/linux/7.2/de/os/s390/doc/l390abi0.pdf

Best Regards,
Michael
--
To UNSUBSCRIBE, email to debian-s390-***@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact ***@lists.debian.org
Archive: https://lists.debian.org/***@holzheu
Loading...