From: Brett Gordon Date: Sun, 12 Jun 2016 17:27:25 +0000 (-0400) Subject: multicomp09: dw_tranaction to support direct to userspace xfers X-Git-Url: https://git.ndcode.org/public/gitweb.cgi?a=commitdiff_plain;h=020ed66989b9521277bbbbab37326d106b336ee8;p=FUZIX.git multicomp09: dw_tranaction to support direct to userspace xfers --- diff --git a/Kernel/platform-multicomp09/drivewire.s b/Kernel/platform-multicomp09/drivewire.s index c7ac5a39..8582fc76 100644 --- a/Kernel/platform-multicomp09/drivewire.s +++ b/Kernel/platform-multicomp09/drivewire.s @@ -19,29 +19,33 @@ ;;; machine isn't fast enough to catch the host's reply packet ;;; , the write and read functions must be "close" together. ;;; uint16_t dw_transaction( char *send, uint16_t scnt, -;;; char *recv, uint16_t rcnt ) +;;; char *recv, uint16_t rcnt, uint8_t rawf ) ;;; x=send cc y ret scnt recv rcnt ;;; Brett M. Gordon _dw_transaction: pshs cc,y ; save caller orcc #0x50 ; stop interrupts - ldy 5,s ; Y = number of bytes to send - beq out@ ; no byte to write - leave + tstb ; rawflag? + beq skip@ ; nope - then skip switching to process map + jsr map_process_always +skip@ ldy 5,s ; Y = number of bytes to send + beq ok@ ; no byte to write - leave jsr DWWrite ; send to DW ldx 7,s ; X is receive buffer ldy 9,s ; Y = number of bytes to receive - beq out@ ; no bytes to send - leave + beq ok@ ; no bytes to send - leave jsr DWRead ; read in that many bytes bcs frame@ ; C set on framing error bne part@ ; Z zet on all bytes received -out@ ldx #0 ; no error +ok@ ldx #0 ; no error +out@ jsr map_kernel puls cc,y,pc ; return frame@ ldx #-1 ; frame error - puls cc,y,pc ; return + bra out@ part@ ldx #-2 ; not all bytes received! - puls cc,y,pc ; return + bra out@ + - _dw_reset: ; maybe reinitalise PIA here? ; and send DW_INIT request to server?