Revert some changes which don't have proper dependencies.
[mono-project.git] / mono / utils / mono-hwcap-sparc.c
blob6775a39668fc988fa031f3f4c1187eaa3ad26541
1 /**
2 * \file
3 * SPARC hardware feature detection
5 * Authors:
6 * Alex Rønne Petersen (alexrp@xamarin.com)
7 * Elijah Taylor (elijahtaylor@google.com)
8 * Miguel de Icaza (miguel@xamarin.com)
9 * Neale Ferguson (Neale.Ferguson@SoftwareAG-usa.com)
10 * Paolo Molaro (lupus@xamarin.com)
11 * Rodrigo Kumpera (kumpera@gmail.com)
12 * Sebastien Pouliot (sebastien@xamarin.com)
13 * Zoltan Varga (vargaz@xamarin.com)
15 * Copyright 2003 Ximian, Inc.
16 * Copyright 2003-2011 Novell, Inc
17 * Copyright 2006 Broadcom
18 * Copyright 2007-2008 Andreas Faerber
19 * Copyright 2011-2013 Xamarin Inc
20 * Licensed under the MIT license. See LICENSE file in the project root for full license information.
23 #include "mono/utils/mono-hwcap.h"
25 #include <string.h>
26 #if !defined(__linux__)
27 #include <sys/systeminfo.h>
28 #else
29 #include <unistd.h>
30 #endif
32 void
33 mono_hwcap_arch_init (void)
35 char buf [1024];
37 #if !defined(__linux__)
38 g_assert (sysinfo (SI_ISALIST, buf, 1024));
39 #else
40 /* If the page size is 8192, we're on a 64-bit SPARC, which
41 * in turn means a v9 or better.
43 if (getpagesize () == 8192)
44 strcpy (buf, "sparcv9");
45 else
46 strcpy (buf, "sparcv8");
47 #endif
49 mono_hwcap_sparc_is_v9 = strstr (buf, "sparcv9");