shithub: nix

Download patch

ref: e8f56cf888be366c443138afd33dfbe6c14d63a6
parent: 2499506dfedee7c2b68aa431306349e9037ba80e
author: glenda <glenda@cirno>
date: Thu May 9 09:53:39 EDT 2024

rethinking nix.
our original model was that there were ac's and tc's and ac's ran a very simple "kernel".
but the cpu model for that does not really exist.
It may be just as cheap/better to have a device that drops you into a
'lightweight' mode that disables all interrupts or swaps the idt for a lightweight
one and takes it from there. So it's time to take a pause and think about things.

--- a/sys/src/nix/pc64/acore.c
+++ b/sys/src/nix/pc64/acore.c
@@ -237,7 +237,7 @@
 	}
 Post:
 	nix->icc->rc = ICCTRAP;
-	//m->cr2 = getcr2();
+	nix->cr2 = getcr2();
 	memmove(m->proc->dbgreg, u, sizeof *u);
 	nix->icc->note = n;
 #ifdef ZERO
@@ -247,11 +247,12 @@
 	mfence();
 	nix->icc->fn = nil;
 	ready(m->proc);
-
+	print("proc ready\n");
 	//mwait(&m->icc->fn);
+	print("waiting on fn\n");
 	while(! nix->icc->fn)
 		;
-
+	print("fn back\n");
 	if(nix->icc->flushtlb)
 		acmmuswitch();
 	if(nix->icc->fn != actrapret)
--- a/sys/src/nix/pc64/nix.h
+++ b/sys/src/nix/pc64/nix.h
@@ -16,6 +16,7 @@
 	uvlong nicc;
 	int apicno; // not sure we need this? 
 	int online; // TODO: what is this really? };
+	uvlong cr2;
 };
 
 /*