initrdb.c
871 Bytes
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
38
39
40
41
#include "os.h"
#include "os_internal.h"
#include "rdb.h"
#include "R4300.h"
#ifndef _FINALROM
rdbPacket * __osRdb_IP6_Data;
u32 __osRdb_IP6_Size;
u32 __osRdb_IP6_Ct;
u32 __osRdb_IP6_CurWrite;
u32 __osRdb_IP6_CurSend;
void osInitRdb(u8 *sendBuf, u32 sendSize)
{
u32 mask;
sendSize /= 4; /* convert the number of bytes to number of packets */
if((u32)sendBuf & 0x00000003) /* not 4 byte aligned */
{
sendBuf = (char*)((u32)sendBuf & 0x00000003) + 4; /* round up to 4 byte alignment */
sendSize--; /* decrement number of packets */
}
mask = __osDisableInt();
__osRdb_IP6_Data = (rdbPacket*)sendBuf;
__osRdb_IP6_Size = sendSize;
__osRdb_IP6_Ct = 0;
__osRdb_IP6_CurWrite = 0;
__osRdb_IP6_CurSend = 0;
__osRestoreInt(mask);
}
#endif /* #ifndef _FINALROM */