patch-2.4.21 linux-2.4.21/include/asm-cris/system.h

Next file: linux-2.4.21/include/asm-cris/timex.h
Previous file: linux-2.4.21/include/asm-cris/sv_addr_ag.h
Back to the patch index
Back to the overall index

diff -urN linux-2.4.20/include/asm-cris/system.h linux-2.4.21/include/asm-cris/system.h
@@ -16,7 +16,7 @@
 
 /* read the CPU version register */
 
-static inline unsigned long rdvr(void) { 
+extern inline unsigned long rdvr(void) { 
 	unsigned char vr;
 	__asm__ volatile ("move $vr,%0" : "=rm" (vr));
 	return vr;
@@ -24,7 +24,7 @@
 
 /* read/write the user-mode stackpointer */
 
-static inline unsigned long rdusp(void) {
+extern inline unsigned long rdusp(void) {
 	unsigned long usp;
 	__asm__ __volatile__("move $usp,%0" : "=rm" (usp));
 	return usp;
@@ -35,13 +35,13 @@
 
 /* read the current stackpointer */
 
-static inline unsigned long rdsp(void) {
+extern inline unsigned long rdsp(void) {
 	unsigned long sp;
 	__asm__ __volatile__("move.d $sp,%0" : "=rm" (sp));
 	return sp;
 }
 
-static inline unsigned long _get_base(char * addr)
+extern inline unsigned long _get_base(char * addr)
 {
   return 0;
 }
@@ -69,6 +69,7 @@
 
 /* For spinlocks etc */
 #define local_irq_save(x) __asm__ __volatile__ ("move $ccr,%0\n\tdi" : "=rm" (x) : : "memory"); 
+#define local_irq_set(x) __asm__ __volatile__ ("move $ccr,%0\n\tei" : "=rm" (x) : : "memory");
 #define local_irq_restore(x) restore_flags(x)
 
 #define local_irq_disable()  cli()
@@ -80,9 +81,10 @@
 #define sti() __sti()
 #define save_flags(x) __save_flags(x)
 #define restore_flags(x) __restore_flags(x)
-#define save_and_cli(x) do { __save_flags(x); cli(); } while(0)
+#define save_and_cli(x) do { save_flags(x); cli(); } while(0)
+#define save_and_sti(x) do { save_flags(x); sti(); } while(0)
 
-static inline unsigned long __xchg(unsigned long x, void * ptr, int size)
+extern inline unsigned long __xchg(unsigned long x, void * ptr, int size)
 {
   /* since Etrax doesn't have any atomic xchg instructions, we need to disable
      irq's (if enabled) and do it with move.d's */
@@ -150,6 +152,8 @@
 #define mb() __asm__ __volatile__ ("" : : : "memory")
 #define rmb() mb()
 #define wmb() mb()
+#define set_mb(var, value)  do { var = value; mb(); } while (0)
+#define set_wmb(var, value) do { var = value; wmb(); } while (0)
 
 #ifdef CONFIG_SMP
 #define smp_mb()        mb()

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)