;       SCCSID = @(#)pdata.asm	6.1 90/11/17
;      SCCSID = @(#)pdata.asm	1.4 90/01/24
; ****************************************************************************
; *									     *
; *			  IBM/Microsoft Confidential			     *
; *									     *
; *		    Copyright (c) IBM Corporation  1987, 1990		     *
; *		    Copyright (c) Microsoft Corp.  1987, 1990		     *
; *			      All Rights Reserved			     *
; *									     *
; ****************************************************************************
TITLE	PDATA - MSDOS 4.0 per process data


;**	PDATA - Per Task Data Area (PTDA) Definitions
;
;	All PTDA cells are defined here and referenced as externals
;	by users.
;
;	NOTE that in addition to defining offsets into the PTDA this
;	module is included in the link image and therefore IS a PTDA;
;	specifically, task 0's (the idle task) PTDA.
;
;	BUGBUG - we can reduce the PTDA size and increase the available
;		stack space by careful arrangement and overlaying of
;		temporary buffers which are allocated here.  An even
;		better approach would be to allocate the temporary
;		buffers off the stack.


;**	Modification History
;
;	11/20/83	JGL		unmarked
;		- conglomerated PUBLIC declarations to improve readability
;
;	12/18/84	EKE		Marked by comments ending "3.10"
;		Added declarations for data needed by 3.10.
;
;	04/18/84	EKE
;		All variables used by the redirector have been marked with the
;		comment "*REDIR*".  If those variables are changed in any way,
;		make sure that the changes are also made in the redirector.
;
;	06/19/85	PBS
;		Definition of FPState, a buffer in the PTDA for the saved
;		state of the floating point coprocessor.  Note that this
;		space is not used if the machine has no FP coprocessor.
;
;	07/02/85	ARW
;		Rearranged some variables which are used by the scheduler
;		to two purposes:  a) PS becomes less dependent on the system
;		version, and b) moving toward shrinking the idle task's PTDA
;		to just those variables which it needs.
;
;	07/16/85	PBS
;		Definition of FPStatus, a byte in the PTDA to tell whether
;		the process uses the coprocessor (based on whether the
;		machine has a coprocessor and whether the behavior bits
;		say the program uses it) and whether the process has
;		used the coprocessor already.
;

.xlist
.xcref

include ldrseg.inc
include curdir.inc
include devsym.inc
.list
.cref

Break	macro	subtitle
	subttl	subtitle
endm
FALSE	EQU	0			; should come from basemaca.inc

BREAK <Public Declarations>

TaskArea	SEGMENT


	PUBLIC	Path_index
	PUBLIC	Path_tempbuf
	PUBLIC	Path_namedx
	PUBLIC	Path_nameds
	PUBLIC	Path_namecount
	PUBLIC	Path_openflag
	PUBLIC	ptda_handle
	PUBLIC	PTDAsizeB,PTDAsizeW,PTDAsizeP
	PUBLIC	RenBuf
	PUBLIC	TempBuf

BREAK <Field Declarations and Descriptions>

ifndef	Kanji
	Kanji = FALSE
endif

ifndef	Debug
	Debug = FALSE
endif

ifndef	Redirector
	Redirector = FALSE
endif

ifndef	ShareF
	ShareF = FALSE
endif

;**	Segment Management Data

;	NOTE:	"ptda_signature" must be the first word of the PTDA
;		This location is common with the new exe "mte" structure

ptda_start	label	byte		; start of PTDA
ptda_handle	dw	0		; handle to this segment


; These are used to keep stack space to a minimum in "open_path" in load.asm
; Later they may be able to go on the stack
; WARNING - the following two items are accessed as double word
Path_index	DW	0		; current index in PATH
Path_tempbuf	DW	0		; segment for temporary buffer
; WARNING - the following two items are accessed as double word
Path_namedx	DW	0		; ds:dx saved
Path_nameds	DW	0		; ds:dx saved
Path_namecount	DB	0		; string length of name
Path_openflag	DB	0		; keep who called us

;
; TempBuf and Search/RenBuf share the same buffer to conserve space in
; the PTDA and must remain independent of each other.
TempBuf 	LABEL	BYTE		; temp buf for Exec & TransFCB funcs
; Buffer for search/rename calls
SearchBuf	DB	 53 DUP(0)	; internal search buffer	   3.10
RenBuf		DB	RMPATHLEN DUP(0); buffer for rename destination    3.10

; SearchBuf and RenBuf are located before the process's PTDA
; stack to act as a pad incase the stack overflows.


;********************  Big Fat Warning!! *********************
;LastField	 label	 byte		 ; New TCB's go here.  Anything after
					; this field will be clobbered.
;********************  Don't Put Anything Here!!  ************
;	The size of the PTDA in bytes, words and paragraphs
PTDAsizeB=	($-ptda_start)
PTDAsizeW=	($-ptda_start+1)/2
PTDAsizeP=	($-ptda_start+15)/16

TaskArea ENDS
	END
