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

📄 pci.inc

📁 This program displays all SMBIOS/DMI information within the BIOS. The information is organized as a
💻 INC
📖 第 1 页 / 共 2 页
字号:
;' $Header:   P:/PVCS/MAX/INC/PCI.INV   1.0   05 Sep 1995 13:27:44   HENRY  $
;
; (C) Copyright 1994-2001 Qualitas, Inc.     All rights reserved.
;
; PCI.INC
;
; Equates for PCI local bus machines
;
; We may need a first-level scheme to check for machines that can't
; handle an unknown Int 1Ah function.  For now, we'll assume it's
; OK to call the installation check function.

; Function codes are loaded in AX.
; Return from all functions is CF=0 and AH=0 if success; if CF=1,
; AH=error code.
; EAX, EBX, ECX, and EDX may be trashed by calls where their return
; values are not defined.

@PCIERR_OK	equ	00h	; Success
@PCIERR_BADFN	equ	81h	; Invalid function
@PCIERR_BADVID	equ	83h	; Invalid vendor ID
@PCIERR_BADDEV	equ	86h	; Invalid device ID
@PCIERR_BADREG	equ	87h	; Invalid configuration register
@PCIERR_BADSET	equ	88h	; Set failed
@PCIERR_BADBUF	equ	89h	; Buffer too small

PCICALL  macro	 FN
ifnb <FN>
	 mov	 ax,FN		; Get PCI function code
endif
	 int	 1Ah		; Call PCI function dispatch
	 endm			; PCICALL

; PCI v2.1 functions ----------------------------------------------

@PCISIG 	 equ	 ' ICP'

@PCI_INST	 equ	 0B101h ; PCI support query
; AL=hardware flags, BH,BL=BCD interface version, CL=highest bus #,
; EDX=@PCISIG.

@PCI_FINDDEV	 equ	 0B102h ; Find PCI device: CX=Device ID, DX=vendor ID,
				; SI=device index (origin:0)
; Returns BH=bus #, BL:7-3=device #, BL:2-0=function #

@PCI_FINDCLASS	 equ	 0B103h ; Find PCI class: 24-bit class code in ECX,
				; SI=device index (origin:0)
; Returns BH=bus #, BL:7-3=device #, BL:2-0=function #

@PCI_BUSOPS	 equ	 0B106h ; PCI bus-specific operations: BH=bus #,
				; EDX=special cycle data.

@PCI_RDBYTE	 equ	 0B108h ; Read PCI configuration byte: BH=bus #,
				; BL:7-3=device #, BL:2-0=function #,
				; DI=register # (00h-FFh)
; Returns byte in CL.

@PCI_RDWORD	 equ	 0B109h ; Read PCI configuration word: BH=bus #,
				; BL:7-3=device #, BL:2-0=function #,
				; DI=register # (00h-FFh)
; Returns word in CX.

@PCI_RDDWORD	 equ	 0B10Ah ; Read PCI configuration dword: BH=bus #,
				; BL:7-3=device #, BL:2-0=function #,
				; DI=register # (00h-FFh)
; Returns dword in ECX.

@PCI_WRBYTE	 equ	 0B10Bh ; Write PCI configuration byte: BH=bus #,
				; BL:7-3=device #, BL:2-0=function #,
				; CL=value, DI=register # (00h-FFh)

@PCI_WRWORD	 equ	 0B10Ch ; Write PCI configuration word: BH=bus #,
				; BL:7-3=device #, BL:2-0=function #,
				; CX=value, DI=register # (00h-FFh)

@PCI_WRDWORD	 equ	 0B10Dh ; Write PCI configuration dword: BH=bus #,
				; BL:7-3=device #, BL:2-0=function #,
				; ECX=value, DI=register # (00h-FFh)

@PCI_GETIRQ	 equ	 0B10Eh ; Get IRQ routing information
				; BX = 0000h
				; DS = segment/selector for F000:0
				; ES:eDI ==> RouteBuffer
; Returns BX = IRQ bitmap

@PCI_SETIRQ	 equ	 0B10Fh ; Set HW Interrupt
				; CH = IRQNum, CL = IntPin, BH = bus #
				; BL:7-3=device #, BL:2-0=function #,
				; DS = segment/selector for F000:0

