/* Copyright (c) 2001, Stanford University
* All rights reserved
*
* See the file LICENSE.txt for information on redistributing this software.
*/
#include "cr_mem.h"
#include "cr_environment.h"
#include "cr_string.h"
#include "cr_dll.h"
#include "cr_error.h"
#include "cr_spu.h"
#include <stdio.h>
#ifdef WINDOWS
#ifdef VBOX_WDDM_WOW64
#else
#endif
/*
#define DLL_SUFFIX ".bundle"
#define DLL_PREFIX ""
*/
#else
#ifdef AIX
#else
#endif
#endif
{
if (!dir)
{
#if defined(DARWIN)
if (RT_SUCCESS(rc))
else
#endif /* DARWIN */
#ifdef VBOX
#else
#endif
}
else
{
#ifdef VBOX
#else
#endif
}
return path;
}
/**
* Load a single SPU from disk and initialize it. Is there any reason
* to export this from the SPU loader library? */
{
char *path;
/* ensure all fields are initially zero,
* NOTE: what actually MUST be zero at this point is the_spu->superSPU, otherwise
* crSPUUnloadChain in the failure branches below will misbehave */
#if defined(DEBUG_misha) && defined(RT_OS_WINDOWS)
#endif
if (!the_spu->entry_point)
{
crError( "Couldn't load the SPU entry point \"%s\" from SPU \"%s\"!",
return NULL;
}
/* This basically calls the SPU's SPULoad() function */
{
return NULL;
}
#ifdef IN_GUEST
{
{
}
}
#else
{
{
}
}
#endif
else
{
}
if (!the_spu->function_table) {
return NULL;
}
/*crDebug( "initializing dispatch table %p (for SPU %s)", (void*)&(the_spu->dispatch_table), name );*/
/*crDebug( "Done initializing the dispatch table for SPU %s, calling the self function", name );*/
/*crDebug( "Done with the self function" );*/
return the_spu;
}
/**
* Load the entire chain of SPUs and initialize all of them.
* This function returns the first one in the chain.
*/
SPU *
{
int i;
for (i = count-1 ; i >= 0 ; i--)
{
/* This call passes the previous version of spu, which is the SPU's
* "child" in this chain. */
if (!the_spu) {
return NULL;
}
{
/* keep track of this so that people can pass functions through but
* still get updated when API's change on the fly. */
{
}
}
}
return child_spu;
}
#if 00
/* XXXX experimental code - not used at this time */
/**
* Like crSPUChangeInterface(), but don't loop over all functions in
* the table to search for 'old_func'.
*/
void
void *newFunc)
{
struct _copy_list_node *temp;
return;
*f = newFunc;
/* update all copies of this table */
#if 1
{
}
#endif
{
}
#if 0
{
}
#endif
}
#endif
/**
* Call the cleanup() function for each SPU in a chain, close the SPU
* DLLs and free the SPU objects.
* \param headSPU pointer to the first SPU in the chain
*/
void
{
while (the_spu)
{
}
}