pub fn tempUnmap(tempVaddr: u64) {
	let mut idx_pud = 0 as isize;
	let mut idx_pmd = 0 as isize;
	let mut idx_pt = 0 as isize;
	let l1_xlation_table = getL1XlationTable();
	let mut entry: u64 = 0;
	let mut pPmd: *mut u64;
 	let mut pPt: *mut u64;

	idx_pud = PUD_IDX(tempVaddr);
	entry = getEntry(l1_xlation_table, idx_pud);
	if entry == 0u64 { ymh_log_str("WRONG1\n\0"); return; }
	else {
		pPmd = getTranslationAddrFromEntry(entry);
		idx_pmd = PMD_IDX(tempVaddr);
		entry = getEntry(pPmd, idx_pmd);
		if entry == 0u64 { ymh_log_str("WRONG2\n\0"); return; }
		else {
			pPt = getTranslationAddrFromEntry(entry);
			idx_pt = PT_IDX(tempVaddr);
			entry = getEntry(pPt, idx_pt);
			if entry == 0u64 { ymh_log_str("WRONG3\n\0"); return; }

			// free PT
			putTable(pPt);
			setEntry(pPmd, idx_pmd, 0);
		}

		//free PMD
		putTable(pPmd);
		setEntry(l1_xlation_table, idx_pud, 0);
	}
}
/*
 * See comment on tempMap(). I don't use PGD.
 *
 * I assume we have only a single page is mapped temporarily.
 * So, for now, I unmap the page and remove all tables.
 */
See comment on tempMap(). I don't use PGD.
I assume we have only a single page is mapped temporarily.
So, for now, I unmap the page and remove all tables.
See comment on tempMap () . I don ' t use PGD . I assume we have only a single page is mapped temporarily . So for now I unmap the page and remove all tables .
pub fn tempUnmap(tempVaddr: u64) {
	let mut idx_pud = 0 as isize;
	let mut idx_pmd = 0 as isize;
	let mut idx_pt = 0 as isize;
	let l1_xlation_table = getL1XlationTable();
	let mut entry: u64 = 0;
	let mut pPmd: *mut u64;
 	let mut pPt: *mut u64;
	idx_pud = PUD_IDX(tempVaddr);
	entry = getEntry(l1_xlation_table, idx_pud);
	if entry == 0u64 { ymh_log_str("WRONG1\n\0"); return; }
	else {
		pPmd = getTranslationAddrFromEntry(entry);
		idx_pmd = PMD_IDX(tempVaddr);
		entry = getEntry(pPmd, idx_pmd);
		if entry == 0u64 { ymh_log_str("WRONG2\n\0"); return; }
		else {
			pPt = getTranslationAddrFromEntry(entry);
			idx_pt = PT_IDX(tempVaddr);
			entry = getEntry(pPt, idx_pt);
			if entry == 0u64 { ymh_log_str("WRONG3\n\0"); return; }
			// free PT
			putTable(pPt);
			setEntry(pPmd, idx_pmd, 0);
		}
		//free PMD
		putTable(pPmd);
		setEntry(l1_xlation_table, idx_pud, 0);
	}
}
pub fn tempUnmap ( tempVaddr : u64 ) { let mut idx_pud = 0 as isize ; let mut idx_pmd = 0 as isize ; let mut idx_pt = 0 as isize ; let l1_xlation_table = getL1XlationTable ( ) ; let mut entry : u64 = 0 ; let mut pPmd : * mut u64 ; let mut pPt : * mut u64 ; idx_pud = PUD_IDX ( tempVaddr ) ; entry = getEntry ( l1_xlation_table , idx_pud ) ; if entry == 0u64 { ymh_log_str ( " \n \0 " ) ; return ; } else { pPmd = getTranslationAddrFromEntry ( entry ) ; idx_pmd = PMD_IDX ( tempVaddr ) ; entry = getEntry ( pPmd , idx_pmd ) ; if entry == 0u64 { ymh_log_str ( " \n \0 " ) ; return ; } else { pPt = getTranslationAddrFromEntry ( entry ) ; idx_pt = PT_IDX ( tempVaddr ) ; entry = getEntry ( pPt , idx_pt ) ; if entry == 0u64 { ymh_log_str ( " \n \0 " ) ; return ; } // free PT putTable ( pPt ) ; setEntry ( pPmd , idx_pmd , 0 ) ; } //free PMD putTable ( pPmd ) ; setEntry ( l1_xlation_table , idx_pud , 0 ) ; } }
See comment on tempMap().
See comment on tempMap () .
tempVaddr
u64
tempVaddr
u64