diff --git a/kernel/src/memory/MemoryManager.cpp b/kernel/src/memory/MemoryManager.cpp index e085426e..4d95e8f5 100644 --- a/kernel/src/memory/MemoryManager.cpp +++ b/kernel/src/memory/MemoryManager.cpp @@ -433,7 +433,7 @@ namespace MemoryManager uintptr_t user_ptr = (uintptr_t)user; uintptr_t user_page = align_down(user_ptr); - const char* kernel_ptr = (const char*)kernel; + const u8* kernel_ptr = (const u8*)kernel; // Userspace pointer not aligned on page boundary if (user_ptr != user_page) @@ -449,7 +449,7 @@ namespace MemoryManager if (!validate_user_writable_page(user_ptr)) return false; } - *(char*)user_ptr = *kernel_ptr++; + *(u8*)user_ptr = *kernel_ptr++; user_ptr++; } @@ -461,7 +461,7 @@ namespace MemoryManager uintptr_t user_ptr = (uintptr_t)user; uintptr_t user_page = align_down(user_ptr); - char* kernel_ptr = (char*)kernel; + u8* kernel_ptr = (u8*)kernel; // Userspace pointer not aligned on page boundary if (user_ptr != user_page) @@ -477,7 +477,7 @@ namespace MemoryManager if (!validate_user_readable_page(user_ptr)) return false; } - *kernel_ptr++ = *(const char*)user_ptr; + *kernel_ptr++ = *(const u8*)user_ptr; user_ptr++; } diff --git a/luna/include/luna/Alignment.h b/luna/include/luna/Alignment.h index 4085e3ef..68b17e4a 100644 --- a/luna/include/luna/Alignment.h +++ b/luna/include/luna/Alignment.h @@ -49,7 +49,5 @@ static_assert(get_blocks_from_size(0, 256) == 0); // arithmetic. template constexpr T* offset_ptr(T* ptr, Offset offset) { - // FIXME: The C standard does not mandate that char be 1 byte. This function (and probably many others) rely on that - // assumption. - return (T*)((char*)ptr + offset); + return (T*)((u8*)ptr + offset); }