Search
lxdream.org :: lxdream/src/sh4/dmac.h
lxdream 0.9.1
released Jun 29
Download Now
filename src/sh4/dmac.h
changeset 736:a02d1475ccfd
prev561:533f6b478071
author nkeynes
date Sat Dec 27 02:59:35 2008 +0000 (15 years ago)
branchlxdream-mem
permissions -rw-r--r--
last change Replace fpscr_mask/fpscr flags in xlat_cache_block with a single xlat_sh4_mode,
which tracks the field of the same name in sh4r - actually a little faster this way.
Now depends on SR.MD, FPSCR.PR and FPSCR.SZ (although it doesn't benefit from the SR
flag yet).

Also fixed the failure to check the flags in the common case (code address returned
by previous block) which took away the performance benefits, but oh well.
view annotate diff log raw
     1 /**
     2  * $Id$
     3  *
     4  * SH4 onboard DMA controller (DMAC) definitions.
     5  *
     6  * Copyright (c) 2005 Nathan Keynes.
     7  *
     8  * This program is free software; you can redistribute it and/or modify
     9  * it under the terms of the GNU General Public License as published by
    10  * the Free Software Foundation; either version 2 of the License, or
    11  * (at your option) any later version.
    12  *
    13  * This program is distributed in the hope that it will be useful,
    14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
    15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    16  * GNU General Public License for more details.
    17  */
    19 #ifndef lxdream_dmac_H
    20 #define lxdream_dmac_H 1
    22 #include <stdint.h>
    24 #ifdef __cplusplus
    25 extern "C" {
    26 #endif
    28 /* External DREQ. Note only used for DMA memory-to-memory - for single 
    29  * address transfers the device uses DMAC_get_buffer/DMAC_put_buffer.
    30  */
    31 #define DMAC_EXTERNAL 0 
    32 #define DMAC_SCI_TDE 1  /* SCI Transmit data empty */
    33 #define DMAC_SCI_RDF 2  /* SCI Receive data full */
    34 #define DMAC_SCIF_TDE 3 /* SCIF Transmit data empty */
    35 #define DMAC_SCIF_RDF 4 /* SCIF Receive data full */
    36 #define DMAC_TMU_ICI 5  /* TMU Input capture interrupt (not used?) */
    38 /**
    39  * Trigger a DMAC transfer by asserting one of the above DMA request lines
    40  * (from the onboard peripherals). Actual transfer is dependent on the 
    41  * relevant channel configuration.
    42  */
    43 void DMAC_trigger( int dmac_trigger );
    45 /**
    46  * Execute a memory-to-external-device transfer. Copies data into the supplied
    47  * buffer up to a maximum of bytecount bytes. 
    48  * @return Actual number of bytes copied.
    49  */
    50 uint32_t DMAC_get_buffer( int channel, unsigned char *buf, uint32_t bytecount );
    52 /**
    53  * execute an external-device-to-memory transfer. Copies data from the 
    54  * supplied buffer into memory up to a maximum of bytecount bytes. 
    55  * @return Actual number of bytes copied.
    56  */
    57 uint32_t DMAC_put_buffer( int channel, unsigned char *buf, uint32_t bytecount );
    59 #ifdef __cplusplus
    60 }
    61 #endif
    63 #endif /* !lxdream_dmac_H */
.