📄 procdef.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. * *---------------------------------------------------------------------- *//* * procdef.h * * Definitions related to process (program) loading */#ifndef __SYS_PROCDEF_H__#define __SYS_PROCDEF_H__#include <sys/elf.h>#include <sys/pinfo.h>#include <extension/sys/segment.h>#ifdef __cplusplusextern "C" {#endif/* * Loading mode * ( LDMD_USR || LDMD_SYS ) | [LDMD_DYN] * * Use LDMD_SYS for loading system program */#define LDMD_USR 0 /* Load user process */#define LDMD_SYS 1 /* Load system process */#define LDMD_DYN 2 /* Dynamic loading *//* * User stack size */IMPORT W DefaultStackSize; /* Default size *//* * Header section of object file */typedef union { Elf32_Ehdr elf; Bz_HDR bz;} OBJ_HDR;/* * Compressed object load information */typedef struct { UB *recBuf; /* Decompressed record data */ W recLen; /* Length of decompressed record (number of bytes) */ UH recSubType; /* Subtype of decompressed record */} BzRead;/* * Dynamic loading management information */typedef struct { QUEUE q; /* Queue for management information connection */ W fd; /* File descriptor */ W fdtype; /* File type */ ID mid[N_LDMID]; /* Disk map ID */ VP topadr; /* Start address */ UW dpage; /* Number of disk map pages */ UW mpage; /* Number of memory map pages */ TC name[L_FNM]; /* Name */} DYNLD;#define DynLoadID(dynld) ( (UW)dynld >> 2 )typedef struct prcminfo PRCMINFO;/* space.c */IMPORT UW GetLSID_pinfo( PINFO *pinfo );IMPORT VP GetUATB_lsid( UW lsid );IMPORT T_TSKSPC GetTSKSPC_pinfo( PINFO *pinfo );IMPORT T_TSKSPC GetTSKSPC_lsid( UW lsid );IMPORT ER ChangeLogicalSpace( T_TSKSPC *curspc, T_TSKSPC chgspc );/* memmgr.c */IMPORT ER InitLocalMemory( PINFO *pinfo );IMPORT ER GetLocalMemoryUseCount( PINFO *pinfo );/* procmap.c */IMPORT W DefaultStackSize;IMPORT ER ReadProgFile( POBJ_HDR *pohdr, W ofs, VB *adr, W sz, BzRead *bzr );IMPORT ER MapProc( PINFO *pinfo, POBJ_HDR *pohdr, FP *entry );IMPORT ER UnmapProc( PINFO *pinfo );IMPORT ER MapStack( PINFO *pinfo, W stksz, VP *laddr );IMPORT ER UnmapStack( PINFO *pinfo, VP laddr );IMPORT ER LoadModule( POBJ_HDR *pohdr, P_DYNLDINF *info, PINFO *pinfo );IMPORT ER UnloadModule( W loadid, PINFO *pinfo );IMPORT void UnloadAllModule( PRCMINFO *pmi, W pid );IMPORT W ChkSysProgMap( ID did );IMPORT ER LoadSysProg( POBJ_HDR *pohdr, TC *arg, VP loadadr[] );IMPORT ER UnloadSysProg( W progid );IMPORT ER FinishAllSysProgs( void );IMPORT ER InitProcMap( void );IMPORT void DumpSysProg( void );IMPORT void DumpDynLoad( W pid );/* ldelf.c */IMPORT ER DirectLoad_elf( LDINFO *li, UW lsid, UW ldmode, Elf32_Ehdr *hdr, FP *entry, BzRead *bzr );IMPORT ER DemandLoad_elf( LDINFO *li, UW lsid, UW ldmode, Elf32_Ehdr *hdr, ID did, PhyBlk *pb, FP *entry, BzRead *bzr );#ifdef __cplusplus}#endif#endif
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -