summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorhaesbaert <haesbaert@openbsd.org>2012-04-22 19:36:09 +0000
committerhaesbaert <haesbaert@openbsd.org>2012-04-22 19:36:09 +0000
commit53d8dcdcbe496437c182a4ef98312fef24c37df6 (patch)
treeb3754a5d8346cb232ee0afa1659e47b2062a07bb
parentRemove redundant returns from functions returning void. Wrap return (diff)
downloadwireguard-openbsd-53d8dcdcbe496437c182a4ef98312fef24c37df6.tar.xz
wireguard-openbsd-53d8dcdcbe496437c182a4ef98312fef24c37df6.zip
Test vendor against cpu_vendor instead of calling CPUID, this matches
the other uses. ok mikeb@
-rw-r--r--sys/arch/amd64/amd64/identcpu.c9
1 files changed, 2 insertions, 7 deletions
diff --git a/sys/arch/amd64/amd64/identcpu.c b/sys/arch/amd64/amd64/identcpu.c
index 77436353af2..ad53ca9078b 100644
--- a/sys/arch/amd64/amd64/identcpu.c
+++ b/sys/arch/amd64/amd64/identcpu.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: identcpu.c,v 1.35 2012/03/27 02:23:04 haesbaert Exp $ */
+/* $OpenBSD: identcpu.c,v 1.36 2012/04/22 19:36:09 haesbaert Exp $ */
/* $NetBSD: identcpu.c,v 1.1 2003/04/26 18:39:28 fvdl Exp $ */
/*
@@ -302,7 +302,6 @@ identifycpu(struct cpu_info *ci)
u_int64_t last_tsc;
u_int32_t dummy, val, pnfeatset;
u_int32_t brand[12];
- u_int32_t vendor[4];
char mycpu_model[48];
int i, max;
char *brandstr_from, *brandstr_to;
@@ -433,11 +432,7 @@ identifycpu(struct cpu_info *ci)
#endif
- vendor[3] = 0;
- CPUID(0, dummy, vendor[0], vendor[2], vendor[1]); /* yup, 0 2 1 */
- /* AuthenticAMD: h t u A i t n e */
- if (vendor[0] == 0x68747541 && vendor[1] == 0x69746e65 &&
- vendor[2] == 0x444d4163) /* DMAc */
+ if (!strcmp(cpu_vendor, "AuthenticAMD"))
amd64_errata(ci);
if (strncmp(mycpu_model, "VIA Nano processor", 18) == 0) {