Index: HelenOS.config
===================================================================
--- HelenOS.config	(revision bca408bfd84743b83b4ee34646013041a86f2ccf)
+++ HelenOS.config	(revision 1715b6af7847ebb95ae42eba99295f3291f1d1b5)
@@ -31,5 +31,4 @@
 
 % Platform
-@ "abs32le" abstract 32-bit little endian
 @ "amd64" AMD64/Intel EM64T (PC)
 @ "arm32" ARM 32-bit
@@ -92,8 +91,4 @@
 
 % Kernel architecture
-@ "abs32le"
-! [PLATFORM=abs32le] KARCH (choice)
-
-% Kernel architecture
 @ "amd64"
 ! [PLATFORM=amd64] KARCH (choice)
@@ -135,8 +130,4 @@
 
 % User space architecture
-@ "abs32le"
-! [PLATFORM=abs32le] UARCH (choice)
-
-% User space architecture
 @ "amd64"
 ! [PLATFORM=amd64] UARCH (choice)
@@ -176,8 +167,4 @@
 
 ## Mapping between platform and boot architecture
-
-% Boot architecture
-@ "abs32le"
-! [PLATFORM=abs32le] BARCH (choice)
 
 % Boot architecture
@@ -256,9 +243,4 @@
 ! [PLATFORM=arm32|PLATFORM=mips32|PLATFORM=ppc32] COMPILER (choice)
 
-% Compiler
-@ "gcc_native" GNU C Compiler (native)
-@ "clang" Clang
-! [PLATFORM=abs32le] COMPILER (choice)
-
 
 ## Kernel configuration
@@ -277,5 +259,5 @@
 
 % Hierarchical page tables support
-! [PLATFORM=abs32le|PLATFORM=ia32|PLATFORM=amd64|PLATFORM=arm32|PLATFORM=mips32|PLATFORM=ppc32] CONFIG_PAGE_PT (y)
+! [PLATFORM=ia32|PLATFORM=amd64|PLATFORM=arm32|PLATFORM=mips32|PLATFORM=ppc32] CONFIG_PAGE_PT (y)
 
 % Page hash table support
@@ -504,5 +486,2 @@
 % Mount /data on startup
 ! [CONFIG_START_BD=y] CONFIG_MOUNT_DATA (n/y)
-
-% Verbose task dumps
-! CONFIG_VERBOSE_DUMPS (n/y)
Index: Makefile
===================================================================
--- Makefile	(revision bca408bfd84743b83b4ee34646013041a86f2ccf)
+++ Makefile	(revision 1715b6af7847ebb95ae42eba99295f3291f1d1b5)
@@ -59,5 +59,5 @@
 
 distclean: clean
