📄 pinfo.h
字号:
/* *---------------------------------------------------------------------- * T-Kernel / Standard Extension * * Copyright (C) 2006 by Ken Sakamura. All rights reserved. * T-Kernel / Standard Extension is distributed * under the T-License for T-Kernel / Standard Extension. *---------------------------------------------------------------------- * * Version: 1.00.00 * Released by T-Engine Forum(http://www.t-engine.org) at 2006/8/11. * *---------------------------------------------------------------------- *//* * pinfo.h * * Process management information */#ifndef __SYS_PINFO_H__#define __SYS_PINFO_H__#include <basic.h>#include <extension/extension.h>#include <sys/queue.h>#ifdef __cplusplusextern "C" {#endif#define PNAME_SZ 20 /* Length of process name (file name) */#ifndef __pinfo__typedef struct pinfo PINFO;#define __pinfo__#endif/* * User information */typedef struct { P_USER user; /* User information */ DA_MODE mode; /* Default access mode */} UINFO;/* * File management information */typedef struct { QUEUE q; /* Link for reference */ LINK workFile; /* Work file */ QUEUE fdList; /* Link to file descriptor */} FINFO;/* * Executable file information */typedef struct _pobj_hdr { W type; /* File type */ W desc; /* File descriptor */ union { LINK *lnk; /* Link (TPA_LINK) */ B* path; /* File path (TPA_SEIO) */ VP buf; /* Executable image address (TPA_PTR) */ } src;} POBJ_HDR;typedef struct { T_CPRC cprc; INT hdrsize;} CINFO;/* * Loading file information */#if VIRTUAL_ADDRESS#define N_LDMID 2 /* Maximum number of disk maps for loading */typedef struct { LINK lnk; /* Link to loading file */ POBJ_HDR pohdr; /* Executable file information */ ID mid[N_LDMID]; /* Executable file map ID */ VP topadr; /* Program start address */ UW dpage; /* Number of disk map pages */ UW mpage; /* Number of memory map pages */ UW stacksz; /* Stack size (number of bytes) */} LDINFO;#elsetypedef struct { UH loadno; /* Loading number */ UH atr[5]; /* Loading file (LINK) attribute information */ VP dataadr; /* Data area start address */} LDINFO;#endif/* * Task management information */typedef struct { /* Task-dependent information */ ID tskid; /* Task ID within process */ UW msg_waimask; /* Message wait mask */#if VIRTUAL_ADDRESS VP stack_addr; /* Stack area start address */#endif} TSK_INFO;/* * Process management information (PINFO) */struct pinfo { QUEUE q; /* Process information queue */ ID procid; /* Process ID */ ID resid; /* T-Kernel resource ID */ PINFO *parent; /* Parent process pointer */ TC name[PNAME_SZ]; /* Process name */ UINFO *user; /* User management information */ UW sysproc:1; /* System process */ /* Information up to here can be accessed by managers in general. Accordingly, changes to the information may affect all managers. */ UW dbgmode:1; /* Specify debugger process mode */ UW rsv1:6; /* Reserved (0) */ UW exitkind:8; /* Termination type */ UW nchild:16; /* Number of child process */ W exitcode; /* Termination code */ VP fexchdr; /* Process forced exception handler */ UW ctime; /* Process generation time */ QUEUE msg_top; /* Message queue */ UW msg_ignmask; /* Handler mask (MH_NONE) */ UW msg_mhmask; /* Handler mask (except for MH_NONE) */ FINFO file; /* File management information */ UW consinf; /* Console information */ UW emg_cnt; /* Number of requests for termination notification */ VP emg_lst; /* Destination list of termination notification */ LDINFO ldinfo; /* Loading file information */ CINFO cinfo; /* Create process infomaion(tkse_cre_prc) */#if VIRTUAL_ADDRESS VP lpgtbl; /* Local memory management table */ VP lmemgrp; /* Local memory group */ VP smemgrp; /* System memory group */ UH allocpage; /* Number of allocated pages */ UH poutcount; /* Number of page-outs */#else VP memgrp; /* Memory group (memmgr) */ UH heappg; /* Number of pages in heap area */#endif TSK_INFO tsk[1]; /* Task information (number of subtasks in reality) */};#define PINFO_BASE_SZ ( sizeof(PINFO) - sizeof(TSK_INFO) )#define PINFO_SZ(ntsk) ( PINFO_BASE_SZ + (sizeof(TSK_INFO) * (ntsk)) )#define PRCTSK_EXINF ((VP)-1) /* Show tasks included in process */#ifdef __cplusplus}#endif#endif /* __SYS_PINFO_H__ */
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -