Index: uspace/lib/c/arch/abs32le/include/libarch/stdint.h
===================================================================
--- uspace/lib/c/arch/abs32le/include/libarch/stdint.h	(revision d6c98451488403ad65ddbaaa4ca9466fba069a73)
+++ uspace/lib/c/arch/abs32le/include/libarch/stdint.h	(revision d6c98451488403ad65ddbaaa4ca9466fba069a73)
@@ -0,0 +1,61 @@
+/*
+ * Copyright (c) 2006 Ondrej Palkovsky
+ * 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 libcabs32
+ * @{
+ */
+/** @file
+ */
+
+#ifndef LIBC_abs32_STDINT_H_
+#define LIBC_abs32_STDINT_H_
+
+#include <libarch/common.h>
+
+#define SIZE_MIN  UINT32_MIN
+#define SIZE_MAX  UINT32_MAX
+
+typedef uint32_t size_t;
+
+#define UINTPTR_MAX UINT32_MAX
+typedef uint32_t uintptr_t;
+
+#define INTPTR_MIN INT32_MIN
+#define INTPTR_MAX INT32_MAX
+typedef int32_t intptr_t;
+
+#define UINTMAX_MAX UINT64_MAX
+typedef uint64_t uintmax_t;
+
+#define INTMAX_MAX INT64_MAX
+typedef int64_t intmax_t;
+
+#endif
+
+/** @}
+ */
Index: uspace/lib/c/arch/abs32le/include/libarch/types.h
===================================================================
--- uspace/lib/c/arch/abs32le/include/libarch/types.h	(revision 8a45707da780cb2e12e6ff6a344ed0df176209a1)
+++ uspace/lib/c/arch/abs32le/include/libarch/types.h	(revision d6c98451488403ad65ddbaaa4ca9466fba069a73)
@@ -36,10 +36,8 @@
 #define LIBC_abs32le_TYPES_H_
 
+#include <libarch/common.h>
+#include <libarch/stdint.h>
+
 #define __32_BITS__
-
-#include <libarch/common.h>
-
-#define SIZE_MIN  UINT32_MIN
-#define SIZE_MAX  UINT32_MAX
 
 #define SSIZE_MIN  INT32_MIN
@@ -50,8 +48,5 @@
 
 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;
Index: uspace/lib/c/arch/amd64/include/libarch/stdint.h
===================================================================
--- uspace/lib/c/arch/amd64/include/libarch/stdint.h	(revision d6c98451488403ad65ddbaaa4ca9466fba069a73)
+++ uspace/lib/c/arch/amd64/include/libarch/stdint.h	(revision d6c98451488403ad65ddbaaa4ca9466fba069a73)
@@ -0,0 +1,61 @@
+/*
+ * Copyright (c) 2006 Ondrej Palkovsky
+ * 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_STDINT_H_
+#define LIBC_amd64_STDINT_H_
+
+#include <libarch/common.h>
+
+#define SIZE_MIN  UINT64_MIN
+#define SIZE_MAX  UINT64_MAX
+
+typedef uint64_t size_t;
+
+#define UINTPTR_MAX UINT64_MAX
+typedef uint64_t uintptr_t;
+
+#define INTPTR_MIN INT64_MIN
+#define INTPTR_MAX INT64_MAX
+typedef int64_t intptr_t;
+
+#define UINTMAX_MAX UINT64_MAX
+typedef uint64_t uintmax_t;
+
+#define INTMAX_MAX INT64_MAX
+typedef int64_t intmax_t;
+
+#endif
+
+/** @}
+ */
Index: uspace/lib/c/arch/amd64/include/libarch/types.h
===================================================================
--- uspace/lib/c/arch/amd64/include/libarch/types.h	(revision 8a45707da780cb2e12e6ff6a344ed0df176209a1)
+++ uspace/lib/c/arch/amd64/include/libarch/types.h	(revision d6c98451488403ad65ddbaaa4ca9466fba069a73)
@@ -36,10 +36,8 @@
 #define LIBC_amd64_TYPES_H_
 
+#include <libarch/common.h>
+#include <libarch/stdint.h>
+
 #define __64_BITS__
