c591f4ad9208815e17a3d0179b5e4c0a881a5c0f
[sphoot.git] / src / ecore / ecore.c
1 #include "ecore.h"
2
3 #include "rreq.h"
4 #include "render.h"
5
6 e_memseg_t shared_mem;
7 shm_region_t *shm_region;
8
9 int main() {
10     e_shm_attach(&shared_mem, "raytrace_shm");
11
12     shm_region = (void *)(shared_mem.ephy_base);
13
14     setup_range_request();
15
16     e_coreid_t eid = e_get_coreid();
17     unsigned x, y;
18     e_coords_from_coreid(eid, &x, &y);
19
20     e_irq_global_mask(E_FALSE);
21     e_irq_mask(E_USER_INT, E_FALSE);
22     e_irq_mask(E_MESSAGE_INT, E_FALSE);
23
24     int id = y*e_group_config.group_rows + x;
25     while(1) {
26         shm_region->msg[id] = 1;
27         request_new_range(id);
28         shm_region->msg[id] = 9;
29
30         for(int i = 0; i < NUM_OUT_ELEMENTS; i ++) {
31             out_buffer_ptr[i] = i+1;
32         }
33
34         // do rendering
35         render_finished();
36     }
37
38     return 0;
39 }