* Re: Problems with setjmp/longjmp on DEC
1992-08-11 12:28 Problems with setjmp/longjmp on DEC Roger Centerstr|m
@ 1992-08-12 0:02 ` Charles M Richmond
1992-08-12 10:29 ` VAX 4000 VLC CPU manual needed grater boston chapter of the acm
1 sibling, 0 replies; 4+ messages in thread
From: Charles M Richmond @ 1992-08-12 0:02 UTC (permalink / raw)
roce@enea.se (Roger Centerstr|m) writes:
>Hello out there !
>I have a tricky question.
>I work with a software package that uses setjmp and longjmp in a non standard
>way. I have it running on a number of different platforms but it is not working
>on an ULTRIX/DEC station.
>The program is simulating a number of processes.
>The priciples of the program is:
> Store current position of stack for simulated process X.
> ..
> ..
> ..
> simulated process X is running.
> ..
> ..
> ..
> setjmp
> save complete stack for simulated process X. (in non stacked data area)
> ..
> ..
> stack is shrinking below setjmp position.
> ..
> ..
> Perform the same actions for simulated process Y.
> ..
> ..
> longjmp (to process X)
> reinstall stack for simulated process X. (with a memcpy)
>
> hopefully simulated process x is running
>
>This code have caused problems on other platforms, such as on the sparc-station
>where I had to use lightweighted processes instaed. On a VMS VAX-750 I had to
>write my own longjmp, setjmp and stackhandling functions in MACRO-assembler.
>Earlier this year I had an ULTRIX/DEC-station for a few days when I tried the
>code, it did not work and I had no chance to find out why, due to lack of time
>and tools.
>Anyone out there having any experiencs of setjmp, longjmp and
>stack manipulation on an ULTRIX/DEC-Station.
>###########################
># Roger Centerstrom #
># ENEA DATA AB #
># BOX 232 Nytorpsvagen 5B #
># S-18323 TABY SWEDEN #
># E-mail roce@enea.se #
># Tel +46 8 792 25 00 #
># Telefax +46 8 768 43 88 #
>###########################
If the result that you are getting is "botched" then manually restore the
stack pointer (see setjmp.h) just before the longjmp, see my code example
below, where "SETSP" is the piece that you need.
##*********************************************************************
##
## Author: Charles Richmond , IIS Corporation.
## Creation Date: 19-Jul-91
##
##**********************************************************************
.globl STKSTART
.globl GETSP
.globl SETSP
.ent STKSTART
STKSTART:
.frame $sp, 0, $31 ## the debuggers need .frame
move $sp, $4 ## Put the new stack address in.
move $3, $5 ## put the ldr function address in r3
move $4, $6 ## Move aguments 2 and 3 into
move $5, $7 ## the arg 0 and 1 postions.
j $3 ## jump to the loader (not returning)
.end STKSTART
.ent GETSP
GETSP:
subu $sp, 8 ## get the value of the stack and
.frame $sp, 8, $31
move $2, $sp ## return it (r2) to the caller.
j $31
.end GETSP
SETSP:
subu $sp, 8 ## set the previous stack value
.frame $sp, 8, $31 ## in place to defeat the ULTRIX
lw $sp, 128($4) ## test for corrupted stacks.
j $31 ## This hack depends on the setjmp
.end SETSP ## storing the old stack 128 offset
## from the address stored. !!!?!!!
Hope that this helps.
Charlie
--
*****************************************************************************
* Charles Richmond Integrated International Systems Corporation *
* cmr@world.std.com (Temporary) crichmond@mr4dec.enet.dec.com *
* Specializing in UNIX, X, Image Processing, and Communications. *
^ permalink raw reply [flat|nested] 4+ messages in thread* VAX 4000 VLC CPU manual needed
1992-08-11 12:28 Problems with setjmp/longjmp on DEC Roger Centerstr|m
1992-08-12 0:02 ` Charles M Richmond
@ 1992-08-12 10:29 ` grater boston chapter of the acm
1992-08-20 16:47 ` mitcham
1 sibling, 1 reply; 4+ messages in thread
From: grater boston chapter of the acm @ 1992-08-12 10:29 UTC (permalink / raw)
I am looking for a manual describing the CPU and peripheral interfaces which
are built in to the CPU board for the VAX 4000 VLC. No one at DEC has been
able to help me; the manual does not ship with the VAXstation, nor is it in
the VAX 4000 VLC owner's guide.
There is an analogous manual for all other DEC CPUs (e g, EK-KA630 for the
MicroVAX II). The manual must exist, because otherwise the system programmers
could not have written the ROM code and lower-level OS functions.
The manual should describe the subsetting of the VAX architecture, the
machine-specific traps and exceptions, processor registers, and built-in
Ethernet and SCSI interfaces. It should also describe the firmware, behavior
on power-up, memory interface and map.
Anyone know how to get this manual, or who at DEC might know?
Peter Sherwood
gbcacm@northeastern.edu
(617) 332-8880
^ permalink raw reply [flat|nested] 4+ messages in thread