From 1a4fbfe49563433937fdda0d9029a79b97f15b92 Mon Sep 17 00:00:00 2001 From: Tim Ledbetter Date: Fri, 31 May 2024 09:27:36 +0100 Subject: [PATCH] Everywhere: Remove references to the kernel --- .clang-tidy | 2 +- AK/CMakeLists.txt | 2 +- CMakeLists.txt | 8 -------- Documentation/CLionConfiguration.md | 23 +---------------------- Documentation/QtCreatorConfiguration.md | 3 --- Meta/CMake/all_the_debug_macros.cmake | 2 -- Meta/CMake/serenity_options.cmake | 6 ------ Meta/check-debug-flags.sh | 3 +-- Meta/check-markdown.sh | 2 +- Meta/check-newlines-at-eof.py | 2 -- Meta/check-style.py | 6 ------ Meta/lint-clang-format.sh | 2 -- 12 files changed, 5 insertions(+), 56 deletions(-) diff --git a/.clang-tidy b/.clang-tidy index 6bba73d87c5..d5d0161c2e8 100644 --- a/.clang-tidy +++ b/.clang-tidy @@ -46,7 +46,7 @@ Checks: > -readability-uppercase-literal-suffix, -readability-use-anyofallof, WarningsAsErrors: '' -HeaderFilterRegex: 'AK|Userland|Kernel|Tests' +HeaderFilterRegex: 'AK|Userland|Tests' FormatStyle: none CheckOptions: - key: bugprone-dangling-handle.HandleClasses diff --git a/AK/CMakeLists.txt b/AK/CMakeLists.txt index e7fb9e485e1..2e4513b8386 100644 --- a/AK/CMakeLists.txt +++ b/AK/CMakeLists.txt @@ -41,7 +41,7 @@ set(AK_SOURCES Utf8View.cpp kmalloc.cpp ) -# AK sources are included from many different places, such as the Kernel, LibC, and Loader +# AK sources are included from many different places list(TRANSFORM AK_SOURCES PREPEND "${CMAKE_CURRENT_SOURCE_DIR}/") set(AK_SOURCES ${AK_SOURCES} PARENT_SCOPE) diff --git a/CMakeLists.txt b/CMakeLists.txt index ccf8f0f9d9a..e56bd54ac3d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -129,18 +129,12 @@ endif() if (ENABLE_ALL_DEBUG_FACILITIES) set(ENABLE_ALL_THE_DEBUG_MACROS ON) - set(ENABLE_EXTRA_KERNEL_DEBUG_SYMBOLS ON) # Immediately finds violations during boot, shouldn't be discoverable # by people who aren't working on fixing issues. Use this check to make # sure this code continues to build instead of all_debug_macros to avoid # people filing bugs. set(KMALLOC_VERIFY_NO_SPINLOCK_HELD ON) - - # Enables KCOV API and injects kernel coverage instrumentation via - # -fsanitize-coverage=trace-pc. Mostly here to ensure that the CI catches - # commits breaking this flag. - set(ENABLE_KERNEL_COVERAGE_COLLECTION ON) endif() if (ENABLE_ALL_THE_DEBUG_MACROS) @@ -154,7 +148,6 @@ set(CMAKE_INSTALL_INCLUDEDIR usr/include) set(CMAKE_INSTALL_LIBDIR usr/lib) configure_file(AK/Debug.h.in AK/Debug.h @ONLY) -configure_file(Kernel/Debug.h.in Kernel/Debug.h @ONLY) install(FILES "${CMAKE_CURRENT_BINARY_DIR}/AK/Debug.h" DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/AK") # We disable it completely because it makes cmake very spammy. @@ -215,7 +208,6 @@ if (ENABLE_CLANG_PLUGINS AND CMAKE_CXX_COMPILER_ID MATCHES "Clang$") endif() add_subdirectory(AK) -add_subdirectory(Kernel) # FIXME: vptr sanitizing requires.. intense ABI wrangling of std::type_info # And would be better served by porting ubsan_type_hash_itanium.cpp from compiler-rt diff --git a/Documentation/CLionConfiguration.md b/Documentation/CLionConfiguration.md index 9ba56e996f9..a01d59de5e6 100644 --- a/Documentation/CLionConfiguration.md +++ b/Documentation/CLionConfiguration.md @@ -42,7 +42,7 @@ want to exclude Toolchain files as well, follow the same procedure with the foll ## Include headers and source files for code insight -To get proper code insight mark the folders `AK`, `Kernel` and `Userland` by right-clicking on them and selecting `Mark Directory as | Project Sources and Headers`. +To get proper code insight mark the folders `AK` and `Userland` by right-clicking on them and selecting `Mark Directory as | Project Sources and Headers`. A symptom of this not being configured correctly is CLion giving a warning for every single file: > The file does not belong to any project target, code insight features might not work properly. @@ -52,27 +52,6 @@ A symptom of this not being configured correctly is CLion giving a warning for e To make code generated by CLion match the SerenityOS coding style, import the `CLionCodeStyleSettings.xml` from this directory as code style scheme via `Settings -> Editor -> Code Style -> C/C++ -> Scheme -> Cog icon -> Import Scheme...` -## Quick switching between Kernel and Userland targets - -In order to let CLion know what kind of code you're currently working on (Kernel / Userland) to make sure it parses and displays the correct half of statements like this: -```c++ -#ifdef KERNEL -... -#else -... -#endif -``` -You need to add build configurations for each: - -Click on one of the buttons below (top right of the IDE) - If you have the second one, press Edit Configurations after the dropdown box opens, then press CTRL+A to select the 1000s of automatically generated targets, and then press Delete to remove them. - -![Add Configuration...](CLion_Add_Configuration.png) -![Kernel | Default](CLion_Add_Configuration_Existing.png) - -Then press the `+` button to add a new configuration, select `CMake Application`, name the configuration `Kernel`, set the target to `Kernel` (typing while the dropdown box is open searches), and then repeat the process one more time, this time with the name being `Userland` and the target being `true`. - -Finally, to quickly switch between the two different contexts, simply click the `Kernel | Default` / `Userland | Default` button to switch. - ## Notes for WSL Users ### Toolchain diff --git a/Documentation/QtCreatorConfiguration.md b/Documentation/QtCreatorConfiguration.md index e9e06095bbf..dd50a0737b1 100644 --- a/Documentation/QtCreatorConfiguration.md +++ b/Documentation/QtCreatorConfiguration.md @@ -15,8 +15,6 @@ First, make sure you have a working toolchain and can build and run SerenityOS. * Edit the `serenity.config` file (In Qt Creator, hit ^K or CMD+K on a Mac to open the search dialog, type the name of the file and hit return to open it) * Add the following `#define`s to the file: ``` - //#define KERNEL - #define ENABLE_UNICODE_DATA 1 //#define ENABLE_COMPILETIME_FORMAT_CHECK @@ -24,7 +22,6 @@ First, make sure you have a working toolchain and can build and run SerenityOS. #define SANITIZE_PTRS 1 #define __SSE__ ``` - If you're working on the Kernel, just uncomment `#define KERNEL`. * Edit the `serenity.cxxflags` file to say `-std=c++23 -fsigned-char -fconcepts -fno-exceptions -fno-semantic-interposition -fPIC` * Edit the `serenity.includes` file to list the following lines: ``` diff --git a/Meta/CMake/all_the_debug_macros.cmake b/Meta/CMake/all_the_debug_macros.cmake index a9c18b98475..41e75c6600d 100644 --- a/Meta/CMake/all_the_debug_macros.cmake +++ b/Meta/CMake/all_the_debug_macros.cmake @@ -40,8 +40,6 @@ set(E1000_DEBUG ON) set(EDITOR_DEBUG ON) set(ELF_IMAGE_DEBUG ON) set(EMOJI_DEBUG ON) -set(ENABLE_KERNEL_COVERAGE_COLLECTION ON) -set(ENABLE_KERNEL_COVERAGE_COLLECTION_DEBUG ON) set(ESCAPE_SEQUENCE_DEBUG ON) set(ETHERNET_DEBUG ON) set(EVENT_DEBUG ON) diff --git a/Meta/CMake/serenity_options.cmake b/Meta/CMake/serenity_options.cmake index 9cf39ed20c2..2e1a29d0c77 100644 --- a/Meta/CMake/serenity_options.cmake +++ b/Meta/CMake/serenity_options.cmake @@ -7,11 +7,5 @@ include(${CMAKE_CURRENT_LIST_DIR}/common_options.cmake NO_POLICY_SCOPE) serenity_option(ENABLE_PCI_IDS_DOWNLOAD ON CACHE BOOL "Enable download of the pci.ids database at build time") serenity_option(ENABLE_USB_IDS_DOWNLOAD ON CACHE BOOL "Enable download of the usb.ids database at build time") serenity_option(ENABLE_PNP_IDS_DOWNLOAD ON CACHE BOOL "Enable download of the pnp.ids database at build time") -serenity_option(ENABLE_KERNEL_ADDRESS_SANITIZER OFF CACHE BOOL "Enable kernel address sanitizer testing in gcc/clang") -serenity_option(ENABLE_KERNEL_COVERAGE_COLLECTION OFF CACHE BOOL "Enable KCOV and kernel coverage instrumentation in gcc/clang") -serenity_option(ENABLE_KERNEL_COVERAGE_COLLECTION_DEBUG OFF CACHE BOOL "Enable KCOV and kernel coverage instrumentation debugging") -serenity_option(ENABLE_KERNEL_LTO OFF CACHE BOOL "Build the kernel with link-time optimization") -serenity_option(ENABLE_KERNEL_UNDEFINED_SANITIZER ON CACHE BOOL "Enable the Kernel Undefined Behavior Sanitizer (KUBSAN)") -serenity_option(ENABLE_EXTRA_KERNEL_DEBUG_SYMBOLS OFF CACHE BOOL "Enable -Og and -ggdb3 options for Kernel code for easier debugging") serenity_option(ENABLE_MOLD_LINKER OFF CACHE BOOL "Link the SerenityOS userland with the mold linker") serenity_option(ENABLE_USERSPACE_COVERAGE_COLLECTION OFF CACHE BOOL "Enable code coverage instrumentation for userspace binaries in clang") diff --git a/Meta/check-debug-flags.sh b/Meta/check-debug-flags.sh index b94dcc981d7..059046ab0da 100755 --- a/Meta/check-debug-flags.sh +++ b/Meta/check-debug-flags.sh @@ -20,8 +20,7 @@ done < <( git ls-files -- \ '*.cpp' \ '*.h' \ - '*.in' \ - ':!:Kernel/FileSystem/Ext2FS/Definitions.h' + '*.in' else # We're in the middle of a pre-commit run, so we should only check the files that have # actually changed. The reason is that "git ls-files | grep" on the entire repo takes diff --git a/Meta/check-markdown.sh b/Meta/check-markdown.sh index 6554c7d836a..7ed103298d0 100755 --- a/Meta/check-markdown.sh +++ b/Meta/check-markdown.sh @@ -24,4 +24,4 @@ if [ -z "$SERENITY_SOURCE_DIR" ] ; then fi # shellcheck disable=SC2086 # Word splitting is intentional here -find AK Base Documentation Kernel Meta Ports Tests Userland -path Tests/LibWeb/WPT/wpt -prune -o -type f -name '*.md' -print0 | xargs -0 "${MARKDOWN_CHECK_BINARY}" -b "${SERENITY_SOURCE_DIR}/Base" $EXTRA_MARKDOWN_CHECK_ARGS README.md CONTRIBUTING.md +find AK Base Documentation Meta Tests Userland -path Tests/LibWeb/WPT/wpt -prune -o -type f -name '*.md' -print0 | xargs -0 "${MARKDOWN_CHECK_BINARY}" -b "${SERENITY_SOURCE_DIR}/Base" $EXTRA_MARKDOWN_CHECK_ARGS README.md CONTRIBUTING.md diff --git a/Meta/check-newlines-at-eof.py b/Meta/check-newlines-at-eof.py index ba2e878e024..c79ab0cd9a3 100755 --- a/Meta/check-newlines-at-eof.py +++ b/Meta/check-newlines-at-eof.py @@ -20,8 +20,6 @@ def should_check_file(filename): return False if filename.startswith('Tests/LibWeb/Layout/'): return False - if filename == 'Kernel/FileSystem/Ext2FS/Definitions.h': - return False if filename.endswith('.txt'): return 'CMake' in filename return True diff --git a/Meta/check-style.py b/Meta/check-style.py index 3a374bcba1d..17fd328e649 100755 --- a/Meta/check-style.py +++ b/Meta/check-style.py @@ -74,12 +74,6 @@ def should_check_file(filename): return False if filename.startswith('Base/'): return False - if filename == 'Kernel/Devices/HID/VirtIO/EvDevDefinitions.h': - return False - if filename == 'Kernel/FileSystem/Ext2FS/Definitions.h': - return False - if filename == 'Kernel/FileSystem/FUSE/Definitions.h': - return False return True diff --git a/Meta/lint-clang-format.sh b/Meta/lint-clang-format.sh index d582402af6e..384a09bf338 100755 --- a/Meta/lint-clang-format.sh +++ b/Meta/lint-clang-format.sh @@ -12,8 +12,6 @@ if [ "$#" -eq "1" ]; then '*.h' \ '*.mm' \ ':!:Base' \ - ':!:Kernel/Devices/HID/VirtIO/EvDevDefinitions.h' \ - ':!:Kernel/FileSystem/Ext2FS/Definitions.h' \ ':!:Userland/Libraries/LibCodeComprehension/Cpp/Tests/*' \ ':!:Userland/Libraries/LibCpp/Tests/parser/*' \ ':!:Userland/Libraries/LibCpp/Tests/preprocessor/*'