Index: kernel/Makefile
===================================================================
--- kernel/Makefile	(revision aae365bc823f3137811d2c48089c150e81c40606)
+++ kernel/Makefile	(revision d19b3fcc8f46d58029778b0ba79ad3d796f39697)
@@ -230,5 +230,4 @@
 	generic/src/smp/ipi.c \
 	generic/src/smp/smp.c \
-	generic/src/smp/smp_call.c \
 	generic/src/ipc/ipc.c \
 	generic/src/ipc/sysipc.c \
@@ -293,6 +292,5 @@
 		test/print/print4.c \
 		test/print/print5.c \
-		test/thread/thread1.c \
-		test/smpcall/smpcall1.c
+		test/thread/thread1.c
 
 	ifeq ($(KARCH),mips32)
Index: kernel/arch/abs32le/Makefile.inc
===================================================================
--- kernel/arch/abs32le/Makefile.inc	(revision aae365bc823f3137811d2c48089c150e81c40606)
+++ kernel/arch/abs32le/Makefile.inc	(revision d19b3fcc8f46d58029778b0ba79ad3d796f39697)
@@ -51,5 +51,4 @@
 	arch/$(KARCH)/src/cpu/cpu.c \
 	arch/$(KARCH)/src/smp/smp.c \
-	arch/$(KARCH)/src/smp/smp_call.c \
 	arch/$(KARCH)/src/smp/ipi.c \
 	arch/$(KARCH)/src/mm/km.c \
Index: rnel/arch/abs32le/src/smp/smp_call.c
===================================================================
--- kernel/arch/abs32le/src/smp/smp_call.c	(revision aae365bc823f3137811d2c48089c150e81c40606)
+++ 	(revision )
@@ -1,48 +1,0 @@
-/*
- * Copyright (c) 2012 Adam Hraska
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * - Redistributions of source code must retain the above copyright
- *   notice, this list of conditions and the following disclaimer.
- * - 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.
- * - The name of the author may not be used to endorse or promote products
- *   derived from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 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.
- */
-
-/** @addtogroup kernel_abs32le
- * @{
- */
-/** @file
- */
-
-#include <smp/smp_call.h>
-#include <panic.h>
-
-#ifdef CONFIG_SMP
-
-void arch_smp_call_ipi(unsigned int cpu_id)
-{
-	panic("smp_call IPI not implemented.");
-}
-
-#endif /* CONFIG_SMP */
-
-/** @}
- */
Index: kernel/arch/amd64/Makefile.inc
===================================================================
--- kernel/arch/amd64/Makefile.inc	(revision aae365bc823f3137811d2c48089c150e81c40606)
+++ kernel/arch/amd64/Makefile.inc	(revision d19b3fcc8f46d58029778b0ba79ad3d796f39697)
@@ -85,5 +85,4 @@
 		arch/$(KARCH)/src/smp/ipi.c \
 		arch/$(KARCH)/src/smp/mps.c \
-		arch/$(KARCH)/src/smp/smp_call.c \
 		arch/$(KARCH)/src/smp/smp.c
 endif
Index: kernel/arch/amd64/include/arch/interrupt.h
===================================================================
--- kernel/arch/amd64/include/arch/interrupt.h	(revision aae365bc823f3137811d2c48089c150e81c40606)
+++ kernel/arch/amd64/include/arch/interrupt.h	(revision d19b3fcc8f46d58029778b0ba79ad3d796f39697)
@@ -81,5 +81,4 @@
 #define VECTOR_TLB_SHOOTDOWN_IPI  (IVT_FREEBASE + 1)
 #define VECTOR_DEBUG_IPI          (IVT_FREEBASE + 2)
-#define VECTOR_SMP_CALL_IPI       (IVT_FREEBASE + 3)
 
 extern void (*disable_irqs_function)(uint16_t);
Index: kernel/arch/amd64/src/interrupt.c
===================================================================
--- kernel/arch/amd64/src/interrupt.c	(revision aae365bc823f3137811d2c48089c150e81c40606)
+++ kernel/arch/amd64/src/interrupt.c	(revision d19b3fcc8f46d58029778b0ba79ad3d796f39697)
@@ -53,5 +53,4 @@
 #include <symtab.h>
 #include <stacktrace.h>
