Index: kernel/arch/ia32/include/arch/asm.h
===================================================================
--- kernel/arch/ia32/include/arch/asm.h	(revision 13dfa3f9eae98905dfc11390f35b47eb2559eeef)
+++ kernel/arch/ia32/include/arch/asm.h	(revision 1a5eca452dd19104f8673b755943e0707abc00e4)
@@ -439,4 +439,17 @@
 	asm volatile (
 		"ltr %[sel]"
+		:: [sel] "r" (sel)
+	);
+}
+
+/** Load GS from descriptor table.
+ *
+ * @param sel Selector specifying descriptor of the GS segment.
+ *
+ */
+NO_TRACE static inline void gs_load(uint16_t sel)
+{
+	asm volatile (
+		"mov %[sel], %%gs"
 		:: [sel] "r" (sel)
 	);
Index: kernel/arch/ia32/include/arch/context_struct.ag
===================================================================
--- kernel/arch/ia32/include/arch/context_struct.ag	(revision 13dfa3f9eae98905dfc11390f35b47eb2559eeef)
+++ kernel/arch/ia32/include/arch/context_struct.ag	(revision 1a5eca452dd19104f8673b755943e0707abc00e4)
@@ -66,4 +66,9 @@
                 },
                 {
+                        name : tp,
+                        type : uint32_t
+                },
+
+                {
                         name : ipl,
                         type : ipl_t
Index: kernel/arch/ia32/include/arch/pm.h
===================================================================
--- kernel/arch/ia32/include/arch/pm.h	(revision 13dfa3f9eae98905dfc11390f35b47eb2559eeef)
+++ kernel/arch/ia32/include/arch/pm.h	(revision 1a5eca452dd19104f8673b755943e0707abc00e4)
@@ -45,5 +45,5 @@
 #define UDATA_DES  4
 #define TSS_DES    5
-#define TLS_DES    6  /* Pointer to Thread-Local-Storage data */
+#define VREG_DES   6  /* Virtual registers */
 
 #ifdef CONFIG_FB
@@ -169,5 +169,4 @@
 
 extern void tss_initialize(tss_t *t);
-extern void set_tls_desc(uintptr_t tls);
 
 #endif /* __ASM__ */
Index: kernel/arch/ia32/include/arch/proc/thread.h
===================================================================
--- kernel/arch/ia32/include/arch/proc/thread.h	(revision 13dfa3f9eae98905dfc11390f35b47eb2559eeef)
+++ kernel/arch/ia32/include/arch/proc/thread.h	(revision 1a5eca452dd19104f8673b755943e0707abc00e4)
@@ -39,5 +39,4 @@
 
 typedef struct {
-	sysarg_t tls;
 } thread_arch_t;
 
Index: kernel/arch/ia32/include/arch/vreg.h
===================================================================
--- kernel/arch/ia32/include/arch/vreg.h	(revision 1a5eca452dd19104f8673b755943e0707abc00e4)
+++ kernel/arch/ia32/include/arch/vreg.h	(revision 1a5eca452dd19104f8673b755943e0707abc00e4)
@@ -0,0 +1,53 @@
+/*
+ * Copyright (c) 2016 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 ia32
+ * @{
+ */
+/** @file
+ */
+
+#ifndef KERN_ia32_VREG_H_
+#define KERN_ia32_VREG_H_
+
+#define VREG_TP	0
+
+#ifndef __ASM__
+
+#include <typedefs.h>
+
+extern uint32_t *vreg_ptr;
+
+extern void vreg_init(void);
+
+#endif /* __ASM__ */
+
+#endif
+
+/** @}
+ */
