process

process control block

define:

typedef struct atmos_pcb
{
    union
    {
        struct
        {
            BITS sp;                  /*  system stack pointer         */
            BITS usp;                /*  user stack pointer           */
        } m68k;

        struct
        {
            BITS regs[16];         /*  26-bit ARM registers         */
        } arm26;

        struct
        {
            BITS regs[16];         /*  32-bit ARM registers         */
            BITS psr;                 /*  PSR register                 */
        } arm32;
    } p;                                 /*  architecture specific        */

    char name[ATMOS_KSTRINGLEN];      /*  process name                 */

    struct atmos_pcb *plink;          /*  static process link          */
    struct atmos_pcb *rlink;          /*  run link                     */

    ATMOS_MSGQUEUE mqueue;            /*  message queue pointer        */
    ATMOS_MESSAGE *specific;              /*  awaiting specific message    */
    BQH qhandle;                                    /*  active queue handler         */
    WORD pri;                                         /*  process priority             */
    BITS state;                                        /*  process state                */

    PTR ustack;                                      /*  user stack base              */
    WORD ustacksize;                            /*  user stack size              */
    BITS ustack_hwm;                           /*  user stack high watermark    */

    PTR sys;                                           /*  system use                   */
    PTR lang;                                         /*  run-time use                 */
    PTR socket_handler;                       /*  socket library use           */
    PTR user;                                        /*  user use                     */
    int *errnop;                                    /*  shared-library errno ptr     */
    struct _iobuf *openlist;                  /*  open file list               */

    VFP epilogue;                                 /*  epilogue routine (or NULL)   */
    int argc;                                         /*  argument count               */
    char *argv[ATMOS_PCB_MAXARGS];    /*  argument pointers            */

    ATMOS_ENV *envptr;                    /*  process/thread environment   */
    ATMOS_THREAD threads;             /*  thread control block chain   */
    ATMOS_THREAD current;             /*  current thread               */
    BITS thread_state;                /*  dying flag                   */
#ifdef SIMULATOR
    void* simulator_id;               /*  id of process within simulator */
    void* scheduler_mutex;            /*  mutex to control scheduling in simulator */
    void* scheduler_condition;        /*  condition variable to control scheduling in simulator */
    int*  scheduler_count;            /*  count for condition variable above */
    ATMOS_MESSAGE *thread_message;    /*  message to be passed by threadswitch */
#endif /* SIMULATOR */
#ifdef HELIUM_FAMILY
    U32 processor_id;
#endif

#ifdef GDB
    void (*gdb)(void *regs);          /* Pointer to a running copy of GDB */
#endif

#ifdef ATMOS_PTIME_SUPPORT
    ATMOS_PTIME_DATA ptime_data;      /* Process timing data */
#endif

}ATMOS_PCB;

ATMOS_MQID = atmos_pcb*

ATMOS_PCBID = atmos_pcb*

ATMOS_THREAD = atmos_pcb*

ATMOS_THREADPCB = atmos_pcb

 

API:

ATMOS_MQID atmos_findqueue( const char *name );

eg. ATMOS_MQID p = atmos_findqueue("im_backend");

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值