From db5f26fe55527521a0ae8ca7cad01f0ba8eb0c49 Mon Sep 17 00:00:00 2001 From: NatrixAeria Date: Fri, 16 Apr 2021 16:24:49 +0200 Subject: Remove wrong size_of multiplier in memcpy, memset --- kernel/src/io/vga_text.rs | 22 ++++------------------ 1 file changed, 4 insertions(+), 18 deletions(-) (limited to 'kernel') diff --git a/kernel/src/io/vga_text.rs b/kernel/src/io/vga_text.rs index 890defb..e44d341 100644 --- a/kernel/src/io/vga_text.rs +++ b/kernel/src/io/vga_text.rs @@ -167,18 +167,12 @@ impl<'a> VgaTerminalControllerLock<'a> { core::intrinsics::volatile_copy_memory( self.start(), self.start().offset(offset as isize), - (self.area() - offset) * core::mem::size_of::(), + self.area() - offset, ); } let pos = self.area() - offset; *self.lock = unsafe { self.start().offset(pos as isize) }; - unsafe { - core::intrinsics::volatile_set_memory( - *self.lock, - 0u8, - offset * core::mem::size_of::(), - ) - } + unsafe { core::intrinsics::volatile_set_memory(*self.lock, 0u8, offset) } } pub fn set_color_state(&mut self, fg: Color, bg: Color) { @@ -187,11 +181,7 @@ impl<'a> VgaTerminalControllerLock<'a> { pub fn clear(&mut self) { unsafe { - core::intrinsics::volatile_set_memory( - *self.lock, - 0u8, - self.area() * core::mem::size_of::(), - ); + core::intrinsics::volatile_set_memory(*self.lock, 0u8, self.area()); *self.lock = self.start(); } } @@ -218,11 +208,7 @@ impl<'a> VgaTerminalControllerLock<'a> { ); } unsafe { - core::intrinsics::volatile_copy_memory( - *self.lock, - chars.as_ptr(), - core::mem::size_of::() * chars.len(), - ); + core::intrinsics::volatile_copy_memory(*self.lock, chars.as_ptr(), chars.len()); *self.lock = self.lock.offset(chars.len() as isize); } } -- cgit v1.2.3-70-g09d2