3 * \brief Some helper functions for stack manipulation. Newer versions of
4 * gcc forbid to cast the lvalue of an expression resulting that
5 * the following expression is invalid:
7 * *--((l4_threadid_t)esp) = tid
10 * \author Frank Mehnert <fm3@os.inf.tu-dresden.de> */
13 * (c) 2003-2009 Author(s)
14 * economic rights: Technische Universität Dresden (Germany)
15 * This file is part of TUD:OS and distributed under the terms of the
16 * GNU Lesser General Public License 2.1.
17 * Please see the COPYING-LGPL-2.1 file for details.
20 #ifndef _L4UTIL_STACK_H
21 #define _L4UTIL_STACK_H
23 #include <l4/sys/types.h>
24 #include <l4/sys/compiler.h>
28 L4_INLINE void l4util_stack_push_mword(l4_addr_t *stack, l4_mword_t val);
30 /*****************************************************************************/
32 * \brief Get current stack pointer.
34 * \return stack pointer.
36 L4_INLINE l4_addr_t l4util_stack_get_sp(void);
42 #include <l4/util/stack_impl.h>
45 l4util_stack_push_mword(l4_addr_t *stack, l4_mword_t val)
47 l4_mword_t *esp = (l4_mword_t*)(*stack);
49 *stack = (l4_addr_t)esp;