diff options
-rw-r--r-- | ddb/db_print.c | 15 | ||||
-rw-r--r-- | device/net_io.c | 1 | ||||
-rw-r--r-- | doc/mach.texi | 5 | ||||
-rw-r--r-- | i386/i386/db_interface.c | 4 | ||||
-rw-r--r-- | i386/i386/db_machdep.h | 1 | ||||
-rw-r--r-- | i386/i386at/kd.c | 60 | ||||
-rw-r--r-- | kern/task.c | 1 |
7 files changed, 57 insertions, 30 deletions
diff --git a/ddb/db_print.c b/ddb/db_print.c index c015d84..e711ab6 100644 --- a/ddb/db_print.c +++ b/ddb/db_print.c @@ -194,12 +194,8 @@ db_print_thread( 2*sizeof(vm_offset_t), thread); else db_printf("(%0*X) ", 2*sizeof(vm_offset_t), thread); - db_printf("%c%c%c%c%c", - (thread->state & TH_RUN) ? 'R' : ' ', - (thread->state & TH_WAIT) ? 'W' : ' ', - (thread->state & TH_SUSP) ? 'S' : ' ', - (thread->state & TH_UNINT)? 'N' : ' ', - db_thread_fp_used(thread) ? 'F' : ' '); + char status[8]; + db_printf("%s", db_thread_stat(thread, status)); if (thread->state & TH_SWAPPED) { if (thread->swap_func) { db_printf("("); @@ -258,7 +254,12 @@ db_print_task( } else { if (flag & OPTION_TASK_TITLE) db_printf(" TASK THREADS\n"); - db_printf("%3d (%0*X): ", task_id, 2*sizeof(vm_offset_t), task); + if (task->name[0]) + db_printf("%3d %s (%0*X): ", task_id, task->name, + 2*sizeof(vm_offset_t), task); + else + db_printf("%3d (%0*X): ", task_id, + 2*sizeof(vm_offset_t), task); if (task->thread_count == 0) { db_printf("no threads\n"); } else { diff --git a/device/net_io.c b/device/net_io.c index 82b6fb9..a9d318e 100644 --- a/device/net_io.c +++ b/device/net_io.c @@ -467,6 +467,7 @@ boolean_t net_deliver(boolean_t nonblocking) /* remember message sizes must be rounded up */ kmsg->ikm_header.msgh_size = (((mach_msg_size_t) (sizeof(struct net_rcv_msg) + - sizeof net_kmsg(kmsg)->sent - NET_RCV_MAX + count)) + 3) &~ 3; kmsg->ikm_header.msgh_local_port = MACH_PORT_NULL; kmsg->ikm_header.msgh_kind = MACH_MSGH_KIND_NORMAL; diff --git a/doc/mach.texi b/doc/mach.texi index 49c0d67..2da670f 100644 --- a/doc/mach.texi +++ b/doc/mach.texi @@ -7029,8 +7029,9 @@ session. If the execution is resumed again, the numbers may change. The current thread can be distinguished from others by a @code{#} after the thread id instead of @code{:}. Without @code{l} option, it only shows thread id, thread structure address and the status for each -thread. The status consists of 5 letters, R(run), W(wait), S(suspended), -O(swapped out) and N(interruptible), and if corresponding +thread. The status consists of 6 letters, R(run), W(wait), S(suspended), +O(swapped out), N(interruptible), and F(loating) point arithmetic used (if +supported by the platform). If the corresponding status bit is off, @code{.} is printed instead. If @code{l} option is specified, more detail information is printed for each thread. diff --git a/i386/i386/db_interface.c b/i386/i386/db_interface.c index 1337685..b442b86 100644 --- a/i386/i386/db_interface.c +++ b/i386/i386/db_interface.c @@ -730,8 +730,8 @@ db_task_name( vm_offset_t vaddr, kaddr; unsigned sp; - if (task->map->pmap == kernel_pmap) { - db_printf(DB_GNUMACH_TASK_NAME); + if (task->name[0]) { + db_printf("%s", task->name); return; } diff --git a/i386/i386/db_machdep.h b/i386/i386/db_machdep.h index c6ea3ca..ae1f9c0 100644 --- a/i386/i386/db_machdep.h +++ b/i386/i386/db_machdep.h @@ -93,7 +93,6 @@ db_regs_t ddb_regs; /* register state */ #define DB_TASK_NAME_TITLE "COMMAND " #define DB_TASK_NAME_LEN 23 #define DB_NULL_TASK_NAME "? " -#define DB_GNUMACH_TASK_NAME "gnumach " /* macro for checking if a thread has used floating-point */ diff --git a/i386/i386at/kd.c b/i386/i386at/kd.c index 9f9faf4..7339767 100644 --- a/i386/i386at/kd.c +++ b/i386/i386at/kd.c @@ -240,8 +240,7 @@ unsigned char key_map[NUMKEYS][WIDTH_KMAP] = { {K_LBRKT,NC,NC, K_LBRACE,NC,NC, K_ESC,NC,NC, 0x1b,K_LBRKT,NC, 0x1b,0x4e,K_LBRACE}, {K_RBRKT,NC,NC, K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K_SCAN,K_CLCKSC,NC, K_SCAN,K_CLCKSC,NC, K_SCAN,K_CLCKSC,NC, K_SCAN,K_CLCKSC,NC, K_SCAN,K_CLCKSC,NC}, {K_F1, K_F1S, K_F1, K_F1A, K_F1S}, {K_F2, K_F2S, K_F2, K_F2A, K_F2S}, {K_F3, K_F3S, K_F3, K_F3A, K_F3S}, @@ -285,20 +280,16 @@ unsigned char key_map[NUMKEYS][WIDTH_KMAP] = { {K_F8, K_F8S, K_F8, K_F8A, K_F8S}, {K_F9, K_F9S, K_F9, K_F9A, K_F9S}, {K_F10, K_F10S, K_F10, K_F10A, K_F10S}, -{K_SCAN,K_NLCKSC,NC, K_SCAN,K_NLCKSC,NC, K_SCAN,K_NLCKSC,NC, - K_SCAN,K_NLCKSC,NC, K_SCAN,K_NLCKSC,NC}, +{K_SCAN,K_NLCKSC,NC, K_SCAN,K_NLCKSC,NC, K_SCAN,K_NLCKSC,NC, K_SCAN,K_NLCKSC,NC, K_SCAN,K_NLCKSC,NC}, {K_SCRL, K_NUL,NC,NC, K_SCRL, K_SCRL, K_NUL,NC,NC}, {K_HOME, K_SEVEN,NC,NC, K_HOME, K_HOME, 0x1b,0x4e,K_SEVEN}, {K_UA, K_EIGHT,NC,NC, K_UA, K_UA, 0x1b,0x4e,K_EIGHT}, {K_PUP, K_NINE,NC,NC, K_PUP, K_PUP, 0x1b,0x4e,K_NINE}, -{0x1b,0x5b,0x53, K_MINUS,NC,NC, 0x1b,0x5b,0x53, 0x1b,0x5b,0x53, - 0x1b,0x4e,0x2d}, +{0x1b,0x5b,0x53, K_MINUS,NC,NC, 0x1b,0x5b,0x53, 0x1b,0x5b,0x53, 0x1b,0x4e,0x2d}, {K_LA, K_FOUR,NC,NC, K_LA, K_LA, 0x1b,0x4e,K_FOUR}, -{0x1b,0x5b,0x47, K_FIVE,NC,NC, 0x1b,0x5b,0x47, 0x1b,0x5b,0x47, - 0x1b,0x4e,0x35}, +{0x1b,0x5b,0x47, K_FIVE,NC,NC, 0x1b,0x5b,0x47, 0x1b,0x5b,0x47, 0x1b,0x4e,0x35}, {K_RA, K_SIX,NC,NC, K_RA, K_RA, 0x1b,0x4e,K_SIX}, -{0x1b,0x5b,0x54, K_PLUS,NC,NC, 0x1b,0x5b,0x54, 0x1b,0x5b,0x54, - 0x1b,0x4e,0x2b}, +{0x1b,0x5b,0x54, K_PLUS,NC,NC, 0x1b,0x5b,0x54, 0x1b,0x5b,0x54, 0x1b,0x4e,0x2b}, {K_END, K_ONE,NC,NC, K_END, K_END, 0x1b,0x4e,K_ONE}, {K_DA, K_TWO,NC,NC, K_DA, K_DA, 0x1b,0x4e,K_TWO}, {K_PDN, K_THREE,NC,NC, K_PDN, K_PDN, 0x1b,0x4e,K_THREE}, @@ -3038,6 +3029,39 @@ kdcnmaygetc(void) #ifdef notdef cnsetleds(state2leds(kd_state)); #endif + } else if (! up + && c == K_ESC + && key_map[scancode][char_idx+1] == 0x5b) { + /* As a convenience for the nice + people using our debugger, remap + some keys to the readline-like + shortcuts supported by dde. + + XXX This is a workaround for the + limited kernel getchar interface. + It is only used by the debugger. */ + c = key_map[scancode][char_idx+2]; + switch (c) { +#define _MAP(A,B,C) (C) +#define MAP(T) _MAP(T) +#define CTRL(c) ((c) & 0x1f) + case MAP(K_HOME): c = CTRL('a'); break; + case MAP(K_UA): c = CTRL('p'); break; + case MAP(K_LA): c = CTRL('b'); break; + case MAP(K_RA): c = CTRL('f'); break; + case MAP(K_DA): c = CTRL('n'); break; + case MAP(K_END): c = CTRL('e'); break; + /* delete */ + case 0x39: c = CTRL('d'); break; +#undef CTRL +#undef MAP +#undef _MAP + default: + /* Retain the old behavior. */ + c = K_ESC; + } + + return(c); } else if (!up) { /* regular key-down */ if (c == K_CR) diff --git a/kern/task.c b/kern/task.c index 66eb25c..20acc6a 100644 --- a/kern/task.c +++ b/kern/task.c @@ -70,6 +70,7 @@ void task_init(void) * for other initialization. (:-() */ (void) task_create(TASK_NULL, FALSE, &kernel_task); + (void) task_set_name(kernel_task, "gnumach"); } kern_return_t task_create( |