initrdb.c 871 Bytes
#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 */