Beispiel #1
0
static void		pipe_right(t_node *tree, int *pipe_fd, t_data *data)
{
	char	*line;
	off_t	offset;

	close(pipe_fd[1]);
	if (data->tmp_pipeout == -1)
		get_tmpfd(&data->tmp_pipeout, "/.temp_pipeout");
	else
	{
		remove_tmp("/.temp_pipeout");
		get_tmpfd(&data->tmp_pipeout, "/.temp_pipeout");
	}
	while (get_next_line(pipe_fd[0], &line) > 0)
	{
		ft_putendl_fd(line, data->tmp_pipeout);
		ft_strdel(&line);
	}
	offset = lseek(data->tmp_pipeout, 0, SEEK_CUR);
	lseek(data->tmp_pipeout, 0, SEEK_SET);
	update_offset(&data, offset);
	read_tree(tree->right);
	remove_tmp("/.temp_pipeout");
	if (g_pid.built == 0 || WEXITSTATUS(g_pid.id) != 0)
		exit(EXIT_FAILURE);
	else
		exit(EXIT_SUCCESS);
}
Beispiel #2
0
int appf_runtime_init(void)
{
    int ret,i;
    unsigned va, pa;
    struct appf_main_table* pmaintable = (struct appf_main_table*)reloc_addr((unsigned)&main_table);
    struct appf_cluster* pcluster;
    
    update_offset();
      
    /* TODO: read U bit */
    is_smp = FALSE;

    pa = reloc_addr((unsigned)&main_table);
    va = (unsigned)&main_table;
    if (pa == va)
    {
    	 __V(flat_mapped) = TRUE;
    }
 /*   
    if (__V(flat_mapped) == 0 && use_smc == 0)
    {
    		ret = 0;
        ret = appf_setup_translation_tables();
        if (ret < 0)
        {
            return ret;
        }
    }*/

    return appf_platform_runtime_init();
}
///need to create memory for this ui object too
void ui_element::tick()
{
    correct_bounds(*this);

    int r_id = hologram_manager::get_real_id(ref_id);

    hologram_manager::acquire(r_id);
    clEnqueueAcquireGLObjects(cl::cqueue, 1, &g_ui, 0, NULL, NULL);
    //cl::cqueue.finish();

    cl_uint global[2] = {(cl_uint)w, (cl_uint)h};

    cl_uint local[2] = {16, 8};

    cl_float2 offset = {finish.x - w/2.0f, finish.y - h/2.0f};

    compute::buffer coords = compute::buffer(cl::context, sizeof(cl_float2), CL_MEM_COPY_HOST_PTR, &offset);
    compute::buffer g_id = compute::buffer(cl::context, sizeof(cl_uint), CL_MEM_COPY_HOST_PTR, &id);

    arg_list id_arg_list;
    id_arg_list.push_back(&hologram_manager::g_tex_mem_base[r_id]);
    id_arg_list.push_back(&hologram_manager::g_tex_mem[r_id]);
    id_arg_list.push_back(&g_ui);
    id_arg_list.push_back(&coords);
    id_arg_list.push_back(&hologram_manager::g_id_bufs[r_id]);
    id_arg_list.push_back(&g_id);

    run_kernel_with_list(cl::blit_with_id, global, local, 2, id_arg_list, true);

    clEnqueueReleaseGLObjects(cl::cqueue, 1, &g_ui, 0, NULL, NULL);
    hologram_manager::release(r_id);

    update_offset();
    //time.stop();
}
Beispiel #4
0
int Random::myrandom(int burst)
{
    int randval = Random::randvals[offset] % burst;

    update_offset();

    return randval;
}
Beispiel #5
0
int appf_boottime_init(void)
{
    /* Set up stack pointers per CPU, per cluster */
    /* Discover devices, set up tables */
		update_offset();
    appf_platform_boottime_init();

    *((unsigned*)reloc_addr((unsigned)&appf_runtime_call_flat_mapped)) = (unsigned)appf_runtime_call;
    *((unsigned*)reloc_addr((unsigned)&appf_device_memory_flat_mapped)) = reloc_addr((unsigned)appf_device_memory);
		appf_setup_translation_tables();
    return 0;
}
Beispiel #6
0
static gboolean
knob_button_release_event(CcItem        * knob,
                          CcView        * view,
                          GdkEventButton* ev)
{
    gdouble* offset = g_object_get_data(G_OBJECT(knob), "CccDemoKnobOffset");
    if(knob == knobs[0] || knob == knobs[2]) {
        cc_circle_set_anchor(CC_CIRCLE(knob), ev->x + offset[0], ev->y + offset[1]);
        update_box();
    }
    else {
        update_offset(ev->x, ev->y);
    }
    g_object_set_data(G_OBJECT(knob), "CccDemoKnobOffset", NULL);
    cc_view_ungrab_item(view, CC_ITEM(knob), ev->time);
    return TRUE;
}
Beispiel #7
0
static gboolean
knob_motion_notify_event(CcItem        * knob,
                         CcView        * view,
                         GdkEventMotion* ev)
{
    gdouble* offset = g_object_get_data(G_OBJECT(knob), "CccDemoKnobOffset");
    if(G_LIKELY(offset)) {
        if(knob == knobs[0] || knob == knobs[2]) {
            cc_circle_set_anchor(CC_CIRCLE(knob), ev->x + offset[0], ev->y + offset[1]);
            update_box();
        }
        else {
            update_offset(ev->x, ev->y);
        }
        return TRUE;
    }
    return FALSE;
}