• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ restore_current函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: prom_query_output_device

enum prom_output_device
prom_query_output_device(void)
{
	unsigned long flags;
	int st_p;
	char propb[64];
	char *p;
	int propl;

	switch(prom_vers) {
	case PROM_V0:
	case PROM_SUN4:
		switch(*romvec->pv_stdin) {
		case PROMDEV_SCREEN:	return PROMDEV_OSCREEN;
		case PROMDEV_TTYA:	return PROMDEV_OTTYA;
		case PROMDEV_TTYB:	return PROMDEV_OTTYB;
		};
		break;
	case PROM_V2:
	case PROM_V3:
		spin_lock_irqsave(&prom_lock, flags);
		st_p = (*romvec->pv_v2devops.v2_inst2pkg)(*romvec->pv_v2bootargs.fd_stdout);
		restore_current();
		spin_unlock_irqrestore(&prom_lock, flags);
		propl = prom_getproperty(st_p, "device_type", propb, sizeof(propb));
		if (propl >= 0 && propl == sizeof("display") &&
			strncmp("display", propb, sizeof("display")) == 0)
		{
			return PROMDEV_OSCREEN;
		}
		if(prom_vers == PROM_V3) {
			if(propl >= 0 &&
			    strncmp("serial", propb, sizeof("serial")) != 0)
				return PROMDEV_O_UNK;
			prom_getproperty(prom_root_node, "stdout-path", propb, sizeof(propb));
			if(strncmp(propb, con_name_jmc, CON_SIZE_JMC) == 0)
				return PROMDEV_OTTYA;
			p = propb;
			while(*p) p++; p -= 2;
			if(p[0]==':') {
				if(p[1] == 'a')
					return PROMDEV_OTTYA;
				else if(p[1] == 'b')
					return PROMDEV_OTTYB;
			}
		} else {
			switch(*romvec->pv_stdin) {
			case PROMDEV_TTYA:	return PROMDEV_OTTYA;
			case PROMDEV_TTYB:	return PROMDEV_OTTYB;
			};
		}
		break;
	default:
		;
	};
	return PROMDEV_O_UNK;
}
开发者ID:12019,项目名称:hg556a_source,代码行数:57,代码来源:console.c


示例2: prom_putsegment

/* Set physical segment 'segment' at virtual address 'vaddr' in
 * context 'ctx'.
 */
void
prom_putsegment(int ctx, unsigned long vaddr, int segment)
{
	unsigned long flags;
	spin_lock_irqsave(&prom_lock, flags);
	(*(romvec->pv_setctxt))(ctx, (char *) vaddr, segment);
	restore_current();
	spin_unlock_irqrestore(&prom_lock, flags);
	return;
}
开发者ID:nhanh0,项目名称:hah,代码行数:13,代码来源:segment.c


示例3: prom_reboot

/* Reset and reboot the machine with the command 'bcommand'. */
void
prom_reboot(char *bcommand)
{
	unsigned long flags;
	spin_lock_irqsave(&prom_lock, flags);
	(*(romvec->pv_reboot))(bcommand);
	/* Never get here. */
	restore_current();
	spin_unlock_irqrestore(&prom_lock, flags);
}
开发者ID:johnny,项目名称:CobraDroidBeta,代码行数:11,代码来源:misc_32.c


示例4: prom_putsegment

/* Set physical segment 'segment' at virtual address 'vaddr' in
 * context 'ctx'.
 */
void
prom_putsegment(int ctx, unsigned long vaddr, int segment)
{
	unsigned long flags;
	save_flags(flags); cli();
	(*(romvec->pv_setctxt))(ctx, (char *) vaddr, segment);
	restore_current();
	restore_flags(flags);
	return;
}
开发者ID:chinnyannieb,项目名称:empeg-hijack,代码行数:13,代码来源:segment.c


示例5: prom_cmdline

void
prom_cmdline(void)
{
	unsigned long flags;

	spin_lock_irqsave(&prom_lock, flags);
	(*(romvec->pv_abort))();
	restore_current();
	spin_unlock_irqrestore(&prom_lock, flags);
	set_auxio(AUXIO_LED, 0);
}
开发者ID:romanbb,项目名称:android_kernel_lge_d851,代码行数:11,代码来源:misc_32.c


