Changeset 63594c0 in mainline


Ignore:
Timestamp:
2011-01-04T22:01:13Z (14 years ago)
Author:
Jiri Svoboda <jiri@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
1ad52de
Parents:
c11ebb6a
Message:

Obtain userspace state in case of system call.

Files:
4 edited

Legend:

Unmodified
Added
Removed
  • kernel/generic/include/interrupt.h

    rc11ebb6a r63594c0  
    6060extern void fault_if_from_uspace(istate_t *, const char *, ...)
    6161    PRINTF_ATTRIBUTE(2, 3);
     62extern istate_t *istate_get(thread_t *);
    6263extern iroutine_t exc_register(unsigned int, const char *, bool, iroutine_t);
    6364extern void exc_dispatch(unsigned int, istate_t *);
  • kernel/generic/src/interrupt/interrupt.c

    rc11ebb6a r63594c0  
    209209}
    210210
     211istate_t *istate_get(thread_t *thread)
     212{
     213        return (istate_t *) ((uint8_t *) thread->kstack + THREAD_STACK_SIZE -
     214            sizeof(istate_t));
     215}
     216
    211217#ifdef CONFIG_KCONSOLE
    212218
  • kernel/generic/src/syscall/syscall.c

    rc11ebb6a r63594c0  
    4545#include <debug.h>
    4646#include <ddi/device.h>
     47#include <interrupt.h>
    4748#include <ipc/sysipc.h>
    4849#include <synch/futex.h>
     
    6667#ifdef CONFIG_UDEBUG
    6768        /*
     69         * An istate_t-compatible record was created on the stack by the
     70         * low-level syscall handler. This is the userspace space state
     71         * structure.
     72         */
     73        THREAD->udebug.uspace_state = istate_get(THREAD);
     74
     75        /*
    6876         * Early check for undebugged tasks. We do not lock anything as this
    6977         * test need not be precise in either direction.
    70          *
    7178         */
    7279        if (THREAD->udebug.active)
     
    98105                udebug_stoppable_end();
    99106        }
     107
     108        /* Clear userspace state pointer */
     109        THREAD->udebug.uspace_state = NULL;
    100110#endif
    101111       
  • uspace/app/taskdump/taskdump.c

    rc11ebb6a r63594c0  
    326326
    327327        sym_pc = fmt_sym_address(pc);
    328         printf("Thread %p crashed at %s. FP = %p\n", (void *) thash,
     328        printf("Thread %p: PC = %s. FP = %p\n", (void *) thash,
    329329            sym_pc, (void *) fp);
    330330        free(sym_pc);
Note: See TracChangeset for help on using the changeset viewer.