本文整理汇总了C++中restore_current函数的典型用法代码示例。如果您正苦于以下问题:C++ restore_current函数的具体用法?C++ restore_current怎么用?C++ restore_current使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了restore_current函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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;
}
示例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;
}
示例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);
}
示例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;
}
示例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);
}
示例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);
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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; /* */
}
示例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 */
}
示例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;
}
示例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;
}