Index: kernel/arch/abs32le/include/arch/asm.h
===================================================================
--- kernel/arch/abs32le/include/arch/asm.h	(revision 94e75cf6c40e56c11fc4cf8e6b165e9be7bcd58b)
+++ kernel/arch/abs32le/include/arch/asm.h	(revision 128359ebc085c950da1f7e34c3928f12654b438f)
@@ -188,17 +188,4 @@
 }
 
-_NO_TRACE static inline uintptr_t get_stack_base(void)
-{
-	/*
-	 * On real hardware this returns the address of the bottom
-	 * of the current CPU stack. The current_t structure is stored
-	 * on the bottom of stack and this is used to identify the
-	 * current CPU, current task, current thread and current
-	 * address space.
-	 */
-
-	return 0;
-}
-
 #endif
 
Index: kernel/arch/amd64/include/arch/asm.h
===================================================================
--- kernel/arch/amd64/include/arch/asm.h	(revision 94e75cf6c40e56c11fc4cf8e6b165e9be7bcd58b)
+++ kernel/arch/amd64/include/arch/asm.h	(revision 128359ebc085c950da1f7e34c3928f12654b438f)
@@ -42,24 +42,4 @@
 
 #define IO_SPACE_BOUNDARY	((void *) (64 * 1024))
-
-/** Return base address of current stack.
- *
- * Return the base address of the current stack.
- * The stack is assumed to be STACK_SIZE bytes long.
- * The stack must start on page boundary.
- *
- */
-_NO_TRACE static inline uintptr_t get_stack_base(void)
-{
-	uintptr_t v;
-
-	asm volatile (
-	    "andq %%rsp, %[v]\n"
-	    : [v] "=r" (v)
-	    : "0" (~((uint64_t) STACK_SIZE - 1))
-	);
-
-	return v;
-}
 
 _NO_TRACE static inline void cpu_sleep(void)
Index: kernel/arch/arm32/include/arch/asm.h
===================================================================
--- kernel/arch/arm32/include/arch/asm.h	(revision 94e75cf6c40e56c11fc4cf8e6b165e9be7bcd58b)
+++ kernel/arch/arm32/include/arch/asm.h	(revision 128359ebc085c950da1f7e34c3928f12654b438f)
@@ -95,24 +95,4 @@
 }
 
-/** Return base address of current stack.
- *
- * Return the base address of the current stack.
- * The stack is assumed to be STACK_SIZE bytes long.
- * The stack must start on page boundary.
- *
- */
-_NO_TRACE static inline uintptr_t get_stack_base(void)
-{
-	uintptr_t v;
-
-	asm volatile (
-	    "and %[v], sp, %[size]\n"
-	    : [v] "=r" (v)
-	    : [size] "r" (~(STACK_SIZE - 1))
-	);
-
-	return v;
-}
-
 extern void cpu_halt(void) __attribute__((noreturn));
 extern void asm_delay_loop(uint32_t t);
Index: kernel/arch/arm32/include/arch/context.h
===================================================================
--- kernel/arch/arm32/include/arch/context.h	(revision 94e75cf6c40e56c11fc4cf8e6b165e9be7bcd58b)
+++ kernel/arch/arm32/include/arch/context.h	(revision 128359ebc085c950da1f7e34c3928f12654b438f)
@@ -42,5 +42,5 @@
 #include <arch/regutils.h>
 
-/* Put one item onto the stack to support get_stack_base() and align it up. */
+/* Put one item onto the stack to support CURRENT and align it up. */
 #define SP_DELTA  (0 + ALIGN_UP(STACK_ITEM_SIZE, STACK_ALIGNMENT))
 
Index: kernel/arch/arm64/include/arch/asm.h
===================================================================
--- kernel/arch/arm64/include/arch/asm.h	(revision 94e75cf6c40e56c11fc4cf8e6b165e9be7bcd58b)
+++ kernel/arch/arm64/include/arch/asm.h	(revision 128359ebc085c950da1f7e34c3928f12654b438f)
@@ -52,24 +52,4 @@
 {
 	asm volatile ("wfe");
-}
-
-/** Return base address of current stack.
- *
- * Return the base address of the current stack.
- * The stack is assumed to be STACK_SIZE bytes long.
- * The stack must start on page boundary.
- */
-_NO_TRACE static inline uintptr_t get_stack_base(void)
-{
-	uintptr_t v;
-
-	asm volatile (
-	    "mov %[v], sp\n"
-	    "and %[v], %[v], %[size]\n"
-	    : [v] "=&r" (v)
-	    : [size] "r" (~((uint64_t) STACK_SIZE - 1))
-	);
-
-	return v;
 }
 
