shithub: n900

Download patch

ref: 1b15b212531f4aac9398406ab1abb5dd907239fa
parent: 8b7518af22beda45575f9f1300b1d2c41430486a
author: mia soweli <mia@soweli.net>
date: Sat Aug 16 11:10:55 EDT 2025

9: drop the probeaddr() bullshit

not even used, and this isn't the correct way of doing things.
figure out how to talk to the pmu and actually turn the hardware on
instead of guessing about if it works.

--- a/sys/src/9/omap/fns.h
+++ b/sys/src/9/omap/fns.h
@@ -13,7 +13,6 @@
 int tas(void *);
 
 void evenaddr(uintptr a);
-int probeaddr(uintptr a);
 void procrestore(Proc *);
 void procsave(Proc *);
 void procsetup(Proc *);
--- a/sys/src/9/omap/trap.c
+++ b/sys/src/9/omap/trap.c
@@ -8,9 +8,6 @@
 #include "tos.h"
 #include "ureg.h"
 
-static volatile int probing;
-static volatile int probed;
-
 void
 callwithureg(void (*f) (Ureg *))
 {
@@ -342,12 +339,6 @@
 
 	case PsrMdabt:
 		ureg->pc -= 8;
-		if(probing && !user) {
-			ureg->pc += 4;
-			probed = 0;
-			goto out;
-		}
-
 		fpukenter(ureg);
 		traparm(ureg, getdfsr(), getdfar());
 		break;
@@ -411,26 +402,4 @@
 
 	kexit(ureg);
 	fpukexit(ureg);
-}
-
-int
-probeaddr(uintptr a)
-{
-	static Lock l;
-	volatile ulong v;
-
-	ilock(&l);
-	probing = 1;
-	probed = 1;
-
-	v = *(ulong*)a;
-
-	coherence();
-	if(!probed) {
-		iunlock(&l);
-		return 0;
-	}
-
-	iunlock(&l);
-	return 1;
 }
--