-#include <smp/smp_call.h>
 
 /*
@@ -161,10 +160,4 @@
 	tlb_shootdown_ipi_recv();
 }
-
-static void arch_smp_call_ipi_recv(unsigned int n, istate_t *istate)
-{
-	trap_virtual_eoi();
-	smp_call_ipi_recv();
-}
 #endif
 
@@ -229,6 +222,4 @@
 	exc_register(VECTOR_TLB_SHOOTDOWN_IPI, "tlb_shootdown", true,
 	    (iroutine_t) tlb_shootdown_ipi);
-	exc_register(VECTOR_SMP_CALL_IPI, "smp_call", true,
-	    (iroutine_t) arch_smp_call_ipi_recv);
 #endif
 }
Index: kernel/arch/ia32/Makefile.inc
===================================================================
--- kernel/arch/ia32/Makefile.inc	(revision aae365bc823f3137811d2c48089c150e81c40606)
+++ kernel/arch/ia32/Makefile.inc	(revision d19b3fcc8f46d58029778b0ba79ad3d796f39697)
@@ -76,5 +76,4 @@
 	arch/$(KARCH)/src/smp/mps.c \
 	arch/$(KARCH)/src/smp/smp.c \
-	arch/$(KARCH)/src/smp/smp_call.c \
 	arch/$(KARCH)/src/atomic.S \
 	arch/$(KARCH)/src/smp/ipi.c \
Index: kernel/arch/ia32/include/arch/interrupt.h
===================================================================
--- kernel/arch/ia32/include/arch/interrupt.h	(revision aae365bc823f3137811d2c48089c150e81c40606)
+++ kernel/arch/ia32/include/arch/interrupt.h	(revision d19b3fcc8f46d58029778b0ba79ad3d796f39697)
@@ -85,5 +85,4 @@
 #define VECTOR_TLB_SHOOTDOWN_IPI  (IVT_FREEBASE + 1)
 #define VECTOR_DEBUG_IPI          (IVT_FREEBASE + 2)
-#define VECTOR_SMP_CALL_IPI       (IVT_FREEBASE + 3)
 
 extern void (*disable_irqs_function)(uint16_t);
Index: kernel/arch/ia32/src/interrupt.c
===================================================================
--- kernel/arch/ia32/src/interrupt.c	(revision aae365bc823f3137811d2c48089c150e81c40606)
+++ kernel/arch/ia32/src/interrupt.c	(revision d19b3fcc8f46d58029778b0ba79ad3d796f39697)
@@ -55,5 +55,4 @@
 #include <symtab.h>
 #include <stacktrace.h>
-#include <smp/smp_call.h>
 #include <proc/task.h>
 
@@ -183,10 +182,4 @@
 	tlb_shootdown_ipi_recv();
 }
-
-static void arch_smp_call_ipi_recv(unsigned int n, istate_t *istate)
-{
-	trap_virtual_eoi();
-	smp_call_ipi_recv();
-}
 #endif
 
@@ -250,6 +243,4 @@
 	exc_register(VECTOR_TLB_SHOOTDOWN_IPI, "tlb_shootdown", true,
 	    (iroutine_t) tlb_shootdown_ipi);
-	exc_register(VECTOR_SMP_CALL_IPI, "smp_call", true,
-	    (iroutine_t) arch_smp_call_ipi_recv);
 #endif
 }
Index: rnel/arch/ia32/src/smp/smp_call.c
===================================================================
--- kernel/arch/ia32/src/smp/smp_call.c	(revision aae365bc823f3137811d2c48089c150e81c40606)
+++ 	(revision )
@@ -1,50 +1,0 @@
-/*
- * Copyright (c) 2012 Adam Hraska
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * - Redistributions of source code must retain the above copyright
- *   notice, this list of conditions and the following disclaimer.
- * - 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.
- * - The name of the author may not be used to endorse or promote products
- *   derived from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 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.
- */
-
-/** @addtogroup kernel_ia32
- * @{
- */
-/** @file
- */
-
-#include <smp/smp_call.h>
-#include <arch/smp/apic.h>
-#include <arch/interrupt.h>
-#include <cpu.h>
-
-#ifdef CONFIG_SMP
-
-void arch_smp_call_ipi(unsigned int cpu_id)
-{
-	(void) l_apic_send_custom_ipi(cpus[cpu_id].arch.id, VECTOR_SMP_CALL_IPI);
-}
-
-#endif /* CONFIG_SMP */
-
-/** @}
- */
Index: kernel/arch/ia64/Makefile.inc
===================================================================
--- kernel/arch/ia64/Makefile.inc	(revision aae365bc823f3137811d2c48089c150e81c40606)
+++ kernel/arch/ia64/Makefile.inc	(revision d19b3fcc8f46d58029778b0ba79ad3d796f39697)
@@ -58,5 +58,4 @@
 	arch/$(KARCH)/src/smc.c \
 	arch/$(KARCH)/src/smp/smp.c \