-
-#include <libarch/common.h>
-
-#define SIZE_MIN  UINT64_MIN
-#define SIZE_MAX  UINT64_MAX
 
 #define SSIZE_MIN  INT64_MIN
@@ -50,8 +48,5 @@
 
 typedef int64_t ssize_t;
-typedef uint64_t size_t;
 
-typedef uint64_t uintptr_t;
-typedef int64_t intptr_t;
 typedef uint64_t atomic_count_t;
 typedef int64_t atomic_signed_t;
Index: uspace/lib/c/arch/arm32/include/libarch/stdint.h
===================================================================
--- uspace/lib/c/arch/arm32/include/libarch/stdint.h	(revision d6c98451488403ad65ddbaaa4ca9466fba069a73)
+++ uspace/lib/c/arch/arm32/include/libarch/stdint.h	(revision d6c98451488403ad65ddbaaa4ca9466fba069a73)
@@ -0,0 +1,61 @@
+/*
+ * Copyright (c) 2006 Ondrej Palkovsky
+ * 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_STDINT_H_
+#define LIBC_arm32_STDINT_H_
+
+#include <libarch/common.h>
+
+#define SIZE_MIN  UINT32_MIN
+#define SIZE_MAX  UINT32_MAX
+
+typedef uint32_t size_t;
+
+#define UINTPTR_MAX UINT32_MAX
+typedef uint32_t uintptr_t;
+
+#define INTPTR_MIN INT32_MIN
+#define INTPTR_MAX INT32_MAX
+typedef int32_t intptr_t;
+
+#define UINTMAX_MAX UINT64_MAX
+typedef uint64_t uintmax_t;
+
+#define INTMAX_MAX INT64_MAX
+typedef int64_t intmax_t;
+
+#endif
+
+/** @}
+ */
Index: uspace/lib/c/arch/arm32/include/libarch/types.h
===================================================================
--- uspace/lib/c/arch/arm32/include/libarch/types.h	(revision 8a45707da780cb2e12e6ff6a344ed0df176209a1)
+++ uspace/lib/c/arch/arm32/include/libarch/types.h	(revision d6c98451488403ad65ddbaaa4ca9466fba069a73)
@@ -37,10 +37,8 @@
 #define LIBC_arm32_TYPES_H_
 
+#include <libarch/common.h>
+#include <libarch/stdint.h>
+
 #define __32_BITS__
-
-#include <libarch/common.h>
-
-#define SIZE_MIN  UINT32_MIN
-#define SIZE_MAX  UINT32_MAX
 
 #define SSIZE_MIN  INT32_MIN
@@ -51,8 +49,5 @@
 
 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;
Index: uspace/lib/c/arch/ia32/include/libarch/stdint.h
===================================================================
--- uspace/lib/c/arch/ia32/include/libarch/stdint.h	(revision d6c98451488403ad65ddbaaa4ca9466fba069a73)
+++ uspace/lib/c/arch/ia32/include/libarch/stdint.h	(revision d6c98451488403ad65ddbaaa4ca9466fba069a73)
@@ -0,0 +1,61 @@
+/*
+ * Copyright (c) 2006 Ondrej Palkovsky
+ * 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
+ * @{
+ */
+/** @file
+ */
+
+#ifndef LIBC_ia32_STDINT_H_
+#define LIBC_ia32_STDINT_H_
+
+#include <libarch/common.h>
+
+#define SIZE_MIN  UINT32_MIN
+#define SIZE_MAX  UINT32_MAX
+
+typedef uint32_t size_t;
+
+#define UINTPTR_MAX UINT32_MAX
+typedef uint32_t uintptr_t;
+
+#define INTPTR_MIN INT32_MIN
+#define INTPTR_MAX INT32_MAX
+typedef int32_t intptr_t;
+
+#define UINTMAX_MAX UINT64_MAX
+typedef uint64_t uintmax_t;
+
+#define INTMAX_MAX INT64_MAX
+typedef int64_t intmax_t;
+
+#endif
+
+/** @}
+ */
Index: uspace/lib/c/arch/ia32/include/libarch/types.h
===================================================================
--- uspace/lib/c/arch/ia32/include/libarch/types.h	(revision 8a45707da780cb2e12e6ff6a344ed0df176209a1)
+++ uspace/lib/c/arch/ia32/include/libarch/types.h	(revision d6c98451488403ad65ddbaaa4ca9466fba069a73)
@@ -36,10 +36,8 @@
 #define LIBC_ia32_TYPES_H_
 
