Subversion Repositories shark

Compare Revisions

Ignore whitespace Rev 1101 → Rev 1123

/demos/trunk/parport/ppdemo.c
26,11 → 26,11
 
/**
------------
CVS : $Id: ppdemo.c,v 1.1 2002-10-28 08:18:27 pj Exp $
CVS : $Id: ppdemo.c,v 1.2 2003-01-07 17:10:18 pj Exp $
 
File: $File$
Revision: $Revision: 1.1 $
Last update: $Date: 2002-10-28 08:18:27 $
Revision: $Revision: 1.2 $
Last update: $Date: 2003-01-07 17:10:18 $
------------
**/
 
329,32 → 329,6
 
/****************************************************************/
 
/* This is the exception handler. It is called when an exception
is raised.
It exits from the graphical mode, then it prints a message and
shutdown the kernel using sys_abort()
*/
 
void demo_exc_handler(int signo, siginfo_t *info, void *extra)
{
struct timespec t;
 
grx_close();
 
/* Default action for an kern exception is */
kern_cli();
ll_gettime(TIME_EXACT, &t),
kern_printf("\nS.Ha.R.K. Exception raised!!!"
"\nTime (s:ns) :%ld:%ld"
"\nException number:%d (numbers in include/bits/errno.h)"
"\nPID :%d\n",
t.tv_sec, t.tv_nsec, info->si_value.sival_int,
info->si_task);
sys_abort(1);
}
 
/******************************************************************/
 
/* This function is called when Alt-X is pressed.
It simply shutdown the system using sys_end.
Note that the byebye() function is called only if we exit from
398,20 → 372,8
HARD_TASK_MODEL m2;
SOFT_TASK_MODEL mp;
 
struct sigaction action;
 
 
/* Init the standard S.Ha.R.K. exception handler */
action.sa_flags = SA_SIGINFO; /* Set the signal action */
action.sa_sigaction = demo_exc_handler;
action.sa_handler = 0;
sigfillset(&action.sa_mask); /* we block all the other signals... */
 
if (sigaction(SIGHEXC, &action, NULL) == -1) { /* set the signal */
perror("Error initializing signals..."); sys_end();}
 
/* Set the closing function */
sys_atrunlevel(byebye, NULL, RUNLEVEL_BEFORE_EXIT|NO_AT_ABORT);
sys_atrunlevel(byebye, NULL, RUNLEVEL_BEFORE_EXIT);