From cf0c095721b22b8ce011484a2509cd27858cbe77 Mon Sep 17 00:00:00 2001
From: Robert Morris <rtm@csail.mit.edu>
Date: Tue, 9 Aug 2022 12:14:29 -0400
Subject: [PATCH] sscratch cleanup

---
 kernel/proc.h  | 1 -
 kernel/riscv.h | 7 -------
 2 files changed, 8 deletions(-)

diff --git a/kernel/proc.h b/kernel/proc.h
index f6ca8b7..d021857 100644
--- a/kernel/proc.h
+++ b/kernel/proc.h
@@ -31,7 +31,6 @@ extern struct cpu cpus[NCPU];
 // per-process data for the trap handling code in trampoline.S.
 // sits in a page by itself just under the trampoline page in the
 // user page table. not specially mapped in the kernel page table.
-// the sscratch register points here.
 // uservec in trampoline.S saves user registers in the trapframe,
 // then initializes registers from the trapframe's
 // kernel_sp, kernel_hartid, kernel_satp, and jumps to kernel_trap.
diff --git a/kernel/riscv.h b/kernel/riscv.h
index 1f8a503..d758845 100644
--- a/kernel/riscv.h
+++ b/kernel/riscv.h
@@ -216,13 +216,6 @@ r_satp()
   return x;
 }
 
-// Supervisor Scratch register, for early trap handler in trampoline.S.
-static inline void 
-w_sscratch(uint64 x)
-{
-  asm volatile("csrw sscratch, %0" : : "r" (x));
-}
-
 static inline void 
 w_mscratch(uint64 x)
 {