Index: kernel/arch/arm64/include/arch/context.h
===================================================================
--- kernel/arch/arm64/include/arch/context.h	(revision 94e75cf6c40e56c11fc4cf8e6b165e9be7bcd58b)
+++ kernel/arch/arm64/include/arch/context.h	(revision 128359ebc085c950da1f7e34c3928f12654b438f)
@@ -41,5 +41,5 @@
 #include <arch/stack.h>
 
-/* Put one item onto the stack to support get_stack_base() and align it up. */
+/* Put one item onto the stack to support CURRENT and align it up. */
 #define SP_DELTA  (0 + ALIGN_UP(STACK_ITEM_SIZE, STACK_ALIGNMENT))
 
Index: kernel/arch/ia32/include/arch/asm.h
===================================================================
--- kernel/arch/ia32/include/arch/asm.h	(revision 94e75cf6c40e56c11fc4cf8e6b165e9be7bcd58b)
+++ kernel/arch/ia32/include/arch/asm.h	(revision 128359ebc085c950da1f7e34c3928f12654b438f)
@@ -348,24 +348,4 @@
 
 #endif /* PROCESSOR_i486 */
-
-/** Return base address of current stack
- *
- * Return the base address of the current stack.
- * The stack is assumed to be STACK_SIZE bytes long.
- * The stack must start on page boundary.
- *
- */
-_NO_TRACE static inline uintptr_t get_stack_base(void)
-{
-	uintptr_t v;
-
-	asm volatile (
-	    "andl %%esp, %[v]\n"
-	    : [v] "=r" (v)
-	    : "0" (~(STACK_SIZE - 1))
-	);
-
-	return v;
-}
 
 /** Invalidate TLB Entry.
Index: kernel/arch/ia32/include/arch/context.h
===================================================================
--- kernel/arch/ia32/include/arch/context.h	(revision 94e75cf6c40e56c11fc4cf8e6b165e9be7bcd58b)
+++ kernel/arch/ia32/include/arch/context.h	(revision 128359ebc085c950da1f7e34c3928f12654b438f)
@@ -45,5 +45,5 @@
  * First for pop of the saved register, second during ret instruction.
  *
- * One item is put onto stack to support get_stack_base().
+ * One item is put onto stack to support CURRENT.
  */
 #define SP_DELTA  (8 + STACK_ITEM_SIZE)
Index: kernel/arch/ia64/include/arch/asm.h
===================================================================
--- kernel/arch/ia64/include/arch/asm.h	(revision 94e75cf6c40e56c11fc4cf8e6b165e9be7bcd58b)
+++ kernel/arch/ia64/include/arch/asm.h	(revision 128359ebc085c950da1f7e34c3928f12654b438f)
@@ -160,22 +160,4 @@
 }
 
-/** Return base address of current memory stack.
- *
- * The memory stack is assumed to be STACK_SIZE / 2 long. Note that there is
- * also the RSE stack, which takes up the upper half of STACK_SIZE.
- * The memory stack must start on page boundary.
- */
-_NO_TRACE static inline uintptr_t get_stack_base(void)
-{
-	uint64_t value;
-
-	asm volatile (
-	    "mov %[value] = r12"
-	    : [value] "=r" (value)
-	);
-
-	return (value & (~(STACK_SIZE / 2 - 1)));
-}
-
 /** Return Processor State Register.
  *
Index: kernel/arch/ia64/include/arch/context.h
===================================================================
--- kernel/arch/ia64/include/arch/context.h	(revision 94e75cf6c40e56c11fc4cf8e6b165e9be7bcd58b)
+++ kernel/arch/ia64/include/arch/context.h	(revision 128359ebc085c950da1f7e34c3928f12654b438f)
@@ -46,5 +46,5 @@
  * No need to allocate scratch area.
  *
- * One item is put onto the stack to support get_stack_base().
+ * One item is put onto the stack to support CURRENT.
  */
 #define SP_DELTA  (0 + ALIGN_UP(STACK_ITEM_SIZE, STACK_ALIGNMENT))
Index: kernel/arch/mips32/include/arch/asm.h
===================================================================
--- kernel/arch/mips32/include/arch/asm.h	(revision 94e75cf6c40e56c11fc4cf8e6b165e9be7bcd58b)
+++ kernel/arch/mips32/include/arch/asm.h	(revision 128359ebc085c950da1f7e34c3928f12654b438f)
@@ -45,24 +45,4 @@
 }
 
