]> rtime.felk.cvut.cz Git - l4.git/blob - l4/pkg/l4util/include/ARCH-x86/stack_impl.h
2f3e801f3585c8e1afbe462b47c4032e3466e22b
[l4.git] / l4 / pkg / l4util / include / ARCH-x86 / stack_impl.h
1 /**
2  * \file
3  * \brief Stack utilities for x86
4  */
5 /*
6  * (c) 2008-2009 Technische Universität Dresden
7  * This file is part of TUD:OS and distributed under the terms of the
8  * GNU Lesser General Public License 2.1.
9  * Please see the COPYING-LGPL-2.1 file for details.
10  */
11 #ifndef __L4UTIL__INCLUDE__ARCH_X86__STACK_IMPL_H__
12 #define __L4UTIL__INCLUDE__ARCH_X86__STACK_IMPL_H__
13
14 #ifndef _L4UTIL_STACK_H
15 #error Do not include stack_impl.h directly, use stack.h instead
16 #endif
17
18 EXTERN_C_BEGIN
19
20 L4_INLINE l4_addr_t l4util_stack_get_sp(void)
21 {
22   l4_addr_t esp;
23
24   asm("movl   %%esp, %0\n\t" : "=r" (esp) : );
25   return esp;
26 }
27
28 EXTERN_C_END
29
30 #endif /* ! __L4UTIL__INCLUDE__ARCH_ARM__STACK_IMPL_H__ */