Index: uspace/lib/c/arch/mips32/include/libarch/tls.h
===================================================================
--- uspace/lib/c/arch/mips32/include/libarch/tls.h	(revision 2eadda9562ba40a94f02c6d055a17a045521838d)
+++ uspace/lib/c/arch/mips32/include/libarch/tls.h	(revision 40abf56ae4263cdef7e6b8d2a4f5f794c32dedf3)
@@ -61,5 +61,5 @@
  * - No assumption about DTV etc., but it will not have a fixed address
  */
-#define MIPS_TP_OFFSET 0x7000
+#define ARCH_TP_OFFSET (0x7000 + sizeof(tcb_t))
 
 typedef struct {
@@ -67,19 +67,15 @@
 } tcb_t;
 
-static inline void __tcb_set(tcb_t *tcb)
+static inline void __tcb_raw_set(void *tls)
 {
-	uint8_t *tp = (uint8_t *) tcb;
-	tp += MIPS_TP_OFFSET + sizeof(tcb_t);
-
-	asm volatile ("add $27, %0, $0" : : "r" (tp)); /* Move tls to K1 */
+	/* Move tls to K1 */
+	asm volatile ("add $27, %0, $0" :: "r" (tls));
 }
 
-static inline tcb_t *__tcb_get(void)
+static inline void *__tcb_raw_get(void)
 {
-	uint8_t *retval;
-
+	void *retval;
 	asm volatile ("add %0, $27, $0" : "=r" (retval));
-
-	return (tcb_t *)(retval - MIPS_TP_OFFSET - sizeof(tcb_t));
+	return retval;
 }
 
