Fixed a few bugs that were found by Visual Studio's static code analysis.
[mono.git] / mono / utils / mono-hwcap-s390x.c
index baf70bc9295a5e2c713a4f4b4af7be01d61648a2..889df8aebf6816896ef5592ed86f2b5ea8d5c768 100644 (file)
 
 gboolean mono_hwcap_s390x_has_ld = FALSE;
 
+#if defined(MONO_CROSS_COMPILE)
+void
+mono_hwcap_arch_init (void)
+{
+}
+#else
 static void
 catch_sigill (int sig_no, siginfo_t *info, gpointer act)
 {
@@ -31,7 +37,7 @@ catch_sigill (int sig_no, siginfo_t *info, gpointer act)
 }
 
 void
-mono_hwcap_init (void)
+mono_hwcap_arch_init (void)
 {
        mono_hwcap_s390x_has_ld = TRUE;
 
@@ -47,7 +53,7 @@ mono_hwcap_init (void)
 
        sigaction (SIGILL, &sa, old_sa);
 
-       __asm__ (
+       __asm__ __volatile__ (
                "LGHI\t0,1\n\t"
                "LA\t1,%0\n\t"
                ".byte\t0xe3,0x00,0x10,0x00,0x00,0x50\n\t"
@@ -58,3 +64,10 @@ mono_hwcap_init (void)
 
        sigaction (SIGILL, old_sa, NULL);
 }
+#endif
+
+void
+mono_hwcap_print (FILE *f)
+{
+       g_fprintf (f, "mono_hwcap_s390x_has_ld = %i\n", mono_hwcap_s390x_has_ld);
+}