	.title	getpar

	.nlist	bex

;
; PDP-11 C
; Stdio.
;
; Get partition parameters.
;

	.globl	getpar

	.mcall	return
	.mcall	gprt$s

;
; Get partition parameters.
;
; This C callable routine is used to get the partition parameters of
; the partition in which the caller is executing.
;
; C call:
;	int buf[4];
;	getpar(buf);
;
; 	buf[0] = physical base
;	buf[1] = virtual base
;	buf[2] = size in core clicks
;	buf[3] = flags
;

	.psect	.prog. con

getpar:	jsr	r0,$save

	sub	#6,sp
	mov	sp,r0
	gprt$s	,r0
	bcc	10$
	mov	#-1,r0
	br	20$

10$:	mov	12(r5),r1
	mov	G.PRPB(r0),(r1)+
	mov	$dsw,(r1)+
	mov	G.PRPS(r0),(r1)+
	mov	G.PRFW(r0),(r1)
	clr	r0

20$:	jmp	$ret

	.end
