adopt github PR98 (No need to store TRAPFRAME in sscratch register)

This commit is contained in:
Robert Morris 2022-08-09 11:44:02 -04:00
parent ca6fc54934
commit 9fc9f755e1
3 changed files with 31 additions and 26 deletions

View file

@ -1,3 +1,5 @@
#ifndef __ASSEMBLER__
// which hart (core) is this?
static inline uint64
r_mhartid()
@ -331,6 +333,10 @@ sfence_vma()
asm volatile("sfence.vma zero, zero");
}
typedef uint64 pte_t;
typedef uint64 *pagetable_t; // 512 PTEs
#endif // __ASSEMBLER__
#define PGSIZE 4096 // bytes per page
#define PGSHIFT 12 // bits of offset within a page
@ -361,6 +367,3 @@ sfence_vma()
// Sv39, to avoid having to sign-extend virtual addresses
// that have the high bit set.
#define MAXVA (1L << (9 + 9 + 9 + 12 - 1))
typedef uint64 pte_t;
typedef uint64 *pagetable_t; // 512 PTEs