File tree Expand file tree Collapse file tree 1 file changed +27
-0
lines changed Expand file tree Collapse file tree 1 file changed +27
-0
lines changed Original file line number Diff line number Diff line change @@ -237,6 +237,33 @@ static inline pte_t *get_l1_table(const void *va) {
237
237
return INVALID_PGENTRY (l1e ) ? NULL : mfn_to_virt_kern (l1e -> mfn );
238
238
}
239
239
240
+ /* Return the virtual address of the PT entry mapping this virtual address.
241
+ * The entry is assumed to be mapped
242
+ */
243
+ static inline pgentry_t * get_pte (const void * va ) {
244
+ pte_t * l1t = get_l1_table (va );
245
+ pte_t * l1e = l1_table_entry (l1t , va );
246
+ return & (l1e -> entry );
247
+ }
248
+
249
+ /* Return the virtual address of the PD entry mapping this virtual address.
250
+ * The entry is assumed to be mapped
251
+ */
252
+ static inline pgentry_t * get_pde (const void * va ) {
253
+ pde_t * l2t = get_l2_table (va );
254
+ pde_t * l2e = l2_table_entry (l2t , va );
255
+ return & (l2e -> entry );
256
+ }
257
+
258
+ /* Return the virtual address of the PDP entry mapping this virtual address.
259
+ * The entry is assumed to be mapped
260
+ */
261
+ static inline pgentry_t * get_pdpe (const void * va ) {
262
+ pdpe_t * l3t = get_l3_table (va );
263
+ pdpe_t * l3e = l3_table_entry (l3t , va );
264
+ return & (l3e -> entry );
265
+ }
266
+
240
267
static inline void set_pgentry (pgentry_t * e , mfn_t mfn , unsigned long flags ) {
241
268
* e = pgentry_from_mfn (mfn , flags );
242
269
barrier ();
You can’t perform that action at this time.
0 commit comments