fn clone_map(&self, page_table: Arc<Mutex<dyn GenericPageTable>>) -> ZxResult<Arc<Self>> {
        //这里调用hal protect后,protect()好像会破坏页表
        let new_vmo = self.vmo.create_child(false, 0, self.vmo.len())?;
        let mapping = Arc::new(VmMapping {
            inner: Mutex::new(self.inner.lock().clone()),
            permissions: self.permissions,
            page_table,
            vmo: new_vmo.clone(),
        });
        new_vmo.append_mapping(Arc::downgrade(&mapping));
        Ok(mapping)
    }
/// Clone VMO and map it to a new page table. (For Linux)
Clone VMO and map it to a new page table. (For Linux)
Clone VMO and map it to a new page table . ( For Linux )
fn clone_map(&self, page_table: Arc<Mutex<dyn GenericPageTable>>) -> ZxResult<Arc<Self>> {
        //这里调用hal protect后,protect()好像会破坏页表
        let new_vmo = self.vmo.create_child(false, 0, self.vmo.len())?;
        let mapping = Arc::new(VmMapping {
            inner: Mutex::new(self.inner.lock().clone()),
            permissions: self.permissions,
            page_table,
            vmo: new_vmo.clone(),
        });
        new_vmo.append_mapping(Arc::downgrade(&mapping));
        Ok(mapping)
    }
fn clone_map ( & self , page_table : Arc < Mutex < dyn GenericPageTable > > ) -> ZxResult < Arc < Self > > { //这里调用hal protect后,protect()好像会破坏页表 let new_vmo = self . vmo . create_child ( false , 0 , self . vmo . len ( ) ) ? ; let mapping = Arc :: new ( VmMapping { inner : Mutex :: new ( self . inner . lock ( ) . clone ( ) ) , permissions : self . permissions , page_table , vmo : new_vmo . clone ( ) , } ) ; new_vmo . append_mapping ( Arc :: downgrade ( & mapping ) ) ; Ok ( mapping ) }
Clone VMO and map it to a new page table.
Clone VMO and map it to a new page table .
&self
page_table
Arc<Mutex<dyn GenericPageTable>>
&self
page_table
Arc<Mutex<dyn GenericPageTable>>