From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jens Staal To: 9fans@9fans.net Date: Mon, 7 Jan 2013 06:45:42 +0100 Message-ID: <1752877.EVzC7FFEmr@krypton> User-Agent: KMail/4.9.5 (Linux/3.7.1-2-ARCH; KDE/4.9.5; x86_64; ; ) MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" Subject: [9fans] a jmp_buf in APE question Topicbox-Message-UUID: 022debc2-ead8-11e9-9d60-3106f5b1d025 Hi all. Perhaps I have been looking at completely the wrong places and perhaps I am just not grasping it at all. For a package that I want to build under APE, I need to put in the stack pointer (sp) and the program counter (pc) part of jmp_buf specific for Plan9 (since APE does not expose any stack-related functions that could have been used) according to /sys/include/ape/setjmp.h, jmp_buf is an array of 10 int:s. I then went to check out /sys/src/ape/lib/ap/$objtype/setjmp.s but I could not really understand anything in those files luckily, I also looked at the GAS-formatted setjmp.s in the GCC-port of the APE libs. There, it seems that each function with a jmp_buf variable as an argument has a set of 10 rows of operations (which I guess correspond to the 10 values in jmp_buf). Based on that, it would seem that the value for sp is in jmp_buf[2] and for pc in jmp_buf[3]. Am I correct or have I totally misunderstood how these things work? I am a self-taught hobbyist so sometimes really basic stuff can have eluded me. The second question would be, is the position of those two values in jmp_buf architecture-specific so that I should make a note of that it is working on i386 only?