PCI_RB_STR struc		; PCI Route Buffer

PCI_RB_SIZE dw	?		; Data buffer size
				; (filled in by callee of @PCI_SETIRQ)
PCI_RB_DATA dd	?		; Far ptr to data buffer
				; (filled in by caller of @PCI_SETIRQ)
PCI_RB_IRQ  dw	?		; Bitmap of IRQs dedicated to PCI devices
				; (filled in by caller of @PCI_SETIRQ from result)
PCI_RB_STR ends


PCI_DB_STR struc

PCI_DB_BUSNO db ?		; 00:  Bus #
PCI_DB_DEVNO db ?		; 01:  Device #
PCI_DB_LV_A  db ?		; 02:  Link value for INTA#
PCI_DB_BM_A  dw ?		; 03:  IRQ bitmap for INTA#
PCI_DB_LV_B  db ?		; 05:  Link value for INTB#
PCI_DB_BM_B  dw ?		; 06:  IRQ bitmap for INTB#
PCI_DB_LV_C  db ?		; 08:  Link value for INTC#
PCI_DB_BM_C  dw ?		; 09:  IRQ bitmap for INTC#
PCI_DB_LV_D  db ?		; 0B:  Link value for INTD#
PCI_DB_BM_D  dw ?		; 0C:  IRQ bitmap for INTD#
PCI_DB_SLOT  db ?		; 0E:  Slot #
PCI_DB_RSV15 db ?		; 0F:  Reserved

PCI_DB_STR ends


; PCI hardware characteristics records and equates
; (returned in AL from @PCI_INST)

PCIHWREC record \
 $PCIHW_RSV1:2, \
 $PCIHW_SCG2:1, \
 $PCIHW_SCG1:1, \
 $PCIHW_RSV0:2, \
 $PCIHW_CSA2:1, \
 $PCIHW_CSA1:1

@PCIHW_SCG2 equ (mask $PCIHW_SCG2) ; Special cycle generation mechanism #2 supported
@PCIHW_SCG1 equ (mask $PCIHW_SCG1) ; ...				 1 ...
@PCIHW_CSA2 equ (mask $PCIHW_CSA2) ; Configuration space access mechanism #2 supported
@PCIHW_CSA1 equ (mask $PCIHW_CSA1) ; ...				   1 ...

PCI_MECH1_ADDR	equ 0CF8h
PCI_MECH1_DATA	equ 0CFCh

PCI_MECH2_CFGSP equ 0CF8h
PCI_MECH2_BUSNO equ 0CFAh


; PCI Type 0 Configuration Transaction Record

PCICFG0REC record \
 $PCICFG0_RSV1:21,\
 $PCICFG0_FCN:3,  \
 $PCICFG0_REG:6,  \
 $PCICFG0_RSV0:2	; = 00b


; PCI Type 1 Configuration Transaction Record

PCICFG1REC record \
 $PCICFG1_RSV1:8, \
 $PCICFG1_BUS:8,  \
 $PCICFG1_DEV:5,  \
 $PCICFG1_FCN:3,  \
 $PCICFG1_REG:6,  \
 $PCICFG1_RSV0:2	; = 01b

					; FF000000:  Reserved
@PCICFG1_BUS equ (mask $PCICFG1_BUS)	; 00FF0000:  Bus #
@PCICFG1_DEV equ (mask $PCICFG1_DEV)	; 0000F800:  Device #
@PCICFG1_FCN equ (mask $PCICFG1_FCN)	; 00000700:  Function #
@PCICFG1_REG equ (mask $PCICFG1_REG)	; 000000FC:  Register #
					; 00000003:  = 01


; PCI Configuration Address register

PCICFGADDRREC record \
 $PCICFGADDR_ENA:1,  \
 $PCICFGADDR_RSV1:7, \
 $PCICFGADDR_BUS:8,  \
 $PCICFGADDR_DEV:5,  \
 $PCICFGADDR_FCN:3,  \
 $PCICFGADDR_REG:6,  \
 $PCICFGADDR_00:2	   ; = 00b

@PCICFGADDR_ENA equ (mask $PCICFGADDR_ENA)    ; 80000000:  1 = Enable
					      ; 7F000000:  Reserved
