source: buchla-68k/orig/MT/MTEXIT.C@ 66b48e7

Last change on this file since 66b48e7 was 3ae31e9, checked in by Thomas Lopatic <thomas@…>, 7 years ago

Imported original source code.

  • Property mode set to 100755
File size: 1.2 KB
Line 
1/*
2 =============================================================================
3 mtexit.c -- Multi-Tasker -- task termination
4 Version 1 -- 1988-04-11 -- D.N. Lynx Crowe
5 (c) Copyright 1988 -- D.N. Lynx Crowe
6 =============================================================================
7*/
8
9#include "stddefs.h"
10#include "biosdefs.h"
11#include "mtdefs.h"
12#include "debug.h"
13
14extern short setipl(); /* set processor IPL function */
15
16extern struct _mtdef *_MT_; /* Multi-Tasker structure pointer */
17
18/*
19
20*/
21
22/*
23 =============================================================================
24 MTExit() -- terminate current task (never returns)
25 =============================================================================
26*/
27
28MTExit()
29{
30 register short oldipl;
31
32 DB_ENTR("MTExit");
33
34 if ((struct _mt_def *)NIL EQ _MT_)
35 _MT_ = (struct _mt_def *)XBIOS(X_MTDEFS);
36
37 oldipl = setipl(7); /* DISABLE INTERRUPTS */
38 _MT_->mtp->CurP->flags = 0; /* clear our flags (deallocate TCB) */
39 setipl(oldipl); /* RESTORE INTERRUPTS */
40
41iquit:
42 MTNext(); /* swap task out of existence */
43
44 printf("\nMTExit(): ERROR -- MTNext() returned\n\n");
45
46 xtrap15(); /* trap to ROMP */
47 goto iquit;
48}
Note: See TracBrowser for help on using the repository browser.