Ignore:
Timestamp:
2011-06-01T08:43:42Z (14 years ago)
Author:
Lubos Slovak <lubos.slovak@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
8d6c1f1
Parents:
9e2e715 (diff), e51a514 (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:

Huuuuuge merge from development - all the work actually :)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • kernel/generic/src/interrupt/interrupt.c

    r9e2e715 reb522e8  
    4545#include <console/console.h>
    4646#include <console/cmd.h>
    47 #include <ipc/event.h>
    4847#include <synch/mutex.h>
    4948#include <time/delay.h>
     
    176175        printf("Task %s (%" PRIu64 ") killed due to an exception at "
    177176            "program counter %p.\n", TASK->name, TASK->taskid,
    178             istate_get_pc(istate));
     177            (void *) istate_get_pc(istate));
    179178       
    180179        stack_trace_istate(istate);
     
    188187        printf("\n");
    189188       
     189        task_kill_self(true);
     190}
     191
     192/** Get istate structure of a thread.
     193 *
     194 * Get pointer to the istate structure at the bottom of the kernel stack.
     195 *
     196 * This function can be called in interrupt or user context. In interrupt
     197 * context the istate structure is created by the low-level exception
     198 * handler. In user context the istate structure is created by the
     199 * low-level syscall handler.
     200 */
     201istate_t *istate_get(thread_t *thread)
     202{
    190203        /*
    191          * Userspace can subscribe for FAULT events to take action
    192          * whenever a thread faults. (E.g. take a dump, run a debugger).
    193          * The notification is always available, but unless Udebug is enabled,
    194          * that's all you get.
     204         * The istate structure should be right at the bottom of the kernel
     205         * stack.
    195206         */
    196         if (event_is_subscribed(EVENT_FAULT)) {
    197                 /* Notify the subscriber that a fault occurred. */
    198                 event_notify_3(EVENT_FAULT, LOWER32(TASK->taskid),
    199                     UPPER32(TASK->taskid), (unative_t) THREAD);
    200                
    201 #ifdef CONFIG_UDEBUG
    202                 /* Wait for a debugging session. */
    203                 udebug_thread_fault();
    204 #endif
    205         }
    206        
    207         task_kill(TASK->taskid);
    208         thread_exit();
     207        return (istate_t *) ((uint8_t *) thread->kstack + THREAD_STACK_SIZE -
     208            sizeof(istate_t));
    209209}
    210210
     
    263263               
    264264                const char *symbol =
    265                     symtab_fmt_name_lookup((unative_t) exc_table[i].handler);
     265                    symtab_fmt_name_lookup((sysarg_t) exc_table[i].handler);
    266266               
    267267#ifdef __32_BITS__
Note: See TracChangeset for help on using the changeset viewer.