@PCICFGADDR_BUS equ (mask $PCICFGADDR_BUS)    ; 00FF0000:  Bus #
@PCICFGADDR_DEV equ (mask $PCICFGADDR_DEV)    ; 0000F800:  Device #
@PCICFGADDR_FCN equ (mask $PCICFGADDR_FCN)    ; 00000700:  Function #
@PCICFGADDR_REG equ (mask $PCICFGADDR_REG)    ; 000000FC:  Register #
@PCICFGADDR_00	equ (mask $PCICFGADDR_00)     ; 00000003:  = 00


; PCI Find Class Record (@PCI_FINDCLASS)

PCIFCREC record \
 $PCIFC_CLS:8,	\
 $PCIFC_SUB:8,	\
 $PCIFC_IF:8

@PCIFC_CLS equ	(mask $PCIFC_CLS)	; 00FF0000:  Class code
@PCIFC_SUB equ	(mask $PCIFC_SUB)	; 0000FF00:  Subclass code
@PCIFC_IF  equ	(mask $PCIFC_IF)	; 000000FF:  Interface


; PCI Class Names for $PCIFC_CLS above

@PCICLS_ORIG	equ	00h	; Original devices
@PCICLS_DISK	equ	01h	; Disk
@PCICLS_NETW	equ	02h	; Network
@PCICLS_DISP	equ	03h	; Display
@PCICLS_MEDIA	equ	04h	; Multimedia
@PCICLS_MEM	equ	05h	; Memory
@PCICLS_BRIDGE	equ	06h	; Bridge
@PCICLS_COMM	equ	07h	; Communication
@PCICLS_PERI	equ	08h	; System Peripheral
@PCICLS_INP	equ	09h	; Input
@PCICLS_DOCK	equ	0Ah	; Docking Station
@PCICLS_CPU	equ	0Bh	; CPU
@PCICLS_SER	equ	0Ch	; Serial Bus
@PCICLS_WIREL	equ	0Dh	; Wireless
@PCICLS_INTIO	equ	0Eh	; Intelligent I/O controllers
@PCICLS_SATCOM	equ	0Fh	; Satelite communication controllers
@PCICLS_CRYPTO	equ	10h	; Encryption and decryption controllers
@PCICLS_SIG	equ	11h	; Data acquisition & signal processing


; PCI Original (00) subclass names

@PCI_ORIG_ALL	    equ    00h	; All except VGA
@PCI_ORIG_VGA	    equ    01h	; VGA-compatible device


; PCI Disk (01) subclass names

@PCISUB_DISK_SCSI   equ    00h	; SCSI
@PCISUB_DISK_IDE    equ    01h	; IDE
@PCISUB_DISK_FLOPPY equ    02h	; Floppy
@PCISUB_DISK_IPI    equ    03h	; IPI
@PCISUB_DISK_RAID   equ    04h	; RAID
@PCISUB_DISK_OTH    equ    80h	; Other


; PCI Network (02) subclass names

@PCISUB_NETW_ETH  equ	   00h	; Ethernet
@PCISUB_NETW_TOK  equ	   01h	; Token Ring
@PCISUB_NETW_FDDI equ	   02h	; FDDI
@PCISUB_NETW_ATM  equ	   03h	; ATM
@PCISUB_NETW_ISDN equ	   04h	; ISDN
@PCISUB_NETW_OTH  equ	   80h	; Other


; PCI Display (03) subclass names

@PCISUB_DISP_VGA equ	   00h	; VGA
@PCISUB_DISP_XGA equ	   01h	; XGA
@PCISUB_DISP_3D  equ	   02h	; 3D
@PCISUB_DISP_OTH equ	   80h	; Other


; PCI Multimedia (04) subclass names

@PCISUB_MEDIA_VIDEO equ    00h	; Video
@PCISUB_MEDIA_AUDIO equ    01h	; Audio
@PCISUB_MEDIA_TELEP equ    02h	; Computer telephony device
@PCISUB_MEDIA_OTH   equ    80h	; Other


; PCI Memory (05) subclass names

@PCISUB_MEM_RAM   equ	   00h	; RAM
@PCISUB_MEM_FLASH equ	   01h	; Flash
@PCISUB_MEM_OTH   equ	   80h	; Other


⌨️ 快捷键说明

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