Merge pull request #2820 from kumpera/license-change-rebased
[mono.git] / mono / metadata / sgen-client-mono.h
index b44d0bc1711998c053ad6a62f0674337810b360a..54630c6ee033853a8ac63065b70eb7cfa1f3a100 100644 (file)
@@ -3,18 +3,7 @@
  *
  * Copyright (C) 2014 Xamarin Inc
  *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public
- * License 2.0 as published by the Free Software Foundation;
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Library General Public License for more details.
- *
- * You should have received a copy of the GNU Library General Public
- * License 2.0 along with this library; if not, write to the Free
- * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ * Licensed under the MIT license. See LICENSE file in the project root for full license information.
  */
 
 #ifdef SGEN_DEFINE_OBJECT_VTABLE
@@ -90,7 +79,7 @@ struct _SgenClientThreadInfo {
 #include "utils/mono-counters.h"
 #include "utils/mono-logger-internals.h"
 #include "utils/mono-time.h"
-#include "utils/mono-semaphore.h"
+#include "utils/mono-os-semaphore.h"
 #include "metadata/sgen-bridge-internals.h"
 
 extern void mono_sgen_register_moved_object (void *obj, void *destination);
@@ -401,7 +390,7 @@ sgen_client_binary_protocol_block_free (gpointer addr, size_t size)
 }
 
 static void G_GNUC_UNUSED
-sgen_client_binary_protocol_block_set_state (gpointer addr, size_t size, int old, int new)
+sgen_client_binary_protocol_block_set_state (gpointer addr, size_t size, int old, int new_)
 {
 }
 
@@ -560,6 +549,11 @@ sgen_client_binary_protocol_global_remset (gpointer ptr, gpointer value, gpointe
 #endif
 }
 
+static void G_GNUC_UNUSED
+sgen_client_binary_protocol_mod_union_remset (gpointer obj, gpointer ptr, gpointer value, gpointer value_vtable)
+{
+}
+
 static void G_GNUC_UNUSED
 sgen_client_binary_protocol_ptr_update (gpointer ptr, gpointer old_value, gpointer new_value, gpointer vtable, size_t size)
 {
@@ -655,6 +649,46 @@ sgen_client_binary_protocol_gray_dequeue (gpointer queue, gpointer cursor, gpoin
 {
 }
 
+static void G_GNUC_UNUSED
+sgen_client_binary_protocol_major_card_table_scan_start (long long timestamp, gboolean mod_union)
+{
+}
+
+static void G_GNUC_UNUSED
+sgen_client_binary_protocol_major_card_table_scan_end (long long timestamp, gboolean mod_union)
+{
+}
+
+static void G_GNUC_UNUSED
+sgen_client_binary_protocol_los_card_table_scan_start (long long timestamp, gboolean mod_union)
+{
+}
+
+static void G_GNUC_UNUSED
+sgen_client_binary_protocol_los_card_table_scan_end (long long timestamp, gboolean mod_union)
+{
+}
+
+static void G_GNUC_UNUSED
+sgen_client_binary_protocol_finish_gray_stack_start (long long timestamp, int generation)
+{
+}
+
+static void G_GNUC_UNUSED
+sgen_client_binary_protocol_finish_gray_stack_end (long long timestamp, int generation)
+{
+}
+
+static void G_GNUC_UNUSED
+sgen_client_binary_protocol_worker_finish (long long timestamp, gboolean forced)
+{
+}
+
+static void G_GNUC_UNUSED
+sgen_client_binary_protocol_evacuating_blocks (size_t block_size)
+{
+}
+
 int sgen_thread_handshake (BOOL suspend);
 gboolean sgen_suspend_thread (SgenThreadInfo *info);
 gboolean sgen_resume_thread (SgenThreadInfo *info);
@@ -670,8 +704,6 @@ extern MonoNativeTlsKey thread_info_key;
 #define IN_CRITICAL_REGION (__thread_info__->client_info.in_critical_region)
 #endif
 
-#ifndef DISABLE_CRITICAL_REGION
-
 #ifdef HAVE_KW_THREAD
 #define IN_CRITICAL_REGION sgen_thread_info->client_info.in_critical_region
 #else
@@ -686,17 +718,15 @@ extern MonoNativeTlsKey thread_info_key;
  */
 #define EXIT_CRITICAL_REGION  do { mono_atomic_store_release (&IN_CRITICAL_REGION, 0); } while (0)
 
-#endif
-
 #define SGEN_TV_DECLARE(name) gint64 name
 #define SGEN_TV_GETTIME(tv) tv = mono_100ns_ticks ()
-#define SGEN_TV_ELAPSED(start,end) ((long)(end-start))
+#define SGEN_TV_ELAPSED(start,end) ((gint64)(end-start))
 
 typedef MonoSemType SgenSemaphore;
 
-#define SGEN_SEMAPHORE_INIT(sem,initial)       MONO_SEM_INIT ((sem), (initial))
-#define SGEN_SEMAPHORE_POST(sem)               MONO_SEM_POST ((sem))
-#define SGEN_SEMAPHORE_WAIT(sem)               MONO_SEM_WAIT ((sem))
+#define SGEN_SEMAPHORE_INIT(sem,initial)       mono_os_sem_init ((sem), (initial))
+#define SGEN_SEMAPHORE_POST(sem)               mono_os_sem_post ((sem))
+#define SGEN_SEMAPHORE_WAIT(sem)               mono_os_sem_wait ((sem), MONO_SEM_FLAGS_NONE)
 
 gboolean sgen_has_critical_method (void);
 gboolean sgen_is_critical_method (MonoMethod *method);