On Tue, Nov 24, 2009 at 12:36 AM, Mark Cave-Ayland mark.cave-ayland@siriusit.co.uk wrote:
Hi all,
This patch is an attempt at reworking the CIF so that it can be called correctly from both Fcode (Forth) and C. Currently the C arguments are pushed into the stack in reverse order, rather than forward order which is required by Forth words calling the CIF.
In order to fix this, we correct the order in which C arguments are placed on the Forth stack by pushing the parameters in forward order. However, this has the side effect of reversing the order in which the parameters to the CIF Forth words are expected and so these must also be altered to take this into account.
This patch works as expected from Forth Fcode, but I would like to put it out for testing before I commit to the repository. Blue Swirl/Laurent - please can you test on your setups again?
It still breaks both Sparc64 and PPC.
Another interesting effect (Aurora 2.0): [sparc64] Booting file 'cdrom' with parameters '' Not a bootable ELF image Not a Linux kernel image Loading a.out image... Loaded 7680 bytes entry point is 0x4000 Jumping to entry point... switching to new context: entry point 0x4000 stack 0x00000000ffe02a71 Unhandled Exception 0x656e746572000000 PC = 0x00000000ffd0fc78 NPC = 0x00000000ffd0fc7c Stopping execution
The exception value 0x656e746572000000 is bogus, it should be less than 0x200 IIRC. But the exception number, when interpreted as a string, yields 'enter'. Strange.