Ignore:
Timestamp:
2013-12-10T22:33:33Z (10 years ago)
Author:
Jakub Klama <jakub.klama@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
f7a33de
Parents:
2955bb9
Message:

Fixes as follows:

  • memcpy_from/to_uspace - fixed return value when size is 0
  • saving UWB pointer after thead runs
  • preemptible trap/syscall fixes
  • support for missing page fault types in page_fault()
File:
1 edited

Legend:

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

    r2955bb9 r382fb4ba  
    11/*
    22 * Copyright (c) 2010 Jakub Jermar
     3 * Copyright (c) 2013 Jakub Klama
    34 * All rights reserved.
    45 *
     
    2728 */
    2829
    29 /** @addtogroup abs32le
     30/** @addtogroup sparc32
    3031 * @{
    3132 */
     
    3738#include <typedefs.h>
    3839
     40#include <arch.h>
     41#include <arch/stack.h>
     42
     43#define FRAME_OFFSET_FP_PREV    14
     44#define FRAME_OFFSET_RA         15
     45
     46extern void alloc_window_and_flush(void);
     47
    3948bool kernel_stack_trace_context_validate(stack_trace_context_t *ctx)
    4049{
    41         return true;
     50        uintptr_t kstack;
     51        uint32_t l1, l2;
     52       
     53        read_from_invalid(&kstack, &l1, &l2);
     54        kstack -= 128;
     55
     56        if (THREAD && (ctx->fp == kstack))
     57                return false;
     58        return ctx->fp != 0;
    4259}
    4360
    4461bool kernel_frame_pointer_prev(stack_trace_context_t *ctx, uintptr_t *prev)
    4562{
     63        uint64_t *stack = (void *) ctx->fp;
     64        alloc_window_and_flush();
     65        *prev = stack[FRAME_OFFSET_FP_PREV];
    4666        return true;
    4767}
     
    4969bool kernel_return_address_get(stack_trace_context_t *ctx, uintptr_t *ra)
    5070{
     71        uint64_t *stack = (void *) ctx->fp;
     72        alloc_window_and_flush();
     73        *ra = stack[FRAME_OFFSET_RA];
    5174        return true;
    5275}
     
    5477bool uspace_stack_trace_context_validate(stack_trace_context_t *ctx)
    5578{
    56         return true;
     79        return false;
    5780}
    5881
    5982bool uspace_frame_pointer_prev(stack_trace_context_t *ctx, uintptr_t *prev)
    6083{
    61         return true;
     84        return false;
    6285}
    6386
    64 bool uspace_return_address_get(stack_trace_context_t *ctx, uintptr_t *ra)
     87bool uspace_return_address_get(stack_trace_context_t *ctx , uintptr_t *ra)
    6588{
    66         return true;
    67 }
    68 
    69 uintptr_t frame_pointer_get(void)
    70 {
    71         return 0;
    72 }
    73 
    74 uintptr_t program_counter_get(void)
    75 {
    76         return 0;
     89        return false;
    7790}
    7891
Note: See TracChangeset for help on using the changeset viewer.