+#include <libarch/common.h>
+#include <libarch/stdint.h>
+
 #define __32_BITS__
-
-#include <libarch/common.h>
-
-#define SIZE_MIN  UINT32_MIN
-#define SIZE_MAX  UINT32_MAX
 
 #define SSIZE_MIN  INT32_MIN
@@ -52,6 +50,4 @@
 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;
Index: uspace/lib/c/arch/ia64/include/libarch/stdint.h
===================================================================
--- uspace/lib/c/arch/ia64/include/libarch/stdint.h	(revision d6c98451488403ad65ddbaaa4ca9466fba069a73)
+++ uspace/lib/c/arch/ia64/include/libarch/stdint.h	(revision d6c98451488403ad65ddbaaa4ca9466fba069a73)
@@ -0,0 +1,61 @@
+/*
+ * Copyright (c) 2006 Ondrej Palkovsky
+ * 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
+ * @{
+ */
+/** @file
+ */
+
+#ifndef LIBC_ia64_STDINT_H_
+#define LIBC_ia64_STDINT_H_
+
+#include <libarch/common.h>
+
+#define SIZE_MIN  UINT64_MIN
+#define SIZE_MAX  UINT64_MAX
+
+typedef uint64_t size_t;
+
+#define UINTPTR_MAX UINT64_MAX
+typedef uint64_t uintptr_t;
+
+#define INTPTR_MIN INT64_MIN
+#define INTPTR_MAX INT64_MAX
+typedef int64_t intptr_t;
+
+#define UINTMAX_MAX UINT64_MAX
+typedef uint64_t uintmax_t;
+
+#define INTMAX_MAX INT64_MAX
+typedef int64_t intmax_t;
+
+#endif
+
+/** @}
+ */
Index: uspace/lib/c/arch/ia64/include/libarch/types.h
===================================================================
--- uspace/lib/c/arch/ia64/include/libarch/types.h	(revision 8a45707da780cb2e12e6ff6a344ed0df176209a1)
+++ uspace/lib/c/arch/ia64/include/libarch/types.h	(revision d6c98451488403ad65ddbaaa4ca9466fba069a73)
@@ -36,10 +36,8 @@
 #define LIBC_ia64_TYPES_H_
 
+#include <libarch/common.h>
+#include <libarch/stdint.h>
+
 #define __64_BITS__
-
-#include <libarch/common.h>
-
-#define SIZE_MIN  UINT64_MIN
-#define SIZE_MAX  UINT64_MAX
 
 #define SSIZE_MIN  INT64_MIN
@@ -50,8 +48,5 @@
 
 typedef int64_t ssize_t;
-typedef uint64_t size_t;
 
-typedef uint64_t uintptr_t;
-typedef int64_t intptr_t;
 typedef uint64_t atomic_count_t;
 typedef int64_t atomic_signed_t;
Index: uspace/lib/c/arch/mips32/include/libarch/stdint.h
===================================================================
--- uspace/lib/c/arch/mips32/include/libarch/stdint.h	(revision d6c98451488403ad65ddbaaa4ca9466fba069a73)
+++ uspace/lib/c/arch/mips32/include/libarch/stdint.h	(revision d6c98451488403ad65ddbaaa4ca9466fba069a73)
@@ -0,0 +1,61 @@
+/*
+ * Copyright (c) 2006 Ondrej Palkovsky
+ * 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_STDINT_H_
+#define LIBC_mips32_STDINT_H_
+
+#include <libarch/common.h>
+
+#define SIZE_MIN  UINT32_MIN
+#define SIZE_MAX  UINT32_MAX
+
+typedef uint32_t size_t;
+
+#define UINTPTR_MAX UINT32_MAX
+typedef uint32_t uintptr_t;
+
+#define INTPTR_MIN INT32_MIN
+#define INTPTR_MAX INT32_MAX
+typedef int32_t intptr_t;
+
+#define UINTMAX_MAX UINT64_MAX
+typedef uint64_t uintmax_t;
+
+#define INTMAX_MAX INT64_MAX
+typedef int64_t intmax_t;
+
+#endif
+
+/** @}
+ */
Index: uspace/lib/c/arch/mips32/include/libarch/types.h
===================================================================
--- uspace/lib/c/arch/mips32/include/libarch/types.h	(revision 8a45707da780cb2e12e6ff6a344ed0df176209a1)
+++ uspace/lib/c/arch/mips32/include/libarch/types.h	(revision d6c98451488403ad65ddbaaa4ca9466fba069a73)
@@ -37,10 +37,8 @@
 #define LIBC_mips32_TYPES_H_
 
