From a1f8f4482013d29a619728f9ee54471dbd69c389 Mon Sep 17 00:00:00 2001 From: Nathan Whitehorn Date: Sun, 22 Apr 2012 18:56:56 +0000 Subject: [PATCH] Remove dead code. The routines in atomic.S did not work properly anyway, and were everywhere unused. If we turn out to need them, they should be reimplemented. MFC after: 2 weeks --- sys/conf/files.powerpc | 1 - sys/powerpc/include/cpufunc.h | 10 --- sys/powerpc/powerpc/atomic.S | 137 ---------------------------------- 3 files changed, 148 deletions(-) delete mode 100644 sys/powerpc/powerpc/atomic.S diff --git a/sys/conf/files.powerpc b/sys/conf/files.powerpc index 6a94caac9a2d..5d9dec5ffd1f 100644 --- a/sys/conf/files.powerpc +++ b/sys/conf/files.powerpc @@ -170,7 +170,6 @@ powerpc/powermac/uninorthpci.c optional powermac pci powerpc/powermac/vcoregpio.c optional powermac powerpc/powermac/windtunnel.c optional powermac windtunnel powerpc/powerpc/altivec.c optional aim -powerpc/powerpc/atomic.S standard powerpc/powerpc/autoconf.c standard powerpc/powerpc/bcopy.c standard powerpc/powerpc/bus_machdep.c standard diff --git a/sys/powerpc/include/cpufunc.h b/sys/powerpc/include/cpufunc.h index 914935f5e775..bb01fdbada06 100644 --- a/sys/powerpc/include/cpufunc.h +++ b/sys/powerpc/include/cpufunc.h @@ -29,16 +29,6 @@ #ifndef _MACHINE_CPUFUNC_H_ #define _MACHINE_CPUFUNC_H_ -/* - * Required for user-space atomic.h includes - */ -static __inline void -powerpc_mb(void) -{ - - __asm __volatile("eieio; sync" : : : "memory"); -} - #ifdef _KERNEL #include diff --git a/sys/powerpc/powerpc/atomic.S b/sys/powerpc/powerpc/atomic.S deleted file mode 100644 index 4d0d1c6af661..000000000000 --- a/sys/powerpc/powerpc/atomic.S +++ /dev/null @@ -1,137 +0,0 @@ -/*- - * Copyright (c) 2000, 2001 Benno Rice - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - * $FreeBSD$ - */ - -#include - - .text - -ASENTRY_NOPROF(atomic_set_8) -0: lwarx 0, 0, 3 /* load old value */ - slwi 4, 4, 24 /* shift the byte so it's in the right place */ - or 0, 0, 4 /* generate new value */ - stwcx. 0, 0, 3 /* attempt to store */ - bne- 0 /* loop if failed */ - eieio /* synchronise */ - sync - blr /* return */ - -ASENTRY_NOPROF(atomic_clear_8) -0: lwarx 0, 0, 3 /* load old value */ - slwi 4, 4, 24 /* shift the byte so it's in the right place */ - andc 0, 0, 4 /* generate new value */ - stwcx. 0, 0, 3 /* attempt to store */ - bne- 0 /* loop if failed */ - eieio /* synchronise */ - sync - blr /* return */ - -ASENTRY_NOPROF(atomic_add_8) -0: lwarx 9, 0, 3 /* load old value */ - srwi 0, 9, 24 /* byte alignment */ - add 0, 4, 0 /* calculate new value */ - slwi 0, 9, 24 /* byte alignment */ - clrlwi 9, 9, 8 /* clear the byte in the original word */ - or 9, 9, 0 /* copy back in to the original word */ - stwcx. 9, 0, 3 /* attempt to store */ - bne- 0 /* loop if failed */ - eieio /* synchronise */ - sync - blr /* return */ - -ASENTRY_NOPROF(atomic_subtract_8) -0: lwarx 9, 0, 3 /* load old value */ - srwi 0, 9, 24 /* byte alignment */ - subf 0, 4, 0 /* calculate new value */ - slwi 0, 9, 24 /* byte alignment */ - clrlwi 9, 9, 8 /* clear the byte in the original word */ - or 9, 9, 0 /* copy back in to the original word */ - stwcx. 9, 0, 3 /* attempt to store */ - bne- 0 /* loop if failed */ - eieio /* synchronise */ - sync - blr /* return */ - -ASENTRY_NOPROF(atomic_set_16) - li 11, 3 /* mask to test for alignment */ - andc. 11, 3, 11 /* force address to be word-aligned */ -0: lwarx 12, 0, 11 /* load old value */ - bne 1f /* no realignment needed if it's aligned */ - slwi 4, 4, 16 /* realign operand */ -1: or 12, 12, 4 /* calculate new value */ - stwcx. 12, 0, 11 /* attempt to store */ - bne- 0b /* loop if failed */ - eieio /* synchronise */ - sync - blr /* return */ - -ASENTRY_NOPROF(atomic_clear_16) - li 11, 3 /* mask to test for alignment */ - andc. 11, 3, 11 /* force address to be word-aligned */ -0: lwarx 12, 0, 11 /* load old value */ - bne 1f /* no realignment needed if it's aligned */ - slwi 4, 4, 16 /* realign operand */ -1: andc 12, 12, 4 /* calculate new value */ - stwcx. 12, 0, 11 /* attempt to store */ - bne- 0b /* loop if failed */ - eieio /* synchronise */ - sync - blr /* return */ - -ASENTRY_NOPROF(atomic_add_16) - li 11, 3 /* mask to test for alignment */ - andc. 11, 3, 11 /* force address to be word-aligned */ -0: lwarx 12, 0, 11 /* load old value */ - bne 1f /* no realignment needed if it's aligned */ - srwi 12, 9, 16 /* realign */ -1: add 12, 4, 12 /* calculate new value */ - bne 2f /* no realignment needed if it's aligned */ - slwi 12, 12, 16 /* realign */ -2: clrlwi 9, 9, 16 /* clear old value */ - or 9, 9, 12 /* copy in new value */ - stwcx. 12, 0, 11 /* attempt to store */ - bne- 0b /* loop if failed */ - eieio /* synchronise */ - sync - blr /* return */ - -ASENTRY_NOPROF(atomic_subtract_16) - li 11, 3 /* mask to test for alignment */ - andc. 11, 3, 11 /* force address to be word-aligned */ -0: lwarx 12, 0, 11 /* load old value */ - bne 1f /* no realignment needed if it's aligned */ - srwi 12, 9, 16 /* realign */ -1: subf 12, 4, 12 /* calculate new value */ - bne 2f /* no realignment needed if it's aligned */ - slwi 12, 12, 16 /* realign */ -2: clrlwi 9, 9, 16 /* clear old value */ - or 9, 9, 12 /* copy in new value */ - stwcx. 12, 0, 11 /* attempt to store */ - bne- 0 /* loop if failed */ - eieio /* synchronise */ - sync - blr /* return */