packspu_net.c revision b4a5af5b468b34352b8cef62209a3b3b88e5cf24
/* Copyright (c) 2001, Stanford University
* All rights reserved
*
* See the file LICENSE.txt for information on redistributing this software.
*/
#include "cr_pack.h"
#include "cr_mem.h"
#include "cr_net.h"
#include "cr_pixeldata.h"
#include "cr_protocol.h"
#include "cr_error.h"
#include "packspu.h"
#include "packspu_proto.h"
static void
{
int *writeback;
*writeback = 0;
}
/**
* XXX Note that this routine is identical to crNetRecvReadback except
* we set *writeback=0 instead of decrementing it. Hmmm.
*/
static void
{
/* minus the header, the destination pointer,
* *and* the implicit writeback pointer at the head. */
int *writeback;
void *dest_ptr;
*writeback = 0;
}
static void
{
}
static int
{
{
case CR_MESSAGE_READ_PIXELS:
break;
case CR_MESSAGE_WRITEBACK:
break;
case CR_MESSAGE_READBACK:
break;
default:
/*crWarning( "Why is the pack SPU getting a message of type 0x%x?", msg->type ); */
return 0; /* NOT HANDLED */
}
return 1; /* HANDLED */
}
static CRMessageOpcodes *
{
int num_opcodes;
hdr = (CRMessageOpcodes *)
{
}
else
{
}
return hdr;
}
/*
* This is called from either the Pack SPU and the packer library whenever
* we need to send a data buffer to the server.
*/
void packspuFlush(void *arg )
{
unsigned int len;
/* we should _always_ pass a valid <arg> value */
#ifdef CHROMIUM_THREADSAFE
#endif
/* We're done packing into the current buffer, unbind it */
/*
printf("%s thread=%p thread->id = %d thread->pc=%p t2->id=%d t2->pc=%p packbuf=%p packbuf=%p\n",
__FUNCTION__, (void*) thread, (int) thread->id, thread->packer,
(int) t2->id, t2->packer,
buf->pack, thread->packer->buffer.pack);
*/
/*
printf("%s early return\n", __FUNCTION__);
*/
/* XXX these calls seem to help, but might be appropriate */
#ifdef CHROMIUM_THREADSAFE
#endif
return;
}
if ( buf->holds_BeginEnd )
{
/*crDebug("crNetBarf %d, (%d)", len, buf->size);*/
}
else
{
/*crDebug("crNetSend %d, (%d)", len, buf->size);*/
}
/* The network may have found a new mtu */
#ifdef CHROMIUM_THREADSAFE
#endif
}
/**
* XXX NOTE: there's a lot of duplicate code here common to the
* pack, tilesort and replicate SPUs. Try to simplify someday!
*/
{
unsigned int len;
unsigned char *src;
/* packet length is indicated by the variable length field, and
includes an additional word for the opcode (with alignment) and
a header */
{
/* It's already been swapped, swap it back. */
}
/* write the opcode in just before the length */
/* fix up the pointer to the packet to include the length & opcode
& header */
{
}
else
{
}
}
#if defined(VBOX_WITH_CRHGSMI) && defined(IN_GUEST)
, struct VBOXUHGSMI *pHgsmi
#endif
)
{
#if defined(VBOX_WITH_CRHGSMI) && defined(IN_GUEST)
, pHgsmi
#endif
);
{
}
}
#if defined(VBOX_WITH_CRHGSMI) && defined(IN_GUEST)
, struct VBOXUHGSMI *pHgsmi
#endif
)
{
if (pack_spu.numThreads == 0) {
#if defined(VBOX_WITH_CRHGSMI) && defined(IN_GUEST)
, pHgsmi
#endif
);
crError("packspuConnectToServer: no connection on first create!");
return;
}
}
else {
/* a new pthread */
#if defined(VBOX_WITH_CRHGSMI) && defined(IN_GUEST)
, pHgsmi
#endif
);
}
}