mirror of
https://github.com/fergalmoran/ladybird.git
synced 2026-01-29 20:04:15 +00:00
The name "variables" is a bit awkward and what the directory entries are really about is kernel configuration so let's make it clear with the new name.
36 lines
938 B
C++
36 lines
938 B
C++
/*
|
|
* Copyright (c) 2022-2023, Liav A. <liavalb@hotmail.co.il>
|
|
*
|
|
* SPDX-License-Identifier: BSD-2-Clause
|
|
*/
|
|
|
|
#include <Kernel/FileSystem/SysFS/Subsystems/Kernel/Configuration/DumpKmallocStack.h>
|
|
#include <Kernel/Sections.h>
|
|
#include <Kernel/Tasks/Process.h>
|
|
|
|
namespace Kernel {
|
|
|
|
UNMAP_AFTER_INIT SysFSDumpKmallocStacks::SysFSDumpKmallocStacks(SysFSDirectory const& parent_directory)
|
|
: SysFSSystemBooleanVariable(parent_directory)
|
|
{
|
|
}
|
|
|
|
UNMAP_AFTER_INIT NonnullRefPtr<SysFSDumpKmallocStacks> SysFSDumpKmallocStacks::must_create(SysFSDirectory const& parent_directory)
|
|
{
|
|
return adopt_ref_if_nonnull(new (nothrow) SysFSDumpKmallocStacks(parent_directory)).release_nonnull();
|
|
}
|
|
|
|
bool SysFSDumpKmallocStacks::value() const
|
|
{
|
|
SpinlockLocker locker(m_lock);
|
|
return g_dump_kmalloc_stacks;
|
|
}
|
|
|
|
void SysFSDumpKmallocStacks::set_value(bool new_value)
|
|
{
|
|
SpinlockLocker locker(m_lock);
|
|
g_dump_kmalloc_stacks = new_value;
|
|
}
|
|
|
|
}
|