Changeset 371bd7d in mainline for kernel/generic/include


Ignore:
Timestamp:
2010-03-27T09:22:17Z (16 years ago)
Author:
Jiri Svoboda <jiri@…>
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.
Message:

Merge mainline changes.

Location:
kernel/generic/include
Files:
1 added
65 edited
1 moved

Legend:

Unmodified
Added
Removed
  • kernel/generic/include/adt/avl.h

    rcd82bb1 r371bd7d  
    3636#define KERN_AVLTREE_H_
    3737
    38 #include <arch/types.h>
    3938#include <typedefs.h>
    4039
  • kernel/generic/include/adt/bitmap.h

    rcd82bb1 r371bd7d  
    3636#define KERN_BITMAP_H_
    3737
    38 #include <arch/types.h>
     38#include <typedefs.h>
    3939
    4040#define BITS2BYTES(bits)        (bits ? ((((bits)-1)>>3)+1) : 0)
  • kernel/generic/include/adt/btree.h

    rcd82bb1 r371bd7d  
    3636#define KERN_BTREE_H_
    3737
    38 #include <arch/types.h>
     38#include <typedefs.h>
    3939#include <adt/list.h>
    4040
  • kernel/generic/include/adt/hash_table.h

    rcd82bb1 r371bd7d  
    3737
    3838#include <adt/list.h>
    39 #include <arch/types.h>
     39#include <typedefs.h>
    4040
    4141/** Set of operations for hash table. */
  • kernel/generic/include/adt/list.h

    rcd82bb1 r371bd7d  
    3636#define KERN_LIST_H_
    3737
    38 #include <arch/types.h>
    3938#include <typedefs.h>
    4039
  • kernel/generic/include/arch.h

    rcd82bb1 r371bd7d  
    3939#include <proc/thread.h>
    4040#include <proc/task.h>
     41#include <mm/as.h>
    4142
    4243#define DEFAULT_CONTEXT         0
  • kernel/generic/include/atomic.h

    rcd82bb1 r371bd7d  
    2727 */
    2828
    29 /** @addtogroup generic 
     29/** @addtogroup generic
    3030 * @{
    3131 */
     
    3636#define KERN_ATOMIC_H_
    3737
    38 typedef struct atomic {
    39         volatile long count;
    40 } atomic_t;
    41 
     38#include <typedefs.h>
    4239#include <arch/atomic.h>
    4340
    44 static inline void atomic_set(atomic_t *val, long i)
     41static inline void atomic_set(atomic_t *val, atomic_count_t i)
    4542{
    4643        val->count = i;
    4744}
    4845
    49 static inline long atomic_get(atomic_t *val)
     46static inline atomic_count_t atomic_get(atomic_t *val)
    5047{
    5148        return val->count;
  • kernel/generic/include/bitops.h

    rcd82bb1 r371bd7d  
    6565        }
    6666       
    67         if (arg >> 1) {
    68                 arg >>= 1;
     67        if (arg >> 1)
    6968                n += 1;
    70         }
    7169       
    7270        return n;
  • kernel/generic/include/byteorder.h

    rcd82bb1 r371bd7d  
    3636#define KERN_BYTEORDER_H_
    3737
    38 #include <arch/types.h>
     38#include <typedefs.h>
    3939
    4040#if !(defined(__BE__) ^ defined(__LE__))
  • kernel/generic/include/config.h

    rcd82bb1 r371bd7d  
    3636#define KERN_CONFIG_H_
    3737
    38 #include <arch/types.h>
     38#include <typedefs.h>
    3939#include <arch/mm/page.h>
    4040
  • kernel/generic/include/console/chardev.h

    rcd82bb1 r371bd7d  
    3737
    3838#include <adt/list.h>
    39 #include <arch/types.h>
     39#include <typedefs.h>
    4040#include <synch/waitq.h>
    4141#include <synch/spinlock.h>
     
    5353/** Character input device. */
    5454typedef struct indev {
    55         char *name;
     55        const char *name;
    5656        waitq_t wq;
    5757       
     
    8181/** Character output device. */
    8282typedef struct outdev {
    83         char *name;
     83        const char *name;
    8484       
    8585        /** Protects everything below. */
     
    9595} outdev_t;
    9696
    97 extern void indev_initialize(char *name, indev_t *indev,
     97extern void indev_initialize(const char *name, indev_t *indev,
    9898    indev_operations_t *op);
    9999extern void indev_push_character(indev_t *indev, wchar_t ch);
    100100extern wchar_t indev_pop_character(indev_t *indev);
    101101
    102 extern void outdev_initialize(char *name, outdev_t *outdev,
     102extern void outdev_initialize(const char *name, outdev_t *outdev,
    103103    outdev_operations_t *op);
    104104
  • kernel/generic/include/console/console.h

    rcd82bb1 r371bd7d  
    3636#define KERN_CONSOLE_H_
    3737
    38 #include <arch/types.h>
     38#include <typedefs.h>
    3939#include <console/chardev.h>
    4040
    4141extern indev_t *stdin;
    4242extern outdev_t *stdout;
    43 extern bool silent;
    4443
    4544extern indev_t *stdin_wire(void);
  • kernel/generic/include/console/kconsole.h

    rcd82bb1 r371bd7d  
    9494extern void kconsole_notify_init(void);
    9595extern bool kconsole_check_poll(void);
    96 extern void kconsole(char *prompt, char *msg, bool kcon);
     96extern void kconsole(const char *prompt, const char *msg, bool kcon);
    9797extern void kconsole_thread(void *data);
    9898
  • kernel/generic/include/context.h

    rcd82bb1 r371bd7d  
    2727 */
    2828
    29 /** @addtogroup generic 
     29/** @addtogroup generic
    3030 * @{
    3131 */
     
    3636#define KERN_CONTEXT_H_
    3737
    38 #include <arch/types.h>
     38#include <typedefs.h>
    3939#include <arch/context.h>
    4040
     41#define context_set_generic(ctx, _pc, stack, size) \
     42        (ctx)->pc = (uintptr_t) (_pc); \
     43        (ctx)->sp = ((uintptr_t) (stack)) + (size) - SP_DELTA;
    4144
    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));
     45extern int context_save_arch(context_t *ctx) __attribute__((returns_twice));
     46extern void context_restore_arch(context_t *ctx) __attribute__((noreturn));
    5047
    5148/** Save register context.
     
    7370 * saved like that would therefore lead to a disaster.
    7471 *
    75  * @param c             Context structure.
     72 * @param ctx Context structure.
    7673 *
    77  * @return              context_save() returns 1, context_restore() returns 0.
     74 * @return context_save() returns 1, context_restore() returns 0.
     75 *
    7876 */
    79 #define context_save(c)   context_save_arch(c)
     77#define context_save(ctx)  context_save_arch(ctx)
    8078
    8179/** Restore register context.
     
    8886 * being return value.
    8987 *
    90  * @param c             Context structure.
     88 * @param ctx Context structure.
    9189 */
    92 static inline void context_restore(context_t *c)
     90static inline void context_restore(context_t *ctx)
    9391{
    94         context_restore_arch(c);
     92        context_restore_arch(ctx);
    9593}
    9694
  • kernel/generic/include/cpu.h

    rcd82bb1 r371bd7d  
    4848 * There is one structure like this for every processor.
    4949 */
    50 typedef struct {
     50typedef struct cpu {
    5151        SPINLOCK_DECLARE(lock);
    5252
  • kernel/generic/include/ddi/ddi.h

    rcd82bb1 r371bd7d  
    3737
    3838#include <ddi/ddi_arg.h>
    39 #include <arch/types.h>
     39#include <typedefs.h>
    4040#include <proc/task.h>
    4141#include <adt/list.h>
  • kernel/generic/include/ddi/device.h

    rcd82bb1 r371bd7d  
    3636#define KERN_DEVICE_H_
    3737
    38 #include <arch/types.h>
    3938#include <typedefs.h>
    4039
  • kernel/generic/include/ddi/irq.h

    rcd82bb1 r371bd7d  
    8181#ifdef KERNEL
    8282
    83 #include <arch/types.h>
     83#include <typedefs.h>
    8484#include <adt/list.h>
    8585#include <adt/hash_table.h>
  • kernel/generic/include/debug.h

    rcd82bb1 r371bd7d  
    7575#       define LOG(format, ...) \
    7676                printf("%s() at %s:%u: " format "\n", __func__, __FILE__, \
    77                         __LINE__, ##__VA_ARGS__);
     77                    __LINE__, ##__VA_ARGS__);
    7878#else
    7979#       define LOG(format, ...)
     
    9292                { \
    9393                        printf("%s() at %s:%u: " #fnc "\n", __func__, __FILE__, \
    94                         __LINE__); \
     94                            __LINE__); \
    9595                        fnc; \
    9696                }
  • kernel/generic/include/func.h

    rcd82bb1 r371bd7d  
    2727 */
    2828
    29 /** @addtogroup generic 
     29/** @addtogroup generic
    3030 * @{
    3131 */
     
    3636#define KERN_FUNC_H_
    3737
    38 #include <arch/types.h>
     38#include <typedefs.h>
    3939#include <atomic.h>
    4040
    4141extern atomic_t haltstate;
    4242
    43 extern void halt(void);
     43extern void halt(void) __attribute__((noreturn));
    4444extern unative_t atoi(const char *text);
    4545extern void order(const uint64_t val, uint64_t *rv, char *suffix);
  • kernel/generic/include/interrupt.h

    rcd82bb1 r371bd7d  
    3737
    3838#include <arch/interrupt.h>
    39 #include <arch/types.h>
     39#include <typedefs.h>
    4040#include <proc/task.h>
    4141#include <proc/thread.h>
    4242#include <arch.h>
    4343#include <ddi/irq.h>
     44#include <stacktrace.h>
    4445
    4546typedef void (* iroutine)(int n, istate_t *istate);
    4647
    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 
     48extern void fault_if_from_uspace(istate_t *istate, const char *fmt, ...);
    5849extern iroutine exc_register(int n, const char *name, iroutine f);
    5950extern void exc_dispatch(int n, istate_t *t);
    6051void exc_init(void);
     52
     53extern void irq_initialize_arch(irq_t *irq);
    6154
    6255#endif
  • kernel/generic/include/ipc/event.h

    rcd82bb1 r371bd7d  
    3737
    3838#include <ipc/event_types.h>
    39 #include <arch/types.h>
     39#include <typedefs.h>
    4040#include <synch/spinlock.h>
    4141#include <ipc/ipc.h>
  • kernel/generic/include/ipc/event_types.h

    rcd82bb1 r371bd7d  
    3737
    3838typedef enum event_type {
     39        /** New data available in kernel log */
    3940        EVENT_KLOG = 0,
     41        /** Returning from kernel console to userspace */
    4042        EVENT_KCONSOLE,
     43        /** A thread has faulted and will be terminated */
     44        EVENT_FAULT,
    4145        EVENT_END
    4246} event_type_t;
  • kernel/generic/include/ipc/ipc.h

    rcd82bb1 r371bd7d  
    227227#ifdef KERNEL
    228228
    229 #define IPC_MAX_PHONES  16
     229#define IPC_MAX_PHONES  32
    230230
    231231#include <synch/spinlock.h>
  • kernel/generic/include/ipc/irq.h

    rcd82bb1 r371bd7d  
    4141#include <ipc/ipc.h>
    4242#include <ddi/irq.h>
    43 #include <arch/types.h>
     43#include <typedefs.h>
    4444#include <adt/list.h>
    4545
  • kernel/generic/include/ipc/sysipc.h

    rcd82bb1 r371bd7d  
    3838#include <ipc/ipc.h>
    3939#include <ipc/irq.h>
    40 #include <arch/types.h>
     40#include <typedefs.h>
    4141
    4242unative_t sys_ipc_call_sync_fast(unative_t phoneid, unative_t method,
  • kernel/generic/include/lib/elf.h

    rcd82bb1 r371bd7d  
    3737
    3838#include <arch/elf.h>
    39 #include <arch/types.h>
     39#include <typedefs.h>
    4040
    4141/**
    4242 * current ELF version
    4343 */
    44 #define EV_CURRENT      1
    45 
    46 /** 
    47  * ELF types 
     44#define EV_CURRENT      1
     45
     46/**
     47 * ELF types
    4848 */
    4949#define ET_NONE         0       /* No type */
     
    338338#endif
    339339
    340 extern char *elf_error(unsigned int rc);
     340extern const char *elf_error(unsigned int rc);
    341341
    342342/* Interpreter string used to recognize the program loader */
  • kernel/generic/include/lib/rd.h

    rcd82bb1 r371bd7d  
    3636#define KERN_RD_H_
    3737
    38 #include <arch/types.h>
     38#include <typedefs.h>
    3939
    4040/**
    4141 * RAM disk version
    4242 */
    43 #define RD_VERSION      1
     43#define RD_VERSION      1
    4444
    4545/**
  • kernel/generic/include/macros.h

    rcd82bb1 r371bd7d  
    3838#ifndef __ASM__
    3939
    40 #include <arch/types.h>
     40#include <typedefs.h>
    4141
    4242/** Return true if the intervals overlap.
     
    8484#define STRING_ARG(arg)  #arg
    8585
    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)
    8888
    8989#define MERGE_LOUP32(lo, up) \
  • kernel/generic/include/main/main.h

    rcd82bb1 r371bd7d  
    3636#define KERN_MAIN_H_
    3737
    38 #include <arch/types.h>
     38#include <typedefs.h>
    3939
    4040extern size_t hardcoded_kdata_size;
  • kernel/generic/include/main/uinit.h

    rcd82bb1 r371bd7d  
    3636#define KERN_UINIT_H_
    3737
    38 #include <arch/types.h>
    39 
    4038extern void uinit(void *arg);
    4139
  • kernel/generic/include/memstr.h

    rcd82bb1 r371bd7d  
    2727 */
    2828
    29 /** @addtogroup generic 
     29/** @addtogroup generic
    3030 * @{
    3131 */
     
    3636#define KERN_MEMSTR_H_
    3737
    38 #include <arch/types.h>
     38#include <typedefs.h>
    3939#include <arch/memstr.h>
    4040
  • kernel/generic/include/mm/as.h

    rcd82bb1 r371bd7d  
    3636#define KERN_AS_H_
    3737
     38#ifdef KERNEL
     39        #include <typedefs.h>
     40#else
     41        #include <sys/types.h>
     42#endif
     43
    3844/** Address space area flags. */
    3945#define AS_AREA_READ            1
     
    4248#define AS_AREA_CACHEABLE       8
    4349
     50/** Address space area info exported to userspace. */
     51typedef 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
    4462#ifdef KERNEL
    4563
     
    4765#include <arch/mm/as.h>
    4866#include <arch/mm/asid.h>
    49 #include <arch/types.h>
     67#include <typedefs.h>
    5068#include <synch/spinlock.h>
    5169#include <synch/mutex.h>
     
    268286
    269287/* Introspection functions. */
     288extern void as_get_area_info(as_t *as, as_area_info_t **obuf, size_t *osize);
    270289extern void as_print(as_t *as);
    271290
  • kernel/generic/include/mm/buddy.h

    rcd82bb1 r371bd7d  
    3636#define KERN_BUDDY_H_
    3737
    38 #include <arch/types.h>
     38#include <typedefs.h>
    3939#include <adt/list.h>
    4040
  • kernel/generic/include/mm/frame.h

    rcd82bb1 r371bd7d  
    3737#define KERN_FRAME_H_
    3838
    39 #include <arch/types.h>
     39#include <typedefs.h>
    4040#include <adt/list.h>
    4141#include <mm/buddy.h>
  • kernel/generic/include/mm/page.h

    rcd82bb1 r371bd7d  
    3636#define KERN_PAGE_H_
    3737
    38 #include <arch/types.h>
     38#include <typedefs.h>
    3939#include <mm/as.h>
    4040#include <memstr.h>
  • kernel/generic/include/mm/slab.h

    rcd82bb1 r371bd7d  
    8686
    8787typedef struct {
    88         char *name;
     88        const char *name;
    8989       
    9090        link_t link;
     
    123123} slab_cache_t;
    124124
    125 extern slab_cache_t *slab_cache_create(char *, size_t, size_t,
     125extern slab_cache_t *slab_cache_create(const char *, size_t, size_t,
    126126    int (*)(void *, int), int (*)(void *), int);
    127127extern void slab_cache_destroy(slab_cache_t *);
  • kernel/generic/include/mm/tlb.h

    rcd82bb1 r371bd7d  
    3737
    3838#include <arch/mm/asid.h>
    39 #include <arch/types.h>
     39#include <typedefs.h>
    4040
    4141/**
  • kernel/generic/include/panic.h

    rcd82bb1 r371bd7d  
    2727 */
    2828
    29 /** @addtogroup generic 
     29/** @addtogroup generic
    3030 * @{
    3131 */
     
    3636#define KERN_PANIC_H_
    3737
     38#include <typedefs.h>
     39#include <stacktrace.h>
     40#include <print.h>
     41
    3842#ifdef CONFIG_DEBUG
    3943#       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)
    4252#else
    4353#       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)
    4558#endif
    4659
    47 extern void panic_printf(char *fmt, ...) __attribute__((noreturn));
     60extern bool silent;
     61
     62extern void panic_printf(const char *fmt, ...) __attribute__((noreturn));
    4863
    4964#endif
  • kernel/generic/include/print.h

    rcd82bb1 r371bd7d  
    3636#define KERN_PRINT_H_
    3737
    38 #include <arch/types.h>
     38#include <typedefs.h>
    3939#include <stdarg.h>
    4040
  • kernel/generic/include/proc/program.h

    rcd82bb1 r371bd7d  
    3636#define KERN_PROGRAM_H_
    3737
    38 #include <arch/types.h>
     38#include <typedefs.h>
    3939
    4040struct task;
     
    4545 * A program is an abstraction of a freshly created (not yet running)
    4646 * userspace task containing a main thread along with its userspace stack.
     47 *
    4748 */
    4849typedef 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 */
    5152} program_t;
    5253
    5354extern void *program_loader;
    5455
    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);
     56extern int program_create(as_t *, uintptr_t, char *, program_t *);
     57extern int program_create_from_image(void *, char *, program_t *);
     58extern int program_create_loader(program_t *, char *);
     59extern void program_ready(program_t *);
    6160
    62 extern unative_t sys_program_spawn_loader(char *uspace_name, size_t name_len);
     61extern unative_t sys_program_spawn_loader(char *, size_t);
    6362
    6463#endif
  • kernel/generic/include/proc/scheduler.h

    rcd82bb1 r371bd7d  
    3737
    3838#include <synch/spinlock.h>
    39 #include <time/clock.h>         /* HZ */
     39#include <time/clock.h>
     40#include <typedefs.h>
    4041#include <atomic.h>
    4142#include <adt/list.h>
    4243
    43 #define RQ_COUNT                16
    44 #define NEEDS_RELINK_MAX        (HZ)
     44#define RQ_COUNT          16
     45#define NEEDS_RELINK_MAX  (HZ)
    4546
    4647/** Scheduler run queue structure. */
    4748typedef struct {
    4849        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. */
    5152} runq_t;
    5253
     
    6162
    6263/*
    63  * To be defined by architectures:
     64 * To be defined by architectures.
    6465 */
    6566extern void before_task_runs_arch(void);
  • kernel/generic/include/proc/task.h

    rcd82bb1 r371bd7d  
    5555#include <udebug/udebug.h>
    5656#include <ipc/kbox.h>
     57#include <mm/as.h>
    5758
    5859#define TASK_NAME_BUFLEN        20
     
    129130extern void task_init(void);
    130131extern void task_done(void);
    131 extern task_t *task_create(as_t *as, char *name);
     132extern task_t *task_create(as_t *as, const char *name);
    132133extern void task_destroy(task_t *t);
    133134extern task_t *task_find_by_id(task_id_t id);
  • kernel/generic/include/proc/thread.h

    rcd82bb1 r371bd7d  
    5252#define THREAD_NAME_BUFLEN      20
    5353
    54 extern char *thread_states[];
     54extern const char *thread_states[];
    5555
    5656/* Thread flags */
     
    225225
    226226extern 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);
     227extern thread_t *thread_create(void (*)(void *), void *, task_t *, int,
     228    const char *, bool);
     229extern void thread_attach(thread_t *, task_t *);
     230extern void thread_ready(thread_t *);
    231231extern void thread_exit(void) __attribute__((noreturn));
    232232
    233233#ifndef thread_create_arch
    234 extern void thread_create_arch(thread_t *t);
     234extern void thread_create_arch(thread_t *);
    235235#endif
    236236#ifndef thr_constructor_arch
    237 extern void thr_constructor_arch(thread_t *t);
     237extern void thr_constructor_arch(thread_t *);
    238238#endif
    239239#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);
     240extern void thr_destructor_arch(thread_t *);
     241#endif
     242
     243extern void thread_sleep(uint32_t);
     244extern void thread_usleep(uint32_t);
    245245
    246246#define thread_join(t) \
    247247        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);
     248extern int thread_join_timeout(thread_t *, uint32_t, int);
     249extern void thread_detach(thread_t *);
     250
     251extern void thread_register_call_me(void (*)(void *), void *);
    253252extern void thread_print_list(void);
    254 extern void thread_destroy(thread_t *t);
     253extern void thread_destroy(thread_t *);
    255254extern void thread_update_accounting(void);
    256 extern bool thread_exists(thread_t *t);
     255extern bool thread_exists(thread_t *);
    257256
    258257/** Fpu context slab cache. */
     
    260259
    261260/* 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);
     261extern unative_t sys_thread_create(uspace_arg_t *, char *, size_t,
     262    thread_id_t *);
     263extern unative_t sys_thread_exit(int);
     264extern unative_t sys_thread_get_id(thread_id_t *);
     265extern unative_t sys_thread_usleep(uint32_t);
    266266
    267267#endif
  • kernel/generic/include/security/cap.h

    rcd82bb1 r371bd7d  
    4949
    5050#include <syscall/sysarg64.h>
    51 #include <arch/types.h>
     51#include <typedefs.h>
    5252
    5353/**
  • kernel/generic/include/smp/ipi.h

    rcd82bb1 r371bd7d  
    2727 */
    2828
    29 /** @addtogroup generic 
     29/** @addtogroup generic
    3030 * @{
    3131 */
     
    3737
    3838#ifdef CONFIG_SMP
    39 extern void ipi_broadcast(int ipi);
    40 extern void ipi_broadcast_arch(int ipi);
     39
     40extern void ipi_broadcast(int);
     41extern void ipi_broadcast_arch(int);
     42
    4143#else
    42 #define ipi_broadcast(x)        ;
     44
     45        #define ipi_broadcast(ipi)
     46
    4347#endif /* CONFIG_SMP */
    4448
  • kernel/generic/include/sort.h

    rcd82bb1 r371bd7d  
    2727 */
    2828
    29 /** @addtogroup generic 
     29/** @addtogroup generic
    3030 * @{
    3131 */
     
    3636#define KERN_SORT_H_
    3737
    38 #include <arch/types.h>
     38#include <typedefs.h>
    3939
    4040/*
  • kernel/generic/include/str.h

    rcd82bb1 r371bd7d  
    3333 */
    3434
    35 #ifndef KERN_STRING_H_
    36 #define KERN_STRING_H_
     35#ifndef KERN_STR_H_
     36#define KERN_STR_H_
    3737
    3838#include <typedefs.h>
  • kernel/generic/include/symtab.h

    rcd82bb1 r371bd7d  
    3636#define KERN_SYMTAB_H_
    3737
    38 #include <arch/types.h>
     38#include <typedefs.h>
    3939
    4040#define MAX_SYMBOL_NAME 64
     
    4545};
    4646
    47 extern int symtab_name_lookup(unative_t addr, char **name);
    48 extern char *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);
     47extern int symtab_name_lookup(uintptr_t, const char **, uintptr_t *);
     48extern const char *symtab_fmt_name_lookup(uintptr_t);
     49extern int symtab_addr_lookup(const char *, uintptr_t *);
     50extern void symtab_print_search(const char *);
     51extern int symtab_compl(char *, size_t);
    5252
    5353#ifdef CONFIG_SYMTAB
  • kernel/generic/include/synch/condvar.h

    rcd82bb1 r371bd7d  
    3636#define KERN_CONDVAR_H_
    3737
    38 #include <arch/types.h>
     38#include <typedefs.h>
    3939#include <synch/waitq.h>
    4040#include <synch/mutex.h>
  • kernel/generic/include/synch/futex.h

    rcd82bb1 r371bd7d  
    3636#define KERN_FUTEX_H_
    3737
    38 #include <arch/types.h>
     38#include <typedefs.h>
    3939#include <synch/waitq.h>
    40 #include <genarch/mm/page_ht.h>
    41 #include <genarch/mm/page_pt.h>
    4240
    4341/** Kernel-side futex structure. */
     
    5452
    5553extern 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);
     54extern unative_t sys_futex_sleep(uintptr_t);
     55extern unative_t sys_futex_wakeup(uintptr_t);
    5956
    6057extern void futex_cleanup(void);
  • kernel/generic/include/synch/mutex.h

    rcd82bb1 r371bd7d  
    3636#define KERN_MUTEX_H_
    3737
    38 #include <arch/types.h>
     38#include <typedefs.h>
    3939#include <synch/semaphore.h>
    4040#include <synch/synch.h>
  • kernel/generic/include/synch/rwlock.h

    rcd82bb1 r371bd7d  
    3636#define KERN_RWLOCK_H_
    3737
    38 #include <arch/types.h>
     38#include <typedefs.h>
    3939#include <synch/mutex.h>
    4040#include <synch/synch.h>
  • kernel/generic/include/synch/semaphore.h

    rcd82bb1 r371bd7d  
    3636#define KERN_SEMAPHORE_H_
    3737
    38 #include <arch/types.h>
     38#include <typedefs.h>
    3939#include <synch/waitq.h>
    4040#include <synch/synch.h>
  • kernel/generic/include/synch/spinlock.h

    rcd82bb1 r371bd7d  
    3636#define KERN_SPINLOCK_H_
    3737
    38 #include <arch/types.h>
     38#include <typedefs.h>
    3939#include <arch/barrier.h>
    4040#include <preemption.h>
     
    4848       
    4949#ifdef CONFIG_DEBUG_SPINLOCK
    50         char *name;
     50        const char *name;
    5151#endif
    5252} spinlock_t;
     
    101101        SPINLOCK_STATIC_INITIALIZE_NAME(lock_name, #lock_name)
    102102
    103 extern void spinlock_initialize(spinlock_t *lock, char *name);
     103extern void spinlock_initialize(spinlock_t *lock, const char *name);
    104104extern int spinlock_trylock(spinlock_t *lock);
    105105extern void spinlock_lock_debug(spinlock_t *lock);
  • kernel/generic/include/synch/waitq.h

    rcd82bb1 r371bd7d  
    3636#define KERN_WAITQ_H_
    3737
    38 #include <arch/types.h>
     38#include <typedefs.h>
    3939#include <synch/spinlock.h>
    4040#include <synch/synch.h>
  • kernel/generic/include/syscall/copy.h

    rcd82bb1 r371bd7d  
    3636#define KERN_COPY_H_
    3737
    38 #include <arch/types.h>
     38#include <typedefs.h>
    3939
    4040/** Label within memcpy_from_uspace() that contains return -1. */
  • kernel/generic/include/syscall/syscall.h

    rcd82bb1 r371bd7d  
    4343        SYS_THREAD_EXIT,
    4444        SYS_THREAD_GET_ID,
     45        SYS_THREAD_USLEEP,
    4546       
    4647        SYS_TASK_GET_ID,
     
    9293#ifdef KERNEL
    9394
    94 #include <arch/types.h>
     95#include <typedefs.h>
    9596
    9697typedef unative_t (*syshandler_t)(unative_t, unative_t, unative_t, unative_t,
  • kernel/generic/include/sysinfo/sysinfo.h

    rcd82bb1 r371bd7d  
    3636#define KERN_SYSINFO_H_
    3737
    38 #include <arch/types.h>
    39 #include <string.h>
     38#include <typedefs.h>
     39#include <str.h>
    4040
    4141extern bool fb_exported;
  • kernel/generic/include/time/clock.h

    rcd82bb1 r371bd7d  
    3636#define KERN_CLOCK_H_
    3737
    38 #include <arch/types.h>
     38#include <typedefs.h>
    3939
    4040#define HZ              100
  • kernel/generic/include/time/delay.h

    rcd82bb1 r371bd7d  
    3636#define KERN_DELAY_H_
    3737
    38 #include <arch/types.h>
     38#include <typedefs.h>
    3939
    4040extern void delay(uint32_t microseconds);
  • kernel/generic/include/time/timeout.h

    rcd82bb1 r371bd7d  
    3636#define KERN_TIMEOUT_H_
    3737
    38 #include <arch/types.h>
     38#include <typedefs.h>
    3939#include <adt/list.h>
    4040#include <cpu.h>
  • kernel/generic/include/typedefs.h

    rcd82bb1 r371bd7d  
    3636#define KERN_TYPEDEFS_H_
    3737
     38#include <arch/common.h>
    3839#include <arch/types.h>
    3940
    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
     46typedef struct {
     47        uint64_t lo;
     48        int64_t hi;
     49} int128_t;
     50
     51typedef struct {
     52        uint64_t lo;
     53        uint64_t hi;
     54} uint128_t;
     55
     56typedef struct {
     57        volatile atomic_count_t count;
     58} atomic_t;
    4359
    4460typedef void (* function)();
  • kernel/generic/include/udebug/udebug.h

    rcd82bb1 r371bd7d  
    2727 */
    2828
    29 /** @addtogroup generic 
     29/** @addtogroup generic
    3030 * @{
    3131 */
     
    8383UDEBUG_M_ARGS_READ,
    8484
     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 */
     94UDEBUG_M_REGS_READ,
     95
    8596/** Read the list of the debugged tasks's threads.
    8697 *
     
    97108UDEBUG_M_THREAD_READ,
    98109
     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 */
     121UDEBUG_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 */
     135UDEBUG_M_AREAS_READ,
     136
    99137/** Read the debugged tasks's memory.
    100138 *
     
    108146} udebug_method_t;
    109147
    110                                
     148
    111149typedef enum {
    112150        UDEBUG_EVENT_FINISHED = 1,      /**< Debuging session has finished */
     
    139177
    140178#include <synch/mutex.h>
     179#include <synch/condvar.h>
    141180#include <arch/interrupt.h>
    142181#include <atomic.h>
     
    181220        bool stoppable;         /**< thread is stoppable */
    182221        bool active;            /**< thread is in a debugging session */
     222        condvar_t active_cv;
    183223} udebug_thread_t;
    184224
     
    202242
    203243int udebug_task_cleanup(struct task *ta);
     244void udebug_thread_fault(void);
    204245
    205246#endif
  • kernel/generic/include/udebug/udebug_ops.h

    rcd82bb1 r371bd7d  
    4545int udebug_stop(thread_t *t, call_t *call);
    4646
    47 int udebug_thread_read(void **buffer, size_t buf_size, size_t *n);
     47int udebug_thread_read(void **buffer, size_t buf_size, size_t *stored,
     48    size_t *needed);
     49int udebug_name_read(char **data, size_t *data_size);
    4850int udebug_args_read(thread_t *t, void **buffer);
     51
     52int udebug_regs_read(thread_t *t, void **buffer);
    4953
    5054int udebug_mem_read(unative_t uspace_addr, size_t n, void **buffer);
  • kernel/generic/include/userspace.h

    rcd82bb1 r371bd7d  
    2727 */
    2828
    29 /** @addtogroup generic 
     29/** @addtogroup generic
    3030 * @{
    3131 */
     
    3737
    3838#include <proc/thread.h>
    39 #include <arch/types.h>
     39#include <typedefs.h>
    4040
    4141/** Switch to user-space (CPU user priviledge level) */
Note: See TracChangeset for help on using the changeset viewer.