diff --git a/sortix/include/sortix/kernel/cpu.h b/sortix/include/sortix/kernel/cpu.h index cd437639..87787fc6 100644 --- a/sortix/include/sortix/kernel/cpu.h +++ b/sortix/include/sortix/kernel/cpu.h @@ -119,8 +119,11 @@ const uint64_t URPL = 0x3; // Portable functions for loading registers. namespace CPU { -extern "C" void load_registers(InterruptRegisters* regs, size_t size) SORTIX_NORETURN; -SORTIX_NORETURN inline void LoadRegisters(InterruptRegisters* regs) +extern "C" __attribute__((noreturn)) +void load_registers(InterruptRegisters* regs, size_t size); + +__attribute__((noreturn)) +inline void LoadRegisters(InterruptRegisters* regs) { load_registers(regs, sizeof(*regs)); } diff --git a/sortix/include/sortix/kernel/decl.h b/sortix/include/sortix/kernel/decl.h index 2f188857..810b8cac 100644 --- a/sortix/include/sortix/kernel/decl.h +++ b/sortix/include/sortix/kernel/decl.h @@ -1,6 +1,6 @@ /******************************************************************************* - Copyright(C) Jonas 'Sortie' Termansen 2011, 2012. + Copyright(C) Jonas 'Sortie' Termansen 2011, 2012, 2013. This file is part of Sortix. @@ -28,9 +28,6 @@ typedef uintptr_t addr_t; -#define SORTIX_NORETURN __attribute__((noreturn)) -#define SORTIX_MAYALIAS __attribute__((__may_alias__)) -#define SORTIX_PACKED __attribute__((packed)) #define likely(x) __builtin_expect((x),1) #define unlikely(x) __builtin_expect((x),0) #define STATIC_ASSERT(condition) static_assert(condition, #condition) diff --git a/sortix/include/sortix/kernel/kthread.h b/sortix/include/sortix/kernel/kthread.h index 6c1ec769..efef6642 100644 --- a/sortix/include/sortix/kernel/kthread.h +++ b/sortix/include/sortix/kernel/kthread.h @@ -32,7 +32,7 @@ namespace Sortix { extern "C" { inline static void kthread_yield(void) { asm volatile ("int $129"); } -void kthread_exit(void* param = NULL) SORTIX_NORETURN; +__attribute__((noreturn)) void kthread_exit(void* param = NULL); typedef unsigned kthread_mutex_t; const kthread_mutex_t KTHREAD_MUTEX_INITIALIZER = 0; unsigned kthread_mutex_trylock(kthread_mutex_t* mutex); diff --git a/sortix/include/sortix/kernel/panic.h b/sortix/include/sortix/kernel/panic.h index 85c4eb61..4785d027 100644 --- a/sortix/include/sortix/kernel/panic.h +++ b/sortix/include/sortix/kernel/panic.h @@ -29,10 +29,10 @@ namespace Sortix { // This function halts the kernel. If you wish to give an error message first, // then you ought to call Panic instead. - extern "C" void SORTIX_NORETURN HaltKernel(); + extern "C" __attribute__((noreturn)) void HaltKernel(); - extern "C" void SORTIX_NORETURN Panic(const char* Error); - extern "C" void SORTIX_NORETURN PanicF(const char* Format, ...); + extern "C" __attribute__((noreturn)) void Panic(const char* Error); + extern "C" __attribute__((noreturn)) void PanicF(const char* Format, ...); extern "C" void WaitForInterrupt(); } diff --git a/sortix/include/sortix/kernel/thread.h b/sortix/include/sortix/kernel/thread.h index 1e5c3d74..324d2377 100644 --- a/sortix/include/sortix/kernel/thread.h +++ b/sortix/include/sortix/kernel/thread.h @@ -42,11 +42,12 @@ extern "C" void KernelInit(unsigned long magic, multiboot_info_t* bootinfo); typedef void (*ThreadEntry)(void* user); // Simply exits the kernel thread. -void KernelThreadExit() SORTIX_NORETURN; +__attribute__((noreturn)) void KernelThreadExit(); // Internally used as a kernel thread entry point that exits the thread // upon the actual thread entry returning. -extern "C" void BootstrapKernelThread(void* user, ThreadEntry entry) SORTIX_NORETURN; +extern "C" __attribute__((noreturn)) +void BootstrapKernelThread(void* user, ThreadEntry entry); // These functions create a new kernel process but doesn't start it. Thread* CreateKernelThread(Process* process, CPU::InterruptRegisters* regs); @@ -130,7 +131,7 @@ public: private: void GotoOnSigKill(CPU::InterruptRegisters* regs); - void OnSigKill() SORTIX_NORETURN; + __attribute__((noreturn)) void OnSigKill(); void LastPrayer(); void SetHavePendingSignals(); void HandleSignalFixupRegsCPU(CPU::InterruptRegisters* regs);