4 * \author Ram Kumar {ram@ee.ucla.edu}
7 #ifndef __DVM_TYPES_H__
8 #define __DVM_TYPES_H__
11 #include <VM/DvmConstants.h>
12 // Ram - For the rest of the data types look at Dvm.h !! :-)
15 //----------------------------------------------------------------------------
17 //----------------------------------------------------------------------------
18 #define NULL_CAPSULE (DVM_CAPSULE_NUM + 1)
19 #define DVM_STATE_SIZE sizeof(DvmState)
20 #define DVM_NUM_SCRIPT_BLOCKS 2
21 #define DVM_DEFAULT_MEM_ALLOC_SIZE (DVM_NUM_SCRIPT_BLOCKS*DVM_STATE_SIZE)
24 DvmState
*scripts
[DVM_CAPSULE_NUM
];
25 uint8_t script_block_owners
[DVM_NUM_SCRIPT_BLOCKS
];
26 DvmState
*script_block_ptr
;
27 } DVMResourceManager_state_t
;
31 uint8_t usedVars
[DVM_CAPSULE_NUM
][(DVM_LOCK_COUNT
+ 7) / 8];
34 uint8_t extlib_module
[4];
35 DvmLock locks
[DVM_LOCK_COUNT
];
36 } DVMConcurrencyMngr_state_t
;
39 func_cb_ptr ext_execute
[4];
41 DvmContext
* runningContext
;
45 uint8_t inErrorState
: 1;
46 uint8_t errorFlipFlop
: 1;
47 uint8_t taskRunning
: 1;
50 } DVMScheduler_state_t
;
53 DvmState
* stateBlock
[DVM_CAPSULE_NUM
];
54 } DVMEventHandler_state_t
;
58 uint8_t busy
; // for GET_DATA
59 DvmContext
*executing
; // for GET_DATA
60 DvmQueue getDataWaitQueue
; // for GET_DATA
61 DvmContext
*nop_executing
; // for NOP
62 uint16_t delay_cnt
; // for NOP
63 DvmDataBuffer buffers
[DVM_NUM_BUFS
];
64 DvmStackVariable shared_vars
[DVM_NUM_SHARED_VARS
];
65 int32_t fl_post
; //for posting a int32_t/float directly
66 } DVMBasiclib_state_t
;
69 typedef struct _str_dvm_state
{
70 func_cb_ptr execute_syncall
;
71 DVMScheduler_state_t sched_st
; // This should be the second field (because of fn. ptr. ptr.)
72 DVMResourceManager_state_t resmgr_st
;
73 DVMEventHandler_state_t evhdlr_st
;
74 DVMConcurrencyMngr_state_t conmgr_st
;
75 DVMBasiclib_state_t basiclib_st
;
79 #endif//__DVM_TYPES_H__