formatting
[AROS.git] / rom / exec / exec_intern.h
blob4d7cb74e4de893bbfdf6f8050aa6681703f42532
1 /*
2 Copyright © 1995-2015, 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 ALERT_BUFFER_SIZE 2048
28 Internals of this structure are host-specific, we don't know them here
30 struct HostInterface;
32 struct SupervisorAlertTask
34 struct Task *sat_Task; /* Task that tries to display supervisor-level alerts */
35 BOOL sat_IsAvailable;
36 IPTR sat_Params[2];
40 AROS specific private portion of ExecBase
42 struct IntExecBase
44 struct ExecBase pub;
45 struct List ResetHandlers; /* Reset handlers list */
46 struct Interrupt ColdResetHandler; /* Reset handler that causes cold reboot */
47 struct Interrupt WarmResetHandler; /* Reset handler that causes warm reboot */
48 struct Interrupt ShutdownHandler; /* Reset handler that halts CPU */
49 struct MinList AllocMemList; /* Mungwall allocations list */
50 struct SignalSemaphore MemListSem; /* Memory list protection semaphore */
51 struct SignalSemaphore LowMemSem; /* Lock for single-threading low memory handlers */
52 #if defined(__AROSEXEC_SMP__)
53 spinlock_t TaskRunningSpinLock;
54 struct List TaskRunning; /* Tasks that are running on CPUs */
55 spinlock_t TaskSpinningLock;
56 struct List TaskSpinning; /* Tasks that are spinning waiting for a lock */
57 spinlock_t TaskReadySpinLock;
58 spinlock_t TaskWaitSpinLock;
59 #endif
60 APTR KernelBase; /* kernel.resource base */
61 struct Library *DebugBase; /* debug.library base */
62 ULONG PageSize; /* Memory page size */
63 ULONG IntFlags; /* Internal flags, see below */
64 struct MsgPort *ServicePort; /* Message port for service task */
65 struct MinList TaskStorageSlots; /* List of free slots, always one element with next slot */
66 struct List AllocatorCtxList; /* List of allocator contexts for system mem headers */
67 struct Exec_PlatformData PlatformData; /* Platform-specific stuff */
68 struct SupervisorAlertTask SAT;
69 char AlertBuffer[ALERT_BUFFER_SIZE]; /* Buffer for alert text */
72 #define PrivExecBase(base) ((struct IntExecBase *)base)
73 #define PD(base) PrivExecBase(base)->PlatformData
74 #define KernelBase PrivExecBase(SysBase)->KernelBase
75 #define DebugBase PrivExecBase(SysBase)->DebugBase
77 /* IntFlags */
78 #define EXECF_MungWall 0x0001 /* This flag can't be changed at runtime */
79 #define EXECF_StackSnoop 0x0002
81 /* Additional private task states */
82 #define TS_SERVICE 128
84 /* Puddle size, in slots. Must be at least 1 */
85 #define TASKSTORAGEPUDDLE 16
87 #if UseLVOs
88 extern void __AROS_InitExecBase (void);
89 #endif
91 struct ExecBase *PrepareExecBase(struct MemHeader *mh, struct TagItem *tags);
92 void InitExecBase(struct ExecBase *SysBase, ULONG negsize, struct TagItem *msg);
93 struct ExecBase *PrepareExecBaseMove(struct ExecBase *oldSysBase);
94 BOOL Exec_PreparePlatform(struct Exec_PlatformData *pdata, struct TagItem *tags);
96 void InitKickTags(struct ExecBase *SysBase);
97 UWORD GetSysBaseChkSum(struct ExecBase *sysbase);
98 void SetSysBaseChkSum(void);
99 BOOL IsSysBaseValid(struct ExecBase *sysbase);
101 IPTR cpu_SuperState();
103 void ServiceTask(struct ExecBase *SysBase);
105 #endif /* __EXEC_INTERN_H__ */