AMX Target Guide Computer Accessories User Manual


 
AMX 68000 Target Guide
K
A
DAK
B-15
cjcfstkjmp cjcfstkjmp
Purpose Switch Stacks and Jump to a New Procedure
This procedure is provided for AMX portability.
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 cjcfstkjmp(void *vp, void *stackp,
CJ_VPPROC procp);
Description vp is a pointer which is passed as a parameter to the new procedure.
stackp is a pointer to a properly aligned block of memory for use as a
stack. For the M68000 family, the stack must be 16-bit word aligned.
For some M68000 processors, performance will be improved if the
stack is 32-bit long word aligned.
Stackp must point to the top of the memory block since the processor
stack builds downward by popular convention.
procp is a pointer to the new procedure which is prototyped as follows:
void CJ_CCPP newfunc(void *vp);
For portability using different C compilers, cast your procedure pointer
as (CJ_VPPROC)newfunc in your call to cjcfstkjmp.
Interrupts o Disabled o Enabled o Restored
Returns There is no return from cjcfstkjmp. Use cjcfjset and cjcfjlong if
there is a requirement to return to the original stack.
Restrictions The new procedure referenced by
procp must never return. The
procedure can call cjtkend to end the calling task.
Example See the example provided with
cjcfjset and cjcfjlong.
See Also cjcfjlong, cjcfjset, cjtkend