Pdp11 Csav Mystery

teklabs!tekmdp!azure!stevenm teklabs!tekmdp!azure!stevenm
Tue Apr 13 14:43:56 AEST 1982


Recently, while debugging a strange problem with a Menlo-overlayed
program, I came across the fact that there are two C register
save/restore sequences. One is called 'csv', is dated 7/75, and
is entered via 'jsr r5,csv'. The other is called 'csav', is
dated '7/79-B', and is entered via 'jsr r0,csav'. The two routines
are semantically equivalent (i.e. the stack is left in the same
state at the end of the two routines).

The former routine is called for all user-written and library routines.
The latter routine (csav) is called ONLY when C runtime routines
(ldiv,lmul,lrem,aldiv,almul,alrem) are called.

On my system there is a directory '/usr/src/libc/crt/' which contains
these runtime routines which call csav. A subdirectory
('/usr/src/libc/crt/old') contains similar routines which call 'csv'.
This indicates that the change was recent. I do not believe that this
change was made locally.

The problem that I had was that the Menlo Overlay code redefines
'csv' so that the appropriate overlay is brought in (via an EMT trap)
before the routine is actually called. When a routine called
one of the runtime routines, however, the correct 'csv' was not
called, and havoc ensued.

My questions: Why are there two C-Save routines? Why is
'csav' used for the runtime routines? Where did the new routines
come from (Bell or UCB)? Should I 'fix' the runtime routines to
use the 'csv' or not?

Please respond to me directly, and I will digest the responses
(if any) and post them to net.unix-wizards in a few days.

Steven McGeady

ucbvax!teklabs!stevenm
decvax!teklabs!stevenm



More information about the Comp.unix.wizards mailing list