-	arch/$(KARCH)/src/smp/smp_call.c \
 	arch/$(KARCH)/src/drivers/it.c
 
Index: rnel/arch/ia64/src/smp/smp_call.c
===================================================================
--- kernel/arch/ia64/src/smp/smp_call.c	(revision aae365bc823f3137811d2c48089c150e81c40606)
+++ 	(revision )
@@ -1,48 +1,0 @@
-/*
- * Copyright (c) 2012 Adam Hraska
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * - Redistributions of source code must retain the above copyright
- *   notice, this list of conditions and the following disclaimer.
- * - 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.
- * - The name of the author may not be used to endorse or promote products
- *   derived from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 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.
- */
-
-/** @addtogroup kernel_ia64
- * @{
- */
-/** @file
- */
-
-#include <smp/smp_call.h>
-#include <panic.h>
-
-#ifdef CONFIG_SMP
-
-void arch_smp_call_ipi(unsigned int cpu_id)
-{
-	panic("smp_call IPI not implemented.");
-}
-
-#endif /* CONFIG_SMP */
-
-/** @}
- */
Index: kernel/arch/mips32/Makefile.inc
===================================================================
--- kernel/arch/mips32/Makefile.inc	(revision aae365bc823f3137811d2c48089c150e81c40606)
+++ kernel/arch/mips32/Makefile.inc	(revision d19b3fcc8f46d58029778b0ba79ad3d796f39697)
@@ -68,5 +68,4 @@
 	arch/$(KARCH)/src/smc.c \
 	arch/$(KARCH)/src/smp/smp.c \
-	arch/$(KARCH)/src/smp/smp_call.c \
 	arch/$(KARCH)/src/machine_func.c
 
Index: rnel/arch/mips32/src/smp/smp_call.c
===================================================================
--- kernel/arch/mips32/src/smp/smp_call.c	(revision aae365bc823f3137811d2c48089c150e81c40606)
+++ 	(revision )
@@ -1,48 +1,0 @@
-/*
- * Copyright (c) 2012 Adam Hraska
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * - Redistributions of source code must retain the above copyright
- *   notice, this list of conditions and the following disclaimer.
- * - 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.
- * - The name of the author may not be used to endorse or promote products
- *   derived from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 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.
- */
-
-/** @addtogroup kernel_mips32
- * @{
- */
-/** @file
- */
-
-#include <smp/smp_call.h>
-#include <panic.h>
-
-#ifdef CONFIG_SMP
-
-void arch_smp_call_ipi(unsigned int cpu_id)
-{
-	panic("smp_call IPI not implemented.");
-}
-
-#endif /* CONFIG_SMP */
-
-/** @}
- */
Index: kernel/arch/sparc64/Makefile.inc
===================================================================
--- kernel/arch/sparc64/Makefile.inc	(revision aae365bc823f3137811d2c48089c150e81c40606)
+++ kernel/arch/sparc64/Makefile.inc	(revision d19b3fcc8f46d58029778b0ba79ad3d796f39697)
@@ -99,5 +99,4 @@
 	ARCH_SOURCES += \
 		arch/$(KARCH)/src/smp/$(USARCH)/smp.c \
-		arch/$(KARCH)/src/smp/$(USARCH)/smp_call.c \
 		arch/$(KARCH)/src/smp/$(USARCH)/ipi.c
 endif
Index: kernel/arch/sparc64/include/arch/interrupt.h
===================================================================
--- kernel/arch/sparc64/include/arch/interrupt.h	(revision aae365bc823f3137811d2c48089c150e81c40606)
+++ kernel/arch/sparc64/include/arch/interrupt.h	(revision d19b3fcc8f46d58029778b0ba79ad3d796f39697)
@@ -47,5 +47,4 @@
 enum {
 	IPI_TLB_SHOOTDOWN = VECTOR_TLB_SHOOTDOWN_IPI,
-	IPI_SMP_CALL
 };
 
