Changeset 8ff0bd2 in mainline for kernel/generic/include


Ignore:
Timestamp:
2011-09-04T11:30:58Z (14 years ago)
Author:
Maurizio Lombardi <m.lombardi85@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
03bc76a
Parents:
d2c67e7 (diff), deac215e (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
28 edited

Legend:

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

    rd2c67e7 r8ff0bd2  
    8989typedef struct {
    9090        btree_node_t *root;     /**< B-tree root node pointer. */
    91         link_t leaf_head;       /**< Leaf-level list head. */
     91        list_t leaf_list;       /**< List of leaves. */
    9292} btree_t;
    9393
  • kernel/generic/include/adt/hash_table.h

    rd2c67e7 r8ff0bd2  
    6868/** Hash table structure. */
    6969typedef struct {
    70         link_t *entry;
     70        list_t *entry;
    7171        size_t entries;
    7272        size_t max_keys;
  • kernel/generic/include/adt/list.h

    rd2c67e7 r8ff0bd2  
    11/*
    22 * Copyright (c) 2001-2004 Jakub Jermar
     3 * Copyright (c) 2011 Jiri Svoboda
    34 * All rights reserved.
    45 *
     
    3940#include <trace.h>
    4041
    41 /** Doubly linked list head and link type. */
     42/** Doubly linked list link. */
    4243typedef struct link {
    4344        struct link *prev;  /**< Pointer to the previous item in the list. */
     
    4546} link_t;
    4647
     48/** Doubly linked list. */
     49typedef struct list {
     50        link_t head;  /**< List head. Does not have any data. */
     51} list_t;
     52
    4753/** Declare and initialize statically allocated list.
    4854 *
     
    5157 */
    5258#define LIST_INITIALIZE(name) \
    53         link_t name = { \
    54                 .prev = &name, \
    55                 .next = &name \
     59        list_t name = { \
     60                .head = { \
     61                        .prev = &(name).head, \
     62                        .next = &(name).head \
     63                } \
    5664        }
    5765
     
    6068
    6169#define list_foreach(list, iterator) \
    62         for (link_t *iterator = (list).next; \
    63             iterator != &(list); iterator = iterator->next)
     70        for (link_t *iterator = (list).head.next; \
     71            iterator != &(list).head; iterator = iterator->next)
     72
     73#define assert_link_not_used(link) \
     74        ASSERT((link)->prev == NULL && (link)->next == NULL)
    6475
    6576/** Initialize doubly-linked circular list link
     
    8091 * Initialize doubly-linked circular list.
    8192 *
    82  * @param list Pointer to link_t structure representing the list.
    83  *
    84  */
    85 NO_TRACE static inline void list_initialize(link_t *list)
    86 {
    87         list->prev = list;
    88         list->next = list;
     93 * @param list Pointer to list_t structure.
     94 *
     95 */
     96NO_TRACE static inline void list_initialize(list_t *list)
     97{
     98        list->head.prev = &list->head;
     99        list->head.next = &list->head;
     100}
     101
     102/** Insert item before another item in doubly-linked circular list.
     103 *
     104 */
     105static inline void list_insert_before(link_t *lnew, link_t *lold)
     106{
     107        lnew->next = lold;
     108        lnew->prev = lold->prev;
     109        lold->prev->next = lnew;
     110        lold->prev = lnew;
     111}
     112
     113/** Insert item after another item in doubly-linked circular list.
     114 *
     115 */
     116static inline void list_insert_after(link_t *lnew, link_t *lold)
     117{
     118        lnew->prev = lold;
     119        lnew->next = lold->next;
     120        lold->next->prev = lnew;
     121        lold->next = lnew;
    89122}
    90123
     
    94127 *
    95128 * @param link Pointer to link_t structure to be added.
    96  * @param list Pointer to link_t structure representing the list.
    97  *
    98  */
    99 NO_TRACE static inline void list_prepend(link_t *link, link_t *list)
    100 {
    101         link->next = list->next;
    102         link->prev = list;
    103         list->next->prev = link;
    104         list->next = link;
     129 * @param list Pointer to list_t structure.
     130 *
     131 */
     132NO_TRACE static inline void list_prepend(link_t *link, list_t *list)
     133{
     134        list_insert_after(link, &list->head);
    105135}
    106136
     
    110140 *
    111141 * @param link Pointer to link_t structure to be added.
    112  * @param list Pointer to link_t structure representing the list.
    113  *
    114  */
    115 NO_TRACE static inline void list_append(link_t *link, link_t *list)
    116 {
    117         link->prev = list->prev;
    118         link->next = list;
    119         list->prev->next = link;
    120         list->prev = link;
    121 }
    122 
    123 /** Insert item before another item in doubly-linked circular list.
    124  *
    125  */
    126 static inline void list_insert_before(link_t *link, link_t *list)
    127 {
    128         list_append(link, list);
    129 }
    130 
    131 /** Insert item after another item in doubly-linked circular list.
    132  *
    133  */
    134 static inline void list_insert_after(link_t *link, link_t *list)
    135 {
    136         list_prepend(list, link);
     142 * @param list Pointer to list_t structure.
     143 *
     144 */
     145NO_TRACE static inline void list_append(link_t *link, list_t *list)
     146{
     147        list_insert_before(link, &list->head);
    137148}
    138149
     
    156167 * Query emptiness of doubly-linked circular list.
    157168 *
    158  * @param list Pointer to link_t structure representing the list.
    159  *
    160  */
    161 NO_TRACE static inline int list_empty(link_t *list)
    162 {
    163         return (list->next == list);
    164 }
    165 
    166 /** Get head item of a list.
    167  *
    168  * @param list Pointer to link_t structure representing the list.
     169 * @param list Pointer to lins_t structure.
     170 *
     171 */
     172NO_TRACE static inline int list_empty(list_t *list)
     173{
     174        return (list->head.next == &list->head);
     175}
     176
     177/** Get first item in list.
     178 *
     179 * @param list Pointer to list_t structure.
    169180 *
    170181 * @return Head item of the list.
     
    172183 *
    173184 */
    174 static inline link_t *list_head(link_t *list)
    175 {
    176         return ((list->next == list) ? NULL : list->next);
     185static inline link_t *list_first(list_t *list)
     186{
     187        return ((list->head.next == &list->head) ? NULL : list->head.next);
     188}
     189
     190/** Get last item in list.
     191 *
     192 * @param list Pointer to list_t structure.
     193 *
     194 * @return Head item of the list.
     195 * @return NULL if the list is empty.
     196 *
     197 */
     198static inline link_t *list_last(list_t *list)
     199{
     200        return ((list->head.prev == &list->head) ? NULL : list->head.prev);
    177201}
    178202
     
    231255}
    232256
    233 /** Get n-th item of a list.
     257/** Get n-th item in a list.
    234258 *
    235259 * @param list Pointer to link_t structure representing the list.
     
    240264 *
    241265 */
    242 static inline link_t *list_nth(link_t *list, unsigned int n)
     266static inline link_t *list_nth(list_t *list, unsigned int n)
    243267{
    244268        unsigned int cnt = 0;
     
    254278}
    255279
    256 extern int list_member(const link_t *, const link_t *);
    257 extern void list_concat(link_t *, link_t *);
    258 extern unsigned int list_count(const link_t *);
     280extern int list_member(const link_t *, const list_t *);
     281extern void list_concat(list_t *, list_t *);
     282extern unsigned int list_count(const list_t *);
    259283
    260284#endif
  • kernel/generic/include/console/chardev.h

    rd2c67e7 r8ff0bd2  
    7373typedef struct {
    7474        /** Write character to output. */
    75         void (* write)(struct outdev *, wchar_t, bool);
     75        void (* write)(struct outdev *, wchar_t);
    7676       
    7777        /** Redraw any previously cached characters. */
     
    8888        /** Fields suitable for multiplexing. */
    8989        link_t link;
    90         link_t list;
     90        list_t list;
    9191       
    9292        /** Implementation of outdev operations. */
  • kernel/generic/include/console/console.h

    rd2c67e7 r8ff0bd2  
    6363
    6464extern void klog_init(void);
    65 extern void klog_update(void);
     65extern void klog_update(void *);
    6666
    6767extern wchar_t getc(indev_t *indev);
     
    7272extern void release_console(void);
    7373
    74 extern sysarg_t sys_debug_enable_console(void);
    75 extern sysarg_t sys_debug_disable_console(void);
     74extern sysarg_t sys_debug_activate_console(void);
    7675
    7776#endif /* KERN_CONSOLE_H_ */
  • kernel/generic/include/console/kconsole.h

    rd2c67e7 r8ff0bd2  
    9191
    9292SPINLOCK_EXTERN(cmd_lock);
    93 extern link_t cmd_head;
     93extern list_t cmd_list;
    9494
    9595extern void kconsole_init(void);
  • kernel/generic/include/cpu.h

    rd2c67e7 r8ff0bd2  
    5959       
    6060        IRQ_SPINLOCK_DECLARE(timeoutlock);
    61         link_t timeout_active_head;
     61        list_t timeout_active_list;
    6262       
    6363        /**
  • kernel/generic/include/ddi/ddi.h

    rd2c67e7 r8ff0bd2  
    3636#define KERN_DDI_H_
    3737
    38 #include <ddi/ddi_arg.h>
    3938#include <typedefs.h>
     39#include <abi/ddi/arg.h>
    4040#include <proc/task.h>
    4141#include <adt/list.h>
     
    4848        pfn_t frames;     /**< Number of frames in the area. */
    4949        bool unpriv;      /**< Allow mapping by unprivileged tasks. */
     50        bool mapped;      /**< Indicate whether the area is actually
     51                               mapped. */
    5052} parea_t;
    5153
  • kernel/generic/include/ddi/irq.h

    rd2c67e7 r8ff0bd2  
    3333 */
    3434
    35 #ifndef KERN_IRQ_H_
    36 #define KERN_IRQ_H_
    37 
    38 #ifdef KERNEL
     35#ifndef KERN_DDI_IRQ_H_
     36#define KERN_DDI_IRQ_H_
    3937
    4038#include <typedefs.h>
     39#include <abi/ddi/irq.h>
    4140#include <adt/list.h>
    4241#include <adt/hash_table.h>
     
    4443#include <proc/task.h>
    4544#include <ipc/ipc.h>
    46 
    47 #endif /* KERNEL */
    48 
    49 typedef enum {
    50         /** Read 1 byte from the I/O space. */
    51         CMD_PIO_READ_8 = 1,
    52         /** Read 2 bytes from the I/O space. */
    53         CMD_PIO_READ_16,
    54         /** Read 4 bytes from the I/O space. */
    55         CMD_PIO_READ_32,
    56        
    57         /** Write 1 byte to the I/O space. */
    58         CMD_PIO_WRITE_8,
    59         /** Write 2 bytes to the I/O space. */
    60         CMD_PIO_WRITE_16,
    61         /** Write 4 bytes to the I/O space. */
    62         CMD_PIO_WRITE_32,
    63        
    64         /**
    65          * Write 1 byte from the source argument
    66          * to the I/O space.
    67          */
    68         CMD_PIO_WRITE_A_8,
    69         /**
    70          * Write 2 bytes from the source argument
    71          * to the I/O space.
    72          */
    73         CMD_PIO_WRITE_A_16,
    74         /**
    75          * Write 4 bytes from the source argument
    76          * to the I/O space.
    77          */
    78         CMD_PIO_WRITE_A_32,
    79 
    80         /** Read 1 byte from the memory space. */
    81         CMD_MEM_READ_8,
    82         /** Read 2 bytes from the memory space. */
    83         CMD_MEM_READ_16,
    84         /** Read 4 bytes from the memory space. */
    85         CMD_MEM_READ_32,
    86 
    87         /** Write 1 byte to the memory space. */
    88         CMD_MEM_WRITE_8,
    89         /** Write 2 bytes to the memory space. */
    90         CMD_MEM_WRITE_16,
    91         /** Write 4 bytes to the memory space. */
    92         CMD_MEM_WRITE_32,
    93 
    94         /** Write 1 byte from the source argument to the memory space. */
    95         CMD_MEM_WRITE_A_8,
    96         /** Write 2 bytes from the source argument to the memory space. */
    97         CMD_MEM_WRITE_A_16,
    98         /** Write 4 bytes from the source argument to the memory space. */
    99         CMD_MEM_WRITE_A_32,
    100 
    101         /**
    102          * Perform a bit masking on the source argument
    103          * and store the result into the destination argument.
    104          */
    105         CMD_BTEST,
    106        
    107         /**
    108          * Predicate the execution of the following
    109          * N commands by the boolean value of the source
    110          * argument.
    111          */
    112         CMD_PREDICATE,
    113        
    114         /** Accept the interrupt. */
    115         CMD_ACCEPT,
    116        
    117         /** Decline the interrupt. */
    118         CMD_DECLINE,
    119         CMD_LAST
    120 } irq_cmd_type;
    121 
    122 typedef struct {
    123         irq_cmd_type cmd;
    124         void *addr;
    125         uint32_t value;
    126         uintptr_t srcarg;
    127         uintptr_t dstarg;
    128 } irq_cmd_t;
    129 
    130 typedef struct {
    131         size_t cmdcount;
    132         irq_cmd_t *cmds;
    133 } irq_code_t;
    134 
    135 #ifdef KERNEL
    13645
    13746typedef enum {
     
    14655
    14756struct irq;
     57
    14858typedef void (* irq_handler_t)(struct irq *);
    14959
     
    224134        /** Notification configuration structure. */
    225135        ipc_notif_cfg_t notif_cfg;
    226 
     136       
    227137        as_t *driver_as;
    228138} irq_t;
     
    238148extern irq_t *irq_dispatch_and_lock(inr_t);
    239149
    240 #endif /* KERNEL */
    241 
    242150#endif
    243151
  • kernel/generic/include/errno.h

    rd2c67e7 r8ff0bd2  
    2727 */
    2828
    29 /** @addtogroup generic 
     29/** @addtogroup generic
    3030 * @{
    3131 */
     
    3636#define KERN_ERRNO_H_
    3737
    38 /* 1-255 are kernel error codes, 256-512 are user error codes */
    39 
    40 #define EOK             0       /* No error */
    41 #define ENOENT          -1      /* No such entry */
    42 #define ENOMEM          -2      /* Not enough memory */
    43 #define ELIMIT          -3      /* Limit exceeded */
    44 #define EREFUSED        -4      /* Connection refused */
    45 #define EFORWARD        -5      /* Forward error */
    46 #define EPERM           -6      /* Permission denied */
    47 #define EHANGUP         -7      /* Answerbox closed connection, call
    48                                  * sys_ipc_hangup() to close the connection.
    49                                  * Used by answerbox to close the connection.
    50                                  */
    51 #define EPARTY          -8      /* The other party encountered an error when
    52                                  * receiving the call.
    53                                  */
    54 #define EEXISTS         -9      /* Entry already exists */
    55 #define EBADMEM         -10     /* Bad memory pointer */
    56 #define ENOTSUP         -11     /* Not supported */
    57 #define EADDRNOTAVAIL   -12     /* Address not available. */
    58 #define ETIMEOUT        -13     /* Timeout expired */
    59 #define EINVAL          -14     /* Invalid value */
    60 #define EBUSY           -15     /* Resource is busy */
    61 #define EOVERFLOW       -16     /* The result does not fit its size. */
    62 #define EINTR           -17     /* Operation was interrupted. */
     38#include <abi/errno.h>
    6339
    6440#endif
  • kernel/generic/include/ipc/event.h

    rd2c67e7 r8ff0bd2  
    3636#define KERN_EVENT_H_
    3737
    38 #include <ipc/event_types.h>
     38#include <abi/ipc/event.h>
    3939#include <typedefs.h>
    4040#include <synch/spinlock.h>
    4141#include <ipc/ipc.h>
    4242
    43 typedef void (*event_callback_t)(void);
     43struct task;
     44
     45typedef void (*event_callback_t)(void *);
    4446
    4547/** Event notification structure. */
     
    6163
    6264extern void event_init(void);
     65extern void event_task_init(struct task *);
    6366extern void event_cleanup_answerbox(answerbox_t *);
    6467extern void event_set_unmask_callback(event_type_t, event_callback_t);
     68extern void event_task_set_unmask_callback(struct task *, event_task_type_t,
     69    event_callback_t);
    6570
    6671#define event_notify_0(e, m) \
     
    7782        event_notify((e), (m), (a1), (a2), (a3), (a4), (a5))
    7883
     84#define event_task_notify_0(t, e, m) \
     85        event_task_notify((t), (e), (m), 0, 0, 0, 0, 0)
     86#define event_task_notify_1(t, e, m, a1) \
     87        event_task_notify((t), (e), (m), (a1), 0, 0, 0, 0)
     88#define event_task_notify_2(t, e, m, a1, a2) \
     89        event_task_notify((t), (e), (m), (a1), (a2), 0, 0, 0)
     90#define event_task_notify_3(t, e, m, a1, a2, a3) \
     91        event_task_notify((t), (e), (m), (a1), (a2), (a3), 0, 0)
     92#define event_task_notify_4(t, e, m, a1, a2, a3, a4) \
     93        event_task_notify((t), (e), (m), (a1), (a2), (a3), (a4), 0)
     94#define event_task_notify_5(t, e, m, a1, a2, a3, a4, a5) \
     95        event_task_notify((t), (e), (m), (a1), (a2), (a3), (a4), (a5))
     96
    7997extern int event_notify(event_type_t, bool, sysarg_t, sysarg_t, sysarg_t,
    8098    sysarg_t, sysarg_t);
     99extern int event_task_notify(struct task *, event_task_type_t, bool, sysarg_t, sysarg_t,
     100    sysarg_t, sysarg_t, sysarg_t);
    81101
    82102extern sysarg_t sys_event_subscribe(sysarg_t, sysarg_t);
  • kernel/generic/include/ipc/ipc.h

    rd2c67e7 r8ff0bd2  
    3636#define KERN_IPC_H_
    3737
    38 /** Length of data being transfered with IPC call
    39  *
    40  * The uspace may not be able to utilize full length
    41  *
    42  */
    43 #define IPC_CALL_LEN  6
    44 
    45 /** Maximum active async calls per phone */
    46 #define IPC_MAX_ASYNC_CALLS  4
    47 
    48 /* Flags for calls */
    49 
    50 /** This is answer to a call */
    51 #define IPC_CALL_ANSWERED  (1 << 0)
    52 
    53 /** Answer will not be passed to userspace, will be discarded */
    54 #define IPC_CALL_DISCARD_ANSWER  (1 << 1)
    55 
    56 /** Call was forwarded */
    57 #define IPC_CALL_FORWARDED  (1 << 2)
    58 
    59 /** Identify connect_me_to answer */
    60 #define IPC_CALL_CONN_ME_TO  (1 << 3)
    61 
    62 /** Interrupt notification */
    63 #define IPC_CALL_NOTIF  (1 << 4)
    64 
    65 
    66 /** Bits used in call hashes.
    67  *
    68  * The addresses are aligned at least to 4 that is why we can use the 2 least
    69  * significant bits of the call address.
    70  *
    71  */
    72 
    73 /** Type of this call is 'answer' */
    74 #define IPC_CALLID_ANSWERED  1
    75 
    76 /** Type of this call is 'notification' */
    77 #define IPC_CALLID_NOTIFICATION  2
    78 
    79 /* Return values from sys_ipc_call_async(). */
    80 #define IPC_CALLRET_FATAL      -1
    81 #define IPC_CALLRET_TEMPORARY  -2
    82 
    83 
    84 /* Macros for manipulating calling data */
    85 #define IPC_SET_RETVAL(data, retval)  ((data).args[0] = (retval))
    86 #define IPC_SET_IMETHOD(data, val)    ((data).args[0] = (val))
    87 #define IPC_SET_ARG1(data, val)       ((data).args[1] = (val))
    88 #define IPC_SET_ARG2(data, val)       ((data).args[2] = (val))
    89 #define IPC_SET_ARG3(data, val)       ((data).args[3] = (val))
    90 #define IPC_SET_ARG4(data, val)       ((data).args[4] = (val))
    91 #define IPC_SET_ARG5(data, val)       ((data).args[5] = (val))
    92 
    93 #define IPC_GET_IMETHOD(data)  ((data).args[0])
    94 #define IPC_GET_RETVAL(data)   ((data).args[0])
    95 
    96 #define IPC_GET_ARG1(data)  ((data).args[1])
    97 #define IPC_GET_ARG2(data)  ((data).args[2])
    98 #define IPC_GET_ARG3(data)  ((data).args[3])
    99 #define IPC_GET_ARG4(data)  ((data).args[4])
    100 #define IPC_GET_ARG5(data)  ((data).args[5])
    101 
    102 /* Forwarding flags. */
    103 #define IPC_FF_NONE  0
    104 
    105 /**
    106  * The call will be routed as though it was initially sent via the phone used to
    107  * forward it. This feature is intended to support the situation in which the
    108  * forwarded call needs to be handled by the same connection fibril as any other
    109  * calls that were initially sent by the forwarder to the same destination. This
    110  * flag has no imapct on routing replies.
    111  *
    112  */
    113 #define IPC_FF_ROUTE_FROM_ME  (1 << 0)
    114 
    115 /* Data transfer flags. */
    116 #define IPC_XF_NONE  0
    117 
    118 /** Restrict the transfer size if necessary. */
    119 #define IPC_XF_RESTRICT  (1 << 0)
    120 
    121 /** User-defined IPC methods */
    122 #define IPC_FIRST_USER_METHOD  1024
    123 
    124 #ifdef KERNEL
    125 
    126 #define IPC_MAX_PHONES  32
    127 
    12838#include <synch/spinlock.h>
    12939#include <synch/mutex.h>
    13040#include <synch/waitq.h>
     41#include <abi/ipc/ipc.h>
     42#include <abi/proc/task.h>
     43#include <typedefs.h>
     44
     45#define IPC_MAX_PHONES  64
    13146
    13247struct answerbox;
     
    16681       
    16782        /** Phones connected to this answerbox. */
    168         link_t connected_phones;
     83        list_t connected_phones;
    16984        /** Received calls. */
    170         link_t calls;
    171         link_t dispatched_calls;  /* Should be hash table in the future */
     85        list_t calls;
     86        list_t dispatched_calls;  /* Should be hash table in the future */
    17287       
    17388        /** Answered calls. */
    174         link_t answers;
     89        list_t answers;
    17590       
    17691        IRQ_SPINLOCK_DECLARE(irq_lock);
    17792       
    17893        /** Notifications from IRQ handlers. */
    179         link_t irq_notifs;
     94        list_t irq_notifs;
    18095        /** IRQs with notifications to this answerbox. */
    181         link_t irq_head;
     96        list_t irq_list;
    18297} answerbox_t;
    18398
    18499typedef struct {
    185100        sysarg_t args[IPC_CALL_LEN];
    186         /** Task which made or forwarded the call with IPC_FF_ROUTE_FROM_ME. */
    187         struct task *task;
     101        /**
     102         * Task which made or forwarded the call with IPC_FF_ROUTE_FROM_ME,
     103         * or the task which answered the call.
     104         */
     105        task_id_t task_id;
    188106        /** Phone which made or last masqueraded this call. */
    189107        phone_t *phone;
     
    243161extern void ipc_backsend_err(phone_t *, call_t *, sysarg_t);
    244162extern void ipc_answerbox_slam_phones(answerbox_t *, bool);
    245 extern void ipc_cleanup_call_list(link_t *);
     163extern void ipc_cleanup_call_list(list_t *);
    246164
    247165extern void ipc_print_task(task_id_t);
    248 
    249 #endif /* KERNEL */
    250166
    251167#endif
  • kernel/generic/include/lib/elf.h

    rd2c67e7 r8ff0bd2  
    3636#define KERN_ELF_H_
    3737
     38#include <typedefs.h>
     39#include <abi/elf.h>
    3840#include <arch/elf.h>
    39 #include <typedefs.h>
    40 
    41 /**
    42  * current ELF version
    43  */
    44 #define EV_CURRENT  1
    45 
    46 /**
    47  * ELF types
    48  */
    49 #define ET_NONE    0       /* No type */
    50 #define ET_REL     1       /* Relocatable file */
    51 #define ET_EXEC    2       /* Executable */
    52 #define ET_DYN     3       /* Shared object */
    53 #define ET_CORE    4       /* Core */
    54 #define ET_LOPROC  0xff00  /* Processor specific */
    55 #define ET_HIPROC  0xffff  /* Processor specific */
    56 
    57 /**
    58  * ELF machine types
    59  */
    60 #define EM_NO           0   /* No machine */
    61 #define EM_SPARC        2   /* SPARC */
    62 #define EM_386          3   /* i386 */
    63 #define EM_MIPS         8   /* MIPS RS3000 */
    64 #define EM_MIPS_RS3_LE  10  /* MIPS RS3000 LE */
    65 #define EM_PPC          20  /* PPC32 */
    66 #define EM_PPC64        21  /* PPC64 */
    67 #define EM_ARM          40  /* ARM */
    68 #define EM_SPARCV9      43  /* SPARC64 */
    69 #define EM_IA_64        50  /* IA-64 */
    70 #define EM_X86_64       62  /* AMD64/EMT64 */
    71 
    72 /**
    73  * ELF identification indexes
    74  */
    75 #define EI_MAG0        0
    76 #define EI_MAG1        1
    77 #define EI_MAG2        2
    78 #define EI_MAG3        3
    79 #define EI_CLASS       4   /* File class */
    80 #define EI_DATA        5   /* Data encoding */
    81 #define EI_VERSION     6   /* File version */
    82 #define EI_OSABI       7
    83 #define EI_ABIVERSION  8
    84 #define EI_PAD         9   /* Start of padding bytes */
    85 #define EI_NIDENT      16  /* ELF identification table size */
    86 
    87 /**
    88  * ELF magic number
    89  */
    90 #define ELFMAG0  0x7f
    91 #define ELFMAG1  'E'
    92 #define ELFMAG2  'L'
    93 #define ELFMAG3  'F'
    94 
    95 /**
    96  * ELF file classes
    97  */
    98 #define ELFCLASSNONE  0
    99 #define ELFCLASS32    1
    100 #define ELFCLASS64    2
    101 
    102 /**
    103  * ELF data encoding types
    104  */
    105 #define ELFDATANONE  0
    106 #define ELFDATA2LSB  1  /* Least significant byte first (little endian) */
    107 #define ELFDATA2MSB  2  /* Most signigicant byte first (big endian) */
    108 
    109 /**
    110  * ELF error return codes
    111  */
    112 #define EE_OK             0  /* No error */
    113 #define EE_INVALID        1  /* Invalid ELF image */
    114 #define EE_MEMORY         2  /* Cannot allocate address space */
    115 #define EE_INCOMPATIBLE   3  /* ELF image is not compatible with current architecture */
    116 #define EE_UNSUPPORTED    4  /* Non-supported ELF (e.g. dynamic ELFs) */
    117 #define EE_LOADER         5  /* The image is actually a program loader */
    118 #define EE_IRRECOVERABLE  6
    119 
    120 /**
    121  * ELF section types
    122  */
    123 #define SHT_NULL      0
    124 #define SHT_PROGBITS  1
    125 #define SHT_SYMTAB    2
    126 #define SHT_STRTAB    3
    127 #define SHT_RELA      4
    128 #define SHT_HASH      5
    129 #define SHT_DYNAMIC   6
    130 #define SHT_NOTE      7
    131 #define SHT_NOBITS    8
    132 #define SHT_REL       9
    133 #define SHT_SHLIB     10
    134 #define SHT_DYNSYM    11
    135 #define SHT_LOOS      0x60000000
    136 #define SHT_HIOS      0x6fffffff
    137 #define SHT_LOPROC    0x70000000
    138 #define SHT_HIPROC    0x7fffffff
    139 #define SHT_LOUSER    0x80000000
    140 #define SHT_HIUSER    0xffffffff
    141 
    142 /**
    143  * ELF section flags
    144  */
    145 #define SHF_WRITE      0x1
    146 #define SHF_ALLOC      0x2
    147 #define SHF_EXECINSTR  0x4
    148 #define SHF_TLS        0x400
    149 #define SHF_MASKPROC   0xf0000000
    150 
    151 /**
    152  * Symbol binding
    153  */
    154 #define STB_LOCAL   0
    155 #define STB_GLOBAL  1
    156 #define STB_WEAK    2
    157 #define STB_LOPROC  13
    158 #define STB_HIPROC  15
    159 
    160 /**
    161  * Symbol types
    162  */
    163 #define STT_NOTYPE   0
    164 #define STT_OBJECT   1
    165 #define STT_FUNC     2
    166 #define STT_SECTION  3
    167 #define STT_FILE     4
    168 #define STT_LOPROC   13
    169 #define STT_HIPROC   15
    170 
    171 /**
    172  * Program segment types
    173  */
    174 #define PT_NULL     0
    175 #define PT_LOAD     1
    176 #define PT_DYNAMIC  2
    177 #define PT_INTERP   3
    178 #define PT_NOTE     4
    179 #define PT_SHLIB    5
    180 #define PT_PHDR     6
    181 #define PT_LOPROC   0x70000000
    182 #define PT_HIPROC   0x7fffffff
    183 
    184 /**
    185  * Program segment attributes.
    186  */
    187 #define PF_X  1
    188 #define PF_W  2
    189 #define PF_R  4
    190 
    191 /**
    192  * ELF data types
    193  *
    194  * These types are found to be identical in both 32-bit and 64-bit
    195  * ELF object file specifications. They are the only types used
    196  * in ELF header.
    197  *
    198  */
    199 typedef uint64_t elf_xword;
    200 typedef int64_t elf_sxword;
    201 typedef uint32_t elf_word;
    202 typedef int32_t elf_sword;
    203 typedef uint16_t elf_half;
    204 
    205 /**
    206  * 32-bit ELF data types.
    207  *
    208  * These types are specific for 32-bit format.
    209  *
    210  */
    211 typedef uint32_t elf32_addr;
    212 typedef uint32_t elf32_off;
    213 
    214 /**
    215  * 64-bit ELF data types.
    216  *
    217  * These types are specific for 64-bit format.
    218  *
    219  */
    220 typedef uint64_t elf64_addr;
    221 typedef uint64_t elf64_off;
    222 
    223 /** ELF header */
    224 struct elf32_header {
    225         uint8_t e_ident[EI_NIDENT];
    226         elf_half e_type;
    227         elf_half e_machine;
    228         elf_word e_version;
    229         elf32_addr e_entry;
    230         elf32_off e_phoff;
    231         elf32_off e_shoff;
    232         elf_word e_flags;
    233         elf_half e_ehsize;
    234         elf_half e_phentsize;
    235         elf_half e_phnum;
    236         elf_half e_shentsize;
    237         elf_half e_shnum;
    238         elf_half e_shstrndx;
    239 };
    240 
    241 struct elf64_header {
    242         uint8_t e_ident[EI_NIDENT];
    243         elf_half e_type;
    244         elf_half e_machine;
    245         elf_word e_version;
    246         elf64_addr e_entry;
    247         elf64_off e_phoff;
    248         elf64_off e_shoff;
    249         elf_word e_flags;
    250         elf_half e_ehsize;
    251         elf_half e_phentsize;
    252         elf_half e_phnum;
    253         elf_half e_shentsize;
    254         elf_half e_shnum;
    255         elf_half e_shstrndx;
    256 };
    257 
    258 /**
    259  * ELF segment header.
    260  * Segments headers are also known as program headers.
    261  */
    262 struct elf32_segment_header {
    263         elf_word p_type;
    264         elf32_off p_offset;
    265         elf32_addr p_vaddr;
    266         elf32_addr p_paddr;
    267         elf_word p_filesz;
    268         elf_word p_memsz;
    269         elf_word p_flags;
    270         elf_word p_align;
    271 };
    272 
    273 struct elf64_segment_header {
    274         elf_word p_type;
    275         elf_word p_flags;
    276         elf64_off p_offset;
    277         elf64_addr p_vaddr;
    278         elf64_addr p_paddr;
    279         elf_xword p_filesz;
    280         elf_xword p_memsz;
    281         elf_xword p_align;
    282 };
    283 
    284 /**
    285  * ELF section header
    286  */
    287 struct elf32_section_header {
    288         elf_word sh_name;
    289         elf_word sh_type;
    290         elf_word sh_flags;
    291         elf32_addr sh_addr;
    292         elf32_off sh_offset;
    293         elf_word sh_size;
    294         elf_word sh_link;
    295         elf_word sh_info;
    296         elf_word sh_addralign;
    297         elf_word sh_entsize;
    298 };
    299 
    300 struct elf64_section_header {
    301         elf_word sh_name;
    302         elf_word sh_type;
    303         elf_xword sh_flags;
    304         elf64_addr sh_addr;
    305         elf64_off sh_offset;
    306         elf_xword sh_size;
    307         elf_word sh_link;
    308         elf_word sh_info;
    309         elf_xword sh_addralign;
    310         elf_xword sh_entsize;
    311 };
    312 
    313 /**
    314  * ELF symbol table entry
    315  */
    316 struct elf32_symbol {
    317         elf_word st_name;
    318         elf32_addr st_value;
    319         elf_word st_size;
    320         uint8_t st_info;
    321         uint8_t st_other;
    322         elf_half st_shndx;
    323 };
    324 
    325 struct elf64_symbol {
    326         elf_word st_name;
    327         uint8_t st_info;
    328         uint8_t st_other;
    329         elf_half st_shndx;
    330         elf64_addr st_value;
    331         elf_xword st_size;
    332 };
    333 
    334 #ifdef __32_BITS__
    335 typedef struct elf32_header elf_header_t;
    336 typedef struct elf32_segment_header elf_segment_header_t;
    337 typedef struct elf32_section_header elf_section_header_t;
    338 typedef struct elf32_symbol elf_symbol_t;
    339 #endif
    340 
    341 #ifdef __64_BITS__
    342 typedef struct elf64_header elf_header_t;
    343 typedef struct elf64_segment_header elf_segment_header_t;
    344 typedef struct elf64_section_header elf_section_header_t;
    345 typedef struct elf64_symbol elf_symbol_t;
    346 #endif
    347 
    348 extern const char *elf_error(unsigned int rc);
    34941
    35042/** Interpreter string used to recognize the program loader */
  • kernel/generic/include/mm/as.h

    rd2c67e7 r8ff0bd2  
    3636#define KERN_AS_H_
    3737
    38 #ifdef KERNEL
    39         #include <typedefs.h>
    40 #else
    41         #include <sys/types.h>
    42 #endif
    43 
    44 /** Address space area flags. */
    45 #define AS_AREA_READ       1
    46 #define AS_AREA_WRITE      2
    47 #define AS_AREA_EXEC       4
    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         unsigned int flags;
    60 } as_area_info_t;
    61 
    62 #ifdef KERNEL
    63 
     38#include <typedefs.h>
     39#include <abi/mm/as.h>
    6440#include <arch/mm/page.h>
    6541#include <arch/mm/as.h>
    6642#include <arch/mm/asid.h>
     43#include <arch/istate.h>
    6744#include <typedefs.h>
    6845#include <synch/spinlock.h>
     
    254231
    255232extern as_operations_t *as_operations;
    256 extern link_t inactive_as_with_asid_head;
     233extern list_t inactive_as_with_asid_list;
    257234
    258235extern void as_init(void);
     
    306283extern mem_backend_t phys_backend;
    307284
    308 /**
    309  * This flags is passed when running the loader, otherwise elf_load()
    310  * would return with a EE_LOADER error code.
    311  *
    312  */
    313 #define ELD_F_NONE    0
    314 #define ELD_F_LOADER  1
    315 
    316 extern unsigned int elf_load(elf_header_t *, as_t *, unsigned int);
    317 
    318285/* Address space area related syscalls. */
    319286extern sysarg_t sys_as_area_create(uintptr_t, size_t, unsigned int);
     
    327294extern void as_print(as_t *);
    328295
    329 #endif /* KERNEL */
    330 
    331296#endif
    332297
  • kernel/generic/include/mm/buddy.h

    rd2c67e7 r8ff0bd2  
    7272        /** Maximal order of block which can be stored by buddy system. */
    7373        uint8_t max_order;
    74         link_t *order;
     74        list_t *order;
    7575        buddy_system_operations_t *op;
    7676        /** Pointer to be used by the implementation. */
  • kernel/generic/include/mm/slab.h

    rd2c67e7 r8ff0bd2  
    111111       
    112112        /* Slabs */
    113         link_t full_slabs;     /**< List of full slabs */
    114         link_t partial_slabs;  /**< List of partial slabs */
     113        list_t full_slabs;     /**< List of full slabs */
     114        list_t partial_slabs;  /**< List of partial slabs */
    115115        SPINLOCK_DECLARE(slablock);
    116116        /* Magazines */
    117         link_t magazines;  /**< List o full magazines */
     117        list_t magazines;  /**< List o full magazines */
    118118        SPINLOCK_DECLARE(maglock);
    119119       
  • kernel/generic/include/panic.h

    rd2c67e7 r8ff0bd2  
    6060struct istate;
    6161
    62 extern bool silent;
     62extern bool console_override;
    6363
    6464extern void panic_common(panic_category_t, struct istate *, int,
  • kernel/generic/include/proc/scheduler.h

    rd2c67e7 r8ff0bd2  
    4848typedef struct {
    4949        IRQ_SPINLOCK_DECLARE(lock);
    50         link_t rq_head;              /**< List of ready threads. */
    51         size_t n;                    /**< Number of threads in rq_ready. */
     50        list_t rq;                      /**< List of ready threads. */
     51        size_t n;                       /**< Number of threads in rq_ready. */
    5252} runq_t;
    5353
  • kernel/generic/include/proc/task.h

    rd2c67e7 r8ff0bd2  
    3838#include <cpu.h>
    3939#include <ipc/ipc.h>
     40#include <ipc/event.h>
     41#include <ipc/kbox.h>
    4042#include <synch/spinlock.h>
    4143#include <synch/mutex.h>
     
    5355#include <proc/scheduler.h>
    5456#include <udebug/udebug.h>
    55 #include <ipc/kbox.h>
    5657#include <mm/as.h>
    57 #include <sysinfo/abi.h>
     58#include <abi/sysinfo.h>
    5859
    5960struct thread;
     
    7374        char name[TASK_NAME_BUFLEN];
    7475        /** List of threads contained in this task. */
    75         link_t th_head;
     76        list_t threads;
    7677        /** Address space. */
    7778        as_t *as;
     
    9394        phone_t phones[IPC_MAX_PHONES];
    9495        stats_ipc_t ipc_info;   /**< IPC statistics */
    95         /** List of synchronous answerboxes. */
    96         link_t sync_box_head;
     96        list_t sync_boxes;      /**< List of synchronous answerboxes. */
     97        event_t events[EVENT_TASK_END - EVENT_END];
    9798       
    9899#ifdef CONFIG_UDEBUG
  • kernel/generic/include/proc/thread.h

    rd2c67e7 r8ff0bd2  
    4545#include <arch/cpu.h>
    4646#include <mm/tlb.h>
    47 #include <proc/uarg.h>
     47#include <abi/proc/uarg.h>
    4848#include <udebug/udebug.h>
    49 #include <sysinfo/abi.h>
     49#include <abi/sysinfo.h>
    5050
    5151#define THREAD_NAME_BUFLEN  20
     
    156156        int fpu_context_engaged;
    157157       
     158        /* The thread will not be migrated if nomigrate is non-zero. */
     159        int nomigrate;
     160       
    158161        /** Thread's state. */
    159162        state_t state;
     
    245248extern bool thread_exists(thread_t *);
    246249
     250extern void thread_migration_disable(void);
     251extern void thread_migration_enable(void);
     252
    247253#ifdef CONFIG_UDEBUG
    248254extern void thread_stack_trace(thread_id_t);
  • kernel/generic/include/synch/condvar.h

    rd2c67e7 r8ff0bd2  
    3939#include <synch/waitq.h>
    4040#include <synch/mutex.h>
    41 #include <synch/synch.h>
     41#include <abi/synch.h>
    4242
    4343typedef struct {
  • kernel/generic/include/synch/mutex.h

    rd2c67e7 r8ff0bd2  
    3838#include <typedefs.h>
    3939#include <synch/semaphore.h>
    40 #include <synch/synch.h>
     40#include <abi/synch.h>
    4141
    4242typedef enum {
  • kernel/generic/include/synch/semaphore.h

    rd2c67e7 r8ff0bd2  
    3838#include <typedefs.h>
    3939#include <synch/waitq.h>
    40 #include <synch/synch.h>
     40#include <abi/synch.h>
    4141
    4242typedef struct {
  • kernel/generic/include/synch/waitq.h

    rd2c67e7 r8ff0bd2  
    3838#include <typedefs.h>
    3939#include <synch/spinlock.h>
    40 #include <synch/synch.h>
     40#include <abi/synch.h>
    4141#include <adt/list.h>
    4242
     
    6363       
    6464        /** List of sleeping threads for which there was no missed_wakeup. */
    65         link_t head;
     65        list_t sleepers;
    6666} waitq_t;
    6767
  • kernel/generic/include/syscall/syscall.h

    rd2c67e7 r8ff0bd2  
    3636#define KERN_SYSCALL_H_
    3737
    38 typedef enum {
    39         SYS_KLOG = 0,
    40         SYS_TLS_SET = 1,  /* Hardcoded for AMD64, IA-32 (fibril.S in uspace) */
    41        
    42         SYS_THREAD_CREATE,
    43         SYS_THREAD_EXIT,
    44         SYS_THREAD_GET_ID,
    45         SYS_THREAD_USLEEP,
    46         SYS_THREAD_UDELAY,
    47        
    48         SYS_TASK_GET_ID,
    49         SYS_TASK_SET_NAME,
    50         SYS_TASK_KILL,
    51         SYS_TASK_EXIT,
    52         SYS_PROGRAM_SPAWN_LOADER,
    53        
    54         SYS_FUTEX_SLEEP,
    55         SYS_FUTEX_WAKEUP,
    56         SYS_SMC_COHERENCE,
    57        
    58         SYS_AS_AREA_CREATE,
    59         SYS_AS_AREA_RESIZE,
    60         SYS_AS_AREA_CHANGE_FLAGS,
    61         SYS_AS_AREA_DESTROY,
    62         SYS_AS_GET_UNMAPPED_AREA,
    63        
    64         SYS_PAGE_FIND_MAPPING,
    65        
    66         SYS_IPC_CALL_SYNC_FAST,
    67         SYS_IPC_CALL_SYNC_SLOW,
    68         SYS_IPC_CALL_ASYNC_FAST,
    69         SYS_IPC_CALL_ASYNC_SLOW,
    70         SYS_IPC_ANSWER_FAST,
    71         SYS_IPC_ANSWER_SLOW,
    72         SYS_IPC_FORWARD_FAST,
    73         SYS_IPC_FORWARD_SLOW,
    74         SYS_IPC_WAIT,
    75         SYS_IPC_POKE,
    76         SYS_IPC_HANGUP,
    77         SYS_IPC_CONNECT_KBOX,
    78        
    79         SYS_EVENT_SUBSCRIBE,
    80         SYS_EVENT_UNMASK,
    81        
    82         SYS_CAP_GRANT,
    83         SYS_CAP_REVOKE,
    84        
    85         SYS_DEVICE_ASSIGN_DEVNO,
    86         SYS_PHYSMEM_MAP,
    87         SYS_IOSPACE_ENABLE,
    88         SYS_REGISTER_IRQ,
    89         SYS_UNREGISTER_IRQ,
    90        
    91         SYS_SYSINFO_GET_TAG,
    92         SYS_SYSINFO_GET_VALUE,
    93         SYS_SYSINFO_GET_DATA_SIZE,
    94         SYS_SYSINFO_GET_DATA,
    95        
    96         SYS_DEBUG_ENABLE_CONSOLE,
    97         SYS_DEBUG_DISABLE_CONSOLE,
    98        
    99         SYSCALL_END
    100 } syscall_t;
    101 
    102 #ifdef KERNEL
    103 
    10438#include <typedefs.h>
     39#include <abi/syscall.h>
    10540
    10641typedef sysarg_t (*syshandler_t)(sysarg_t, sysarg_t, sysarg_t, sysarg_t,
     
    11449#endif
    11550
    116 #endif
    117 
    11851/** @}
    11952 */
  • kernel/generic/include/sysinfo/sysinfo.h

    rd2c67e7 r8ff0bd2  
    3838#include <typedefs.h>
    3939#include <str.h>
     40#include <abi/sysinfo.h>
    4041
    4142/** Framebuffer info exported flags */
    4243extern bool fb_exported;
    43 
    44 /** Item value type
    45  *
    46  */
    47 typedef enum {
    48         SYSINFO_VAL_UNDEFINED = 0,     /**< Undefined value */
    49         SYSINFO_VAL_VAL = 1,           /**< Constant numeric value */
    50         SYSINFO_VAL_DATA = 2,          /**< Constant binary data */
    51         SYSINFO_VAL_FUNCTION_VAL = 3,  /**< Generated numeric value */
    52         SYSINFO_VAL_FUNCTION_DATA = 4  /**< Generated binary data */
    53 } sysinfo_item_val_type_t;
    5444
    5545/** Subtree type
     
    145135extern void sysinfo_dump(sysinfo_item_t *);
    146136
    147 extern sysarg_t sys_sysinfo_get_tag(void *, size_t);
     137extern sysarg_t sys_sysinfo_get_val_type(void *, size_t);
    148138extern sysarg_t sys_sysinfo_get_value(void *, size_t, void *);
    149139extern sysarg_t sys_sysinfo_get_data_size(void *, size_t, void *);
  • kernel/generic/include/typedefs.h

    rd2c67e7 r8ff0bd2  
    3939#include <arch/common.h>
    4040#include <arch/types.h>
     41#include <abi/bool.h>
    4142
    4243#define NULL  ((void *) 0)
     
    6162typedef void (* function)();
    6263
    63 typedef uint8_t bool;
    64 typedef uint64_t thread_id_t;
    65 typedef uint64_t task_id_t;
    6664typedef uint32_t container_id_t;
    6765
  • kernel/generic/include/udebug/udebug.h

    rd2c67e7 r8ff0bd2  
    3636#define KERN_UDEBUG_H_
    3737
    38 #define UDEBUG_EVMASK(event)  (1 << ((event) - 1))
    39 
    40 typedef enum { /* udebug_method_t */
    41        
    42         /** Start debugging the recipient.
    43          *
    44          * Causes all threads in the receiving task to stop. When they
    45          * are all stoped, an answer with retval 0 is generated.
    46          *
    47          */
    48         UDEBUG_M_BEGIN = 1,
    49        
    50         /** Finish debugging the recipient.
    51          *
    52          * Answers all pending GO and GUARD messages.
    53          *
    54          */
    55         UDEBUG_M_END,
    56        
    57         /** Set which events should be captured. */
    58         UDEBUG_M_SET_EVMASK,
    59        
    60         /** Make sure the debugged task is still there.
    61          *
    62          * This message is answered when the debugged task dies
    63          * or the debugging session ends.
    64          *
    65          */
    66         UDEBUG_M_GUARD,
    67        
    68         /** Run a thread until a debugging event occurs.
    69          *
    70          * This message is answered when the thread stops
    71          * in a debugging event.
    72          *
    73          * - ARG2 - id of the thread to run
    74          *
    75          */
    76         UDEBUG_M_GO,
    77        
    78         /** Stop a thread being debugged.
    79          *
    80          * Creates a special STOP event in the thread, causing
    81          * it to answer a pending GO message (if any).
    82          *
    83          */
    84         UDEBUG_M_STOP,
    85        
    86         /** Read arguments of a syscall.
    87          *
    88          * - ARG2 - thread identification
    89          * - ARG3 - destination address in the caller's address space
    90          *
    91          */
    92         UDEBUG_M_ARGS_READ,
    93        
    94         /** Read thread's userspace register state (istate_t).
    95          *
    96          * - ARG2 - thread identification
    97          * - ARG3 - destination address in the caller's address space
    98          *
    99          * or, on error, retval will be
    100          * - ENOENT - thread does not exist
    101          * - EBUSY - register state not available
    102          */
    103         UDEBUG_M_REGS_READ,
    104        
    105         /** Read the list of the debugged tasks's threads.
    106          *
    107          * - ARG2 - destination address in the caller's address space
    108          * - ARG3 - size of receiving buffer in bytes
    109          *
    110          * The kernel fills the buffer with a series of sysarg_t values
    111          * (thread ids). On answer, the kernel will set:
    112          *
    113          * - ARG2 - number of bytes that were actually copied
    114          * - ARG3 - number of bytes of the complete data
    115          *
    116          */
    117         UDEBUG_M_THREAD_READ,
    118        
    119         /** Read the name of the debugged task.
    120          *
    121          * - ARG2 - destination address in the caller's address space
    122          * - ARG3 - size of receiving buffer in bytes
    123          *
    124          * The kernel fills the buffer with a non-terminated string.
    125          *
    126          * - ARG2 - number of bytes that were actually copied
    127          * - ARG3 - number of bytes of the complete data
    128          *
    129          */
    130         UDEBUG_M_NAME_READ,
    131        
    132         /** Read the list of the debugged task's address space areas.
    133          *
    134          * - ARG2 - destination address in the caller's address space
    135          * - ARG3 - size of receiving buffer in bytes
    136          *
    137          * The kernel fills the buffer with a series of as_area_info_t structures.
    138          * Upon answer, the kernel will set:
    139          *
    140          * - ARG2 - number of bytes that were actually copied
    141          * - ARG3 - number of bytes of the complete data
    142          *
    143          */
    144         UDEBUG_M_AREAS_READ,
    145        
    146         /** Read the debugged tasks's memory.
    147          *
    148          * - ARG2 - destination address in the caller's address space
    149          * - ARG3 - source address in the recipient's address space
    150          * - ARG4 - size of receiving buffer in bytes
    151          *
    152          */
    153         UDEBUG_M_MEM_READ
    154 } udebug_method_t;
    155 
    156 typedef enum {
    157         UDEBUG_EVENT_FINISHED = 1,  /**< Debuging session has finished */
    158         UDEBUG_EVENT_STOP,          /**< Stopped on DEBUG_STOP request */
    159         UDEBUG_EVENT_SYSCALL_B,     /**< Before beginning syscall execution */
    160         UDEBUG_EVENT_SYSCALL_E,     /**< After finishing syscall execution */
    161         UDEBUG_EVENT_THREAD_B,      /**< The task created a new thread */
    162         UDEBUG_EVENT_THREAD_E       /**< A thread exited */
    163 } udebug_event_t;
    164 
    165 typedef enum {
    166         UDEBUG_EM_FINISHED = UDEBUG_EVMASK(UDEBUG_EVENT_FINISHED),
    167         UDEBUG_EM_STOP = UDEBUG_EVMASK(UDEBUG_EVENT_STOP),
    168         UDEBUG_EM_SYSCALL_B = UDEBUG_EVMASK(UDEBUG_EVENT_SYSCALL_B),
    169         UDEBUG_EM_SYSCALL_E = UDEBUG_EVMASK(UDEBUG_EVENT_SYSCALL_E),
    170         UDEBUG_EM_THREAD_B = UDEBUG_EVMASK(UDEBUG_EVENT_THREAD_B),
    171         UDEBUG_EM_THREAD_E = UDEBUG_EVMASK(UDEBUG_EVENT_THREAD_E),
    172         UDEBUG_EM_ALL =
    173             (UDEBUG_EVMASK(UDEBUG_EVENT_FINISHED) |
    174             UDEBUG_EVMASK(UDEBUG_EVENT_STOP) |
    175             UDEBUG_EVMASK(UDEBUG_EVENT_SYSCALL_B) |
    176             UDEBUG_EVMASK(UDEBUG_EVENT_SYSCALL_E) |
    177             UDEBUG_EVMASK(UDEBUG_EVENT_THREAD_B) |
    178             UDEBUG_EVMASK(UDEBUG_EVENT_THREAD_E))
    179 } udebug_evmask_t;
    180 
    181 #ifdef KERNEL
    182 
     38#include <abi/udebug.h>
    18339#include <ipc/ipc.h>
    18440#include <synch/mutex.h>
     
    251107#endif
    252108
    253 #endif
    254 
    255109/** @}
    256110 */
Note: See TracChangeset for help on using the changeset viewer.