AMX 68000 Target Guide
K
A
DAK
B-11
cjcfjlong cjcfjlongcjcfjset cjcfjset
Purpose cjcfjset Sets a Mark for a Long Jump
cjcfjlong 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 ISP o Timer Procedure o Restart Procedure n Exit Procedure
Setup Prototype is in file
CJZZZTF.H.
#include "CJZZZ.H"
void CJ_CCPP cjcfjlong(struct cjxjbuf *jbuf, int value);
int CJ_CCPP cjcfjset(struct cjxjbuf *jbuf);
Description jbuf is a pointer to a jump buffer to be used to mark the processor state at
the time cjcfjset is called and to restore that state when cjcfjlong is
subsequently called.
The processor dependent structure cjxjbuf is defined in file
CJZZZCC.H.
value is an integer value to be returned to the cjcfjset caller when
cjcfjlong initiates the long jump return. Value cannot be 0. If value
=0
, cjcfjlong will replace it with value = 1.
Interrupts o Disabled o Enabled o Restored
Returns Cjcfjset returns 0 when initially called to establish the mark. Cjcfjset
returns value (non 0) when cjcfjlong is called to do the long jump to the
mark established by the initial cjcfjset call.
There is no return from cjcfjlong.
Restrictions Cjcfjset must be called prior to any call to cjcfjlong. Each call must
reference the same jump buffer. The jump buffer must remain unaltered
between the initial cjcfjset call and the subsequent cjcfjlong long
jump return.
Under no circumstances should one task attempt a long jump using a jump
buffer set by another task.