[Pkg-mono-svn-commits] [SCM] mono branch, master-experimental, updated. debian/2.6.3-4-34-gd1bf954

Mirco Bauer meebey at meebey.net
Thu Aug 12 01:18:08 UTC 2010


The following commit has been merged in the master-experimental branch:
commit 6f656c11f08c8d71806fbdb5752d02aa6bbebf35
Merge: 665316e3fe5fcc613bf7ba81d33c05004889d7cf 42561d5f0bca95eb6e21e6008ead48bcb4006445
Author: Mirco Bauer <meebey at meebey.net>
Date:   Tue Aug 3 01:08:15 2010 +0200

    Merge branch 'debian/patches/arm_cpuinfo_parsing' into merge/2.6.7

diff --combined mono/mini/mini-arm.c
index 01d78a7,0613593..2e04a25
--- a/mono/mini/mini-arm.c
+++ b/mono/mini/mini-arm.c
@@@ -36,9 -36,13 +36,13 @@@ static gint lmf_addr_tls_offset = -1
  #define mono_mini_arch_unlock() LeaveCriticalSection (&mini_arch_mutex)
  static CRITICAL_SECTION mini_arch_mutex;
  
- static int v5_supported = 0;
- static int v7_supported = 0;
- static int thumb_supported = 0;
+ #define MAYBE 2
+ 
+ /* Assume v5 and Thumb are supported unless cpuinfo says otherwise (ARMv4
+  * without Thumb) */
+ static int v5_supported = MAYBE;
+ static int v7_supported = MAYBE;
+ static int thumb_supported = MAYBE;
  
  /*
   * The code generated for sequence points reads from this location, which is
@@@ -177,11 -181,11 +181,11 @@@ emit_memcpy (guint8 *code, int size, in
  static guint8*
  emit_call_reg (guint8 *code, int reg)
  {
- 	if (v5_supported) {
+ 	if (v5_supported != FALSE) {
  		ARM_BLX_REG (code, reg);
  	} else {
  		ARM_MOV_REG_REG (code, ARMREG_LR, ARMREG_PC);
- 		if (thumb_supported)
+ 		if (thumb_supported != FALSE)
  			ARM_BX (code, reg);
  		else
  			ARM_MOV_REG_REG (code, ARMREG_PC, reg);
@@@ -421,11 -425,11 +425,11 @@@ mono_arch_get_delegate_invoke_impls (vo
  	int i;
  
  	code = get_delegate_invoke_impl (TRUE, 0, &code_len);
 -	res = g_slist_prepend (res, mono_aot_tramp_info_create (g_strdup ("delegate_invoke_impl_has_target"), code, code_len));
 +	res = g_slist_prepend (res, mono_tramp_info_create (g_strdup ("delegate_invoke_impl_has_target"), code, code_len, NULL, NULL));
  
  	for (i = 0; i <= MAX_ARCH_DELEGATE_PARAMS; ++i) {
  		code = get_delegate_invoke_impl (FALSE, i, &code_len);
 -		res = g_slist_prepend (res, mono_aot_tramp_info_create (g_strdup_printf ("delegate_invoke_impl_target_%d", i), code, code_len));
 +		res = g_slist_prepend (res, mono_tramp_info_create (g_strdup_printf ("delegate_invoke_impl_target_%d", i), code, code_len, NULL, NULL));
  	}
  
  	return res;
@@@ -543,20 -547,36 +547,36 @@@ mono_arch_cpu_optimizazions (guint32 *e
  		while ((line = fgets (buf, 512, file))) {
  			if (strncmp (line, "Processor", 9) == 0) {
  				char *ver = strstr (line, "(v");
- 				if (ver && (ver [2] == '5' || ver [2] == '6' || ver [2] == '7'))
- 					v5_supported = TRUE;
+ 				if (!ver) {
+ 					/* invalid cpuinfo; perhaps running withing qemu-arm; skip */
+ 					break;
+ 				}
+ 				v7_supported = FALSE;
  				if (ver && (ver [2] == '7'))
  					v7_supported = TRUE;
- 				continue;
+ 				if (ver [2] == '5' || ver [2] == '6' || ver [2] == '7') {
+ 					v5_supported = TRUE;
+ 					/* present since ARMv5 for mono's practical purposes */
+ 					thumb_supported = TRUE;
+ 					break;
+ 				} else if (ver [2] == '4') {
+ 					v5_supported = FALSE;
+ 					/* continue scanning for Features */
+ 					continue;
+ 				}
+ 				/* new or very old ARM architecture? */
+ 				g_assert_not_reached ();
  			}
  			if (strncmp (line, "Features", 8) == 0) {
+ 				/* Assume we already parsed Processor and it was v4 */
+ 				g_assert (v5_supported == FALSE);
  				char *th = strstr (line, "thumb");
  				if (th) {
  					thumb_supported = TRUE;
- 					if (v5_supported)
- 						break;
+ 				} else {
+ 					thumb_supported = FALSE;
  				}
- 				continue;
+ 				break;
  			}
  		}
  		fclose (file);
@@@ -2510,7 -2530,7 +2530,7 @@@ search_thunk_slot (void *data, int csiz
  				 */
  				code = (guchar*)thunks;
  				ARM_LDR_IMM (code, ARMREG_IP, ARMREG_PC, 0);
- 				if (thumb_supported)
+ 				if (thumb_supported != FALSE)
  					ARM_BX (code, ARMREG_IP);
  				else
  					ARM_MOV_REG_REG (code, ARMREG_PC, ARMREG_IP);
@@@ -2575,7 -2595,7 +2595,7 @@@ arm_patch_general (MonoDomain *domain, 
  		gint tmask = 0xffffffff;
  		if (tval & 1) { /* entering thumb mode */
  			diff = target - 1 - code - 8;
- 			g_assert (thumb_supported);
+ 			g_assert (thumb_supported != FALSE);
  			tbits = 0xf << 28; /* bl->blx bit pattern */
  			g_assert ((ins & (1 << 24))); /* it must be a bl, not b instruction */
  			/* this low bit of the displacement is moved to bit 24 in the instruction encoding */
@@@ -4794,15 -4814,10 +4814,15 @@@ mono_arch_emit_exceptions (MonoCompile 
  	MonoJumpInfo *patch_info;
  	int i;
  	guint8 *code;
 -	const guint8* exc_throw_pos [MONO_EXC_INTRINS_NUM] = {NULL};
 -	guint8 exc_throw_found [MONO_EXC_INTRINS_NUM] = {0};
 +	guint8* exc_throw_pos [MONO_EXC_INTRINS_NUM];
 +	guint8 exc_throw_found [MONO_EXC_INTRINS_NUM];
  	int max_epilog_size = 50;
  
 +	for (i = 0; i < MONO_EXC_INTRINS_NUM; i++) {
 +		exc_throw_pos [i] = NULL;
 +		exc_throw_found [i] = 0;
 +	}
 +
  	/* count the number of exception infos */
       
  	/* 

-- 
mono



More information about the Pkg-mono-svn-commits mailing list