-	rm -f $(CSCOPE).out Makefile.config config.h config.defs tools/*.pyc tools/checkers/*.pyc
+	rm -f $(CSCOPE).out Makefile.config config.h config.defs tools/*.pyc
 
 clean:
Index: boot/Makefile.common
===================================================================
--- boot/Makefile.common	(revision bca408bfd84743b83b4ee34646013041a86f2ccf)
+++ boot/Makefile.common	(revision 1715b6af7847ebb95ae42eba99295f3291f1d1b5)
@@ -56,6 +56,5 @@
 	$(USPACEDIR)/srv/fs/devfs/devfs \
 	$(USPACEDIR)/srv/fs/tmpfs/tmpfs \
-	$(USPACEDIR)/srv/fs/fat/fat \
-	$(USPACEDIR)/srv/taskmon/taskmon
+	$(USPACEDIR)/srv/fs/fat/fat
 
 RD_APPS = \
@@ -66,5 +65,4 @@
 	$(USPACEDIR)/app/mkfat/mkfat \
 	$(USPACEDIR)/app/redir/redir \
-	$(USPACEDIR)/app/taskdump/taskdump \
 	$(USPACEDIR)/app/tester/tester \
 	$(USPACEDIR)/app/tetris/tetris \
Index: faults/abs32le/Makefile.config
===================================================================
--- defaults/abs32le/Makefile.config	(revision bca408bfd84743b83b4ee34646013041a86f2ccf)
+++ 	(revision )
@@ -1,29 +1,0 @@
-# Platform
-PLATFORM = abs32le
-
-# RAM disk format
-RDFMT = fat
-
-# Compiler
-COMPILER = gcc_native
-
-# Debug build
-CONFIG_DEBUG = y
-
-# Support for userspace debuggers
-CONFIG_UDEBUG = y
-
-# Kernel console support
-CONFIG_KCONSOLE = y
-
-# Kernel symbol information
-CONFIG_SYMTAB = y
-
-# Detailed kernel logging
-CONFIG_LOG = n
-
-# Compile kernel tests
-CONFIG_TEST = y
-
-# Load disk drivers on startup
-CONFIG_START_BD = n
Index: rnel/arch/abs32le/Makefile.inc
===================================================================
--- kernel/arch/abs32le/Makefile.inc	(revision bca408bfd84743b83b4ee34646013041a86f2ccf)
+++ 	(revision )
@@ -1,46 +1,0 @@
-#
-# Copyright (c) 2010 Martin Decky
-# 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.
-#
-
-## Toolchain configuration
-#
-
-BITS = 32
-ENDIANESS = LE
-
-ARCH_SOURCES = \
-	arch/$(KARCH)/src/debug/stacktrace.c \
-	arch/$(KARCH)/src/proc/scheduler.c \
-	arch/$(KARCH)/src/proc/task.c \
-	arch/$(KARCH)/src/proc/thread.c \
-	arch/$(KARCH)/src/abs32le.c \
-	arch/$(KARCH)/src/userspace.c \
-	arch/$(KARCH)/src/cpu/cpu.c \
-	arch/$(KARCH)/src/mm/as.c \
-	arch/$(KARCH)/src/mm/frame.c \
-	arch/$(KARCH)/src/mm/page.c \
-	arch/$(KARCH)/src/mm/tlb.c
Index: rnel/arch/abs32le/_link.ld.in
===================================================================
--- kernel/arch/abs32le/_link.ld.in	(revision bca408bfd84743b83b4ee34646013041a86f2ccf)
+++ 	(revision )
@@ -1,39 +1,0 @@
-SECTIONS {
-	.text : {
-		ktext_start = .;
-		*(.text);
-		ktext_end = .;
-	}
-	.data : {
-		kdata_start = .;
-		*(.data);                       /* initialized data */
-		hardcoded_ktext_size = .;
-		LONG(ktext_end - ktext_start);
-		hardcoded_kdata_size = .;
-		LONG(kdata_end - kdata_start);
-		hardcoded_load_address = .;
-		LONG(hardcoded_load_address);
-		*(.bss);                        /* uninitialized static variables */
-		*(COMMON);                      /* global variables */
-		
-		*(.rodata*);
-		*(.sdata);
-		*(.reginfo);
-		. = ALIGN(8);
-		symbol_table = .;
-		*(symtab.*);
-	}
-	.sbss : {
-		*(.sbss);
-		*(.scommon);
-	}
-	
-	kdata_end = .;
-	
-	/DISCARD/ : {
-		*(.mdebug*);
-		*(.pdr);
-		*(.comment);
-		*(.note);
-	}
-}
Index: rnel/arch/abs32le/include/arch.h
===================================================================
--- kernel/arch/abs32le/include/arch.h	(revision bca408bfd84743b83b4ee34646013041a86f2ccf)
+++ 	(revision )
@@ -1,41 +1,0 @@
-/*
- * Copyright (c) 2010 Martin Decky
- * 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 abs32le
- * @{
- */
-/** @file
- */
-
-#ifndef KERN_abs32le_ARCH_H_
-#define KERN_abs32le_ARCH_H_
-
-#endif
-
-/** @}
- */
Index: rnel/arch/abs32le/include/asm.h
===================================================================
--- kernel/arch/abs32le/include/asm.h	(revision bca408bfd84743b83b4ee34646013041a86f2ccf)
+++ 	(revision )
@@ -1,196 +1,0 @@
-/*
- * Copyright (c) 2010 Martin Decky
- * 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 abs32le
- * @{
- */
-/** @file
- */
-
-#ifndef KERN_abs32le_ASM_H_
-#define KERN_abs32le_ASM_H_
-
-#include <arch/types.h>
-#include <typedefs.h>
-#include <config.h>
-
-extern void interrupt_handlers(void);
-
-extern void enable_l_apic_in_msr(void);
-
-
-extern void asm_delay_loop(uint32_t);
-extern void asm_fake_loop(uint32_t);
-
-
-static inline void cpu_halt(void)
-{
-	/* On real hardware this should stop processing further
-	   instructions on the CPU (and possibly putting it into
-	   low-power mode) without any possibility of exitting
-	   this function. */
-	
-	while (true);
-}
-
-static inline void cpu_sleep(void)
-{
-	/* On real hardware this should put the CPU into low-power
-	   mode. However, the CPU is free to continue processing
-	   futher instructions any time. The CPU also wakes up
-	   upon an interrupt. */
-}
-
-static inline void pio_write_8(ioport8_t *port, uint8_t val)
-{
-}
-
-/** Word to port
- *
- * Output word to port
- *
- * @param port Port to write to
- * @param val Value to write
- *
- */
-static inline void pio_write_16(ioport16_t *port, uint16_t val)
-{
-}
-
-/** Double word to port
- *
- * Output double word to port
- *
- * @param port Port to write to
- * @param val Value to write
- *
- */
-static inline void pio_write_32(ioport32_t *port, uint32_t val)
-{
-}
-
-/** Byte from port
- *
- * Get byte from port
- *
- * @param port Port to read from
- * @return Value read
- *
- */
-static inline uint8_t pio_read_8(ioport8_t *port)
-{
-	return 0;
-}
-
-/** Word from port
- *
- * Get word from port
- *
- * @param port Port to read from
- * @return Value read
- *
- */
-static inline uint16_t pio_read_16(ioport16_t *port)
-{
-	return 0;
-}
-
-/** Double word from port
- *
- * Get double word from port
- *
- * @param port Port to read from
- * @return Value read
- *
- */
-static inline uint32_t pio_read_32(ioport32_t *port)
-{
-	return 0;
-}
-
-static inline ipl_t interrupts_enable(void)
-{
-	/* On real hardware this unconditionally enables preemption
-	   by internal and external interrupts.
-	   
-	   The return value stores the previous interrupt level. */
-	
-	return 0;
-}
-
-static inline ipl_t interrupts_disable(void)
-{
-	/* On real hardware this disables preemption by the usual
-	   set of internal and external interrupts. This does not
-	   apply to special non-maskable interrupts and sychronous
-	   CPU exceptions.
-	   
-	   The return value stores the previous interrupt level. */
-	
-	return 0;
-}
-
-static inline void interrupts_restore(ipl_t ipl)
-{
-	/* On real hardware this either enables or disables preemption
-	   according to the interrupt level value from the argument. */
-}
-
-static inline ipl_t interrupts_read(void)
-{
-	/* On real hardware the return value stores the current interrupt
-	   level. */
-	
-	return 0;
-}
-
-static inline uintptr_t get_stack_base(void)
-{
-	/* On real hardware this returns the address of the bottom
-	   of the current CPU stack. The the_t structure is stored
-	   on the bottom of stack and this is used to identify the
-	   current CPU, current task, current thread and current
-	   address space. */
-	
-	return 0;
-}
-
-static inline uintptr_t *get_ip()
-{
-	/* On real hardware this returns the current instruction
-	   pointer value. The value certainly changes with each
-	   instruction, but it can be still used to identify
-	   a specific function. */
-	
-	return 0;
-}
-
-#endif
-
-/** @}
- */
Index: rnel/arch/abs32le/include/atomic.h
===================================================================
--- kernel/arch/abs32le/include/atomic.h	(revision bca408bfd84743b83b4ee34646013041a86f2ccf)
+++ 	(revision )
@@ -1,123 +1,0 @@
-/*
- * Copyright (c) 2010 Martin Decky
- * 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 abs32le
- * @{
- */
-/** @file
- */
-
-#ifndef KERN_abs32le_ATOMIC_H_
-#define KERN_abs32le_ATOMIC_H_
-
-#include <arch/types.h>
-#include <arch/barrier.h>
-#include <preemption.h>
-
-static inline void atomic_inc(atomic_t *val) {
-	/* On real hardware the increment has to be done
-	   as an atomic action. */
-	
-	val->count++;
-}
-
-static inline void atomic_dec(atomic_t *val) {
-	/* On real hardware the decrement has to be done
-	   as an atomic action. */
-	
-	val->count++;
-}
-
-static inline long atomic_postinc(atomic_t *val)
-{
-	/* On real hardware both the storing of the previous
-	   value and the increment have to be done as a single
-	   atomic action. */
-	
-	long prev = val->count;
-	
-	val->count++;
-	return prev;
-}
-
-static inline long atomic_postdec(atomic_t *val)
-{
-	/* On real hardware both the storing of the previous
-	   value and the decrement have to be done as a single
-	   atomic action. */
-	
-	long prev = val->count;
-	
-	val->count--;
-	return prev;
-}
-
-#define atomic_preinc(val)  (atomic_postinc(val) + 1)
-#define atomic_predec(val)  (atomic_postdec(val) - 1)
-
-static inline uint32_t test_and_set(atomic_t *val) {
-	uint32_t v;
-	
-	asm volatile (
-		"movl $1, %[v]\n"
-		"xchgl %[v], %[count]\n"
-		: [v] "=r" (v), [count] "+m" (val->count)
-	);
-	
-	return v;
-}
-
-/** ia32 specific fast spinlock */
-static inline void atomic_lock_arch(atomic_t *val)
-{
-	uint32_t tmp;
-	
-	preemption_disable();
-	asm volatile (
-		"0:\n"
-		"pause\n"        /* Pentium 4's HT love this instruction */
-		"mov %[count], %[tmp]\n"
-		"testl %[tmp], %[tmp]\n"
-		"jnz 0b\n"       /* lightweight looping on locked spinlock */
-		
-		"incl %[tmp]\n"  /* now use the atomic operation */
-		"xchgl %[count], %[tmp]\n"
-		"testl %[tmp], %[tmp]\n"
-		"jnz 0b\n"
-		: [count] "+m" (val->count), [tmp] "=&r" (tmp)
-	);
-	/*
-	 * Prevent critical section code from bleeding out this way up.
-	 */
-	CS_ENTER_BARRIER();
-}
-
-#endif
-
-/** @}
- */
Index: rnel/arch/abs32le/include/barrier.h
===================================================================
--- kernel/arch/abs32le/include/barrier.h	(revision bca408bfd84743b83b4ee34646013041a86f2ccf)
+++ 	(revision )
@@ -1,99 +1,0 @@
-/*
- * Copyright (c) 2005 Jakub Jermar
- * 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 ia32
- * @{
- */
-/** @file
- */
-
-#ifndef KERN_ia32_BARRIER_H_
-#define KERN_ia32_BARRIER_H_
-
-/*
- * NOTE:
- * No barriers for critical section (i.e. spinlock) on IA-32 are needed:
- * - spinlock_lock() and spinlock_trylock() use serializing XCHG instruction
- * - writes cannot pass reads on IA-32 => spinlock_unlock() needs no barriers
- */
-
-/*
- * Provisions are made to prevent compiler from reordering instructions itself.
- */
-
-#define CS_ENTER_BARRIER()  asm volatile ("" ::: "memory")
-#define CS_LEAVE_BARRIER()  asm volatile ("" ::: "memory")
-
-static inline void cpuid_serialization(void)
-{
-	asm volatile (
-		"xorl %%eax, %%eax\n"
-		"cpuid\n"
-		::: "eax", "ebx", "ecx", "edx", "memory"
-	);
-}
-
-#if defined(CONFIG_FENCES_P4)
-	#define memory_barrier()  asm volatile ("mfence\n" ::: "memory")
-	#define read_barrier()    asm volatile ("lfence\n" ::: "memory")
-	#ifdef CONFIG_WEAK_MEMORY
-		#define write_barrier()  asm volatile ("sfence\n" ::: "memory")
-	#else
-		#define write_barrier()  asm volatile ("" ::: "memory");
-	#endif
-#elif defined(CONFIG_FENCES_P3)
-	#define memory_barrier()  cpuid_serialization()
-	#define read_barrier()    cpuid_serialization()
-	#ifdef CONFIG_WEAK_MEMORY
-		#define write_barrier()  asm volatile ("sfence\n" ::: "memory")
-	#else
-		#define write_barrier()  asm volatile ("" ::: "memory");
-	#endif
-#else
-	#define memory_barrier()  cpuid_serialization()
-	#define read_barrier()    cpuid_serialization()
-	#ifdef CONFIG_WEAK_MEMORY
-		#define write_barrier()  cpuid_serialization()
-	#else
-		#define write_barrier()  asm volatile ("" ::: "memory");
-	#endif
-#endif
-
-/*
- * On ia32, the hardware takes care about instruction and data cache coherence,
- * even on SMP systems.  We issue a write barrier to be sure that writes
- * queueing in the store buffer drain to the memory (even though it would be
- * sufficient for them to drain to the D-cache).
- */
-#define smc_coherence(a)           write_barrier()
-#define smc_coherence_block(a, l)  write_barrier()
-
-#endif
-
-/** @}
- */
Index: rnel/arch/abs32le/include/context.h
===================================================================
--- kernel/arch/abs32le/include/context.h	(revision bca408bfd84743b83b4ee34646013041a86f2ccf)
+++ 	(revision )
@@ -1,64 +1,0 @@
-/*
- * Copyright (c) 2010 Martin Decky
- * 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 abs32le
- * @{
- */
-/** @file
- */
-
-#ifndef KERN_abs32le_CONTEXT_H_
-#define KERN_abs32le_CONTEXT_H_
-
-#ifdef KERNEL
-#include <arch/types.h>
-
-#define STACK_ITEM_SIZE  4
-#define SP_DELTA         0
-
-#define context_set(c, _pc, stack, size) \
-	do { \
-		(c)->pc = (uintptr_t) (_pc); \
-	} while (0)
-
-#endif /* KERNEL */
-
-/*
- * On real hardware this stores the registers which
- * need to be preserved across function calls.
- */
-typedef struct {
-	uintptr_t sp;
-	uintptr_t pc;
-	ipl_t ipl;
-} context_t;
-
-#endif
-
-/** @}
- */
Index: rnel/arch/abs32le/include/context_offset.h
===================================================================
--- kernel/arch/abs32le/include/context_offset.h	(revision bca408bfd84743b83b4ee34646013041a86f2ccf)
+++ 	(revision )
@@ -1,49 +1,0 @@
-/*
- * Copyright (c) 2010 Martin Decky
- * 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 abs32le
- * @{
- */
-/** @file
- */
-
-#ifndef KERN_abs32le_CONTEXT_OFFSET_H_
-#define KERN_abs32le_CONTEXT_OFFSET_H_
-
-#define OFFSET_PC  0x00
-
-#ifdef KERNEL
-	#define OFFSET_IPL 0x04
-#else
-	#define OFFSET_TLS 0x04
-#endif
-
-#endif
-
-/** @}
- */
Index: rnel/arch/abs32le/include/cpu.h
===================================================================
--- kernel/arch/abs32le/include/cpu.h	(revision bca408bfd84743b83b4ee34646013041a86f2ccf)
+++ 	(revision )
@@ -1,49 +1,0 @@
-/*
- * Copyright (c) 2010 Martin Decky
- * 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 abs32le
- * @{
- */
-/** @file
- */
-
-#ifndef KERN_abs32le_CPU_H_
-#define KERN_abs32le_CPU_H_
-
-/*
- * On real hardware this structure stores
- * information specific to the current
- * CPU model.
- */
-typedef struct {
-} cpu_arch_t;
-
-#endif
-
-/** @}
- */
Index: rnel/arch/abs32le/include/cycle.h
===================================================================
--- kernel/arch/abs32le/include/cycle.h	(revision bca408bfd84743b83b4ee34646013041a86f2ccf)
+++ 	(revision )
@@ -1,46 +1,0 @@
-/*
- * Copyright (c) 2010 Martin Decky
- * 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 abs32le
- * @{
- */
-/** @file
- */
-
-#ifndef KERN_abs32le_CYCLE_H_
-#define KERN_abs32le_CYCLE_H_
-
-static inline uint64_t get_cycle(void)
-{
-	return 0;
-}
-
-#endif
-
-/** @}
- */
Index: rnel/arch/abs32le/include/debug.h
===================================================================
--- kernel/arch/abs32le/include/debug.h	(revision bca408bfd84743b83b4ee34646013041a86f2ccf)
+++ 	(revision )
@@ -1,45 +1,0 @@
-/*
- * Copyright (c) 2010 Martin Decky
- * 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 abs32ledebug
- * @{
- */
-/** @file
- */
-
-#ifndef KERN_abs32le_DEBUG_H_
-#define KERN_abs32le_DEBUG_H_
-
-#include <arch/asm.h>
-
-#define HERE  get_ip()
-
-#endif
-
-/** @}
- */
Index: rnel/arch/abs32le/include/elf.h
===================================================================
--- kernel/arch/abs32le/include/elf.h	(revision bca408bfd84743b83b4ee34646013041a86f2ccf)
+++ 	(revision )
@@ -1,45 +1,0 @@
-/*
- * Copyright (c) 2010 Martin Decky
- * 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 abs32le
- * @{
- */
-/** @file
- */
-
-#ifndef KERN_abs32le_ELF_H_
-#define KERN_abs32le_ELF_H_
-
-#define ELF_MACHINE        EM_NO
-#define ELF_DATA_ENCODING  ELFDATA2LSB
-#define ELF_CLASS          ELFCLASS32
-
-#endif
-
-/** @}
- */
Index: rnel/arch/abs32le/include/faddr.h
===================================================================
--- kernel/arch/abs32le/include/faddr.h	(revision bca408bfd84743b83b4ee34646013041a86f2ccf)
+++ 	(revision )
@@ -1,45 +1,0 @@
-/*
- * Copyright (c) 2010 Martin Decky
- * 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 abs32le
- * @{
- */
-/** @file
- */
-
-#ifndef KERN_abs32le_FADDR_H_
-#define KERN_abs32le_FADDR_H_
-
-#include <arch/types.h>
-
-#define FADDR(fptr)  ((uintptr_t) (fptr))
-
-#endif
-
-/** @}
- */
Index: rnel/arch/abs32le/include/fpu_context.h
===================================================================
--- kernel/arch/abs32le/include/fpu_context.h	(revision bca408bfd84743b83b4ee34646013041a86f2ccf)
+++ 	(revision )
@@ -1,52 +1,0 @@
-/*
- * Copyright (c) 2010 Martin Decky
- * 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 abs32le
- * @{
- */
-/** @file
- */
-
-#ifndef KERN_abs32le_FPU_CONTEXT_H_
-#define KERN_abs32le_FPU_CONTEXT_H_
-
-#include <arch/types.h>
-
-#define FPU_CONTEXT_ALIGN  16
-
-/*
- * On real hardware this stores the FPU registers
- * which are part of the CPU context.
- */
-typedef struct {
-} fpu_context_t;
-
-#endif
-
-/** @}
- */
Index: rnel/arch/abs32le/include/interrupt.h
===================================================================
--- kernel/arch/abs32le/include/interrupt.h	(revision bca408bfd84743b83b4ee34646013041a86f2ccf)
+++ 	(revision )
@@ -1,85 +1,0 @@
-/*
- * Copyright (c) 2010 Martin Decky
- * 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 abs32leinterrupt
- * @{
- */
-/** @file
- */
-
-#ifndef KERN_abs32le_INTERRUPT_H_
-#define KERN_abs32le_INTERRUPT_H_
-
-#include <arch/types.h>
-
-#define IVT_ITEMS  0
-#define IVT_FIRST  0
-
-/*
- * On real hardware this stores the registers which
- * need to be preserved during interupts.
- */
-typedef struct istate {
-	uintptr_t ip;
-	uintptr_t fp;
-	uint32_t stack[];
-} istate_t;
-
-static inline int istate_from_uspace(istate_t *istate)
-{
-	/* On real hardware this checks whether the interrupted
-	   context originated from user space. */
-	
-	return !(istate->ip & 0x80000000);
-}
-
-static inline void istate_set_retaddr(istate_t *istate, uintptr_t retaddr)
-{
-	/* On real hardware this sets the instruction pointer. */
-	
-	istate->ip = retaddr;
-}
-
-static inline unative_t istate_get_pc(istate_t *istate)
-{
-	/* On real hardware this returns the instruction pointer. */
-	
-	return istate->ip;
-}
-
-static inline unative_t istate_get_fp(istate_t *istate)
-{
-	/* On real hardware this returns the frame pointer. */
-	
-	return istate->fp;
-}
-
-#endif
-
-/** @}
- */
Index: rnel/arch/abs32le/include/memstr.h
===================================================================
--- kernel/arch/abs32le/include/memstr.h	(revision bca408bfd84743b83b4ee34646013041a86f2ccf)
+++ 	(revision )
@@ -1,48 +1,0 @@
-/*
- * Copyright (c) 2010 Martin Decky
- * 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 abs32le
- * @{
- */
-/** @file
- */
-
-#ifndef KERN_abs32le_MEMSTR_H_
-#define KERN_abs32le_MEMSTR_H_
-
-#define memcpy(dst, src, cnt)  __builtin_memcpy((dst), (src), (cnt))
-
-extern void memsetw(void *, size_t, uint16_t);
-extern void memsetb(void *, size_t, uint8_t);
-
-extern int memcmp(const void *, const void *, size_t);
-
-#endif
-
-/** @}
- */
Index: rnel/arch/abs32le/include/mm/as.h
===================================================================
--- kernel/arch/abs32le/include/mm/as.h	(revision bca408bfd84743b83b4ee34646013041a86f2ccf)
+++ 	(revision )
@@ -1,64 +1,0 @@
-/*
- * Copyright (c) 2010 Martin Decky
- * 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 abs32lemm
- * @{
- */
-/** @file
- */
-
-#ifndef KERN_abs32le_AS_H_
-#define KERN_abs32le_AS_H_
-
-#define KERNEL_ADDRESS_SPACE_SHADOWED_ARCH  0
-
-#define KERNEL_ADDRESS_SPACE_START_ARCH  ((unsigned long) 0x80000000)
-#define KERNEL_ADDRESS_SPACE_END_ARCH    ((unsigned long) 0xffffffff)
-#define USER_ADDRESS_SPACE_START_ARCH    ((unsigned long) 0x00000000)
-#define USER_ADDRESS_SPACE_END_ARCH      ((unsigned long) 0x7fffffff)
-
-#define USTACK_ADDRESS_ARCH  (USER_ADDRESS_SPACE_END_ARCH - (PAGE_SIZE - 1))
-
-typedef struct {
-} as_arch_t;
-
-#include <genarch/mm/as_pt.h>
-
-#define as_constructor_arch(as, flags)  (as != as)
-#define as_destructor_arch(as)          (as != as)
-#define as_create_arch(as, flags)       (as != as)
-#define as_install_arch(as)
-#define as_deinstall_arch(as)
-#define as_invalidate_translation_cache(as, page, cnt)
-
-extern void as_arch_init(void);
-
-#endif
-
-/** @}
- */
Index: rnel/arch/abs32le/include/mm/asid.h
===================================================================
--- kernel/arch/abs32le/include/mm/asid.h	(revision bca408bfd84743b83b4ee34646013041a86f2ccf)
+++ 	(revision )
@@ -1,48 +1,0 @@
-/*
- * Copyright (c) 2010 Martin Decky
- * 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 abc32lemm
- * @{
- */
-
-#ifndef KERN_abs32le_ASID_H_
-#define KERN_abs32le_ASID_H_
-
-#include <arch/types.h>
-
-typedef uint32_t asid_t;
-
-#define ASID_MAX_ARCH  3
-
-#define asid_get()      (ASID_START + 1)
-#define asid_put(asid)
-
-#endif
-
-/** @}
- */
Index: rnel/arch/abs32le/include/mm/frame.h
===================================================================
--- kernel/arch/abs32le/include/mm/frame.h	(revision bca408bfd84743b83b4ee34646013041a86f2ccf)
+++ 	(revision )
@@ -1,55 +1,0 @@
-/*
- * Copyright (c) 2010 Martin Decky
- * 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 abs32lemm
- * @{
- */
-/** @file
- */
-
-#ifndef KERN_abs32le_FRAME_H_
-#define KERN_abs32le_FRAME_H_
-
-#define FRAME_WIDTH  12  /* 4K */
-#define FRAME_SIZE   (1 << FRAME_WIDTH)
-
-#ifdef KERNEL
-#ifndef __ASM__
-
-#include <arch/types.h>
-
-extern void frame_arch_init(void);
-extern void physmem_print(void);
-
-#endif /* __ASM__ */
-#endif /* KERNEL */
-
-#endif
-
-/** @}
- */
Index: rnel/arch/abs32le/include/mm/page.h
===================================================================
--- kernel/arch/abs32le/include/mm/page.h	(revision bca408bfd84743b83b4ee34646013041a86f2ccf)
+++ 	(revision )
@@ -1,203 +1,0 @@
-/*
- * Copyright (c) 2010 Martin Decky
- * 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 abs32lemm
- * @{
- */
-/** @file
- */
-
-#ifndef KERN_abs32le_PAGE_H_
-#define KERN_abs32le_PAGE_H_
-
-#include <arch/mm/frame.h>
-
-#define PAGE_WIDTH  FRAME_WIDTH
-#define PAGE_SIZE   FRAME_SIZE
-
-#ifdef KERNEL
-
-#ifndef __ASM__
-	#define KA2PA(x)  (((uintptr_t) (x)) - 0x80000000)
-	#define PA2KA(x)  (((uintptr_t) (x)) + 0x80000000)
-#else
-	#define KA2PA(x)  ((x) - 0x80000000)
-	#define PA2KA(x)  ((x) + 0x80000000)
-#endif
-
-/*
- * This is an example of 2-level page tables (PTL1 and PTL2 are left out)
- * on top of the generic 4-level page table interface.
- */
-
-/* Number of entries in each level. */
-#define PTL0_ENTRIES_ARCH  1024
-#define PTL1_ENTRIES_ARCH  0
-#define PTL2_ENTRIES_ARCH  0
-#define PTL3_ENTRIES_ARCH  1024
-
-/* Page table sizes for each level. */
-#define PTL0_SIZE_ARCH  ONE_FRAME
-#define PTL1_SIZE_ARCH  0
-#define PTL2_SIZE_ARCH  0
-#define PTL3_SIZE_ARCH  ONE_FRAME
-
-/* Macros calculating indices for each level. */
-#define PTL0_INDEX_ARCH(vaddr)  (((vaddr) >> 22) & 0x3ff)
-#define PTL1_INDEX_ARCH(vaddr)  0
-#define PTL2_INDEX_ARCH(vaddr)  0
-#define PTL3_INDEX_ARCH(vaddr)  (((vaddr) >> 12) & 0x3ff)
-
-/* Get PTE address accessors for each level. */
-#define GET_PTL1_ADDRESS_ARCH(ptl0, i) \
-	((pte_t *) ((((pte_t *) (ptl0))[(i)].frame_address) << 12))
-#define GET_PTL2_ADDRESS_ARCH(ptl1, i) \
-	(ptl1)
-#define GET_PTL3_ADDRESS_ARCH(ptl2, i) \
-	(ptl2)
-#define GET_FRAME_ADDRESS_ARCH(ptl3, i) \
-	((uintptr_t) ((((pte_t *) (ptl3))[(i)].frame_address) << 12))
-
-/* Set PTE address accessors for each level. */
-#define SET_PTL0_ADDRESS_ARCH(ptl0)
-#define SET_PTL1_ADDRESS_ARCH(ptl0, i, a) \
-	(((pte_t *) (ptl0))[(i)].frame_address = (a) >> 12)
-#define SET_PTL2_ADDRESS_ARCH(ptl1, i, a)
-#define SET_PTL3_ADDRESS_ARCH(ptl2, i, a)
-#define SET_FRAME_ADDRESS_ARCH(ptl3, i, a) \
-	(((pte_t *) (ptl3))[(i)].frame_address = (a) >> 12)
-
-/* Get PTE flags accessors for each level. */
-#define GET_PTL1_FLAGS_ARCH(ptl0, i) \
-	get_pt_flags((pte_t *) (ptl0), (size_t) (i))
-#define GET_PTL2_FLAGS_ARCH(ptl1, i) \
-	PAGE_PRESENT
-#define GET_PTL3_FLAGS_ARCH(ptl2, i) \
-	PAGE_PRESENT
-#define GET_FRAME_FLAGS_ARCH(ptl3, i) \
-	get_pt_flags((pte_t *) (ptl3), (size_t) (i))
-
-/* Set PTE flags accessors for each level. */
-#define SET_PTL1_FLAGS_ARCH(ptl0, i, x)	\
-	set_pt_flags((pte_t *) (ptl0), (size_t) (i), (x))
-#define SET_PTL2_FLAGS_ARCH(ptl1, i, x)
-#define SET_PTL3_FLAGS_ARCH(ptl2, i, x)
-#define SET_FRAME_FLAGS_ARCH(ptl3, i, x) \
-	set_pt_flags((pte_t *) (ptl3), (size_t) (i), (x))
-
-/* Macros for querying the last level entries. */
-#define PTE_VALID_ARCH(p) \
-	(*((uint32_t *) (p)) != 0)
-#define PTE_PRESENT_ARCH(p) \
-	((p)->present != 0)
-#define PTE_GET_FRAME_ARCH(p) \
-	((p)->frame_address << FRAME_WIDTH)
-#define PTE_WRITABLE_ARCH(p) \
-	((p)->writeable != 0)
-#define PTE_EXECUTABLE_ARCH(p)  1
-
-#ifndef __ASM__
-
-#include <mm/mm.h>
-#include <arch/interrupt.h>
-#include <arch/types.h>
-#include <typedefs.h>
-
-/* Page fault error codes. */
-
-/** When bit on this position is 0, the page fault was caused by a not-present
- * page.
- */
-#define PFERR_CODE_P		(1 << 0)
-
-/** When bit on this position is 1, the page fault was caused by a write. */
-#define PFERR_CODE_RW		(1 << 1)
-
-/** When bit on this position is 1, the page fault was caused in user mode. */
-#define PFERR_CODE_US		(1 << 2)
-
-/** When bit on this position is 1, a reserved bit was set in page directory. */ 
-#define PFERR_CODE_RSVD		(1 << 3)	
-
-/** Page Table Entry. */
-typedef struct {
-	unsigned present : 1;
-	unsigned writeable : 1;
-	unsigned uaccessible : 1;
-	unsigned page_write_through : 1;
-	unsigned page_cache_disable : 1;
-	unsigned accessed : 1;
-	unsigned dirty : 1;
-	unsigned pat : 1;
-	unsigned global : 1;
-	unsigned soft_valid : 1;	/**< Valid content even if the present bit is not set. */
-	unsigned avl : 2;
-	unsigned frame_address : 20;
-} __attribute__ ((packed)) pte_t;
-
-static inline unsigned int get_pt_flags(pte_t *pt, size_t i)
-{
-	pte_t *p = &pt[i];
-	
-	return ((!p->page_cache_disable) << PAGE_CACHEABLE_SHIFT |
-	    (!p->present) << PAGE_PRESENT_SHIFT |
-	    p->uaccessible << PAGE_USER_SHIFT |
-	    1 << PAGE_READ_SHIFT |
-	    p->writeable << PAGE_WRITE_SHIFT |
-	    1 << PAGE_EXEC_SHIFT |
-	    p->global << PAGE_GLOBAL_SHIFT);
-}
-
-static inline void set_pt_flags(pte_t *pt, size_t i, int flags)
-{
-	pte_t *p = &pt[i];
-	
-	p->page_cache_disable = !(flags & PAGE_CACHEABLE);
-	p->present = !(flags & PAGE_NOT_PRESENT);
-	p->uaccessible = (flags & PAGE_USER) != 0;
-	p->writeable = (flags & PAGE_WRITE) != 0;
-	p->global = (flags & PAGE_GLOBAL) != 0;
-	
-	/*
-	 * Ensure that there is at least one bit set even if the present bit is
-	 * cleared.
-	 */
-	p->soft_valid = true;
-}
-
-extern void page_arch_init(void);
-extern void page_fault(int n, istate_t *istate);
-
-#endif /* __ASM__ */
-
-#endif /* KERNEL */
-
-#endif
-
-/** @}
- */
Index: rnel/arch/abs32le/include/mm/tlb.h
===================================================================
--- kernel/arch/abs32le/include/mm/tlb.h	(revision bca408bfd84743b83b4ee34646013041a86f2ccf)
+++ 	(revision )
@@ -1,41 +1,0 @@
-/*
- * Copyright (c) 2010 Martin Decky
- * 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 abs32lemm
- * @{
- */
-/** @file
- */
-
-#ifndef KERN_abs32le_TLB_H_
-#define KERN_abs32le_TLB_H_
-
-#endif
-
-/** @}
- */
Index: rnel/arch/abs32le/include/proc/task.h
===================================================================
--- kernel/arch/abs32le/include/proc/task.h	(revision bca408bfd84743b83b4ee34646013041a86f2ccf)
+++ 	(revision )
@@ -1,51 +1,0 @@
-/*
- * Copyright (c) 2010 Martin Decky
- * 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 abs32leproc
- * @{
- */
-/** @file
- */
-
-#ifndef KERN_abs32le_TASK_H_
-#define KERN_abs32le_TASK_H_
-
-#include <arch/types.h>
-#include <adt/bitmap.h>
-
-/*
- * On real hardware this structure stores task information
- * specific to the architecture.
- */
-typedef struct {
-} task_arch_t;
-
-#endif
-
-/** @}
- */
Index: rnel/arch/abs32le/include/proc/thread.h
===================================================================
--- kernel/arch/abs32le/include/proc/thread.h	(revision bca408bfd84743b83b4ee34646013041a86f2ccf)
+++ 	(revision )
@@ -1,49 +1,0 @@
-/*
- * Copyright (c) 2010 Martin Decky
- * 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 abs32leproc
- * @{
- */
-/** @file
- */
-
-#ifndef KERN_abs32le_THREAD_H_
-#define KERN_abs32le_THREAD_H_
-
-#include <arch/types.h>
-
-typedef struct {
-} thread_arch_t;
-
-#define thr_constructor_arch(thr)
-#define thr_destructor_arch(thr)
-
-#endif
-
-/** @}
- */
Index: rnel/arch/abs32le/include/types.h
===================================================================
--- kernel/arch/abs32le/include/types.h	(revision bca408bfd84743b83b4ee34646013041a86f2ccf)
+++ 	(revision )
@@ -1,85 +1,0 @@
-/*
- * Copyright (c) 2010 Martin Decky
- * 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 abs32le
- * @{
- */
-/** @file
- */
-
-#ifndef KERN_abs32le_TYPES_H_
-#define KERN_abs32le_TYPES_H_
-
-typedef signed char int8_t;
-typedef signed short int16_t;
-typedef signed long int32_t;
-typedef signed long long int64_t;
-
-typedef unsigned char uint8_t;
-typedef unsigned short uint16_t;
-typedef unsigned long uint32_t;
-typedef unsigned long long uint64_t;
-
-typedef uint32_t size_t;
-
-typedef uint32_t uintptr_t;
-typedef uint32_t pfn_t;
-
-typedef uint32_t ipl_t;
-
-typedef uint32_t unative_t;
-typedef int32_t native_t;
-
-typedef struct {
-} fncptr_t;
-
-#define PRIp  "x"  /**< Format for uintptr_t. */
-#define PRIs  "u"  /**< Format for size_t. */
-
-#define PRId8   "d"    /**< Format for int8_t. */
-#define PRId16  "d"    /**< Format for int16_t. */
-#define PRId32  "d"    /**< Format for int32_t. */
-#define PRId64  "lld"  /**< Format for int64_t. */
-#define PRIdn   "d"    /**< Format for native_t. */
-
-#define PRIu8   "u"    /**< Format for uint8_t. */
-#define PRIu16  "u"    /**< Format for uint16_t. */
-#define PRIu32  "u"    /**< Format for uint32_t. */
-#define PRIu64  "llu"  /**< Format for uint64_t. */
-#define PRIun   "u"    /**< Format for unative_t. */
-
-#define PRIx8   "x"    /**< Format for hexadecimal (u)int8_t. */
-#define PRIx16  "x"    /**< Format for hexadecimal (u)int16_t. */
-#define PRIx32  "x"    /**< Format for hexadecimal (u)uint32_t. */
-#define PRIx64  "llx"  /**< Format for hexadecimal (u)int64_t. */
-#define PRIxn   "x"    /**< Format for hexadecimal (u)native_t. */
-
-#endif
-
-/** @}
- */
Index: rnel/arch/abs32le/src/abs32le.c
===================================================================
--- kernel/arch/abs32le/src/abs32le.c	(revision bca408bfd84743b83b4ee34646013041a86f2ccf)
+++ 	(revision )
@@ -1,105 +1,0 @@
-/*
- * Copyright (c) 2010 Martin Decky
- * 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 abs32le
- * @{
- */
-/** @file
- */
-
-#include <arch.h>
-#include <arch/types.h>
-#include <arch/context.h>
-#include <arch/interrupt.h>
-#include <arch/asm.h>
-
-#include <config.h>
-#include <interrupt.h>
-#include <ddi/irq.h>
-#include <proc/thread.h>
-#include <syscall/syscall.h>
-#include <console/console.h>
-#include <sysinfo/sysinfo.h>
-#include <memstr.h>
-
-void arch_pre_mm_init(void)
-{
-}
-
-void arch_post_mm_init(void)
-{
-	if (config.cpu_active == 1) {
-		/* Initialize IRQ routing */
-		irq_init(0, 0);
-		
-		/* Merge all memory zones to 1 big zone */
-		zone_merge_all();
-	}
-}
-
-void arch_post_cpu_init()
-{
-}
-
-void arch_pre_smp_init(void)
-{
-}
-
-void arch_post_smp_init(void)
-{
-}
-
-void calibrate_delay_loop(void)
-{
-}
-
-unative_t sys_tls_set(unative_t addr)
-{
-	return 0;
-}
-
-/** Construct function pointer
- *
- * @param fptr   function pointer structure
- * @param addr   function address
- * @param caller calling function address
- *
- * @return address of the function pointer
- *
- */
-void *arch_construct_function(fncptr_t *fptr, void *addr, void *caller)
-{
-	return addr;
-}
-
-void arch_reboot(void)
-{
-}
-
-/** @}
- */
Index: rnel/arch/abs32le/src/cpu/cpu.c
===================================================================
--- kernel/arch/abs32le/src/cpu/cpu.c	(revision bca408bfd84743b83b4ee34646013041a86f2ccf)
+++ 	(revision )
@@ -1,63 +1,0 @@
-/*
- * Copyright (c) 2010 Martin Decky
- * 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 abs32le
- * @{
- */
-/** @file
- */
-
-#include <arch/cpu.h>
-#include <arch.h>
-#include <arch/types.h>
-#include <print.h>
-#include <fpu_context.h>
-
-
-void fpu_disable(void)
-{
-}
-
-void fpu_enable(void)
-{
-}
-
-void cpu_arch_init(void)
-{
-}
-
-void cpu_identify(void)
-{
-}
-
-void cpu_print_report(cpu_t* cpu)
-{
-}
-
-/** @}
- */
Index: rnel/arch/abs32le/src/debug/stacktrace.c
===================================================================
--- kernel/arch/abs32le/src/debug/stacktrace.c	(revision bca408bfd84743b83b4ee34646013041a86f2ccf)
+++ 	(revision )
@@ -1,80 +1,0 @@
-/*
- * Copyright (c) 2010 Jakub Jermar
- * 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 ia32
- * @{
- */
-/** @file
- */
-
-#include <stacktrace.h>
-#include <syscall/copy.h>
-#include <arch/types.h>
-#include <typedefs.h>
-
-#define FRAME_OFFSET_FP_PREV	0
-#define FRAME_OFFSET_RA		1
-
-bool kernel_frame_pointer_validate(uintptr_t fp)
-{
-	return fp != 0;
-}
-
-bool kernel_frame_pointer_prev(uintptr_t fp, uintptr_t *prev)
-{
-	uint32_t *stack = (void *) fp;
-	*prev = stack[FRAME_OFFSET_FP_PREV];
-	return true;
-}
-
-bool kernel_return_address_get(uintptr_t fp, uintptr_t *ra)
-{
-	uint32_t *stack = (void *) fp;
-	*ra = stack[FRAME_OFFSET_RA];
-	return true;
-}
-
-bool uspace_frame_pointer_validate(uintptr_t fp)
-{
-	return fp != 0;
-}
-
-bool uspace_frame_pointer_prev(uintptr_t fp, uintptr_t *prev)
-{
-	return !copy_from_uspace((void *) prev,
-	    (uint32_t *) fp + FRAME_OFFSET_FP_PREV, sizeof(*prev));
-}
-
-bool uspace_return_address_get(uintptr_t fp, uintptr_t *ra)
-{
-	return !copy_from_uspace((void *) ra, (uint32_t *) fp + FRAME_OFFSET_RA,
-	    sizeof(*ra));
-}
-
-/** @}
- */
Index: rnel/arch/abs32le/src/mm/as.c
===================================================================
--- kernel/arch/abs32le/src/mm/as.c	(revision bca408bfd84743b83b4ee34646013041a86f2ccf)
+++ 	(revision )
@@ -1,43 +1,0 @@
-/*
- * Copyright (c) 2010 Martin Decky
- * 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 abs32lemm
- * @{
- */
-
-#include <mm/as.h>
-#include <arch/mm/as.h>
-#include <genarch/mm/page_pt.h>
-
-void as_arch_init(void)
-{
-	as_operations = &as_pt_operations;
-}
-
-/** @}
- */
Index: rnel/arch/abs32le/src/mm/frame.c
===================================================================
--- kernel/arch/abs32le/src/mm/frame.c	(revision bca408bfd84743b83b4ee34646013041a86f2ccf)
+++ 	(revision )
@@ -1,57 +1,0 @@
-/*
- * Copyright (c) 2010 Martin Decky
- * 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 abs32lemm
- * @{
- */
-
-#include <mm/frame.h>
-#include <arch/mm/frame.h>
-#include <mm/as.h>
-#include <config.h>
-#include <panic.h>
-#include <debug.h>
-#include <align.h>
-#include <macros.h>
-
-#include <print.h>
-
-size_t hardcoded_unmapped_ktext_size = 0;
-size_t hardcoded_unmapped_kdata_size = 0;
-
-void physmem_print(void)
-{
-}
-
-
-void frame_arch_init(void)
-{
-}
-
-/** @}
- */
Index: rnel/arch/abs32le/src/mm/page.c
===================================================================
--- kernel/arch/abs32le/src/mm/page.c	(revision bca408bfd84743b83b4ee34646013041a86f2ccf)
+++ 	(revision )
@@ -1,69 +1,0 @@
-/*
- * Copyright (c) 2010 Martin Decky
- * 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 abs32lemm
- * @{
- */
-/** @file
- */
-
-#include <arch/mm/page.h>
-#include <genarch/mm/page_pt.h>
-#include <arch/mm/frame.h>
-#include <mm/frame.h>
-#include <mm/page.h>
-#include <mm/as.h>
-#include <arch/types.h>
-#include <align.h>
-#include <config.h>
-#include <func.h>
-#include <arch/interrupt.h>
-#include <arch/asm.h>
-#include <debug.h>
-#include <memstr.h>
-#include <print.h>
-#include <interrupt.h>
-
-void page_arch_init(void)
-{
-	if (config.cpu_active == 1)
-		page_mapping_operations = &pt_mapping_operations;
-}
-
-
-uintptr_t hw_map(uintptr_t physaddr, size_t size)
-{
-	return physaddr;
-}
-
-void page_fault(int n __attribute__((unused)), istate_t *istate)
-{
-}
-
-/** @}
- */
Index: rnel/arch/abs32le/src/mm/tlb.c
===================================================================
--- kernel/arch/abs32le/src/mm/tlb.c	(revision bca408bfd84743b83b4ee34646013041a86f2ccf)
+++ 	(revision )
@@ -1,61 +1,0 @@
-/*
- * Copyright (c) 2010 Martin Decky
- * 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 abs32lemm
- * @{
- */
-
-#include <mm/tlb.h>
-#include <arch/mm/asid.h>
-#include <arch/asm.h>
-#include <arch/types.h>
-
-void tlb_invalidate_all(void)
-{
-}
-
-void tlb_invalidate_asid(asid_t asid __attribute__((unused)))
-{
-	tlb_invalidate_all();
-}
-
-void tlb_invalidate_pages(asid_t asid __attribute__((unused)), uintptr_t page, size_t cnt)
-{
-	tlb_invalidate_all();
-}
-
-void tlb_arch_init(void)
-{
-}
-
-void tlb_print(void)
-{
-}
-
-/** @}
- */
Index: rnel/arch/abs32le/src/proc/scheduler.c
===================================================================
--- kernel/arch/abs32le/src/proc/scheduler.c	(revision bca408bfd84743b83b4ee34646013041a86f2ccf)
+++ 	(revision )
@@ -1,50 +1,0 @@
-/*
- * Copyright (c) 2010 Martin Decky
- * 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 abs32leproc
- * @{
- */
-/** @file
- */
-
-#include <proc/scheduler.h>
-
-void before_task_runs_arch(void)
-{
-}
-
-void before_thread_runs_arch(void)
-{
-}
-
-void after_thread_ran_arch(void)
-{
-}
-
-/** @}
- */
Index: rnel/arch/abs32le/src/proc/task.c
===================================================================
--- kernel/arch/abs32le/src/proc/task.c	(revision bca408bfd84743b83b4ee34646013041a86f2ccf)
+++ 	(revision )
@@ -1,46 +1,0 @@
-/*
- * Copyright (c) 2010 Martin Decky
- * 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 abs32leproc
- * @{
- */
-/** @file
- */
-
-#include <proc/task.h>
-
-void task_create_arch(task_t *t)
-{
-}
-
-void task_destroy_arch(task_t *t)
-{
-}
-
-/** @}
- */
Index: rnel/arch/abs32le/src/proc/thread.c
===================================================================
--- kernel/arch/abs32le/src/proc/thread.c	(revision bca408bfd84743b83b4ee34646013041a86f2ccf)
+++ 	(revision )
@@ -1,42 +1,0 @@
-/*
- * Copyright (c) 2010 Martin Decky
- * 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 abs32leproc
- * @{
- */
-/** @file
- */
-
-#include <proc/thread.h>
-
-void thread_create_arch(thread_t *t)
-{
-}
-
-/** @}
- */
Index: rnel/arch/abs32le/src/userspace.c
===================================================================
--- kernel/arch/abs32le/src/userspace.c	(revision bca408bfd84743b83b4ee34646013041a86f2ccf)
+++ 	(revision )
@@ -1,51 +1,0 @@
-/*
- * Copyright (c) 2010 Martin Decky
- * 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 abs32le
- * @{
- */
-/** @file
- */
-
-#include <userspace.h>
-#include <arch/types.h>
-#include <arch.h>
-#include <proc/uarg.h>
-#include <mm/as.h>
-
-
-void userspace(uspace_arg_t *kernel_uarg)
-{
-	/* On real hardware this switches the CPU to user
-	   space mode and jumps to kernel_uarg->uspace_entry. */
-	
-	while (true);
-}
-
-/** @}
- */
Index: kernel/generic/include/interrupt.h
===================================================================
--- kernel/generic/include/interrupt.h	(revision bca408bfd84743b83b4ee34646013041a86f2ccf)
+++ kernel/generic/include/interrupt.h	(revision 1715b6af7847ebb95ae42eba99295f3291f1d1b5)
@@ -46,5 +46,17 @@
 typedef void (* iroutine)(int n, istate_t *istate);
 
