chore: fix almost *ALL* warnings.
[lunaix-os.git] / lunaix-os / kernel / mm / mmio.c
index 99e8fb8e36298d3b45c394e2eb3a5246377a7c4b..cac4a894a7f7c25552c2b779eaeb2de926792b6e 100644 (file)
@@ -4,23 +4,25 @@
 #include <lunaix/spike.h>
 
 void*
-ioremap(uintptr_t paddr, u32_t size)
+ioremap(ptr_t paddr, u32_t size)
 {
     void* ptr = vmm_vmap(paddr, size, PG_PREM_RW | PG_DISABLE_CACHE);
+
     if (ptr) {
         pmm_mark_chunk_occupied(KERNEL_PID,
                                 paddr >> PG_SIZE_BITS,
                                 CEIL(size, PG_SIZE_BITS),
                                 PP_FGLOCKED);
     }
+
     return ptr;
 }
 
-void*
-iounmap(uintptr_t vaddr, u32_t size)
+void
+iounmap(ptr_t vaddr, u32_t size)
 {
     for (size_t i = 0; i < size; i += PG_SIZE) {
-        uintptr_t paddr = vmm_del_mapping(PD_REFERENCED, vaddr + i);
+        ptr_t paddr = vmm_del_mapping(VMS_SELF, vaddr + i);
         pmm_free_page(KERNEL_PID, paddr);
     }
 }
\ No newline at end of file