Index: uspace/lib/c/arch/arm32/include/atomic.h
===================================================================
--- uspace/lib/c/arch/arm32/include/atomic.h	(revision 6ecf5b8322ea8b1cfad0e7246655beef88ab3194)
+++ 	(revision )
@@ -1,204 +1,0 @@
-/*
- * Copyright (c) 2007 Michal Kebrt
- * 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
- *  @brief Atomic operations.
- */
-
-#ifndef LIBC_arm32_ATOMIC_H_
-#define LIBC_arm32_ATOMIC_H_
-
-#define LIBC_ARCH_ATOMIC_H_
-#define CAS
-
-#include <atomicdflt.h>
-#include <bool.h>
-#include <sys/types.h>
-
-extern uintptr_t *ras_page;
-
-static inline bool cas(atomic_t *val, atomic_count_t ov, atomic_count_t nv)
-{
-	atomic_count_t ret = 0;
-	
-	/*
-	 * The following instructions between labels 1 and 2 constitute a
-	 * Restartable Atomic Seqeunce. Should the sequence be non-atomic,
-	 * the kernel will restart it.
-	 */
-	asm volatile (
-		"1:\n"
-		"	adr %[ret], 1b\n"
-		"	str %[ret], %[rp0]\n"
-		"	adr %[ret], 2f\n"
-		"	str %[ret], %[rp1]\n"
-		"	ldr %[ret], %[addr]\n"
-		"	cmp %[ret], %[ov]\n"
-		"	streq %[nv], %[addr]\n"
-		"2:\n"
-		"	moveq %[ret], #1\n"
-		"	movne %[ret], #0\n"
-		: [ret] "+&r" (ret),
-		  [rp0] "=m" (ras_page[0]),
-		  [rp1] "=m" (ras_page[1]),
-		  [addr] "+m" (val->count)
-		: [ov] "r" (ov),
-		  [nv] "r" (nv)
-		: "memory"
-	);
-	
-	ras_page[0] = 0;
-	asm volatile (
-		"" ::: "memory"
-	);
-	ras_page[1] = 0xffffffff;
-	
-	return (bool) ret;
-}
-
-/** Atomic addition.
- *
- * @param val Where to add.
- * @param i   Value to be added.
- *
- * @return Value after addition.
- *
- */
-static inline atomic_count_t atomic_add(atomic_t *val, atomic_count_t i)
-{
-	atomic_count_t ret = 0;
-	
-	/*
-	 * The following instructions between labels 1 and 2 constitute a
-	 * Restartable Atomic Seqeunce. Should the sequence be non-atomic,
-	 * the kernel will restart it.
-	 */
-	asm volatile (
-		"1:\n"
-		"	adr %[ret], 1b\n"
-		"	str %[ret], %[rp0]\n"
-		"	adr %[ret], 2f\n"
-		"	str %[ret], %[rp1]\n"
-		"	ldr %[ret], %[addr]\n"
-		"	add %[ret], %[ret], %[imm]\n"
-		"	str %[ret], %[addr]\n"
-		"2:\n"
-		: [ret] "+&r" (ret),
-		  [rp0] "=m" (ras_page[0]),
-		  [rp1] "=m" (ras_page[1]),
-		  [addr] "+m" (val->count)
-		: [imm] "r" (i)
-	);
-	
-	ras_page[0] = 0;
-	asm volatile (
-		"" ::: "memory"
-	);
-	ras_page[1] = 0xffffffff;
-	
-	return ret;
-}
-
-
-/** Atomic increment.
- *
- * @param val Variable to be incremented.
- *
- */
-static inline void atomic_inc(atomic_t *val)
-{
-	atomic_add(val, 1);
-}
-
-
-/** Atomic decrement.
- *
- * @param val Variable to be decremented.
- *
- */
-static inline void atomic_dec(atomic_t *val)
-{
-	atomic_add(val, -1);
-}
-
-
-/** Atomic pre-increment.
- *
- * @param val Variable to be incremented.
- * @return    Value after incrementation.
- *
- */
-static inline atomic_count_t atomic_preinc(atomic_t *val)
-{
-	return atomic_add(val, 1);
-}
-
-
-/** Atomic pre-decrement.
- *
- * @param val Variable to be decremented.
- * @return    Value after decrementation.
- *
- */
-static inline atomic_count_t atomic_predec(atomic_t *val)
-{
-	return atomic_add(val, -1);
-}
-
-
-/** Atomic post-increment.
- *
- * @param val Variable to be incremented.
- * @return    Value before incrementation.
- *
- */
-static inline atomic_count_t atomic_postinc(atomic_t *val)
-{
-	return atomic_add(val, 1) - 1;
-}
-
-
-/** Atomic post-decrement.
- *
- * @param val Variable to be decremented.
- * @return    Value before decrementation.
- *
- */
-static inline atomic_count_t atomic_postdec(atomic_t *val)
-{
-	return atomic_add(val, -1) + 1;
-}
-
-
-#endif
-
-/** @}
- */
Index: uspace/lib/c/arch/arm32/include/barrier.h
===================================================================
--- uspace/lib/c/arch/arm32/include/barrier.h	(revision 6ecf5b8322ea8b1cfad0e7246655beef88ab3194)
+++ 	(revision )
@@ -1,1 +1,0 @@
-../../../../../../kernel/arch/arm32/include/arch/barrier.h
Index: uspace/lib/c/arch/arm32/include/config.h
===================================================================
--- uspace/lib/c/arch/arm32/include/config.h	(revision 6ecf5b8322ea8b1cfad0e7246655beef88ab3194)
+++ 	(revision )
@@ -1,45 +1,0 @@
-/*
- * Copyright (c) 2006 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 libcarm32
- * @{
- */
-/** @file  
- *  @brief Configuration constants.
- */
-
-#ifndef LIBC_arm32_CONFIG_H_
-#define LIBC_arm32_CONFIG_H_
-
-#define PAGE_WIDTH	12
-#define PAGE_SIZE	(1 << PAGE_WIDTH)
-
-#endif
-
-/** @}
- */
Index: uspace/lib/c/arch/arm32/include/ddi.h
===================================================================
--- uspace/lib/c/arch/arm32/include/ddi.h	(revision 6ecf5b8322ea8b1cfad0e7246655beef88ab3194)
+++ 	(revision )
@@ -1,69 +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.
- */
-
-/** @file
- * @ingroup libcarm32
- */
-
-#ifndef LIBC_arm32_DDI_H_
-#define LIBC_arm32_DDI_H_
-
-#include <sys/types.h>
-#include <libarch/types.h>
-
-static inline void pio_write_8(ioport8_t *port, uint8_t v)
-{
-	*port = v;
-}
-
-static inline void pio_write_16(ioport16_t *port, uint16_t v)
-{
-	*port = v;
-}
-
-static inline void pio_write_32(ioport32_t *port, uint32_t v)
-{
-	*port = v;
-}
-
-static inline uint8_t pio_read_8(ioport8_t *port)
-{
-	return *port;
-}
-
-static inline uint16_t pio_read_16(ioport16_t *port)
-{
-	return *port;
-}
-
-static inline uint32_t pio_read_32(ioport32_t *port)
-{
-	return *port;
-}
-
-#endif
Index: uspace/lib/c/arch/arm32/include/elf.h
===================================================================
--- uspace/lib/c/arch/arm32/include/elf.h	(revision 6ecf5b8322ea8b1cfad0e7246655beef88ab3194)
+++ 	(revision )
@@ -1,1 +1,0 @@
-../../../../../../kernel/arch/arm32/include/arch/elf.h
Index: uspace/lib/c/arch/arm32/include/elf_linux.h
===================================================================
--- uspace/lib/c/arch/arm32/include/elf_linux.h	(revision 6ecf5b8322ea8b1cfad0e7246655beef88ab3194)
+++ 	(revision )
@@ -1,94 +1,0 @@
-/*
- * Copyright (c) 2011 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 Definitions needed to write core files in Linux-ELF format.
- */
-
-#ifndef LIBC_arm32_ELF_LINUX_H_
-#define LBIC_arm32_ELF_LINUX_H_
-
-#include <libarch/istate.h>
-#include <sys/types.h>
-
-/** Linux kernel struct pt_regs structure.
- *
- * We need this to save register state to a core file in Linux format
- * (readable by GDB configured for Linux target).
- */
-typedef struct {
-	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 sp;
-	uint32_t lr;
-	uint32_t pc;
-	uint32_t cpsr;
-	uint32_t old_r0;
-} elf_regs_t;
-
-/** Convert istate_t to elf_regs_t. */
-static inline void istate_to_elf_regs(istate_t *istate, elf_regs_t *elf_regs)
-{
-	elf_regs->r0 = istate->r0;
-	elf_regs->r1 = istate->r1;
-	elf_regs->r2 = istate->r2;
-	elf_regs->r3 = istate->r3;
-	elf_regs->r4 = istate->r4;
-	elf_regs->r5 = istate->r5;
-	elf_regs->r6 = istate->r6;
-	elf_regs->r7 = istate->r7;
-	elf_regs->r8 = istate->r8;
-	elf_regs->r9 = istate->r9;
-	elf_regs->r10 = istate->r10;
-
-	elf_regs->fp = istate->fp;
-	elf_regs->r12 = istate->r12;
-	elf_regs->sp = istate->sp;
-	elf_regs->lr = istate->lr;
-	elf_regs->pc = istate->pc;
-	elf_regs->cpsr = istate->spsr;
-	elf_regs->old_r0 = 0;
-}
-
-#endif
-
-/** @}
- */
Index: uspace/lib/c/arch/arm32/include/faddr.h
===================================================================
--- uspace/lib/c/arch/arm32/include/faddr.h	(revision 6ecf5b8322ea8b1cfad0e7246655beef88ab3194)
+++ 	(revision )
@@ -1,50 +1,0 @@
-/*
- * Copyright (c) 2007 Michal Kebrt
- * 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 
- *  @brief Function address conversion.
- */
-
-#ifndef LIBC_arm32_FADDR_H_
-#define LIBC_arm32_FADDR_H_
-
-#include <libarch/types.h>
-
-/** Calculate absolute address of function referenced by fptr pointer.
- *
- * @param f Function pointer.
- */
-#define FADDR(f)	 (f)
-
-#endif
-
-/** @}
- */
Index: uspace/lib/c/arch/arm32/include/fibril.h
===================================================================
--- uspace/lib/c/arch/arm32/include/fibril.h	(revision 6ecf5b8322ea8b1cfad0e7246655beef88ab3194)
+++ 	(revision )
@@ -1,96 +1,0 @@
-/*
- * Copyright (c) 2007 Michal Kebrt
- * 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 
- *  @brief Fibrils related declarations.
- */
-
-#ifndef LIBC_arm32_FIBRIL_H_
-#define LIBC_arm32_FIBRIL_H_
-
-#include <sys/types.h>
-#include <align.h>
-#include <thread.h>
-
-/** Size of a stack item */
-#define STACK_ITEM_SIZE  4
-
-/** Stack alignment - see <a href="http://www.arm.com/support/faqdev/14269.html">ABI</a> for details */
-#define STACK_ALIGNMENT  8
-
-#define SP_DELTA  (0 + ALIGN_UP(STACK_ITEM_SIZE, STACK_ALIGNMENT))
-
-
-/** Sets data to the context.
- *
- *  @param c     Context (#context_t).
- *  @param _pc   Program counter.
- *  @param stack Stack address.
- *  @param size  Stack size.
- *  @param ptls  Pointer to the TCB.
- */
-#define context_set(c, _pc, stack, size, ptls) \
-	do { \
-		(c)->pc = (sysarg_t) (_pc); \
-		(c)->sp = ((sysarg_t) (stack)) + (size) - SP_DELTA; \
-		(c)->tls = ((sysarg_t)(ptls)) + sizeof(tcb_t) + ARM_TP_OFFSET; \
-		(c)->fp = 0; \
-	} while (0)
-
-/** Fibril context.
- *
- *  Only registers preserved accross function calls are included. r9 is used 
- *  to store a TLS address. -ffixed-r9 gcc forces gcc not to use this
- *  register. -mtp=soft forces gcc to use #__aeabi_read_tp to obtain
- *  TLS address.
- */
-typedef struct  {
-	uint32_t sp;
-	uint32_t pc;
-	uint32_t r4;
-	uint32_t r5;
-	uint32_t r6;
-	uint32_t r7;
-	uint32_t r8;
-	uint32_t tls;	/* r9 */
-	uint32_t r10;
-	uint32_t fp;	/* r11 */
-} context_t;
-
-static inline uintptr_t context_get_fp(context_t *ctx)
-{
-	return ctx->fp;
-}
-
-#endif
-
-/** @}
- */
Index: uspace/lib/c/arch/arm32/include/inttypes.h
===================================================================
--- uspace/lib/c/arch/arm32/include/inttypes.h	(revision 6ecf5b8322ea8b1cfad0e7246655beef88ab3194)
+++ 	(revision )
@@ -1,44 +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
- * @{
- */
-
-#ifndef LIBC_arm32_INTTYPES_H_
-#define LIBC_arm32_INTTYPES_H_
-
-#define PRIdn  PRId32  /**< Format for native_t. */
-#define PRIun  PRIu32  /**< Format for sysarg_t. */
-#define PRIxn  PRIx32  /**< Format for hexadecimal sysarg_t. */
-#define PRIua  PRIu32  /**< Format for atomic_count_t. */
-
-#endif
-
-/** @}
- */
Index: uspace/lib/c/arch/arm32/include/istate.h
===================================================================
--- uspace/lib/c/arch/arm32/include/istate.h	(revision 6ecf5b8322ea8b1cfad0e7246655beef88ab3194)
+++ 	(revision )
@@ -1,1 +1,0 @@
-../../../../../../kernel/arch/arm32/include/arch/istate.h
Index: uspace/lib/c/arch/arm32/include/libarch/atomic.h
===================================================================
--- uspace/lib/c/arch/arm32/include/libarch/atomic.h	(revision ea906c296a71e3f2edea0bfac602ee88cf04f607)
+++ uspace/lib/c/arch/arm32/include/libarch/atomic.h	(revision ea906c296a71e3f2edea0bfac602ee88cf04f607)
@@ -0,0 +1,204 @@
+/*
+ * Copyright (c) 2007 Michal Kebrt
+ * 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
+ *  @brief Atomic operations.
+ */
+
+#ifndef LIBC_arm32_ATOMIC_H_
+#define LIBC_arm32_ATOMIC_H_
+
+#define LIBC_ARCH_ATOMIC_H_
+#define CAS
+
+#include <atomicdflt.h>
+#include <bool.h>
+#include <sys/types.h>
+
+extern uintptr_t *ras_page;
+
+static inline bool cas(atomic_t *val, atomic_count_t ov, atomic_count_t nv)
+{
+	atomic_count_t ret = 0;
+	
+	/*
+	 * The following instructions between labels 1 and 2 constitute a
+	 * Restartable Atomic Seqeunce. Should the sequence be non-atomic,
+	 * the kernel will restart it.
+	 */
+	asm volatile (
+		"1:\n"
+		"	adr %[ret], 1b\n"
+		"	str %[ret], %[rp0]\n"
+		"	adr %[ret], 2f\n"
+		"	str %[ret], %[rp1]\n"
+		"	ldr %[ret], %[addr]\n"
+		"	cmp %[ret], %[ov]\n"
+		"	streq %[nv], %[addr]\n"
+		"2:\n"
+		"	moveq %[ret], #1\n"
+		"	movne %[ret], #0\n"
+		: [ret] "+&r" (ret),
+		  [rp0] "=m" (ras_page[0]),
+		  [rp1] "=m" (ras_page[1]),
+		  [addr] "+m" (val->count)
+		: [ov] "r" (ov),
+		  [nv] "r" (nv)
+		: "memory"
+	);
+	
+	ras_page[0] = 0;
+	asm volatile (
+		"" ::: "memory"
+	);
+	ras_page[1] = 0xffffffff;
+	
+	return (bool) ret;
+}
+
+/** Atomic addition.
+ *
+ * @param val Where to add.
+ * @param i   Value to be added.
+ *
+ * @return Value after addition.
+ *
+ */
+static inline atomic_count_t atomic_add(atomic_t *val, atomic_count_t i)
+{
+	atomic_count_t ret = 0;
+	
+	/*
+	 * The following instructions between labels 1 and 2 constitute a
+	 * Restartable Atomic Seqeunce. Should the sequence be non-atomic,
+	 * the kernel will restart it.
+	 */
+	asm volatile (
+		"1:\n"
+		"	adr %[ret], 1b\n"
+		"	str %[ret], %[rp0]\n"
+		"	adr %[ret], 2f\n"
+		"	str %[ret], %[rp1]\n"
+		"	ldr %[ret], %[addr]\n"
+		"	add %[ret], %[ret], %[imm]\n"
+		"	str %[ret], %[addr]\n"
+		"2:\n"
+		: [ret] "+&r" (ret),
+		  [rp0] "=m" (ras_page[0]),
+		  [rp1] "=m" (ras_page[1]),
+		  [addr] "+m" (val->count)
+		: [imm] "r" (i)
+	);
+	
+	ras_page[0] = 0;
+	asm volatile (
+		"" ::: "memory"
+	);
+	ras_page[1] = 0xffffffff;
+	
+	return ret;
+}
+
+
+/** Atomic increment.
+ *
+ * @param val Variable to be incremented.
+ *
+ */
+static inline void atomic_inc(atomic_t *val)
+{
+	atomic_add(val, 1);
+}
+
+
+/** Atomic decrement.
+ *
+ * @param val Variable to be decremented.
+ *
+ */
+static inline void atomic_dec(atomic_t *val)
+{
+	atomic_add(val, -1);
+}
+
+
+/** Atomic pre-increment.
+ *
+ * @param val Variable to be incremented.
+ * @return    Value after incrementation.
+ *
+ */
+static inline atomic_count_t atomic_preinc(atomic_t *val)
+{
+	return atomic_add(val, 1);
+}
+
+
+/** Atomic pre-decrement.
+ *
+ * @param val Variable to be decremented.
+ * @return    Value after decrementation.
+ *
+ */
+static inline atomic_count_t atomic_predec(atomic_t *val)
+{
+	return atomic_add(val, -1);
+}
+
+
+/** Atomic post-increment.
+ *
+ * @param val Variable to be incremented.
+ * @return    Value before incrementation.
+ *
+ */
+static inline atomic_count_t atomic_postinc(atomic_t *val)
+{
+	return atomic_add(val, 1) - 1;
+}
+
+
+/** Atomic post-decrement.
+ *
+ * @param val Variable to be decremented.
+ * @return    Value before decrementation.
+ *
+ */
+static inline atomic_count_t atomic_postdec(atomic_t *val)
+{
+	return atomic_add(val, -1) + 1;
+}
+
+
+#endif
+
+/** @}
+ */
Index: uspace/lib/c/arch/arm32/include/libarch/barrier.h
===================================================================
--- uspace/lib/c/arch/arm32/include/libarch/barrier.h	(revision ea906c296a71e3f2edea0bfac602ee88cf04f607)
+++ uspace/lib/c/arch/arm32/include/libarch/barrier.h	(revision ea906c296a71e3f2edea0bfac602ee88cf04f607)
@@ -0,0 +1,1 @@
+../../../../../../../kernel/arch/arm32/include/arch/barrier.h
Index: uspace/lib/c/arch/arm32/include/libarch/config.h
===================================================================
--- uspace/lib/c/arch/arm32/include/libarch/config.h	(revision ea906c296a71e3f2edea0bfac602ee88cf04f607)
+++ uspace/lib/c/arch/arm32/include/libarch/config.h	(revision ea906c296a71e3f2edea0bfac602ee88cf04f607)
@@ -0,0 +1,45 @@
+/*
+ * Copyright (c) 2006 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 libcarm32
+ * @{
+ */
+/** @file  
+ *  @brief Configuration constants.
+ */
+
+#ifndef LIBC_arm32_CONFIG_H_
+#define LIBC_arm32_CONFIG_H_
+
+#define PAGE_WIDTH	12
+#define PAGE_SIZE	(1 << PAGE_WIDTH)
+
+#endif
+
+/** @}
+ */
Index: uspace/lib/c/arch/arm32/include/libarch/ddi.h
===================================================================
--- uspace/lib/c/arch/arm32/include/libarch/ddi.h	(revision ea906c296a71e3f2edea0bfac602ee88cf04f607)
+++ uspace/lib/c/arch/arm32/include/libarch/ddi.h	(revision ea906c296a71e3f2edea0bfac602ee88cf04f607)
@@ -0,0 +1,69 @@
+/*
+ * 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.
+ */
+
+/** @file
+ * @ingroup libcarm32
+ */
+
+#ifndef LIBC_arm32_DDI_H_
+#define LIBC_arm32_DDI_H_
+
+#include <sys/types.h>
+#include <libarch/types.h>
+
+static inline void pio_write_8(ioport8_t *port, uint8_t v)
+{
+	*port = v;
+}
+
+static inline void pio_write_16(ioport16_t *port, uint16_t v)
+{
+	*port = v;
+}
+
+static inline void pio_write_32(ioport32_t *port, uint32_t v)
+{
+	*port = v;
+}
+
+static inline uint8_t pio_read_8(ioport8_t *port)
+{
+	return *port;
+}
+
+static inline uint16_t pio_read_16(ioport16_t *port)
+{
+	return *port;
+}
+
+static inline uint32_t pio_read_32(ioport32_t *port)
+{
+	return *port;
+}
+
+#endif
Index: uspace/lib/c/arch/arm32/include/libarch/elf.h
===================================================================
--- uspace/lib/c/arch/arm32/include/libarch/elf.h	(revision ea906c296a71e3f2edea0bfac602ee88cf04f607)
+++ uspace/lib/c/arch/arm32/include/libarch/elf.h	(revision ea906c296a71e3f2edea0bfac602ee88cf04f607)
@@ -0,0 +1,1 @@
+../../../../../../../kernel/arch/arm32/include/arch/elf.h
Index: uspace/lib/c/arch/arm32/include/libarch/elf_linux.h
===================================================================
--- uspace/lib/c/arch/arm32/include/libarch/elf_linux.h	(revision ea906c296a71e3f2edea0bfac602ee88cf04f607)
+++ uspace/lib/c/arch/arm32/include/libarch/elf_linux.h	(revision ea906c296a71e3f2edea0bfac602ee88cf04f607)
@@ -0,0 +1,94 @@
+/*
+ * Copyright (c) 2011 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 Definitions needed to write core files in Linux-ELF format.
+ */
+
+#ifndef LIBC_arm32_ELF_LINUX_H_
+#define LBIC_arm32_ELF_LINUX_H_
+
+#include <libarch/istate.h>
+#include <sys/types.h>
+
+/** Linux kernel struct pt_regs structure.
+ *
+ * We need this to save register state to a core file in Linux format
+ * (readable by GDB configured for Linux target).
+ */
+typedef struct {
+	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 sp;
+	uint32_t lr;
+	uint32_t pc;
+	uint32_t cpsr;
+	uint32_t old_r0;
+} elf_regs_t;
+
+/** Convert istate_t to elf_regs_t. */
+static inline void istate_to_elf_regs(istate_t *istate, elf_regs_t *elf_regs)
+{
+	elf_regs->r0 = istate->r0;
+	elf_regs->r1 = istate->r1;
+	elf_regs->r2 = istate->r2;
+	elf_regs->r3 = istate->r3;
+	elf_regs->r4 = istate->r4;
+	elf_regs->r5 = istate->r5;
+	elf_regs->r6 = istate->r6;
+	elf_regs->r7 = istate->r7;
+	elf_regs->r8 = istate->r8;
+	elf_regs->r9 = istate->r9;
+	elf_regs->r10 = istate->r10;
+
+	elf_regs->fp = istate->fp;
+	elf_regs->r12 = istate->r12;
+	elf_regs->sp = istate->sp;
+	elf_regs->lr = istate->lr;
+	elf_regs->pc = istate->pc;
+	elf_regs->cpsr = istate->spsr;
+	elf_regs->old_r0 = 0;
+}
+
+#endif
+
+/** @}
+ */
Index: uspace/lib/c/arch/arm32/include/libarch/faddr.h
===================================================================
--- uspace/lib/c/arch/arm32/include/libarch/faddr.h	(revision ea906c296a71e3f2edea0bfac602ee88cf04f607)
+++ uspace/lib/c/arch/arm32/include/libarch/faddr.h	(revision ea906c296a71e3f2edea0bfac602ee88cf04f607)
@@ -0,0 +1,50 @@
+/*
+ * Copyright (c) 2007 Michal Kebrt
+ * 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 
+ *  @brief Function address conversion.
+ */
+
+#ifndef LIBC_arm32_FADDR_H_
+#define LIBC_arm32_FADDR_H_
+
+#include <libarch/types.h>
+
+/** Calculate absolute address of function referenced by fptr pointer.
+ *
+ * @param f Function pointer.
+ */
+#define FADDR(f)	 (f)
+
+#endif
+
+/** @}
+ */
Index: uspace/lib/c/arch/arm32/include/libarch/fibril.h
===================================================================
--- uspace/lib/c/arch/arm32/include/libarch/fibril.h	(revision ea906c296a71e3f2edea0bfac602ee88cf04f607)
+++ uspace/lib/c/arch/arm32/include/libarch/fibril.h	(revision ea906c296a71e3f2edea0bfac602ee88cf04f607)
@@ -0,0 +1,96 @@
+/*
+ * Copyright (c) 2007 Michal Kebrt
+ * 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 
+ *  @brief Fibrils related declarations.
+ */
+
+#ifndef LIBC_arm32_FIBRIL_H_
+#define LIBC_arm32_FIBRIL_H_
+
+#include <sys/types.h>
+#include <align.h>
+#include <thread.h>
+
+/** Size of a stack item */
+#define STACK_ITEM_SIZE  4
+
+/** Stack alignment - see <a href="http://www.arm.com/support/faqdev/14269.html">ABI</a> for details */
+#define STACK_ALIGNMENT  8
+
+#define SP_DELTA  (0 + ALIGN_UP(STACK_ITEM_SIZE, STACK_ALIGNMENT))
+
+
+/** Sets data to the context.
+ *
+ *  @param c     Context (#context_t).
+ *  @param _pc   Program counter.
+ *  @param stack Stack address.
+ *  @param size  Stack size.
+ *  @param ptls  Pointer to the TCB.
+ */
+#define context_set(c, _pc, stack, size, ptls) \
+	do { \
+		(c)->pc = (sysarg_t) (_pc); \
+		(c)->sp = ((sysarg_t) (stack)) + (size) - SP_DELTA; \
+		(c)->tls = ((sysarg_t)(ptls)) + sizeof(tcb_t) + ARM_TP_OFFSET; \
+		(c)->fp = 0; \
+	} while (0)
+
+/** Fibril context.
+ *
+ *  Only registers preserved accross function calls are included. r9 is used 
+ *  to store a TLS address. -ffixed-r9 gcc forces gcc not to use this
+ *  register. -mtp=soft forces gcc to use #__aeabi_read_tp to obtain
+ *  TLS address.
+ */
+typedef struct  {
+	uint32_t sp;
+	uint32_t pc;
+	uint32_t r4;
+	uint32_t r5;
+	uint32_t r6;
+	uint32_t r7;
+	uint32_t r8;
+	uint32_t tls;	/* r9 */
+	uint32_t r10;
+	uint32_t fp;	/* r11 */
+} context_t;
+
+static inline uintptr_t context_get_fp(context_t *ctx)
+{
+	return ctx->fp;
+}
+
+#endif
+
+/** @}
+ */
Index: uspace/lib/c/arch/arm32/include/libarch/inttypes.h
===================================================================
--- uspace/lib/c/arch/arm32/include/libarch/inttypes.h	(revision ea906c296a71e3f2edea0bfac602ee88cf04f607)
+++ uspace/lib/c/arch/arm32/include/libarch/inttypes.h	(revision ea906c296a71e3f2edea0bfac602ee88cf04f607)
@@ -0,0 +1,44 @@
+/*
+ * 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
+ * @{
+ */
+
+#ifndef LIBC_arm32_INTTYPES_H_
+#define LIBC_arm32_INTTYPES_H_
+
+#define PRIdn  PRId32  /**< Format for native_t. */
+#define PRIun  PRIu32  /**< Format for sysarg_t. */
+#define PRIxn  PRIx32  /**< Format for hexadecimal sysarg_t. */
+#define PRIua  PRIu32  /**< Format for atomic_count_t. */
+
+#endif
+
+/** @}
+ */
Index: uspace/lib/c/arch/arm32/include/libarch/istate.h
===================================================================
--- uspace/lib/c/arch/arm32/include/libarch/istate.h	(revision ea906c296a71e3f2edea0bfac602ee88cf04f607)
+++ uspace/lib/c/arch/arm32/include/libarch/istate.h	(revision ea906c296a71e3f2edea0bfac602ee88cf04f607)
@@ -0,0 +1,1 @@
+../../../../../../../kernel/arch/arm32/include/arch/istate.h
Index: uspace/lib/c/arch/arm32/include/libarch/regutils.h
===================================================================
--- uspace/lib/c/arch/arm32/include/libarch/regutils.h	(revision ea906c296a71e3f2edea0bfac602ee88cf04f607)
+++ uspace/lib/c/arch/arm32/include/libarch/regutils.h	(revision ea906c296a71e3f2edea0bfac602ee88cf04f607)
@@ -0,0 +1,1 @@
+../../../../../../../kernel/arch/arm32/include/arch/regutils.h
Index: uspace/lib/c/arch/arm32/include/libarch/stackarg.h
===================================================================
--- uspace/lib/c/arch/arm32/include/libarch/stackarg.h	(revision ea906c296a71e3f2edea0bfac602ee88cf04f607)
+++ uspace/lib/c/arch/arm32/include/libarch/stackarg.h	(revision ea906c296a71e3f2edea0bfac602ee88cf04f607)
@@ -0,0 +1,43 @@
+/*
+ * Copyright (c) 2007 Michal Kebrt
+ * 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
+ *  @brief Empty.
+ */
+
+#ifndef LIBC_arm32_STACKARG_H_
+#define LIBC_arm32_STACKARG_H_
+
+#endif
+
+/** @}
+ */
+
Index: uspace/lib/c/arch/arm32/include/libarch/syscall.h
===================================================================
--- uspace/lib/c/arch/arm32/include/libarch/syscall.h	(revision ea906c296a71e3f2edea0bfac602ee88cf04f607)
+++ uspace/lib/c/arch/arm32/include/libarch/syscall.h	(revision ea906c296a71e3f2edea0bfac602ee88cf04f607)
@@ -0,0 +1,46 @@
+/*
+ * Copyright (c) 2007 Michal Kebrt
+ * 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
+ *  @brief
+ */
+
+#ifndef LIBC_arm32_SYSCALL_H_
+#define LIBC_arm32_SYSCALL_H_
+
+#define LIBARCH_SYSCALL_GENERIC
+
+#include <syscall.h>
+
+#endif
+
+/** @}
+ */
Index: uspace/lib/c/arch/arm32/include/libarch/thread.h
===================================================================
--- uspace/lib/c/arch/arm32/include/libarch/thread.h	(revision ea906c296a71e3f2edea0bfac602ee88cf04f607)
+++ uspace/lib/c/arch/arm32/include/libarch/thread.h	(revision ea906c296a71e3f2edea0bfac602ee88cf04f607)
@@ -0,0 +1,42 @@
+/*
+ * Copyright (c) 2007 Pavel Jancik
+ * Copyright (c) 2007 Michal Kebrt
+ * 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_THREAD_H_
+#define LIBC_arm32_THREAD_H_
+
+#endif
+
+/** @}
+ */
Index: uspace/lib/c/arch/arm32/include/libarch/tls.h
===================================================================
--- uspace/lib/c/arch/arm32/include/libarch/tls.h	(revision ea906c296a71e3f2edea0bfac602ee88cf04f607)
+++ uspace/lib/c/arch/arm32/include/libarch/tls.h	(revision ea906c296a71e3f2edea0bfac602ee88cf04f607)
@@ -0,0 +1,99 @@
+/*
+ * Copyright (c) 2007 Pavel Jancik
+ * Copyright (c) 2007 Michal Kebrt
+ * 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_TLS_H_
+#define LIBC_arm32_TLS_H_
+
+#include <sys/types.h>
+
+#define CONFIG_TLS_VARIANT_1
+
+/** Offsets for accessing thread-local variables are shifted 8 bytes higher. */
+#define ARM_TP_OFFSET  (-8)
+
+/** TCB (Thread Control Block) struct. 
+ *
+ *  TLS starts just after this struct.
+ */
+typedef struct {
+	/** Fibril data. */
+	void *fibril_data;
+} tcb_t;
+
+
+/** Sets TLS address to the r9 register.
+ *
+ *  @param tcb		TCB (TLS starts behind)
+ */
+static inline void __tcb_set(tcb_t *tcb)
+{
+	void *tls = (void *) tcb;
+	tls += sizeof(tcb_t) + ARM_TP_OFFSET;
+	asm volatile (
+		"mov r9, %0"
+		:
+		: "r" (tls)
+	);
+}
+
+
+/** Returns TCB address.
+ *
+ * @return		TCB address (starts before TLS which address is stored
+ * 			in r9 register).
+ */
+static inline tcb_t *__tcb_get(void)
+{
+	void *ret;
+	asm volatile (
+		"mov %0, r9"
+		: "=r"(ret)
+	);
+	return (tcb_t *) (ret - ARM_TP_OFFSET - sizeof(tcb_t));
+}
+
+
+/** Returns TLS address stored.
+ *
+ *  Implemented in assembly.
+ *
+ *  @return		TLS address stored in r9 register
+ */
+extern uintptr_t __aeabi_read_tp(void);
+
+#endif
+
+/** @}
+ */
Index: uspace/lib/c/arch/arm32/include/libarch/types.h
===================================================================
--- uspace/lib/c/arch/arm32/include/libarch/types.h	(revision ea906c296a71e3f2edea0bfac602ee88cf04f607)
+++ uspace/lib/c/arch/arm32/include/libarch/types.h	(revision ea906c296a71e3f2edea0bfac602ee88cf04f607)
@@ -0,0 +1,63 @@
+/*
+ * 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.
+ */
+
+/** @addtogroup libcarm32
+ * @{
+ */
+/** @file
+ *  @brief Definitions of basic types like #uintptr_t.
+ */
+
+#ifndef LIBC_arm32_TYPES_H_
+#define LIBC_arm32_TYPES_H_
+
+#define __32_BITS__
+
+#include <libarch/common.h>
+
+#define SIZE_MIN  UINT32_MIN
+#define SIZE_MAX  UINT32_MAX
+
+#define SSIZE_MIN  INT32_MIN
+#define SSIZE_MAX  INT32_MAX
+
+typedef uint32_t sysarg_t;
+typedef int32_t native_t;
+
+typedef int32_t ssize_t;
+typedef uint32_t size_t;
+
+typedef uint32_t uintptr_t;
+typedef int32_t intptr_t;
+typedef uint32_t atomic_count_t;
+typedef int32_t atomic_signed_t;
+
+#endif
+
+/** @}
+ */
Index: uspace/lib/c/arch/arm32/include/regutils.h
===================================================================
--- uspace/lib/c/arch/arm32/include/regutils.h	(revision 6ecf5b8322ea8b1cfad0e7246655beef88ab3194)
+++ 	(revision )
@@ -1,1 +1,0 @@
-../../../../../../kernel/arch/arm32/include/arch/regutils.h
Index: uspace/lib/c/arch/arm32/include/stackarg.h
===================================================================
--- uspace/lib/c/arch/arm32/include/stackarg.h	(revision 6ecf5b8322ea8b1cfad0e7246655beef88ab3194)
+++ 	(revision )
@@ -1,43 +1,0 @@
-/*
- * Copyright (c) 2007 Michal Kebrt
- * 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
- *  @brief Empty.
- */
-
-#ifndef LIBC_arm32_STACKARG_H_
-#define LIBC_arm32_STACKARG_H_
-
-#endif
-
-/** @}
- */
-
Index: uspace/lib/c/arch/arm32/include/syscall.h
===================================================================
--- uspace/lib/c/arch/arm32/include/syscall.h	(revision 6ecf5b8322ea8b1cfad0e7246655beef88ab3194)
+++ 	(revision )
@@ -1,46 +1,0 @@
-/*
- * Copyright (c) 2007 Michal Kebrt
- * 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
- *  @brief
- */
-
-#ifndef LIBC_arm32_SYSCALL_H_
-#define LIBC_arm32_SYSCALL_H_
-
-#define LIBARCH_SYSCALL_GENERIC
-
-#include <syscall.h>
-
-#endif
-
-/** @}
- */
Index: uspace/lib/c/arch/arm32/include/thread.h
===================================================================
--- uspace/lib/c/arch/arm32/include/thread.h	(revision 6ecf5b8322ea8b1cfad0e7246655beef88ab3194)
+++ 	(revision )
@@ -1,42 +1,0 @@
-/*
- * Copyright (c) 2007 Pavel Jancik
- * Copyright (c) 2007 Michal Kebrt
- * 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_THREAD_H_
-#define LIBC_arm32_THREAD_H_
-
-#endif
-
-/** @}
- */
Index: uspace/lib/c/arch/arm32/include/tls.h
===================================================================
--- uspace/lib/c/arch/arm32/include/tls.h	(revision 6ecf5b8322ea8b1cfad0e7246655beef88ab3194)
+++ 	(revision )
@@ -1,99 +1,0 @@
-/*
- * Copyright (c) 2007 Pavel Jancik
- * Copyright (c) 2007 Michal Kebrt
- * 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_TLS_H_
-#define LIBC_arm32_TLS_H_
-
-#include <sys/types.h>
-
-#define CONFIG_TLS_VARIANT_1
-
-/** Offsets for accessing thread-local variables are shifted 8 bytes higher. */
-#define ARM_TP_OFFSET  (-8)
-
-/** TCB (Thread Control Block) struct. 
- *
- *  TLS starts just after this struct.
- */
-typedef struct {
-	/** Fibril data. */
-	void *fibril_data;
-} tcb_t;
-
-
-/** Sets TLS address to the r9 register.
- *
- *  @param tcb		TCB (TLS starts behind)
- */
-static inline void __tcb_set(tcb_t *tcb)
-{
-	void *tls = (void *) tcb;
-	tls += sizeof(tcb_t) + ARM_TP_OFFSET;
-	asm volatile (
-		"mov r9, %0"
-		:
-		: "r" (tls)
-	);
-}
-
-
-/** Returns TCB address.
- *
- * @return		TCB address (starts before TLS which address is stored
- * 			in r9 register).
- */
-static inline tcb_t *__tcb_get(void)
-{
-	void *ret;
-	asm volatile (
-		"mov %0, r9"
-		: "=r"(ret)
-	);
-	return (tcb_t *) (ret - ARM_TP_OFFSET - sizeof(tcb_t));
-}
-
-
-/** Returns TLS address stored.
- *
- *  Implemented in assembly.
- *
- *  @return		TLS address stored in r9 register
- */
-extern uintptr_t __aeabi_read_tp(void);
-
-#endif
-
-/** @}
- */
Index: uspace/lib/c/arch/arm32/include/types.h
===================================================================
--- uspace/lib/c/arch/arm32/include/types.h	(revision 6ecf5b8322ea8b1cfad0e7246655beef88ab3194)
+++ 	(revision )
@@ -1,63 +1,0 @@
-/*
- * 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.
- */
-
-/** @addtogroup libcarm32
- * @{
- */
-/** @file
- *  @brief Definitions of basic types like #uintptr_t.
- */
-
-#ifndef LIBC_arm32_TYPES_H_
-#define LIBC_arm32_TYPES_H_
-
-#define __32_BITS__
-
-#include <libarch/common.h>
-
-#define SIZE_MIN  UINT32_MIN
-#define SIZE_MAX  UINT32_MAX
-
-#define SSIZE_MIN  INT32_MIN
-#define SSIZE_MAX  INT32_MAX
-
-typedef uint32_t sysarg_t;
-typedef int32_t native_t;
-
-typedef int32_t ssize_t;
-typedef uint32_t size_t;
-
-typedef uint32_t uintptr_t;
-typedef int32_t intptr_t;
-typedef uint32_t atomic_count_t;
-typedef int32_t atomic_signed_t;
-
-#endif
-
-/** @}
- */
