The Pedigree Project 0.1
core-main.cc
1/*
2 * Copyright (c) 2026, Pedigree Developers
3 *
4 * Permission to use, copy, modify, and distribute this software for any
5 * purpose with or without fee is hereby granted.
6 */
7
8#include "pedigree/kernel/Log.h"
9#include "pedigree/kernel/linker/KernelElf.h"
10
11#include "modules/Module.h"
12
13extern void system_reset();
14extern bool runHostedWaitRegressions();
15extern bool runHostedAccountingRegressions();
16extern bool runHostedPagingRequestRegressions();
17extern bool runHostedModuleAdmissionRegressions();
18#if defined(PEDIGREE_HOSTED_GLOBAL_SYNC_TESTS)
19extern bool runHostedCacheSyncRegressions();
20extern bool runHostedScsiSyncRegressions();
21#endif
22#if PEDIGREE_AFFINITY_TESTS
23extern bool runAffinityRegressions();
24#endif
25#if PEDIGREE_CHILD_WAIT_TESTS
26extern bool runChildWaitRegressions();
27#endif
28#if PEDIGREE_PTRACE_TESTS
29extern bool runPtraceFrameRegressions();
30#endif
31
32static bool entry() {
33 bool passed = runHostedWaitRegressions() && runHostedAccountingRegressions();
34 if (passed)
35 passed = runHostedPagingRequestRegressions() && runHostedModuleAdmissionRegressions();
36#if defined(PEDIGREE_HOSTED_GLOBAL_SYNC_TESTS)
37 if (passed)
38 passed = runHostedCacheSyncRegressions() && runHostedScsiSyncRegressions();
39#endif
40 if (passed) {
41 passed = KernelElf::moduleExecutionWaitsForUnloadForTest();
42 if (passed)
43 NOTICE("HOSTED-MODULE-TEST: PASS execution-unload-admission");
44 else
45 ERROR("HOSTED-MODULE-TEST: FAIL execution-unload-admission");
46 }
47#if PEDIGREE_AFFINITY_TESTS
48 if (passed)
49 passed = runAffinityRegressions();
50#endif
51#if PEDIGREE_CHILD_WAIT_TESTS
52 if (passed)
53 passed = runChildWaitRegressions();
54#endif
55#if PEDIGREE_PTRACE_TESTS
56 if (passed)
57 passed = runPtraceFrameRegressions();
58#endif
59 if (passed) {
60 NOTICE("HOSTED-SMOKE: Darwin core smoke executed");
61 }
62 system_reset();
63 return true;
64}
65
66static void exit() {}
67
68#if defined(PEDIGREE_HOSTED_GLOBAL_SYNC_TESTS)
69MODULE_INFO("hosted-core-smoke", &entry, &exit, "scsi");
70#else
71MODULE_INFO("hosted-core-smoke", &entry, &exit);
72#endif