utils.c
860 Bytes
/*---------------------------------------------------------------------*
Copyright (C) 1998 Nintendo. (Originated by SGI)
$RCSfile: utils.c,v $
$Revision: 1.1.1.1 $
$Date: 2002/05/02 03:27:08 $
*---------------------------------------------------------------------*/
#include <ultra64.h>
#include "audiotest.h"
extern OSMesgQueue dmaMessageQ;
void
romCopy(char *src, char *dest, int len)
{
OSIoMesg dmaIoMesgBuf;
OSMesg dummyMesg;
osWritebackDCacheAll();
dmaIoMesgBuf.hdr.pri = OS_MESG_PRI_NORMAL;
dmaIoMesgBuf.hdr.retQueue = &dmaMessageQ;
dmaIoMesgBuf.dramAddr = dest;
dmaIoMesgBuf.devAddr = (u32)src;
dmaIoMesgBuf.size = len;
osEPiStartDma(handler, &dmaIoMesgBuf, OS_READ);
(void) osRecvMesg(&dmaMessageQ, &dummyMesg, OS_MESG_BLOCK);
}