-/** Return base address of current stack
- *
- * Return the base address of the current stack.
- * The stack is assumed to be STACK_SIZE bytes long.
- * The stack must start on page boundary.
- *
- */
-_NO_TRACE static inline uintptr_t get_stack_base(void)
-{
-	uintptr_t base;
-
-	asm volatile (
-	    "and %[base], $29, %[mask]\n"
-	    : [base] "=r" (base)
-	    : [mask] "r" (~(STACK_SIZE - 1))
-	);
-
-	return base;
-}
-
 _NO_TRACE static inline void pio_write_8(ioport8_t *port, uint8_t v)
 {
Index: kernel/arch/mips32/include/arch/context.h
===================================================================
--- kernel/arch/mips32/include/arch/context.h	(revision 94e75cf6c40e56c11fc4cf8e6b165e9be7bcd58b)
+++ kernel/arch/mips32/include/arch/context.h	(revision 128359ebc085c950da1f7e34c3928f12654b438f)
@@ -41,5 +41,5 @@
 
 /*
- * Put one item onto the stack to support get_stack_base() and align it up.
+ * Put one item onto the stack to support CURRENT and align it up.
  */
 #define SP_DELTA  (ABI_STACK_FRAME + ALIGN_UP(STACK_ITEM_SIZE, STACK_ALIGNMENT))
Index: kernel/arch/ppc32/include/arch/asm.h
===================================================================
--- kernel/arch/ppc32/include/arch/asm.h	(revision 94e75cf6c40e56c11fc4cf8e6b165e9be7bcd58b)
+++ kernel/arch/ppc32/include/arch/asm.h	(revision 128359ebc085c950da1f7e34c3928f12654b438f)
@@ -163,24 +163,4 @@
 }
 
-/** Return base address of current stack.
- *
- * Return the base address of the current stack.
- * The stack is assumed to be STACK_SIZE bytes long.
- * The stack must start on page boundary.
- *
- */
-_NO_TRACE static inline uintptr_t get_stack_base(void)
-{
-	uintptr_t base;
-
-	asm volatile (
-	    "and %[base], %%sp, %[mask]\n"
-	    : [base] "=r" (base)
-	    : [mask] "r" (~(STACK_SIZE - 1))
-	);
-
-	return base;
-}
-
 _NO_TRACE static inline void cpu_sleep(void)
 {
Index: kernel/arch/riscv64/include/arch/asm.h
===================================================================
--- kernel/arch/riscv64/include/arch/asm.h	(revision 94e75cf6c40e56c11fc4cf8e6b165e9be7bcd58b)
+++ kernel/arch/riscv64/include/arch/asm.h	(revision 128359ebc085c950da1f7e34c3928f12654b438f)
@@ -91,17 +91,4 @@
 }
 
-_NO_TRACE static inline uintptr_t get_stack_base(void)
-{
-	uintptr_t base;
-
-	asm volatile (
-	    "and %[base], sp, %[mask]\n"
-	    : [base] "=r" (base)
-	    : [mask] "r" (~(STACK_SIZE - 1))
-	);
-
-	return base;
-}
-
 _NO_TRACE static inline void cpu_sleep(void)
 {
Index: kernel/arch/sparc64/include/arch/asm.h
===================================================================
--- kernel/arch/sparc64/include/arch/asm.h	(revision 94e75cf6c40e56c11fc4cf8e6b165e9be7bcd58b)
+++ kernel/arch/sparc64/include/arch/asm.h	(revision 128359ebc085c950da1f7e34c3928f12654b438f)
@@ -382,24 +382,4 @@
 }
 
-/** Return base address of current stack.
- *
- * Return the base address of the current stack.
- * The stack is assumed to be STACK_SIZE bytes long.
- * The stack must start on page boundary.
- *
- */
-_NO_TRACE static inline uintptr_t get_stack_base(void)
-{
-	uintptr_t unbiased_sp;
-
-	asm volatile (
-	    "add %%sp, %[stack_bias], %[unbiased_sp]\n"
-	    : [unbiased_sp] "=r" (unbiased_sp)
-	    : [stack_bias] "i" (STACK_BIAS)
-	);
-
-	return ALIGN_DOWN(unbiased_sp, STACK_SIZE);
-}
-
 /** Read Version Register.
  *
Index: kernel/generic/include/arch.h
===================================================================
--- kernel/generic/include/arch.h	(revision 94e75cf6c40e56c11fc4cf8e6b165e9be7bcd58b)
+++ kernel/generic/include/arch.h	(revision 128359ebc085c950da1f7e34c3928f12654b438f)
@@ -36,14 +36,21 @@
 #define KERN_ARCH_H_
 
-#include <arch/asm.h>   /* get_stack_base() */
 #include <config.h>
 
