Add option to let genmf use a temp file when generating the target file, and use...
[AROS.git] / rom / exec / exec_intern.h
blob3963b7019dae87896f29e99a0abe0eaa4629c435
1 /*
2 Copyright © 1995-2017, The AROS Development Team. All rights reserved.
3 $Id$
5 Desc: Private data belonging to exec.library
6 Lang:
7 */
8 #ifndef __EXEC_INTERN_H__
9 #define __EXEC_INTERN_H__
11 /* This is a short file that contains a few things every Exec function needs */
13 #include <aros/debug.h> /* Needed for aros_print_not_implemented macro */
14 #include <aros/system.h>
15 #include <aros/libcall.h>
16 #include <exec/execbase.h>
17 #include <proto/exec.h>
19 #include <exec_platform.h>
21 #if defined(__AROSEXEC_SMP__)
22 #include <aros/types/spinlock_s.h>
23 #endif
25 #define __KERNEL_NOLIBBASE__
26 #include <proto/kernel.h>
28 #define ALERT_BUFFER_SIZE 2048
31 Internals of this structure are host-specific, we don't know them here
33 struct HostInterface;
35 struct SupervisorAlertTask
37 struct Task *sat_Task; /* Task that tries to display supervisor-level alerts */
38 BOOL sat_IsAvailable;
39 IPTR sat_Params[2];
43 AROS specific private portion of ExecBase
45 struct IntExecBase
47 struct ExecBase pub;
48 struct List ResetHandlers; /* Reset handlers list */
49 struct Interrupt ColdResetHandler; /* Reset handler that causes cold reboot */
50 struct Interrupt WarmResetHandler; /* Reset handler that causes warm reboot */
51 struct Interrupt ShutdownHandler; /* Reset handler that halts CPU */
52 struct MinList AllocMemList; /* Mungwall allocations list */
53 struct SignalSemaphore LowMemSem; /* Lock for single-threading low memory handlers */
54 APTR KernelBase; /* kernel.resource base */
55 struct Library *DebugBase; /* debug.library base */
56 ULONG PageSize; /* Memory page size */
57 ULONG IntFlags; /* Internal flags, see below */
58 struct MsgPort *ServicePort; /* Message port for service task */
59 struct MinList TaskStorageSlots; /* List of free slots, always one element with next slot */
60 struct List AllocatorCtxList; /* List of allocator contexts for system mem headers */
61 struct Exec_PlatformData PlatformData; /* Platform-specific stuff */
62 struct SupervisorAlertTask SAT;
63 char AlertBuffer[ALERT_BUFFER_SIZE]; /* Buffer for alert text */
64 #if defined(__AROSEXEC_BROKENMEMLOCK__)
65 struct SignalSemaphore MemListSem; /* Memory list protection semaphore */
66 #elif defined(__AROSEXEC_SMP__)
67 void * ExecLockBase;
68 cpumask_t *CPUMask; /* bitmap of online core */
69 spinlock_t MemListSpinLock;
70 /* First the locks for arbitration of public resources ... */
71 spinlock_t ResourceListSpinLock;
72 spinlock_t DeviceListSpinLock;
73 spinlock_t IntrListSpinLock;
74 spinlock_t LibListSpinLock;
75 spinlock_t PortListSpinLock;
76 spinlock_t SemListSpinLock;
78 /* .. and then scheduling related locks ... */
79 spinlock_t TaskRunningSpinLock;
80 struct List TaskRunning; /* Tasks that are currently running on available CPUs */
81 spinlock_t TaskSpinningLock;
82 struct List TaskSpinning; /* Tasks that are spinning waiting for a lock */
83 spinlock_t TaskReadySpinLock;
84 spinlock_t TaskWaitSpinLock;
85 #endif
88 #define PrivExecBase(base) ((struct IntExecBase *)(base))
89 #define PD(base) PrivExecBase(base)->PlatformData
90 #ifndef __AROS_KERNEL__
91 #define KernelBase PrivExecBase(SysBase)->KernelBase
92 #else
93 #define __kernelBase PrivExecBase(SysBase)->KernelBase
94 #endif
95 #define DebugBase PrivExecBase(SysBase)->DebugBase
97 /* IntFlags */
98 #define EXECF_MungWall 0x0001 /* This flag can't be changed at runtime */
99 #define EXECF_StackSnoop 0x0002
100 #define EXECF_CPUAffinity 0x0004 /* Set once the CPU affinity masks should be used */
102 /* Additional private task states */
103 #define TS_SERVICE 128
105 /* Puddle size, in slots. Must be at least 1 */
106 #define TASKSTORAGEPUDDLE 16
108 #if UseLVOs
109 extern void __AROS_InitExecBase (void);
110 #endif
112 struct ExecBase *PrepareExecBase(struct MemHeader *mh, struct TagItem *tags);
113 void InitExecBase(struct ExecBase *SysBase, ULONG negsize, struct TagItem *msg);
114 struct ExecBase *PrepareExecBaseMove(struct ExecBase *oldSysBase);
115 BOOL Exec_PreparePlatform(struct Exec_PlatformData *pdata, struct TagItem *tags);
117 void InitKickTags(struct ExecBase *SysBase);
118 UWORD GetSysBaseChkSum(struct ExecBase *sysbase);
119 void SetSysBaseChkSum(void);
120 BOOL IsSysBaseValid(struct ExecBase *sysbase);
122 IPTR cpu_SuperState();
124 void ServiceTask(struct ExecBase *SysBase);
126 #endif /* __EXEC_INTERN_H__ */