]> rtime.felk.cvut.cz Git - l4.git/blob - l4/pkg/l4re-core/l4util/include/ARCH-amd64/stack_impl.h
Update
[l4.git] / l4 / pkg / l4re-core / l4util / include / ARCH-amd64 / stack_impl.h
1 /**
2  * \file
3  * \brief Stack utilities for amd64
4  */
5 /*
6  * (c) 2008-2009 Adam Lackorzynski <adam@os.inf.tu-dresden.de>,
7  *               Torsten Frenzel <frenzel@os.inf.tu-dresden.de>
8  *     economic rights: Technische Universität Dresden (Germany)
9  * This file is part of TUD:OS and distributed under the terms of the
10  * GNU Lesser General Public License 2.1.
11  * Please see the COPYING-LGPL-2.1 file for details.
12  */
13 #ifndef __L4UTIL__INCLUDE__ARCH_AMD64__STACK_IMPL_H__
14 #define __L4UTIL__INCLUDE__ARCH_AMD64__STACK_IMPL_H__
15
16 EXTERN_C_BEGIN
17
18 #ifndef _L4UTIL_STACK_H
19 #error Do not include stack_impl.h directly, use stack.h instead
20 #endif
21
22 L4_INLINE l4_addr_t l4util_stack_get_sp(void)
23 {
24   l4_addr_t rsp;
25
26   asm("movq   %%rsp, %0\n\t" : "=r" (rsp) : );
27   return rsp;
28 }
29
30 EXTERN_C_END
31
32 #endif /* ! __L4UTIL__INCLUDE__ARCH_AMD64__STACK_IMPL_H__ */