spuload.c revision 753b2807843903eee704f9f61bdda82113e27788
/* 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
#define DLL_SUFFIX ".dll"
#define DLL_PREFIX "VBoxOGL"
#define DLL_SUFFIX ".dylib"
#define DLL_PREFIX "VBoxOGL"
/*
#define DLL_SUFFIX ".bundle"
#define DLL_PREFIX ""
*/
#else
#ifdef AIX
#define DLL_SUFFIX ".o"
#define DLL_PREFIX "VBoxOGL"
#else
#define DLL_SUFFIX ".so"
#define DLL_PREFIX "VBoxOGL"
#endif
#endif
{
static char path[8092];
if (!dir)
{
#if defined(DARWIN)
char szSharedLibPath[8092];
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;
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)
{
}
}