📄 pg_drvenv.h
字号:
///////////////////////////////////////////////////////////////
//
//
// PGOS : A Portable,Configable Embedded System Kernel
//
// Intel X86 Specific Code
//
// This is an open source project under GPL lincence
//
// Version 0.9.0 ---- Development Snopshot
//
// For Technology Support,please mail xcxin@sec.ac.cn
//
// File name : pg_task.c : Driver Executions Definition
// History :
//
// 2005-08-03 First build by X.K. @ PGOS Team
//
/////////////////////////////////////////////////////////////////
#ifndef PG_DRV_H
#define PG_DRV_H
#if PG_DRV_SUPPORT == 1
#define MAX_DRIVERS 100
////////////////////////////////////
// Driver Types Definitions
//
////////////////////////////////////
#define SERVICE_DRV 0x01
#define CALLBACK_DRV 0x02
#define HARDWARE_DRV 0x04
#define NORMAL_DRV 0x03
#define FULL_DRV 0x07
#define DRV_RESERVED 0xFF
////////////////////////////////////
// Driver Entry Point
//
////////////////////////////////////
typedef void ( *ServiceEntry )( ) ;
typedef void ( *CallBackEntry )( void* info ) ;
typedef void ( *HardwareEntry )( ) ;
typedef union
{
ServiceEntry ServiceDriver ;
CallBackEntry CallBackDriver ;
HardwareEntry HardwareDriver ;
void ( *Raw )( ) ;
}DRIVER_ENTRY ;
////////////////////////////////////
// Call Back Function Types
//
////////////////////////////////////
typedef void ( *CALLBACK )( void* info ) ;
////////////////////////////////////
// Driver Installed Status
//
////////////////////////////////////
#define DRV_NOT_INSTALL 0
#define DRV_INSTALL 1
////////////////////////////////////
// Driver Module
//
////////////////////////////////////
typedef struct _driver_module
{
#if PG_DRV_NAME_SUPPORT == 1
BYTE DrvName[32] ;
#endif
BYTE DrvTypes ;
BYTE DrvID ;
BYTE CbkType ;
void* info ;
DRIVER_ENTRY EntryPoint ;
}DRIVER ;
////////////////////////////////////
// System Core Driver List
//
////////////////////////////////////
typedef struct _sys_drv
{
DRIVER *drv ;
struct _sys_drv* next ;
}SYS_DRV_LIST ;
////////////////////////////////////
// CALL BACK Types
//
////////////////////////////////////
#define TIME_BASED 0x01
#define TASK_CREATE 0x02
#define TASK_REMOVE 0x04
#define TASK_SCH 0x10
#define KERNEL 0x20
#define MSG_SEND 0x40
#define MSG_RECV 0x80
#define FULL_TYPE 0xFF
////////////////////////////////////
// Driver call env
//
////////////////////////////////////
#define SYS_KERNEL 0x01
#define SYS_INT 0x02
#define SYS_TK_C 0x04
#define SYS_TK_R 0x08
#define SYS_TK_SW 0x10
#define SYS_TIMER 0x20
#define SYS_MSG_S 0x40
#define SYS_MSG_R 0x80
////////////////////////////////////
// Driver API
//
////////////////////////////////////
PGOS_STATUS pgos_drv_initalize( void ) ;
PGOS_STATUS pgos_drv_install( DRIVER_ENTRY Entry, BYTE DrvType, BYTE* DrvID, BYTE* CbkType ) ;
PGOS_STATUS pgos_drv_remove( BYTE DrvID ) ;
void pgos_call_drv( BYTE CallEnv, void* info ) ;
#if PG_DRV_NAME_SUPPORT == 1
PGOS_STATUS pgos_drv_getname( BYTE DrvID, BYTE* buffer ) ;
PGOS_STATUS pgos_drv_setname( BYTE DrvID, const BYTE* Name, BYTE namelen ) ;
#endif
#endif
#endif
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -