当前位置: 首页>>代码示例>>C++>>正文


C++ COPY函数代码示例

本文整理汇总了C++中COPY函数的典型用法代码示例。如果您正苦于以下问题:C++ COPY函数的具体用法?C++ COPY怎么用?C++ COPY使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了COPY函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: MESH_Create


//.........这里部分代码省略.........
  ERRMEM (msh->nodes = static_cast<REAL(*)[3]>(malloc (sizeof (REAL [3]) * (msh->nodes_count))));
  msh->surfeles_count = msh->bulkeles_count = 0;
  msh->surfeles = msh->bulkeles = NULL;

  /* set up elements */
  for (ele = elist; ele; ele = enx)
  {
    enx = ele->next;

    if (minimal_node > 0) /* impose 0-based indexing */
    {
      for (temp = 0; temp < ele->type; temp ++)
	ele->nodes [temp] -= minimal_node;
    }

    ele->prev = NULL;
   
    if (ele->neighs < neighs (ele->type)) /* surface element */
    {
      msh->surfeles_count ++;
      ele->next = msh->surfeles;
      if (msh->surfeles) msh->surfeles->prev = ele;
      msh->surfeles = ele;
    }
    else /* bulk element */
    {
      msh->bulkeles_count ++;
      ele->next = msh->bulkeles;
      if (msh->bulkeles) msh->bulkeles->prev = ele;
      msh->bulkeles = ele;
    }
  }

  /* create surfaces map => skip first element of 'surfaces' == the global surface kind */
  for (eleptr = (surfaces + 1), smap = NULL, temp = 0;
    eleptr [0]; eleptr += (eleptr [0]+2), temp ++)
  {
    fac = static_cast<FACE*>(MEM_Alloc (&facmem));
    
    ASSERT (
      eleptr [0] == 3 || /* triangle */
      eleptr [0] == 4,   /* quad */
      "ERROR: unsupported face type");

    fac->type = eleptr [0];
    for (n = 0; n < eleptr [0]; n ++)
      fac->nodes [n] = eleptr [n+1];
    sort (fac->nodes, fac->nodes+fac->type-1);

    fac->color = eleptr [eleptr [0] + 1];
    MAP_Insert (&mapmem, &smap, fac, /* map by the type/nodes key */
      fac, face_compare);
  }

  /* set up nodes */
  for (temp = minimal_node,
       node = msh->nodes;
       temp <= maximal_node;
       temp ++, node ++)
  {
    COPY (nodes [temp], *node);
  }

  /* set up faces */
  for (fac = flist; fac; fac = fac->next)
  {
    if (fac->ele) /* see (***) */
    {
      ele = fac->ele;

      cac = static_cast<FACE*>(MEM_Alloc (&msh->facmem));
      setup_face (ele, fac->index, cac, 0); /* setup face nodes without sorting them */
      cac->index = fac->index;
      cac->ele = fac->ele;
      setup_normal (msh->nodes, cac); /* calculate outer spatial normal */
      cac->next = ele->faces; /* append element face list */
      ele->faces = cac;

      /* set the mapped surface kind if possible => otherwise the global one */
      gac = static_cast<FACE*>(MAP_Find (smap, fac, face_compare));
      cac->color = (gac ? gac->color : surfaces [0]);
    }
  }

  /* create mesh face list */
  for (ele = msh->surfeles; ele; ele = ele->next)
  {
    for (fac = ele->faces; fac; fac = fac->next)
    {
      fac->n = msh->faces;
      msh->faces = fac;
    }
  }

  /* clean up */
  MEM_Release (&facmem);
  MEM_Release (&mapmem);

  return msh;
}
开发者ID:tkoziara,项目名称:parmec,代码行数:101,代码来源:mesh.cpp

示例2: setup_rt_frame

static int setup_rt_frame(int signr, struct k_sigaction *ka, siginfo_t *info,
			   sigset_t *set, struct pt_regs *regs)
{
	struct rt_sigframe __user *frame;
	unsigned long __user *retcode;
	int err = 0;

	frame = get_sigframe(ka, regs, sizeof(*frame));

	if (!access_ok(VERIFY_WRITE, frame, sizeof(*frame)))
		goto segv_and_exit;

	err |= __put_user(&frame->info, &frame->pinfo);
	err |= __put_user(&frame->uc, &frame->puc);
	err |= copy_siginfo_to_user(&frame->info, info);

	/* Clear all the bits of the ucontext we don't use.  */
	err |= __clear_user(&frame->uc, offsetof(struct ucontext, uc_mcontext));

	err |= setup_sigcontext(&frame->uc.uc_mcontext,	regs, set->sig[0]);
	err |= __copy_to_user(&frame->uc.uc_sigmask, set, sizeof(*set));

	/* Set up to return from userspace */
	retcode = (unsigned long __user *) &frame->retcode;

	/* The access_ok check was done above, so use __put_user here */
#define COPY(x) (err |= __put_user(x, retcode++))

	COPY(0x0000002AUL | (__NR_rt_sigreturn << 7));
				/* MVK __NR_rt_sigreturn,B0 */
	COPY(0x10000000UL);	/* SWE */
	COPY(0x00006000UL);	/* NOP 4 */
	COPY(0x00006000UL);	/* NOP 4 */
	COPY(0x00006000UL);	/* NOP 4 */
	COPY(0x00006000UL);	/* NOP 4 */
	COPY(0x00006000UL);	/* NOP 4 */
	COPY(0x00006000UL);	/* NOP 4 */
	COPY(0x00006000UL);	/* NOP 4 */

#undef COPY

	if (err)
		goto segv_and_exit;

	flush_icache_range((unsigned long) &frame->retcode,
			   (unsigned long) &frame->retcode + RETCODE_SIZE);

	retcode = (unsigned long __user *) &frame->retcode;

	/* Change user context to branch to signal handler */
	regs->sp = (unsigned long) frame - 8;
	regs->b3 = (unsigned long) retcode;
	regs->pc = (unsigned long) ka->sa.sa_handler;

	/* Give the signal number to the handler */
	regs->a4 = signr;

	/*
	 * For realtime signals we must also set the second and third
	 * arguments for the signal handler.
	 *   -- Peter Maydell <[email protected]> 2000-12-06
	 */
	regs->b4 = (unsigned long)&frame->info;
	regs->a6 = (unsigned long)&frame->uc;

	return 0;

segv_and_exit:
	force_sigsegv(signr, current);
	return -EFAULT;
}
开发者ID:01org,项目名称:KVMGT-kernel,代码行数:71,代码来源:signal.c

示例3: setup_sigcontext

static int
setup_sigcontext(struct sigcontext __user *sc, struct pt_regs *regs,
	         unsigned long mask)
{
	int err = 0;

#define COPY(x)	err |= __put_user(regs->x, &sc->sc_##x)
	COPY(r4);
	COPY(r5);
	COPY(r6);
	COPY(pt_regs);
	COPY(r0);
	COPY(r1);
	COPY(r2);
	COPY(r3);
	COPY(r7);
	COPY(r8);
	COPY(r9);
	COPY(r10);
	COPY(r11);
	COPY(r12);
	COPY(acc0h);
	COPY(acc0l);
	COPY(acc1h);		/* ISA_DSP_LEVEL2 only */
	COPY(acc1l);		/* ISA_DSP_LEVEL2 only */
	COPY(psw);
	COPY(bpc);
	COPY(bbpsw);
	COPY(bbpc);
	COPY(spu);
	COPY(fp);
	COPY(lr);
	COPY(spi);
#undef COPY

	err |= __put_user(mask, &sc->oldmask);

	return err;
}
开发者ID:01org,项目名称:thunderbolt-software-kernel-tree,代码行数:39,代码来源:signal.c

示例4: restore_sigcontext

static int
restore_sigcontext(struct pt_regs *regs, struct sigcontext __user *sc, long long *r2_p)
{
	unsigned int err = 0;
        unsigned long long current_sr, new_sr;
#define SR_MASK 0xffff8cfd

#define COPY(x)		err |= __get_user(regs->x, &sc->sc_##x)

	COPY(regs[0]);	COPY(regs[1]);	COPY(regs[2]);	COPY(regs[3]);
	COPY(regs[4]);	COPY(regs[5]);	COPY(regs[6]);	COPY(regs[7]);
	COPY(regs[8]);	COPY(regs[9]);  COPY(regs[10]);	COPY(regs[11]);
	COPY(regs[12]);	COPY(regs[13]);	COPY(regs[14]);	COPY(regs[15]);
	COPY(regs[16]);	COPY(regs[17]);	COPY(regs[18]);	COPY(regs[19]);
	COPY(regs[20]);	COPY(regs[21]);	COPY(regs[22]);	COPY(regs[23]);
	COPY(regs[24]);	COPY(regs[25]);	COPY(regs[26]);	COPY(regs[27]);
	COPY(regs[28]);	COPY(regs[29]);	COPY(regs[30]);	COPY(regs[31]);
	COPY(regs[32]);	COPY(regs[33]);	COPY(regs[34]);	COPY(regs[35]);
	COPY(regs[36]);	COPY(regs[37]);	COPY(regs[38]);	COPY(regs[39]);
	COPY(regs[40]);	COPY(regs[41]);	COPY(regs[42]);	COPY(regs[43]);
	COPY(regs[44]);	COPY(regs[45]);	COPY(regs[46]);	COPY(regs[47]);
	COPY(regs[48]);	COPY(regs[49]);	COPY(regs[50]);	COPY(regs[51]);
	COPY(regs[52]);	COPY(regs[53]);	COPY(regs[54]);	COPY(regs[55]);
	COPY(regs[56]);	COPY(regs[57]);	COPY(regs[58]);	COPY(regs[59]);
	COPY(regs[60]);	COPY(regs[61]);	COPY(regs[62]);
	COPY(tregs[0]);	COPY(tregs[1]);	COPY(tregs[2]);	COPY(tregs[3]);
	COPY(tregs[4]);	COPY(tregs[5]);	COPY(tregs[6]);	COPY(tregs[7]);

        /* Prevent the signal handler manipulating SR in a way that can
           crash the kernel. i.e. only allow S, Q, M, PR, SZ, FR to be
           modified */
        current_sr = regs->sr;
        err |= __get_user(new_sr, &sc->sc_sr);
        regs->sr &= SR_MASK;
        regs->sr |= (new_sr & ~SR_MASK);

	COPY(pc);

#undef COPY

	/* Must do this last in case it sets regs->sr.fd (i.e. after rest of sr
	 * has been restored above.) */
	err |= restore_sigcontext_fpu(regs, sc);

	regs->syscall_nr = -1;		/* disable syscall checks */
	err |= __get_user(*r2_p, &sc->sc_regs[REG_RET]);
	return err;
}
开发者ID:Aircell,项目名称:asp-kernel,代码行数:48,代码来源:signal_64.c

