ComponentRegistry.cpp 741 B

123456789101112131415161718192021222324252627282930313233
  1. /*
  2. * Copyright (c) 2018-2021, Andreas Kling <kling@serenityos.org>
  3. * Copyright (c) 2021, Spencer Dixon <spencercdixon@gmail.com>
  4. * Copyright (c) 2021, Liav A. <liavalb@hotmail.co.il>
  5. *
  6. * SPDX-License-Identifier: BSD-2-Clause
  7. */
  8. #include <AK/Singleton.h>
  9. #include <Kernel/ProcessExposed.h>
  10. #include <Kernel/Sections.h>
  11. namespace Kernel {
  12. static Singleton<ProcFSComponentRegistry> s_the;
  13. ProcFSComponentRegistry& ProcFSComponentRegistry::the()
  14. {
  15. return *s_the;
  16. }
  17. UNMAP_AFTER_INIT void ProcFSComponentRegistry::initialize()
  18. {
  19. VERIFY(!s_the.is_initialized());
  20. s_the.ensure_instance();
  21. }
  22. UNMAP_AFTER_INIT ProcFSComponentRegistry::ProcFSComponentRegistry()
  23. : m_root_directory(ProcFSRootDirectory::must_create())
  24. {
  25. }
  26. }