rem: *out_flags |= (entry->page_protection == PTE_READ_ONLY) ? LOCK_RO : LOCK_RW; if (va >= KERNEL_BASE) *out_flags |= LOCK_KERNEL; *out_flags |= entry->changed ? PAGE_MODIFIED : 0; *out_flags |= entry->referenced ? PAGE_ACCESSED : 0; *out_flags |= entry->valid ? PAGE_PRESENT : 0;
add: if (IS_KERNEL_ADDRESS(va)) *_outFlags |= B_KERNEL_READ_AREA | (entry->page_protection == PTE_READ_ONLY ? 0 : B_KERNEL_WRITE_AREA); else *_outFlags |= B_KERNEL_READ_AREA | B_KERNEL_WRITE_AREA | B_READ_AREA | (entry->page_protection == PTE_READ_ONLY ? 0 : B_WRITE_AREA);
context: query_tmap(vm_translation_map *map, addr_t va, addr_t *out_physical, unsigned int *out_flags){	page_table_entry *entry;	// default the flags to not present	*out_flags = 0;	*out_physical = 0;	entry = lookup_pagetable_entry(map, va);	if (entry == NULL)		return B_NO_ERROR;	*out_flags |= (entry->page_protection == PTE_READ_ONLY) ? LOCK_RO : LOCK_RW;	if (va >= KERNEL_BASE)		*out_flags |= LOCK_KERNEL; // XXX is this enough?	*out_flags |= entry->changed ? PAGE_MODIFIED : 0;	*out_flags |= entry->referenced ? PAGE_ACCESSED : 0;	*out_flags |= entry->valid ? PAGE_PRESENT : 0;	*out_physical = entry->physical_page_number * B_PAGE_SIZE;	return B_OK;}