Index: rnel/arch/sparc64/include/arch/smp/sun4u/ipi.h
===================================================================
--- kernel/arch/sparc64/include/arch/smp/sun4u/ipi.h	(revision aae365bc823f3137811d2c48089c150e81c40606)
+++ 	(revision )
@@ -1,45 +1,0 @@
-/*
- * Copyright (c) 2012 Adam Hraska
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * - Redistributions of source code must retain the above copyright
- *   notice, this list of conditions and the following disclaimer.
- * - 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.
- * - The name of the author may not be used to endorse or promote products
- *   derived from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 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.
- */
-
-/** @addtogroup kernel_sparc64
- * @{
- */
-/**
- * @file
- * @brief	IPI functions specific to Sun4U.
- */
-
-#ifndef KERN_sparc64_sun4u_IPI_H_
-#define KERN_sparc64_sun4u_IPI_H_
-
-extern void ipi_unicast_arch(unsigned int, int);
-
-#endif
-
-/** @}
- */
Index: kernel/arch/sparc64/src/smp/sun4u/ipi.c
===================================================================
--- kernel/arch/sparc64/src/smp/sun4u/ipi.c	(revision aae365bc823f3137811d2c48089c150e81c40606)
+++ kernel/arch/sparc64/src/smp/sun4u/ipi.c	(revision d19b3fcc8f46d58029778b0ba79ad3d796f39697)
@@ -35,5 +35,4 @@
 #include <smp/ipi.h>
 #include <arch/barrier.h>
-#include <arch/smp/sun4u/ipi.h>
 #include <assert.h>
 #include <cpu.h>
@@ -43,5 +42,4 @@
 #include <config.h>
 #include <mm/tlb.h>
-#include <smp/smp_call.h>
 #include <arch/interrupt.h>
 #include <arch/trap/interrupt.h>
@@ -175,25 +173,4 @@
 }
 
-/*
- * Deliver an IPI to the specified processors (except the current one).
- *
- * Interrupts must be disabled.
- *
- * @param cpu_id Destination cpu id (index into cpus array). Must not
- *               be the current cpu.
- * @param ipi    IPI number.
- */
-void ipi_unicast_arch(unsigned int cpu_id, int ipi)
-{
-	assert(&cpus[cpu_id] != CPU);
-
-	if (ipi == IPI_SMP_CALL) {
-		cross_call(cpus[cpu_id].arch.mid, smp_call_ipi_recv);
-	} else {
-		panic("Unknown IPI (%d).\n", ipi);
-		return;
-	}
-}
-
 /** @}
  */
Index: rnel/arch/sparc64/src/smp/sun4u/smp_call.c
===================================================================
--- kernel/arch/sparc64/src/smp/sun4u/smp_call.c	(revision aae365bc823f3137811d2c48089c150e81c40606)
+++ 	(revision )
@@ -1,55 +1,0 @@
-/*
- * Copyright (c) 2012 Adam Hraska
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * - Redistributions of source code must retain the above copyright
- *   notice, this list of conditions and the following disclaimer.
- * - 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.
- * - The name of the author may not be used to endorse or promote products
- *   derived from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 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.
- */
-
-/** @addtogroup kernel_sparc64
- * @{
- */
-
-/**
- * @file
- * @brief Sun4u specific smp call support.
- */
-
-#include <smp/smp_call.h>
-#include <arch/smp/sun4u/ipi.h>
-#include <arch/interrupt.h>
-
-void arch_smp_call_ipi(unsigned int cpu_id)
-{
-	/*
-	 * Required by ipi_unicast_arch(). That functions resolves a potential
-	 * deadlock should both the destination and source cpus be sending
-	 * unicast ipis to each other with interrupts disabled.
-	 */
-	ipl_t ipl = interrupts_disable();
-	ipi_unicast_arch(cpu_id, IPI_SMP_CALL);
-	interrupts_restore(ipl);
-}
-
-/** @}
- */
Index: kernel/generic/include/cpu.h
===================================================================
--- kernel/generic/include/cpu.h	(revision aae365bc823f3137811d2c48089c150e81c40606)
+++ kernel/generic/include/cpu.h	(revision d19b3fcc8f46d58029778b0ba79ad3d796f39697)
@@ -98,10 +98,4 @@
 
 	/**
-	 * SMP calls to invoke on this CPU.
-	 */
-	SPINLOCK_DECLARE(smp_calls_lock);
-	list_t smp_pending_calls;
-
-	/**
 	 * Stack used by scheduler when there is no running thread.
 	 */
