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 <stdio.h>
|
---|
8 | #include "cr_spu.h"
|
---|
9 |
|
---|
10 | extern SPUNamedFunctionTable _cr_error_table[];
|
---|
11 |
|
---|
12 | static SPUFunctions error_functions = {
|
---|
13 | NULL, /* CHILD COPY */
|
---|
14 | NULL, /* DATA */
|
---|
15 | _cr_error_table /* THE ACTUAL FUNCTIONS */
|
---|
16 | };
|
---|
17 |
|
---|
18 | static SPUFunctions *errorSPUInit( int id, SPU *child, SPU *self,
|
---|
19 | unsigned int context_id,
|
---|
20 | unsigned int num_contexts )
|
---|
21 | {
|
---|
22 | (void) id;
|
---|
23 | (void) context_id;
|
---|
24 | (void) num_contexts;
|
---|
25 | (void) child;
|
---|
26 | (void) self;
|
---|
27 | return &error_functions;
|
---|
28 | }
|
---|
29 |
|
---|
30 | static void errorSPUSelfDispatch(SPUDispatchTable *parent)
|
---|
31 | {
|
---|
32 | (void)parent;
|
---|
33 | }
|
---|
34 |
|
---|
35 | static int errorSPUCleanup(void)
|
---|
36 | {
|
---|
37 | return 1;
|
---|
38 | }
|
---|
39 |
|
---|
40 | static SPUOptions errorSPUOptions[] = {
|
---|
41 | { NULL, CR_BOOL, 0, NULL, NULL, NULL, NULL, NULL },
|
---|
42 | };
|
---|
43 |
|
---|
44 |
|
---|
45 | int SPULoad( char **name, char **super, SPUInitFuncPtr *init,
|
---|
46 | SPUSelfDispatchFuncPtr *self, SPUCleanupFuncPtr *cleanup,
|
---|
47 | SPUOptionsPtr *options, int *flags )
|
---|
48 | {
|
---|
49 | #ifdef IN_GUEST
|
---|
50 | *name = "error";
|
---|
51 | #else
|
---|
52 | *name = "hosterror";
|
---|
53 | #endif
|
---|
54 | *super = NULL;
|
---|
55 | *init = errorSPUInit;
|
---|
56 | *self = errorSPUSelfDispatch;
|
---|
57 | *cleanup = errorSPUCleanup;
|
---|
58 | *options = errorSPUOptions;
|
---|
59 | *flags = (SPU_NO_PACKER|SPU_NOT_TERMINAL|SPU_MAX_SERVERS_ZERO);
|
---|
60 |
|
---|
61 | return 1;
|
---|
62 | }
|
---|