|
The Pedigree Project 0.1
|
The kernel. More...
Collaboration diagram for kernel:Modules | |
| utilities | |
| Utilities. | |
| processor-specifc kernel | |
| processor-specific kernel interface | |
| machine-specifc kernel | |
| machine-specific kernel interface | |
| debugger | |
| the kernel debugger | |
| linker | |
| the kernel linker | |
Classes | |
| class | Atomic< T, bAllow > |
| class | Atomic< T, true > |
| class | Atomic< bool, true > |
| class | BootstrapStruct_t |
| class | ConstexprLockGuard< T, Condition > |
| class | LockGuard< T > |
| class | LockGuard< Mutex > |
| class | ConstexprLockGuard< Mutex, true > |
| class | LockGuard< Semaphore > |
| class | RecursingLockGuard< T > |
| class | Log |
| the kernel's log More... | |
Macros | |
| #define | BOOTSTRAP_FLAG_CMDLINE 0x001 |
| #define | BOOTSTRAP_FLAG_MODULES 0x002 |
| #define | BOOTSTRAP_FLAG_ELF 0x004 |
| #define | BOOTSTRAP_FLAG_MEMORY_MAP 0x008 |
| #define | BOOTSTRAP_FLAG_ACPI 0x010 |
| #define | BOOTSTRAP_FLAG_SMBIOS 0x020 |
| #define | BOOTSTRAP_FLAG_FRAMEBUFFER 0x040 |
| #define | BOOTSTRAP_FLAG_UEFI 0x080 |
| #define | DEPRECATED __attribute__((deprecated)) |
| #define | NORETURN __attribute__((noreturn)) |
| #define | PURE __attribute__((pure)) |
| #define | CONST __attribute__((const)) |
| #define | ALWAYS_INLINE __attribute__((always_inline)) |
| #define | NEVER_INLINE __attribute__((noinline)) |
| #define | ALIGN(x) __attribute__((aligned(x))) |
| #define | PACKED __attribute__((packed)) |
| #define | MAY_ALIAS __attribute__((may_alias)) |
| #define | CONSTRUCTOR __attribute__((constructor)) |
| #define | LIKELY(exp) __builtin_expect(!!(exp), 1) |
| #define | UNLIKELY(exp) __builtin_expect(!!(exp), 0) |
| #define | UNREACHABLE __builtin_unreachable() |
| #define | FORMAT(type, idx, first) __attribute__((format(type, idx, first))) |
| #define | IS_CONSTANT(x) __builtin_constant_p(x) |
| #define | SECTION(x) __attribute__((__section__(x))) |
| #define | MUST_USE_RESULT __attribute__((warn_unused_result)) |
| #define | USED __attribute__((used)) |
| #define | WEAK __attribute__((weak)) |
| #define | FALLSTHROUGH |
| #define | MALLOC __attribute__((malloc)) |
| #define | ALLOC_SIZE(...) __attribute__((alloc_size(__VA_ARGS__))) |
| #define | C_NOTHROW __attribute__((nothrow)) |
| #define | EMIT_IF(...) if constexpr (__VA_ARGS__) |
| #define | EXPORTED_PUBLIC __attribute__((visibility("default"))) |
| #define | SYMBOL_HIDDEN __attribute__((visibility("hidden"))) |
| #define | __has_builtin(x) 0 |
| #define | __has_feature(x) 0 |
| #define | ASSUME_ALIGNMENT(b, sz) __builtin_assume_aligned((b), sz) |
| #define | INITIALISATION_ONLY SECTION(".init.text") |
| #define | INITIALISATION_ONLY_DATA SECTION(".init.data") |
| #define | HAS_ADDRESS_SANITIZER 0 |
| #define | HAS_THREAD_SANITIZER 0 |
| #define | BARRIER() __asm__ __volatile__("" ::: "memory") |
| #define | FENCE() __sync_synchronize() |
| #define | SHOW_FILE_IN_LOGS 0 |
| #define | HUGE_STATIC_LOG 0 |
| #define | FILE_LOG(entry, level) |
| #define | LOG_AT_LEVEL(level, text, lock) |
| #define | DEBUG_LOG(text) |
| #define | DEBUG_LOG_NOLOCK(text) |
| #define | NOTICE(text) |
| #define | NOTICE_NOLOCK(text) |
| #define | WARNING(text) |
| #define | WARNING_NOLOCK(text) |
| #define | ERROR(text) |
| #define | ERROR_NOLOCK(text) |
| #define | FATAL(text) |
| #define | FATAL_NOLOCK(text) |
| #define | PEDANTRY(text) |
| #define | LOG_LENGTH 128 |
| #define | LOG_ENTRIES ((1 << 16) / sizeof(LogEntry)) |
| #define | LOG_CALLBACK_COUNT 16 |
| #define | assert(x) |
| #define | assert_heap_ptr_valid(x) |
| #define | bool char |
Typedefs | |
| typedef StaticCord< 8 > | LogCord |
| typedef void(* | BootProgressUpdateFn) (const char *) |
Enumerations | |
| enum | NumberType { Hex , Dec , Oct } |
| enum | LogEntryModifier { Unlocked , NoTimestamp } |
Functions | |
| void | installSerialLogger () |
| void EXPORTED_PUBLIC | panic (const char *msg) NORETURN |
| void EXPORTED_PUBLIC | _assert (bool b, const char *file, int line, const char *func) |
| bool | _assert_ptr_valid (uintptr_t x) |
Variables | |
| BootstrapStruct_t *g_pBootstrapInfo | EXPORTED_PUBLIC |
| class EXPORTED_PUBLIC BootstrapStruct_t | PACKED |
| size_t | g_BootProgressCurrent |
| size_t | g_BootProgressTotal |
| BootProgressUpdateFn | g_BootProgressUpdate |
The kernel.
Classes, functions, defines belonging to the kernel
| #define __has_builtin | ( | x | ) | 0 |
Definition at line 100 of file system/include/pedigree/kernel/compiler.h.
| #define __has_feature | ( | x | ) | 0 |
Definition at line 104 of file system/include/pedigree/kernel/compiler.h.
| #define ALIGN | ( | x | ) | __attribute__((aligned(x))) |
Specific alignment for a type/variable
Definition at line 46 of file system/include/pedigree/kernel/compiler.h.
| #define ALLOC_SIZE | ( | ... | ) | __attribute__((alloc_size(__VA_ARGS__))) |
Hint for the size of an allocation.
Definition at line 85 of file system/include/pedigree/kernel/compiler.h.
| #define ALWAYS_INLINE __attribute__((always_inline)) |
Functions that should always be inlined
Definition at line 42 of file system/include/pedigree/kernel/compiler.h.
| #define assert | ( | x | ) |
If the passed argument resolves to a Boolean false value, execution will be halted and a message displayed.
| #define assert_heap_ptr_valid | ( | x | ) |
| #define ASSUME_ALIGNMENT | ( | b, | |
| sz | |||
| ) | __builtin_assume_aligned((b), sz) |
Definition at line 108 of file system/include/pedigree/kernel/compiler.h.
| #define BARRIER | ( | ) | __asm__ __volatile__("" ::: "memory") |
Definition at line 151 of file system/include/pedigree/kernel/compiler.h.
| #define BOOTSTRAP_FLAG_ACPI 0x010 |
Definition at line 38 of file BootstrapInfo.h.
| #define BOOTSTRAP_FLAG_CMDLINE 0x001 |
Definition at line 34 of file BootstrapInfo.h.
| #define BOOTSTRAP_FLAG_ELF 0x004 |
Definition at line 36 of file BootstrapInfo.h.
| #define BOOTSTRAP_FLAG_FRAMEBUFFER 0x040 |
Definition at line 40 of file BootstrapInfo.h.
| #define BOOTSTRAP_FLAG_MEMORY_MAP 0x008 |
Definition at line 37 of file BootstrapInfo.h.
| #define BOOTSTRAP_FLAG_MODULES 0x002 |
Definition at line 35 of file BootstrapInfo.h.
| #define BOOTSTRAP_FLAG_SMBIOS 0x020 |
Definition at line 39 of file BootstrapInfo.h.
| #define BOOTSTRAP_FLAG_UEFI 0x080 |
Definition at line 41 of file BootstrapInfo.h.
| #define C_NOTHROW __attribute__((nothrow)) |
C function cannot throw an exception.
Definition at line 87 of file system/include/pedigree/kernel/compiler.h.
| #define CONST __attribute__((const)) |
Function does not have a side-effect and does only depend on its arguments
Definition at line 40 of file system/include/pedigree/kernel/compiler.h.
| #define CONSTRUCTOR __attribute__((constructor)) |
The function is a constructor to be run at program load time.
Definition at line 52 of file system/include/pedigree/kernel/compiler.h.
| #define DEPRECATED __attribute__((deprecated)) |
Deprecated function/variable/type
Definition at line 33 of file system/include/pedigree/kernel/compiler.h.
| #define EMIT_IF | ( | ... | ) | if constexpr (__VA_ARGS__) |
Macros to wrap things in compile-times conditions.
Definition at line 89 of file system/include/pedigree/kernel/compiler.h.
| #define EXPORTED_PUBLIC __attribute__((visibility("default"))) |
This function or variable is to be exposed to other objects. This is needed for anything that the kernel will expose to kernel modules.
Definition at line 95 of file system/include/pedigree/kernel/compiler.h.
| #define FALLSTHROUGH |
A switch fallthrough is indeed intentional.
Definition at line 79 of file system/include/pedigree/kernel/compiler.h.
| #define FENCE | ( | ) | __sync_synchronize() |
Definition at line 154 of file system/include/pedigree/kernel/compiler.h.
| #define FORMAT | ( | type, | |
| idx, | |||
| first | |||
| ) | __attribute__((format(type, idx, first))) |
This function handles a format string.
Definition at line 60 of file system/include/pedigree/kernel/compiler.h.
| #define HAS_ADDRESS_SANITIZER 0 |
Definition at line 125 of file system/include/pedigree/kernel/compiler.h.
| #define HAS_THREAD_SANITIZER 0 |
Definition at line 131 of file system/include/pedigree/kernel/compiler.h.
| #define INITIALISATION_ONLY SECTION(".init.text") |
Pack initialisation functions into a special section that could be freed after the kernel initialisation is finished
Definition at line 116 of file system/include/pedigree/kernel/compiler.h.
| #define INITIALISATION_ONLY_DATA SECTION(".init.data") |
Definition at line 117 of file system/include/pedigree/kernel/compiler.h.
| #define IS_CONSTANT | ( | x | ) | __builtin_constant_p(x) |
True if the expression is constant at compile time, false otherwise.
Definition at line 62 of file system/include/pedigree/kernel/compiler.h.
| #define LIKELY | ( | exp | ) | __builtin_expect(!!(exp), 1) |
The expression is very likely to be true
Definition at line 54 of file system/include/pedigree/kernel/compiler.h.
| #define LOG_AT_LEVEL | ( | level, | |
| text, | |||
| lock | |||
| ) |
| #define LOG_CALLBACK_COUNT 16 |
| #define LOG_ENTRIES ((1 << 16) / sizeof(LogEntry)) |
| #define LOG_LENGTH 128 |
| #define MALLOC __attribute__((malloc)) |
The function is malloc-like, i.e. doesn't return an aliased pointer, memory is uninitialized, and so on.
Definition at line 83 of file system/include/pedigree/kernel/compiler.h.
| #define MAY_ALIAS __attribute__((may_alias)) |
The type may alias
Definition at line 50 of file system/include/pedigree/kernel/compiler.h.
| #define MUST_USE_RESULT __attribute__((warn_unused_result)) |
This function must have its return value used somehow.
Definition at line 70 of file system/include/pedigree/kernel/compiler.h.
| #define NEVER_INLINE __attribute__((noinline)) |
Functions that should never be inlined
Definition at line 44 of file system/include/pedigree/kernel/compiler.h.
| #define NORETURN __attribute__((noreturn)) |
Function does not return
Definition at line 35 of file system/include/pedigree/kernel/compiler.h.
| #define PACKED __attribute__((packed)) |
No padding for a type/variable
Definition at line 48 of file system/include/pedigree/kernel/compiler.h.
| #define PURE __attribute__((pure)) |
Function does not have a side-effect (except for the return value)
Definition at line 37 of file system/include/pedigree/kernel/compiler.h.
| #define SECTION | ( | x | ) | __attribute__((__section__(x))) |
This code should be placed in the given section.
Definition at line 67 of file system/include/pedigree/kernel/compiler.h.
| #define SYMBOL_HIDDEN __attribute__((visibility("hidden"))) |
Definition at line 96 of file system/include/pedigree/kernel/compiler.h.
| #define UNLIKELY | ( | exp | ) | __builtin_expect(!!(exp), 0) |
The expression is very unlikely to be true
Definition at line 56 of file system/include/pedigree/kernel/compiler.h.
| #define UNREACHABLE __builtin_unreachable() |
This code is not reachable.
Definition at line 58 of file system/include/pedigree/kernel/compiler.h.
| #define USED __attribute__((used)) |
This function or variable is used, even if it doesn't appear that way.
Definition at line 72 of file system/include/pedigree/kernel/compiler.h.
| #define WEAK __attribute__((weak)) |
This function can be overridden by a library.
Definition at line 74 of file system/include/pedigree/kernel/compiler.h.
| typedef StaticCord<8> LogCord |
| enum LogEntryModifier |
| enum NumberType |
| void EXPORTED_PUBLIC _assert | ( | bool | b, |
| const char * | file, | ||
| int | line, | ||
| const char * | func | ||
| ) |
Internal use only, the assert() macro passes the additional arguments automatically
Definition at line 27 of file assert.cc.
References ProcessorBase::breakpoint(), Dec, Machine::getSerial(), Hex, ProcessorBase::m_Initialised, and panic().
| bool _assert_ptr_valid | ( | uintptr_t | x | ) |
Definition at line 1511 of file SlamAllocator.cc.
|
extern |
Definition at line 41 of file SerialLog.cc.
| void EXPORTED_PUBLIC panic | ( | const char * | msg | ) |
Prints out a message to the screen and the most recent log entries and halts the processor. This function should only be called in unrecoverable emergency cases, e.g. when the kernel is unable to successfully complete its initialisation.
| [in] | msg | the message to print to the screen |
Definition at line 117 of file panic.cc.
References GraphicsService::GraphicsProvider::bTextModes, Machine::displayShutdownMessage(), SerialIO::drawString(), ServiceManager::enumerateOperations(), Machine::getSerial(), ServiceManager::getService(), ProcessorBase::halt(), KernelElf::instance(), ProcessorBase::pause(), ServiceFeatures::probe, ServiceFeatures::provides(), Service::serve(), ProcessorBase::setInterrupts(), Display::setScreenMode(), Machine::stopAllOtherProcessors(), and ProcessorBase::tlbInvalidationTerminal().
Referenced by _assert(), Spinlock::acquire(), Spinlock::acquireContended(), Log::addEntry(), Ehci::addInterruptInHandler(), PerProcessorScheduler::addThread(), PerProcessorScheduler::addThread(), SlamAllocator::allocate(), HostedPhysicalMemoryManager::allocatePage(), X86CommonPhysicalMemoryManager::allocatePage(), HostedPhysicalMemoryManager::allocateRegion(), X86CommonPhysicalMemoryManager::allocateRegion(), Archive::Archive(), Ehci::cancelAsyncAndDrain(), Xhci::cancelInterruptInAndDrain(), Ehci::cancelInterruptInAndDrain(), Ohci::cancelInterruptInAndDrain(), Uhci::cancelInterruptInAndDrain(), UsbHubDevice::cancelInterruptInAndDrain(), PerProcessorScheduler::checkEventState(), Pc::deinitialise(), AtaDisk::doWrite(), PanicCommand::execute(), X86CommonPhysicalMemoryManager::PageStack::free(), SlamAllocator::freeSlabUnlocked(), Rtl8139::haltController(), HostedVirtualAddressSpace::handleCopyOnWriteFault(), HostedMachine::initialise(), Pc::initialise(), X86CommonPhysicalMemoryManager::initialise(), PerProcessorScheduler::initialise(), ProcessorBase::initialise1(), HostedMachine::initialise3(), Pc::initialise3(), X86CommonPhysicalMemoryManager::initialise64(), HostedInterruptManager::interrupt(), X64InterruptManager::interrupt(), PageFaultHandler::interrupt(), OwnedThread::join(), AdmittedThread::launchDetached(), OperationBarrier::leave(), HostedVirtualAddressSpace::map(), X64VirtualAddressSpace::mapPageStructures(), SlamAllocator::markSlabReady(), IoPort::read16(), IoPort::read32(), IoPort::read8(), Xhci::releaseDeviceAddress(), PerProcessorScheduler::requestCurrentThreadExitToIdle(), Pic::reservePciRoute(), Rtl8139::resetController(), ScsiDisk::shutdownCache(), ScsiController::shutdownDiskCaches(), Uhci::start(), Debugger::start(), Uhci::stop(), Spinlock::trackRelease(), Ohci::transitionControllerState(), Rtc::uninitialise(), OperationBarrier::wait(), IoPort::write16(), IoPort::write32(), and IoPort::write8().