Solved 4.2BSD panic trap 9 problem on VAX 11/785

Griff Smith ggs at ulysses.UUCP
Thu Aug 15 12:02:34 AEST 1985


> >No!  The fix is to insert a ".space n" directive immediately before
> >the function in locore.s that is causing the problem.
> 
> Yes, this is better, but is also more difficult to apply.  It's
				   ^^^^^^^^^^^^^^^^^^^^^^^?
> much harder to push down, e.g, the probew in vax/trap.c this way.
>

Huh?  The code in question is

	.
	.
	clrl	12(r2)
	ret

_Copyin:	.globl	_Copyin		# <<<massaged for jsb by asm.sed>>>
	movl	12(sp),r0		# copy length
	blss	ersb
	movl	4(sp),r1		# copy user address
	cmpl	$NBPG,r0		# probing one page or less ?
	bgeq	cishort			# yes
ciloop:
	prober	$3,$NBPG,(r1)		# bytes accessible ?
	beql	ersb			# no
	addl2	$NBPG,r1		# incr user address ptr
	acbl	$NBPG+1,$-NBPG,r0,ciloop	# reduce count and loop
cishort:
	prober	$3,r0,(r1)		# bytes accessible ?
	beql	ersb			# no
	.
	.

Change it to the following:

	.
	.
	clrl	12(r2)
	ret

	.space 50			# kludge to move probers to next page

_Copyin:	.globl	_Copyin		# <<<massaged for jsb by asm.sed>>>
	movl	12(sp),r0		# copy length
	blss	ersb
	movl	4(sp),r1		# copy user address
	cmpl	$NBPG,r0		# probing one page or less ?
	bgeq	cishort			# yes
ciloop:
	prober	$3,$NBPG,(r1)		# bytes accessible ?
	beql	ersb			# no
	addl2	$NBPG,r1		# incr user address ptr
	acbl	$NBPG+1,$-NBPG,r0,ciloop	# reduce count and loop
cishort:
	prober	$3,r0,(r1)		# bytes accessible ?
	beql	ersb			# no
	.
	.

There is nothing difficult about this.  References to probes in C code
are another problem; you probably WILL need to pad with nop's.  So what?
Nothing says you have to use the same solution in both languages.  When
casting spells in assembly, use the tools that are available.
-- 

Griff Smith	AT&T Bell Laboratories, Murray Hill
Phone:		(201) 582-7736
Internet:	ggs at ulysses.uucp
UUCP:		ulysses!ggs  ( {allegra|ihnp4}!ulysses!ggs )



More information about the Comp.unix.wizards mailing list