📄 psos.h
字号:
/************************************************************************//* rn_info() call returns the following information for a given *//* region object. *//************************************************************************/struct rninfo { UCHAR name[4]; /* Name of the region */ ULONG flags; /* Region attributes */ ULONG wqlen; /* No. of waiting tasks */ ULONG wtid; /* Object ID of the first waiting task */ void *start_addr; /* Start address */ ULONG unit_size; /* Size of each unit */ ULONG total_units; /* Total units in the region */ ULONG free_bytes; /* Bytes free in the region */ ULONG largest; /* size of largest chunk in bytes */ ULONG length; /* Total length of region in bytes */ };typedef struct rninfo prninfo_t;/************************************************************************//* sm_info() call returns the following information for a given *//* semaphore object. *//************************************************************************/struct sminfo { UCHAR name[4]; /* Semaphore name */ ULONG flags; /* Semaphore attributes */ ULONG wqlen; /* No. of waiting tasks */ ULONG wtid; /* Object ID of the first waiting task */ ULONG count; /* Semaphore count */ ULONG maxcount; /* Limit for bounded semaphores */ ULONG tid_ntfy; /* Task to notify of sema4 availability */ ULONG ev_ntfy; /* Event to post on sema4 availability */ };typedef struct sminfo psminfo_t;/************************************************************************//* t_info() call returns the following information for a given *//* task object. *//************************************************************************/struct tinfo { UCHAR name[4]; /* Task name */ ULONG flags; /* Task attributes */ void (*iip)(); /* Task's initial starting address */ ULONG next; /* ID of the next waiting task */ USHORT status; /* Task status */ UCHAR cpriority; /* Task's current priority */ UCHAR bpriority; /* Task's base priority */ UCHAR ipriority; /* Task's initial priority */ UCHAR evwantcond; /* Task's event wait condition */ USHORT amode; /* Task's ASR mode */ USHORT mode; /* Task's current mode */ USHORT imode; /* Task's initial mode */ ULONG tslice_quantum; /* Per task's time slice in ticks */ long tslice_remain; /* Remainder time slice in ticks */ ULONG wtobid; /* Object where task is blocked */ ULONG evwait; /* Events - task waiting for */ ULONG evcaught; /* Events caught */ ULONG evrcvd; /* Events received */ ULONG ss_size; /* Supervisory stack size */ ULONG us_size; /* User stack size */ ULONG *ssp; /* Task's current supervisor stack ptr */ ULONG *issp; /* Task's initial supervisor stack ptr */ ULONG *usp; /* Task's current user stack pointer */ ULONG *iusp; /* Task's initial user stack pointer */ ULONG imask; /* Task's Interrupt priority level */ void (*asr_addr)(); /* Task's ASR address */ ULONG signal; /* Asynchronous signal pending */ ULONG xdate; /* Timer expiry date */ ULONG xtime; /* Time expiry time */ ULONG xticks; /* Timer expiry ticks */ ULONG nrnunits; /* No. of region units wanted */ void **tsdp; /* Task-specific-Data pointer */ ULONG evasr_ntfy; /* Events used for ASR notification */ ULONG co_toproc; /* Callouts to process (pending) */ ULONG co_inprog; /* Callouts in progress */ };typedef struct tinfo ptinfo_t;/*----------------------------------------------------------------------*//* BIT MASKS FOR tinfo.status *//*----------------------------------------------------------------------*/#define TS_DEBUG 0x8000 /* The task has been blocked by */ /* debugger */#define TS_SUSP 0x4000 /* The task has been suspended via a */ /* t_suspend() call */#define TS_TIMING 0x1000 /* The task is in a timeout queue, */ /* either absolute or relative */#define TS_PAUSE 0x0800 /* Task is in the timeout queue */ /* specifically as a result of */ /* tm_wkafter or tm_wkwhen call */#define TS_ABSTIME 0x0400 /* Timed for absolute time */#define TS_VWAIT 0x0200 /* task is Waiting for events */#define TS_SPAWN 0x0100 /* task is waiting to be started. */ /* t_create() sets, t_start() resets */#define TS_SWAIT 0x0080 /* Task is Waiting for semaphore */#define TS_MWAIT 0x0040 /* Task is Waiting for region memory */#define TS_QWAIT 0x0020 /* Task is Waiting for message */#define TS_RWAIT 0x0010 /* Task is Waiting for reply packet */ /* from a remote node */#define TS_MUWAIT 0x0008 /* Task is Waiting for mutex */#define TS_CVWAIT 0x0004 /* Task is Waiting for condition */ /* variable */#define TS_CWAIT 0x0001 /* Task has been blocked by a */ /* componet (pNA+, pHile etc) while */ /* waiting for an internal resource */#define TS_READY 0x0000 /* Task is either currently running */ /* or in runnable state */struct qvinfo { UCHAR name[4]; /* Name of the queue */ ULONG flags; /* Queue attributes */ ULONG wqlen; /* No. of waiting tasks */ ULONG wtid; /* Object ID of the first waiting task */ ULONG mqlen; /* No. of messages in the queue */ ULONG mqmax; /* Max. no. of messages allowed */ ULONG tid_ntfy; /* Task to notify of message arrival */ ULONG ev_ntfy; /* Event to post on message arrival */ ULONG maxlen; /* Max. message length allowed */ };typedef struct qvinfo pqvinfo_t;/************************************************************************//* tsd_info() call returns the following information for a given *//* TSD object. *//************************************************************************/ struct tsdinfo { UCHAR name[4]; /* Name of the Task-specific Data entry */ ULONG flags; /* TSD attributes */ ULONG size; /* Default size of TSD data area */ ULONG obid; /* Object ID of the TSD object */ }; typedef struct tsdinfo ptsdinfo_t; /************************************************************************//* ob_roster() call returns an array of structures of the following *//* type, for a roster of pSOS+ objects. *//************************************************************************/ struct psos_obj_entry { UCHAR name[4]; /* Name of the object */ ULONG id; /* ID of the pSOS+ object */ ULONG type; /* Type of the pSOS+ object */ }; typedef struct psos_obj_entry ppsos_obj_entry_t; /*----------------------------------------------------------------------*//* DEFINITIONS FOR PSOS OBJECT TYPES *//*----------------------------------------------------------------------*/#define OT_UNUSED 0 /* UNUSED */#define OT_ALL 0 /* ALL OBJECTS */#define OT_TASK 1 /* TASK*/#define OT_QUEUE 2 /* QUEUE*/#define OT_SEM 3 /* SEMAPHORE*/#define OT_REGION 4 /* REGION*/#define OT_PART 5 /* PARTITION*/#define OT_MUTEX 6 /* MUTEX */#define OT_CVAR 7 /* CONDITION VARIABLE */#define OT_TSD 8 /* TASK-SPECIFIC DATA CB *//*----------------------------------------------------------------------*//* The following object type will be returned by the type field in the *//* object information structure(s) returned by ob_roster(), if the *//* the pSOS+ object is a variable-length message queue. Note, however *//* that it cannot be passed as an input type argument to the call. *//*----------------------------------------------------------------------*/#define OT_VQUEUE 9 /* VARIABLE-LENGTH MESSAGE QUEUE */ /************************************************************************//* sys_info() call returns a combination of data for various keys *//************************************************************************//*----------------------------------------------------------------------*//* DEFINITIONS FOR INPUT KEY TO SYS_INFO() *//*----------------------------------------------------------------------*/#define PSOS_VERSION 0#define PSOS_ROSTER 1#define PSOS_IOJT 2#define PSOS_DNT 3#define PSOS_CALLOUT 4 /*----------------------------------------------------------------------*//* sys_info() call returns node roster as an array of structures of the *//* following type. *//*----------------------------------------------------------------------*/struct psos_node_entry { USHORT nodenum; /* Node number */ USHORT seqnum; /* Sequence number of node */ }; typedef struct psos_node_entry ppsos_node_entry_t; /*----------------------------------------------------------------------*//* sys_info() call returns the run-time pSOS+ IO jump table as an array *//* of structures of the following type. *//*----------------------------------------------------------------------*/struct psos_iojt_entry { IOJENT iojte; /* IOJT entry information */ ULONG devnum; /* Device number of IOJT entry */ }; typedef struct psos_iojt_entry ppsos_iojt_entry_t; /*----------------------------------------------------------------------*//* sys_info() call returns the run-time pSOS+ Device Name Table as an *//* array of structures of the following type. For device name, a str of *//* length, (kd_dnlen+1) rounded to nearest long-word size, is returned. *//*----------------------------------------------------------------------*/struct psos_dnt_entry { ULONG devnum; /* Major-minor device number */ char devname[1]; /* Null terminated device name string */ }; typedef struct psos_dnt_entry ppsos_dnt_entry_t; /*----------------------------------------------------------------------*//* sys_info() call returns pSOS+ callout(CO) information as an array *//* of structures of the following type. *//*----------------------------------------------------------------------*/struct psos_co_entry { ULONG coid; /* Unique ID of this CO */ ULONG type; /* Type of this CO */ void (*func ) (void *, CO_INFO *); /* Ptr to CO function */ void *arg; /* Argument to CO function */ }; typedef struct psos_co_entry ppsos_co_entry_t;/*----------------------------------------------------------------------*//* Function prototypes for Query Services *//*----------------------------------------------------------------------*/ULONG QueryLibRegister(void);ULONG QueryLibUnregister(void); ULONG pt_info (ULONG ptid, struct ptinfo *buf);ULONG q_info(ULONG qid, struct qinfo *buf);ULONG q_vinfo(ULONG qvid, struct qvinfo *buf);ULONG rn_info(ULONG rnid, struct rninfo *buf);ULONG sm_info(ULONG smid, struct sminfo *buf);ULONG t_info(ULONG tid, struct tinfo *buf);ULONG cv_info(ULONG cvid, struct cvinfo *buf);ULONG mu_info(ULONG muid, struct muinfo *buf);ULONG tsd_info(ULONG tsdid, struct tsdinfo *buf); ULONG ob_roster(ULONG otype, void *buf, ULONG buflen, ULONG *actlen);ULONG sys_info(ULONG key, void *buf, ULONG buflen, ULONG *actlen);#ifdef __cplusplus}#endif#endif /* _PSOS_H */
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -