; SRDISK - XMS memory device driver specific code
; Copyright (C) 1992-1996, 2005 Marko Kohtala
; Released under GNU GPL, read the file 'COPYING' for more information

%define MEMSTR 'XMS '      ; Define 4 char memory type string
ALLOCBLOCK equ 1        ; Memory allocation block size

%ifn CAPABLE & C_32BITSEC
MAX_SIZE equ 07FFFh     ; Without 32-bit sector addressing only 32M max
%elifn CAPABLE & C_NOALLOC
MAX_SIZE equ 0FFFFh     ; With own allocation only 64M max
%else
MAX_SIZE equ 524288     ; Maximum possible size (using 32-bit access)
%endif

METHOD equ 1

[list -]
XMS_block       struc
XMS_sizel       dw ?
XMS_sizeh       dw ?
XMS_shandle     dw ?
XMS_soffl       dw ?
XMS_soffh       dw ?
XMS_dhandle     dw ?
XMS_doffl       dw ?
XMS_doffh       dw ?
XMS_block       ends

XMS_alloc_s struc       ; Changing this structure needs changes in srdisk.exe
XMS_handle      dw      ?       ; XMS handle to disk memory (0=no handle)
XMS_entry       dd      ?       ; XMS driver entry point
XMS_cblk: ; NASM structure instance
XMS_block_size equ XMS_block_struc_size	; NASM port equate
istruc XMS_block
	resb XMS_block_size
iend
XMS_alloc_s ends
[list +]