Index: rnel/generic/include/smp/smp_call.h
===================================================================
--- kernel/generic/include/smp/smp_call.h	(revision aae365bc823f3137811d2c48089c150e81c40606)
+++ 	(revision )
@@ -1,65 +1,0 @@
-/*
- * Copyright (c) 2012 Adam Hraska
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * - Redistributions of source code must retain the above copyright
- *   notice, this list of conditions and the following disclaimer.
- * - 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.
- * - The name of the author may not be used to endorse or promote products
- *   derived from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 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.
- */
-
-/** @addtogroup kernel_generic
- * @{
- */
-/** @file
- */
-
-#ifndef KERN_SMP_CALL_H_
-#define	KERN_SMP_CALL_H_
-
-#include <adt/list.h>
-#include <synch/spinlock.h>
-#include <atomic.h>
-
-typedef void (*smp_call_func_t)(void *);
-
-typedef struct smp_call {
-	smp_call_func_t func;
-	void *arg;
-	link_t calls_link;
-	atomic_t pending;
-} smp_call_t;
-
-extern void smp_call(unsigned int, smp_call_func_t, void *);
-extern void smp_call_async(unsigned int, smp_call_func_t, void *, smp_call_t *);
-extern void smp_call_wait(smp_call_t *);
-
-extern void smp_call_init(void);
-
-#ifdef CONFIG_SMP
-extern void smp_call_ipi_recv(void);
-extern void arch_smp_call_ipi(unsigned int);
-#endif
-
-#endif	/* KERN_SMP_CALL_H_ */
-
-/** @}
- */
Index: kernel/generic/src/main/main.c
===================================================================
--- kernel/generic/src/main/main.c	(revision aae365bc823f3137811d2c48089c150e81c40606)
+++ kernel/generic/src/main/main.c	(revision d19b3fcc8f46d58029778b0ba79ad3d796f39697)
@@ -78,5 +78,4 @@
 #include <synch/waitq.h>
 #include <synch/futex.h>
-#include <smp/smp_call.h>
 #include <arch/arch.h>
 #include <arch.h>
@@ -273,5 +272,4 @@
 	ARCH_OP(post_cpu_init);
 
-	smp_call_init();
 	clock_counter_init();
 	timeout_init();
