changed EM_* to _EM_*, added Makefile, LIST and .distr
This commit is contained in:
		
							parent
							
								
									2a15fcf645
								
							
						
					
					
						commit
						25291680b0
					
				
					 4 changed files with 38 additions and 23 deletions
				
			
		
							
								
								
									
										3
									
								
								lang/cem/libcc.ansi/setjmp/.distr
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										3
									
								
								lang/cem/libcc.ansi/setjmp/.distr
									
										
									
									
									
										Normal file
									
								
							| 
						 | 
				
			
			@ -0,0 +1,3 @@
 | 
			
		|||
LIST
 | 
			
		||||
Makefile
 | 
			
		||||
setjmp.e
 | 
			
		||||
							
								
								
									
										1
									
								
								lang/cem/libcc.ansi/setjmp/LIST
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										1
									
								
								lang/cem/libcc.ansi/setjmp/LIST
									
										
									
									
									
										Normal file
									
								
							| 
						 | 
				
			
			@ -0,0 +1 @@
 | 
			
		|||
setjmp.e
 | 
			
		||||
							
								
								
									
										11
									
								
								lang/cem/libcc.ansi/setjmp/Makefile
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										11
									
								
								lang/cem/libcc.ansi/setjmp/Makefile
									
										
									
									
									
										Normal file
									
								
							| 
						 | 
				
			
			@ -0,0 +1,11 @@
 | 
			
		|||
CFLAGS=-L -LIB
 | 
			
		||||
 | 
			
		||||
.SUFFIXES: .o .e .c
 | 
			
		||||
 | 
			
		||||
.e.o:
 | 
			
		||||
	$(CC) $(CFLAGS) -c -o $@ $*.e
 | 
			
		||||
 | 
			
		||||
clean:
 | 
			
		||||
	rm -rf setjmp.o OLIST
 | 
			
		||||
 | 
			
		||||
setjmp.o:
 | 
			
		||||
| 
						 | 
				
			
			@ -1,5 +1,5 @@
 | 
			
		|||
#
 | 
			
		||||
 mes 2,EM_WSIZE,EM_PSIZE
 | 
			
		||||
 mes 2,_EM_WSIZE,_EM_PSIZE
 | 
			
		||||
 | 
			
		||||
;
 | 
			
		||||
; layout of a setjmp buffer:
 | 
			
		||||
| 
						 | 
				
			
			@ -21,7 +21,7 @@
 | 
			
		|||
 | 
			
		||||
; a GTO descriptor must be in the global data area
 | 
			
		||||
gtobuf
 | 
			
		||||
 bss 3*EM_PSIZE,0,0
 | 
			
		||||
 bss 3*_EM_PSIZE,0,0
 | 
			
		||||
 | 
			
		||||
 inp $fill_ret_area
 | 
			
		||||
 exp $setjmp
 | 
			
		||||
| 
						 | 
				
			
			@ -31,29 +31,29 @@ gtobuf
 | 
			
		|||
; longjmp must restore this mask
 | 
			
		||||
 loc 0
 | 
			
		||||
 cal $sigblock
 | 
			
		||||
 asp EM_WSIZE
 | 
			
		||||
 lfr EM_WSIZE
 | 
			
		||||
 asp _EM_WSIZE
 | 
			
		||||
 lfr _EM_WSIZE
 | 
			
		||||
 lal 0
 | 
			
		||||
 loi EM_PSIZE
 | 
			
		||||
 stf 3*EM_PSIZE
 | 
			
		||||
 loi _EM_PSIZE
 | 
			
		||||
 stf 3*_EM_PSIZE
 | 
			
		||||
#endif
 | 
			
		||||
; create GTO descriptor for longjmp
 | 
			
		||||
 lxl 0
 | 
			
		||||
 dch		; Local Base of caller
 | 
			
		||||
 lxa 0		; Stackpointer of caller
 | 
			
		||||
 lal EM_PSIZE
 | 
			
		||||
 loi EM_PSIZE	; Return address of caller
 | 
			
		||||
 lal _EM_PSIZE
 | 
			
		||||
 loi _EM_PSIZE	; Return address of caller
 | 
			
		||||
 lal 0
 | 
			
		||||
 loi EM_PSIZE	; address of jmpbuf
 | 
			
		||||
 sti 3*EM_PSIZE	; LB, SP, and PC stored in jmpbuf
 | 
			
		||||
 loi _EM_PSIZE	; address of jmpbuf
 | 
			
		||||
 sti 3*_EM_PSIZE	; LB, SP, and PC stored in jmpbuf
 | 
			
		||||
 loc 0
 | 
			
		||||
 ret EM_WSIZE	; setjmp must return 0
 | 
			
		||||
 ret _EM_WSIZE	; setjmp must return 0
 | 
			
		||||
 end 0
 | 
			
		||||
 | 
			
		||||
 pro $fill_ret_area,0
 | 
			
		||||
; put argument in function result area
 | 
			
		||||
 lol 0
 | 
			
		||||
 ret EM_WSIZE
 | 
			
		||||
 ret _EM_WSIZE
 | 
			
		||||
 end 0
 | 
			
		||||
 | 
			
		||||
 exp $longjmp
 | 
			
		||||
| 
						 | 
				
			
			@ -61,27 +61,27 @@ gtobuf
 | 
			
		|||
#ifdef __BSD4_2
 | 
			
		||||
; restore signal mask
 | 
			
		||||
 lal 0
 | 
			
		||||
 loi EM_PSIZE
 | 
			
		||||
 lof 3*EM_PSIZE
 | 
			
		||||
 loi _EM_PSIZE
 | 
			
		||||
 lof 3*_EM_PSIZE
 | 
			
		||||
 cal $sigsetmask
 | 
			
		||||
 asp EM_WSIZE
 | 
			
		||||
 lfr EM_WSIZE
 | 
			
		||||
 asp EM_WSIZE
 | 
			
		||||
 asp _EM_WSIZE
 | 
			
		||||
 lfr _EM_WSIZE
 | 
			
		||||
 asp _EM_WSIZE
 | 
			
		||||
#endif
 | 
			
		||||
 lal 0
 | 
			
		||||
 loi EM_PSIZE	; address of jmpbuf
 | 
			
		||||
 loi _EM_PSIZE	; address of jmpbuf
 | 
			
		||||
 lae gtobuf
 | 
			
		||||
 blm 3*EM_PSIZE	; fill GTO descriptor from jmpbuf
 | 
			
		||||
 lol EM_PSIZE	; second parameter of longjmp: the return value
 | 
			
		||||
 dup EM_WSIZE
 | 
			
		||||
 blm 3*_EM_PSIZE	; fill GTO descriptor from jmpbuf
 | 
			
		||||
 lol _EM_PSIZE	; second parameter of longjmp: the return value
 | 
			
		||||
 dup _EM_WSIZE
 | 
			
		||||
 zne *3
 | 
			
		||||
; of course, longjmp may not return 0!
 | 
			
		||||
 asp EM_WSIZE
 | 
			
		||||
 asp _EM_WSIZE
 | 
			
		||||
 loc 1
 | 
			
		||||
3
 | 
			
		||||
; put return value in function result area
 | 
			
		||||
 cal $fill_ret_area
 | 
			
		||||
 asp EM_WSIZE
 | 
			
		||||
 asp _EM_WSIZE
 | 
			
		||||
 gto gtobuf	; there we go ...
 | 
			
		||||
; ASP and GTO do not damage function result area
 | 
			
		||||
 end 0
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		
		Reference in a new issue