1 /* The kernel call implemented in this file:
4 * The parameters for this kernel call are:
5 * m1_i1: ABRT_HOW (how to abort, possibly fetch monitor params)
6 * m1_i2: ABRT_MON_ENDPT (proc nr to get monitor params from)
7 * m1_i3: ABRT_MON_LEN (length of monitor params)
8 * m1_p1: ABRT_MON_ADDR (virtual address of params)
11 #include "kernel/system.h"
16 /*===========================================================================*
18 *===========================================================================*/
19 int do_abort(struct proc
* caller
, message
* m_ptr
)
21 /* Handle sys_abort. MINIX is unable to continue. This can originate e.g.
22 * in the PM (normal abort) or TTY (after CTRL-ALT-DEL).
24 int how
= m_ptr
->ABRT_HOW
;
26 /* See if the monitor is to run the specified instructions. */
27 if (how
== RBT_MONITOR
) {
29 static char paramsbuffer
[512];
31 len
= MIN(m_ptr
->ABRT_MON_LEN
, sizeof(paramsbuffer
)-1);
33 if((p
=data_copy(m_ptr
->ABRT_MON_ENDPT
, (vir_bytes
) m_ptr
->ABRT_MON_ADDR
,
34 KERNEL
, (vir_bytes
) paramsbuffer
, len
)) != OK
) {
37 paramsbuffer
[len
] = '\0';
40 /* Now prepare to shutdown MINIX. */
41 prepare_shutdown(how
);
42 return(OK
); /* pro-forma (really EDISASTER) */
45 #endif /* USE_ABORT */