shithub: riscv

Download patch

ref: e6d84a3fa6c867594d9b572dddd4f4410708dbc9
parent: bae3ac29fc39bc36329abf1823004c0d79b2f6f0
author: cinap_lenrek <cinap_lenrek@felloff.net>
date: Thu Jul 16 04:49:24 EDT 2015

aux/cpuid: make sure extended feature bits are available (fixes crash on the pentium II)

--- a/sys/src/cmd/aux/cpuid.c
+++ b/sys/src/cmd/aux/cpuid.c
@@ -246,6 +246,8 @@
 		}else
 			funcs[i](i);
 	r = cpuid(0x80000000, 0);
+	if(r.ax < 0x80000000)
+		exits(nil);
 	r.ax -= 0x80000000;
 	for(i = 0; i <= r.ax; i++)
 		if(i >= nelem(extfuncs) || extfuncs[i] == nil || rflag){
@@ -253,5 +255,5 @@
 				stdfunc(0x80000000 | i);
 		}else
 			extfuncs[i](0x80000000 | i);
-	Bterm(out);
+	exits(nil);
 }