+#include <libarch/common.h>
+#include <libarch/stdint.h>
+
 #define __32_BITS__
-
-#include <libarch/common.h>
-
-#define SIZE_MIN  UINT32_MIN
-#define SIZE_MAX  UINT32_MAX
 
 #define SSIZE_MIN  INT32_MIN
@@ -51,8 +49,5 @@
 
 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;
Index: uspace/lib/c/arch/mips32eb/include/libarch/stdint.h
===================================================================
--- uspace/lib/c/arch/mips32eb/include/libarch/stdint.h	(revision d6c98451488403ad65ddbaaa4ca9466fba069a73)
+++ uspace/lib/c/arch/mips32eb/include/libarch/stdint.h	(revision d6c98451488403ad65ddbaaa4ca9466fba069a73)
@@ -0,0 +1,1 @@
+../../../mips32/include/libarch/stdint.h
Index: uspace/lib/c/arch/ppc32/include/libarch/stdint.h
===================================================================
--- uspace/lib/c/arch/ppc32/include/libarch/stdint.h	(revision d6c98451488403ad65ddbaaa4ca9466fba069a73)
+++ uspace/lib/c/arch/ppc32/include/libarch/stdint.h	(revision d6c98451488403ad65ddbaaa4ca9466fba069a73)
@@ -0,0 +1,61 @@
+/*
+ * Copyright (c) 2006 Ondrej Palkovsky
+ * 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_STDINT_H_
+#define LIBC_ppc32_STDINT_H_
+
+#include <libarch/common.h>
+
+#define SIZE_MIN  UINT32_MIN
+#define SIZE_MAX  UINT32_MAX
+
+typedef uint32_t size_t;
+
+#define UINTPTR_MAX UINT32_MAX
+typedef uint32_t uintptr_t;
+
+#define INTPTR_MIN INT32_MIN
+#define INTPTR_MAX INT32_MAX
+typedef int32_t intptr_t;
+
+#define UINTMAX_MAX UINT64_MAX
+typedef uint64_t uintmax_t;
+
+#define INTMAX_MAX INT64_MAX
+typedef int64_t intmax_t;
+
+#endif
+
+/** @}
+ */
Index: uspace/lib/c/arch/ppc32/include/libarch/types.h
===================================================================
--- uspace/lib/c/arch/ppc32/include/libarch/types.h	(revision 8a45707da780cb2e12e6ff6a344ed0df176209a1)
+++ uspace/lib/c/arch/ppc32/include/libarch/types.h	(revision d6c98451488403ad65ddbaaa4ca9466fba069a73)
@@ -36,10 +36,8 @@
 #define LIBC_ppc32_TYPES_H_
 
+#include <libarch/common.h>
+#include <libarch/stdint.h>
+
 #define __32_BITS__
-
-#include <libarch/common.h>
-
-#define SIZE_MIN  UINT32_MIN
-#define SIZE_MAX  UINT32_MAX
 
 #define SSIZE_MIN  INT32_MIN
@@ -50,8 +48,5 @@
 
 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;
