Move i386 rwlock out of line helpers to arch/i386/kernel/rwlock.c. Signed-off-by: Benjamin LaHaise Index: arch/i386/kernel/Makefile =================================================================== --- 948b9c0bd3218b468df9333f59340c08db5a2c69/arch/i386/kernel/Makefile (mode:100644 sha1:aacdae6f372d4ba0440f3795d89ba27bc0b0f3c5) +++ a9fb535288303828dd62c0ee4f83836d1792be79/arch/i386/kernel/Makefile (mode:100644 sha1:e00ab47e94363bd961a78d50e300b56e2892a396) @@ -32,6 +32,7 @@ obj-$(CONFIG_HPET_TIMER) += time_hpet.o obj-$(CONFIG_EFI) += efi.o efi_stub.o obj-$(CONFIG_EARLY_PRINTK) += early_printk.o +obj-$(CONFIG_SMP) += rwlock.o EXTRA_AFLAGS := -traditional Index: arch/i386/kernel/rwlock.c =================================================================== --- /dev/null (tree:948b9c0bd3218b468df9333f59340c08db5a2c69) +++ a9fb535288303828dd62c0ee4f83836d1792be79/arch/i386/kernel/rwlock.c (mode:100644 sha1:8bcde71c08d66a758c361cceb4386d24083b654c) @@ -0,0 +1,50 @@ +/* + * i386 rwlock fallbacks + * + * (C) Copyright 1999 Linus Torvalds + * + * Portions Copyright 1999 Red Hat, Inc. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version + * 2 of the License, or (at your option) any later version. + * + * rw semaphores implemented November 1999 by Benjamin LaHaise + */ +#include +#include +#include + +/* + * rw spinlock fallbacks + */ +#if defined(CONFIG_SMP) +asm( +".section .sched.text\n" +".align 4\n" +".globl __write_lock_failed\n" +"__write_lock_failed:\n\t" + LOCK "addl $" RW_LOCK_BIAS_STR ",(%eax)\n" +"1: rep; nop\n\t" + "cmpl $" RW_LOCK_BIAS_STR ",(%eax)\n\t" + "jne 1b\n\t" + LOCK "subl $" RW_LOCK_BIAS_STR ",(%eax)\n\t" + "jnz __write_lock_failed\n\t" + "ret" +); + +asm( +".section .sched.text\n" +".align 4\n" +".globl __read_lock_failed\n" +"__read_lock_failed:\n\t" + LOCK "incl (%eax)\n" +"1: rep; nop\n\t" + "cmpl $1,(%eax)\n\t" + "js 1b\n\t" + LOCK "decl (%eax)\n\t" + "js __read_lock_failed\n\t" + "ret" +); +#endif Index: arch/i386/kernel/semaphore.c =================================================================== --- 948b9c0bd3218b468df9333f59340c08db5a2c69/arch/i386/kernel/semaphore.c (mode:100644 sha1:12f8c48463156d6d44b2d300904284263bcc5cdd) +++ a9fb535288303828dd62c0ee4f83836d1792be79/arch/i386/kernel/semaphore.c (mode:100644 sha1:b1642e2342e20e492ddf151b171277eb6afca117) @@ -262,36 +262,3 @@ "popl %edx\n\t" "ret" ); - -/* - * rw spinlock fallbacks - */ -#if defined(CONFIG_SMP) -asm( -".section .sched.text\n" -".align 4\n" -".globl __write_lock_failed\n" -"__write_lock_failed:\n\t" - LOCK "addl $" RW_LOCK_BIAS_STR ",(%eax)\n" -"1: rep; nop\n\t" - "cmpl $" RW_LOCK_BIAS_STR ",(%eax)\n\t" - "jne 1b\n\t" - LOCK "subl $" RW_LOCK_BIAS_STR ",(%eax)\n\t" - "jnz __write_lock_failed\n\t" - "ret" -); - -asm( -".section .sched.text\n" -".align 4\n" -".globl __read_lock_failed\n" -"__read_lock_failed:\n\t" - LOCK "incl (%eax)\n" -"1: rep; nop\n\t" - "cmpl $1,(%eax)\n\t" - "js 1b\n\t" - LOCK "decl (%eax)\n\t" - "js __read_lock_failed\n\t" - "ret" -); -#endif