flashwritebuffer.c
1.17 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
/*---------------------------------------------------------------------
Copyright (C) 1998 Nintendo.
File flash.c
Coded by Atushi Watanabe. Dec 1, 1998.
Modified by Atushi Watanabe. Apr 4, 2000.
Comments 1M Flash ROM access functions(Ver.7.6)
$Id: flashwritebuffer.c,v 1.1.1.1 2002/10/29 08:06:43 blythe Exp $
---------------------------------------------------------------------*/
/**************************************************************************
*
* $Revision: 1.1.1.1 $
* $Date: 2002/10/29 08:06:43 $
* $Source:
*
**************************************************************************/
#include <ultra64.h>
#include "osint_flash.h"
s32 osFlashWriteBuffer(OSIoMesg *mb, s32 priority, void *dramAddr, OSMesgQueue *mq)
{
s32 ret;
/* Set Read Buffer(Buffer Access Mode) */
osEPiWriteIo(&__osFlashHandler,(__osFlashHandler.baseAddress|0x10000),0xb4000000);
/* Read Buffer */
mb->hdr.pri = priority;
mb->hdr.retQueue = mq;
mb->dramAddr = dramAddr;
mb->devAddr = 0;
mb->size = 128;
ret = osEPiStartDma(&__osFlashHandler, mb, OS_WRITE);
return ret;
}