diff options
| author | Felix Morgner <felix.morgner@ost.ch> | 2025-12-15 17:13:12 +0100 |
|---|---|---|
| committer | Felix Morgner <felix.morgner@ost.ch> | 2025-12-15 17:13:12 +0100 |
| commit | 7b9482ae637126ac9337876e60f519b493437711 (patch) | |
| tree | 6fc71a253c8b0325d303bd34c95b564ba536ed14 /include | |
| parent | 116f9332a206767c45095950f09f7c7447b561cf (diff) | |
| parent | a9eeec745e29d89afd48ee43d09432eb6fc35be7 (diff) | |
| download | teachos-7b9482ae637126ac9337876e60f519b493437711.tar.xz teachos-7b9482ae637126ac9337876e60f519b493437711.zip | |
os: rework kernel architecture
Rework the code structure and architecture of the kernel by separating
platform-dependent and platform-independent code more cleanly. As of
this patchset, full feature parity has not been achieved. Nonetheless, a
sufficient subset of functionality has been ported to the new
architecture to demonstrate the feasibility of the new structure.
Diffstat (limited to 'include')
| -rw-r--r-- | include/memory/asm_pointer.hpp | 76 |
1 files changed, 0 insertions, 76 deletions
diff --git a/include/memory/asm_pointer.hpp b/include/memory/asm_pointer.hpp deleted file mode 100644 index 4c25658..0000000 --- a/include/memory/asm_pointer.hpp +++ /dev/null @@ -1,76 +0,0 @@ -#ifndef TEACHOS_MEMORY_ASM_POINTER_HPP -#define TEACHOS_MEMORY_ASM_POINTER_HPP - -namespace teachos::memory -{ - - /** - * @brief A pointer that is defined in some assembly source file. - * - * @tparam Type The type of the pointer - * @since 0.0.1 - */ - template<typename Type> - struct asm_pointer - { - /** - * @brief The type of the underlying pointer. - */ - using pointer = Type *; - - /** - * @brief Construct a new asm_pointer for a given assembly-defined pointer. - * - * @param pointer A pointer defined in assembly. - */ - constexpr asm_pointer(Type *& pointer) - : m_pointer{&pointer} - { - // Nothing to do - } - - /** - * @brief Access the underlying pointer. - * - * @return The pointer wrapped by this asm_pointer. - */ - auto constexpr operator*() -> pointer & { return *m_pointer; } - - /** - * @brief Access the underlying pointer. - * - * @return The pointer wrapped by this asm_pointer. - */ - auto constexpr operator*() const -> pointer const & { return *m_pointer; } - - private: - pointer * m_pointer; - }; - - /** - * @copydoc asm_pointer - * - * @note This specialization allows the use of this type for pointers to constant data. - * @since 0.0.1 - */ - template<typename Type> - struct asm_pointer<Type const> - { - /** @copydoc asm_pointer<Type>::asm_pointer */ - constexpr asm_pointer(Type const & pointer) - : m_pointer{&pointer} - { - } - - /** @copydoc asm_pointer<Type>::operator*() */ - auto constexpr operator*() -> Type const & { return *m_pointer; } - /** @copydoc asm_pointer<Type>::operator*() const */ - auto constexpr operator*() const -> Type const & { return *m_pointer; } - - private: - Type const * m_pointer; - }; - -} // namespace teachos::memory - -#endif // TEACHOS_MEMORY_ASM_POINTER_HPP |
