From 9fc9f755e1f9ec56a452b334f6112028e0ec0329 Mon Sep 17 00:00:00 2001
From: Robert Morris <rtm@csail.mit.edu>
Date: Tue, 9 Aug 2022 11:44:02 -0400
Subject: adopt github PR98 (No need to store TRAPFRAME in sscratch register)

---
 kernel/riscv.h | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

(limited to 'kernel/riscv.h')

diff --git a/kernel/riscv.h b/kernel/riscv.h
index 1691faf..1f8a503 100644
--- a/kernel/riscv.h
+++ b/kernel/riscv.h
@@ -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
-- 
cgit v1.2.3