⚠️ VeridianOS Kernel Documentation - This is low-level kernel code. All functions are unsafe unless explicitly marked otherwise. no_std

apply_write_combining

Function apply_write_combining 

Source
pub unsafe fn apply_write_combining(vaddr: usize, size: usize)
Expand description

Apply write-combining attributes to a virtual address range.

Walks the active page table (CR3), finds PTEs for each 4KB page in the range, sets PWT=1 PCD=0 PAT=0 (PAT index 1 = WC after init()), and flushes the TLB entry.

§Safety

  • vaddr must be page-aligned and mapped with 4KB pages.
  • size must be a multiple of 4096.
  • PAT entry 1 must have been reprogrammed to WC via init().