示例6: prom_unmapio

/* Unmap an IO/device area that was mapped using the above routine. */
void
prom_unmapio(char *vaddr, unsigned int num_bytes)
{
	unsigned long flags;

	if(num_bytes == 0x0) return;
	spin_lock_irqsave(&prom_lock, flags);
	(*(romvec->pv_v2devops.v2_dumb_munmap))(vaddr, num_bytes);
	restore_current();
	spin_unlock_irqrestore(&prom_lock, flags);
}
开发者ID:Medvedroid,项目名称:OT_903D-kernel-2.6.35.7,代码行数:12,代码来源:devmap.c


示例7: __prom_nextprop

/* Interal version of nextprop that does not alter return values. */
char * __prom_nextprop(int node, char * oprop)
{
	unsigned long flags;
	char *prop;

	save_and_cli(flags);
	prop = prom_nodeops->no_nextprop(node, oprop);
	restore_current();
	restore_flags(flags);

	return prop;
}
开发者ID:chinnyannieb,项目名称:empeg-hijack,代码行数:13,代码来源:tree.c


示例8: __prom_getsibling

/* Internal version of prom_getsibling that does not alter return values. */
static phandle __prom_getsibling(phandle node)
{
	unsigned long flags;
	phandle cnode;

	spin_lock_irqsave(&prom_lock, flags);
	cnode = prom_nodeops->no_nextnode(node);
	restore_current();
	spin_unlock_irqrestore(&prom_lock, flags);

	return cnode;
}
开发者ID:0-T-0,项目名称:ps4-linux,代码行数:13,代码来源:tree_32.c


示例9: spin_lock_irqsave

/* Interal version of nextprop that does not alter return values. */
static char *__prom_nextprop(phandle node, char * oprop)
{
	unsigned long flags;
	char *prop;

	spin_lock_irqsave(&prom_lock, flags);
	prop = prom_nodeops->no_nextprop(node, oprop);
	restore_current();
	spin_unlock_irqrestore(&prom_lock, flags);

	return prop;
}
开发者ID:0-T-0,项目名称:ps4-linux,代码行数:13,代码来源:tree_32.c


示例10: prom_inst2pkg

int prom_inst2pkg(int inst)
{
    int node;
    unsigned long flags;

    spin_lock_irqsave(&prom_lock, flags);
    node = (*romvec->pv_v2devops.v2_inst2pkg)(inst);
    restore_current();
    spin_unlock_irqrestore(&prom_lock, flags);
    if (node == -1) return 0;
    return node;
}
开发者ID:acassis,项目名称:emlinux-ssd1935,代码行数:12,代码来源:tree.c


示例11: __prom_getchild

/* Internal version of prom_getchild that does not alter return values. */
int __prom_getchild(int node)
{
    unsigned long flags;
    int cnode;

    spin_lock_irqsave(&prom_lock, flags);
    cnode = prom_nodeops->no_child(node);
    restore_current();
    spin_unlock_irqrestore(&prom_lock, flags);

    return cnode;
}
开发者ID:acassis,项目名称:emlinux-ssd1935,代码行数:13,代码来源:tree.c


示例12: prom_halt

void __noreturn
prom_halt(void)
{
	unsigned long flags;
again:
	spin_lock_irqsave(&prom_lock, flags);
	(*(romvec->pv_halt))();
	/*                 */
	restore_current();
	spin_unlock_irqrestore(&prom_lock, flags);
	goto again; /*                              */
}
开发者ID:romanbb,项目名称:android_kernel_lge_d851,代码行数:12,代码来源:misc_32.c


示例13: prom_halt

/* Drop into the prom, but completely terminate the program.
 * No chance of continuing.
 */
void
prom_halt(void)
{
	unsigned long flags;
again:
	spin_lock_irqsave(&prom_lock, flags);
	(*(romvec->pv_halt))();
	/* Never get here. */
	restore_current();
	spin_unlock_irqrestore(&prom_lock, flags);
	goto again; /* PROM is out to get me -DaveM */
}
开发者ID:johnny,项目名称:CobraDroidBeta,代码行数:15,代码来源:misc_32.c


