Changeset 371bd7d in mainline for kernel/generic/include
- Timestamp:
- 2010-03-27T09:22:17Z (16 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 36a75a2
- Parents:
- cd82bb1 (diff), eaf22d4 (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
- 65 edited
- 1 moved
-
adt/avl.h (modified) (1 diff)
-
adt/bitmap.h (modified) (1 diff)
-
adt/btree.h (modified) (1 diff)
-
adt/hash_table.h (modified) (1 diff)
-
adt/list.h (modified) (1 diff)
-
arch.h (modified) (1 diff)
-
atomic.h (modified) (2 diffs)
-
bitops.h (modified) (1 diff)
-
byteorder.h (modified) (1 diff)
-
config.h (modified) (1 diff)
-
console/chardev.h (modified) (4 diffs)
-
console/console.h (modified) (1 diff)
-
console/kconsole.h (modified) (1 diff)
-
context.h (modified) (4 diffs)
-
cpu.h (modified) (1 diff)
-
ddi/ddi.h (modified) (1 diff)
-
ddi/device.h (modified) (1 diff)
-
ddi/irq.h (modified) (1 diff)
-
debug.h (modified) (2 diffs)
-
func.h (modified) (2 diffs)
-
interrupt.h (modified) (1 diff)
-
ipc/event.h (modified) (1 diff)
-
ipc/event_types.h (modified) (1 diff)
-
ipc/ipc.h (modified) (1 diff)
-
ipc/irq.h (modified) (1 diff)
-
ipc/sysipc.h (modified) (1 diff)
-
lib/elf.h (modified) (2 diffs)
-
lib/rd.h (modified) (1 diff)
-
macros.h (modified) (2 diffs)
-
main/main.h (modified) (1 diff)
-
main/uinit.h (modified) (1 diff)
-
memstr.h (modified) (2 diffs)
-
mm/as.h (modified) (4 diffs)
-
mm/buddy.h (modified) (1 diff)
-
mm/frame.h (modified) (1 diff)
-
mm/page.h (modified) (1 diff)
-
mm/slab.h (modified) (2 diffs)
-
mm/tlb.h (modified) (1 diff)
-
panic.h (modified) (2 diffs)
-
print.h (modified) (1 diff)
-
proc/program.h (modified) (2 diffs)
-
proc/scheduler.h (modified) (2 diffs)
-
proc/task.h (modified) (2 diffs)
-
proc/thread.h (modified) (3 diffs)
-
security/cap.h (modified) (1 diff)
-
smp/ipi.h (modified) (2 diffs)
-
sort.h (modified) (2 diffs)
-
stacktrace.h (added)
-
str.h (moved) (moved from kernel/generic/include/string.h ) (1 diff)
-
symtab.h (modified) (2 diffs)
-
synch/condvar.h (modified) (1 diff)
-
synch/futex.h (modified) (2 diffs)
-
synch/mutex.h (modified) (1 diff)
-
synch/rwlock.h (modified) (1 diff)
-
synch/semaphore.h (modified) (1 diff)
-
synch/spinlock.h (modified) (3 diffs)
-
synch/waitq.h (modified) (1 diff)
-
syscall/copy.h (modified) (1 diff)
-
syscall/syscall.h (modified) (2 diffs)
-
sysinfo/sysinfo.h (modified) (1 diff)
-
time/clock.h (modified) (1 diff)
-
time/delay.h (modified) (1 diff)
-
time/timeout.h (modified) (1 diff)
-
typedefs.h (modified) (1 diff)
-
udebug/udebug.h (modified) (7 diffs)
-
udebug/udebug_ops.h (modified) (1 diff)
-
userspace.h (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
kernel/generic/include/adt/avl.h
rcd82bb1 r371bd7d 36 36 #define KERN_AVLTREE_H_ 37 37 38 #include <arch/types.h>39 38 #include <typedefs.h> 40 39 -
kernel/generic/include/adt/bitmap.h
rcd82bb1 r371bd7d 36 36 #define KERN_BITMAP_H_ 37 37 38 #include < arch/types.h>38 #include <typedefs.h> 39 39 40 40 #define BITS2BYTES(bits) (bits ? ((((bits)-1)>>3)+1) : 0) -
kernel/generic/include/adt/btree.h
rcd82bb1 r371bd7d 36 36 #define KERN_BTREE_H_ 37 37 38 #include < arch/types.h>38 #include <typedefs.h> 39 39 #include <adt/list.h> 40 40 -
kernel/generic/include/adt/hash_table.h
rcd82bb1 r371bd7d 37 37 38 38 #include <adt/list.h> 39 #include < arch/types.h>39 #include <typedefs.h> 40 40 41 41 /** Set of operations for hash table. */ -
kernel/generic/include/adt/list.h
rcd82bb1 r371bd7d 36 36 #define KERN_LIST_H_ 37 37 38 #include <arch/types.h>39 38 #include <typedefs.h> 40 39 -
kernel/generic/include/arch.h
rcd82bb1 r371bd7d 39 39 #include <proc/thread.h> 40 40 #include <proc/task.h> 41 #include <mm/as.h> 41 42 42 43 #define DEFAULT_CONTEXT 0 -
kernel/generic/include/atomic.h
rcd82bb1 r371bd7d 27 27 */ 28 28 29 /** @addtogroup generic 29 /** @addtogroup generic 30 30 * @{ 31 31 */ … … 36 36 #define KERN_ATOMIC_H_ 37 37 38 typedef struct atomic { 39 volatile long count; 40 } atomic_t; 41 38 #include <typedefs.h> 42 39 #include <arch/atomic.h> 43 40 44 static inline void atomic_set(atomic_t *val, longi)41 static inline void atomic_set(atomic_t *val, atomic_count_t i) 45 42 { 46 43 val->count = i; 47 44 } 48 45 49 static inline longatomic_get(atomic_t *val)46 static inline atomic_count_t atomic_get(atomic_t *val) 50 47 { 51 48 return val->count; -
kernel/generic/include/bitops.h
rcd82bb1 r371bd7d 65 65 } 66 66 67 if (arg >> 1) { 68 arg >>= 1; 67 if (arg >> 1) 69 68 n += 1; 70 }71 69 72 70 return n; -
kernel/generic/include/byteorder.h
rcd82bb1 r371bd7d 36 36 #define KERN_BYTEORDER_H_ 37 37 38 #include < arch/types.h>38 #include <typedefs.h> 39 39 40 40 #if !(defined(__BE__) ^ defined(__LE__)) -
kernel/generic/include/config.h
rcd82bb1 r371bd7d 36 36 #define KERN_CONFIG_H_ 37 37 38 #include < arch/types.h>38 #include <typedefs.h> 39 39 #include <arch/mm/page.h> 40 40 -
kernel/generic/include/console/chardev.h
rcd82bb1 r371bd7d 37 37 38 38 #include <adt/list.h> 39 #include < arch/types.h>39 #include <typedefs.h> 40 40 #include <synch/waitq.h> 41 41 #include <synch/spinlock.h> … … 53 53 /** Character input device. */ 54 54 typedef struct indev { 55 c har *name;55 const char *name; 56 56 waitq_t wq; 57 57 … … 81 81 /** Character output device. */ 82 82 typedef struct outdev { 83 c har *name;83 const char *name; 84 84 85 85 /** Protects everything below. */ … … 95 95 } outdev_t; 96 96 97 extern void indev_initialize(c har *name, indev_t *indev,97 extern void indev_initialize(const char *name, indev_t *indev, 98 98 indev_operations_t *op); 99 99 extern void indev_push_character(indev_t *indev, wchar_t ch); 100 100 extern wchar_t indev_pop_character(indev_t *indev); 101 101 102 extern void outdev_initialize(c har *name, outdev_t *outdev,102 extern void outdev_initialize(const char *name, outdev_t *outdev, 103 103 outdev_operations_t *op); 104 104 -
kernel/generic/include/console/console.h
rcd82bb1 r371bd7d 36 36 #define KERN_CONSOLE_H_ 37 37 38 #include < arch/types.h>38 #include <typedefs.h> 39 39 #include <console/chardev.h> 40 40 41 41 extern indev_t *stdin; 42 42 extern outdev_t *stdout; 43 extern bool silent;44 43 45 44 extern indev_t *stdin_wire(void); -
kernel/generic/include/console/kconsole.h
rcd82bb1 r371bd7d 94 94 extern void kconsole_notify_init(void); 95 95 extern bool kconsole_check_poll(void); 96 extern void kconsole(c har *prompt,char *msg, bool kcon);96 extern void kconsole(const char *prompt, const char *msg, bool kcon); 97 97 extern void kconsole_thread(void *data); 98 98 -
kernel/generic/include/context.h
rcd82bb1 r371bd7d 27 27 */ 28 28 29 /** @addtogroup generic 29 /** @addtogroup generic 30 30 * @{ 31 31 */ … … 36 36 #define KERN_CONTEXT_H_ 37 37 38 #include < arch/types.h>38 #include <typedefs.h> 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/cpu.h
rcd82bb1 r371bd7d 48 48 * There is one structure like this for every processor. 49 49 */ 50 typedef struct {50 typedef struct cpu { 51 51 SPINLOCK_DECLARE(lock); 52 52 -
kernel/generic/include/ddi/ddi.h
rcd82bb1 r371bd7d 37 37 38 38 #include <ddi/ddi_arg.h> 39 #include < arch/types.h>39 #include <typedefs.h> 40 40 #include <proc/task.h> 41 41 #include <adt/list.h> -
kernel/generic/include/ddi/device.h
rcd82bb1 r371bd7d 36 36 #define KERN_DEVICE_H_ 37 37 38 #include <arch/types.h>39 38 #include <typedefs.h> 40 39 -
kernel/generic/include/ddi/irq.h
rcd82bb1 r371bd7d 81 81 #ifdef KERNEL 82 82 83 #include < arch/types.h>83 #include <typedefs.h> 84 84 #include <adt/list.h> 85 85 #include <adt/hash_table.h> -
kernel/generic/include/debug.h
rcd82bb1 r371bd7d 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
rcd82bb1 r371bd7d 27 27 */ 28 28 29 /** @addtogroup generic 29 /** @addtogroup generic 30 30 * @{ 31 31 */ … … 36 36 #define KERN_FUNC_H_ 37 37 38 #include < arch/types.h>38 #include <typedefs.h> 39 39 #include <atomic.h> 40 40 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
rcd82bb1 r371bd7d 37 37 38 38 #include <arch/interrupt.h> 39 #include < arch/types.h>39 #include <typedefs.h> 40 40 #include <proc/task.h> 41 41 #include <proc/thread.h> 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, const 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.h
rcd82bb1 r371bd7d 37 37 38 38 #include <ipc/event_types.h> 39 #include < arch/types.h>39 #include <typedefs.h> 40 40 #include <synch/spinlock.h> 41 41 #include <ipc/ipc.h> -
kernel/generic/include/ipc/event_types.h
rcd82bb1 r371bd7d 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/ipc/ipc.h
rcd82bb1 r371bd7d 227 227 #ifdef KERNEL 228 228 229 #define IPC_MAX_PHONES 16229 #define IPC_MAX_PHONES 32 230 230 231 231 #include <synch/spinlock.h> -
kernel/generic/include/ipc/irq.h
rcd82bb1 r371bd7d 41 41 #include <ipc/ipc.h> 42 42 #include <ddi/irq.h> 43 #include < arch/types.h>43 #include <typedefs.h> 44 44 #include <adt/list.h> 45 45 -
kernel/generic/include/ipc/sysipc.h
rcd82bb1 r371bd7d 38 38 #include <ipc/ipc.h> 39 39 #include <ipc/irq.h> 40 #include < arch/types.h>40 #include <typedefs.h> 41 41 42 42 unative_t sys_ipc_call_sync_fast(unative_t phoneid, unative_t method, -
kernel/generic/include/lib/elf.h
rcd82bb1 r371bd7d 37 37 38 38 #include <arch/elf.h> 39 #include < arch/types.h>39 #include <typedefs.h> 40 40 41 41 /** 42 42 * current ELF version 43 43 */ 44 #define EV_CURRENT 145 46 /** 47 * ELF types 44 #define EV_CURRENT 1 45 46 /** 47 * ELF types 48 48 */ 49 49 #define ET_NONE 0 /* No type */ … … 338 338 #endif 339 339 340 extern c har *elf_error(unsigned int rc);340 extern const char *elf_error(unsigned int rc); 341 341 342 342 /* Interpreter string used to recognize the program loader */ -
kernel/generic/include/lib/rd.h
rcd82bb1 r371bd7d 36 36 #define KERN_RD_H_ 37 37 38 #include < arch/types.h>38 #include <typedefs.h> 39 39 40 40 /** 41 41 * RAM disk version 42 42 */ 43 #define RD_VERSION 143 #define RD_VERSION 1 44 44 45 45 /** -
kernel/generic/include/macros.h
rcd82bb1 r371bd7d 38 38 #ifndef __ASM__ 39 39 40 #include < arch/types.h>40 #include <typedefs.h> 41 41 42 42 /** Return true if the intervals overlap. … … 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/main/main.h
rcd82bb1 r371bd7d 36 36 #define KERN_MAIN_H_ 37 37 38 #include < arch/types.h>38 #include <typedefs.h> 39 39 40 40 extern size_t hardcoded_kdata_size; -
kernel/generic/include/main/uinit.h
rcd82bb1 r371bd7d 36 36 #define KERN_UINIT_H_ 37 37 38 #include <arch/types.h>39 40 38 extern void uinit(void *arg); 41 39 -
kernel/generic/include/memstr.h
rcd82bb1 r371bd7d 27 27 */ 28 28 29 /** @addtogroup generic 29 /** @addtogroup generic 30 30 * @{ 31 31 */ … … 36 36 #define KERN_MEMSTR_H_ 37 37 38 #include < arch/types.h>38 #include <typedefs.h> 39 39 #include <arch/memstr.h> 40 40 -
kernel/generic/include/mm/as.h
rcd82bb1 r371bd7d 36 36 #define KERN_AS_H_ 37 37 38 #ifdef KERNEL 39 #include <typedefs.h> 40 #else 41 #include <sys/types.h> 42 #endif 43 38 44 /** Address space area flags. */ 39 45 #define AS_AREA_READ 1 … … 42 48 #define AS_AREA_CACHEABLE 8 43 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; 61 44 62 #ifdef KERNEL 45 63 … … 47 65 #include <arch/mm/as.h> 48 66 #include <arch/mm/asid.h> 49 #include < arch/types.h>67 #include <typedefs.h> 50 68 #include <synch/spinlock.h> 51 69 #include <synch/mutex.h> … … 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/mm/buddy.h
rcd82bb1 r371bd7d 36 36 #define KERN_BUDDY_H_ 37 37 38 #include < arch/types.h>38 #include <typedefs.h> 39 39 #include <adt/list.h> 40 40 -
kernel/generic/include/mm/frame.h
rcd82bb1 r371bd7d 37 37 #define KERN_FRAME_H_ 38 38 39 #include < arch/types.h>39 #include <typedefs.h> 40 40 #include <adt/list.h> 41 41 #include <mm/buddy.h> -
kernel/generic/include/mm/page.h
rcd82bb1 r371bd7d 36 36 #define KERN_PAGE_H_ 37 37 38 #include < arch/types.h>38 #include <typedefs.h> 39 39 #include <mm/as.h> 40 40 #include <memstr.h> -
kernel/generic/include/mm/slab.h
rcd82bb1 r371bd7d 86 86 87 87 typedef struct { 88 c har *name;88 const char *name; 89 89 90 90 link_t link; … … 123 123 } slab_cache_t; 124 124 125 extern slab_cache_t *slab_cache_create(c har *, size_t, size_t,125 extern slab_cache_t *slab_cache_create(const char *, size_t, size_t, 126 126 int (*)(void *, int), int (*)(void *), int); 127 127 extern void slab_cache_destroy(slab_cache_t *); -
kernel/generic/include/mm/tlb.h
rcd82bb1 r371bd7d 37 37 38 38 #include <arch/mm/asid.h> 39 #include < arch/types.h>39 #include <typedefs.h> 40 40 41 41 /** -
kernel/generic/include/panic.h
rcd82bb1 r371bd7d 27 27 */ 28 28 29 /** @addtogroup generic 29 /** @addtogroup generic 30 30 * @{ 31 31 */ … … 36 36 #define KERN_PANIC_H_ 37 37 38 #include <typedefs.h> 39 #include <stacktrace.h> 40 #include <print.h> 41 38 42 #ifdef CONFIG_DEBUG 39 43 # define panic(format, ...) \ 40 panic_printf("Kernel panic in %s() at %s:%u: " format "\n", \ 41 __func__, __FILE__, __LINE__, ##__VA_ARGS__); 44 do { \ 45 silent = false; \ 46 printf("Kernel panic in %s() at %s:%u.\n", \ 47 __func__, __FILE__, __LINE__); \ 48 stack_trace(); \ 49 panic_printf("Panic message: " format "\n", \ 50 ##__VA_ARGS__);\ 51 } while (0) 42 52 #else 43 53 # define panic(format, ...) \ 44 panic_printf("Kernel panic: " format "\n", ##__VA_ARGS__); 54 do { \ 55 silent = false; \ 56 panic_printf("Kernel panic: " format "\n", ##__VA_ARGS__); \ 57 } while (0) 45 58 #endif 46 59 47 extern void panic_printf(char *fmt, ...) __attribute__((noreturn)); 60 extern bool silent; 61 62 extern void panic_printf(const char *fmt, ...) __attribute__((noreturn)); 48 63 49 64 #endif -
kernel/generic/include/print.h
rcd82bb1 r371bd7d 36 36 #define KERN_PRINT_H_ 37 37 38 #include < arch/types.h>38 #include <typedefs.h> 39 39 #include <stdarg.h> 40 40 -
kernel/generic/include/proc/program.h
rcd82bb1 r371bd7d 36 36 #define KERN_PROGRAM_H_ 37 37 38 #include < arch/types.h>38 #include <typedefs.h> 39 39 40 40 struct task; … … 45 45 * A program is an abstraction of a freshly created (not yet running) 46 46 * userspace task containing a main thread along with its userspace stack. 47 * 47 48 */ 48 49 typedef struct program { 49 struct task *task; /**< Program task */50 struct thread *main_thread; /**< Program main thread */50 struct task *task; /**< Program task */ 51 struct thread *main_thread; /**< Program main thread */ 51 52 } program_t; 52 53 53 54 extern void *program_loader; 54 55 55 extern void program_create(as_t *as, uintptr_t entry_addr, char *name, 56 program_t *p); 57 extern int program_create_from_image(void *image_addr, char *name, 58 program_t *p); 59 extern int program_create_loader(program_t *p, char *name); 60 extern void program_ready(program_t *p); 56 extern int program_create(as_t *, uintptr_t, char *, program_t *); 57 extern int program_create_from_image(void *, char *, program_t *); 58 extern int program_create_loader(program_t *, char *); 59 extern void program_ready(program_t *); 61 60 62 extern unative_t sys_program_spawn_loader(char * uspace_name, size_t name_len);61 extern unative_t sys_program_spawn_loader(char *, size_t); 63 62 64 63 #endif -
kernel/generic/include/proc/scheduler.h
rcd82bb1 r371bd7d 37 37 38 38 #include <synch/spinlock.h> 39 #include <time/clock.h> /* HZ */ 39 #include <time/clock.h> 40 #include <typedefs.h> 40 41 #include <atomic.h> 41 42 #include <adt/list.h> 42 43 43 #define RQ_COUNT 1644 #define NEEDS_RELINK_MAX (HZ)44 #define RQ_COUNT 16 45 #define NEEDS_RELINK_MAX (HZ) 45 46 46 47 /** Scheduler run queue structure. */ 47 48 typedef struct { 48 49 SPINLOCK_DECLARE(lock); 49 link_t rq_head; /**< List of ready threads. */50 size_t n; /**< Number of threads in rq_ready. */50 link_t rq_head; /**< List of ready threads. */ 51 size_t n; /**< Number of threads in rq_ready. */ 51 52 } runq_t; 52 53 … … 61 62 62 63 /* 63 * To be defined by architectures :64 * To be defined by architectures. 64 65 */ 65 66 extern void before_task_runs_arch(void); -
kernel/generic/include/proc/task.h
rcd82bb1 r371bd7d 55 55 #include <udebug/udebug.h> 56 56 #include <ipc/kbox.h> 57 #include <mm/as.h> 57 58 58 59 #define TASK_NAME_BUFLEN 20 … … 129 130 extern void task_init(void); 130 131 extern void task_done(void); 131 extern task_t *task_create(as_t *as, c har *name);132 extern task_t *task_create(as_t *as, const char *name); 132 133 extern void task_destroy(task_t *t); 133 134 extern task_t *task_find_by_id(task_id_t id); -
kernel/generic/include/proc/thread.h
rcd82bb1 r371bd7d 52 52 #define THREAD_NAME_BUFLEN 20 53 53 54 extern c har *thread_states[];54 extern const char *thread_states[]; 55 55 56 56 /* Thread flags */ … … 225 225 226 226 extern void thread_init(void); 227 extern thread_t *thread_create(void (* func)(void *), void *arg, task_t *task,228 int flags, char *name, bool uncounted);229 extern void thread_attach(thread_t * t, task_t *task);230 extern void thread_ready(thread_t * t);227 extern thread_t *thread_create(void (*)(void *), void *, task_t *, int, 228 const char *, bool); 229 extern void thread_attach(thread_t *, task_t *); 230 extern void thread_ready(thread_t *); 231 231 extern void thread_exit(void) __attribute__((noreturn)); 232 232 233 233 #ifndef thread_create_arch 234 extern void thread_create_arch(thread_t * t);234 extern void thread_create_arch(thread_t *); 235 235 #endif 236 236 #ifndef thr_constructor_arch 237 extern void thr_constructor_arch(thread_t * t);237 extern void thr_constructor_arch(thread_t *); 238 238 #endif 239 239 #ifndef thr_destructor_arch 240 extern void thr_destructor_arch(thread_t * t);241 #endif 242 243 extern void thread_sleep(uint32_t sec);244 extern void thread_usleep(uint32_t usec);240 extern void thr_destructor_arch(thread_t *); 241 #endif 242 243 extern void thread_sleep(uint32_t); 244 extern void thread_usleep(uint32_t); 245 245 246 246 #define thread_join(t) \ 247 247 thread_join_timeout((t), SYNCH_NO_TIMEOUT, SYNCH_FLAGS_NONE) 248 extern int thread_join_timeout(thread_t *t, uint32_t usec, int flags); 249 extern void thread_detach(thread_t *t); 250 251 extern void thread_register_call_me(void (* call_me)(void *), 252 void *call_me_with); 248 extern int thread_join_timeout(thread_t *, uint32_t, int); 249 extern void thread_detach(thread_t *); 250 251 extern void thread_register_call_me(void (*)(void *), void *); 253 252 extern void thread_print_list(void); 254 extern void thread_destroy(thread_t * t);253 extern void thread_destroy(thread_t *); 255 254 extern void thread_update_accounting(void); 256 extern bool thread_exists(thread_t * t);255 extern bool thread_exists(thread_t *); 257 256 258 257 /** Fpu context slab cache. */ … … 260 259 261 260 /* Thread syscall prototypes. */ 262 extern unative_t sys_thread_create(uspace_arg_t *uspace_uarg, 263 char *uspace_name, size_t name_len, thread_id_t *uspace_thread_id); 264 extern unative_t sys_thread_exit(int uspace_status); 265 extern unative_t sys_thread_get_id(thread_id_t *uspace_thread_id); 261 extern unative_t sys_thread_create(uspace_arg_t *, char *, size_t, 262 thread_id_t *); 263 extern unative_t sys_thread_exit(int); 264 extern unative_t sys_thread_get_id(thread_id_t *); 265 extern unative_t sys_thread_usleep(uint32_t); 266 266 267 267 #endif -
kernel/generic/include/security/cap.h
rcd82bb1 r371bd7d 49 49 50 50 #include <syscall/sysarg64.h> 51 #include < arch/types.h>51 #include <typedefs.h> 52 52 53 53 /** -
kernel/generic/include/smp/ipi.h
rcd82bb1 r371bd7d 27 27 */ 28 28 29 /** @addtogroup generic 29 /** @addtogroup generic 30 30 * @{ 31 31 */ … … 37 37 38 38 #ifdef CONFIG_SMP 39 extern void ipi_broadcast(int ipi); 40 extern void ipi_broadcast_arch(int ipi); 39 40 extern void ipi_broadcast(int); 41 extern void ipi_broadcast_arch(int); 42 41 43 #else 42 #define ipi_broadcast(x) ; 44 45 #define ipi_broadcast(ipi) 46 43 47 #endif /* CONFIG_SMP */ 44 48 -
kernel/generic/include/sort.h
rcd82bb1 r371bd7d 27 27 */ 28 28 29 /** @addtogroup generic 29 /** @addtogroup generic 30 30 * @{ 31 31 */ … … 36 36 #define KERN_SORT_H_ 37 37 38 #include < arch/types.h>38 #include <typedefs.h> 39 39 40 40 /* -
kernel/generic/include/str.h
rcd82bb1 r371bd7d 33 33 */ 34 34 35 #ifndef KERN_STR ING_H_36 #define KERN_STR ING_H_35 #ifndef KERN_STR_H_ 36 #define KERN_STR_H_ 37 37 38 38 #include <typedefs.h> -
kernel/generic/include/symtab.h
rcd82bb1 r371bd7d 36 36 #define KERN_SYMTAB_H_ 37 37 38 #include < arch/types.h>38 #include <typedefs.h> 39 39 40 40 #define MAX_SYMBOL_NAME 64 … … 45 45 }; 46 46 47 extern int symtab_name_lookup(u native_t addr, char **name);48 extern c har *symtab_fmt_name_lookup(unative_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, const char **, uintptr_t *); 48 extern const 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/synch/condvar.h
rcd82bb1 r371bd7d 36 36 #define KERN_CONDVAR_H_ 37 37 38 #include < arch/types.h>38 #include <typedefs.h> 39 39 #include <synch/waitq.h> 40 40 #include <synch/mutex.h> -
kernel/generic/include/synch/futex.h
rcd82bb1 r371bd7d 36 36 #define KERN_FUTEX_H_ 37 37 38 #include < arch/types.h>38 #include <typedefs.h> 39 39 #include <synch/waitq.h> 40 #include <genarch/mm/page_ht.h>41 #include <genarch/mm/page_pt.h>42 40 43 41 /** Kernel-side futex structure. */ … … 54 52 55 53 extern void futex_init(void); 56 extern unative_t sys_futex_sleep_timeout(uintptr_t uaddr, uint32_t usec, 57 int flags); 58 extern unative_t sys_futex_wakeup(uintptr_t uaddr); 54 extern unative_t sys_futex_sleep(uintptr_t); 55 extern unative_t sys_futex_wakeup(uintptr_t); 59 56 60 57 extern void futex_cleanup(void); -
kernel/generic/include/synch/mutex.h
rcd82bb1 r371bd7d 36 36 #define KERN_MUTEX_H_ 37 37 38 #include < arch/types.h>38 #include <typedefs.h> 39 39 #include <synch/semaphore.h> 40 40 #include <synch/synch.h> -
kernel/generic/include/synch/rwlock.h
rcd82bb1 r371bd7d 36 36 #define KERN_RWLOCK_H_ 37 37 38 #include < arch/types.h>38 #include <typedefs.h> 39 39 #include <synch/mutex.h> 40 40 #include <synch/synch.h> -
kernel/generic/include/synch/semaphore.h
rcd82bb1 r371bd7d 36 36 #define KERN_SEMAPHORE_H_ 37 37 38 #include < arch/types.h>38 #include <typedefs.h> 39 39 #include <synch/waitq.h> 40 40 #include <synch/synch.h> -
kernel/generic/include/synch/spinlock.h
rcd82bb1 r371bd7d 36 36 #define KERN_SPINLOCK_H_ 37 37 38 #include < arch/types.h>38 #include <typedefs.h> 39 39 #include <arch/barrier.h> 40 40 #include <preemption.h> … … 48 48 49 49 #ifdef CONFIG_DEBUG_SPINLOCK 50 c har *name;50 const char *name; 51 51 #endif 52 52 } spinlock_t; … … 101 101 SPINLOCK_STATIC_INITIALIZE_NAME(lock_name, #lock_name) 102 102 103 extern void spinlock_initialize(spinlock_t *lock, c har *name);103 extern void spinlock_initialize(spinlock_t *lock, const char *name); 104 104 extern int spinlock_trylock(spinlock_t *lock); 105 105 extern void spinlock_lock_debug(spinlock_t *lock); -
kernel/generic/include/synch/waitq.h
rcd82bb1 r371bd7d 36 36 #define KERN_WAITQ_H_ 37 37 38 #include < arch/types.h>38 #include <typedefs.h> 39 39 #include <synch/spinlock.h> 40 40 #include <synch/synch.h> -
kernel/generic/include/syscall/copy.h
rcd82bb1 r371bd7d 36 36 #define KERN_COPY_H_ 37 37 38 #include < arch/types.h>38 #include <typedefs.h> 39 39 40 40 /** Label within memcpy_from_uspace() that contains return -1. */ -
kernel/generic/include/syscall/syscall.h
rcd82bb1 r371bd7d 43 43 SYS_THREAD_EXIT, 44 44 SYS_THREAD_GET_ID, 45 SYS_THREAD_USLEEP, 45 46 46 47 SYS_TASK_GET_ID, … … 92 93 #ifdef KERNEL 93 94 94 #include < arch/types.h>95 #include <typedefs.h> 95 96 96 97 typedef unative_t (*syshandler_t)(unative_t, unative_t, unative_t, unative_t, -
kernel/generic/include/sysinfo/sysinfo.h
rcd82bb1 r371bd7d 36 36 #define KERN_SYSINFO_H_ 37 37 38 #include < arch/types.h>39 #include <str ing.h>38 #include <typedefs.h> 39 #include <str.h> 40 40 41 41 extern bool fb_exported; -
kernel/generic/include/time/clock.h
rcd82bb1 r371bd7d 36 36 #define KERN_CLOCK_H_ 37 37 38 #include < arch/types.h>38 #include <typedefs.h> 39 39 40 40 #define HZ 100 -
kernel/generic/include/time/delay.h
rcd82bb1 r371bd7d 36 36 #define KERN_DELAY_H_ 37 37 38 #include < arch/types.h>38 #include <typedefs.h> 39 39 40 40 extern void delay(uint32_t microseconds); -
kernel/generic/include/time/timeout.h
rcd82bb1 r371bd7d 36 36 #define KERN_TIMEOUT_H_ 37 37 38 #include < arch/types.h>38 #include <typedefs.h> 39 39 #include <adt/list.h> 40 40 #include <cpu.h> -
kernel/generic/include/typedefs.h
rcd82bb1 r371bd7d 36 36 #define KERN_TYPEDEFS_H_ 37 37 38 #include <arch/common.h> 38 39 #include <arch/types.h> 39 40 40 #define NULL 0 41 #define false 0 42 #define true 1 41 #define NULL 0 42 43 #define false 0 44 #define true 1 45 46 typedef struct { 47 uint64_t lo; 48 int64_t hi; 49 } int128_t; 50 51 typedef struct { 52 uint64_t lo; 53 uint64_t hi; 54 } uint128_t; 55 56 typedef struct { 57 volatile atomic_count_t count; 58 } atomic_t; 43 59 44 60 typedef void (* function)(); -
kernel/generic/include/udebug/udebug.h
rcd82bb1 r371bd7d 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
rcd82bb1 r371bd7d 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); -
kernel/generic/include/userspace.h
rcd82bb1 r371bd7d 27 27 */ 28 28 29 /** @addtogroup generic 29 /** @addtogroup generic 30 30 * @{ 31 31 */ … … 37 37 38 38 #include <proc/thread.h> 39 #include < arch/types.h>39 #include <typedefs.h> 40 40 41 41 /** Switch to user-space (CPU user priviledge level) */
Note:
See TracChangeset
for help on using the changeset viewer.
