Index: uspace/lib/c/arch/riscv64/Makefile.common
===================================================================
--- uspace/lib/c/arch/riscv64/Makefile.common	(revision c09ff7bd1b88585eb4f2aaba5b1a2d603a5979c7)
+++ uspace/lib/c/arch/riscv64/Makefile.common	(revision c09ff7bd1b88585eb4f2aaba5b1a2d603a5979c7)
@@ -0,0 +1,34 @@
+#
+# 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.
+#
+
+BASE_LIBS += $(LIBSOFTFLOAT_PREFIX)/libsoftfloat.a
+
+ENDIANESS = LE
+
+BFD_NAME = elf64-littleriscv
+BFD_ARCH = riscv
Index: uspace/lib/c/arch/riscv64/include/libarch/config.h
===================================================================
--- uspace/lib/c/arch/riscv64/include/libarch/config.h	(revision c09ff7bd1b88585eb4f2aaba5b1a2d603a5979c7)
+++ uspace/lib/c/arch/riscv64/include/libarch/config.h	(revision c09ff7bd1b88585eb4f2aaba5b1a2d603a5979c7)
@@ -0,0 +1,44 @@
+/*
+ * 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 libcamd64
+ * @{
+ */
+/** @file
+ */
+
+#ifndef LIBC_riscv64_CONFIG_H_
+#define LIBC_riscv64_CONFIG_H_
+
+#define PAGE_WIDTH  12
+#define PAGE_SIZE   (1 << PAGE_WIDTH)
+
+#endif
+
+/** @}
+ */
Index: uspace/lib/c/arch/riscv64/include/libarch/syscall.h
===================================================================
--- uspace/lib/c/arch/riscv64/include/libarch/syscall.h	(revision 22299ed9a3c298d5c73fceaefb6a619c975bdee1)
+++ uspace/lib/c/arch/riscv64/include/libarch/syscall.h	(revision c09ff7bd1b88585eb4f2aaba5b1a2d603a5979c7)
@@ -37,5 +37,7 @@
 #define LIBC_riscv64_SYSCALL_H_
 
+#include <stdint.h>
 #include <abi/syscall.h>
+#include <libarch/types.h>
 
 #define __syscall0  __syscall
Index: uspace/lib/c/arch/riscv64/include/libarch/tls.h
===================================================================
--- uspace/lib/c/arch/riscv64/include/libarch/tls.h	(revision 22299ed9a3c298d5c73fceaefb6a619c975bdee1)
+++ uspace/lib/c/arch/riscv64/include/libarch/tls.h	(revision c09ff7bd1b88585eb4f2aaba5b1a2d603a5979c7)
@@ -51,5 +51,5 @@
 static inline tcb_t *__tcb_get(void)
 {
-	return NULL;
+	return (void *) 0;
 }
 
Index: uspace/lib/c/arch/riscv64/src/entry.c
===================================================================
--- uspace/lib/c/arch/riscv64/src/entry.c	(revision 22299ed9a3c298d5c73fceaefb6a619c975bdee1)
+++ uspace/lib/c/arch/riscv64/src/entry.c	(revision c09ff7bd1b88585eb4f2aaba5b1a2d603a5979c7)
@@ -35,5 +35,5 @@
 void __entry(void)
 {
-	__main(NULL);
+	__main((void *) 0);
 }
 
Index: uspace/lib/c/arch/riscv64/src/stacktrace.c
===================================================================
--- uspace/lib/c/arch/riscv64/src/stacktrace.c	(revision 22299ed9a3c298d5c73fceaefb6a619c975bdee1)
+++ uspace/lib/c/arch/riscv64/src/stacktrace.c	(revision c09ff7bd1b88585eb4f2aaba5b1a2d603a5979c7)
@@ -55,10 +55,10 @@
 uintptr_t stacktrace_fp_get(void)
 {
-	return (uintptr_t) NULL;
+	return 0;
 }
 
 uintptr_t stacktrace_pc_get(void)
 {
-	return (uintptr_t) NULL;
+	return 0;
 }
 
Index: uspace/lib/c/arch/riscv64/src/thread_entry.c
===================================================================
--- uspace/lib/c/arch/riscv64/src/thread_entry.c	(revision 22299ed9a3c298d5c73fceaefb6a619c975bdee1)
+++ uspace/lib/c/arch/riscv64/src/thread_entry.c	(revision c09ff7bd1b88585eb4f2aaba5b1a2d603a5979c7)
@@ -30,9 +30,10 @@
  */
 
+#include <libarch/types.h>
 #include "../../../generic/private/thread.h"
 
 void __thread_entry(void)
 {
-	__thread_main(NULL);
+	__thread_main((void *) 0);
 }
 
