;
; IBM/Microsoft Confidential
;
; Copyright (c) IBM Corporation 1987, 1989
; Copyright (c) Microsoft Corporation 1987, 1989
;
; All Rights Reserved
;

;*
;* eisa.asm - routines to get Eisa configuration information
;*

 include segments.inc
 include basemaca.inc
 include eisa.inc

_TEXT segment

        assume cs:_TEXT

;*** GetSlotInfo - get Eisa slot information
;*
;* Description
;*      This routine retrieves the slot information for the specified slot
;*
;* Entry
;*      call near
;*      ss:sp + 4       pointer to return structure
;*            + 6       slot number
;*
;* Exit
;*      return structure filled in
;*
;*

Procedure _GetSlotInfo, near
ArgVar  bSlot, byte
ArgVar  pesi, word
LocalVar us, word

        EnterProc


        pusha
        mov     ax, EISA_SLOT_INFO_16
        mov     cl, bSlot
        int     15h

        mov     us, bx
        mov     bx, pesi
        ; fill values in in eisa slot info structure
        mov     [bx].esi_bReturn, ah
        mov     [bx].esi_fb, al
        mov     ax, us
        mov     [bx].esi_bMajorRev, ah
        mov     [bx].esi_bMinorRev, al
        mov     [bx].esi_usChecksum, cx
        mov     [bx].esi_cbFunc, dh
        mov     [bx].esi_fbFunc, dl
        mov     word ptr [bx].esi_ulID, di
        mov     word ptr [bx].esi_ulID + 2, si

        popa
        LeaveProc
        ret

EndProc _GetSlotInfo

;*** GetFunctionInfo - get Eisa function information
;*
;* Description
;*      This routine retrieves function information for the specified
;*      function
;*
;* Entry
;*      call near
;*      ss:sp + 4       pointer to buffer for function info
;*            + 6       function number
;*            + 8       slot number
;*
;* Exit
;*      success -- buffer filled in
;*                 ax = 1
;*      failure -- ax = 0
;*

Procedure _GetFunctionInfo, near
ArgVar  bSlot, byte
ArgVar  bFunc, byte
ArgVar  pefi, word

        EnterProc

        push    di
        push    si
        push    ax
        push    cx

        mov     ax, EISA_FUNC_INFO_16
        mov     cl, bSlot
        mov     ch, bFunc
        mov     si, pefi
        ; make ds:si point to buffer for function info
        inc     si
        int     15h

        dec     si
        mov     [si].efi_bReturn, ah

        pop     cx
        pop     ax
        pop     si
        pop     di

        LeaveProc
        ret
EndProc _GetFunctionInfo

_TEXT ends
        end
