better pointers and a broken vmm

better pointers and a broken vmm
This commit is contained in:
Zoe
2024-08-25 21:56:18 -05:00
parent bab094b9cd
commit 224a9783d9
27 changed files with 1275 additions and 444 deletions

View File

@@ -1,5 +1,7 @@
use core::arch::asm;
use crate::mem::VirtualPtr;
#[inline(always)]
pub fn outb(port: u16, value: u8) {
unsafe {
@@ -60,7 +62,9 @@ pub fn inw(port: u16) -> u16 {
///
/// This function panics if the supplied buffer's size is smaller than `count`.
#[inline(always)]
pub unsafe fn insw(port: u16, buffer: *mut u16, count: usize) {
pub unsafe fn insw(port: u16, buffer: VirtualPtr<u16>, count: usize) {
let buffer = buffer.as_raw_ptr();
asm!("cld",
"rep insw",
in("dx") port,
@@ -75,7 +79,9 @@ pub unsafe fn insw(port: u16, buffer: *mut u16, count: usize) {
///
/// This function panics if the supplied buffer's size is smaller than `count`.
#[inline(always)]
pub unsafe fn outsb(port: u16, buffer: *const u8, count: usize) {
pub unsafe fn outsb(port: u16, buffer: VirtualPtr<u8>, count: usize) {
let buffer = buffer.as_raw_ptr();
asm!("cld",
"rep outsb",
in("dx") port,
@@ -90,7 +96,9 @@ pub unsafe fn outsb(port: u16, buffer: *const u8, count: usize) {
///
/// This function panics if the supplied buffer's size is smaller than `count`.
#[inline(always)]
pub unsafe fn outsw(port: u16, buffer: *const u16, count: usize) {
pub unsafe fn outsw(port: u16, buffer: VirtualPtr<u16>, count: usize) {
let buffer = buffer.as_raw_ptr();
asm!("cld",
"rep outsw",
in("dx") port,