Changeset a074b4f in mainline
- Timestamp:
- 2010-01-23T19:19:18Z (15 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 03333bc
- Parents:
- 336db295
- Files:
-
- 2 added
- 11 edited
Legend:
- Unmodified
- Added
- Removed
-
HelenOS.config
r336db295 ra074b4f 486 486 % Mount /data on startup 487 487 ! [CONFIG_START_BD=y] CONFIG_MOUNT_DATA (n/y) 488 489 % Verbose task dumps 490 ! CONFIG_VERBOSE_DUMPS (n/y) -
boot/Makefile.common
r336db295 ra074b4f 56 56 $(USPACEDIR)/srv/fs/devfs/devfs \ 57 57 $(USPACEDIR)/srv/fs/tmpfs/tmpfs \ 58 $(USPACEDIR)/srv/fs/fat/fat 58 $(USPACEDIR)/srv/fs/fat/fat \ 59 $(USPACEDIR)/srv/taskmon/taskmon 59 60 60 61 RD_APPS = \ -
kernel/generic/include/interrupt.h
r336db295 ra074b4f 46 46 typedef void (* iroutine)(int n, istate_t *istate); 47 47 48 #define fault_if_from_uspace(istate, fmt, ...) \ 49 { \ 50 if (istate_from_uspace(istate)) { \ 51 task_t *task = TASK; \ 52 printf("Task %s (%" PRIu64 ") killed due to an exception at " \ 53 "program counter %p.\n", task->name, task->taskid, istate_get_pc(istate)); \ 54 stack_trace_istate(istate); \ 55 printf("Kill message: " fmt "\n", ##__VA_ARGS__); \ 56 task_kill(task->taskid); \ 57 thread_exit(); \ 58 } \ 59 } 60 48 extern void fault_if_from_uspace(istate_t *istate, char *fmt, ...); 61 49 extern iroutine exc_register(int n, const char *name, iroutine f); 62 50 extern void exc_dispatch(int n, istate_t *t); -
kernel/generic/include/ipc/event_types.h
r336db295 ra074b4f 37 37 38 38 typedef enum event_type { 39 /** New data available in kernel log */ 39 40 EVENT_KLOG = 0, 41 /** Returning from kernel console to userspace */ 40 42 EVENT_KCONSOLE, 43 /** A thread has faulted and will be terminated */ 44 EVENT_FAULT, 41 45 EVENT_END 42 46 } event_type_t; -
kernel/generic/include/udebug/udebug.h
r336db295 ra074b4f 153 153 154 154 #include <synch/mutex.h> 155 #include <synch/condvar.h> 155 156 #include <arch/interrupt.h> 156 157 #include <atomic.h> … … 195 196 bool stoppable; /**< thread is stoppable */ 196 197 bool active; /**< thread is in a debugging session */ 198 condvar_t active_cv; 197 199 } udebug_thread_t; 198 200 -
kernel/generic/src/interrupt/interrupt.c
r336db295 ra074b4f 44 44 #include <console/console.h> 45 45 #include <console/cmd.h> 46 #include <ipc/event.h> 47 #include <synch/mutex.h> 48 #include <time/delay.h> 49 #include <macros.h> 46 50 #include <panic.h> 47 51 #include <print.h> … … 107 111 fault_if_from_uspace(istate, "Unhandled exception %d.", n); 108 112 panic("Unhandled exception %d.", n); 113 } 114 115 /** Terminate thread and task if exception came from userspace. */ 116 void fault_if_from_uspace(istate_t *istate, char *fmt, ...) 117 { 118 task_t *task = TASK; 119 va_list args; 120 121 if (!istate_from_uspace(istate)) 122 return; 123 124 printf("Task %s (%" PRIu64 ") killed due to an exception at " 125 "program counter %p.\n", task->name, task->taskid, 126 istate_get_pc(istate)); 127 128 stack_trace_istate(istate); 129 130 printf("Kill message: "); 131 va_start(args, fmt); 132 vprintf(fmt, args); 133 va_end(args); 134 printf("\n"); 135 136 if (event_is_subscribed(EVENT_FAULT)) { 137 event_notify_3(EVENT_FAULT, LOWER32(TASK->taskid), 138 UPPER32(TASK->taskid), (unative_t) THREAD); 139 } 140 141 #ifdef CONFIG_UDEBUG 142 /* Wait until a debugger attends to us. */ 143 mutex_lock(&THREAD->udebug.lock); 144 while (!THREAD->udebug.active) 145 condvar_wait(&THREAD->udebug.active_cv, &THREAD->udebug.lock); 146 mutex_unlock(&THREAD->udebug.lock); 147 148 udebug_stoppable_begin(); 149 udebug_stoppable_end(); 150 151 /* Make sure the debugging session is over before proceeding. */ 152 mutex_lock(&THREAD->udebug.lock); 153 while (THREAD->udebug.active) 154 condvar_wait(&THREAD->udebug.active_cv, &THREAD->udebug.lock); 155 mutex_unlock(&THREAD->udebug.lock); 156 #endif 157 158 task_kill(task->taskid); 159 thread_exit(); 109 160 } 110 161 -
kernel/generic/src/udebug/udebug.c
r336db295 ra074b4f 69 69 mutex_initialize(&ut->lock, MUTEX_PASSIVE); 70 70 waitq_initialize(&ut->go_wq); 71 condvar_initialize(&ut->active_cv); 71 72 72 73 ut->go_call = NULL; … … 446 447 waitq_wakeup(&t->udebug.go_wq, WAKEUP_FIRST); 447 448 } 449 mutex_unlock(&t->udebug.lock); 450 condvar_broadcast(&t->udebug.active_cv); 451 } else { 452 mutex_unlock(&t->udebug.lock); 448 453 } 449 mutex_unlock(&t->udebug.lock);450 454 } 451 455 -
kernel/generic/src/udebug/udebug_ops.c
r336db295 ra074b4f 209 209 210 210 mutex_lock(&t->udebug.lock); 211 if ((t->flags & THREAD_FLAG_USPACE) != 0) 211 if ((t->flags & THREAD_FLAG_USPACE) != 0) { 212 212 t->udebug.active = true; 213 mutex_unlock(&t->udebug.lock); 213 mutex_unlock(&t->udebug.lock); 214 condvar_broadcast(&t->udebug.active_cv); 215 } else { 216 mutex_unlock(&t->udebug.lock); 217 } 214 218 } 215 219 -
uspace/Makefile
r336db295 ra074b4f 48 48 srv/loader \ 49 49 srv/ns \ 50 srv/taskmon \ 50 51 srv/vfs \ 51 52 srv/bd/ata_bd \ -
uspace/app/init/init.c
r336db295 ra074b4f 257 257 258 258 spawn("/srv/devfs"); 259 spawn("/srv/taskmon"); 259 260 260 261 if (!mount_devfs()) { -
uspace/app/taskdump/taskdump.c
r336db295 ra074b4f 47 47 #define LINE_BYTES 16 48 48 49 50 49 #define DBUF_SIZE 4096 51 50 static uint8_t data_buf[DBUF_SIZE]; … … 222 221 printf("Threads:\n"); 223 222 for (i = 0; i < n_threads; i++) { 224 printf(" [%d] (hash 0x%lx)\n", 1+i, thash_buf[i]);223 printf(" [%d] hash: 0x%lx\n", 1+i, thash_buf[i]); 225 224 } 226 225 putchar('\n');
Note:
See TracChangeset
for help on using the changeset viewer.