Ignore:
Timestamp:
2010-01-10T12:16:59Z (15 years ago)
Author:
Jiri Svoboda <jiri@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
c77a64f
Parents:
309ede1 (diff), 1ac3a52 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

Merge mainline changes.

File:
1 moved

Legend:

Unmodified
Added
Removed
  • kernel/arch/ia32/src/debug/stacktrace.c

    r309ede1 r5f70118  
    11/*
    2  * Copyright (c) 2006 Josef Cejka
     2 * Copyright (c) 2010 Jakub Jermar
    33 * All rights reserved.
    44 *
     
    2727 */
    2828
    29 /** @addtogroup libcmips32     
     29/** @addtogroup ia32
    3030 * @{
    3131 */
    3232/** @file
    33  * @ingroup libcmips32eb       
    3433 */
    3534
    36 #ifndef LIBC_mips32_STACKARG_H_
    37 #define LIBC_mips32_STACKARG_H_
     35#include <stacktrace.h>
     36#include <syscall/copy.h>
     37#include <arch/types.h>
     38#include <typedefs.h>
    3839
    39 /* dont allow to define it second time in stdarg.h */
    40 #define __VARARGS_DEFINED
     40#define FRAME_OFFSET_FP_PREV    0
     41#define FRAME_OFFSET_RA         1
    4142
    42 #include <sys/types.h>
     43bool kernel_frame_pointer_validate(uintptr_t fp)
     44{
     45        return fp != 0;
     46}
    4347
    44 /**
    45  * va_arg macro for MIPS32 - problem is that 64 bit values must be aligned on an 8-byte boundary (32bit values not)
    46  * To satisfy this, paddings must be sometimes inserted.
    47  */
     48bool kernel_frame_pointer_prev(uintptr_t fp, uintptr_t *prev)
     49{
     50        uint32_t *stack = (void *) fp;
     51        *prev = stack[FRAME_OFFSET_FP_PREV];
     52        return true;
     53}
    4854
    49 typedef uint8_t* va_list;
     55bool kernel_return_address_get(uintptr_t fp, uintptr_t *ra)
     56{
     57        uint32_t *stack = (void *) fp;
     58        *ra = stack[FRAME_OFFSET_RA];
     59        return true;
     60}
    5061
    51 #define va_start(ap, lst) \
    52         ((ap) = (va_list)&(lst) + sizeof(lst))
     62bool uspace_frame_pointer_validate(uintptr_t fp)
     63{
     64        return fp != 0;
     65}
    5366
    54 #define va_arg(ap, type)        \
    55         (((type *)((ap) = (va_list)( (sizeof(type) <= 4) ? ((uint32_t)((ap) + 2*4 - 1) & (~3)) : ((uint32_t)((ap) + 2*8 -1) & (~7)) )))[-1])
     67bool uspace_frame_pointer_prev(uintptr_t fp, uintptr_t *prev)
     68{
     69        return !copy_from_uspace((void *) prev,
     70            (uint32_t *) fp + FRAME_OFFSET_FP_PREV, sizeof(*prev));
     71}
    5672
    57 #define va_end(ap)
    58 
    59 #endif
     73bool uspace_return_address_get(uintptr_t fp, uintptr_t *ra)
     74{
     75        return !copy_from_uspace((void *) ra, (uint32_t *) fp + FRAME_OFFSET_RA,
     76            sizeof(*ra));
     77}
    6078
    6179/** @}
Note: See TracChangeset for help on using the changeset viewer.