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