示例14: __prom_getsibling

/* Internal version of prom_getsibling that does not alter return values. */
int __prom_getsibling(int node)
{
	unsigned long flags;
	int cnode;

	save_and_cli(flags);
	cnode = prom_nodeops->no_nextnode(node);
	restore_current();
	restore_flags(flags);

	return cnode;
}
开发者ID:chinnyannieb,项目名称:empeg-hijack,代码行数:13,代码来源:tree.c


示例15: prom_inst2pkg

int prom_inst2pkg(int inst)
{
	int node;
	unsigned long flags;
	
	save_flags(flags); cli();
	node = (*romvec->pv_v2devops.v2_inst2pkg)(inst);
	restore_current();
	restore_flags(flags);
	if (node == -1) return 0;
	return node;
}
开发者ID:chinnyannieb,项目名称:empeg-hijack,代码行数:12,代码来源:tree.c


示例16: prom_setprop

/* Set property 'pname' at node 'node' to value 'value' which has a length
 * of 'size' bytes.  Return the number of bytes the prom accepted.
 */
int prom_setprop(int node, char *pname, char *value, int size)
{
    unsigned long flags;
    int ret;

    if(size == 0) return 0;
    if((pname == 0) || (value == 0)) return 0;
    spin_lock_irqsave(&prom_lock, flags);
    ret = prom_nodeops->no_setprop(node, pname, value, size);
    restore_current();
    spin_unlock_irqrestore(&prom_lock, flags);
    return ret;
}
开发者ID:acassis,项目名称:emlinux-ssd1935,代码行数:16,代码来源:tree.c


示例17: prom_setprop

/* Set property 'pname' at node 'node' to value 'value' which has a length
 * of 'size' bytes.  Return the number of bytes the prom accepted.
 */
int prom_setprop(int node, char *pname, char *value, int size)
{
	unsigned long flags;
	int ret;

	if(size == 0) return 0;
	if((pname == 0) || (value == 0)) return 0;
	save_flags(flags); cli();
	ret = prom_nodeops->no_setprop(node, pname, value, size);
	restore_current();
	restore_flags(flags);
	return ret;
}
开发者ID:chinnyannieb,项目名称:empeg-hijack,代码行数:16,代码来源:tree.c


示例18: prom_feval

/* Forth evaluate the expression contained in 'fstring'. */
void
prom_feval(char *fstring)
{
	unsigned long flags;
	if(!fstring || fstring[0] == 0)
		return;
	spin_lock_irqsave(&prom_lock, flags);
	if(prom_vers == PROM_V0)
		(*(romvec->pv_fortheval.v0_eval))(strlen(fstring), fstring);
	else
		(*(romvec->pv_fortheval.v2_eval))(fstring);
	restore_current();
	spin_unlock_irqrestore(&prom_lock, flags);
}
开发者ID:johnny,项目名称:CobraDroidBeta,代码行数:15,代码来源:misc_32.c


示例19: prom_getproplen

/* Return the length in bytes of property 'prop' at node 'node'.
 * Return -1 on error.
 */
int prom_getproplen(phandle node, const char *prop)
{
	int ret;
	unsigned long flags;

	if((!node) || (!prop))
		return -1;
		
	spin_lock_irqsave(&prom_lock, flags);
	ret = prom_nodeops->no_proplen(node, prop);
	restore_current();
	spin_unlock_irqrestore(&prom_lock, flags);
	return ret;
}
开发者ID:0-T-0,项目名称:ps4-linux,代码行数:17,代码来源:tree_32.c


示例20: prom_getproplen

/* Return the length in bytes of property 'prop' at node 'node'.
 * Return -1 on error.
 */
int prom_getproplen(int node, char *prop)
{
	int ret;
	unsigned long flags;

	if((!node) || (!prop))
		return -1;
		
	save_flags(flags); cli();
	ret = prom_nodeops->no_proplen(node, prop);
	restore_current();
	restore_flags(flags);
	return ret;
}
开发者ID:chinnyannieb,项目名称:empeg-hijack,代码行数:17,代码来源:tree.c



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ restore_flags函数代码示例发布时间:2022-05-30
下一篇:
C++ restore_context函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap