1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 03:37:34 +00:00
serenity/Kernel/VM
asynts 7cf0c7cc0d Meta: Split debug defines into multiple headers.
The following script was used to make these changes:

    #!/bin/bash
    set -e

    tmp=$(mktemp -d)

    echo "tmp=$tmp"

    find Kernel \( -name '*.cpp' -o -name '*.h' \) | sort > $tmp/Kernel.files
    find . \( -path ./Toolchain -prune -o -path ./Build -prune -o -path ./Kernel -prune \) -o \( -name '*.cpp' -o -name '*.h' \) -print | sort > $tmp/EverythingExceptKernel.files

    cat $tmp/Kernel.files | xargs grep -Eho '[A-Z0-9_]+_DEBUG' | sort | uniq > $tmp/Kernel.macros
    cat $tmp/EverythingExceptKernel.files | xargs grep -Eho '[A-Z0-9_]+_DEBUG' | sort | uniq > $tmp/EverythingExceptKernel.macros

    comm -23 $tmp/Kernel.macros $tmp/EverythingExceptKernel.macros > $tmp/Kernel.unique
    comm -1 $tmp/Kernel.macros $tmp/EverythingExceptKernel.macros > $tmp/EverythingExceptKernel.unique

    cat $tmp/Kernel.unique | awk '{ print "#cmakedefine01 "$1 }' > $tmp/Kernel.header
    cat $tmp/EverythingExceptKernel.unique | awk '{ print "#cmakedefine01 "$1 }' > $tmp/EverythingExceptKernel.header

    for macro in $(cat $tmp/Kernel.unique)
    do
        cat $tmp/Kernel.files | xargs grep -l $macro >> $tmp/Kernel.new-includes ||:
    done
    cat $tmp/Kernel.new-includes | sort > $tmp/Kernel.new-includes.sorted

    for macro in $(cat $tmp/EverythingExceptKernel.unique)
    do
        cat $tmp/Kernel.files | xargs grep -l $macro >> $tmp/Kernel.old-includes ||:
    done
    cat $tmp/Kernel.old-includes | sort > $tmp/Kernel.old-includes.sorted

    comm -23 $tmp/Kernel.new-includes.sorted $tmp/Kernel.old-includes.sorted > $tmp/Kernel.includes.new
    comm -13 $tmp/Kernel.new-includes.sorted $tmp/Kernel.old-includes.sorted > $tmp/Kernel.includes.old
    comm -12 $tmp/Kernel.new-includes.sorted $tmp/Kernel.old-includes.sorted > $tmp/Kernel.includes.mixed

    for file in $(cat $tmp/Kernel.includes.new)
    do
        sed -i -E 's/#include <AK\/Debug\.h>/#include <Kernel\/Debug\.h>/' $file
    done

    for file in $(cat $tmp/Kernel.includes.mixed)
    do
        echo "mixed include in $file, requires manual editing."
    done
2021-01-26 21:20:00 +01:00
..
AllocationStrategy.h Kernel: Merge PurgeableVMObject into AnonymousVMObject 2021-01-01 23:43:44 +01:00
AnonymousVMObject.cpp Meta: Split debug defines into multiple headers. 2021-01-26 21:20:00 +01:00
AnonymousVMObject.h Kernel: Merge PurgeableVMObject into AnonymousVMObject 2021-01-01 23:43:44 +01:00
ContiguousVMObject.cpp Everywhere: Debug macros instead of constexpr. 2021-01-25 09:47:36 +01:00
ContiguousVMObject.h Kernel: Implement lazy committed page allocation 2021-01-01 23:43:44 +01:00
InodeVMObject.cpp Everywhere: Replace a bundle of dbg with dbgln. 2021-01-11 11:55:47 +01:00
InodeVMObject.h Kernel: Remove the limited use of AK::TypeTraits we had in the kernel 2021-01-01 15:32:44 +01:00
MappedROM.h Kernel: Fix various forward declarations 2020-09-12 13:46:15 +02:00
MemoryManager.cpp Kernel: sys$munmap() region splitting did not preserve "shared" flag 2021-01-26 18:35:04 +01:00
MemoryManager.h Kernel: Parse boot modules from Multiboot specification 2021-01-22 22:17:39 +01:00
PageDirectory.cpp Kernel: Remove MM_DEBUG debug spam code 2021-01-11 22:09:40 +01:00
PageDirectory.h Kernel: More gracefully handle out-of-memory when creating PageDirectory 2021-01-01 23:43:44 +01:00
PageFaultResponse.h Kernel: Merge PurgeableVMObject into AnonymousVMObject 2021-01-01 23:43:44 +01:00
PhysicalPage.cpp Kernel: Remove MM_DEBUG debug spam code 2021-01-11 22:09:40 +01:00
PhysicalPage.h Kernel: Implement lazy committed page allocation 2021-01-01 23:43:44 +01:00
PhysicalRegion.cpp Kernel/VM: Make local_offset in PhysicalRegion::find_one_free_page unsigned 2020-12-29 02:20:26 +01:00
PhysicalRegion.h Meta+Kernel: Make clang-format-10 clean 2020-09-25 21:18:17 +02:00
PrivateInodeVMObject.cpp Kernel: Implement lazy committed page allocation 2021-01-01 23:43:44 +01:00
PrivateInodeVMObject.h Kernel: Implement lazy committed page allocation 2021-01-01 23:43:44 +01:00
ProcessPagingScope.cpp Kernel: Turn Thread::current and Process::current into functions 2020-07-01 12:07:01 +02:00
ProcessPagingScope.h Kernel: Move ProcessPagingScope to its own files 2020-03-01 15:38:09 +01:00
PurgeablePageRanges.cpp Meta: Split debug defines into multiple headers. 2021-01-26 21:20:00 +01:00
PurgeablePageRanges.h Kernel: Merge PurgeableVMObject into AnonymousVMObject 2021-01-01 23:43:44 +01:00
RangeAllocator.cpp Meta: Split debug defines into multiple headers. 2021-01-26 21:20:00 +01:00
RangeAllocator.h Kernel: Convert a bunch of String::format() => String::formatted() 2021-01-11 22:07:01 +01:00
Region.cpp Meta: Split debug defines into multiple headers. 2021-01-26 21:20:00 +01:00
Region.h Kernel: sys$munmap() region splitting did not preserve "shared" flag 2021-01-26 18:35:04 +01:00
SharedInodeVMObject.cpp Kernel: Implement lazy committed page allocation 2021-01-01 23:43:44 +01:00
SharedInodeVMObject.h Kernel: Implement lazy committed page allocation 2021-01-01 23:43:44 +01:00
TypedMapping.h Kernel: Add non-const version of TypedMapping::operator->() 2020-05-23 15:57:19 +02:00
VMObject.cpp Kernel: Some futex improvements 2021-01-17 20:30:31 +01:00
VMObject.h Kernel: Some futex improvements 2021-01-17 20:30:31 +01:00