Don't assume that all sun4m CPUs support muldiv; the Cypress CPU, which
implements the 4m MMU but only v7 instructions, does not. (Debian
    #100).
			
			
This commit is contained in:
		
							parent
							
								
									fd158d3d52
								
							
						
					
					
						commit
						b48a24e796
					
				| 
						 | 
				
			
			@ -190,9 +190,24 @@ sparcUseHWMulDiv(void)
 | 
			
		|||
    while (fgets(buffer, 1024, f) != NULL) {
 | 
			
		||||
	if (!strncmp(buffer, "type", 4)) {
 | 
			
		||||
	    p = strstr(buffer, "sun4");
 | 
			
		||||
	    if (p && (p[4] == 'u' || p[4] == 'd' || p[4] == 'm')) {
 | 
			
		||||
	    if (p && (p[4] == 'u' || p[4] == 'd')) {
 | 
			
		||||
		fclose(f);
 | 
			
		||||
		return 1;
 | 
			
		||||
	    } else if (p && p[4] == 'm') {
 | 
			
		||||
		fclose(f);
 | 
			
		||||
		f = fopen("/proc/cpuinfo","r");
 | 
			
		||||
		if (!f) return 0;
 | 
			
		||||
		while (fgets(buffer, 1024, f) != NULL) {
 | 
			
		||||
		    if (!strncmp (buffer, "MMU type", 8)) {
 | 
			
		||||
		      p = strstr (buffer, "Cypress");
 | 
			
		||||
		      if (p) {
 | 
			
		||||
			fclose(f);
 | 
			
		||||
			return 1;
 | 
			
		||||
		      }
 | 
			
		||||
		    }
 | 
			
		||||
		}
 | 
			
		||||
	        fclose(f);
 | 
			
		||||
	        return 0;
 | 
			
		||||
	    }
 | 
			
		||||
	}
 | 
			
		||||
    }
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
		Reference in New Issue