changeset 2333:080b3670b08f

Updated to handle SSig on data ready
author boisy
date Wed, 13 Jan 2010 12:45:50 +0000
parents 594d292e1788
children c7191a2dd8e5
files level1/modules/dw3.asm level1/modules/scdwn.asm
diffstat 2 files changed, 36 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/level1/modules/dw3.asm	Wed Jan 13 05:33:18 2010 +0000
+++ b/level1/modules/dw3.asm	Wed Jan 13 12:45:50 2010 +0000
@@ -313,7 +313,7 @@
 		  anda		#$C0	; mask last 6 bits
 		  beq		mode00	; virtual serial mode
           					; future - handle other modes
-		  bra		IRQExit ; for now, bail
+		  lbra		IRQExit ; for now, bail
 		  
 mode00	  lda		,s		; restore A		  
           anda    #$0F		; mask first 4 bits, a is now port #+1
@@ -398,9 +398,16 @@
           ; increment RxDatLen
           inc		RxDatLen,u
 
+          lda           <V.SSigID,u     ; send signal on data ready?
+          beq           CkSuspnd
+          ldb           <V.SSigSg,u     ; else get signal code
+          os9           F$Send
+          clr           <V.SSigID,u
+          bra           IRQExit
 
           ; check if we have a process waiting for data	
-CkSuspnd  lda   	<V.WAKE,u  	; V.WAKE?
+CkSuspnd
+          lda   	<V.WAKE,u  	; V.WAKE?
           beq   	IRQExit   	; no
           clr 	<V.WAKE,u	; clear V.WAKE
           
--- a/level1/modules/scdwn.asm	Wed Jan 13 05:33:18 2010 +0000
+++ b/level1/modules/scdwn.asm	Wed Jan 13 12:45:50 2010 +0000
@@ -228,6 +228,10 @@
 WriteExit puls      a,x,pc		; clean stack, return
 
 	
+NotReady  comb
+          ldb       #E$NotRdy
+          rts
+
 *************************************************************************************
 * Read
 *
@@ -240,10 +244,15 @@
 *    CC = carry set on error
 *    B  = error code
 *
-Read    	equ  	*
+Read      equ           *
+* Check to see if there is a signal-on-data-ready set for this path.
+* If so, we return a Not Ready error.
+          lda           <V.SSigID,u     data ready signal trap set up?
+          bne           NotReady        yes, exit with not ready error
+
           pshs  	cc,dp       ; save IRQ/Carry status, system DP
 
-ReadChr	orcc      #IntMasks	; mask interrupts
+ReadChr   orcc          #IntMasks	; mask interrupts
           
           lda   	RxDatLen,u 	; get our Rx buffer count
           beq   	ReadSlp 	; no data, go sleep while waiting for new Rx data...
@@ -429,8 +438,23 @@
 		ldb       #OP_SERSETSTAT
 		bsr       SendStat
 		cmpa      #SS.ComSt
+                beq       comst
+                cmpa      #SS.SSig
 		bne       donebad
-		leax      PD.OPT,y
+ssig            pshs    cc
+                orcc    #IntMasks
+                lda     PD.CPR,y        ; get curr proc #
+                ldx     PD.RGS,y
+                ldb     R$X+1,x         ; get user signal code
+        	tst     RxDatLen,u	; get Rx data length
+                beq     ssigsetup       ; branch if no data in buffer
+* if here, we have data so send signal immediately
+                os9     F$Send
+                puls    cc,pc
+ssigsetup       std     <V.SSigID,u     ; save process ID & signal
+                puls    cc,pc
+
+comst		leax      PD.OPT,y
 		ldy       #OPTCNT
 		IFGT      LEVEL-1
 		ldu       <D.DWSubAddr