1 | /* Copyright (c) 2001, Stanford University
|
---|
2 | * All rights reserved
|
---|
3 | *
|
---|
4 | * See the file LICENSE.txt for information on redistributing this software.
|
---|
5 | */
|
---|
6 |
|
---|
7 | #include "cr_error.h"
|
---|
8 | #include "passthroughspu.h"
|
---|
9 |
|
---|
10 | static SPUFunctions passthrough_functions = {
|
---|
11 | NULL, /* CHILD COPY */
|
---|
12 | NULL, /* DATA */
|
---|
13 | _cr_passthrough_table /* THE ACTUAL FUNCTIONS */
|
---|
14 | };
|
---|
15 |
|
---|
16 | static SPUFunctions *
|
---|
17 | passthroughSPUInit( int id, SPU *child, SPU *self,
|
---|
18 | unsigned int context_id,
|
---|
19 | unsigned int num_contexts )
|
---|
20 | {
|
---|
21 | (void) id;
|
---|
22 | (void) self;
|
---|
23 | (void) context_id;
|
---|
24 | (void) num_contexts;
|
---|
25 |
|
---|
26 | if (child == NULL)
|
---|
27 | {
|
---|
28 | crError( "You can't load the passthrough SPU as the last SPU in a chain!" );
|
---|
29 | }
|
---|
30 | BuildPassthroughTable( child );
|
---|
31 | return &passthrough_functions;
|
---|
32 | }
|
---|
33 |
|
---|
34 | static void
|
---|
35 | passthroughSPUSelfDispatch(SPUDispatchTable *parent)
|
---|
36 | {
|
---|
37 | (void)parent;
|
---|
38 | }
|
---|
39 |
|
---|
40 | static int
|
---|
41 | passthroughSPUCleanup(void)
|
---|
42 | {
|
---|
43 | return 1;
|
---|
44 | }
|
---|
45 |
|
---|
46 | static SPUOptions passthroughSPUOptions[] = {
|
---|
47 | { NULL, CR_BOOL, 0, NULL, NULL, NULL, NULL, NULL },
|
---|
48 | };
|
---|
49 |
|
---|
50 |
|
---|
51 | int SPULoad( char **name, char **super, SPUInitFuncPtr *init,
|
---|
52 | SPUSelfDispatchFuncPtr *self, SPUCleanupFuncPtr *cleanup,
|
---|
53 | SPUOptionsPtr *options, int *flags )
|
---|
54 | {
|
---|
55 | *name = "passthrough";
|
---|
56 | *super = NULL;
|
---|
57 | *init = passthroughSPUInit;
|
---|
58 | *self = passthroughSPUSelfDispatch;
|
---|
59 | *cleanup = passthroughSPUCleanup;
|
---|
60 | *options = passthroughSPUOptions;
|
---|
61 | *flags = (SPU_NO_PACKER|SPU_NOT_TERMINAL|SPU_MAX_SERVERS_ZERO);
|
---|
62 |
|
---|
63 | return 1;
|
---|
64 | }
|
---|