PageRenderTime 21ms CodeModel.GetById 12ms app.highlight 6ms RepoModel.GetById 1ms app.codeStats 0ms

/src/VBox/GuestHost/OpenGL/error/errorspu_init.c

https://gitlab.com/ufo/virtualbox-ose-3-1-8
C | 62 lines | 47 code | 10 blank | 5 comment | 0 complexity | 4757c55b1a79a7e8b900183105b5ee45 MD5 | raw file
 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
10extern SPUNamedFunctionTable _cr_error_table[];
11
12static SPUFunctions error_functions = {
13        NULL, /* CHILD COPY */
14        NULL, /* DATA */
15        _cr_error_table /* THE ACTUAL FUNCTIONS */
16};
17
18static 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
30static void errorSPUSelfDispatch(SPUDispatchTable *parent)
31{
32        (void)parent;
33}
34
35static int errorSPUCleanup(void)
36{
37        return 1;
38}
39
40static SPUOptions errorSPUOptions[] = {
41   { NULL, CR_BOOL, 0, NULL, NULL, NULL, NULL, NULL },
42};
43
44
45int 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}