;       SCCSID = @(#)rmp.inc	6.2 91/05/04
;      SCCSID = @(#)rmp.inc	6.2 91/05/04

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

.386p
.286p


;*** includes for RMP.ASM, and anyone else that need to do Record Management




;**	Record Management Package Definitions
;

rbheadr_s struc
  rb_size	dw	?		; total size of segment
  rb_free_size	dw	?		; amount of free space
  rb_1st_free	dw	?		; link to first free block in seg
  rb_last_free	dw	?		; start of last free block
  rb_hkh	dd	?		; heap handle
  rb_flags	dd	?		; PG alloc/realloc flags
  rb_hobowner	dw	?		; hobowner
  rb_hobmte	dw	?		; hobmte
  rb_first	dw	?		; start of first record
rbheadr_s ends

rb_sz_field	equ	rb_free_size	; size of 'record size field'

rbfree_s struc
  rf_size	dw	?		; free block size (high bit set)
  rf_prev_free	dw	?		; link to prev free block in seg
  rf_next_free	dw	?		; link to next free block in seg
rbfree_s ends

rparm_s struc
  rp_flags	db	?		; flags
		db	?		; (unused)
  rp_selector	dw	?		; GDT selector to use
rparm_s ends

RPF_BUSY	equ	01h		; Segment busy flag
RPF_WAITING	equ	02h		; Somebody waiting flag
RPF_ALLOC	equ	04h		; Segment allocated flag
RPF_FREE	equ	8000h		; Record invalid flag
RPF_USED	equ	not RPF_FREE	; Mask for free record flag

RMPINITSIZE	equ	((RMPGRAN-1 + rb_first) and RMPMASK)
RMPMINSIZE	equ	size rbfree_s	; Minimum record size
RMPMAXFREE	equ	4096		; max size of free block
RMPMAXMOVED	equ	4096		; max amount moved between yields


;**	Managed Segment Granulaity
;
;	Segments must grow and shrink by multiples of this size.  This
;	is to prevent memory thrashing when a small adjustment is made
;	to the managed segment.  The size is large enough to accommodate
;	the RMP user with the largest record size.  This user is the
;	path cacher, which needs to allocate a record at init time
;	with a maximum possible size of 1370 bytes  The size is also a multiple
;	of 512.

RMPGRAN EQU	1536                    ; change back
RMPMASK EQU	0FE00h			; mask for RMPGRAN
