patch-2.3.9 linux/include/asm-mips/system.h
Next file: linux/include/asm-mips/timex.h
Previous file: linux/include/asm-mips/string.h
Back to the patch index
Back to the overall index
- Lines: 62
- Date:
Fri Jun 25 17:37:53 1999
- Orig file:
v2.3.8/linux/include/asm-mips/system.h
- Orig date:
Tue Oct 20 13:52:54 1998
diff -u --recursive --new-file v2.3.8/linux/include/asm-mips/system.h linux/include/asm-mips/system.h
@@ -88,6 +88,12 @@
{
__asm__ __volatile__(
".set\tnoreorder\n\t"
+ "mfc0\t$8,$12\n\t"
+ "li\t$9,0xff00\n\t"
+ "and\t$8,$9\n\t"
+ "nor\t$9,$0,$9\n\t"
+ "and\t%0,$9\n\t"
+ "or\t%0,$8\n\t"
"mtc0\t%0,$12\n\t"
"nop\n\t"
"nop\n\t"
@@ -95,7 +101,7 @@
".set\treorder"
: /* no output */
: "r" (flags)
- : "memory");
+ : "$8", "$9", "memory");
}
/*
@@ -107,6 +113,15 @@
#define save_and_cli(x) __save_and_cli(x)
#define restore_flags(x) __restore_flags(x)
+/* For spinlocks etc */
+#define local_irq_save(x) __save_and_cli(x);
+#define local_irq_restore(x) __restore_flags(x);
+#define local_irq_disable() __cli();
+#define local_irq_enable() __sti();
+
+/*
+ * These are probably defined overly paranoid ...
+ */
#define mb() \
__asm__ __volatile__( \
"# prevent instructions being moved around\n\t" \
@@ -117,18 +132,20 @@
: /* no output */ \
: /* no input */ \
: "memory")
+#define rmb() mb()
+#define wmb() mb()
#if !defined (_LANGUAGE_ASSEMBLY)
/*
* switch_to(n) should switch tasks to task nr n, first
* checking that n isn't the current task, in which case it does nothing.
*/
-extern asmlinkage void (*resume)(void *tsk);
+extern asmlinkage void *(*resume)(void *last, void *next);
#endif /* !defined (_LANGUAGE_ASSEMBLY) */
-#define switch_to(prev,next) \
+#define switch_to(prev,next,last) \
do { \
- resume(next); \
+ (last) = resume(prev, next); \
} while(0)
/*
FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)