-/*
+/** Return the current_t structure
+ *
  * The current_t structure holds pointers to various parts of the current
  * execution state, like running task, thread, address space, etc.
+ *
+ * The current_t structure is located at the base address of the current
+ * stack. The stack is assumed to be STACK_SIZE bytes long. The stack base
+ * address must be aligned to STACK_SIZE.
+ *
  */
-#define CURRENT  ((current_t * )(get_stack_base()))
+#define CURRENT \
+	((current_t *) (((uintptr_t) __builtin_frame_address(0)) & \
+	    (~((uintptr_t) STACK_SIZE - 1))))
 
-#define MAGIC                UINT32_C(0xfacefeed)
+#define MAGIC  UINT32_C(0xfacefeed)
 
 #define container_check(ctn1, ctn2)  ((ctn1) == (ctn2))
@@ -59,16 +66,18 @@
 struct as;
 
-/**
+/** Current structure
+ *
  * For each possible kernel stack, structure
  * of the following type will be placed at
  * the base address of the stack.
+ *
  */
 typedef struct {
-	size_t preemption;     /**< Preemption disabled counter and flag. */
-	struct thread *thread; /**< Current thread. */
-	struct task *task;     /**< Current task. */
-	struct cpu *cpu;       /**< Executing cpu. */
-	struct as *as;         /**< Current address space. */
-	uint32_t magic;        /**< Magic value */
+	size_t preemption;      /**< Preemption disabled counter and flag. */
+	struct thread *thread;  /**< Current thread. */
+	struct task *task;      /**< Current task. */
+	struct cpu *cpu;        /**< Executing CPU. */
+	struct as *as;          /**< Current address space. */
+	uint32_t magic;         /**< Magic value. */
 } current_t;
 
@@ -89,5 +98,5 @@
 	} while (0)
 
-#define ARCH_OP(op)	ARCH_STRUCT_OP(arch_ops, op)
+#define ARCH_OP(op)  ARCH_STRUCT_OP(arch_ops, op)
 
 extern void current_initialize(current_t *);
Index: kernel/generic/src/cpu/cpu.c
===================================================================
--- kernel/generic/src/cpu/cpu.c	(revision 94e75cf6c40e56c11fc4cf8e6b165e9be7bcd58b)
+++ kernel/generic/src/cpu/cpu.c	(revision 128359ebc085c950da1f7e34c3928f12654b438f)
@@ -71,8 +71,9 @@
 		memsetb(cpus, sizeof(cpu_t) * config.cpu_count, 0);
 
-		// NOTE: All kernel stacks must be aligned to STACK_SIZE,
-		//       see get_stack_base().
-		size_t i;
-		for (i = 0; i < config.cpu_count; i++) {
+		/*
+		 * NOTE: All kernel stacks must be aligned to STACK_SIZE,
+		 *       see CURRENT.
+		 */
+		for (size_t i = 0; i < config.cpu_count; i++) {
 			uintptr_t stack_phys = frame_alloc(STACK_FRAMES,
 			    FRAME_LOWMEM | FRAME_ATOMIC, STACK_SIZE - 1);
Index: kernel/generic/src/main/main.c
===================================================================
--- kernel/generic/src/main/main.c	(revision 94e75cf6c40e56c11fc4cf8e6b165e9be7bcd58b)
+++ kernel/generic/src/main/main.c	(revision 128359ebc085c950da1f7e34c3928f12654b438f)
@@ -170,6 +170,8 @@
 	    ALIGN_UP((uintptr_t) kdata_end - config.base, PAGE_SIZE);
 
-	// NOTE: All kernel stacks must be aligned to STACK_SIZE,
-	//       see get_stack_base().
+	/*
+	 * NOTE: All kernel stacks must be aligned to STACK_SIZE,
+	 *       see CURRENT.
+	 */
 
 	/* Place the stack after the kernel, init and ballocs. */
Index: kernel/generic/src/proc/thread.c
===================================================================
--- kernel/generic/src/proc/thread.c	(revision 94e75cf6c40e56c11fc4cf8e6b165e9be7bcd58b)
+++ kernel/generic/src/proc/thread.c	(revision 128359ebc085c950da1f7e34c3928f12654b438f)
@@ -191,6 +191,8 @@
 	kmflags &= ~FRAME_HIGHMEM;
 
-	// NOTE: All kernel stacks must be aligned to STACK_SIZE,
-	//       see get_stack_base().
+	/*
+	 * NOTE: All kernel stacks must be aligned to STACK_SIZE,
+	 *       see CURRENT.
+	 */
 
 	uintptr_t stack_phys =
