interp.c File Reference

VM Interpreter. More...

#include "pm.h"

Defines

#define __FILE_ID__   0x09

Functions

PmReturn_t interpret (const uint8_t returnOnNoThreads)
PmReturn_t interp_reschedule (void)
PmReturn_t interp_addThread (pPmFunc_t pfunc)
void interp_setRescheduleFlag (uint8_t boolean)

Variables

PmReturn_t(* std_nat_fxn_table [])(pPmFrame_t *)
PmReturn_t(* usr_nat_fxn_table [])(pPmFrame_t *)


Detailed Description

VM Interpreter.

VM interpreter operations.


Function Documentation

PmReturn_t interp_addThread ( pPmFunc_t  pfunc  ) 

Creates a thread object and adds it to the queue of threads to be executed while interpret() is running.

The given obj may be a function, module, or class. Creates a frame for the given function.

Parameters:
pfunc Ptr to function to be executed as a thread.
Returns:
Return status

PmReturn_t interp_reschedule ( void   ) 

Selects a thread to run and changes the VM internal variables to let the switch-loop execute the chosen one in the next iteration. For the moment the algorithm is primitive and will change the thread each time it is called in a round-robin fashion.

void interp_setRescheduleFlag ( uint8_t  boolean  ) 

Sets the reschedule flag.

Parameters:
boolean Reschedule on next occasion if boolean is true; clear the flag otherwise.

PmReturn_t interpret ( const uint8_t  returnOnNoThreads  ) 

Interprets the available threads. Does not return.

Parameters:
returnOnNoThreads Loop forever if 0, exit with status if no more threads left.
Returns:
Return status if called with returnOnNoThreads != 0, will not return otherwise.


Generated on Wed Feb 24 13:37:02 2010 for Python-on-a-chip by  doxygen 1.5.9