Main Page   File List  

stack.h

Go to the documentation of this file.
00001 
00012 /* (c) 2003 Technische Universitaet Dresden
00013  * This file is part of DROPS, which is distributed under the terms of the
00014  * GNU General Public License 2. Please see the COPYING file for details. */
00015 
00016 #ifndef _L4UTIL_STACK_H
00017 #define _L4UTIL_STACK_H
00018 
00019 #include <l4/sys/types.h>
00020 #include <l4/sys/compiler.h>
00021 
00022 EXTERN_C_BEGIN
00023 
00024 L4_INLINE void l4util_stack_push_mword(l4_addr_t *stack, l4_mword_t val);
00025 L4_INLINE void l4util_stack_push_threadid(l4_addr_t *stack, l4_threadid_t val);
00026 
00027 /*****************************************************************************/
00033 L4_INLINE l4_addr_t l4util_stack_get_sp(void);
00034 
00035 /*
00036  * Implementations.
00037  */
00038 
00039 #include <l4/util/stack_impl.h>
00040 
00041 L4_INLINE void
00042 l4util_stack_push_mword(l4_addr_t *stack, l4_mword_t val)
00043 {
00044   l4_mword_t *esp = (l4_mword_t*)(*stack);
00045   *--esp = val;
00046   *stack = (l4_addr_t)esp;
00047 }
00048 
00049 L4_INLINE void
00050 l4util_stack_push_threadid(l4_addr_t *stack, l4_threadid_t val)
00051 {
00052   l4_threadid_t *esp = (l4_threadid_t*)(*stack);
00053   *--esp = val;
00054   *stack = (l4_addr_t)esp;
00055 }
00056 
00057 EXTERN_C_END
00058 
00059 #endif

L4 Utilities, part of DROPS  © 2000-2003