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

[MiNT] [PATCH] Fix NFS.XFS the FireBee



Hello.

As discussed previously, here is a patch to fix NFS.XFS on the FireBee. It uses BSET.B #7 instead of TAS, on all machines.

Alan, please commit!

nfs.patch
Do not use TAS on the FireBee. Contributed by Vincent Riviere.

--
Vincent Rivière
diff -aurN -x CVS freemint.orig/sys/xfs/nfs/sock_ipc.c freemint/sys/xfs/nfs/sock_ipc.c
--- freemint.orig/sys/xfs/nfs/sock_ipc.c	2007-07-13 23:32:53.000000000 +0200
+++ freemint/sys/xfs/nfs/sock_ipc.c	2014-09-04 18:04:22.578125000 +0200
@@ -276,6 +276,10 @@
 /* TL: implement locking functions for the request actions.
  *     Note: We will need this when MiNT will be also multitasking
  *           in super mode some day.
+ *     Note: The TAS instruction is only useful on multiprocessor
+ *           systems, and it is buggy on the FireBee.
+ *           The BSET.B #7 instruction does exactly the same thing,
+ *           without additional overhead.
  */
 
 volatile char lock = 0;
@@ -286,7 +290,7 @@
 	__asm__ __volatile__(					\
 		"clrb		%0\n\t"				\
 		"movel		%1,a0\n\t"			\
-		"tas		a0@\n\t"			\
+		"bsetb		#7,a0@\n\t"			\
 		"beq		1f\n\t"				\
 		"moveb		#1,%0\n\t"			\
 		"1:\n\t"					\