⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 pcidp.asm

📁 一个amccs5933芯片的驱动程序开发源程序和部分文档
💻 ASM
📖 第 1 页 / 共 2 页
字号:
;******************************************************************************
; THIS CODE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED 
; OR IMPLIED. THIS CODE IS LABELED "OPEN SOFTWARE" AND MAY BE FREELY USED, 
; REPRODUCED, MODIFIED, AND/OR REDISTRIBUTED WITH THE STIPULATION THAT THIS 
; NOTICE REMAIN INTACT. REDISTRIBUTION OF ANY KIND IMPLIES THAT ALL
; MODIFICATIONS FALL UNDER THIS "OPEN SOFTWARE" LABEL.
;
; Copyright (C) 2000, Foxen Solutions
; Copyright (C) 2000, FXN
;
; All Rights Reserved.
;******************************************************************************
PAGE 58,132
;******************************************************************************
TITLE PCIDP.ASM -
;******************************************************************************
;
;   Title:      PCIDP.asm - Virtual PCI-DP Device Driver
;
;   Version:    1.00
;
;   Date:       Oct 2000
;
;   Author:     
;
;		Note:				Best viewed with TABs set to 2.
;------------------------------------------------------------------------------
;
;   Change log:
;
;      DATE     REV DESCRIPTION
;   ----------- --- -----------------------------------------------------------
;   24-Oct-2000 1.0 Initial release
;
;==============================================================================


	.386p

;******************************************************************************
; Include files.
;******************************************************************************

.xlist
	include vmm.inc
	include vpicd.inc
	include vwin32.inc
	include shell.inc
	include local.inc
.list

;******************************************************************************
; Public/External Declarations
;******************************************************************************
public _PCIDPISR
public _PCIDPForDpcIsr
public _VWIN32_CloseVxDHandleW
public _VWIN32_SetWin32EventW
public _Message_Box
public _DWORD_to_ASCII_Hex

extrn _PCIDPISR_C:far				; PCIDPISR_C(
														;		unsigned long IRQHandle,
														;		unsigned long HWRefData
														;	)
extrn _PCIDPForDpcIsr_C:far	; PCIDPForDpcIsr_C(
														;		unsigned long HWRefData
														;	)
extrn	_DeviceIocontrol:far	;	DeviceIocontrol(
														;		DIOCParams* Params
														;	)
extrn _PnPNewDevice:far			;	PnPNewDevice(
														;		unsigned long Devnode,
														;		unsigned long LoadType
														;	)



;******************************************************************************
; Constants Declaration
;******************************************************************************

PCIDP_DYNAMIC			equ 1			;makes the VXD dynamically loadable
CH_SPACE					equ	020h
CH_COLON					equ	03Ah
CH_CR							equ	0Dh
CH_LF							equ	0Ah
PCIDP_DEVICE_ID		equ 0C300h
V86_Mode_Not_Supported	equ (PCIDP_DEVICE_ID + 1)
PM_Mode_Not_Supported	equ (PCIDP_DEVICE_ID + 2)

;******************************************************************************
; Virutal Device Declaration
;******************************************************************************

; Declare this virtual device.
Declare_Virtual_Device PCIDP,1,0,PCIDP_Control,UNDEFINED_DEVICE_ID,\
  Undefined_Init_Order,PCIDP_V86_API,PCIDP_PM_API


;******************************************************************************
; Initialization data segment; deleted upon completion of device initialization
;******************************************************************************

;;VxD_IDATA_SEG

;;VxD_IDATA_ENDS

;******************************************************************************
; Normal data segment
;******************************************************************************

VxD_DATA_SEG

  VM							dd	0   ;virtual machine handle

  INIT_MSG				db	'PCIDP version 1.0',0
  ;DYN_INIT_MSG		db	'DYN_INIT',0
  ;PNP_DEV_MSG			db	'PNP_DEV, Type='
	;PNP_LOAD_TYPE		db	'        , Node='
	;PNP_DEVNODE			db	'        ',0
  ;PNP_DEV_STAT		db	'PNP_DEV, IRQHdl='
	;PNP_STATUS			db	'        ',0
  ;DEV_IO_MSG			db	'DEV_IO',0

VxD_DATA_ENDS


;******************************************************************************
; Initialization code segment; deleted upon completion of device initialization
;******************************************************************************

VxD_ICODE_SEG


;******************************************************************************
;
;   PCIDP_Sys_Critical_Init
;
;   DESCRIPTION: Initialization of PCIDP during System Critical Initializaion.
;
;==============================================================================

BeginProc PCIDP_Sys_Critical_Init

	clc	;clear carry flag to indicate status is OK
	ret	;return to caller

EndProc PCIDP_Sys_Critical_Init


VxD_ICODE_ENDS


;******************************************************************************
; Normal code segment; resident throughout the life of the device.
;******************************************************************************


