s390 fixes (12/12).
PATCH 1/1 s390 fixes (12/12).
trivial s390 fixes
diff -urN linux-2.5.59/arch/s390/kernel/setup.clinux-2.5.59-s390/arch/s390/kernel/setup.c
arch/s390/kernel/setup.c +1 -1
@@ -551,7 +551,7 @@static void *c_start (struct seq_file *m,loff_t *pos) { -return *pos <=NR_CPUS ? (void *)((unsigned long ) *pos +1 ) :NULL ; +return *pos <NR_CPUS ? (void *)((unsigned long ) *pos +1 ) :NULL ; }static void *c_next (struct seq_file *m,void *v,loff_t *pos) {
diff -urN linux-2.5.59/arch/s390x/kernel/setup.clinux-2.5.59-s390/arch/s390x/kernel/setup.c
arch/s390x/kernel/setup.c +1 -1
@@ -545,7 +545,7 @@static void *c_start (struct seq_file *m,loff_t *pos) { -return *pos <=NR_CPUS ? (void *)((unsigned long ) *pos +1 ) :NULL ; +return *pos <NR_CPUS ? (void *)((unsigned long ) *pos +1 ) :NULL ; }static void *c_next (struct seq_file *m,void *v,loff_t *pos) {
diff -urN linux-2.5.59/include/asm-s390/spinlock.h linux-2.5.59-s390/include/asm-s390/spinlock.h
include/asm-s390/spinlock.h +13 -0
@@ -122,4 +122,17 @@ : "+m" ((rw)->lock) : "a" (&(rw)->lock) \ : "2", "3", "cc" ) +extern inline int _raw_write_trylock (rwlock_t *rw) +{ +unsigned int result, reg; + + __asm__ __volatile__(" lhi %0,1\n" +" sll %0,31\n" +" basr %1,0\n" +"0: cs %0,%1,0(%3)\n" + :"=&d" (result),"=&d" (reg),"+m" (rw->lock) + :"a" (&rw->lock) :"cc" ); +return !result; +} +#endif /* __ASM_SPINLOCK_H */
diff -urN linux-2.5.59/include/asm-s390x/spinlock.h linux-2.5.59-s390/include/asm-s390x/spinlock.h
include/asm-s390x/spinlock.h +12 -0
@@ -139,5 +139,17 @@ : "a" (&(rw)->lock), "i" (__DIAG44_OPERAND) \ : "2", "3", "cc" ) +extern inline int _raw_write_trylock (rwlock_t *rw) +{ +unsigned int result, reg; + + __asm__ __volatile__(" llihh %0,0x8000\n" +" basr %1,0\n" +"0: csg %0,%1,0(%3)\n" + :"=&d" (result),"=&d" (reg),"+m" (rw->lock) + :"a" (&rw->lock) :"cc" ); +return !result; +} +#endif /* __ASM_SPINLOCK_H */