Index: uspace/lib/c/arch/sparc32/include/libarch/stdint.h
===================================================================
--- uspace/lib/c/arch/sparc32/include/libarch/stdint.h	(revision d6c98451488403ad65ddbaaa4ca9466fba069a73)
+++ uspace/lib/c/arch/sparc32/include/libarch/stdint.h	(revision d6c98451488403ad65ddbaaa4ca9466fba069a73)
@@ -0,0 +1,61 @@
+/*
+ * Copyright (c) 2006 Ondrej Palkovsky
+ * 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 libcsparc32
+ * @{
+ */
+/** @file
+ */
+
+#ifndef LIBC_sparc32_STDINT_H_
+#define LIBC_sparc32_STDINT_H_
+
+#include <libarch/common.h>
+
+#define SIZE_MIN  UINT32_MIN
+#define SIZE_MAX  UINT32_MAX
+
+typedef uint32_t size_t;
+
+#define UINTPTR_MAX UINT32_MAX
+typedef uint32_t uintptr_t;
+
+#define INTPTR_MIN INT32_MIN
+#define INTPTR_MAX INT32_MAX
+typedef int32_t intptr_t;
+
+#define UINTMAX_MAX UINT64_MAX
+typedef uint64_t uintmax_t;
+
+#define INTMAX_MAX INT64_MAX
+typedef int64_t intmax_t;
+
+#endif
+
+/** @}
+ */
Index: uspace/lib/c/arch/sparc32/include/libarch/types.h
===================================================================
--- uspace/lib/c/arch/sparc32/include/libarch/types.h	(revision 8a45707da780cb2e12e6ff6a344ed0df176209a1)
+++ uspace/lib/c/arch/sparc32/include/libarch/types.h	(revision d6c98451488403ad65ddbaaa4ca9466fba069a73)
@@ -36,10 +36,8 @@
 #define LIBC_sparc32_TYPES_H_
 
+#include <libarch/common.h>
+#include <libarch/stdint.h>
+
 #define __32_BITS__
-
-#include <libarch/common.h>
-
-#define SIZE_MIN  UINT32_MIN
-#define SIZE_MAX  UINT32_MAX
 
 #define SSIZE_MIN  INT32_MIN
@@ -50,8 +48,5 @@
 
 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;
Index: uspace/lib/c/arch/sparc64/include/libarch/stdint.h
===================================================================
--- uspace/lib/c/arch/sparc64/include/libarch/stdint.h	(revision d6c98451488403ad65ddbaaa4ca9466fba069a73)
+++ uspace/lib/c/arch/sparc64/include/libarch/stdint.h	(revision d6c98451488403ad65ddbaaa4ca9466fba069a73)
@@ -0,0 +1,61 @@
+/*
+ * Copyright (c) 2006 Ondrej Palkovsky
+ * 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_STDINT_H_
+#define LIBC_sparc64_STDINT_H_
+
+#include <libarch/common.h>
+
+#define SIZE_MIN  UINT64_MIN
+#define SIZE_MAX  UINT64_MAX
+
+typedef uint64_t size_t;
+
+#define UINTPTR_MAX UINT64_MAX
+typedef uint64_t uintptr_t;
+
+#define INTPTR_MIN INT64_MIN
+#define INTPTR_MAX INT64_MAX
+typedef int64_t intptr_t;
+
+#define UINTMAX_MAX UINT64_MAX
+typedef uint64_t uintmax_t;
+
+#define INTMAX_MAX INT64_MAX
+typedef int64_t intmax_t;
+
+#endif
+
+/** @}
+ */
Index: uspace/lib/c/arch/sparc64/include/libarch/types.h
===================================================================
--- uspace/lib/c/arch/sparc64/include/libarch/types.h	(revision 8a45707da780cb2e12e6ff6a344ed0df176209a1)
+++ uspace/lib/c/arch/sparc64/include/libarch/types.h	(revision d6c98451488403ad65ddbaaa4ca9466fba069a73)
@@ -36,10 +36,8 @@
 #define LIBC_sparc64_TYPES_H_
 
+#include <libarch/common.h>
+#include <libarch/stdint.h>
+
 #define __64_BITS__
-
-#include <libarch/common.h>
-
-#define SIZE_MIN  UINT64_MIN
-#define SIZE_MAX  UINT64_MAX
 
 #define SSIZE_MIN  INT64_MIN
@@ -50,8 +48,5 @@
 
 typedef int64_t ssize_t;
-typedef uint64_t size_t;
 
-typedef uint64_t uintptr_t;
-typedef int64_t intptr_t;
 typedef uint64_t atomic_count_t;
 typedef int64_t atomic_signed_t;
