[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[MiNT] [PATCH]Making the USB module loader to load the right km



Hi!

Please commit this patch.

Thanks!

Comment:

Now loader.prg loads the right kernel module depending on what CPU
cookie is read. No need to rename the module to usb.km anymore.
Taken from xaloader.
Index: sys/usb/src.km/loader/loader.c
===================================================================
RCS file: /mint/freemint/sys/usb/src.km/loader/loader.c,v
retrieving revision 1.1
diff -u -8 -p -r1.1 loader.c
--- sys/usb/src.km/loader/loader.c	29 Apr 2011 11:39:28 -0000	1.1
+++ sys/usb/src.km/loader/loader.c	26 Nov 2011 10:19:19 -0000
@@ -184,27 +184,50 @@ loader_init(int argc, char **argv, char 
 			my_strlcpy(path, argv[1], sizeof(path));
 			my_strlcat(path, "/", sizeof(path));
 		}
 		else
 			name = argv[1];
 	}
 	else
 	{
+#ifdef __mcoldfire__
+		name = "xaaesv4e.km";
+#else
 		long cpu;
 
 		name = DEFAULT;
 
 		/* if the system have a 68000 CPU we use the 68000 compiled
 		 * module
 		 */
 		r = Ssystem(S_GETCOOKIE, C__CPU, &cpu);
-		if (r == 0 && cpu < 20)
-			name = DEFAULT_68000;
+		if (r == 0 )
+		{
+			switch( cpu )
+			{
+			case 30:
+				name = "usb030.km";
+			break;
+			case 40:
+				name = "usb040.km";
+			break;
+			case 60:
+				name = "usb060.km";
+			break;
+			default:
+				name = DEFAULT_68000;
+			}
+		}
+		else
+			(void)Cconws("CPU-cookie not found \r\n");
+#endif
 	}
+	(void)Cconws(name);
+	(void)Cconws("\r\n");
 
 	/* change to the usb module directory */
 	r = Dsetpath(path);
 	if (r)
 	{
 		(void)Cconws("usb loader: No such directory: \"");
 		(void)Cconws(path);
 		(void)Cconws("\"\r\n");