366
K
A
DAK
Structure/Constant Definitions
AMX Task Status Block Structure
struct amxsbs {
AMXID amsbtid; /* task id */
char amsbtag1; /* task tag */
char amsbtag2;
char amsbtag3;
char amsbtag4;
unsigned long amsbst; /* task status */
unsigned long amsbsig; /* pending signals */
long amsbtmr; /* task timer (time remaining)*/
unsigned short int amsbslc; /* time slice */
unsigned short int amsbcc; /* call count */
unsigned short int amsbatr; /* task attributes */
AMXID amsbctid; /* caller's task id */
/* (-1=ISP; 0=AATRIG) */
short int amsbcwat; /* caller waiting if <> 0 */
short int amsbpry; /* task priority */
unsigned short int amsbmc0; /* message count; mailbox 0 */
unsigned short int amsbmc1; /* message count; mailbox 1 */
unsigned short int amsbmc2; /* message count; mailbox 2 */
unsigned short int amsbmc3; /* message count; mailbox 3 */
};
Task Status Masks (fields amsbst, amsbsig)
#define AMSBWTMR 0x01 /* timer wait */
/* (used with other bits) */
#define AMSBWTRG 0x02 /* trigger wait (i.e. idle) */
#define AMSBWSEM 0x04 /* semaphore wait */
#define AMSBWEVT 0x08 /* event group wait */
#define AMSBWXCH 0x10 /* message exchange wait */
#define AMSBWSND 0x20 /* message send wait */
#define AMSBWSUS 0x40 /* suspended */
/* (waiting for resume) */
#define AMSBWWAT 0x80 /* waiting for wake */
#define AMSBWSIG 0x7FFF0000L /* 15 task signal waits */
#define AMSBWORW 0x80000000L /* OR-wait on AMSBWSIG bits */
Critical Function Codes (passed to Task Termination Procedure)
#define AMCFE 1 /* ajtkstp() - stop (end) task*/
#define AMCFK 2 /* ajtkill() - kill task */
#define AMCFD 3 /* ajtkdel() - delete task */