Changeset 827d73f in mainline for kernel/generic/include
- Timestamp:
- 2010-02-12T14:09:22Z (16 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- a70bda4
- Parents:
- 918e9910 (diff), e70edd1 (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. - Location:
- kernel/generic/include
- Files:
-
- 1 added
- 11 edited
-
context.h (modified) (4 diffs)
-
debug.h (modified) (2 diffs)
-
func.h (modified) (1 diff)
-
interrupt.h (modified) (1 diff)
-
ipc/event_types.h (modified) (1 diff)
-
macros.h (modified) (1 diff)
-
mm/as.h (modified) (3 diffs)
-
panic.h (modified) (1 diff)
-
stacktrace.h (added)
-
symtab.h (modified) (1 diff)
-
udebug/udebug.h (modified) (7 diffs)
-
udebug/udebug_ops.h (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
kernel/generic/include/context.h
r918e9910 r827d73f 27 27 */ 28 28 29 /** @addtogroup generic 29 /** @addtogroup generic 30 30 * @{ 31 31 */ … … 39 39 #include <arch/context.h> 40 40 41 #define context_set_generic(ctx, _pc, stack, size) \ 42 (ctx)->pc = (uintptr_t) (_pc); \ 43 (ctx)->sp = ((uintptr_t) (stack)) + (size) - SP_DELTA; 41 44 42 #ifndef context_set 43 #define context_set(c, _pc, stack, size) \ 44 (c)->pc = (uintptr_t) (_pc); \ 45 (c)->sp = ((uintptr_t) (stack)) + (size) - SP_DELTA; 46 #endif /* context_set */ 47 48 extern int context_save_arch(context_t *c) __attribute__ ((returns_twice)); 49 extern void context_restore_arch(context_t *c) __attribute__ ((noreturn)); 45 extern int context_save_arch(context_t *ctx) __attribute__((returns_twice)); 46 extern void context_restore_arch(context_t *ctx) __attribute__((noreturn)); 50 47 51 48 /** Save register context. … … 73 70 * saved like that would therefore lead to a disaster. 74 71 * 75 * @param c Context structure.72 * @param ctx Context structure. 76 73 * 77 * @return context_save() returns 1, context_restore() returns 0. 74 * @return context_save() returns 1, context_restore() returns 0. 75 * 78 76 */ 79 #define context_save(c ) context_save_arch(c)77 #define context_save(ctx) context_save_arch(ctx) 80 78 81 79 /** Restore register context. … … 88 86 * being return value. 89 87 * 90 * @param c Context structure.88 * @param ctx Context structure. 91 89 */ 92 static inline void context_restore(context_t *c )90 static inline void context_restore(context_t *ctx) 93 91 { 94 context_restore_arch(c );92 context_restore_arch(ctx); 95 93 } 96 94 -
kernel/generic/include/debug.h
r918e9910 r827d73f 75 75 # define LOG(format, ...) \ 76 76 printf("%s() at %s:%u: " format "\n", __func__, __FILE__, \ 77 __LINE__, ##__VA_ARGS__);77 __LINE__, ##__VA_ARGS__); 78 78 #else 79 79 # define LOG(format, ...) … … 92 92 { \ 93 93 printf("%s() at %s:%u: " #fnc "\n", __func__, __FILE__, \ 94 __LINE__); \94 __LINE__); \ 95 95 fnc; \ 96 96 } -
kernel/generic/include/func.h
r918e9910 r827d73f 41 41 extern atomic_t haltstate; 42 42 43 extern void halt(void) ;43 extern void halt(void) __attribute__((noreturn)); 44 44 extern unative_t atoi(const char *text); 45 45 extern void order(const uint64_t val, uint64_t *rv, char *suffix); -
kernel/generic/include/interrupt.h
r918e9910 r827d73f 42 42 #include <arch.h> 43 43 #include <ddi/irq.h> 44 #include <stacktrace.h> 44 45 45 46 typedef void (* iroutine)(int n, istate_t *istate); 46 47 47 #define fault_if_from_uspace(istate, fmt, ...) \ 48 { \ 49 if (istate_from_uspace(istate)) { \ 50 task_t *task = TASK; \ 51 printf("Task %s (%" PRIu64 ") killed due to an exception at %p: ", task->name, task->taskid, istate_get_pc(istate)); \ 52 printf(fmt "\n", ##__VA_ARGS__); \ 53 task_kill(task->taskid); \ 54 thread_exit(); \ 55 } \ 56 } 57 48 extern void fault_if_from_uspace(istate_t *istate, char *fmt, ...); 58 49 extern iroutine exc_register(int n, const char *name, iroutine f); 59 50 extern void exc_dispatch(int n, istate_t *t); 60 51 void exc_init(void); 52 53 extern void irq_initialize_arch(irq_t *irq); 61 54 62 55 #endif -
kernel/generic/include/ipc/event_types.h
r918e9910 r827d73f 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/macros.h
r918e9910 r827d73f 84 84 #define STRING_ARG(arg) #arg 85 85 86 #define LOWER32(arg) (( arg) & 0xffffffff)87 #define UPPER32(arg) ((( arg) >> 32) & 0xffffffff)86 #define LOWER32(arg) (((uint64_t) (arg)) & 0xffffffff) 87 #define UPPER32(arg) (((((uint64_t) arg)) >> 32) & 0xffffffff) 88 88 89 89 #define MERGE_LOUP32(lo, up) \ -
kernel/generic/include/mm/as.h
r918e9910 r827d73f 36 36 #define KERN_AS_H_ 37 37 38 #ifdef KERNEL 39 #include <arch/types.h> 40 #else 41 #include <sys/types.h> 42 #endif 43 38 44 /** Address space area flags. */ 39 45 #define AS_AREA_READ 1 … … 41 47 #define AS_AREA_EXEC 4 42 48 #define AS_AREA_CACHEABLE 8 49 50 /** Address space area info exported to userspace. */ 51 typedef struct { 52 /** Starting address */ 53 uintptr_t start_addr; 54 55 /** Area size */ 56 size_t size; 57 58 /** Area flags */ 59 int flags; 60 } as_area_info_t; 43 61 44 62 #ifdef KERNEL … … 268 286 269 287 /* Introspection functions. */ 288 extern void as_get_area_info(as_t *as, as_area_info_t **obuf, size_t *osize); 270 289 extern void as_print(as_t *as); 271 290 -
kernel/generic/include/panic.h
r918e9910 r827d73f 36 36 #define KERN_PANIC_H_ 37 37 38 #include <stacktrace.h> 39 #include <print.h> 40 38 41 #ifdef CONFIG_DEBUG 39 42 # define panic(format, ...) \ 40 panic_printf("Kernel panic in %s() at %s:%u: " format "\n", \ 41 __func__, __FILE__, __LINE__, ##__VA_ARGS__); 43 do { \ 44 printf("Kernel panic in %s() at %s:%u.\n", \ 45 __func__, __FILE__, __LINE__); \ 46 stack_trace(); \ 47 panic_printf("Panic message: " format "\n", \ 48 ##__VA_ARGS__);\ 49 } while (0) 42 50 #else 43 51 # define panic(format, ...) \ -
kernel/generic/include/symtab.h
r918e9910 r827d73f 45 45 }; 46 46 47 extern int symtab_name_lookup(u native_t addr, char **name);48 extern char *symtab_fmt_name_lookup(u native_t addr);49 extern int symtab_addr_lookup(const char * name, uintptr_t *addr);50 extern void symtab_print_search(const char * name);51 extern int symtab_compl(char * input, size_t size);47 extern int symtab_name_lookup(uintptr_t, char **, uintptr_t *); 48 extern char *symtab_fmt_name_lookup(uintptr_t); 49 extern int symtab_addr_lookup(const char *, uintptr_t *); 50 extern void symtab_print_search(const char *); 51 extern int symtab_compl(char *, size_t); 52 52 53 53 #ifdef CONFIG_SYMTAB -
kernel/generic/include/udebug/udebug.h
r918e9910 r827d73f 27 27 */ 28 28 29 /** @addtogroup generic 29 /** @addtogroup generic 30 30 * @{ 31 31 */ … … 83 83 UDEBUG_M_ARGS_READ, 84 84 85 /** Read thread's userspace register state (istate_t). 86 * 87 * - ARG2 - thread identification 88 * - ARG3 - destination address in the caller's address space 89 * 90 * or, on error, retval will be 91 * - ENOENT - thread does not exist 92 * - EBUSY - register state not available 93 */ 94 UDEBUG_M_REGS_READ, 95 85 96 /** Read the list of the debugged tasks's threads. 86 97 * … … 97 108 UDEBUG_M_THREAD_READ, 98 109 110 /** Read the name of the debugged task. 111 * 112 * - ARG2 - destination address in the caller's address space 113 * - ARG3 - size of receiving buffer in bytes 114 * 115 * The kernel fills the buffer with a non-terminated string. 116 * 117 * - ARG2 - number of bytes that were actually copied 118 * - ARG3 - number of bytes of the complete data 119 * 120 */ 121 UDEBUG_M_NAME_READ, 122 123 /** Read the list of the debugged task's address space areas. 124 * 125 * - ARG2 - destination address in the caller's address space 126 * - ARG3 - size of receiving buffer in bytes 127 * 128 * The kernel fills the buffer with a series of as_area_info_t structures. 129 * Upon answer, the kernel will set: 130 * 131 * - ARG2 - number of bytes that were actually copied 132 * - ARG3 - number of bytes of the complete data 133 * 134 */ 135 UDEBUG_M_AREAS_READ, 136 99 137 /** Read the debugged tasks's memory. 100 138 * … … 108 146 } udebug_method_t; 109 147 110 148 111 149 typedef enum { 112 150 UDEBUG_EVENT_FINISHED = 1, /**< Debuging session has finished */ … … 139 177 140 178 #include <synch/mutex.h> 179 #include <synch/condvar.h> 141 180 #include <arch/interrupt.h> 142 181 #include <atomic.h> … … 181 220 bool stoppable; /**< thread is stoppable */ 182 221 bool active; /**< thread is in a debugging session */ 222 condvar_t active_cv; 183 223 } udebug_thread_t; 184 224 … … 202 242 203 243 int udebug_task_cleanup(struct task *ta); 244 void udebug_thread_fault(void); 204 245 205 246 #endif -
kernel/generic/include/udebug/udebug_ops.h
r918e9910 r827d73f 45 45 int udebug_stop(thread_t *t, call_t *call); 46 46 47 int udebug_thread_read(void **buffer, size_t buf_size, size_t *n); 47 int udebug_thread_read(void **buffer, size_t buf_size, size_t *stored, 48 size_t *needed); 49 int udebug_name_read(char **data, size_t *data_size); 48 50 int udebug_args_read(thread_t *t, void **buffer); 51 52 int udebug_regs_read(thread_t *t, void **buffer); 49 53 50 54 int udebug_mem_read(unative_t uspace_addr, size_t n, void **buffer);
Note:
See TracChangeset
for help on using the changeset viewer.
