git: 9front

Download patch

ref: f0ac39fd0d394f9d1c317701fe7d889c4adf3609
parent: ca22c279391e49f5d48da0182f74dccb8578b73e
author: cinap_lenrek <cinap_lenrek@felloff.net>
date: Tue Dec 8 11:00:57 EST 2020

pc64: preserve reserved bits in CR0/CR4 for amd64 in mtrr setstate()

On AMD64, CR0/CR4 are 64-bit registers, with
the upper half reserved. So use uintptr type
to store the register values to get 32 bit on 386
and 64 bit on AMD64.

--- a/sys/src/9/pc/mtrr.c
+++ b/sys/src/9/pc/mtrr.c
@@ -354,7 +354,7 @@
 static void
 putstate(State *s)
 {
-	ulong cr0, cr4;
+	uintptr cr0, cr4;
 	int i, x;
 
 	x = splhi();
--