-extern void fault_if_from_uspace(istate_t *istate, char *fmt, ...);
+#define fault_if_from_uspace(istate, fmt, ...) \
+{ \
+	if (istate_from_uspace(istate)) { \
+		task_t *task = TASK; \
+		printf("Task %s (%" PRIu64 ") killed due to an exception at " \
+		    "program counter %p.\n", task->name, task->taskid, istate_get_pc(istate)); \
+		stack_trace_istate(istate); \
+		printf("Kill message: " fmt "\n", ##__VA_ARGS__); \
+		task_kill(task->taskid); \
+		thread_exit(); \
+	} \
+}
+
 extern iroutine exc_register(int n, const char *name, iroutine f);
 extern void exc_dispatch(int n, istate_t *t);
Index: kernel/generic/include/ipc/event_types.h
===================================================================
--- kernel/generic/include/ipc/event_types.h	(revision bca408bfd84743b83b4ee34646013041a86f2ccf)
+++ kernel/generic/include/ipc/event_types.h	(revision 1715b6af7847ebb95ae42eba99295f3291f1d1b5)
@@ -37,10 +37,6 @@
 
 typedef enum event_type {
-	/** New data available in kernel log */
 	EVENT_KLOG = 0,
-	/** Returning from kernel console to userspace */
 	EVENT_KCONSOLE,
-	/** A thread has faulted and will be terminated */
-	EVENT_FAULT,
 	EVENT_END
 } event_type_t;
Index: kernel/generic/include/mm/as.h
===================================================================
--- kernel/generic/include/mm/as.h	(revision bca408bfd84743b83b4ee34646013041a86f2ccf)
+++ kernel/generic/include/mm/as.h	(revision 1715b6af7847ebb95ae42eba99295f3291f1d1b5)
@@ -36,10 +36,4 @@
 #define KERN_AS_H_
 
-#ifdef KERNEL
-#include <arch/types.h>
-#else
-#include <sys/types.h>
-#endif
-
 /** Address space area flags. */
 #define AS_AREA_READ		1
@@ -47,16 +41,4 @@
 #define AS_AREA_EXEC		4
 #define AS_AREA_CACHEABLE	8
-
-/** Address space area info exported to userspace. */
-typedef struct {
-	/** Starting address */
-	uintptr_t start_addr;
-
-	/** Area size */
-	size_t size;
-
-	/** Area flags */
-	int flags;
-} as_area_info_t;
 
 #ifdef KERNEL
@@ -286,5 +268,4 @@
 
 /* Introspection functions. */
-extern void as_get_area_info(as_t *as, as_area_info_t **obuf, size_t *osize);
 extern void as_print(as_t *as);
 
Index: kernel/generic/include/udebug/udebug.h
===================================================================
--- kernel/generic/include/udebug/udebug.h	(revision bca408bfd84743b83b4ee34646013041a86f2ccf)
+++ kernel/generic/include/udebug/udebug.h	(revision 1715b6af7847ebb95ae42eba99295f3291f1d1b5)
@@ -27,5 +27,5 @@
  */
 
-/** @addtogroup generic
+/** @addtogroup generic	
  * @{
  */
@@ -83,15 +83,4 @@
 UDEBUG_M_ARGS_READ,
 
-/** Read thread's userspace register state (istate_t).
- *
- * - ARG2 - thread identification
- * - ARG3 - destination address in the caller's address space
- *
- * or, on error, retval will be
- * - ENOENT - thread does not exist
- * - EBUSY - register state not available
- */
-UDEBUG_M_REGS_READ,
-
 /** Read the list of the debugged tasks's threads.
  *
@@ -107,31 +96,4 @@
  */
 UDEBUG_M_THREAD_READ,
-
-/** Read the name of the debugged task.
- *
- * - ARG2 - destination address in the caller's address space
- * - ARG3 - size of receiving buffer in bytes
- *
- * The kernel fills the buffer with a non-terminated string.
- *
- * - ARG2 - number of bytes that were actually copied
- * - ARG3 - number of bytes of the complete data
- *
- */
-UDEBUG_M_NAME_READ,
-
-/** Read the list of the debugged task's address space areas.
- *
- * - ARG2 - destination address in the caller's address space
- * - ARG3 - size of receiving buffer in bytes
- *
- * The kernel fills the buffer with a series of as_area_info_t structures.
- * Upon answer, the kernel will set:
- *
- * - ARG2 - number of bytes that were actually copied
- * - ARG3 - number of bytes of the complete data
- *
- */
-UDEBUG_M_AREAS_READ,
 
 /** Read the debugged tasks's memory.
@@ -146,5 +108,5 @@
 } udebug_method_t;
 
-
+				
 typedef enum {
 	UDEBUG_EVENT_FINISHED = 1,	/**< Debuging session has finished */
@@ -177,5 +139,4 @@
 
 #include <synch/mutex.h>
-#include <synch/condvar.h>
 #include <arch/interrupt.h>
 #include <atomic.h>
@@ -220,5 +181,4 @@
 	bool stoppable;		/**< thread is stoppable */
 	bool active;		/**< thread is in a debugging session */
-	condvar_t active_cv;
 } udebug_thread_t;
 
@@ -242,5 +202,4 @@
 
 int udebug_task_cleanup(struct task *ta);
-void udebug_thread_fault(void);
 
 #endif
Index: kernel/generic/include/udebug/udebug_ops.h
===================================================================
--- kernel/generic/include/udebug/udebug_ops.h	(revision bca408bfd84743b83b4ee34646013041a86f2ccf)
+++ kernel/generic/include/udebug/udebug_ops.h	(revision 1715b6af7847ebb95ae42eba99295f3291f1d1b5)
@@ -45,10 +45,6 @@
 int udebug_stop(thread_t *t, call_t *call);
 
-int udebug_thread_read(void **buffer, size_t buf_size, size_t *stored,
-    size_t *needed);
-int udebug_name_read(char **data, size_t *data_size);
+int udebug_thread_read(void **buffer, size_t buf_size, size_t *n);
 int udebug_args_read(thread_t *t, void **buffer);
-
-int udebug_regs_read(thread_t *t, void **buffer);
 
 int udebug_mem_read(unative_t uspace_addr, size_t n, void **buffer);
Index: kernel/generic/src/interrupt/interrupt.c
===================================================================
--- kernel/generic/src/interrupt/interrupt.c	(revision bca408bfd84743b83b4ee34646013041a86f2ccf)
+++ kernel/generic/src/interrupt/interrupt.c	(revision 1715b6af7847ebb95ae42eba99295f3291f1d1b5)
@@ -44,8 +44,4 @@
 #include <console/console.h>
 #include <console/cmd.h>
-#include <ipc/event.h>
-#include <synch/mutex.h>
-#include <time/delay.h>
-#include <macros.h>
 #include <panic.h>
 #include <print.h>
@@ -111,46 +107,4 @@
 	fault_if_from_uspace(istate, "Unhandled exception %d.", n);
 	panic("Unhandled exception %d.", n);
-}
-
-/** Terminate thread and task if exception came from userspace. */
-void fault_if_from_uspace(istate_t *istate, char *fmt, ...)
-{
-	task_t *task = TASK;
-	va_list args;
-
-	if (!istate_from_uspace(istate))
-		return;
-
-	printf("Task %s (%" PRIu64 ") killed due to an exception at "
-	    "program counter %p.\n", task->name, task->taskid,
-	    istate_get_pc(istate));
-
-	stack_trace_istate(istate);
-
-	printf("Kill message: ");
-	va_start(args, fmt);
-	vprintf(fmt, args);
-	va_end(args);
-	printf("\n");
-
-	/*
-	 * Userspace can subscribe for FAULT events to take action
-	 * whenever a thread faults. (E.g. take a dump, run a debugger).
-	 * The notification is always available, but unless Udebug is enabled,
-	 * that's all you get.
-	 */
-	if (event_is_subscribed(EVENT_FAULT)) {
-		/* Notify the subscriber that a fault occurred. */
-		event_notify_3(EVENT_FAULT, LOWER32(TASK->taskid),
-		    UPPER32(TASK->taskid), (unative_t) THREAD);
-
-#ifdef CONFIG_UDEBUG
-		/* Wait for a debugging session. */
-		udebug_thread_fault();
-#endif
-	}
-
-	task_kill(task->taskid);
-	thread_exit();
 }
 
Index: kernel/generic/src/mm/as.c
===================================================================
--- kernel/generic/src/mm/as.c	(revision bca408bfd84743b83b4ee34646013041a86f2ccf)
+++ kernel/generic/src/mm/as.c	(revision 1715b6af7847ebb95ae42eba99295f3291f1d1b5)
@@ -1920,70 +1920,4 @@
 }
 
-/** Get list of adress space areas.
- *
- * @param as		Address space.
- * @param obuf		Place to save pointer to returned buffer.
- * @param osize		Place to save size of returned buffer.
- */
-void as_get_area_info(as_t *as, as_area_info_t **obuf, size_t *osize)
-{
-	ipl_t ipl;
-	size_t area_cnt, area_idx, i;
-	link_t *cur;
-
-	as_area_info_t *info;
-	size_t isize;
-
-	ipl = interrupts_disable();
-	mutex_lock(&as->lock);
-
-	/* First pass, count number of areas. */
-
-	area_cnt = 0;
-
-	for (cur = as->as_area_btree.leaf_head.next;
-	    cur != &as->as_area_btree.leaf_head; cur = cur->next) {
-		btree_node_t *node;
-
-		node = list_get_instance(cur, btree_node_t, leaf_link);
-		area_cnt += node->keys;
-	}
-
-        isize = area_cnt * sizeof(as_area_info_t);
-	info = malloc(isize, 0);
-
-	/* Second pass, record data. */
-
-	area_idx = 0;
-
-	for (cur = as->as_area_btree.leaf_head.next;
-	    cur != &as->as_area_btree.leaf_head; cur = cur->next) {
-		btree_node_t *node;
-
-		node = list_get_instance(cur, btree_node_t, leaf_link);
-
-		for (i = 0; i < node->keys; i++) {
-			as_area_t *area = node->value[i];
-
-			ASSERT(area_idx < area_cnt);
-			mutex_lock(&area->lock);
-
-			info[area_idx].start_addr = area->base;
-			info[area_idx].size = FRAMES2SIZE(area->pages);
-			info[area_idx].flags = area->flags;
-			++area_idx;
-
-			mutex_unlock(&area->lock);
-		}
-	}
-
-	mutex_unlock(&as->lock);
-	interrupts_restore(ipl);
-
-	*obuf = info;
-	*osize = isize;
-}
-
-
 /** Print out information about address space.
  *
Index: kernel/generic/src/udebug/udebug.c
===================================================================
--- kernel/generic/src/udebug/udebug.c	(revision bca408bfd84743b83b4ee34646013041a86f2ccf)
+++ kernel/generic/src/udebug/udebug.c	(revision 1715b6af7847ebb95ae42eba99295f3291f1d1b5)
@@ -69,5 +69,4 @@
 	mutex_initialize(&ut->lock, MUTEX_PASSIVE);
 	waitq_initialize(&ut->go_wq);
-	condvar_initialize(&ut->active_cv);
 
 	ut->go_call = NULL;
@@ -447,9 +446,6 @@
 				waitq_wakeup(&t->udebug.go_wq, WAKEUP_FIRST);
 			}
-			mutex_unlock(&t->udebug.lock);
-			condvar_broadcast(&t->udebug.active_cv);
-		} else {
-			mutex_unlock(&t->udebug.lock);
 		}
+		mutex_unlock(&t->udebug.lock);
 	}
 
@@ -460,29 +456,4 @@
 }
 
-/** Wait for debugger to handle a fault in this thread.
- *
- * When a thread faults and someone is subscribed to the FAULT kernel event,
- * this function is called to wait for a debugging session to give userspace
- * a chance to examine the faulting thead/task. When the debugging session
- * is over, this function returns (so that thread/task cleanup can continue).
- */
-void udebug_thread_fault(void)
-{
-	udebug_stoppable_begin();
-
-	/* Wait until a debugger attends to us. */
-	mutex_lock(&THREAD->udebug.lock);
-	while (!THREAD->udebug.active)
-		condvar_wait(&THREAD->udebug.active_cv, &THREAD->udebug.lock);
-	mutex_unlock(&THREAD->udebug.lock);
-
-	/* Make sure the debugging session is over before proceeding. */
-	mutex_lock(&THREAD->udebug.lock);
-	while (THREAD->udebug.active)
-		condvar_wait(&THREAD->udebug.active_cv, &THREAD->udebug.lock);
-	mutex_unlock(&THREAD->udebug.lock);
-
-	udebug_stoppable_end();
-}
 
 /** @}
Index: kernel/generic/src/udebug/udebug_ipc.c
===================================================================
--- kernel/generic/src/udebug/udebug_ipc.c	(revision bca408bfd84743b83b4ee34646013041a86f2ccf)
+++ kernel/generic/src/udebug/udebug_ipc.c	(revision 1715b6af7847ebb95ae42eba99295f3291f1d1b5)
@@ -41,5 +41,4 @@
 #include <proc/task.h>
 #include <proc/thread.h>
-#include <mm/as.h>
 #include <arch.h>
 #include <errno.h>
@@ -166,8 +165,10 @@
 static void udebug_receive_thread_read(call_t *call)
 {
-	uintptr_t uspace_addr;
-	size_t buf_size;
+	unative_t uspace_addr;
+	unative_t to_copy;
+	unsigned total_bytes;
+	unsigned buf_size;
 	void *buffer;
-	size_t copied, needed;
+	size_t n;
 	int rc;
 
@@ -179,5 +180,5 @@
 	 * of threads times thread-id size.
 	 */
