Changeset 5f70118 in mainline for kernel/arch/ia32/src/debug/stacktrace.c
- Timestamp:
- 2010-01-10T12:16:59Z (15 years ago)
- 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. - File:
-
- 1 moved
Legend:
- Unmodified
- Added
- Removed
-
kernel/arch/ia32/src/debug/stacktrace.c
r309ede1 r5f70118 1 1 /* 2 * Copyright (c) 20 06 Josef Cejka2 * Copyright (c) 2010 Jakub Jermar 3 3 * All rights reserved. 4 4 * … … 27 27 */ 28 28 29 /** @addtogroup libcmips3229 /** @addtogroup ia32 30 30 * @{ 31 31 */ 32 32 /** @file 33 * @ingroup libcmips32eb34 33 */ 35 34 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> 38 39 39 /* dont allow to define it second time in stdarg.h */ 40 #define __VARARGS_DEFINED40 #define FRAME_OFFSET_FP_PREV 0 41 #define FRAME_OFFSET_RA 1 41 42 42 #include <sys/types.h> 43 bool kernel_frame_pointer_validate(uintptr_t fp) 44 { 45 return fp != 0; 46 } 43 47 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 */ 48 bool 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 } 48 54 49 typedef uint8_t* va_list; 55 bool 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 } 50 61 51 #define va_start(ap, lst) \ 52 ((ap) = (va_list)&(lst) + sizeof(lst)) 62 bool uspace_frame_pointer_validate(uintptr_t fp) 63 { 64 return fp != 0; 65 } 53 66 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]) 67 bool 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 } 56 72 57 #define va_end(ap) 58 59 #endif 73 bool 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 } 60 78 61 79 /** @}
Note:
See TracChangeset
for help on using the changeset viewer.