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>
13 #include <proto/kernel.h>
15 #include "../kernel/kernel_intern.h"
17 /*****i***********************************************************************
20 #include <proto/exec.h>
22 AROS_LH1(void, Reschedule
,
25 AROS_LHA(struct Task
*, task
, A0
),
28 struct ExecBase
*, SysBase
, 8, Exec
)
31 Reschedule will place the task into one of Execs internal task
32 lists. Which list it is placed in will depend upon whether the
33 task is ready to run, or whether it is waiting for an external
36 It is possible that in the future, more efficient schedulers
37 will be implemented. In which case this is the function that they
40 You should not do any costly calculations since you will be
41 running in interupt mode.
44 task - The task to insert into the list.
47 The task will be inserted into one of Exec's task lists.
50 Not actually complete yet. Some of the task states don't have any
56 Only in relation to the comments within about low-priority tasks
57 not getting any processor time.
65 ******************************************************************************/
69 UBYTE flag
= SysBase
->AttnResched
; /* Save state of scheduling attention */
71 AROS_ATOMIC_OR(SysBase
->AttnResched
, 0x80);/* Set scheduling attention */
73 if (SysBase
->TDNestCnt
< 0) /* If task switching enabled */
75 if (SysBase
->IDNestCnt
< 0) /* And interrupts enabled */
77 void *KernelBase
= getKernelBase();
81 else if (!(flag
& 0x80)) /* Generate software interrupt */
84 #warning: "This is wrong!!!!!!!! It should cause the software interrupt only once interrupts are enabled again"
85 #warning "but this jumps directly to software interrupt, no matter if interrupts are enabled or not"
86 __asm__ ("movl $-3,%eax\n\tint $0x80");