Exemplo n.º 1
0
/*
 * This is the service routine for the syscall #48 (signal funcs).
 *
 * Examine the request code and branch on the request to the appropriate
 * function.
 */
int
abi_sigfunc(struct pt_regs *regp)
{
	int			sig_type = (int)HIDDEN_PARAM(regp);

#if defined(CONFIG_ABI_TRACE)
	abi_trace(ABI_TRACE_SIGNAL|ABI_TRACE_SIGNAL_F,
		"sig%s(%ld, 0x%08lx, 0x%08lx)\n",
			sig_type == 0 ? "nal"
			: (sig_type == 0x100 ? "set"
			: (sig_type == 0x200 ? "hold"
			: (sig_type == 0x400 ? "relse"
			: (sig_type == 0x800 ? "ignore"
			: (sig_type == 0x1000 ? "pause"
			: "???" ))))),
			SIGNAL_NUMBER(regp) & 0xff,
			SECOND_PARAM(regp),
			THIRD_PARAM(regp));
#endif

	_FLG(regp)   &= ~1;
	_AX(regp)     = 0;

	switch (sig_type) {
	case 0x0000:
		abi_signal(regp);
		break;
	case 0x0100:
		abi_sigset(regp);
		break;
	case 0x0200:
		abi_sighold(regp);
		break;
	case 0x0400:
		abi_sigrelse(regp);
		break;
	case 0x0800:
		abi_sigignore(regp);
		break;
	case 0x1000:
		abi_sigpause(regp);
		break;
	default:
		set_error(regp, EINVAL);

#if defined(CONFIG_ABI_TRACE)
		abi_trace(ABI_TRACE_SIGNAL|ABI_TRACE_SIGNAL_F,
				"sigfunc(%x, %ld, %lx, %lx) unsupported\n",
				sig_type, SIGNAL_NUMBER(regp),
				SECOND_PARAM(regp), THIRD_PARAM(regp));
#endif
		return 0;
	}

#if defined(CONFIG_ABI_TRACE)
	abi_trace(ABI_TRACE_SIGNAL|ABI_TRACE_SIGNAL_F,
			"returns %d\n", get_result(regp));
#endif
	return 0;
}
Exemplo n.º 2
0
int abi_sigfunc (struct pt_regs * regs)
{
	int sig_type = (int) HIDDEN_PARAM;

#ifdef CONFIG_ABI_TRACE
	if ((ibcs_trace & (TRACE_SIGNAL | TRACE_SIGNAL_F))
	|| ibcs_func_p->trace) {
		printk(KERN_DEBUG "iBCS2 sig%s(%ld, 0x%08lx, 0x%08lx)\n",
			sig_type == 0 ? "nal"
			: (sig_type == 0x100 ? "set"
			: (sig_type == 0x200 ? "hold"
			: (sig_type == 0x400 ? "relse"
			: (sig_type == 0x800 ? "ignore"
			: (sig_type == 0x1000 ? "pause"
			: "???" ))))),
			SIGNAL_NUMBER & 0xff, SECOND_PARAM, THIRD_PARAM);
	}
#endif

#ifdef __sparc__
	set_result (regs, 0);
#else /* __sparc__ */
	regs->eflags &= ~1;
	regs->eax     = 0;
#endif /* __sparc__ */
	switch (sig_type) {
	case 0x0000:
		abi_signal (regs);
		break;

	case 0x0100:
		abi_sigset (regs);
		break;

	case 0x0200:
		abi_sighold (regs);
		break;
		
	case 0x0400:
		abi_sigrelse (regs);
		break;

	case 0x0800:
		abi_sigignore (regs);
		break;

	case 0x1000:
		abi_sigpause (regs);
		break;

	default:
		set_error (regs, EINVAL);

#ifdef CONFIG_ABI_TRACE
		if ((ibcs_trace & (TRACE_SIGNAL | TRACE_SIGNAL_F))
		|| ibcs_func_p->trace)
		       printk (KERN_ERR "iBCS2 sigfunc(%x, %ld, %lx, %lx) unsupported\n",
			       sig_type,
			       SIGNAL_NUMBER,
			       SECOND_PARAM,
			       THIRD_PARAM);
#endif
		return 0;
	}

#ifdef CONFIG_ABI_TRACE
	if ((ibcs_trace & (TRACE_SIGNAL | TRACE_SIGNAL_F))
	|| ibcs_func_p->trace) {
		printk(KERN_DEBUG "iBCS2 returns %ld\n", get_result (regs));
	}
#endif
	return 0;
}