AMX 86 Procedures
K
A
DAK
217
ajcfjlong ajcfjlongajcfjset ajcfjsetPurpose ajcfjset Sets a Mark for a Long Jump
ajcfjlong Long Jumps to that Mark
These procedures are provided for AMX portability. They are not
replacements for C library procedures longjmp or setjmp although they
function in a similar manner.
Used by n Task o IS P o Timer Procedure o Restart Procedure n Exit Procedure
Setup Prototype is in file
AMX831CF.H.
#include "AMX831CF.H"
void cdecl ajcfjlong(struct ajxjbuf *jbuf, int value);
int cdecl ajcfjset(struct ajxjbuf *jbuf);
Where jbuf is a pointer to a jump buffer to be used to mark the processor state at
the time ajcfjset is called and to restore that state when ajcfjlong is
subsequently called.
The processor dependent structure ajxjbuf is defined in file
AMX831SD.H.
value is an integer value to be returned to the ajcfjset caller when
ajcfjlong initiates the long jump return. Value cannot be 0. If value
=0
, ajcfjlong will replace it with value = 1.
Returns Ajcfjset returns 0 when initially called to establish the mark. Ajcfjset
returns value (non 0) when ajcfjlong is called to do the long jump to the
mark established by the initial ajcfjset call.
There is no return from ajcfjlong.
Interrupts are not touched by ajcfjset or ajcfjlong.
Restrictions Ajcfjset must be called prior to any call to ajcfjlong. Each call must
reference the same jump buffer. The jump buffer must remain unaltered
between the initial ajcfjset call and the subsequent ajcfjlong long
jump return.
Under no circumstances should one task attempt a long jump using a jump
buffer set by another task.