@@ -379,6 +377,4 @@
 void main_ap_separated_stack(void)
 {
-	smp_call_init();
-
 	/*
 	 * Configure timeouts for this cpu.
Index: rnel/generic/src/smp/smp_call.c
===================================================================
--- kernel/generic/src/smp/smp_call.c	(revision aae365bc823f3137811d2c48089c150e81c40606)
+++ 	(revision )
@@ -1,276 +1,0 @@
-/*
- * Copyright (c) 2012 Adam Hraska
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * - Redistributions of source code must retain the above copyright
- *   notice, this list of conditions and the following disclaimer.
- * - 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.
- * - The name of the author may not be used to endorse or promote products
- *   derived from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 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.
- */
-
-/** @addtogroup kernel_generic
- * @{
- */
-
-/**
- * @file
- * @brief Facility to invoke functions on other cpus via IPIs.
- */
-
-#include <smp/smp_call.h>
-#include <barrier.h>
-#include <arch/asm.h>  /* interrupt_disable */
-#include <arch.h>
-#include <assert.h>
-#include <config.h>
-#include <preemption.h>
-#include <cpu.h>
-
-static void call_start(smp_call_t *call_info, smp_call_func_t func, void *arg);
-static void call_done(smp_call_t *call_info);
-static void call_wait(smp_call_t *call_info);
-
-/** Init smp_call() on the local cpu. */
-void smp_call_init(void)
-{
-	assert(CPU);
-	assert(PREEMPTION_DISABLED || interrupts_disabled());
-
-	spinlock_initialize(&CPU->smp_calls_lock, "cpu[].smp_calls_lock");
-	list_initialize(&CPU->smp_pending_calls);
-}
-
-/** Invokes a function on a specific cpu and waits for it to complete.
- *
- * Calls @a func on the CPU denoted by its logical id @cpu_id .
- * The function will execute with interrupts disabled. It should
- * be a quick and simple function and must never block.
- *
- * If @a cpu_id is the local CPU, the function will be invoked
- * directly.
- *
- * All memory accesses of prior to smp_call() will be visible
- * to @a func on cpu @a cpu_id. Similarly, any changes @a func
- * makes on cpu @a cpu_id will be visible on this cpu once
- * smp_call() returns.
- *
- * Invoking @a func on the destination cpu acts as a memory barrier
- * on that cpu.
- *
- * @param cpu_id Destination CPU's logical id (eg CPU->id)
- * @param func Function to call.
- * @param arg Argument to pass to the user supplied function @a func.
- */
-void smp_call(unsigned int cpu_id, smp_call_func_t func, void *arg)
-{
-	smp_call_t call_info;
-	smp_call_async(cpu_id, func, arg, &call_info);
-	smp_call_wait(&call_info);
-}
-
-/** Invokes a function on a specific cpu asynchronously.
- *
- * Calls @a func on the CPU denoted by its logical id @cpu_id .
- * The function will execute with interrupts disabled. It should
- * be a quick and simple function and must never block.
- *
- * Pass @a call_info to smp_call_wait() in order to wait for
- * @a func to complete.
- *
- * @a call_info must be valid until/after @a func returns. Use
- * smp_call_wait() to wait until it is safe to free @a call_info.
- *
- * If @a cpu_id is the local CPU, the function will be invoked
- * directly. If the destination cpu id @a cpu_id is invalid
- * or denotes an inactive cpu, the call is discarded immediately.
- *
- * All memory accesses of the caller prior to smp_call_async()
- * will be made visible to @a func on the other cpu. Similarly,
- * any changes @a func makes on cpu @a cpu_id will be visible
- * to this cpu when smp_call_wait() returns.
- *
- * Invoking @a func on the destination cpu acts as a memory barrier
- * on that cpu.
- *
- * Interrupts must be enabled. Otherwise you run the risk
- * of a deadlock.
- *
- * @param cpu_id Destination CPU's logical id (eg CPU->id).
- * @param func Function to call.
- * @param arg Argument to pass to the user supplied function @a func.
- * @param call_info Use it to wait for the function to complete. Must
- *          be valid until the function completes.
- */
-void smp_call_async(unsigned int cpu_id, smp_call_func_t func, void *arg,
-    smp_call_t *call_info)
-{
-	/*
-	 * Interrupts must not be disabled or you run the risk of a deadlock
-	 * if both the destination and source cpus try to send an IPI to each
-	 * other with interrupts disabled. Because the interrupts are disabled
-	 * the IPIs cannot be delivered and both cpus will forever busy wait
-	 * for an acknowledgment of the IPI from the other cpu.
-	 */
-	assert(!interrupts_disabled());
-	assert(call_info != NULL);
-
-	/* Discard invalid calls. */
-	if (config.cpu_count <= cpu_id || !cpus[cpu_id].active) {
-		call_start(call_info, func, arg);
-		call_done(call_info);
-		return;
-	}
-
-	/* Protect cpu->id against migration. */
-	preemption_disable();
-
-	call_start(call_info, func, arg);
-
-	if (cpu_id != CPU->id) {
-#ifdef CONFIG_SMP
-		spinlock_lock(&cpus[cpu_id].smp_calls_lock);
-		list_append(&call_info->calls_link, &cpus[cpu_id].smp_pending_calls);
-		spinlock_unlock(&cpus[cpu_id].smp_calls_lock);
-
-		/*
-		 * If a platform supports SMP it must implement arch_smp_call_ipi().
-		 * It should issue an IPI on cpu_id and invoke smp_call_ipi_recv()
-		 * on cpu_id in turn.
-		 *
-		 * Do not implement as just an empty dummy function. Instead
-		 * consider providing a full implementation or at least a version
-		 * that panics if invoked. Note that smp_call_async() never
-		 * calls arch_smp_call_ipi() on uniprocessors even if CONFIG_SMP.
-		 */
-		arch_smp_call_ipi(cpu_id);
-#endif
-	} else {
-		/* Invoke local smp calls in place. */
-		ipl_t ipl = interrupts_disable();
-		func(arg);
-		interrupts_restore(ipl);
-
-		call_done(call_info);
-	}
-
-	preemption_enable();
-}
-
-/** Waits for a function invoked on another CPU asynchronously to complete.
- *
- * Does not sleep but rather spins.
- *
- * Example usage:
- * @code
- * void hello(void *p) {
- *     puts((char*)p);
- * }
- *
- * smp_call_t call_info;
- * smp_call_async(cpus[2].id, hello, "hi!\n", &call_info);
- * // Do some work. In the meantime, hello() is executed on cpu2.
- * smp_call_wait(&call_info);
- * @endcode
- *
- * @param call_info Initialized by smp_call_async().
- */
-void smp_call_wait(smp_call_t *call_info)
-{
-	call_wait(call_info);
-}
-
-#ifdef CONFIG_SMP
-
-/** Architecture independent smp call IPI handler.
- *
- * Interrupts must be disabled. Tolerates spurious calls.
- */
-void smp_call_ipi_recv(void)
-{
-	assert(interrupts_disabled());
-	assert(CPU);
-
-	list_t calls_list;
-	list_initialize(&calls_list);
-
-	/*
-	 * Acts as a load memory barrier. Any changes made by the cpu that
-	 * added the smp_call to calls_list will be made visible to this cpu.
-	 */
-	spinlock_lock(&CPU->smp_calls_lock);
-	list_concat(&calls_list, &CPU->smp_pending_calls);
-	spinlock_unlock(&CPU->smp_calls_lock);
-
-	/* Walk the list manually, so that we can safely remove list items. */
-	for (link_t *cur = calls_list.head.next, *next = cur->next;
-	    !list_empty(&calls_list); cur = next, next = cur->next) {
-
-		smp_call_t *call_info = list_get_instance(cur, smp_call_t, calls_link);
-		list_remove(cur);
-
-		call_info->func(call_info->arg);
-		call_done(call_info);
-	}
-}
-
-#endif /* CONFIG_SMP */
-
-static void call_start(smp_call_t *call_info, smp_call_func_t func, void *arg)
-{
-	link_initialize(&call_info->calls_link);
-	call_info->func = func;
-	call_info->arg = arg;
-
-	/*
-	 * We can't use standard spinlocks here because we want to lock
-	 * the structure on one cpu and unlock it on another (without
-	 * messing up the preemption count).
-	 */
-	atomic_store(&call_info->pending, 1);
-
-	/* Let initialization complete before continuing. */
-	memory_barrier();
-}
-
-static void call_done(smp_call_t *call_info)
-{
-	/*
-	 * Separate memory accesses of the called function from the
-	 * announcement of its completion.
-	 */
-	memory_barrier();
-	atomic_store(&call_info->pending, 0);
-}
-
-static void call_wait(smp_call_t *call_info)
-{
-	do {
-		/*
-		 * Ensure memory accesses following call_wait() are ordered
-		 * after completion of the called function on another cpu.
-		 * Also, speed up loading of call_info->pending.
-		 */
-		memory_barrier();
-	} while (atomic_load(&call_info->pending));
-}
-
-/** @}
- */
Index: rnel/test/smpcall/smpcall1.c
===================================================================
--- kernel/test/smpcall/smpcall1.c	(revision aae365bc823f3137811d2c48089c150e81c40606)
+++ 	(revision )
@@ -1,179 +1,0 @@
-/*
- * Copyright (c) 2012 Adam Hraska
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * - Redistributions of source code must retain the above copyright
- *   notice, this list of conditions and the following disclaimer.
- * - 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.
- * - The name of the author may not be used to endorse or promote products
- *   derived from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 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.
- */
-
-#include <assert.h>
-#include <test.h>
-#include <smp/smp_call.h>
-#include <cpu.h>
-#include <macros.h>
-#include <config.h>
-#include <arch.h>
-#include <proc/thread.h>
-
-/*
- * Maximum total number of smp_calls in the system is:
- *  162000 == 9^2 * 1000 * 2
- *  == MAX_CPUS^2 * ITERATIONS * EACH_CPU_INC_PER_ITER
- */
-#define MAX_CPUS   9
-#define ITERATIONS 1000
-#define EACH_CPU_INC_PER_ITER 2
-
-static void inc(void *p)
-{
-	assert(interrupts_disabled());
-
-	size_t *pcall_cnt = (size_t *)p;
-	/*
-	 * No synchronization. Tests if smp_calls makes changes
-	 * visible to the caller.
-	 */
-	++*pcall_cnt;
-}
-
-static void test_thread(void *p)
-{
-	size_t *pcall_cnt = (size_t *)p;
-	smp_call_t call_info[MAX_CPUS];
-
-	unsigned int cpu_count = min(config.cpu_active, MAX_CPUS);
-
-	for (int iter = 0; iter < ITERATIONS; ++iter) {
-		/* Synchronous version. */
-		for (unsigned cpu_id = 0; cpu_id < cpu_count; ++cpu_id) {
-			/*
-			 * smp_call should make changes by inc() visible on this cpu.
-			 * As a result we can pass it our pcall_cnt and not worry
-			 * about other synchronization.
-			 */
-			smp_call(cpu_id, inc, pcall_cnt);
-		}
-
-		/*
-		 * Async calls run in parallel on different cpus, so passing the
-		 * same counter would clobber it without additional synchronization.
-		 */
-		size_t local_cnt[MAX_CPUS] = { 0 };
-
-		/* Now start asynchronous calls. */
-		for (unsigned cpu_id = 0; cpu_id < cpu_count; ++cpu_id) {
-			smp_call_async(cpu_id, inc, &local_cnt[cpu_id], &call_info[cpu_id]);
-		}
-
-		/* And wait for all async calls to complete. */
-		for (unsigned cpu_id = 0; cpu_id < cpu_count; ++cpu_id) {
-			smp_call_wait(&call_info[cpu_id]);
-			*pcall_cnt += local_cnt[cpu_id];
-		}
-
-		/* Give other threads a chance to run. */
-		thread_usleep(10000);
-	}
-}
-
-static size_t calc_exp_calls(size_t thread_cnt)
-{
-	return thread_cnt * ITERATIONS * EACH_CPU_INC_PER_ITER;
-}
-
-const char *test_smpcall1(void)
-{
-	/* Number of received calls that were sent by cpu[i]. */
-	size_t call_cnt[MAX_CPUS] = { 0 };
-	thread_t *thread[MAX_CPUS] = { NULL };
-
-	unsigned int cpu_count = min(config.cpu_active, MAX_CPUS);
-	size_t running_thread_cnt = 0;
-
-	TPRINTF("Spawning threads on %u cpus.\n", cpu_count);
-
-	/* Create a wired thread on each cpu. */
-	for (unsigned int id = 0; id < cpu_count; ++id) {
-		thread[id] = thread_create(test_thread, &call_cnt[id], TASK,
-		    THREAD_FLAG_NONE, "smp-call-test");
-
-		if (thread[id]) {
-			thread_wire(thread[id], &cpus[id]);
-			++running_thread_cnt;
-		} else {
-			TPRINTF("Failed to create thread on cpu%u.\n", id);
-		}
-	}
-
-	size_t exp_calls = calc_exp_calls(running_thread_cnt);
-	size_t exp_calls_sum = exp_calls * cpu_count;
-
-	TPRINTF("Running %zu wired threads. Expecting %zu calls. Be patient.\n",
-	    running_thread_cnt, exp_calls_sum);
-
-	for (unsigned int i = 0; i < cpu_count; ++i) {
-		if (thread[i] != NULL) {
-			thread_ready(thread[i]);
-		}
-	}
-
-	/* Wait for threads to complete. */
-	for (unsigned int i = 0; i < cpu_count; ++i) {
-		if (thread[i] != NULL) {
-			thread_join(thread[i]);
-			thread_detach(thread[i]);
-		}
-	}
-
-	TPRINTF("Threads finished. Checking number of smp_call()s.\n");
-
-	bool ok = true;
-	size_t calls_sum = 0;
-
-	for (size_t i = 0; i < cpu_count; ++i) {
-		if (thread[i] != NULL) {
-			if (call_cnt[i] != exp_calls) {
-				ok = false;
-				TPRINTF("Error: %zu instead of %zu cpu%zu's calls were"
-				    " acknowledged.\n", call_cnt[i], exp_calls, i);
-			}
-		}
-
-		calls_sum += call_cnt[i];
-	}
-
-	if (calls_sum != exp_calls_sum) {
-		TPRINTF("Error: total acknowledged sum: %zu instead of %zu.\n",
-		    calls_sum, exp_calls_sum);
-
-		ok = false;
-	}
-
-	if (ok) {
-		TPRINTF("Success: number of received smp_calls is as expected (%zu).\n",
-		    exp_calls_sum);
-		return NULL;
-	} else
-		return "Failed: incorrect acknowledged smp_calls.\n";
-
-}
Index: rnel/test/smpcall/smpcall1.def
===================================================================
--- kernel/test/smpcall/smpcall1.def	(revision aae365bc823f3137811d2c48089c150e81c40606)
+++ 	(revision )
@@ -1,6 +1,0 @@
-{
-	"smpcall1",
-	"smp_call() test",
-	&test_smpcall1,
-	true
-},
Index: kernel/test/test.c
===================================================================
--- kernel/test/test.c	(revision aae365bc823f3137811d2c48089c150e81c40606)
+++ kernel/test/test.c	(revision d19b3fcc8f46d58029778b0ba79ad3d796f39697)
@@ -57,5 +57,4 @@
 #include <print/print5.def>
 #include <thread/thread1.def>
-#include <smpcall/smpcall1.def>
 	{
 		.name = NULL,
Index: kernel/test/test.h
===================================================================
--- kernel/test/test.h	(revision aae365bc823f3137811d2c48089c150e81c40606)
+++ kernel/test/test.h	(revision d19b3fcc8f46d58029778b0ba79ad3d796f39697)
@@ -76,5 +76,4 @@
 extern const char *test_print5(void);
 extern const char *test_thread1(void);
-extern const char *test_smpcall1(void);
 
 extern test_t tests[];
