changeset 3:8e51f5dd849f

candidate for final -- about to begin debugging
author Sean Halle <seanhalle@yahoo.com>
date Wed, 30 May 2012 15:04:01 -0700
parents a8a8c4193c9b
children 6643a6f47050
files VSs__Hello_World/EntryPoint.c VSs__Hello_World/SeedVP.c VSs__Hello_World/Task.c VSs__Hello_World/VSs__Hello_World.h
diffstat 4 files changed, 21 insertions(+), 12 deletions(-) [+]
line diff
     1.1 --- a/VSs__Hello_World/EntryPoint.c	Thu May 24 07:59:38 2012 -0700
     1.2 +++ b/VSs__Hello_World/EntryPoint.c	Wed May 30 15:04:01 2012 -0700
     1.3 @@ -21,7 +21,7 @@
     1.4   * functions do:
     1.5   *1) it creates the params for the seed processor, from the
     1.6   *    parameters passed into the entry-point function
     1.7 - *2) it calls SSR__create_seed_procr_and_do_work
     1.8 + *2) it calls SSR__create_seed_slave_and_do_work
     1.9   *3) it gets the return value from the params struc, frees the params struc,
    1.10   *    and returns the value from the function
    1.11   *
    1.12 @@ -31,7 +31,7 @@
    1.13   { 
    1.14        //create seed processor, start doing the work, and wait till done
    1.15        //This function is the "border crossing" between normal code and SSR
    1.16 -   VSs__create_seed_procr_and_do_work( &hello_world,
    1.17 +   VSs__create_seed_slave_and_do_work( &hello_world,
    1.18                                         NULL );
    1.19    
    1.20     return;
     2.1 --- a/VSs__Hello_World/SeedVP.c	Thu May 24 07:59:38 2012 -0700
     2.2 +++ b/VSs__Hello_World/SeedVP.c	Wed May 30 15:04:01 2012 -0700
     2.3 @@ -11,6 +11,10 @@
     2.4  #include <string.h>
     2.5  #include "VSs__Hello_World.h"
     2.6  
     2.7 +/*Global vars are part of the hello world task type.. NULL means not cntld*/
     2.8 +int32 helloWorldArgTypes[2] = {NULL, IN};
     2.9 +int32 helloWorldArgSizes[2] = {sizeof(int32), 16*16*sizeof(float)};
    2.10 +
    2.11  void hello_world( void *_params, SlaveVP *animPr )
    2.12   { int32 i;
    2.13   
    2.14 @@ -19,17 +23,19 @@
    2.15     // create all the task types
    2.16     helloWorldTaskType = VMS_App__malloc( sizeof(VSsTaskType) );
    2.17     helloWorldTaskType->fn = &hello_world_task;
    2.18 -   helloWorldTaskType->numArgs = 2;
    2.19 -   helloWorldTaskType->argTypes = &{NULL, IN};
    2.20 -   helloWorldTaskType->argSizes = {sizeof(int), 16*16*sizeof(float)};
    2.21 +   helloWorldTaskType->numCtldArgs  = 1;
    2.22 +   helloWorldTaskType->numTotalArgs = 2;
    2.23 +   helloWorldTaskType->sizeOfArgs   = sizeof(HelloWorldArgs);
    2.24 +   helloWorldTaskType->argTypes = helloWorldArgTypes;
    2.25 +   helloWorldTaskType->argSizes = helloWorldArgSizes;
    2.26  
    2.27     HelloWorldArgs args; //allocate on stack, VSs copies internally
    2.28     
    2.29     for( i = 0; i < 5; i++ )
    2.30      {
    2.31 -      args.dummy1 = i;
    2.32 -      args.dummy2 = VMS_App__malloc();
    2.33 -      VSs__submit_task( helloWorldTaskType, &args );
    2.34 +      args.dummy1 = VMS_App__malloc( 4 );
    2.35 +      args.dummy2 = i;
    2.36 +      VSs__submit_task( helloWorldTaskType, &args, animPr );
    2.37  	}
    2.38   }
    2.39  
     3.1 --- a/VSs__Hello_World/Task.c	Thu May 24 07:59:38 2012 -0700
     3.2 +++ b/VSs__Hello_World/Task.c	Wed May 30 15:04:01 2012 -0700
     3.3 @@ -11,11 +11,13 @@
     3.4  #include <string.h>
     3.5  #include "VSs__Hello_World.h"
     3.6   
     3.7 -void hello_world_task( void  *_args, SlaveVP *animPr )
     3.8 +void hello_world_task( void  *_args, SlaveVP *animSlv )
     3.9   { HelloWorldArgs *args;
    3.10  		 
    3.11     args = (HelloWorldArgs *)_args;
    3.12     
    3.13 -   printf("Hello World: %d, %f", args->dummy1, args->dummy2);
    3.14 +   printf("Hello World: %d, %d", args->dummy1, args->dummy2);
    3.15 +   
    3.16 +   VSs__end_task( animSlv );
    3.17   }
    3.18  
     4.1 --- a/VSs__Hello_World/VSs__Hello_World.h	Thu May 24 07:59:38 2012 -0700
     4.2 +++ b/VSs__Hello_World/VSs__Hello_World.h	Wed May 30 15:04:01 2012 -0700
     4.3 @@ -15,9 +15,10 @@
     4.4  
     4.5  //==============================  Structures  ==============================
     4.6  
     4.7 +//NOTE: controlled args must come first, accessible as array of ptrs
     4.8  typedef struct
     4.9 - { int32  dummy1;
    4.10 -   int32 *dummy2;
    4.11 + { int32 *dummy1;  //This is a controlled arg -- VSs uses to calc depenencies
    4.12 +   int32  dummy2;  //This is a normal arg, ignored by VSs
    4.13   }
    4.14  HelloWorldArgs;
    4.15