18#define DMA3 ((volatile struct DmaRegisters *)REG_DMA3)
22#define Dma_Fill16(value, destination, size) \
24 volatile u16 fill_ = (value); \
25 Dma_Set((const void *)&fill_, (destination), \
26 (DMA_ENABLE | DMA_SRC_FIXED) << 16 | ((size) / 2), REG_DMA3); \
30#define Dma_Fill32(value, destination, size) \
32 volatile u32 fill_ = (value); \
33 Dma_Set((const void *)&fill_, (destination), \
34 (DMA_ENABLE | DMA_32BIT | DMA_SRC_FIXED) << 16 | ((size) / 4), \
42#define Dma_Fill32Cell(cell, value, destination, size) \
45 Dma_Set((const void *)&(cell), (destination), \
46 (DMA_ENABLE | DMA_32BIT | DMA_SRC_FIXED) << 16 | ((size) / 4), \
51#define Cpu_Fill32(value, destination, size) \
53 volatile u32 fill_ = (value); \
54 Bios_CpuSet((const void *)&fill_, (destination), \
55 CPU_SET_32BIT | CPU_SET_SRC_FIXED | ((size) / 4)); \
60CAMELOT_ASM(
"stmia of three registers with no paired ldmia, which no agscc "
62static __inline__
void Dma_Set(const volatile
void *source,
63 volatile
void *destination,
u32 control,
64 volatile
u32 *channel) {
67 register volatile u32 *dma __asm__(
"r3") = channel;
68 register u32 src __asm__(
"r0") = (
u32)source;
69 register u32 dst __asm__(
"r1") = (
u32)destination;
70 register u32 cnt __asm__(
"r2") = control;
71 __asm__
volatile(
"stmia %2!, {%0, %3, %1}\n\tsub %2, #12"
72 :
"+r"(src),
"+r"(cnt)
static __inline__ void Dma_Set(const volatile void *source, volatile void *destination, u32 control, volatile u32 *channel)
Starts a DMA transfer: stores the source, destination and control words into channel's registers with...
The hardware's I/O registers and their bits, as pret names them.
A DMA channel's registers (DMAxSAD, DMAxDAD, DMAxCNT).
u32 control
The count in the low half, DMAxCNT_H's flags above it.
The integer types, TRUE, UNUSED and the fixed-address macros.
#define CAMELOT_ASM(proof)