diff options
author | Lenny Maiorani <lenny@serenityos.org> | 2022-02-09 11:33:39 -0700 |
---|---|---|
committer | Linus Groh <mail@linusgroh.de> | 2022-02-09 21:04:51 +0000 |
commit | c6acf645589cd96b9e25ab9f9da41ca2ae3721b4 (patch) | |
tree | ce5da59df32cbb23787d4ea11f9742e695cb73c3 /Kernel/Syscall.cpp | |
parent | 6a4c8a66aeba4b6ed0a91f2f0e9b7da42fe2b06f (diff) | |
download | serenity-c6acf645589cd96b9e25ab9f9da41ca2ae3721b4.zip |
Kernel: Change static constexpr variables to constexpr where possible
Function-local `static constexpr` variables can be `constexpr`. This
can reduce memory consumption, binary size, and offer additional
compiler optimizations.
These changes result in a stripped x86_64 kernel binary size reduction
of 592 bytes.
Diffstat (limited to 'Kernel/Syscall.cpp')
-rw-r--r-- | Kernel/Syscall.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/Kernel/Syscall.cpp b/Kernel/Syscall.cpp index 1d93502d19..807908000e 100644 --- a/Kernel/Syscall.cpp +++ b/Kernel/Syscall.cpp @@ -1,5 +1,6 @@ /* * Copyright (c) 2018-2021, Andreas Kling <kling@serenityos.org> + * Copyright (c) 2022, the SerenityOS developers. * * SPDX-License-Identifier: BSD-2-Clause */ @@ -196,7 +197,7 @@ NEVER_INLINE void syscall_handler(TrapFrame* trap) asm volatile("" : "=m"(*ptr)); - static constexpr FlatPtr iopl_mask = 3u << 12; + constexpr FlatPtr iopl_mask = 3u << 12; FlatPtr flags = regs.flags(); if ((flags & (iopl_mask)) != 0) { |