ELF abaption.

This commit is contained in:
thomas 2001-09-08 11:15:35 +00:00
parent eb5341b79a
commit e97e2309f0
1 changed files with 45 additions and 46 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: hdfd_intr.s,v 1.6 1999/03/24 05:50:58 mrg Exp $
/* $NetBSD: hdfd_intr.s,v 1.7 2001/09/08 11:15:35 thomas Exp $
/*
* Copyright (c) 1996 Leo Weppelman.
@ -43,82 +43,81 @@
#include <atari/dev/hdfdreg.h>
.text
.globl _fddmaaddr
.globl _fdio_addr,_fddmalen
.globl _mfp_hdfd_nf, _mfp_hdfd_fifo
.globl _C_LABEL(fddmaaddr)
.globl _C_LABEL(fdio_addr),_C_LABEL(fddmalen)
/*
* Entry point when there is no fifo. Handles the read/write
* interrupts a bit faster because it *knows* that there is only
* one character waiting.
*/
_mfp_hdfd_nf:
ENTRY_NOPROFILE(mfp_hdfd_nf)
addql #1,nintr | add another interrupt
moveml d0-d1/a0-a1,sp@- | Save scratch registers
movl _fdio_addr,a0 | Get base of fdc registers
movb a0@(fdsts),d0 | Get fdsts
btst #5,d0 | Dma active?
moveml %d0-%d1/%a0-%a1,%sp@- | Save scratch registers
movl _C_LABEL(fdio_addr),%a0 | Get base of fdc registers
movb %a0@(fdsts),%d0 | Get fdsts
btst #5,%d0 | Dma active?
jeq hdfdc_norm | No, normal interrupt
tstl _fddmalen | Bytecount zero?
tstl _C_LABEL(fddmalen) | Bytecount zero?
jeq hdfdc_norm | Yes -> normal interrupt
movl _fddmaaddr, a1 | a1 = dmabuffer
btst #6,d0 | Read?
movl _C_LABEL(fddmaaddr),%a1 | a1 = dmabuffer
btst #6,%d0 | Read?
jeq hdfd_wrt_nf | No, write
hdfd_rd_nf:
movb a0@(fddata),a1@+ | Get a byte
movb %a0@(fddata),%a1@+ | Get a byte
1:
subql #1, _fddmalen | decrement bytecount
movl a1,_fddmaaddr | update dma pointer
subql #1, _C_LABEL(fddmalen) | decrement bytecount
movl %a1,_C_LABEL(fddmaaddr) | update dma pointer
| addql #1,_cnt+V_INTR | chalk up another interrupt
moveml sp@+,d0-d1/a0-a1
moveml %sp@+,%d0-%d1/%a0-%a1
rte
hdfd_wrt_nf:
movb a1@+,a0@(fddata) | Push a byte
movb %a1@+,%a0@(fddata) | Push a byte
jra 1b | And get out...
/*
* Systems *with* fifo's enter here.
*/
_mfp_hdfd_fifo:
addql #1,_intrcnt_user+88 | add another interrupt
ENTRY_NOPROFILE(mfp_hdfd_fifo)
addql #1,_C_LABEL(intrcnt_user)+88 | add another interrupt
moveml d0-d1/a0-a1,sp@- | Save scratch registers
movl _fdio_addr,a0 | Get base of fdc registers
movb a0@(fdsts),d0 | Get fdsts
btst #5,d0 | Dma active?
moveml %d0-%d1/%a0-%a1,%sp@- | Save scratch registers
movl _C_LABEL(fdio_addr),%a0 | Get base of fdc registers
movb %a0@(fdsts),%d0 | Get fdsts
btst #5,%d0 | Dma active?
jeq hdfdc_norm | No, normal interrupt
movl _fddmaaddr, a1 | a1 = dmabuffer
btst #6,d0 | Read?
movl _C_LABEL(fddmaaddr),%a1 | a1 = dmabuffer
btst #6,%d0 | Read?
jeq hdfd_wrt | No, write
hdfd_rd:
tstl _fddmalen | Bytecount zero?
tstl _C_LABEL(fddmalen) | Bytecount zero?
jeq hdfdc1 | Yes -> done
movb a0@(fddata),a1@+ | Get a byte
subql #1, _fddmalen | decrement bytecount
movb a0@(fdsts),d0 | Get fdsts
andb #0xa0,d0 | both NE7_NDM and NE7_RQM active?
cmpb #0xa0,d0
movb %a0@(fddata),%a1@+ | Get a byte
subql #1, _C_LABEL(fddmalen) | decrement bytecount
movb %a0@(fdsts),%d0 | Get fdsts
andb #0xa0,%d0 | both NE7_NDM and NE7_RQM active?
cmpb #0xa0,%d0
jne hdfdc1 | No, end of this batch
jra hdfd_rd
hdfd_wrt:
tstl _fddmalen | Bytecount zero?
tstl _C_LABEL(fddmalen) | Bytecount zero?
jeq hdfdc1 | Yes -> done
movb a1@+,a0@(fddata) | Push a byte
subql #1, _fddmalen | decrement bytecount
movb %a1@+,%a0@(fddata) | Push a byte
subql #1, _C_LABEL(fddmalen) | decrement bytecount
jra hdfdc1
movb a0@(fdsts),d0 | Get fdsts
andb #0xa0,d0 | both NE7_NDM and NE7_RQM active?
cmpb #0xa0,d0
movb %a0@(fdsts),%d0 | Get fdsts
andb #0xa0,%d0 | both NE7_NDM and NE7_RQM active?
cmpb #0xa0,%d0
jne hdfdc1 | No, end of this batch
jra hdfd_wrt
hdfdc1:
movl a1,_fddmaaddr | update buffer pointer
btst #5,d0 | Dma still active?
movl %a1,_C_LABEL(fddmaaddr) | update buffer pointer
btst #5,%d0 | Dma still active?
jeq hdfdc_norm | No -> take normal interrupt
/*
@ -127,7 +126,7 @@ hdfdc1:
*/
hdfdc_xit:
addql #1,_C_LABEL(uvmexp)+UVMEXP_INTRS
moveml sp@+,d0-d1/a0-a1
moveml %sp@+,%d0-%d1/%a0-%a1
rte
/*
@ -137,13 +136,13 @@ hdfdc_xit:
hdfdc_norm:
tstl nintr
jeq 0f
movl nintr,d0
movl nintr,%d0
clrl nintr
addl d0, _intrcnt_user+88 | add another interrupt
addl d0,_C_LABEL(uvmexp)+UVMEXP_INTRS
0: jbsr _fdc_ctrl_intr | handle interrupt
moveml sp@+,d0-d1/a0-a1 | and saved registers
jra rei
addl %d0, _C_LABEL(intrcnt_user)+88 | add another interrupt
addl %d0,_C_LABEL(uvmexp)+UVMEXP_INTRS
0: jbsr _C_LABEL(fdc_ctrl_intr) | handle interrupt
moveml %sp@+,%d0-%d1/%a0-%a1 | and saved registers
jra _ASM_LABEL(rei)
.data
nintr: