aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.clang-tidy4
-rw-r--r--.vscode/settings.json12
-rw-r--r--arch/x86_64/include/x86_64/cpu/control_register.hpp3
-rw-r--r--arch/x86_64/include/x86_64/cpu/model_specific_register.hpp3
-rw-r--r--arch/x86_64/include/x86_64/device_io/port_io.hpp6
5 files changed, 28 insertions, 0 deletions
diff --git a/.clang-tidy b/.clang-tidy
index 6b3bfd9..e802dbd 100644
--- a/.clang-tidy
+++ b/.clang-tidy
@@ -64,3 +64,7 @@ CheckOptions:
readability-magic-numbers.IgnorePowersOf2IntegerValues: true
readability-magic-numbers.IgnoreBitFieldsWidths: true
readability-magic-numbers.IgnoreTypeAliases: true
+
+FormatStyle: file
+HeaderFilterRegex: '(.*/kstd/.*)|.*\.hpp'
+SystemHeaders: true \ No newline at end of file
diff --git a/.vscode/settings.json b/.vscode/settings.json
index 7f588f4..96d6ab4 100644
--- a/.vscode/settings.json
+++ b/.vscode/settings.json
@@ -23,8 +23,12 @@
},
"cSpell.words": [
"acpi",
+ "bugprone",
+ "cppcoreguidelines",
"crtc",
+ "crtp",
"efer",
+ "functors",
"initializable",
"interprocedural",
"invlpg",
@@ -32,13 +36,21 @@
"iwyu",
"kapi",
"kstd",
+ "malloc",
"memcmp",
+ "memset",
"multiboot",
+ "nodiscard",
"nolintnextline",
+ "nullptr",
+ "println",
+ "raii",
"rdmsr",
"rvalues",
+ "stringview",
"sysret",
"teachos",
+ "undelegated",
"wrmsr"
]
} \ No newline at end of file
diff --git a/arch/x86_64/include/x86_64/cpu/control_register.hpp b/arch/x86_64/include/x86_64/cpu/control_register.hpp
index 9c3bad5..67ae87e 100644
--- a/arch/x86_64/include/x86_64/cpu/control_register.hpp
+++ b/arch/x86_64/include/x86_64/cpu/control_register.hpp
@@ -85,6 +85,9 @@ namespace teachos::cpu::x86_64
template<typename Derived, typename ValueType, typename = void>
struct control_register_with_flags
{
+ private:
+ constexpr control_register_with_flags() noexcept = default;
+ friend Derived;
};
//! @copydoc control_register_with_flags
diff --git a/arch/x86_64/include/x86_64/cpu/model_specific_register.hpp b/arch/x86_64/include/x86_64/cpu/model_specific_register.hpp
index 857b444..39765fe 100644
--- a/arch/x86_64/include/x86_64/cpu/model_specific_register.hpp
+++ b/arch/x86_64/include/x86_64/cpu/model_specific_register.hpp
@@ -52,6 +52,9 @@ namespace teachos::cpu::x86_64
template<typename Derived, typename ValueType, typename = void>
struct model_specific_register_with_flags
{
+ private:
+ constexpr model_specific_register_with_flags() noexcept = default;
+ friend Derived;
};
//! @copydoc model_specific_register_with_flags
diff --git a/arch/x86_64/include/x86_64/device_io/port_io.hpp b/arch/x86_64/include/x86_64/device_io/port_io.hpp
index c3e5271..295a0cd 100644
--- a/arch/x86_64/include/x86_64/device_io/port_io.hpp
+++ b/arch/x86_64/include/x86_64/device_io/port_io.hpp
@@ -38,6 +38,9 @@ namespace teachos::io::x86_64
}
private:
+ constexpr port_read() noexcept = default;
+ friend Derived;
+
//! The assembly templates used for reading from an I/O port.
constexpr auto static code = std::array{
std::string_view{"mov %[port], %%dx\nin %%dx, %%al\nmov %%al, %[data]"},
@@ -61,6 +64,9 @@ namespace teachos::io::x86_64
}
private:
+ constexpr port_write() noexcept = default;
+ friend Derived;
+
//! The assembly templates used for writing to an I/O port.
constexpr auto static code = std::array{
std::string_view{"mov %[port], %%dx\nmov %%dx, %[data]\nout %%al, %%dx"},