Re-enabled use of AROS.Boot file due to lack of general enthusiasm for
[tangerine.git] / arch / i386-pc / exec / enable.c
blobb1538254b663b897ff90d7553f260a0bc7c37650
1 /*
2 Copyright © 1995-2001, The AROS Development Team. All rights reserved.
3 $Id$
5 Desc: i386unix version of Enable()
6 Lang: english
7 */
9 #include <exec/tasks.h>
10 #include <exec/execbase.h>
11 #include <aros/libcall.h>
12 #include <aros/atomic.h>
13 #include <aros/debug.h>
14 #include <asm/segments.h>
15 #include <proto/exec.h>
16 #include "exec_intern.h"
18 void Exec_Permit_Supervisor();
20 #undef Exec
21 #ifdef UseExecstubs
22 # define Exec _Exec
23 #endif
25 AROS_LH0(void, Enable,
26 struct ExecBase *, SysBase, 21, Exec)
28 #undef Exec
29 AROS_LIBFUNC_INIT
31 AROS_ATOMIC_DEC(SysBase->IDNestCnt);
33 if(SysBase->IDNestCnt < 0)
35 __asm__ __volatile__ ("sti");
37 /* There's no dff09c like thing in x86 native which would allow
38 us to set delayed (mark it as pending but it gets triggered
39 only once interrupts are enabled again) software interrupt,
40 so we check it manually here in Enable() == same stuff as
41 in Permit(). */
43 if ((SysBase->TDNestCnt < 0) && (SysBase->AttnResched & 0x80))
45 if (IN_USER_MODE) Supervisor(Exec_Permit_Supervisor);
48 if (SysBase->SysFlags & SFF_SoftInt)
50 if (IN_USER_MODE)
52 /* sys_Cause */
53 __asm__ __volatile__ ("movl $0,%%eax\n\tint $0x80":::"eax","memory");
58 AROS_LIBFUNC_EXIT