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