source: buchla-68k/orig/MT/MTQUIT.C@ 0170798

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

Imported original source code.

  • Property mode set to 100755
File size: 1.6 KB
Line 
1/*
2 =============================================================================
3 mtquit.c -- Multi-Tasker -- shutdown
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
13extern short _MT_Nil(); /* system NIL task */
14
15extern TCB *MT_CurP; /* current TCB pointer */
16extern TCB *MT_RdyQ; /* ready queue pointer */
17
18extern unsigned *_MT_Vc1; /* old swapper TRAP vector 1 */
19extern unsigned *_MT_Vc2; /* old swapper TRAP vector 2 */
20
21long _MT_Stk[48]; /* a stack for _MT_Nil() */
22
23TCB _MT_TCB; /* dummy TCB for shutdown */
24
25/*
26
27*/
28
29/*
30 =============================================================================
31 MTQuit() -- shut down the multi-tasker
32 =============================================================================
33*/
34
35MTQuit()
36{
37 register short oldipl;
38
39 oldipl = setipl(7); /* DISABLE INTERRUPTS */
40
41 BIOS(B_SETV, 40, _MT_Vc1); /* restore old trap vector 1 */
42 BIOS(B_SETV, 41, _MT_Vc2); /* restore old trap vector 2 */
43
44 _MT_Vc1 = (short *)NIL; /* clear trap vector save area 1 */
45 _MT_Vc2 = (short *)NIL; /* clear trap vector save area 2 */
46
47 /* setup dummy current TCB in case of 'accidents' */
48
49 _MT_TCB.pri = (unsigned)0xFFFF; /* highest priority */
50 _MT_TCB.slice = -1L; /* no time slicing */
51
52 MT_CurP = &_MT_TCB; /* make dummy TCB current */
53 MT_RdyQ = (TCB *)NIL; /* clear the ready queue */
54
55 setipl(oldipl); /* RESTORE INTERRUPTS */
56}
Note: See TracBrowser for help on using the repository browser.