;******************************************************************************
;
;   PCIDP_Control
;
;   DESCRIPTION:    Dispatch control messages to the correct handlers.  This 
;		driver supports static and dynamic loading (for Plug and Play configuration
;		managment).
;
;==============================================================================
VXD_LOCKED_CODE_SEG
BeginProc PCIDP_Control

	Control_Dispatch Sys_Critical_Init, PCIDP_Sys_Critical_Init
	Control_Dispatch Sys_VM_Init, PCIDP_Init
  Control_Dispatch SYS_DYNAMIC_DEVICE_INIT, PCIDP_Sys_Dynamic_Device_Init
  Control_Dispatch SYS_DYNAMIC_DEVICE_EXIT,	PCIDP_Sys_Dynamic_Device_Exit
	Control_Dispatch Sys_VM_Terminate, PCIDP_Term
	Control_Dispatch Sys_Critical_Exit, PCIDP_Sys_Critical_Exit
	Control_Dispatch PNP_NEW_DEVNODE, PCIDP_PNP_New_Device
	Control_Dispatch W32_DEVICEIOCONTROL, PCIDP_DeviceIocontrol
	clc
	ret

EndProc PCIDP_Control
VXD_LOCKED_CODE_ENDS


VxD_CODE_SEG

;******************************************************************************
;
;   PCIDP_Init
;
;   DESCRIPTION: Initialization of PCIDP.
;		1. Save the system virtual machine handle.
;		2. Display debug message.
;
;==============================================================================
BeginProc PCIDP_Init

	; Save some registers.
	push    eax
	push    ebx
	push    ecx
	push    edx
	push    edi
	push    esi

	; Get the system virtual machine handle.
	VMMCall Get_Cur_VM_Handle
	mov	[VM], ebx

	;	Display the initial configuration message if so directed.
	mov	eax, 0									;default answer No (0)
	cmp	eax, 0									;check for No
	je	DONE										;skip out if so
	mov	ebx, [VM]			    			;virtual machine handle
	mov	ecx, OFFSET32 INIT_MSG  ;pointer to message
	call Message_Box

	; Restore the saved registers.
DONE:
	pop     esi
	pop     edi
	pop     edx
	pop     ecx
	pop     ebx
	pop     eax

	clc     ;clear carry flag to indicate initialization is successful
	ret     ;return to caller

EndProc PCIDP_Init


;******************************************************************************
;
;   PCIDP_Sys_Dynamic_Device_Init
;
;   DESCRIPTION: Initialization of PCIDP during System Dynamic Initializaion.
;
;==============================================================================

BeginProc PCIDP_Sys_Dynamic_Device_Init

	clc     ;clear carry flag to indicate to initialization is successful
	ret     ;return to caller

EndProc PCIDP_Sys_Dynamic_Device_Init


;******************************************************************************
;
;   PCIDP_Sys_Dynamic_Device_Exit
;
;   DESCRIPTION: Termination of PCIDP during System Dynamic Unloading.
;
;==============================================================================

BeginProc PCIDP_Sys_Dynamic_Device_Exit

	clc     ;clear carry flag to indicate to continue termination
	ret     ;return to caller

EndProc PCIDP_Sys_Dynamic_Device_Exit


;******************************************************************************
;
;   PCIDP_Term
;
;   DESCRIPTION: Termination of PCIDP.
;
;==============================================================================
BeginProc PCIDP_Term

	clc     ;clear carry flag to indicate to continue termination
	ret     ;return to caller

EndProc PCIDP_Term


;******************************************************************************
;
;   PCIDP_Sys_Critical_Exit
;
;   DESCRIPTION: Termination of PCIDP during System Critical Initializaion.
;
;==============================================================================

BeginProc PCIDP_Sys_Critical_Exit

	clc     ;clear carry flag to indicate to continue termination
	ret     ;return to caller

EndProc PCIDP_Sys_Critical_Exit


;******************************************************************************
;
; PCIDP_V86_API
;
; DESCRIPTION: Entry routine for an application running under V86 mode.
;
;******************************************************************************

BeginProc PCIDP_V86_API

	mov	[ebp + Client_AX], V86_Mode_Not_Supported
	or	[ebp + Client_Flags], CF_Mask
	ret

EndProc PCIDP_V86_API


;******************************************************************************
;
; PCIDP_PM_API
;
; DESCRIPTION: Entry routine for an application running under PM mode.
;
;******************************************************************************

BeginProc PCIDP_PM_API

	mov	[ebp + Client_AX], PM_Mode_Not_Supported
	or	[ebp + Client_Flags], CF_Mask
	ret

EndProc PCIDP_PM_API


;******************************************************************************
;
;   PCIDP_PNP_New_Device
;
;   DESCRIPTION: 
;
;==============================================================================

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -