2 Copyright © 1995-2001, The AROS Development Team. All rights reserved.
9 #include <exec/types.h>
10 #include <exec/execbase.h>
11 #include <aros/libcall.h>
12 #include <aros/atomic.h>
14 void Exec_Permit_Supervisor();
16 /*****i***********************************************************************
19 #include <proto/exec.h>
21 AROS_LH1(void, Reschedule
,
24 AROS_LHA(struct Task
*, task
, A0
),
27 struct ExecBase
*, SysBase
, 8, Exec
)
30 Reschedule will place the task into one of Exec's internal task
31 lists. Which list it is placed in will depend upon whether the
32 task is ready to run, or whether it is waiting for an external
35 It is possible that in the future, more efficient schedulers
36 will be implemented. In which case this is the function that they
39 You should not do any costly calculations since you will be
40 running in interrupt mode.
43 task - The task to insert into the list.
46 The task will be inserted into one of Exec's task lists.
49 Not actually complete yet. Some of the task states don't have any
55 Only in relation to the comments within about low-priority tasks
56 not getting any processor time.
64 ******************************************************************************/
68 UBYTE flag
= SysBase
->AttnResched
; /* Save state of scheduling attention */
70 AROS_ATOMIC_OR(SysBase
->AttnResched
, 0x80); /* Set scheduling attention */
72 if (SysBase
->TDNestCnt
< 0) /* If task switching enabled */
74 if (SysBase
->IDNestCnt
< 0) /* And interrupts enabled */
76 Supervisor(Exec_Permit_Supervisor
);
78 else if (!(flag
& 0x80)) /* Generate software interrupt */
81 #warning: "This is wrong!!!!!!!! It should cause the software interrupt only once interrupts are enabled again"
82 #warning "but this jumps directly to software interrupt, no matter if interrupts are enabled or not"
83 __asm__ ("movl $-3,%eax\n\tint $0x80");