2 Copyright © 1995-2017, The AROS Development Team.
6 #include <proto/exec.h>
7 #include <exec/execbase.h>
8 #include <exec/memory.h>
9 #include <exec/tasks.h>
10 #include <clib/exec_protos.h>
14 #include "exec_platform.h"
20 #define STACKSIZE 4096
22 static void entry(void)
26 sigbit2
=AllocSignal(-1);
27 Signal(parent
,1<<sigbit1
);
40 Wait(0);/* Let the parent remove me */
43 int main(int argc
, char* argv
[])
47 parent
=FindTask(NULL
);
49 sigbit1
=AllocSignal(-1);
52 t
=(struct Task
*)AllocMem(sizeof(struct Task
), MEMF_PUBLIC
|MEMF_CLEAR
);
56 s
=(UBYTE
*)AllocMem(STACKSIZE
, MEMF_PUBLIC
|MEMF_CLEAR
);
59 t
->tc_Node
.ln_Type
=NT_TASK
;
61 t
->tc_Node
.ln_Name
="new task";
63 t
->tc_SPUpper
=s
+STACKSIZE
;
64 #if AROS_STACK_GROWS_DOWNWARDS
65 t
->tc_SPReg
=(UBYTE
*)t
->tc_SPUpper
-SP_OFFSET
;
67 t
->tc_SPReg
=(UBYTE
*)t
->tc_SPLower
-SP_OFFSET
;
69 NEWLIST(&t
->tc_MemEntry
);
70 AddTask(t
,&entry
,NULL
);
73 printf("%p %p %p %p\n",
75 FindTask("new task"), FindTask(NULL
));
90 FreeMem(t
,sizeof(struct Task
));