-	rc = udebug_thread_read(&buffer, buf_size, &copied, &needed);
+	rc = udebug_thread_read(&buffer, buf_size, &n);
 	if (rc < 0) {
 		IPC_SET_RETVAL(call->data, rc);
@@ -186,46 +187,10 @@
 	}
 
-	/*
-	 * Make use of call->buffer to transfer data to caller's userspace
-	 */
-
-	IPC_SET_RETVAL(call->data, 0);
-	/* ARG1=dest, ARG2=size as in IPC_M_DATA_READ so that
-	   same code in process_answer() can be used 
-	   (no way to distinguish method in answer) */
-	IPC_SET_ARG1(call->data, uspace_addr);
-	IPC_SET_ARG2(call->data, copied);
-	IPC_SET_ARG3(call->data, needed);
-	call->buffer = buffer;
-
-	ipc_answer(&TASK->kb.box, call);
-}
-
-/** Process a NAME_READ call.
- *
- * Returns a string containing the name of the task.
- *
- * @param call	The call structure.
- */
-static void udebug_receive_name_read(call_t *call)
-{
-	unative_t uspace_addr;
-	unative_t to_copy;
-	size_t data_size;
-	size_t buf_size;
-	void *data;
-
-	uspace_addr = IPC_GET_ARG2(call->data);	/* Destination address */
-	buf_size = IPC_GET_ARG3(call->data);	/* Dest. buffer size */
-
-	/*
-	 * Read task name.
-	 */
-	udebug_name_read((char **) &data, &data_size);
-
-	/* Copy MAX(buf_size, data_size) bytes */
-
-	if (buf_size > data_size)
-		to_copy = data_size;
+	total_bytes = n;
+
+	/* Copy MAX(buf_size, total_bytes) bytes */
+
+	if (buf_size > total_bytes)
+		to_copy = total_bytes;
 	else
 		to_copy = buf_size;
@@ -242,57 +207,9 @@
 	IPC_SET_ARG2(call->data, to_copy);
 
-	IPC_SET_ARG3(call->data, data_size);
-	call->buffer = data;
-
-	ipc_answer(&TASK->kb.box, call);
-}
-
-/** Process an AREAS_READ call.
- *
- * Returns a list of address space areas in the current task, as an array
- * of as_area_info_t structures.
- *
- * @param call	The call structure.
- */
-static void udebug_receive_areas_read(call_t *call)
-{
-	unative_t uspace_addr;
-	unative_t to_copy;
-	size_t data_size;
-	size_t buf_size;
-	void *data;
-
-	uspace_addr = IPC_GET_ARG2(call->data);	/* Destination address */
-	buf_size = IPC_GET_ARG3(call->data);	/* Dest. buffer size */
-
-	/*
-	 * Read area list.
-	 */
-	as_get_area_info(AS, (as_area_info_t **) &data, &data_size);
-
-	/* Copy MAX(buf_size, data_size) bytes */
-
-	if (buf_size > data_size)
-		to_copy = data_size;
-	else
-		to_copy = buf_size;
-
-	/*
-	 * Make use of call->buffer to transfer data to caller's userspace
-	 */
-
-	IPC_SET_RETVAL(call->data, 0);
-	/* ARG1=dest, ARG2=size as in IPC_M_DATA_READ so that
-	   same code in process_answer() can be used 
-	   (no way to distinguish method in answer) */
-	IPC_SET_ARG1(call->data, uspace_addr);
-	IPC_SET_ARG2(call->data, to_copy);
-
-	IPC_SET_ARG3(call->data, data_size);
-	call->buffer = data;
-
-	ipc_answer(&TASK->kb.box, call);
-}
-
+	IPC_SET_ARG3(call->data, total_bytes);
+	call->buffer = buffer;
+
+	ipc_answer(&TASK->kb.box, call);
+}
 
 /** Process an ARGS_READ call.
@@ -333,45 +250,4 @@
 	ipc_answer(&TASK->kb.box, call);
 }
-
-/** Receive a REGS_READ call.
- *
- * Reads the thread's register state (istate structure).
- */
-static void udebug_receive_regs_read(call_t *call)
-{
-	thread_t *t;
-	unative_t uspace_addr;
-	unative_t to_copy;
-	void *buffer;
-	int rc;
-
-	t = (thread_t *) IPC_GET_ARG2(call->data);
-
-	rc = udebug_regs_read(t, &buffer);
-	if (rc < 0) {
-		IPC_SET_RETVAL(call->data, rc);
-		ipc_answer(&TASK->kb.box, call);
-		return;
-	}
-
-	/*
-	 * Make use of call->buffer to transfer data to caller's userspace
-	 */
-
-	uspace_addr = IPC_GET_ARG3(call->data);
-	to_copy = sizeof(istate_t);
-
-	IPC_SET_RETVAL(call->data, 0);
-	/* ARG1=dest, ARG2=size as in IPC_M_DATA_READ so that
-	   same code in process_answer() can be used 
-	   (no way to distinguish method in answer) */
-	IPC_SET_ARG1(call->data, uspace_addr);
-	IPC_SET_ARG2(call->data, to_copy);
-
-	call->buffer = buffer;
-
-	ipc_answer(&TASK->kb.box, call);
-}
-
 
 /** Process an MEM_READ call.
@@ -455,16 +331,7 @@
 		udebug_receive_thread_read(call);
 		break;
-	case UDEBUG_M_NAME_READ:
-		udebug_receive_name_read(call);
-		break;
-	case UDEBUG_M_AREAS_READ:
-		udebug_receive_areas_read(call);
-		break;
 	case UDEBUG_M_ARGS_READ:
 		udebug_receive_args_read(call);
 		break;
-	case UDEBUG_M_REGS_READ:
-		udebug_receive_regs_read(call);
-		break;
 	case UDEBUG_M_MEM_READ:
 		udebug_receive_mem_read(call);
Index: kernel/generic/src/udebug/udebug_ops.c
===================================================================
--- kernel/generic/src/udebug/udebug_ops.c	(revision bca408bfd84743b83b4ee34646013041a86f2ccf)
+++ kernel/generic/src/udebug/udebug_ops.c	(revision 1715b6af7847ebb95ae42eba99295f3291f1d1b5)
@@ -46,5 +46,4 @@
 #include <errno.h>
 #include <print.h>
-#include <string.h>
 #include <syscall/copy.h>
 #include <ipc/ipc.h>
@@ -210,11 +209,7 @@
 
 		mutex_lock(&t->udebug.lock);
-		if ((t->flags & THREAD_FLAG_USPACE) != 0) {
+		if ((t->flags & THREAD_FLAG_USPACE) != 0)
 			t->udebug.active = true;
-			mutex_unlock(&t->udebug.lock);
-			condvar_broadcast(&t->udebug.active_cv);
-		} else {
-			mutex_unlock(&t->udebug.lock);
-		}
+		mutex_unlock(&t->udebug.lock);
 	}
 
@@ -360,7 +355,6 @@
  *
  * If the sequence is longer than @a buf_size bytes, only as much hashes
- * as can fit are copied. The number of bytes copied is stored in @a stored.
- * The total number of thread bytes that could have been saved had there been
- * enough space is stored in @a needed.
+ * as can fit are copied. The number of thread hashes copied is stored
+ * in @a n.
  *
  * The rationale for having @a buf_size is that this function is only
@@ -370,15 +364,12 @@
  * @param buffer	The buffer for storing thread hashes.
  * @param buf_size	Buffer size in bytes.
- * @param stored	The actual number of bytes copied will be stored here.
- * @param needed	Total number of hashes that could have been saved.
- */
-int udebug_thread_read(void **buffer, size_t buf_size, size_t *stored,
-    size_t *needed)
+ * @param n		The actual number of hashes copied will be stored here.
+ */
+int udebug_thread_read(void **buffer, size_t buf_size, size_t *n)
 {
 	thread_t *t;
 	link_t *cur;
 	unative_t tid;
-	size_t copied_ids;
-	size_t extra_ids;
+	unsigned copied_ids;
 	ipl_t ipl;
 	unative_t *id_buffer;
@@ -389,5 +380,5 @@
 
 	/* Allocate a buffer to hold thread IDs */
-	id_buffer = malloc(buf_size + 1, 0);
+	id_buffer = malloc(buf_size, 0);
 
 	mutex_lock(&TASK->udebug.lock);
@@ -405,8 +396,10 @@
 	max_ids = buf_size / sizeof(unative_t);
 	copied_ids = 0;
-	extra_ids = 0;
 
 	/* FIXME: make sure the thread isn't past debug shutdown... */
 	for (cur = TASK->th_head.next; cur != &TASK->th_head; cur = cur->next) {
+		/* Do not write past end of buffer */
+		if (copied_ids >= max_ids) break;
+
 		t = list_get_instance(cur, thread_t, th_link);
 
@@ -416,13 +409,8 @@
 
 		/* Not interested in kernel threads. */
-		if ((flags & THREAD_FLAG_USPACE) == 0)
-			continue;
-
-		if (copied_ids < max_ids) {
+		if ((flags & THREAD_FLAG_USPACE) != 0) {
 			/* Using thread struct pointer as identification hash */
 			tid = (unative_t) t;
 			id_buffer[copied_ids++] = tid;
-		} else {
-			extra_ids++;
 		}
 	}
@@ -434,29 +422,5 @@
 
 	*buffer = id_buffer;
-	*stored = copied_ids * sizeof(unative_t);
-	*needed = (copied_ids + extra_ids) * sizeof(unative_t);
-
-	return 0;
-}
-
-/** Read task name.
- *
- * Returns task name as non-terminated string in a newly allocated buffer.
- * Also returns the size of the data.
- *
- * @param data		Place to store pointer to newly allocated block.
- * @param data_size	Place to store size of the data.
- *
- * @returns		EOK.
- */
-int udebug_name_read(char **data, size_t *data_size)
-{
-	size_t name_size;
-
-	name_size = str_size(TASK->name) + 1;
-	*data = malloc(name_size, 0);
-	*data_size = name_size;
-
-	memcpy(*data, TASK->name, name_size);
+	*n = copied_ids * sizeof(unative_t);
 
 	return 0;
@@ -473,8 +437,5 @@
  * this function will fail with an EINVAL error code.
  *
- * @param t		Thread where call arguments are to be read.
- * @param buffer	Place to store pointer to new buffer.
- * @return		EOK on success, ENOENT if @a t is invalid, EINVAL
- *			if thread state is not valid for this operation.
+ * @param buffer	The buffer for storing thread hashes.
  */
 int udebug_args_read(thread_t *t, void **buffer)
@@ -508,48 +469,4 @@
 }
 
-/** Read the register state of the thread.
- *
- * The contents of the thread's istate structure are copied to a newly
- * allocated buffer and a pointer to it is written to @a buffer. The size of
- * the buffer will be sizeof(istate_t).
- *
- * Currently register state cannot be read if the thread is inside a system
- * call (as opposed to an exception). This is an implementation limit.
- *
- * @param t		Thread whose state is to be read.
- * @param buffer	Place to store pointer to new buffer.
- * @return		EOK on success, ENOENT if @a t is invalid, EINVAL
- *			if thread is not in valid state, EBUSY if istate
- *			is not available.
- */
-int udebug_regs_read(thread_t *t, void **buffer)
-{
-	istate_t *state, *state_buf;
-	int rc;
-
-	/* Prepare a buffer to hold the data. */
-	state_buf = malloc(sizeof(istate_t), 0);
-
-	/* On success, this will lock t->udebug.lock */
-	rc = _thread_op_begin(t, false);
-	if (rc != EOK) {
-		return rc;
-	}
-
-	state = t->udebug.uspace_state;
-	if (state == NULL) {
-		_thread_op_end(t);
-		return EBUSY;
-	}
-
-	/* Copy to the allocated buffer */
-	memcpy(state_buf, state, sizeof(istate_t));
-
-	_thread_op_end(t);
-
-	*buffer = (void *) state_buf;
-	return 0;
-}
-
 /** Read the memory of the debugged task.
  *
Index: uspace/Makefile
===================================================================
--- uspace/Makefile	(revision bca408bfd84743b83b4ee34646013041a86f2ccf)
+++ uspace/Makefile	(revision 1715b6af7847ebb95ae42eba99295f3291f1d1b5)
@@ -40,5 +40,4 @@
 	app/mkfat \
 	app/redir \
-	app/taskdump \
 	app/tester \
 	app/tetris \
@@ -48,5 +47,4 @@
 	srv/loader \
 	srv/ns \
-	srv/taskmon \
 	srv/vfs \
 	srv/bd/ata_bd \
Index: uspace/app/init/init.c
===================================================================
--- uspace/app/init/init.c	(revision bca408bfd84743b83b4ee34646013041a86f2ccf)
+++ uspace/app/init/init.c	(revision 1715b6af7847ebb95ae42eba99295f3291f1d1b5)
@@ -233,18 +233,4 @@
 }
 
-static void mount_scratch(void)
-{
-	int rc;
-
-	printf("Trying to mount null/0 on /scratch... ");
-	fflush(stdout);
-
-	rc = mount("tmpfs", "/scratch", "null/0", "", 0);
-	if (rc == EOK)
-		printf("OK\n");
-	else
-		printf("Failed\n");
-}
-
 static void mount_data(void)
 {
@@ -269,12 +255,6 @@
 		return -1;
 	}
-
-	/* Make sure tmpfs is running. */
-	if (str_cmp(STRING(RDFMT), "tmpfs") != 0) {
-		spawn("/srv/tmpfs");
-	}
 	
 	spawn("/srv/devfs");
-	spawn("/srv/taskmon");
 	
 	if (!mount_devfs()) {
@@ -282,6 +262,4 @@
 		return -2;
 	}
-
-	mount_scratch();
 	
 	spawn("/srv/fhc");
Index: pace/app/taskdump/Makefile
===================================================================
--- uspace/app/taskdump/Makefile	(revision bca408bfd84743b83b4ee34646013041a86f2ccf)
+++ 	(revision )
@@ -1,39 +1,0 @@
-#
-# Copyright (c) 2010 Jiri Svoboda
-# 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.
-#
-
-USPACE_PREFIX = ../..
-LIBS = $(LIBC_PREFIX)/libc.a
-EXTRA_CFLAGS = -Iinclude
-
-OUTPUT = taskdump
-
-SOURCES = \
-	taskdump.c \
-	symtab.c
-
-include ../Makefile.common
Index: pace/app/taskdump/include/elf.h
===================================================================
--- uspace/app/taskdump/include/elf.h	(revision bca408bfd84743b83b4ee34646013041a86f2ccf)
+++ 	(revision )
@@ -1,344 +1,0 @@
-/*
- * Copyright (c) 2006 Sergey Bondari
- * 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 generic	
- * @{
- */
-/** @file
- */
-
-#ifndef ELF_H_
-#define ELF_H_
-
-#include <arch/elf.h>
-#include <sys/types.h>
-
-/**
- * current ELF version
- */
-#define	EV_CURRENT	1
-
-/** 
- * ELF types 
- */
-#define ET_NONE		0	/* No type */
-#define ET_REL		1	/* Relocatable file */
-#define ET_EXEC		2	/* Executable */
-#define ET_DYN		3	/* Shared object */
-#define ET_CORE		4	/* Core */
-#define ET_LOPROC	0xff00	/* Processor specific */
-#define ET_HIPROC	0xffff	/* Processor specific */
-
-/** 
- * ELF machine types
- */
-#define EM_NO		0	/* No machine */
-#define EM_SPARC	2	/* SPARC */
-#define EM_386		3	/* i386 */
-#define EM_MIPS		8	/* MIPS RS3000 */
-#define EM_MIPS_RS3_LE	10	/* MIPS RS3000 LE */
-#define EM_PPC		20	/* PPC32 */
-#define EM_PPC64	21	/* PPC64 */
-#define EM_ARM		40	/* ARM */
-#define EM_SPARCV9	43	/* SPARC64 */
-#define EM_IA_64	50	/* IA-64 */
-#define EM_X86_64	62	/* AMD64/EMT64 */
-
-/**
- * ELF identification indexes
- */
-#define EI_MAG0		0
-#define EI_MAG1		1
-#define EI_MAG2		2
-#define EI_MAG3		3
-#define EI_CLASS	4		/* File class */
-#define EI_DATA		5		/* Data encoding */
-#define EI_VERSION	6		/* File version */
-#define EI_OSABI	7
-#define EI_ABIVERSION	8
-#define EI_PAD		9		/* Start of padding bytes */
-#define EI_NIDENT	16		/* ELF identification table size */
-
-/**
- * ELF magic number
- */
-#define ELFMAG0		0x7f
-#define ELFMAG1		'E'
-#define ELFMAG2		'L'
-#define ELFMAG3		'F'
-
-/**
- * ELF file classes
- */
-#define ELFCLASSNONE	0
-#define ELFCLASS32	1
-#define ELFCLASS64	2
-
-/**
- * ELF data encoding types
- */
-#define ELFDATANONE	0
-#define ELFDATA2LSB	1		/* Least significant byte first (little endian) */
-#define ELFDATA2MSB	2		/* Most signigicant byte first (big endian) */
-
-/**
- * ELF error return codes
- */
-#define EE_OK			0	/* No error */
-#define EE_INVALID		1	/* Invalid ELF image */
-#define	EE_MEMORY		2	/* Cannot allocate address space */
-#define EE_INCOMPATIBLE		3	/* ELF image is not compatible with current architecture */
-#define EE_UNSUPPORTED		4	/* Non-supported ELF (e.g. dynamic ELFs) */
-#define EE_IRRECOVERABLE	5
-
-/**
- * ELF section types
- */
-#define SHT_NULL		0
-#define SHT_PROGBITS		1
-#define SHT_SYMTAB		2
-#define SHT_STRTAB		3
-#define SHT_RELA		4
-#define SHT_HASH		5
-#define SHT_DYNAMIC		6
-#define SHT_NOTE		7
-#define SHT_NOBITS		8
-#define SHT_REL			9
-#define SHT_SHLIB		10
-#define SHT_DYNSYM		11
-#define SHT_LOOS		0x60000000
-#define SHT_HIOS		0x6fffffff
-#define SHT_LOPROC		0x70000000
-#define SHT_HIPROC		0x7fffffff
-#define SHT_LOUSER		0x80000000
-#define SHT_HIUSER		0xffffffff
-
-/**
- * ELF section flags
- */
-#define SHF_WRITE		0x1 
-#define SHF_ALLOC		0x2
-#define SHF_EXECINSTR		0x4
-#define SHF_TLS			0x400
-#define SHF_MASKPROC		0xf0000000
-
-/**
- * Symbol binding
- */
-#define STB_LOCAL		0
-#define STB_GLOBAL		1
-#define STB_WEAK		2
-#define STB_LOPROC		13
-#define STB_HIPROC		15
-
-/**
- * Symbol types
- */
-#define STT_NOTYPE		0
-#define STT_OBJECT		1
-#define STT_FUNC		2
-#define STT_SECTION		3
-#define STT_FILE		4
-#define STT_LOPROC		13
-#define STT_HIPROC		15
-
-/**
- * Program segment types
- */
-#define PT_NULL			0
-#define PT_LOAD			1
-#define PT_DYNAMIC		2
-#define PT_INTERP		3
-#define PT_NOTE			4
-#define PT_SHLIB		5
-#define PT_PHDR			6
-#define PT_LOPROC		0x70000000
-#define PT_HIPROC		0x7fffffff
-
-/**
- * Program segment attributes.
- */
-#define PF_X	1
-#define PF_W	2
-#define PF_R	4
-
-/**
- * ELF data types
- *
- * These types are found to be identical in both 32-bit and 64-bit
- * ELF object file specifications. They are the only types used
- * in ELF header.
- */
-typedef uint64_t elf_xword;
-typedef int64_t elf_sxword;
-typedef uint32_t elf_word;
-typedef int32_t elf_sword;
-typedef uint16_t elf_half;
-
-/**
- * 32-bit ELF data types.
- *
- * These types are specific for 32-bit format.
- */
-typedef uint32_t elf32_addr;
-typedef uint32_t elf32_off;
-
-/**
- * 64-bit ELF data types.
- *
- * These types are specific for 64-bit format.
- */
-typedef uint64_t elf64_addr;
-typedef uint64_t elf64_off;
-
-/** ELF header */
-struct elf32_header {
-	uint8_t e_ident[EI_NIDENT];
-	elf_half e_type;
-	elf_half e_machine;
-	elf_word e_version;
-	elf32_addr e_entry;
-	elf32_off e_phoff;
-	elf32_off e_shoff;
-	elf_word e_flags;
-	elf_half e_ehsize;
-	elf_half e_phentsize;
-	elf_half e_phnum;
-	elf_half e_shentsize;
-	elf_half e_shnum;
-	elf_half e_shstrndx;
-};
-struct elf64_header {
-	uint8_t e_ident[EI_NIDENT];
-	elf_half e_type;
-	elf_half e_machine;
-	elf_word e_version;
-	elf64_addr e_entry;
-	elf64_off e_phoff;
-	elf64_off e_shoff;
-	elf_word e_flags;
-	elf_half e_ehsize;
-	elf_half e_phentsize;
-	elf_half e_phnum;
-	elf_half e_shentsize;
-	elf_half e_shnum;
-	elf_half e_shstrndx;
-};
-
-/*
- * ELF segment header.
- * Segments headers are also known as program headers.
- */
-struct elf32_segment_header {
-	elf_word p_type;
-	elf32_off p_offset;
-	elf32_addr p_vaddr;
-	elf32_addr p_paddr;
-	elf_word p_filesz;
-	elf_word p_memsz;
-	elf_word p_flags;
-	elf_word p_align;
-};
-struct elf64_segment_header {
-	elf_word p_type;
-	elf_word p_flags;
-	elf64_off p_offset;
-	elf64_addr p_vaddr;
-	elf64_addr p_paddr;
-	elf_xword p_filesz;
-	elf_xword p_memsz;
-	elf_xword p_align;
-};
-
-/*
- * ELF section header
- */
-struct elf32_section_header {
-	elf_word sh_name;
-	elf_word sh_type;
-	elf_word sh_flags;
-	elf32_addr sh_addr;
-	elf32_off sh_offset;
-	elf_word sh_size;
-	elf_word sh_link;
-	elf_word sh_info;
-	elf_word sh_addralign;
-	elf_word sh_entsize;
-};
-struct elf64_section_header {
-	elf_word sh_name;
-	elf_word sh_type;
-	elf_xword sh_flags;
-	elf64_addr sh_addr;
-	elf64_off sh_offset;
-	elf_xword sh_size;
-	elf_word sh_link;
-	elf_word sh_info;
-	elf_xword sh_addralign;
-	elf_xword sh_entsize;
-};
-
-/*
- * ELF symbol table entry
- */
-struct elf32_symbol {
-	elf_word st_name;
-	elf32_addr st_value;
-	elf_word st_size;
-	uint8_t st_info;
-	uint8_t st_other;
-	elf_half st_shndx;
-};
-struct elf64_symbol {
-	elf_word st_name;
-	uint8_t st_info;
-	uint8_t st_other;
-	elf_half st_shndx;
-	elf64_addr st_value;
-	elf_xword st_size;
-};
-
-#ifdef __32_BITS__ 
-typedef struct elf32_header elf_header_t;
-typedef struct elf32_segment_header elf_segment_header_t;
-typedef struct elf32_section_header elf_section_header_t;
-typedef struct elf32_symbol elf_symbol_t;
-#endif
-#ifdef __64_BITS__
-typedef struct elf64_header elf_header_t;
-typedef struct elf64_segment_header elf_segment_header_t;
-typedef struct elf64_section_header elf_section_header_t;
-typedef struct elf64_symbol elf_symbol_t;
-#endif
-
-extern char *elf_error(unsigned int rc);
-
-#endif
-
-/** @}
- */
Index: pace/app/taskdump/include/symtab.h
===================================================================
--- uspace/app/taskdump/include/symtab.h	(revision bca408bfd84743b83b4ee34646013041a86f2ccf)
+++ 	(revision )
@@ -1,59 +1,0 @@
-/*
- * Copyright (c) 2008 Jiri Svoboda
- * 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 debug
- * @{
- */
-/** @file
- */
-
-#ifndef SYMTAB_H_
-#define SYMTAB_H_
-
-#include <sys/types.h>
-#include <elf.h>
-
-typedef struct {
-	/** Symbol section */
-	elf_symbol_t *sym;
-	size_t sym_size;
-	/** String table */
-	char *strtab;
-	size_t strtab_size;
-} symtab_t;
-
-extern int symtab_load(const char *file_name, symtab_t **symtab);
-extern void symtab_delete(symtab_t *st);
-extern int symtab_name_to_addr(symtab_t *st, char *name, uintptr_t *addr);
-extern int symtab_addr_to_name(symtab_t *symtab, uintptr_t addr, char **name,
-    size_t *offs);
-
-#endif
-
-/** @}
- */
Index: pace/app/taskdump/symtab.c
===================================================================
--- uspace/app/taskdump/symtab.c	(revision bca408bfd84743b83b4ee34646013041a86f2ccf)
+++ 	(revision )
@@ -1,373 +1,0 @@
-/*
- * Copyright (c) 2010 Jiri Svoboda
- * 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 debug
- * @{
- */
-/** @file Handling of ELF symbol tables.
- *
- * This module allows one to load a symbol table from an ELF file and
- * use it to lookup symbol names/addresses in both directions.
- */
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <errno.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <fcntl.h>
-
-#include <elf.h>
-#include "include/symtab.h"
-
-static int elf_hdr_check(elf_header_t *hdr);
-static int section_hdr_load(int fd, const elf_header_t *ehdr, int idx,
-    elf_section_header_t *shdr);
-static int chunk_load(int fd, off_t start, off_t size, void **ptr);
-static int read_all(int fd, void *buf, size_t len);
-
-/** Load symbol table from an ELF file.
- *
- * @param file_name	Name of the ELF file to read from.
- * @param symtab	Place to save pointer to new symtab structure.
- *
- * @return		EOK on success, ENOENT if file could not be open,
- *			ENOTSUP if file parsing failed.
- */
-int symtab_load(const char *file_name, symtab_t **symtab)
-{
-	symtab_t *stab;
-	elf_header_t elf_hdr;
-	elf_section_header_t sec_hdr;
-	off_t shstrt_start, shstrt_size;
-	char *shstrt, *sec_name;
-	void *data;
-
-	int fd;
-	int rc;
-	int i;
-
-	bool load_sec, sec_is_symtab;
-
-	*symtab = NULL;
-
-	stab = calloc(1, sizeof(symtab_t));
-	if (stab == NULL)
-		return ENOMEM;
-
-	fd = open(file_name, O_RDONLY);
-	if (fd < 0) {
-		printf("failed opening file\n");
-		free(stab);
-		return ENOENT;
-	}
-
-	rc = read_all(fd, &elf_hdr, sizeof(elf_header_t));
-	if (rc != EOK) {
-		printf("failed reading elf header\n");
-		free(stab);
-		return EIO;
-	}
-
-	rc = elf_hdr_check(&elf_hdr);
-	if (rc != EOK) {
-		printf("failed header check\n");
-		free(stab);
-		return ENOTSUP;
-	}
-
-	/*
-	 * Load section header string table.
-	 */
-
-	rc = section_hdr_load(fd, &elf_hdr, elf_hdr.e_shstrndx, &sec_hdr);
-	if (rc != EOK) {
-		printf("failed reading shstrt header\n");
-		free(stab);
-		return ENOTSUP;
-	}
-
-	shstrt_start = sec_hdr.sh_offset;
-	shstrt_size = sec_hdr.sh_size;
-
-	rc = chunk_load(fd, shstrt_start, shstrt_size, (void **) &shstrt);
-	if (rc != EOK) {
-		printf("failed loading shstrt\n");
-		free(stab);
-		return ENOTSUP;
-	}
-
-	/* Read all section headers. */
-	for (i = 0; i < elf_hdr.e_shnum; ++i) {
-		rc = section_hdr_load(fd, &elf_hdr, i, &sec_hdr);
-		if (rc != EOK) {
-			free(shstrt);
-			free(stab);
-			return ENOTSUP;
-		}
-
-		sec_name = shstrt + sec_hdr.sh_name;
-		if (str_cmp(sec_name, ".symtab") == 0 &&
-		    sec_hdr.sh_type == SHT_SYMTAB) {
-			load_sec = true;
-			sec_is_symtab = true;
-		} else if (str_cmp(sec_name, ".strtab") == 0 &&
-		    sec_hdr.sh_type == SHT_STRTAB) {
-			load_sec = true;
-			sec_is_symtab = false;
-		} else {
-			load_sec = false;
-		}
-
-		if (load_sec) {
-			rc = chunk_load(fd, sec_hdr.sh_offset, sec_hdr.sh_size,
-			    &data);
-			if (rc != EOK) {
-				free(shstrt);
-				free(stab);
-				return ENOTSUP;
-			}
-
-			if (sec_is_symtab) {
-				stab->sym = data;
-				stab->sym_size = sec_hdr.sh_size;
-			} else {
-				stab->strtab = data;
-				stab->strtab_size = sec_hdr.sh_size;
-			}
-		}
-	}
-
-	free(shstrt);
-	close(fd);
-
-	if (stab->sym == NULL || stab->strtab == NULL) {
-		/* Tables not found. */
-		printf("Symbol table or string table section not found\n");
-		free(stab);
-		return ENOTSUP;
-	}
-
-	*symtab = stab;
-
-	return EOK;
-}
-
-/** Delete a symtab structure.
- *
- * Deallocates all resources used by the symbol table.
- */
-void symtab_delete(symtab_t *st)
-{
-	free(st->sym);
-	st->sym = NULL;
-
-	free(st->strtab);
-	st->strtab = NULL;
-
-	free(st);
-}
-
-/** Convert symbol name to address.
- *
- * @param st	Symbol table.
- * @param name	Name of the symbol.
- * @param addr	Place to store address for symbol, if found.
- *
- * @return	EOK on success, ENOENT if no such symbol was found.
- */
-int symtab_name_to_addr(symtab_t *st, char *name, uintptr_t *addr)
-{
-	size_t i;
-	char *sname;
-
-	for (i = 0; i < st->sym_size / sizeof(elf_symbol_t); ++i) {
-		if (st->sym[i].st_name == 0)
-			continue;
-
-		sname = st->strtab + st->sym[i].st_name;
-
-		if (str_cmp(sname, name) == 0) {
-			*addr = st->sym[i].st_value;
-			return EOK;
-		}
-	}
-
-	return ENOENT;
-}
-
-/** Convert symbol address to name.
- *
- * This function finds the symbol which starts at the highest address
- * less than or equal to @a addr.
- *
- * @param st	Symbol table.
- * @param addr	Address for lookup.
- * @param name	Place to store pointer name of symbol, if found.
- *		This is valid while @a st exists.
- *
- * @return	EOK on success or ENOENT if no matching symbol was found.
- */
-int symtab_addr_to_name(symtab_t *st, uintptr_t addr, char **name,
-    size_t *offs)
-{
-	size_t i;
-	uintptr_t saddr, best_addr;
-	char *sname, *best_name;
-
-	best_name = NULL;
-	best_addr = 0;
-
-	for (i = 0; i < st->sym_size / sizeof(elf_symbol_t); ++i) {
-		if (st->sym[i].st_name == 0)
-			continue;
-
-		saddr = st->sym[i].st_value;
-		sname = st->strtab + st->sym[i].st_name;
-
-		if (best_name == NULL || (saddr <= addr && saddr > best_addr)) {
-			best_name = sname;
-			best_addr = saddr;
-		}
-	}
-
-	if (best_name == NULL)
-		return ENOENT;
-
-	*name = best_name;
-	*offs = addr - best_addr;
-	return EOK;
-}
-
-/** Check if ELF header is valid.
- *
- * @return	EOK on success or negative error code.
- */
-static int elf_hdr_check(elf_header_t *ehdr)
-{
-	/* TODO */
-	return EOK;
-}
-
-/** Load ELF section header.
- *
- * @param fd		File descriptor of ELF file.
- * @param elf_hdr	Pointer to ELF file header in memory.
- * @param idx		Index of section whose header to load (0 = first).
- * @param sec_hdr	Place to store section header data.
- *
- * @return		EOK on success or EIO if I/O failed.
- */
-static int section_hdr_load(int fd, const elf_header_t *elf_hdr, int idx,
-    elf_section_header_t *sec_hdr)
-{
-	int rc;
-
-	rc = lseek(fd, elf_hdr->e_shoff + idx * sizeof(elf_section_header_t),
-	    SEEK_SET);
-	if (rc == (off_t) -1)
-		return EIO;
-
-	rc = read_all(fd, sec_hdr, sizeof(elf_section_header_t));
-	if (rc != EOK)
-		return EIO;
-
-	return EOK;
-}
-
-/** Load a segment of bytes from a file and return it as a new memory block.
- *
- * This function fails if it cannot read exactly @a size bytes from the file.
- *
- * @param fd		File to read from.
- * @param start		Position in file where to start reading.
- * @param size		Number of bytes to read.
- * @param ptr		Place to store pointer to newly allocated block.
- *
- * @return		EOK on success or EIO on failure.
- */
-static int chunk_load(int fd, off_t start, off_t size, void **ptr)
-{
-	int rc;
-
-	rc = lseek(fd, start, SEEK_SET);
-	if (rc == (off_t) -1) {
-		printf("failed seeking chunk\n");
-		*ptr = NULL;
-		return EIO;
-	}
-
-	*ptr = malloc(size);
-	if (*ptr == NULL) {
-		printf("failed allocating memory\n");
-		return ENOMEM;
-	}
-
-	rc = read_all(fd, *ptr, size);
-	if (rc != EOK) {
-		printf("failed reading chunk\n");
-		free(*ptr);
-		*ptr = NULL;
-		return EIO;
-	}
-
-	return EOK;
-}
-
-/** Read until the buffer is read in its entirety.
- *
- * This function fails if it cannot read exactly @a len bytes from the file.
- *
- * @param fd		The file to read from.
- * @param buf		Buffer for storing data, @a len bytes long.
- * @param len		Number of bytes to read.
- *
- * @return		EOK on error, EIO if file is short or return value
- *			from read() if reading failed.
- */
-static int read_all(int fd, void *buf, size_t len)
-{
-	int cnt = 0;
-
-	do {
-		buf += cnt;
-		len -= cnt;
-		cnt = read(fd, buf, len);
-	} while (cnt > 0 && (len - cnt) > 0);
-
-	if (cnt < 0)
-		return cnt;
-
-	if (len - cnt > 0)
-		return EIO;
-
-	return EOK;
-}
-
-/** @}
- */
Index: pace/app/taskdump/taskdump.c
===================================================================
--- uspace/app/taskdump/taskdump.c	(revision bca408bfd84743b83b4ee34646013041a86f2ccf)
+++ 	(revision )
@@ -1,532 +1,0 @@
-/*
- * Copyright (c) 2010 Jiri Svoboda
- * 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 taskdump
- * @{
- */
-/** @file
- */
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <unistd.h>
-#include <ipc/ipc.h>
-#include <errno.h>
-#include <udebug.h>
-#include <task.h>
-#include <kernel/mm/as.h>
-#include <libarch/istate.h>
-#include <macros.h>
-#include <assert.h>
-#include <bool.h>
-
-#include <symtab.h>
-#include <stacktrace.h>
-
-#define LINE_BYTES 16
-
-#define DBUF_SIZE 4096
-static uint8_t data_buf[DBUF_SIZE];
-
-static int phoneid;
-static task_id_t task_id;
-static bool dump_memory;
-static char *app_name;
-static symtab_t *app_symtab;
-
-static int connect_task(task_id_t task_id);
-static int parse_args(int argc, char *argv[]);
-static void print_syntax(void);
-static int threads_dump(void);
-static int thread_dump(uintptr_t thash);
-static int areas_dump(void);
-static int area_dump(as_area_info_t *area);
-static void hex_dump(uintptr_t addr, void *buffer, size_t size);
-static int td_read_uintptr(void *arg, uintptr_t addr, uintptr_t *value);
-
-static void autoload_syms(void);
-static char *get_app_task_name(void);
-static char *fmt_sym_address(uintptr_t addr);
-
-int main(int argc, char *argv[])
-{
-	int rc;
-
-	/*
-	 * FIXME: The stdio module cannot currently detect whether we are
-	 * writing to a console or file. This workaround make file output
-	 * faster.
-	 */
-	setvbuf(stdout, NULL, _IOFBF, 32768);
-
-	printf("Task Dump Utility\n");
-	dump_memory = false;
-
-	if (parse_args(argc, argv) < 0)
-		return 1;
-
-	rc = connect_task(task_id);
-	if (rc < 0) {
-		printf("Failed connecting to task %lld.\n", task_id);
-		return 1;
-	}
-
-	app_name = get_app_task_name();
-	app_symtab = NULL;
-
-	printf("Dumping task '%s' (task ID %lld).\n", app_name, task_id);
-	autoload_syms();
-	putchar('\n');
-
-	rc = threads_dump();
-	if (rc < 0)
-		printf("Failed dumping threads.\n");
-
-	rc = areas_dump();
-	if (rc < 0)
-		printf("Failed dumping address space areas.\n");
-
-	udebug_end(phoneid);
-	ipc_hangup(phoneid);
-
-	return 0;
-}
-
-static int connect_task(task_id_t task_id)
-{
-	int rc;
-
-	rc = ipc_connect_kbox(task_id);
-
-	if (rc == ENOTSUP) {
-		printf("You do not have userspace debugging support "
-		    "compiled in the kernel.\n");
-		printf("Compile kernel with 'Support for userspace debuggers' "
-		    "(CONFIG_UDEBUG) enabled.\n");
-		return rc;
-	}
-
-	if (rc < 0) {
-		printf("Error connecting\n");
-		printf("ipc_connect_task(%lld) -> %d ", task_id, rc);
-		return rc;
-	}
-
-	phoneid = rc;
-
-	rc = udebug_begin(phoneid);
-	if (rc < 0) {
-		printf("udebug_begin() -> %d\n", rc);
-		return rc;
-	}
-
-	return 0;
-}
-
-static int parse_args(int argc, char *argv[])
-{
-	char *arg;
-	char *err_p;
-
-	task_id = 0;
-
-	--argc; ++argv;
-
-	while (argc > 0) {
-		arg = *argv;
-		if (arg[0] == '-') {
-			if (arg[1] == 't' && arg[2] == '\0') {
-				/* Task ID */
-				--argc; ++argv;
-				task_id = strtol(*argv, &err_p, 10);
-				if (*err_p) {
-					printf("Task ID syntax error\n");
-					print_syntax();
-					return -1;
-				}
-			} else if (arg[1] == 'm' && arg[2] == '\0') {
-				dump_memory = true;
-			} else {
-				printf("Uknown option '%s'\n", arg[0]);
-				print_syntax();
-				return -1;
-			}
-		} else {
-			break;
-		}
-
-		--argc; ++argv;
-	}
-
-	if (task_id == 0) {
-		printf("Missing task ID argument\n");
-		print_syntax();
-		return -1;
-	}
-
-	if (argc != 0) {
-		printf("Extra arguments\n");
-		print_syntax();
-		return -1;
-	}
-
-	return 0;
-}
-
-static void print_syntax(void)
-{
-	printf("Syntax: taskdump [-m] -t <task_id>\n");
-	printf("\t-m\tDump memory area contents.\n");
-	printf("\t-t <task_id>\tWhich task to dump.\n");
-}
-
-static int threads_dump(void)
-{
-	uintptr_t *thash_buf;
-	uintptr_t dummy_buf;
-	size_t buf_size, n_threads;
-
-	size_t copied;
-	size_t needed;
-	size_t i;
-	int rc;
-
-	/* TODO: See why NULL does not work. */
-	rc = udebug_thread_read(phoneid, &dummy_buf, 0, &copied, &needed);
-	if (rc < 0) {
-		printf("udebug_thread_read() -> %d\n", rc);
-		return rc;
-	}
-
-	if (needed == 0) {
-		printf("No threads.\n\n");
-		return 0;
-	}
-
-	buf_size = needed;
-	thash_buf = malloc(buf_size);
-
-	rc = udebug_thread_read(phoneid, thash_buf, buf_size, &copied, &needed);
-	if (rc < 0) {
-		printf("udebug_thread_read() -> %d\n", rc);
-		return rc;
-	}
-
-	assert(copied == buf_size);
-	assert(needed == buf_size);
-
-	n_threads = copied / sizeof(uintptr_t);
-
-	printf("Threads:\n");
-	for (i = 0; i < n_threads; i++) {
-		printf(" [%d] hash: 0x%lx\n", 1+i, thash_buf[i]);
-
-		thread_dump(thash_buf[i]);
-	}
-	putchar('\n');
-
-	free(thash_buf);
-
-	return 0;
-}
-
-static int areas_dump(void)
-{
-	as_area_info_t *ainfo_buf;
-	as_area_info_t dummy_buf;
-	size_t buf_size, n_areas;
-
-	size_t copied;
-	size_t needed;
-	size_t i;
-	int rc;
-
-	rc = udebug_areas_read(phoneid, &dummy_buf, 0, &copied, &needed);
-	if (rc < 0) {
-		printf("udebug_areas_read() -> %d\n", rc);
-		return rc;
-	}
-
-	buf_size = needed;
-	ainfo_buf = malloc(buf_size);
-
-	rc = udebug_areas_read(phoneid, ainfo_buf, buf_size, &copied, &needed);
-	if (rc < 0) {
-		printf("udebug_areas_read() -> %d\n", rc);
-		return rc;
-	}
-
-	assert(copied == buf_size);
-	assert(needed == buf_size);
-
-	n_areas = copied / sizeof(as_area_info_t);
-
-	printf("Address space areas:\n");
-	for (i = 0; i < n_areas; i++) {
-		printf(" [%d] flags: %c%c%c%c base: 0x%lx size: 0x%lx\n", 1+i,
-		    (ainfo_buf[i].flags & AS_AREA_READ) ? 'R' : '-',
-		    (ainfo_buf[i].flags & AS_AREA_WRITE) ? 'W' : '-',
-		    (ainfo_buf[i].flags & AS_AREA_EXEC) ? 'X' : '-',
-		    (ainfo_buf[i].flags & AS_AREA_CACHEABLE) ? 'C' : '-',
-		    ainfo_buf[i].start_addr, ainfo_buf[i].size);
-
-		if (dump_memory) {
-			putchar('\n');
-			area_dump(&ainfo_buf[i]);
-			putchar('\n');
-		}
-	}
-
-	putchar('\n');
-
-	free(ainfo_buf);
-
-	return 0;
-}
-
-static int thread_dump(uintptr_t thash)
-{
-	istate_t istate;
-	uintptr_t pc, fp, nfp;
-	stacktrace_t st;
-	char *sym_pc;
-	int rc;
-
-	rc = udebug_regs_read(phoneid, thash, &istate);
-	if (rc < 0) {
-		printf("Failed reading registers (%d).\n", rc);
-		return EIO;
-	}
-
-	pc = istate_get_pc(&istate);
-	fp = istate_get_fp(&istate);
-
-	printf("Thread 0x%lx crashed at PC 0x%lx. FP 0x%lx\n", thash, pc, fp);
-
-	st.op_arg = NULL;
-	st.read_uintptr = td_read_uintptr;
-
-	while (stacktrace_fp_valid(&st, fp)) {
-		sym_pc = fmt_sym_address(pc);
-		printf("  %p: %s()\n", fp, sym_pc);
-		free(sym_pc);
-
-		rc = stacktrace_ra_get(&st, fp, &pc);
-		if (rc != EOK)
-			return rc;
-
-		rc = stacktrace_fp_prev(&st, fp, &nfp);
-		if (rc != EOK)
-			return rc;
-
-		fp = nfp;
-	}
-
-	return EOK;
-}
-
-static int area_dump(as_area_info_t *area)
-{
-	size_t to_copy;
-	size_t total;
-	uintptr_t addr;
-	int rc;
-
-	addr = area->start_addr;
-	total = 0;
-
-	while (total < area->size) {
-		to_copy = min(area->size - total, DBUF_SIZE);
-		rc = udebug_mem_read(phoneid, data_buf, addr, to_copy);
-		if (rc < 0) {
-			printf("udebug_mem_read() failed.\n");
-			return rc;
-		}
-
-		hex_dump(addr, data_buf, to_copy);
-
-		addr += to_copy;
-		total += to_copy;
-	}
-
-	return EOK;
-}
-
-static void hex_dump(uintptr_t addr, void *buffer, size_t size)
-{
-	uint8_t *data = (uint8_t *) buffer;
-	uint8_t b;
-	size_t pos, i;
-
-	assert(addr % LINE_BYTES == 0);
-	assert(size % LINE_BYTES == 0);
-
-	pos = 0;
-
-	while (pos < size) {
-		printf("%08x:", addr + pos);
-		for (i = 0; i < LINE_BYTES; ++i) {
-			if (i % 4 == 0) putchar(' ');
-			printf(" %02x", data[pos + i]);
-		}
-		putchar('\t');
-
-		for (i = 0; i < LINE_BYTES; ++i) {
-			b = data[pos + i];
-			if (b >= 32 && b < 127) {
-				putchar(b);
-			} else {
-				putchar(' ');
-			}
-		}
-		putchar('\n');
-		pos += LINE_BYTES;
-	}
-}
-
-static int td_read_uintptr(void *arg, uintptr_t addr, uintptr_t *value)
-{
-	uintptr_t data;
-	int rc;
-
-	(void) arg;
-
-	rc = udebug_mem_read(phoneid, &data, addr, sizeof(data));
-	if (rc < 0) {
-		printf("Warning: udebug_mem_read() failed.\n");
-		return rc;
-	}
-
-	*value = data;
-	return EOK;
-}
-
-/** Attempt to find the right executable file and load the symbol table. */
-static void autoload_syms(void)
-{
-	char *file_name;
-	int rc;
-
-	assert(app_name != NULL);
-	assert(app_symtab == NULL);
-
-	rc = asprintf(&file_name, "/app/%s", app_name);
-	if (rc < 0) {
-		printf("Memory allocation failure.\n");
-		exit(1);
-	}
-
-	rc = symtab_load(file_name, &app_symtab);
-	if (rc == EOK) {
-		printf("Loaded symbol table from %s\n", file_name);
-		free(file_name);
-		return;
-	}
-
-	free(file_name);
-
-	rc = asprintf(&file_name, "/srv/%s", app_name);
-	if (rc < 0) {
-		printf("Memory allocation failure.\n");
-		exit(1);
-	}
-
-	rc = symtab_load("/srv/xyz", &app_symtab);
-	if (rc == EOK) {
-		printf("Loaded symbol table from %s\n", file_name);
-		free(file_name);
-		return;
-	}
-
-	free(file_name);
-	printf("Failed autoloading symbol table.\n");
-}
-
-static char *get_app_task_name(void)
-{
-	char dummy_buf;
-	size_t copied, needed, name_size;
-	char *name;
-	int rc;
-
-	rc = udebug_name_read(phoneid, &dummy_buf, 0, &copied, &needed);
-	if (rc < 0)
-		return NULL;
-
-	name_size = needed;
-	name = malloc(name_size + 1);
-	rc = udebug_name_read(phoneid, name, name_size, &copied, &needed);
-	if (rc < 0) {
-		free(name);
-		return NULL;
-	}
-
-	assert(copied == name_size);
-	assert(copied == needed);
-	name[copied] = '\0';
-
-	return name;
-}
-
-/** Format address in symbolic form.
- *
- * Formats address as <symbol_name>+<offset> (<address>), if possible,
- * otherwise as <address>.
- *
- * @param addr	Address to format.
- * @return	Newly allocated string, address in symbolic form.
- */
-static char *fmt_sym_address(uintptr_t addr)
-{
-	char *name;
-	size_t offs;
-	int rc;
-	char *str;
-
-	if (app_symtab != NULL) {
-		rc = symtab_addr_to_name(app_symtab, addr, &name, &offs);
-	} else {
-		rc = ENOTSUP;
-	}
-
-	if (rc == EOK) {
-		rc = asprintf(&str, "(%p) %s+%p", addr, name, offs);
-	} else {
-		rc = asprintf(&str, "%p", addr);
-	}
-
-	if (rc < 0) {
-		printf("Memory allocation error.\n");
-		exit(1);
-	}
-
-	return str;
-}
-
-/** @}
- */
Index: uspace/lib/libc/arch/amd64/Makefile.inc
===================================================================
--- uspace/lib/libc/arch/amd64/Makefile.inc	(revision bca408bfd84743b83b4ee34646013041a86f2ccf)
+++ uspace/lib/libc/arch/amd64/Makefile.inc	(revision 1715b6af7847ebb95ae42eba99295f3291f1d1b5)
@@ -37,6 +37,5 @@
 	arch/$(UARCH)/src/fibril.S \
 	arch/$(UARCH)/src/tls.c \
-	arch/$(UARCH)/src/stacktrace.c \
-	arch/$(UARCH)/src/stacktrace_asm.S
+	arch/$(UARCH)/src/stacktrace.S
 
 GCC_CFLAGS += -fno-omit-frame-pointer
Index: pace/lib/libc/arch/amd64/include/istate.h
===================================================================
--- uspace/lib/libc/arch/amd64/include/istate.h	(revision bca408bfd84743b83b4ee34646013041a86f2ccf)
+++ 	(revision )
@@ -1,75 +1,0 @@
-/*
- * Copyright (c) 2010 Jiri Svoboda
- * 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 libcamd64
- * @{
- */
-/** @file
- */
-
-#ifndef LIBC_amd64_ISTATE_H_
-#define LIBC_amd64_ISTATE_H_
-
-#include <sys/types.h>
-
-/** Interrupt context.
- *
- * This is a copy of the kernel definition with which it must be kept in sync.
- */
-typedef struct istate {
-	uint64_t rax;
-	uint64_t rcx;
-	uint64_t rdx;
-	uint64_t rsi;
-	uint64_t rdi;
-	uint64_t r8;
-	uint64_t r9;
-	uint64_t r10;
-	uint64_t r11;
-	uint64_t rbp;
-	uint64_t error_word;
-	uint64_t rip;
-	uint64_t cs;
-	uint64_t rflags;
-	uint64_t stack[]; /* Additional data on stack */
-} istate_t;
-
-static inline uintptr_t istate_get_pc(istate_t *istate)
-{
-	return istate->rip;
-}
-
-static inline uintptr_t istate_get_fp(istate_t *istate)
-{
-	return istate->rbp;
-}
-
-#endif
-
-/** @}
- */
Index: uspace/lib/libc/arch/amd64/include/types.h
===================================================================
--- uspace/lib/libc/arch/amd64/include/types.h	(revision bca408bfd84743b83b4ee34646013041a86f2ccf)
+++ uspace/lib/libc/arch/amd64/include/types.h	(revision 1715b6af7847ebb95ae42eba99295f3291f1d1b5)
@@ -36,6 +36,4 @@
 #define LIBC_amd64_TYPES_H_
 
-#define __64_BITS__
-
 typedef unsigned long long sysarg_t;
 
Index: uspace/lib/libc/arch/amd64/src/stacktrace.S
===================================================================
--- uspace/lib/libc/arch/amd64/src/stacktrace.S	(revision 1715b6af7847ebb95ae42eba99295f3291f1d1b5)
+++ uspace/lib/libc/arch/amd64/src/stacktrace.S	(revision 1715b6af7847ebb95ae42eba99295f3291f1d1b5)
@@ -0,0 +1,55 @@
+#
+# Copyright (c) 2009 Jakub Jermar
+# 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.
+#
+
+.text
+
+.global frame_pointer_get
+.global frame_pointer_prev
+.global frame_pointer_validate
+.global return_address_get
+.global program_counter_get
+
+frame_pointer_get:
+	movq %rbp, %rax
+	ret
+
+frame_pointer_prev:
+	movq (%rdi), %rax
+	ret
+
+frame_pointer_validate:
+	movq %rdi, %rax
+	ret
+
+return_address_get:
+	movq 8(%rdi), %rax
+	ret
+
+program_counter_get:
+	movq (%rsp), %rax
+	ret
Index: pace/lib/libc/arch/amd64/src/stacktrace.c
===================================================================
--- uspace/lib/libc/arch/amd64/src/stacktrace.c	(revision bca408bfd84743b83b4ee34646013041a86f2ccf)
+++ 	(revision )
@@ -1,62 +1,0 @@
-/*
- * Copyright (c) 2010 Jakub Jermar
- * Copyright (c) 2010 Jiri Svoboda
- * 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 libcamd64 amd64
- * @ingroup lc
- * @{
- */
-/** @file
- */
-
-#include <sys/types.h>
-#include <bool.h>
-
-#include <stacktrace.h>
-
-#define FRAME_OFFSET_FP_PREV	0
-#define FRAME_OFFSET_RA		8
-
-bool stacktrace_fp_valid(stacktrace_t *st, uintptr_t fp)
-{
-	(void) st;
-	return fp != 0;
-}
-
-int stacktrace_fp_prev(stacktrace_t *st, uintptr_t fp, uintptr_t *prev)
-{
-	return (*st->read_uintptr)(st->op_arg, fp + FRAME_OFFSET_FP_PREV, prev);
-}
-
-int stacktrace_ra_get(stacktrace_t *st, uintptr_t fp, uintptr_t *ra)
-{
-	return (*st->read_uintptr)(st->op_arg, fp + FRAME_OFFSET_RA, ra);
-}
-
-/** @}
- */
Index: pace/lib/libc/arch/amd64/src/stacktrace_asm.S
===================================================================
--- uspace/lib/libc/arch/amd64/src/stacktrace_asm.S	(revision bca408bfd84743b83b4ee34646013041a86f2ccf)
+++ 	(revision )
@@ -1,44 +1,0 @@
-#
-# Copyright (c) 2009 Jakub Jermar
-# 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.
-#
-
-.text
-
-.global stacktrace_prepare
-.global stacktrace_fp_get
-.global stacktrace_pc_get
-
-stacktrace_prepare:
-	ret
-
-stacktrace_fp_get:
-	movq %rbp, %rax
-	ret
-
-stacktrace_pc_get:
-	movq (%rsp), %rax
-	ret
Index: uspace/lib/libc/arch/arm32/Makefile.inc
===================================================================
--- uspace/lib/libc/arch/arm32/Makefile.inc	(revision bca408bfd84743b83b4ee34646013041a86f2ccf)
+++ uspace/lib/libc/arch/arm32/Makefile.inc	(revision 1715b6af7847ebb95ae42eba99295f3291f1d1b5)
@@ -38,6 +38,5 @@
 	arch/$(UARCH)/src/tls.c \
 	arch/$(UARCH)/src/eabi.S \
-	arch/$(UARCH)/src/stacktrace.c \
-	arch/$(UARCH)/src/stacktrace_asm.S
+	arch/$(UARCH)/src/stacktrace.S
 
 GCC_CFLAGS += -ffixed-r9 -mtp=soft -mapcs-frame -fno-omit-frame-pointer
Index: pace/lib/libc/arch/arm32/include/istate.h
===================================================================
--- uspace/lib/libc/arch/arm32/include/istate.h	(revision bca408bfd84743b83b4ee34646013041a86f2ccf)
+++ 	(revision )
@@ -1,79 +1,0 @@
-/*
- * Copyright (c) 2010 Jiri Svoboda
- * 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 libcarm32
- * @{
- */
-/** @file
- */
-
-#ifndef LIBC_arm32__ISTATE_H_
-#define LIBC_arm32__ISTATE_H_
-
-#include <sys/types.h>
-
-/** Interrupt context.
- *
- * This is a copy of the kernel definition with which it must be kept in sync.
- */
-typedef struct istate {
-	uint32_t spsr;
-	uint32_t sp;
-	uint32_t lr;
-
-	uint32_t r0;
-	uint32_t r1;
-	uint32_t r2;
-	uint32_t r3;
-	uint32_t r4;
-	uint32_t r5;
-	uint32_t r6;
-	uint32_t r7;
-	uint32_t r8;
-	uint32_t r9;
-	uint32_t r10;
-	uint32_t fp;
-	uint32_t r12;
-
-	uint32_t pc;
-} istate_t;
-
-static inline uintptr_t istate_get_pc(istate_t *istate)
-{
-	return istate->pc;
-}
-
-static inline uintptr_t istate_get_fp(istate_t *istate)
-{
-	return istate->fp;
-}
-
-#endif
-
-/** @}
- */
Index: uspace/lib/libc/arch/arm32/include/types.h
===================================================================
--- uspace/lib/libc/arch/arm32/include/types.h	(revision bca408bfd84743b83b4ee34646013041a86f2ccf)
+++ uspace/lib/libc/arch/arm32/include/types.h	(revision 1715b6af7847ebb95ae42eba99295f3291f1d1b5)
@@ -37,6 +37,4 @@
 #define LIBC_arm32_TYPES_H_
 
-#define __32_BITS__
-
 typedef unsigned int sysarg_t;
 
Index: uspace/lib/libc/arch/arm32/src/stacktrace.S
===================================================================
--- uspace/lib/libc/arch/arm32/src/stacktrace.S	(revision 1715b6af7847ebb95ae42eba99295f3291f1d1b5)
+++ uspace/lib/libc/arch/arm32/src/stacktrace.S	(revision 1715b6af7847ebb95ae42eba99295f3291f1d1b5)
@@ -0,0 +1,55 @@
+#
+# Copyright (c) 2009 Jakub Jermar
+# 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.
+#
+
+.text
+
+.global frame_pointer_get
+.global frame_pointer_prev
+.global frame_pointer_validate
+.global return_address_get
+.global program_counter_get
+
+frame_pointer_get:
+	mov r0, fp
+	mov pc, lr
+
+frame_pointer_prev:
+	ldr r0, [r0, #-12]
+	mov pc, lr
+
+frame_pointer_validate:
+	mov pc, lr
+
+return_address_get:
+	ldr r0, [r0, #-4]
+	mov pc, lr
+
+program_counter_get:
+	mov r0, lr 
+	mov pc, lr
+
Index: pace/lib/libc/arch/arm32/src/stacktrace.c
===================================================================
--- uspace/lib/libc/arch/arm32/src/stacktrace.c	(revision bca408bfd84743b83b4ee34646013041a86f2ccf)
+++ 	(revision )
@@ -1,62 +1,0 @@
-/*
- * Copyright (c) 2010 Jakub Jermar
- * Copyright (c) 2010 Jiri Svoboda
- * 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 libcarm32 arm32
- * @ingroup lc
- * @{
- */
-/** @file
- */
-
-#include <sys/types.h>
-#include <bool.h>
-
-#include <stacktrace.h>
-
-#define FRAME_OFFSET_FP_PREV	-12
-#define FRAME_OFFSET_RA		-4
-
-bool stacktrace_fp_valid(stacktrace_t *st, uintptr_t fp)
-{
-	(void) st;
-	return fp != 0;
-}
-
-int stacktrace_fp_prev(stacktrace_t *st, uintptr_t fp, uintptr_t *prev)
-{
-	return (*st->read_uintptr)(st->op_arg, fp + FRAME_OFFSET_FP_PREV, prev);
-}
-
-int stacktrace_ra_get(stacktrace_t *st, uintptr_t fp, uintptr_t *ra)
-{
-	return (*st->read_uintptr)(st->op_arg, fp + FRAME_OFFSET_RA, ra);
-}
-
-/** @}
- */
Index: pace/lib/libc/arch/arm32/src/stacktrace_asm.S
===================================================================
--- uspace/lib/libc/arch/arm32/src/stacktrace_asm.S	(revision bca408bfd84743b83b4ee34646013041a86f2ccf)
+++ 	(revision )
@@ -1,44 +1,0 @@
-#
-# Copyright (c) 2009 Jakub Jermar
-# 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.
-#
-
-.text
-
-.global stacktrace_prepare
-.global stacktrace_fp_get
-.global stacktrace_pc_get
-
-stacktrace_prepare:
-	mov pc, lr
-
-stacktrace_fp_get:
-	mov r0, fp
-	mov pc, lr
-
-stacktrace_pc_get:
-	mov r0, lr 
-	mov pc, lr
Index: uspace/lib/libc/arch/ia32/Makefile.inc
===================================================================
--- uspace/lib/libc/arch/ia32/Makefile.inc	(revision bca408bfd84743b83b4ee34646013041a86f2ccf)
+++ uspace/lib/libc/arch/ia32/Makefile.inc	(revision 1715b6af7847ebb95ae42eba99295f3291f1d1b5)
@@ -38,6 +38,5 @@
 	arch/$(UARCH)/src/tls.c \
 	arch/$(UARCH)/src/setjmp.S \
-	arch/$(UARCH)/src/stacktrace.c \
-	arch/$(UARCH)/src/stacktrace_asm.S
+	arch/$(UARCH)/src/stacktrace.S
 
 GCC_CFLAGS += -march=pentium
Index: pace/lib/libc/arch/ia32/include/istate.h
===================================================================
--- uspace/lib/libc/arch/ia32/include/istate.h	(revision bca408bfd84743b83b4ee34646013041a86f2ccf)
+++ 	(revision )
@@ -1,75 +1,0 @@
-/*
- * Copyright (c) 2010 Jiri Svoboda
- * 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 debug
- * @{
- */
-/** @file
- */
-
-#ifndef LIBC_ia32__ISTATE_H_
-#define LIBC_ia32__ISTATE_H_
-
-#include <sys/types.h>
-
-/** Interrupt context.
- *
- * This is a copy of the kernel definition with which it must be kept in sync.
- */
-typedef struct istate {
-	uint32_t eax;
-	uint32_t ecx;
-	uint32_t edx;
-	uint32_t ebp;
-
-	uint32_t gs;
-	uint32_t fs;
-	uint32_t es;
-	uint32_t ds;
-
-	uint32_t error_word;
-	uint32_t eip;
-	uint32_t cs;
-	uint32_t eflags;
-	uint32_t stack[];
-} istate_t;
-
-static inline uintptr_t istate_get_pc(istate_t *istate)
-{
-	return istate->eip;
-}
-
-static inline uintptr_t istate_get_fp(istate_t *istate)
-{
-	return istate->ebp;
-}
-
-#endif
-
-/** @}
- */
Index: uspace/lib/libc/arch/ia32/include/types.h
===================================================================
--- uspace/lib/libc/arch/ia32/include/types.h	(revision bca408bfd84743b83b4ee34646013041a86f2ccf)
+++ uspace/lib/libc/arch/ia32/include/types.h	(revision 1715b6af7847ebb95ae42eba99295f3291f1d1b5)
@@ -36,6 +36,4 @@
 #define LIBC_ia32_TYPES_H_
 
-#define __32_BITS__
-
 typedef unsigned int sysarg_t;
 
Index: uspace/lib/libc/arch/ia32/src/stacktrace.S
===================================================================
--- uspace/lib/libc/arch/ia32/src/stacktrace.S	(revision 1715b6af7847ebb95ae42eba99295f3291f1d1b5)
+++ uspace/lib/libc/arch/ia32/src/stacktrace.S	(revision 1715b6af7847ebb95ae42eba99295f3291f1d1b5)
@@ -0,0 +1,57 @@
+#
+# Copyright (c) 2009 Jakub Jermar
+# 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.
+#
+
+.text
+
+.global frame_pointer_get
+.global frame_pointer_prev
+.global frame_pointer_validate
+.global return_address_get
+.global program_counter_get
+
+frame_pointer_get:
+	movl %ebp, %eax
+	ret
+
+frame_pointer_prev:
+	movl 4(%esp), %eax
+	movl (%eax), %eax
+	ret
+
+frame_pointer_validate:
+	movl 4(%esp), %eax
+	ret
+
+return_address_get:
+	movl 4(%esp), %eax
+	movl 4(%eax), %eax
+	ret
+
+program_counter_get:
+	movl (%esp), %eax
+	ret
Index: pace/lib/libc/arch/ia32/src/stacktrace.c
===================================================================
--- uspace/lib/libc/arch/ia32/src/stacktrace.c	(revision bca408bfd84743b83b4ee34646013041a86f2ccf)
+++ 	(revision )
@@ -1,62 +1,0 @@
-/*
- * Copyright (c) 2010 Jakub Jermar
- * Copyright (c) 2010 Jiri Svoboda
- * 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 libcia32 ia32
- * @ingroup lc
- * @{
- */
-/** @file
- */
-
-#include <sys/types.h>
-#include <bool.h>
-
-#include <stacktrace.h>
-
-#define FRAME_OFFSET_FP_PREV	0
-#define FRAME_OFFSET_RA		4
-
-bool stacktrace_fp_valid(stacktrace_t *st, uintptr_t fp)
-{
-	(void) st;
-	return fp != 0;
-}
-
-int stacktrace_fp_prev(stacktrace_t *st, uintptr_t fp, uintptr_t *prev)
-{
-	return (*st->read_uintptr)(st->op_arg, fp + FRAME_OFFSET_FP_PREV, prev);
-}
-
-int stacktrace_ra_get(stacktrace_t *st, uintptr_t fp, uintptr_t *ra)
-{
-	return (*st->read_uintptr)(st->op_arg, fp + FRAME_OFFSET_RA, ra);
-}
-
-/** @}
- */
Index: pace/lib/libc/arch/ia32/src/stacktrace_asm.S
===================================================================
--- uspace/lib/libc/arch/ia32/src/stacktrace_asm.S	(revision bca408bfd84743b83b4ee34646013041a86f2ccf)
+++ 	(revision )
@@ -1,44 +1,0 @@
-#
-# Copyright (c) 2009 Jakub Jermar
-# 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.
-#
-
-.text
-
-.global stacktrace_prepare
-.global stacktrace_fp_get
-.global stacktrace_pc_get
-
-stacktrace_prepare:
-	ret
-
-stacktrace_fp_get:
-	movl %ebp, %eax
-	ret
-
-stacktrace_pc_get:
-	movl (%esp), %eax
-	ret
Index: uspace/lib/libc/arch/ia64/Makefile.inc
===================================================================
--- uspace/lib/libc/arch/ia64/Makefile.inc	(revision bca408bfd84743b83b4ee34646013041a86f2ccf)
+++ uspace/lib/libc/arch/ia64/Makefile.inc	(revision 1715b6af7847ebb95ae42eba99295f3291f1d1b5)
@@ -37,6 +37,5 @@
 	arch/$(UARCH)/src/tls.c \
 	arch/$(UARCH)/src/ddi.c \
-	arch/$(UARCH)/src/stacktrace.c \
-	arch/$(UARCH)/src/stacktrace_asm.S
+	arch/$(UARCH)/src/stacktrace.S
 
 GCC_CFLAGS += -fno-unwind-tables
Index: pace/lib/libc/arch/ia64/include/istate.h
===================================================================
--- uspace/lib/libc/arch/ia64/include/istate.h	(revision bca408bfd84743b83b4ee34646013041a86f2ccf)
+++ 	(revision )
@@ -1,63 +1,0 @@
-/*
- * Copyright (c) 2010 Jiri Svoboda
- * 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 libcsparc64
- * @{
- */
-/** @file
- */
-
-#ifndef LIBC_ia64_ISTATE_H_
-#define LIBC_ia64_ISTATE_H_
-
-#include <sys/types.h>
-
-/** Interrupt context.
- *
- * This is a copy of the kernel definition with which it must be kept in sync.
- */
-typedef struct istate {
-	/* TODO */
-} istate_t;
-
-static inline uintptr_t istate_get_pc(istate_t *istate)
-{
-	/* TODO */
-	return 0;
-}
-
-static inline uintptr_t istate_get_fp(istate_t *istate)
-{
-	/* TODO */
-	return 0;
-}
-
-#endif
-
-/** @}
- */
Index: uspace/lib/libc/arch/ia64/include/types.h
===================================================================
--- uspace/lib/libc/arch/ia64/include/types.h	(revision bca408bfd84743b83b4ee34646013041a86f2ccf)
+++ uspace/lib/libc/arch/ia64/include/types.h	(revision 1715b6af7847ebb95ae42eba99295f3291f1d1b5)
@@ -36,6 +36,4 @@
 #define LIBC_ia64_TYPES_H_
 
-#define __64_BITS__
-
 typedef unsigned long long sysarg_t;
 
Index: uspace/lib/libc/arch/ia64/src/stacktrace.S
===================================================================
--- uspace/lib/libc/arch/ia64/src/stacktrace.S	(revision 1715b6af7847ebb95ae42eba99295f3291f1d1b5)
+++ uspace/lib/libc/arch/ia64/src/stacktrace.S	(revision 1715b6af7847ebb95ae42eba99295f3291f1d1b5)
@@ -0,0 +1,43 @@
+#
+# Copyright (c) 2009 Jakub Jermar
+# 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.
+#
+
+.text
+
+.global frame_pointer_get
+.global frame_pointer_prev
+.global frame_pointer_validate
+.global return_address_get
+.global program_counter_get
+
+frame_pointer_get:
+frame_pointer_prev:
+frame_pointer_validate:
+return_address_get:
+program_counter_get:
+	mov r8 = r0
+	br.ret.sptk.many b0
Index: pace/lib/libc/arch/ia64/src/stacktrace.c
===================================================================
--- uspace/lib/libc/arch/ia64/src/stacktrace.c	(revision bca408bfd84743b83b4ee34646013041a86f2ccf)
+++ 	(revision )
@@ -1,62 +1,0 @@
-/*
- * Copyright (c) 2010 Jakub Jermar
- * Copyright (c) 2010 Jiri Svoboda
- * 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 libcia64 ia64
- * @ingroup lc
- * @{
- */
-/** @file
- */
-
-#include <sys/types.h>
-#include <bool.h>
-#include <errno.h>
-
-#include <stacktrace.h>
-
-bool stacktrace_fp_valid(stacktrace_t *st, uintptr_t fp)
-{
-	(void) st; (void) fp;
-	return false;
-}
-
-int stacktrace_fp_prev(stacktrace_t *st, uintptr_t fp, uintptr_t *prev)
-{
-	(void) st; (void) fp; (void) prev;
-	return ENOTSUP;
-}
-
-int stacktrace_ra_get(stacktrace_t *st, uintptr_t fp, uintptr_t *ra)
-{
-	(void) st; (void) fp; (void) ra;
-	return ENOTSUP;
-}
-
-/** @}
- */
Index: pace/lib/libc/arch/ia64/src/stacktrace_asm.S
===================================================================
--- uspace/lib/libc/arch/ia64/src/stacktrace_asm.S	(revision bca408bfd84743b83b4ee34646013041a86f2ccf)
+++ 	(revision )
@@ -1,41 +1,0 @@
-#
-# Copyright (c) 2009 Jakub Jermar
-# 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.
-#
-
-.text
-
-.global stacktrace_prepare
-.global stacktrace_fp_get
-.global stacktrace_pc_get
-
-stacktrace_prepare:
-	br.ret.sptk.many b0
-
-stacktrace_fp_get:
-stacktrace_pc_get:
-	mov r8 = r0
-	br.ret.sptk.many b0
Index: uspace/lib/libc/arch/mips32/Makefile.inc
===================================================================
--- uspace/lib/libc/arch/mips32/Makefile.inc	(revision bca408bfd84743b83b4ee34646013041a86f2ccf)
+++ uspace/lib/libc/arch/mips32/Makefile.inc	(revision 1715b6af7847ebb95ae42eba99295f3291f1d1b5)
@@ -36,6 +36,5 @@
 	arch/$(UARCH)/src/fibril.S \
 	arch/$(UARCH)/src/tls.c \
-	arch/$(UARCH)/src/stacktrace.c \
-	arch/$(UARCH)/src/stacktrace_asm.S
+	arch/$(UARCH)/src/stacktrace.S
 
 GCC_CFLAGS += -mips3
Index: pace/lib/libc/arch/mips32/include/istate.h
===================================================================
--- uspace/lib/libc/arch/mips32/include/istate.h	(revision bca408bfd84743b83b4ee34646013041a86f2ccf)
+++ 	(revision )
@@ -1,88 +1,0 @@
-/*
- * Copyright (c) 2010 Jiri Svoboda
- * 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 libcmips32
- * @{
- */
-/** @file
- */
-
-#ifndef LIBC_mips32__ISTATE_H_
-#define LIBC_mips32__ISTATE_H_
-
-#include <sys/types.h>
-
-/** Interrupt context.
- *
- * This is a copy of the kernel definition with which it must be kept in sync.
- */
-typedef struct istate {
-	uint32_t at;
-	uint32_t v0;
-	uint32_t v1;
-	uint32_t a0;
-	uint32_t a1;
-	uint32_t a2;
-	uint32_t a3;
-	uint32_t t0;
-	uint32_t t1;
-	uint32_t t2;
-	uint32_t t3;
-	uint32_t t4;
-	uint32_t t5;
-	uint32_t t6;
-	uint32_t t7;
-	uint32_t t8;
-	uint32_t t9;
-	uint32_t gp;
-	uint32_t sp;
-	uint32_t ra;
-
-	uint32_t lo;
-	uint32_t hi;
-
-	uint32_t status; /* cp0_status */
-	uint32_t epc; /* cp0_epc */
-	uint32_t k1; /* We use it as thread-local pointer */
-} istate_t;
-
-static inline uintptr_t istate_get_pc(istate_t *istate)
-{
-	return istate->epc;
-}
-
-static inline uintptr_t istate_get_fp(istate_t *istate)
-{
-	/* TODO */
-	return 0;
-}
-
-#endif
-
-/** @}
- */
Index: uspace/lib/libc/arch/mips32/include/types.h
===================================================================
--- uspace/lib/libc/arch/mips32/include/types.h	(revision bca408bfd84743b83b4ee34646013041a86f2ccf)
+++ uspace/lib/libc/arch/mips32/include/types.h	(revision 1715b6af7847ebb95ae42eba99295f3291f1d1b5)
@@ -37,6 +37,4 @@
 #define LIBC_mips32_TYPES_H_
 
-#define __32_BITS__
-
 typedef unsigned int sysarg_t;
 
Index: uspace/lib/libc/arch/mips32/src/stacktrace.S
===================================================================
--- uspace/lib/libc/arch/mips32/src/stacktrace.S	(revision 1715b6af7847ebb95ae42eba99295f3291f1d1b5)
+++ uspace/lib/libc/arch/mips32/src/stacktrace.S	(revision 1715b6af7847ebb95ae42eba99295f3291f1d1b5)
@@ -0,0 +1,46 @@
+#
+# Copyright (c) 2009 Jakub Jermar
+# 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.
+#
+
+.text
+
+.set noat
+.set noreorder
+
+.global frame_pointer_get
+.global frame_pointer_prev
+.global frame_pointer_validate
+.global return_address_get
+.global program_counter_get
+
+frame_pointer_get:
+frame_pointer_prev:
+frame_pointer_validate:
+return_address_get:
+program_counter_get:
+	j $ra
+	xor $v0, $v0
Index: pace/lib/libc/arch/mips32/src/stacktrace.c
===================================================================
--- uspace/lib/libc/arch/mips32/src/stacktrace.c	(revision bca408bfd84743b83b4ee34646013041a86f2ccf)
+++ 	(revision )
@@ -1,62 +1,0 @@
-/*
- * Copyright (c) 2010 Jakub Jermar
- * Copyright (c) 2010 Jiri Svoboda
- * 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 libcmips32 mips32
- * @ingroup lc
- * @{
- */
-/** @file
- */
-
-#include <sys/types.h>
-#include <bool.h>
-#include <errno.h>
-
-#include <stacktrace.h>
-
-bool stacktrace_fp_valid(stacktrace_t *st, uintptr_t fp)
-{
-	(void) st; (void) fp;
-	return false;
-}
-
-int stacktrace_fp_prev(stacktrace_t *st, uintptr_t fp, uintptr_t *prev)
-{
-	(void) st; (void) fp; (void) prev;
-	return ENOTSUP;
-}
-
-int stacktrace_ra_get(stacktrace_t *st, uintptr_t fp, uintptr_t *ra)
-{
-	(void) st; (void) fp; (void) ra;
-	return ENOTSUP;
-}
-
-/** @}
- */
Index: pace/lib/libc/arch/mips32/src/stacktrace_asm.S
===================================================================
--- uspace/lib/libc/arch/mips32/src/stacktrace_asm.S	(revision bca408bfd84743b83b4ee34646013041a86f2ccf)
+++ 	(revision )
@@ -1,42 +1,0 @@
-#
-# Copyright (c) 2009 Jakub Jermar
-# 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.
-#
-
-.text
-
-.set noat
-.set noreorder
-
-.global stacktrace_prepare
-.global stacktrace_fp_get
-.global stacktrace_pc_get
-
-stacktrace_prepare:
-stacktrace_fp_get:
-stacktrace_pc_get:
-	j $ra
-	xor $v0, $v0
Index: uspace/lib/libc/arch/mips32eb/Makefile.inc
===================================================================
--- uspace/lib/libc/arch/mips32eb/Makefile.inc	(revision bca408bfd84743b83b4ee34646013041a86f2ccf)
+++ uspace/lib/libc/arch/mips32eb/Makefile.inc	(revision 1715b6af7847ebb95ae42eba99295f3291f1d1b5)
@@ -36,6 +36,5 @@
 	arch/$(UARCH)/src/fibril.S \
 	arch/$(UARCH)/src/tls.c \
-	arch/$(UARCH)/src/stacktrace.c \
-	arch/$(UARCH)/src/stacktrace_asm.S
+	arch/$(UARCH)/src/stacktrace.S
 
 GCC_CFLAGS += -mips3
Index: pace/lib/libc/arch/mips32eb/include/istate.h
===================================================================
--- uspace/lib/libc/arch/mips32eb/include/istate.h	(revision bca408bfd84743b83b4ee34646013041a86f2ccf)
+++ 	(revision )
@@ -1,1 +1,0 @@
-../../mips32/include/istate.h
Index: uspace/lib/libc/arch/ppc32/Makefile.inc
===================================================================
--- uspace/lib/libc/arch/ppc32/Makefile.inc	(revision bca408bfd84743b83b4ee34646013041a86f2ccf)
+++ uspace/lib/libc/arch/ppc32/Makefile.inc	(revision 1715b6af7847ebb95ae42eba99295f3291f1d1b5)
@@ -36,6 +36,5 @@
 	arch/$(UARCH)/src/fibril.S \
 	arch/$(UARCH)/src/tls.c \
-	arch/$(UARCH)/src/stacktrace.c \
-	arch/$(UARCH)/src/stacktrace_asm.S
+	arch/$(UARCH)/src/stacktrace.S
 
 GCC_CFLAGS += -mcpu=powerpc -msoft-float -m32
Index: pace/lib/libc/arch/ppc32/include/istate.h
===================================================================
--- uspace/lib/libc/arch/ppc32/include/istate.h	(revision bca408bfd84743b83b4ee34646013041a86f2ccf)
+++ 	(revision )
@@ -1,99 +1,0 @@
-/*
- * Copyright (c) 2010 Jiri Svoboda
- * 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 libcppc32
- * @{
- */
-/** @file
- */
-
-#ifndef LIBC_ppc32_ISTATE_H_
-#define LIBC_ppc32_ISTATE_H_
-
-#include <sys/types.h>
-
-/** Interrupt context.
- *
- * This is a copy of the kernel definition with which it must be kept in sync.
- */
-typedef struct istate {
-	uint32_t r0;
-	uint32_t r2;
-	uint32_t r3;
-	uint32_t r4;
-	uint32_t r5;
-	uint32_t r6;
-	uint32_t r7;
-	uint32_t r8;
-	uint32_t r9;
-	uint32_t r10;
-	uint32_t r11;
-	uint32_t r13;
-	uint32_t r14;
-	uint32_t r15;
-	uint32_t r16;
-	uint32_t r17;
-	uint32_t r18;
-	uint32_t r19;
-	uint32_t r20;
-	uint32_t r21;
-	uint32_t r22;
-	uint32_t r23;
-	uint32_t r24;
-	uint32_t r25;
-	uint32_t r26;
-	uint32_t r27;
-	uint32_t r28;
-	uint32_t r29;
-	uint32_t r30;
-	uint32_t r31;
-	uint32_t cr;
-	uint32_t pc;
-	uint32_t srr1;
-	uint32_t lr;
-	uint32_t ctr;
-	uint32_t xer;
-	uint32_t dar;
-	uint32_t r12;
-	uint32_t sp;
-} istate_t;
-
-static inline uintptr_t istate_get_pc(istate_t *istate)
-{
-	return istate->pc;
-}
-
-static inline uintptr_t istate_get_fp(istate_t *istate)
-{
-	return istate->sp;
-}
-
-#endif
-
-/** @}
- */
Index: uspace/lib/libc/arch/ppc32/include/types.h
===================================================================
--- uspace/lib/libc/arch/ppc32/include/types.h	(revision bca408bfd84743b83b4ee34646013041a86f2ccf)
+++ uspace/lib/libc/arch/ppc32/include/types.h	(revision 1715b6af7847ebb95ae42eba99295f3291f1d1b5)
@@ -36,6 +36,4 @@
 #define LIBC_ppc32_TYPES_H_
 
-#define __32_BITS__
-
 typedef unsigned int sysarg_t;
 
Index: uspace/lib/libc/arch/ppc32/src/stacktrace.S
===================================================================
--- uspace/lib/libc/arch/ppc32/src/stacktrace.S	(revision 1715b6af7847ebb95ae42eba99295f3291f1d1b5)
+++ uspace/lib/libc/arch/ppc32/src/stacktrace.S	(revision 1715b6af7847ebb95ae42eba99295f3291f1d1b5)
@@ -0,0 +1,56 @@
+#
+# Copyright (c) 2009 Jakub Jermar
+# 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.
+#
+
+.text
+
+#include <libarch/regname.h>
+
+.global frame_pointer_get
+.global frame_pointer_prev
+.global frame_pointer_validate
+.global return_address_get
+.global program_counter_get
+
+frame_pointer_get:
+	mr r3, sp
+	blr
+
+frame_pointer_prev:
+	lwz r3, 0(r3)
+	blr
+
+frame_pointer_validate:
+	blr
+
+return_address_get:
+	lwz r3, 4(r3)
+	blr
+
+program_counter_get:
+	mflr r3
+	blr
Index: pace/lib/libc/arch/ppc32/src/stacktrace.c
===================================================================
--- uspace/lib/libc/arch/ppc32/src/stacktrace.c	(revision bca408bfd84743b83b4ee34646013041a86f2ccf)
+++ 	(revision )
@@ -1,62 +1,0 @@
-/*
- * Copyright (c) 2010 Jakub Jermar
- * Copyright (c) 2010 Jiri Svoboda
- * 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 libcppc32 ppc32
- * @ingroup lc
- * @{
- */
-/** @file
- */
-
-#include <sys/types.h>
-#include <bool.h>
-
-#include <stacktrace.h>
-
-#define FRAME_OFFSET_FP_PREV	0
-#define FRAME_OFFSET_RA		4
-
-bool stacktrace_fp_valid(stacktrace_t *st, uintptr_t fp)
-{
-	(void) st;
-	return fp != 0;
-}
-
-int stacktrace_fp_prev(stacktrace_t *st, uintptr_t fp, uintptr_t *prev)
-{
-	return (*st->read_uintptr)(st->op_arg, fp + FRAME_OFFSET_FP_PREV, prev);
-}
-
-int stacktrace_ra_get(stacktrace_t *st, uintptr_t fp, uintptr_t *ra)
-{
-	return (*st->read_uintptr)(st->op_arg, fp + FRAME_OFFSET_RA, ra);
-}
-
-/** @}
- */
Index: pace/lib/libc/arch/ppc32/src/stacktrace_asm.S
===================================================================
--- uspace/lib/libc/arch/ppc32/src/stacktrace_asm.S	(revision bca408bfd84743b83b4ee34646013041a86f2ccf)
+++ 	(revision )
@@ -1,46 +1,0 @@
-#
-# Copyright (c) 2009 Jakub Jermar
-# 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.
-#
-
-.text
-
-#include <libarch/regname.h>
-
-.global stacktrace_prepare
-.global stacktrace_fp_get
-.global stacktrace_pc_get
-
-stacktrace_prepare:
-	blr
-
-stacktrace_fp_get:
-	mr r3, sp
-	blr
-
-stacktrace_pc_get:
-	mflr r3
-	blr
Index: uspace/lib/libc/arch/sparc64/Makefile.inc
===================================================================
--- uspace/lib/libc/arch/sparc64/Makefile.inc	(revision bca408bfd84743b83b4ee34646013041a86f2ccf)
+++ uspace/lib/libc/arch/sparc64/Makefile.inc	(revision 1715b6af7847ebb95ae42eba99295f3291f1d1b5)
@@ -35,6 +35,5 @@
 ARCH_SOURCES += arch/$(UARCH)/src/fibril.S \
 	arch/$(UARCH)/src/tls.c \
-	arch/$(UARCH)/src/stacktrace.c \
-	arch/$(UARCH)/src/stacktrace_asm.S
+	arch/$(UARCH)/src/stacktrace.S
 
 GCC_CFLAGS += -mcpu=ultrasparc -m64
Index: pace/lib/libc/arch/sparc64/include/istate.h
===================================================================
--- uspace/lib/libc/arch/sparc64/include/istate.h	(revision bca408bfd84743b83b4ee34646013041a86f2ccf)
+++ 	(revision )
@@ -1,63 +1,0 @@
-/*
- * Copyright (c) 2010 Jiri Svoboda
- * 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 libcsparc64
- * @{
- */
-/** @file
- */
-
-#ifndef LIBC_sparc64_ISTATE_H_
-#define LIBC_sparc64_ISTATE_H_
-
-#include <sys/types.h>
-
-/** Interrupt context.
- *
- * This is a copy of the kernel definition with which it must be kept in sync.
- */
-typedef struct istate {
-	/* TODO */
-} istate_t;
-
-static inline uintptr_t istate_get_pc(istate_t *istate)
-{
-	/* TODO */
-	return 0;
-}
-
-static inline uintptr_t istate_get_fp(istate_t *istate)
-{
-	/* TODO */
-	return 0;
-}
-
-#endif
-
-/** @}
- */
Index: uspace/lib/libc/arch/sparc64/include/types.h
===================================================================
--- uspace/lib/libc/arch/sparc64/include/types.h	(revision bca408bfd84743b83b4ee34646013041a86f2ccf)
+++ uspace/lib/libc/arch/sparc64/include/types.h	(revision 1715b6af7847ebb95ae42eba99295f3291f1d1b5)
@@ -36,6 +36,4 @@
 #define LIBC_sparc64_TYPES_H_
 
-#define __64_BITS__
-
 typedef unsigned long sysarg_t;
 
Index: uspace/lib/libc/arch/sparc64/src/stacktrace.S
===================================================================
--- uspace/lib/libc/arch/sparc64/src/stacktrace.S	(revision 1715b6af7847ebb95ae42eba99295f3291f1d1b5)
+++ uspace/lib/libc/arch/sparc64/src/stacktrace.S	(revision 1715b6af7847ebb95ae42eba99295f3291f1d1b5)
@@ -0,0 +1,71 @@
+#
+# Copyright (c) 2009 Jakub Jermar
+# 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 <libarch/stack.h>
+
+.text
+
+.global frame_pointer_get
+.global frame_pointer_prev
+.global frame_pointer_validate
+.global return_address_get
+.global program_counter_get
+
+frame_pointer_get:
+	# Add the stack bias to %sp to get the actual address.
+	retl
+	add %sp, STACK_BIAS, %o0
+
+frame_pointer_prev:
+	save %sp, -(STACK_WINDOW_SAVE_AREA_SIZE+STACK_ARG_SAVE_AREA_SIZE), %sp
+	# Flush all other windows to memory so that we can read their contents.
+	flushw
+	# Read the %fp from the window save area.
+	ldx [%i0 + 14 * 8], %i0
+	# Add the stack bias to the %fp read from the window save area.
+	add %i0, STACK_BIAS, %i0
+	ret
+	restore
+
+frame_pointer_validate:
+	retl
+	nop
+
+return_address_get:
+	save %sp, -(STACK_WINDOW_SAVE_AREA_SIZE+STACK_ARG_SAVE_AREA_SIZE), %sp
+	# Flush all other windows to memory so that we can read their contents.
+	flushw
+	# Read the %i7 from the window save area.
+	ldx [%i0 + 15 * 8], %i0
+	ret
+	restore
+
+program_counter_get:
+	retl
+	mov %o7, %o0
+
Index: pace/lib/libc/arch/sparc64/src/stacktrace.c
===================================================================
--- uspace/lib/libc/arch/sparc64/src/stacktrace.c	(revision bca408bfd84743b83b4ee34646013041a86f2ccf)
+++ 	(revision )
@@ -1,69 +1,0 @@
-/*
- * Copyright (c) 2010 Jakub Jermar
- * Copyright (c) 2010 Jiri Svoboda
- * 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 sparc64
- * @{
- */
-/** @file
- */
-
-#include <sys/types.h>
-#include <bool.h>
-#include <libarch/stack.h>
-#include <errno.h>
-
-#include <stacktrace.h>
-
-#define FRAME_OFFSET_FP_PREV	(14 * 8)
-#define FRAME_OFFSET_RA		(15 * 8)
-
-bool stacktrace_fp_valid(stacktrace_t *st, uintptr_t fp)
-{
-	(void) st;
-	return fp != 0;
-}
-
-int stacktrace_fp_prev(stacktrace_t *st, uintptr_t fp, uintptr_t *prev)
-{
-	uintptr_t bprev;
-	int rc;
-
-	rc = (*st->read_uintptr)(st->op_arg, fp + FRAME_OFFSET_FP_PREV, &bprev);
-	if (rc == EOK)
-		*prev = bprev + STACK_BIAS;
-	return rc;
-}
-
-int stacktrace_ra_get(stacktrace_t *st, uintptr_t fp, uintptr_t *ra)
-{
-	return (*st->read_uintptr)(st->op_arg, fp + FRAME_OFFSET_RA, ra);
-}
-
-/** @}
- */
Index: pace/lib/libc/arch/sparc64/src/stacktrace_asm.S
===================================================================
--- uspace/lib/libc/arch/sparc64/src/stacktrace_asm.S	(revision bca408bfd84743b83b4ee34646013041a86f2ccf)
+++ 	(revision )
@@ -1,51 +1,0 @@
-#
-# Copyright (c) 2009 Jakub Jermar
-# 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 <libarch/stack.h>
-
-.text
-
-.global stacktrace_prepare
-.global stacktrace_fp_get
-.global stacktrace_pc_get
-
-stacktrace_prepare:
-	save %sp, -(STACK_WINDOW_SAVE_AREA_SIZE+STACK_ARG_SAVE_AREA_SIZE), %sp
-	# Flush all other windows to memory so that we can read their contents.
-	flushw
-	ret
-	restore
-
-stacktrace_fp_get:
-	# Add the stack bias to %sp to get the actual address.
-	retl
-	add %sp, STACK_BIAS, %o0
-
-stacktrace_pc_get:
-	retl
-	mov %o7, %o0
Index: uspace/lib/libc/generic/stacktrace.c
===================================================================
--- uspace/lib/libc/generic/stacktrace.c	(revision bca408bfd84743b83b4ee34646013041a86f2ccf)
+++ uspace/lib/libc/generic/stacktrace.c	(revision 1715b6af7847ebb95ae42eba99295f3291f1d1b5)
@@ -1,5 +1,4 @@
 /*
  * Copyright (c) 2009 Jakub Jermar
- * Copyright (c) 2010 Jiri Svoboda
  * All rights reserved.
  *
@@ -37,40 +36,22 @@
 #include <stdio.h>
 #include <sys/types.h>
-#include <errno.h>
 
-static int stacktrace_read_uintptr(void *arg, uintptr_t addr, uintptr_t *data);
-
-void stacktrace_print_fp_pc(uintptr_t fp, uintptr_t pc)
+void stack_trace_fp_pc(uintptr_t fp, uintptr_t pc)
 {
-	stacktrace_t st;
-	uintptr_t nfp;
-
-	st.op_arg = NULL;
-	st.read_uintptr = stacktrace_read_uintptr;
-
-	while (stacktrace_fp_valid(&st, fp)) {
+	while (frame_pointer_validate(fp)) {
 		printf("%p: %p()\n", fp, pc);
-		(void) stacktrace_ra_get(&st, fp, &pc);
-		(void) stacktrace_fp_prev(&st, fp, &nfp);
-		fp = nfp;
+		pc = return_address_get(fp);
+		fp = frame_pointer_prev(fp);
 	}
 }
 
-void stacktrace_print(void)
+void stack_trace(void)
 {
-	stacktrace_prepare();
-	stacktrace_print_fp_pc(stacktrace_fp_get(), stacktrace_pc_get());
+	stack_trace_fp_pc(frame_pointer_get(), program_counter_get());
 	/*
 	 * Prevent the tail call optimization of the previous call by
 	 * making it a non-tail call.
 	 */
-	(void) stacktrace_fp_get();
-}
-
-static int stacktrace_read_uintptr(void *arg, uintptr_t addr, uintptr_t *data)
-{
-	(void) arg;
-	*data = *((uintptr_t *) addr);
-	return EOK;
+	(void) frame_pointer_get();
 }
 
Index: uspace/lib/libc/generic/udebug.c
===================================================================
--- uspace/lib/libc/generic/udebug.c	(revision bca408bfd84743b83b4ee34646013041a86f2ccf)
+++ uspace/lib/libc/generic/udebug.c	(revision 1715b6af7847ebb95ae42eba99295f3291f1d1b5)
@@ -69,34 +69,4 @@
 }
 
-int udebug_name_read(int phoneid, void *buffer, size_t n,
-	size_t *copied, size_t *needed)
-{
-	ipcarg_t a_copied, a_needed;
-	int rc;
-
-	rc = async_req_3_3(phoneid, IPC_M_DEBUG_ALL, UDEBUG_M_NAME_READ,
-		(sysarg_t)buffer, n, NULL, &a_copied, &a_needed);
-
-	*copied = (size_t)a_copied;
-	*needed = (size_t)a_needed;
-
-	return rc;
-}
-
-int udebug_areas_read(int phoneid, void *buffer, size_t n,
-	size_t *copied, size_t *needed)
-{
-	ipcarg_t a_copied, a_needed;
-	int rc;
-
-	rc = async_req_3_3(phoneid, IPC_M_DEBUG_ALL, UDEBUG_M_AREAS_READ,
-		(sysarg_t)buffer, n, NULL, &a_copied, &a_needed);
-
-	*copied = (size_t)a_copied;
-	*needed = (size_t)a_needed;
-
-	return rc;
-}
-
 int udebug_mem_read(int phoneid, void *buffer, uintptr_t addr, size_t n)
 {
@@ -108,10 +78,4 @@
 {
 	return async_req_3_0(phoneid, IPC_M_DEBUG_ALL, UDEBUG_M_ARGS_READ,
-	    tid, (sysarg_t)buffer);
-}
-
-int udebug_regs_read(int phoneid, thash_t tid, void *buffer)
-{
-	return async_req_3_0(phoneid, IPC_M_DEBUG_ALL, UDEBUG_M_REGS_READ,
 	    tid, (sysarg_t)buffer);
 }
Index: uspace/lib/libc/include/stacktrace.h
===================================================================
--- uspace/lib/libc/include/stacktrace.h	(revision bca408bfd84743b83b4ee34646013041a86f2ccf)
+++ uspace/lib/libc/include/stacktrace.h	(revision 1715b6af7847ebb95ae42eba99295f3291f1d1b5)
@@ -1,5 +1,4 @@
 /*
  * Copyright (c) 2009 Jakub Jermar
- * Copyright (c) 2010 Jiri Svoboda
  * All rights reserved.
  *
@@ -40,22 +39,15 @@
 #include <bool.h>
 
-typedef struct {
-	void *op_arg;
-	int (*read_uintptr)(void *, uintptr_t, uintptr_t *);
-} stacktrace_t;
-
-extern void stacktrace_print(void);
-extern void stacktrace_print_fp_pc(uintptr_t, uintptr_t);
+extern void stack_trace(void);
+extern void stack_trace_fp_pc(uintptr_t, uintptr_t);
 
 /*
  * The following interface is to be implemented by each architecture.
  */
-extern bool stacktrace_fp_valid(stacktrace_t *, uintptr_t);
-extern int stacktrace_fp_prev(stacktrace_t *, uintptr_t, uintptr_t *);
-extern int stacktrace_ra_get(stacktrace_t *, uintptr_t, uintptr_t *);
-
-extern void stacktrace_prepare(void);
-extern uintptr_t stacktrace_fp_get(void);
-extern uintptr_t stacktrace_pc_get();
+extern bool frame_pointer_validate(uintptr_t);
+extern uintptr_t frame_pointer_get(void);
+extern uintptr_t frame_pointer_prev(uintptr_t);
+extern uintptr_t return_address_get(uintptr_t);
+extern uintptr_t program_counter_get();
 
 #endif
Index: uspace/lib/libc/include/stdlib.h
===================================================================
--- uspace/lib/libc/include/stdlib.h	(revision bca408bfd84743b83b4ee34646013041a86f2ccf)
+++ uspace/lib/libc/include/stdlib.h	(revision 1715b6af7847ebb95ae42eba99295f3291f1d1b5)
@@ -42,5 +42,5 @@
 #define abort() \
 	do { \
-		stacktrace_print(); \
+		stack_trace(); \
 		_exit(1); \
 	} while (0)
Index: uspace/lib/libc/include/udebug.h
===================================================================
--- uspace/lib/libc/include/udebug.h	(revision bca408bfd84743b83b4ee34646013041a86f2ccf)
+++ uspace/lib/libc/include/udebug.h	(revision 1715b6af7847ebb95ae42eba99295f3291f1d1b5)
@@ -47,11 +47,6 @@
 int udebug_thread_read(int phoneid, void *buffer, size_t n,
 	size_t *copied, size_t *needed);
-int udebug_name_read(int phoneid, void *buffer, size_t n,
-	size_t *copied, size_t *needed);
-int udebug_areas_read(int phoneid, void *buffer, size_t n,
-	size_t *copied, size_t *needed);
 int udebug_mem_read(int phoneid, void *buffer, uintptr_t addr, size_t n);
 int udebug_args_read(int phoneid, thash_t tid, sysarg_t *buffer);
-int udebug_regs_read(int phoneid, thash_t tid, void *buffer);
 int udebug_go(int phoneid, thash_t tid, udebug_event_t *ev_type,
 	sysarg_t *val0, sysarg_t *val1);
Index: uspace/lib/libpci/Makefile.build
===================================================================
--- uspace/lib/libpci/Makefile.build	(revision 1715b6af7847ebb95ae42eba99295f3291f1d1b5)
+++ uspace/lib/libpci/Makefile.build	(revision 1715b6af7847ebb95ae42eba99295f3291f1d1b5)
@@ -0,0 +1,64 @@
+#
+# Copyright (c) 2005 Martin Decky
+# Copyright (c) 2007 Jakub Jermar
+# 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.
+#
+
+## Setup toolchain
+#
+
+include Makefile.common
+include $(LIBC_PREFIX)/Makefile.toolchain
+
+## Sources
+#
+
+SOURCES = \
+	access.c \
+	generic.c \
+	names.c \
+	i386-ports.c
+
+OBJECTS := $(addsuffix .o,$(basename $(SOURCES)))
+
+.PHONY: all
+
+all: $(LIBPCI)
+
+-include $(DEPEND)
+
+$(LIBPCI): $(OBJECTS)
+	$(AR) rc $@ $(OBJECTS)
+
+%.o: %.c $(DEPEND)
+	$(CC) $(DEFS) $(CFLAGS) -c $< -o $@
+ifeq ($(PRECHECK),y)
+	$(JOBFILE) $(JOB) $< $@ cc core $(DEFS) $(CFLAGS)
+endif
+
+$(DEPEND):
+	makedepend -f - -- $(DEPEND_DEFS) $(CFLAGS) -- $(SOURCES) > $@ 2> /dev/null
+	-[ -f $(DEPEND_PREV) ] && diff -q $(DEPEND_PREV) $@ && mv -f $(DEPEND_PREV) $@
Index: uspace/lib/libpci/Makefile.common
===================================================================
--- uspace/lib/libpci/Makefile.common	(revision 1715b6af7847ebb95ae42eba99295f3291f1d1b5)
+++ uspace/lib/libpci/Makefile.common	(revision 1715b6af7847ebb95ae42eba99295f3291f1d1b5)
@@ -0,0 +1,37 @@
+#
+# Copyright (c) 2005 Martin Decky
+# 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.
+#
+
+
+## Common names
+#
+
+LIBC_PREFIX = ../../../../../lib/libc
+DEPEND = Makefile.depend
+DEPEND_PREV = $(DEPEND).prev
+JOB = libpci.job
+LIBPCI = libpci.a
Index: uspace/srv/hid/kbd/port/i8042.h
===================================================================
--- uspace/srv/hid/kbd/port/i8042.h	(revision 1715b6af7847ebb95ae42eba99295f3291f1d1b5)
+++ uspace/srv/hid/kbd/port/i8042.h	(revision 1715b6af7847ebb95ae42eba99295f3291f1d1b5)
@@ -0,0 +1,55 @@
+/*
+ * Copyright (c) 2006 Josef Cejka
+ * 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 kbd_port
+ * @ingroup  kbd
+ * @{
+ */
+
+/** @file
+ * @brief i8042 port driver.
+ */
+
+#ifndef KBD_PORT_i8042_H_
+#define KBD_PORT_i8042_H_
+
+#include <libarch/ddi.h>
+#include <libarch/types.h>
+
+struct i8042 {
+	ioport8_t data;
+	uint8_t pad[3];
+	ioport8_t status;
+} __attribute__ ((packed));
+typedef struct i8042 i8042_t;
+
+#endif
+
+/**
+ * @}
+ */ 
Index: uspace/srv/loader/arch/amd64/Makefile.inc
===================================================================
--- uspace/srv/loader/arch/amd64/Makefile.inc	(revision bca408bfd84743b83b4ee34646013041a86f2ccf)
+++ uspace/srv/loader/arch/amd64/Makefile.inc	(revision 1715b6af7847ebb95ae42eba99295f3291f1d1b5)
@@ -27,3 +27,4 @@
 #
 
+EXTRA_CFLAGS = -D__64_BITS__
 ARCH_SOURCES := arch/$(UARCH)/amd64.s
Index: uspace/srv/loader/arch/arm32/Makefile.inc
===================================================================
--- uspace/srv/loader/arch/arm32/Makefile.inc	(revision bca408bfd84743b83b4ee34646013041a86f2ccf)
+++ uspace/srv/loader/arch/arm32/Makefile.inc	(revision 1715b6af7847ebb95ae42eba99295f3291f1d1b5)
@@ -27,3 +27,4 @@
 #
 
+EXTRA_CFLAGS = -D__32_BITS__
 ARCH_SOURCES := arch/$(UARCH)/arm32.s
Index: uspace/srv/loader/arch/ia32/Makefile.inc
===================================================================
--- uspace/srv/loader/arch/ia32/Makefile.inc	(revision bca408bfd84743b83b4ee34646013041a86f2ccf)
+++ uspace/srv/loader/arch/ia32/Makefile.inc	(revision 1715b6af7847ebb95ae42eba99295f3291f1d1b5)
@@ -27,3 +27,4 @@
 #
 
+EXTRA_CFLAGS = -D__32_BITS__
 ARCH_SOURCES := arch/$(UARCH)/ia32.s
Index: uspace/srv/loader/arch/ia64/Makefile.inc
===================================================================
--- uspace/srv/loader/arch/ia64/Makefile.inc	(revision bca408bfd84743b83b4ee34646013041a86f2ccf)
+++ uspace/srv/loader/arch/ia64/Makefile.inc	(revision 1715b6af7847ebb95ae42eba99295f3291f1d1b5)
@@ -27,4 +27,5 @@
 #
 
+EXTRA_CFLAGS = -D__64_BITS__
 ARCH_SOURCES := arch/$(UARCH)/ia64.s
 AFLAGS += -xexplicit
Index: uspace/srv/loader/arch/mips32/Makefile.inc
===================================================================
--- uspace/srv/loader/arch/mips32/Makefile.inc	(revision bca408bfd84743b83b4ee34646013041a86f2ccf)
+++ uspace/srv/loader/arch/mips32/Makefile.inc	(revision 1715b6af7847ebb95ae42eba99295f3291f1d1b5)
@@ -27,3 +27,4 @@
 #
 
+EXTRA_CFLAGS = -D__32_BITS__
 ARCH_SOURCES := arch/$(UARCH)/mips32.s
Index: uspace/srv/loader/arch/ppc32/Makefile.inc
===================================================================
--- uspace/srv/loader/arch/ppc32/Makefile.inc	(revision bca408bfd84743b83b4ee34646013041a86f2ccf)
+++ uspace/srv/loader/arch/ppc32/Makefile.inc	(revision 1715b6af7847ebb95ae42eba99295f3291f1d1b5)
@@ -27,3 +27,4 @@
 #
 
+EXTRA_CFLAGS = -D__32_BITS__
 ARCH_SOURCES := arch/$(UARCH)/ppc32.s
Index: uspace/srv/loader/arch/sparc64/Makefile.inc
===================================================================
--- uspace/srv/loader/arch/sparc64/Makefile.inc	(revision bca408bfd84743b83b4ee34646013041a86f2ccf)
+++ uspace/srv/loader/arch/sparc64/Makefile.inc	(revision 1715b6af7847ebb95ae42eba99295f3291f1d1b5)
@@ -27,3 +27,4 @@
 #
 
+EXTRA_CFLAGS = -D__64_BITS__
 ARCH_SOURCES := arch/$(UARCH)/sparc64.s
Index: pace/srv/taskmon/Makefile
===================================================================
--- uspace/srv/taskmon/Makefile	(revision bca408bfd84743b83b4ee34646013041a86f2ccf)
+++ 	(revision )
@@ -1,37 +1,0 @@
-#
-# Copyright (c) 2010 Jiri Svoboda
-# 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.
-#
-
-USPACE_PREFIX = ../..
-LIBS = $(LIBC_PREFIX)/libc.a
-
-OUTPUT = taskmon
-
-SOURCES = \
-	taskmon.c
-
-include ../Makefile.common
Index: pace/srv/taskmon/taskmon.c
===================================================================
--- uspace/srv/taskmon/taskmon.c	(revision bca408bfd84743b83b4ee34646013041a86f2ccf)
+++ 	(revision )
@@ -1,121 +1,0 @@
-/*
- * Copyright (c) 2010 Jiri Svoboda
- * 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 taskmon
- * @brief
- * @{
- */
-/**
- * @file
- */
-
-#include <stdio.h>
-#include <ipc/ipc.h>
-#include <async.h>
-#include <ipc/services.h>
-#include <task.h>
-#include <event.h>
-#include <macros.h>
-#include <errno.h>
-
-#define NAME  "taskmon"
-
-static void fault_event(ipc_callid_t callid, ipc_call_t *call)
-{
-	char *argv[11];
-	char *fname;
-	char *dump_fname;
-	char *s_taskid;
-	char **s;
-
-	task_id_t taskid;
-	uintptr_t thread;
-
-	taskid = MERGE_LOUP32(IPC_GET_ARG1(*call), IPC_GET_ARG2(*call));
-	thread = IPC_GET_ARG3(*call);
-
-	if (asprintf(&s_taskid, "%lld", taskid) < 0) {
-		printf("Memory allocation failed.\n");
-		return;
-	}
-
-	if (asprintf(&dump_fname, "/scratch/d%lld.txt", taskid) < 0) {
-		printf("Memory allocation failed.\n");
-		return;
-	}
-
-	printf(NAME ": Task %lld fault in thread 0x%lx.\n", taskid, thread);
-
-	argv[0] = fname = "/app/redir";
-	argv[1] = "-i";
-	argv[2] = "/readme";
-	argv[3] = "-o";
-	argv[4] = dump_fname;
-	argv[5] = "--";
-
-#ifdef CONFIG_VERBOSE_DUMPS
-	argv[6] = "/app/taskdump";
-	argv[7] = "-m";
-	argv[8] = "-t";
-	argv[9] = s_taskid;
-	argv[10] = NULL;
-#else
-	argv[6] = "/app/taskdump";
-	argv[7] = "-t";
-	argv[8] = s_taskid;
-	argv[9] = NULL;
-#endif
-	printf(NAME ": Executing");
-        s = argv;
-	while (*s != NULL) {
-		printf(" %s", *s);
-		++s;
-	}
-	putchar('\n');
-
-	if (!task_spawn(fname, argv))
-		printf(NAME ": Error spawning taskdump.\n", fname);
-}
-
-int main(int argc, char *argv[])
-{
-	printf(NAME ": Task Monitoring Service\n");
-
-	if (event_subscribe(EVENT_FAULT, 0) != EOK) {
-		printf(NAME ": Error registering fault notifications.\n");
-		return -1;
-	}
-
-	async_set_interrupt_received(fault_event);
-	async_manager();
-
-	return 0;
-}
-
-/** @}
- */
