Index: kernel/arch/mips64/include/context_offset.h
===================================================================
--- kernel/arch/mips64/include/context_offset.h	(revision c6f087267a5341520c2f7f049eae7b1a387ecb14)
+++ kernel/arch/mips64/include/context_offset.h	(revision eb66f2363ca8db8691ed55d9584d3122c2853502)
@@ -63,15 +63,7 @@
 #ifdef __ASM__
 
-#ifdef KERNEL
-
 #include <arch/asm/regname.h>
 
-#else /* KERNEL */
-
-#include <libarch/regname.h>
-
-#endif /* KERNEL */
-
-/* ctx: address of the structure with saved context */
+# ctx: address of the structure with saved context
 .macro CONTEXT_SAVE_ARCH_CORE ctx:req
 	sd $s0, OFFSET_S0(\ctx)
@@ -129,5 +121,5 @@
 .endm
 
-/* ctx: address of the structure with saved context */
+# ctx: address of the structure with saved context
 .macro CONTEXT_RESTORE_ARCH_CORE ctx:req
 	ld $s0, OFFSET_S0(\ctx)
Index: kernel/arch/mips64/include/cp0.h
===================================================================
--- kernel/arch/mips64/include/cp0.h	(revision c6f087267a5341520c2f7f049eae7b1a387ecb14)
+++ kernel/arch/mips64/include/cp0.h	(revision eb66f2363ca8db8691ed55d9584d3122c2853502)
@@ -35,4 +35,14 @@
 #ifndef KERN_mips64_CP0_H_
 #define KERN_mips64_CP0_H_
+
+#ifdef KERNEL
+
+#include <typedefs.h>
+
+#else
+
+#include <sys/types.h>
+
+#endif
 
 #define cp0_status_ie_enabled_bit     (1 << 0)
Index: kernel/arch/mips64/include/istate.h
===================================================================
--- kernel/arch/mips64/include/istate.h	(revision c6f087267a5341520c2f7f049eae7b1a387ecb14)
+++ kernel/arch/mips64/include/istate.h	(revision eb66f2363ca8db8691ed55d9584d3122c2853502)
@@ -36,15 +36,17 @@
 #define KERN_mips64_ISTATE_H_
 
-#include <trace.h>
+#include <arch/cp0.h>
 
 #ifdef KERNEL
 
-#include <arch/cp0.h>
+#include <typedefs.h>
+#include <trace.h>
 
-#else /* KERNEL */
+#else
 
-#include <libarch/cp0.h>
+#include <sys/types.h>
+#define NO_TRACE
 
-#endif /* KERNEL */
+#endif
 
 typedef struct istate {
Index: kernel/arch/mips64/include/mm/frame.h
===================================================================
--- kernel/arch/mips64/include/mm/frame.h	(revision c6f087267a5341520c2f7f049eae7b1a387ecb14)
+++ kernel/arch/mips64/include/mm/frame.h	(revision eb66f2363ca8db8691ed55d9584d3122c2853502)
@@ -39,4 +39,5 @@
 #define FRAME_SIZE   (1 << FRAME_WIDTH)
 
+#ifdef KERNEL
 #ifndef __ASM__
 
@@ -45,4 +46,5 @@
 
 #endif /* __ASM__ */
+#endif /* KERNEL */
 
 #endif
Index: kernel/arch/mips64/include/mm/page.h
===================================================================
--- kernel/arch/mips64/include/mm/page.h	(revision c6f087267a5341520c2f7f049eae7b1a387ecb14)
+++ kernel/arch/mips64/include/mm/page.h	(revision eb66f2363ca8db8691ed55d9584d3122c2853502)
@@ -50,4 +50,5 @@
 #endif
 
+#ifdef KERNEL
 #ifndef __ASM__
 
@@ -55,4 +56,5 @@
 
 #endif /* __ASM__ */
+#endif /* KERNEL */
 
 #endif
Index: kernel/arch/mips64/src/mips64.c
===================================================================
--- kernel/arch/mips64/src/mips64.c	(revision c6f087267a5341520c2f7f049eae7b1a387ecb14)
+++ kernel/arch/mips64/src/mips64.c	(revision eb66f2363ca8db8691ed55d9584d3122c2853502)
@@ -41,5 +41,5 @@
 #include <memstr.h>
 #include <proc/thread.h>
-#include <abi/proc/uarg.h>
+#include <proc/uarg.h>
 #include <print.h>
 #include <console/console.h>
@@ -52,5 +52,5 @@
 #include <arch/debugger.h>
 #include <genarch/fb/fb.h>
-#include <abi/fb/visuals.h>
+#include <genarch/fb/visuals.h>
 #include <genarch/drivers/dsrln/dsrlnin.h>
 #include <genarch/drivers/dsrln/dsrlnout.h>