Index: uspace/lib/c/include/stdint.h
===================================================================
--- uspace/lib/c/include/stdint.h	(revision 8a45707da780cb2e12e6ff6a344ed0df176209a1)
+++ uspace/lib/c/include/stdint.h	(revision d6c98451488403ad65ddbaaa4ca9466fba069a73)
@@ -60,5 +60,5 @@
 #define UINT64_MAX  UINT64_C(0xFFFFFFFFFFFFFFFF)
 
-#include <libarch/types.h>
+#include <libarch/stdint.h>
 
 /* off64_t */
Index: uspace/lib/posix/include/posix/inttypes.h
===================================================================
--- uspace/lib/posix/include/posix/inttypes.h	(revision 8a45707da780cb2e12e6ff6a344ed0df176209a1)
+++ uspace/lib/posix/include/posix/inttypes.h	(revision d6c98451488403ad65ddbaaa4ca9466fba069a73)
@@ -43,7 +43,7 @@
 #include "libc/inttypes.h"
 
-extern __POSIX_DEF__(intmax_t) __POSIX_DEF__(strtoimax)(const char *restrict nptr,
+extern intmax_t __POSIX_DEF__(strtoimax)(const char *restrict nptr,
     char **restrict endptr, int base);
-extern __POSIX_DEF__(uintmax_t) __POSIX_DEF__(strtoumax)(const char *restrict nptr,
+extern uintmax_t __POSIX_DEF__(strtoumax)(const char *restrict nptr,
     char **restrict endptr, int base);
 
Index: uspace/lib/posix/include/posix/stdint.h
===================================================================
--- uspace/lib/posix/include/posix/stdint.h	(revision 8a45707da780cb2e12e6ff6a344ed0df176209a1)
+++ uspace/lib/posix/include/posix/stdint.h	(revision d6c98451488403ad65ddbaaa4ca9466fba069a73)
@@ -104,12 +104,10 @@
 #include "libc/sys/types.h"
 
-typedef int64_t __POSIX_DEF__(intmax_t);
-typedef uint64_t __POSIX_DEF__(uintmax_t);
-
-
 /*
  * Fast* and least* integer types.
  *
- * The definitions below are definitely safe if not the best.
+ * The definitions below are correct as long as uint8/16/32/64_t are defined.
+ * Considering the entire rest of the system would break down if they were not,
+ * these definitions are just fine.
  */
 typedef uint8_t uint_least8_t;
Index: uspace/lib/posix/source/stdio/scanf.c
===================================================================
--- uspace/lib/posix/source/stdio/scanf.c	(revision 8a45707da780cb2e12e6ff6a344ed0df176209a1)
+++ uspace/lib/posix/source/stdio/scanf.c	(revision d6c98451488403ad65ddbaaa4ca9466fba069a73)
@@ -698,6 +698,6 @@
 							break;
 						case LMOD_j: ;
-							posix_uintmax_t *pj = va_arg(arg, posix_uintmax_t *);
-							*pj = (posix_uintmax_t) ures;
+							uintmax_t *pj = va_arg(arg, uintmax_t *);
+							*pj = (uintmax_t) ures;
 							break;
 						case LMOD_z: ;
@@ -740,6 +740,6 @@
 							break;
 						case LMOD_j: ;
-							posix_intmax_t *pj = va_arg(arg, posix_intmax_t *);
-							*pj = (posix_intmax_t) sres;
+							intmax_t *pj = va_arg(arg, intmax_t *);
+							*pj = (intmax_t) sres;
 							break;
 						case LMOD_z: ;
Index: uspace/lib/posix/source/stdlib/strtol.c
===================================================================
--- uspace/lib/posix/source/stdlib/strtol.c	(revision 8a45707da780cb2e12e6ff6a344ed0df176209a1)
+++ uspace/lib/posix/source/stdlib/strtol.c	(revision d6c98451488403ad65ddbaaa4ca9466fba069a73)
@@ -43,7 +43,4 @@
 #include "posix/inttypes.h"
 #include "posix/limits.h"
-
-#define intmax_t posix_intmax_t
-#define uintmax_t posix_uintmax_t
 
 /**