示例5: pathname_name1

void pathname_name1(CL_FORM *base)
{
	COPY(ARG(0), ARG(2));
	LOAD_SYMBOL(SYMBOL(Slisp, 234), ARG(3));	/* PATHNAME */
	rt_struct_typep(ARG(2));
	if(CL_TRUEP(ARG(2)))
	{
		COPY(ARG(0), ARG(2));
	}
	else
	{
		COPY(ARG(0), ARG(2));
		Fstringp(ARG(2));
		if(CL_TRUEP(ARG(2)))
		{
			COPY(ARG(0), ARG(2));
			LOAD_NIL(ARG(3));
			COPY(SYMVAL(Slisp, 233), ARG(4));	/* *DEFAULT-PATHNAME-DEFAULTS* */
			LOAD_FIXNUM(ARG(5), 0, ARG(5));
			LOAD_NIL(ARG(6));
			LOAD_NIL(ARG(7));
			parse_namestring1(ARG(2));
			mv_count = 1;
		}
		else
		{
			COPY(ARG(0), ARG(2));
			LOAD_SYMBOL(SYMBOL(Slisp, 64), ARG(3));	/* STREAM */
			rt_struct_typep(ARG(2));
			if(CL_TRUEP(ARG(2)))
			{
				COPY(ARG(0), ARG(2));
				LOAD_NIL(ARG(3));
				file_name1(ARG(2));
				COPY(SYMVAL(Slisp, 233), ARG(3));	/* *DEFAULT-PATHNAME-DEFAULTS* */
				COPY(ARG(2), ARG(4));
				LOAD_NIL(ARG(5));
				COPY(ARG(3), ARG(6));
				LOAD_FIXNUM(ARG(7), 0, ARG(7));
				LOAD_NIL(ARG(8));
				LOAD_NIL(ARG(9));
				parse_namestring1(ARG(4));
				mv_count = 1;
				COPY(ARG(4), ARG(2));
			}
			else
			{
				LOAD_SMSTR((CL_FORM *)&Kpathname_name1[0], ARG(2));	/* etypecase: the value ~a is not a legal value */
				COPY(ARG(0), ARG(3));
				Ferror(ARG(2), 2);
			}
		}
	}
	COPY(ARG(2), ARG(3));
	LOAD_SYMBOL(SYMBOL(Slisp, 234), ARG(4));	/* PATHNAME */
	rt_struct_typep(ARG(3));
	if(CL_TRUEP(ARG(3)))
	{
		COPY(OFFSET(AR_BASE(GET_FORM(ARG(2))), 3 + 1), ARG(3));
	}
	else
	{
		COPY(SYMVAL(Slisp, 352), ARG(3));	/* NO_STRUCT */
		COPY(ARG(2), ARG(4));
		LOAD_SYMBOL(SYMBOL(Slisp, 234), ARG(5));	/* PATHNAME */
		Ferror(ARG(3), 3);
	}
	if(CL_SYMBOLP(ARG(1)) && GET_SYMBOL(ARG(1)) == SYMBOL(Slisp, 278))	/* COMMON */
	{
		COPY(ARG(2), ARG(4));
		LOAD_SYMBOL(SYMBOL(Slisp, 234), ARG(5));	/* PATHNAME */
		rt_struct_typep(ARG(4));
		if(CL_TRUEP(ARG(4)))
		{
			COPY(OFFSET(AR_BASE(GET_FORM(ARG(2))), 0 + 1), ARG(4));
		}
		else
		{
			COPY(SYMVAL(Slisp, 352), ARG(4));	/* NO_STRUCT */
			COPY(ARG(2), ARG(5));
			LOAD_SYMBOL(SYMBOL(Slisp, 234), ARG(6));	/* PATHNAME */
			Ferror(ARG(4), 3);
		}
		COPY(ARG(4), ARG(5));
		LOAD_SYMBOL(SYMBOL(Slisp, 263), ARG(6));	/* HOST */
		rt_struct_typep(ARG(5));
		if(CL_TRUEP(ARG(5)))
		{
			COPY(OFFSET(AR_BASE(GET_FORM(ARG(4))), 6 + 1), ARG(4));
		}
		else
		{
			COPY(SYMVAL(Slisp, 352), ARG(5));	/* NO_STRUCT */
			COPY(ARG(4), ARG(6));
			LOAD_SYMBOL(SYMBOL(Slisp, 263), ARG(7));	/* HOST */
			Ferror(ARG(5), 3);
		}
		LOAD_BOOL(CL_SYMBOLP(ARG(4)) && GET_SYMBOL(ARG(4)) == SYMBOL(Slisp, 279), ARG(4));	/* LOWER */
	}
	else
//.........这里部分代码省略.........
开发者ID:hoelzl,项目名称:Clicc,代码行数:101,代码来源:lisp128.c

示例6: walk

static void
walk (struct state *st, int dir)
{
    register int    incr = 0;

    if (dir & (LEFT | RIGHT))
    {				/* left/right movement (mabye up/st->down too) */
	st->walk_up = -st->walk_up;		/* bouncing effect (even if hit a wall) */
	if (dir & LEFT)
	{
	    incr = X_INCR;
	    st->walk_frame = (st->walk_up < 0) ? st->left1 : st->left2;
	}
	else
	{
	    incr = -X_INCR;
	    st->walk_frame = (st->walk_up < 0) ? st->right1 : st->right2;
	}
	if ((st->walk_lastdir == FRONT || st->walk_lastdir == DOWN) && dir & UP)
	{

	    /*
	     * workaround silly bug that leaves screen dust when guy is
	     * facing forward or st->down and moves up-left/right.
	     */
	    COPY(st->dpy, st->walk_frame, st->window, st->fg_gc, 0, 0, 64, 64, st->x, st->y);
	}
	/* note that maybe neither UP nor DOWN is set! */
	if (dir & UP && st->y > Y_INCR)
	    st->y -= Y_INCR;
	else if (dir & DOWN && st->y < st->Height - 64)
	    st->y += Y_INCR;
    }
    /* Explicit up/st->down movement only (no left/right) */
    else if (dir == UP)
	COPY(st->dpy, st->front, st->window, st->fg_gc, 0, 0, 64, 64, st->x, st->y -= Y_INCR);
    else if (dir == DOWN)
	COPY(st->dpy, st->down, st->window, st->fg_gc, 0, 0, 64, 64, st->x, st->y += Y_INCR);
    else if (dir == FRONT && st->walk_frame != st->front)
    {
	if (st->walk_up > 0)
	    st->walk_up = -st->walk_up;
	if (st->walk_lastdir & LEFT)
	    st->walk_frame = st->left_front;
	else if (st->walk_lastdir & RIGHT)
	    st->walk_frame = st->right_front;
	else
	    st->walk_frame = st->front;
	COPY(st->dpy, st->walk_frame, st->window, st->fg_gc, 0, 0, 64, 64, st->x, st->y);
    }
    if (dir & LEFT)
	while (--incr >= 0)
	{
	    COPY(st->dpy, st->walk_frame, st->window, st->fg_gc, 0, 0, 64, 64, --st->x, st->y + st->walk_up);
	}
    else if (dir & RIGHT)
	while (++incr <= 0)
	{
	    COPY(st->dpy, st->walk_frame, st->window, st->fg_gc, 0, 0, 64, 64, ++st->x, st->y + st->walk_up);
	}
    st->walk_lastdir = dir;
}
开发者ID:Davidchristy,项目名称:Game-of-Life-Screen-Saver,代码行数:62,代码来源:noseguy.c

示例7: FcharGE

void FcharGE(CL_FORM *base, int nargs)
{
	CL_FORM *rest_0;
	CL_FORM *local;
	rest_0 = ARG(1);
	local = ARG(nargs);
	{
		CL_FORM *rest_1;
		LOAD_NIL(LOCAL(0));
		rest_1 = rest_0;
		M1_1:;
		if(NOT(REST_NOT_EMPTY(rest_1)))
		{
			LOAD_NIL(LOCAL(0));
			LOAD_SYMBOL(SYMBOL(Slisp, 48), ARG(0));	/* T */
			goto RETURN1;
		}
		{
			CL_FORM *rest_2;
			rest_2 = rest_1;
			REST_CAR(rest_2, LOCAL(0));
		}
		if(CL_CHARP(ARG(0)))
		{
			COPY(ARG(0), LOCAL(1));
		}
		else
		{
			COPY(SYMVAL(Slisp, 58), LOCAL(1));	/* WRONG_TYPE */
			COPY(ARG(0), LOCAL(2));
			LOAD_SYMBOL(SYMBOL(Slisp, 18), LOCAL(3));	/* CHARACTER */
			Ferror(LOCAL(1), 3);
		}
		rt_char_code(LOCAL(1));
		if(CL_CHARP(LOCAL(0)))
		{
			COPY(LOCAL(0), LOCAL(2));
		}
		else
		{
			COPY(SYMVAL(Slisp, 58), LOCAL(2));	/* WRONG_TYPE */
			COPY(LOCAL(0), LOCAL(3));
			LOAD_SYMBOL(SYMBOL(Slisp, 18), LOCAL(4));	/* CHARACTER */
			Ferror(LOCAL(2), 3);
		}
		rt_char_code(LOCAL(2));
		Flt(LOCAL(1), 2);
		if(CL_TRUEP(LOCAL(1)))
		{
			LOAD_NIL(ARG(0));
			goto RETURN1;
		}
		COPY(LOCAL(0), ARG(0));
		{
			CL_FORM *rest_3;
			rest_3 = rest_1;
			rest_1 = REST_CDR(rest_3);
		}
		goto M1_1;
	}
	RETURN1:;
}
开发者ID:plops,项目名称:clicc,代码行数:62,代码来源:FcharGE.c

示例8: restore_sigcontext

static int
restore_sigcontext(struct pt_regs *regs, struct sigcontext __user *sc,
		   int *r0_p)
{
	unsigned int err = 0;

	/* Always make any pending restarted system calls return -EINTR */
	current_thread_info()->restart_block.fn = do_no_restart_syscall;

#define COPY(x)		err |= __get_user(regs->x, &sc->sc_##x)
	COPY(r4);
	COPY(r5);
	COPY(r6);
	COPY(pt_regs);
	/* COPY(r0); Skip r0 */
	COPY(r1);
	COPY(r2);
	COPY(r3);
	COPY(r7);
	COPY(r8);
	COPY(r9);
	COPY(r10);
	COPY(r11);
	COPY(r12);
#if defined(CONFIG_ISA_M32R2) && defined(CONFIG_ISA_DSP_LEVEL2)
	COPY(acc0h);
	COPY(acc0l);
	COPY(acc1h);
	COPY(acc1l);
#elif defined(CONFIG_ISA_M32R2) || defined(CONFIG_ISA_M32R)
	COPY(acch);
	COPY(accl);
#else
#error unknown isa configuration
#endif
	COPY(psw);
	COPY(bpc);
	COPY(bbpsw);
	COPY(bbpc);
	COPY(spu);
	COPY(fp);
	COPY(lr);
	COPY(spi);
#undef COPY

	regs->syscall_nr = -1;	/* disable syscall checks */
	err |= __get_user(*r0_p, &sc->sc_r0);

	return err;
}
开发者ID:GodFox,项目名称:magx_kernel_xpixl,代码行数:50,代码来源:signal.c

示例9: vector_push_extend1

void vector_push_extend1(CL_FORM *base)
{
	COPY(ARG(1), ARG(3));
	Farray_has_fill_pointer_p(ARG(3));
	if(CL_TRUEP(ARG(3)))
	{
	}
	else
	{
		COPY(SYMVAL(Slisp, 154), ARG(3));	/* NO_FILL_PTR */
		COPY(ARG(1), ARG(4));
		Ferror(ARG(3), 2);
	}
	COPY(ARG(1), ARG(3));
	LOAD_SYMBOL(SYMBOL(Slisp, 150), ARG(4));	/* COMPLEX-VECTOR */
	rt_struct_typep(ARG(3));
	if(CL_TRUEP(ARG(3)))
	{
		COPY(OFFSET(AR_BASE(GET_FORM(ARG(1))), 3 + 1), ARG(3));
	}
	else
	{
		COPY(SYMVAL(Slisp, 352), ARG(3));	/* NO_STRUCT */
		COPY(ARG(1), ARG(4));
		LOAD_SYMBOL(SYMBOL(Slisp, 150), ARG(5));	/* COMPLEX-VECTOR */
		Ferror(ARG(3), 3);
	}
	COPY(ARG(3), ARG(4));
	COPY(ARG(1), ARG(5));
	Farray_total_size(ARG(5));
	Fge(ARG(4), 2);
	if(CL_TRUEP(ARG(4)))
	{
		COPY(ARG(1), ARG(4));
		if(CL_TRUEP(ARG(2)))
		{
			COPY(ARG(1), ARG(5));
			Farray_total_size(ARG(5));
			COPY(ARG(2), ARG(6));
			Fplus(ARG(5), 2);
		}
		else
		{
			LOAD_FIXNUM(ARG(5), 2, ARG(5));
			COPY(ARG(1), ARG(6));
			Farray_total_size(ARG(6));
			Fmult(ARG(5), 2);
		}
		LOAD_NIL(ARG(6));
		LOAD_NIL(ARG(7));
		LOAD_NIL(ARG(8));
		COPY(ARG(3), ARG(9));
		LOAD_NIL(ARG(10));
		LOAD_NIL(ARG(11));
		LOAD_SYMBOL(SYMBOL(Slisp, 101), ARG(12));	/* FILL-POINTER */
		COPY(ARG(3), ARG(13));
		Flist(ARG(12), 2);
		LOAD_NIL(ARG(13));
		LOAD_SYMBOL(SYMBOL(Slisp, 48), ARG(14));	/* T */
		adjust_array1(ARG(4));
	}
	COPY(ARG(0), ARG(4));
	COPY(ARG(1), ARG(5));
	COPY(ARG(3), ARG(6));
	rt_set_vref(ARG(4));
	COPY(ARG(3), ARG(4));
	F1plus(ARG(4));
	COPY(ARG(1), ARG(5));
	Fset_fill_pointer(ARG(4));
	COPY(ARG(3), ARG(0));
}
开发者ID:hoelzl,项目名称:Clicc,代码行数:71,代码来源:lisp143.c

示例10: shadowing_import1

void shadowing_import1(CL_FORM *base)
{
	coerce_to_package(ARG(1));
	if(CL_LISTP(ARG(0)))
	{
	}
	else
	{
		COPY(ARG(0), ARG(2));
		Flist(ARG(2), 1);
		COPY(ARG(2), ARG(0));
	}
	LOAD_NIL(ARG(2));
	COPY(ARG(0), ARG(3));
	M1_1:;
	if(CL_ATOMP(ARG(3)))
	{
		LOAD_NIL(ARG(2));
		goto RETURN1;
	}
	COPY(ARG(3), ARG(4));
	COPY(GET_CAR(ARG(4)), ARG(2));
	if(CL_SYMBOLP(ARG(2)))
	{
		LOAD_SMSTR(SYM_NAME(ARG(2)), ARG(4));
	}
	else
	{
		if(CL_TRUEP(ARG(2)))
		{
			COPY(SYMVAL(Slisp, 676), ARG(4));	/* SYM_EXPECTED */
			COPY(ARG(2), ARG(5));
			Ferror(ARG(4), 2);
		}
		else
		{
			LOAD_SMSTR((CL_FORM *)&KClisp[266], ARG(4));	/* NIL */
		}
	}
	COPY(ARG(1), ARG(5));
	find_symbol1(ARG(4));
	COPY(&mv_buf[0], ARG(5));
	{
		int nargs;
		nargs = 2;
		mv_count = 1;
		{
			switch(nargs)
			{
				case 0:
				LOAD_NIL(ARG(4));
				case 1:
				LOAD_NIL(ARG(5));
				nargs = 2;
			}
			if(CL_SYMBOLP(ARG(2)))
			{
				LOAD_SMSTR(SYM_NAME(ARG(2)), ARG(6));
			}
			else
			{
				if(CL_TRUEP(ARG(2)))
				{
					COPY(SYMVAL(Slisp, 676), ARG(6));	/* SYM_EXPECTED */
					COPY(ARG(2), ARG(7));
					Ferror(ARG(6), 2);
				}
				else
				{
					LOAD_SMSTR((CL_FORM *)&KClisp[266], ARG(6));	/* NIL */
				}
			}
			LOAD_FIXNUM(ARG(7), 101, ARG(7));
			COPY(ARG(6), ARG(8));
			string_to_simple_string(ARG(8));
			rt_sxhash_string(ARG(8));
			COPY(ARG(8), ARG(9));
			LOAD_FIXNUM(ARG(10), 101, ARG(10));
			rt_floor(ARG(9));
			COPY(&mv_buf[0], ARG(10));
			mv_count = 1;
			{
				COPY(ARG(10), ARG(6));
			}
			if(CL_SYMBOLP(ARG(5)) && GET_SYMBOL(ARG(5)) == SYMBOL(Slisp, 384))	/* INTERNAL */
			{
				COPY(ARG(4), ARG(7));
				COPY(ARG(1), ARG(8));
				LOAD_SYMBOL(SYMBOL(Slisp, 354), ARG(9));	/* PACKAGE */
				rt_struct_typep(ARG(8));
				if(CL_TRUEP(ARG(8)))
				{
					COPY(OFFSET(AR_BASE(GET_FORM(ARG(1))), 2 + 1), ARG(8));
				}
				else
				{
					COPY(SYMVAL(Slisp, 352), ARG(8));	/* NO_STRUCT */
					COPY(ARG(1), ARG(9));
					LOAD_SYMBOL(SYMBOL(Slisp, 354), ARG(10));	/* PACKAGE */
					Ferror(ARG(8), 3);
//.........这里部分代码省略.........
开发者ID:hoelzl,项目名称:Clicc,代码行数:101,代码来源:lisp105.c

示例11: restore_sigcontext

/*
 * do a signal return; undo the signal stack.
 */
static int restore_sigcontext(struct pt_regs *regs,
			      struct sigcontext __user *sc, long *_d0)
{
	unsigned int err = 0;

	/* Always make any pending restarted system calls return -EINTR */
	current_thread_info()->restart_block.fn = do_no_restart_syscall;

	if (is_using_fpu(current))
		fpu_kill_state(current);

#define COPY(x) err |= __get_user(regs->x, &sc->x)
	COPY(d1); COPY(d2); COPY(d3);
	COPY(a0); COPY(a1); COPY(a2); COPY(a3);
	COPY(e0); COPY(e1); COPY(e2); COPY(e3);
	COPY(e4); COPY(e5); COPY(e6); COPY(e7);
	COPY(lar); COPY(lir);
	COPY(mdr); COPY(mdrq);
	COPY(mcvf); COPY(mcrl); COPY(mcrh);
	COPY(sp); COPY(pc);
#undef COPY

	{
		unsigned int tmpflags;
#ifndef CONFIG_MN10300_USING_JTAG
#define USER_EPSW (EPSW_FLAG_Z | EPSW_FLAG_N | EPSW_FLAG_C | EPSW_FLAG_V | \
		   EPSW_T | EPSW_nAR)
#else
#define USER_EPSW (EPSW_FLAG_Z | EPSW_FLAG_N | EPSW_FLAG_C | EPSW_FLAG_V | \
		   EPSW_nAR)
#endif
		err |= __get_user(tmpflags, &sc->epsw);
		regs->epsw = (regs->epsw & ~USER_EPSW) |
		  (tmpflags & USER_EPSW);
		regs->orig_d0 = -1;		/* disable syscall checks */
	}

	{
		struct fpucontext *buf;
		err |= __get_user(buf, &sc->fpucontext);
		if (buf) {
			if (verify_area(VERIFY_READ, buf, sizeof(*buf)))
				goto badframe;
			err |= fpu_restore_sigcontext(buf);
		}
	}

	err |= __get_user(*_d0, &sc->d0);
	return err;

badframe:
	return 1;
}
开发者ID:moddingg33k,项目名称:deprecated_android_kernel_synopsis,代码行数:56,代码来源:signal.c

示例12: setup_sigcontext

/*
 * store the userspace context into a signal frame
 */
static int setup_sigcontext(struct sigcontext __user *sc,
			    struct fpucontext *fpuctx,
			    struct pt_regs *regs,
			    unsigned long mask)
{
	int tmp, err = 0;

#define COPY(x) err |= __put_user(regs->x, &sc->x)
	COPY(d0); COPY(d1); COPY(d2); COPY(d3);
	COPY(a0); COPY(a1); COPY(a2); COPY(a3);
	COPY(e0); COPY(e1); COPY(e2); COPY(e3);
	COPY(e4); COPY(e5); COPY(e6); COPY(e7);
	COPY(lar); COPY(lir);
	COPY(mdr); COPY(mdrq);
	COPY(mcvf); COPY(mcrl); COPY(mcrh);
	COPY(sp); COPY(epsw); COPY(pc);
#undef COPY

	tmp = fpu_setup_sigcontext(fpuctx);
	if (tmp < 0)
		err = 1;
	else
		err |= __put_user(tmp ? fpuctx : NULL, &sc->fpucontext);

	/* non-iBCS2 extensions.. */
	err |= __put_user(mask, &sc->oldmask);

	return err;
}
开发者ID:moddingg33k,项目名称:deprecated_android_kernel_synopsis,代码行数:32,代码来源:signal.c

示例13: restore_sigcontext

static int
restore_sigcontext(struct pt_regs *regs, struct sigcontext __user *sc, unsigned long *prax)
{
	unsigned int err = 0;

	/* Always make any pending restarted system calls return -EINTR */
	current_thread_info()->restart_block.fn = do_no_restart_syscall;

#define COPY(x)		err |= __get_user(regs->x, &sc->x)

	COPY(rdi); COPY(rsi); COPY(rbp); COPY(rsp); COPY(rbx);
	COPY(rdx); COPY(rcx); COPY(rip);
	COPY(r8);
	COPY(r9);
	COPY(r10);
	COPY(r11);
	COPY(r12);
	COPY(r13);
	COPY(r14);
	COPY(r15);

	/* Kernel saves and restores only the CS segment register on signals,
	 * which is the bare minimum needed to allow mixed 32/64-bit code.
	 * App's signal handler can save/restore other segments if needed. */
	{
		unsigned cs;
		err |= __get_user(cs, &sc->cs);
		regs->cs = cs | 3;	/* Force into user mode */
	}

	{
		unsigned int tmpflags;
		err |= __get_user(tmpflags, &sc->eflags);
		regs->eflags = (regs->eflags & ~0x40DD5) | (tmpflags & 0x40DD5);
		regs->orig_rax = -1;		/* disable syscall checks */
	}

	{
		struct _fpstate __user * buf;
		err |= __get_user(buf, &sc->fpstate);

		if (buf) {
			if (!access_ok(VERIFY_READ, buf, sizeof(*buf)))
				goto badframe;
			err |= restore_i387(buf);
		} else {
			struct task_struct *me = current;
			if (used_math()) {
				clear_fpu(me);
				clear_used_math();
			}
		}
	}

	err |= __get_user(*prax, &sc->rax);
	return err;

badframe:
	return 1;
}
开发者ID:gnensis,项目名称:linux-2.6.15,代码行数:60,代码来源:signal.c

示例14: decode

int decode(void)
{
    VAAPIContext * const vaapi = vaapi_get_context();
    VAPictureParameterBufferMPEG4 *pic_param;
    VASliceParameterBufferMPEG4 *slice_param;
    VAIQMatrixBufferMPEG4 *iq_matrix;
    int i, slice_count;

    MPEG4PictureInfo mpeg4_pic_info;
    MPEG4SliceInfo mpeg4_slice_info;
    MPEG4IQMatrix mpeg4_iq_matrix;
    const uint8_t *mpeg4_slice_data;
    unsigned int mpeg4_slice_data_size;

    if (!vaapi)
        return -1;

    mpeg4_get_picture_info(&mpeg4_pic_info);

    if (vaapi_init_decoder(VAProfileMPEG4AdvancedSimple, VAEntrypointVLD,
                           mpeg4_pic_info.width, mpeg4_pic_info.height) < 0)
        return -1;

    if ((pic_param = vaapi_alloc_picture(sizeof(*pic_param))) == NULL)
        return -1;

#define COPY(field) \
    pic_param->field = mpeg4_pic_info.field
#define COPY_BFM(a,b,c) \
    pic_param->BFM(a,b,c) = mpeg4_pic_info.a.b.c
    pic_param->vop_width = mpeg4_pic_info.width;
    pic_param->vop_height = mpeg4_pic_info.height;
    pic_param->forward_reference_picture = 0xffffffff;
    pic_param->backward_reference_picture = 0xffffffff;
    pic_param->BFV(vol_fields, value) = 0; /* reset all bits */
    COPY_BFM(vol_fields, bits, short_video_header);
    COPY_BFM(vol_fields, bits, chroma_format);
    COPY_BFM(vol_fields, bits, interlaced);
    COPY_BFM(vol_fields, bits, obmc_disable);
    COPY_BFM(vol_fields, bits, sprite_enable);
    COPY_BFM(vol_fields, bits, sprite_warping_accuracy);
    COPY_BFM(vol_fields, bits, quant_type);
    COPY_BFM(vol_fields, bits, quarter_sample);
    COPY_BFM(vol_fields, bits, data_partitioned);
    COPY_BFM(vol_fields, bits, reversible_vlc);
    COPY(no_of_sprite_warping_points);
    for (i = 0; i < 3; i++) {
        COPY(sprite_trajectory_du[i]);
        COPY(sprite_trajectory_dv[i]);
    }
    COPY(quant_precision);
    pic_param->BFV(vop_fields, value) = 0; /* reset all bits */
    COPY_BFM(vop_fields, bits, vop_coding_type);
    COPY_BFM(vop_fields, bits, backward_reference_vop_coding_type);
    COPY_BFM(vop_fields, bits, vop_rounding_type);
    COPY_BFM(vop_fields, bits, intra_dc_vlc_thr);
    COPY_BFM(vop_fields, bits, top_field_first);
    COPY_BFM(vop_fields, bits, alternate_vertical_scan_flag);
    COPY(vop_fcode_forward);
    COPY(vop_fcode_backward);
    COPY(num_gobs_in_vop);
    COPY(num_macroblocks_in_gob);
    COPY(TRB);
    COPY(TRD);
#if (VA_CHECK_VERSION(0,31,1) /* XXX: update when changes are merged */ || \
     (VA_CHECK_VERSION(0,31,0) && VA_SDS_VERSION >= 4))
    COPY(vop_time_increment_resolution);
    COPY_BFM(vol_fields, bits, resync_marker_disable);
#endif
#undef COPY_BFM
#undef COPY

    if (mpeg4_iq_matrix.load_intra_quant_mat ||
        mpeg4_iq_matrix.load_non_intra_quant_mat) {
        if ((iq_matrix = vaapi_alloc_iq_matrix(sizeof(*iq_matrix))) == NULL)
            return -1;
        mpeg4_get_iq_matrix(&mpeg4_iq_matrix);

#define COPY(field) iq_matrix->field = mpeg4_iq_matrix.field
        COPY(load_intra_quant_mat);
        COPY(load_non_intra_quant_mat);
        for (i = 0; i < 64; i++) {
            COPY(intra_quant_mat[i]);
            COPY(non_intra_quant_mat[i]);
        }
#undef COPY
    }

    slice_count = mpeg4_get_slice_count();
    for (i = 0; i < slice_count; i++) {
        if (mpeg4_get_slice_info(i, &mpeg4_slice_info) < 0)
            return -1;
        if (mpeg4_get_slice_data(i, &mpeg4_slice_data, &mpeg4_slice_data_size) < 0)
            return -1;
        if (mpeg4_slice_data_size != mpeg4_slice_info.slice_data_size)
            return -1;
        if ((slice_param = vaapi_alloc_slice(sizeof(*slice_param),
                                             mpeg4_slice_data,
                                             mpeg4_slice_data_size)) == NULL)
            return -1;
//.........这里部分代码省略.........
开发者ID:O-Computers,项目名称:hwdecode-demos,代码行数:101,代码来源:vaapi_mpeg4.c

示例15: setup_sigcontext

static int
setup_sigcontext(struct sigcontext __user *sc, struct pt_regs *regs,
	         unsigned long mask)
{
	int err = 0;

#define COPY(x)	err |= __put_user(regs->x, &sc->sc_##x)
	COPY(r4);
	COPY(r5);
	COPY(r6);
	COPY(pt_regs);
	COPY(r0);
	COPY(r1);
	COPY(r2);
	COPY(r3);
	COPY(r7);
	COPY(r8);
	COPY(r9);
	COPY(r10);
	COPY(r11);
	COPY(r12);
#if defined(CONFIG_ISA_M32R2) && defined(CONFIG_ISA_DSP_LEVEL2)
	COPY(acc0h);
	COPY(acc0l);
	COPY(acc1h);
	COPY(acc1l);
#elif defined(CONFIG_ISA_M32R2) || defined(CONFIG_ISA_M32R)
	COPY(acch);
	COPY(accl);
#else
#error unknown isa configuration
#endif
	COPY(psw);
	COPY(bpc);
	COPY(bbpsw);
	COPY(bbpc);
	COPY(spu);
	COPY(fp);
	COPY(lr);
	COPY(spi);
#undef COPY

	err |= __put_user(mask, &sc->oldmask);

	return err;
}
开发者ID:GodFox,项目名称:magx_kernel_xpixl,代码行数:46,代码来源:signal.c


注:本文中的COPY函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。