2 * ===================================================================== */
5 #include "../esrc/Gen.h"
10 shm_t shm SECTION(".shared_dram");
13 * ===================================================================== */
14 struct _DOL_wptr Gen_wptr = {
16 {0,0,0,0} /* instance */
20 DOLProcess Gen_process = {
27 /* Port Read/Write Functions
28 * ===================================================================== */
29 int size_0 (void) { return(size_shm (&shm.buf0)); }
30 int level_0(void) { return(level_shm(&shm.buf0)); }
31 int read_0 (void *buf, int len) { return(read_shm (&shm.buf0, buf, len)); }
32 int write_0(void *buf, int len) { return(write_shm(&shm.buf0, buf, len)); }
35 * ===================================================================== */
37 port_t ports[NUM_PORTS] = {
38 { "0", size_0, level_0, NULL, write_0},
41 port_t *get_port(void *port)
43 for(int i = 0; i < NUM_PORTS; i++) {
44 if(!strncmp(ports[i].name, port, PORTNAME_MAXLEN)) {
53 * ===================================================================== */
56 int index = core_id2lin(e_get_coreid());
59 Gen_process.init((struct _DOLProcess_struct*)&Gen_process);
60 while(Gen_process.wptr->active) {
61 shm.states[index] = ++state;
62 Gen_process.fire((struct _DOLProcess_struct*)&Gen_process);
65 shm.states[index] = -1;