// Extends the exact K2045 backend with a read-only transfer validation and an // infallible CPU-owner commit. The guarded stack and its five leases move intact. unsafe impl th::MigrationBackend for ThreadBackend<'_>{ fn observe_transfer(&self,s:&Stack,source:u32,target:u32)->Result{ if self.cpu!=target{return Err(th::Error::Context)}self.validate_owned(s,source)?; let l=s.layout();let guard=s.guard.as_ref().ok_or(th::Error::Guard)?; let descriptor=self.shared.tables.os_k1020_stack_guard_descriptor(guard).map_err(|_|th::Error::Guard)?; Ok(th::StackObservation{layout:l,guard_descriptor:descriptor,low_canary:unsafe{read_volatile(l.base as*const u64)},high_canary:unsafe{read_volatile((l.base+l.bytes-8)as*const u64)},initially_zeroed:(1..l.bytes/8-1).all(|i|unsafe{read_volatile((l.base as*const u64).add(i as usize))}==0)}) } fn commit_transfer(&mut self,s:&mut Stack,source:u32,target:u32){ if s.cpu!=source||self.cpu!=target||execution().cpu!=target{park()}s.cpu=target; } }