Changeset fedac2f in mainline for kernel/generic/include


Ignore:
Timestamp:
2012-09-16T11:27:35Z (13 years ago)
Author:
Maurizio Lombardi <m.lombardi85@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
289fa65
Parents:
8930624 (diff), 00b4a68 (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:
2 added
5 edited

Legend:

Unmodified
Added
Removed
  • kernel/generic/include/config.h

    r8930624 rfedac2f  
    4747#define CONFIG_INIT_TASKS        32
    4848#define CONFIG_TASK_NAME_BUFLEN  32
     49#define CONFIG_TASK_ARGUMENTS_BUFLEN 64
     50
     51/**
     52 * Maximum buffer size allowed for IPC_M_DATA_WRITE and IPC_M_DATA_READ
     53 * requests.
     54 */
     55#define DATA_XFER_LIMIT  (64 * 1024)
    4956
    5057#ifndef __ASM__
     
    5663        size_t size;
    5764        char name[CONFIG_TASK_NAME_BUFLEN];
     65        char arguments[CONFIG_TASK_ARGUMENTS_BUFLEN];
    5866} init_task_t;
    5967
  • kernel/generic/include/ipc/ipc.h

    r8930624 rfedac2f  
    6565        mutex_t lock;
    6666        link_t link;
     67        struct task *caller;
    6768        struct answerbox *callee;
    6869        ipc_phone_state_t state;
     
    7273typedef struct answerbox {
    7374        IRQ_SPINLOCK_DECLARE(lock);
     75
     76        /** Answerbox is active until it enters cleanup. */
     77        bool active;
    7478       
    7579        struct task *task;
     
    106110
    107111typedef struct {
    108         link_t link;
     112        /**
     113         * Task link.
     114         * Valid only when the call is not forgotten.
     115         * Protected by the task's active_calls_lock.
     116         */
     117        link_t ta_link;
     118
     119        atomic_t refcnt;
     120
     121        /** Answerbox link. */
     122        link_t ab_link;
    109123       
    110124        unsigned int flags;
     125
     126        /** Protects the forget member. */
     127        SPINLOCK_DECLARE(forget_lock);
     128
     129        /**
     130         * True if the caller 'forgot' this call and donated it to the callee.
     131         * Forgotten calls are discarded upon answering (the answer is not
     132         * delivered) and answered calls cannot be forgotten. Forgotten calls
     133         * also do not figure on the task's active call list.
     134         *
     135         * We keep this separate from the flags so that it is not necessary
     136         * to take a lock when accessing them.
     137         */
     138        bool forget;
     139
     140        /** True if the call is in the active list. */
     141        bool active;
    111142       
    112         /** Identification of the caller. */
     143        /**
     144         * Identification of the caller.
     145         * Valid only when the call is not forgotten.
     146         */
    113147        struct task *sender;
     148       
     149        /** Phone which was used to send the call. */
     150        phone_t *caller_phone;
    114151       
    115152        /** Private data to internal IPC. */
     
    118155        /** Data passed from/to userspace. */
    119156        ipc_data_t data;
    120        
     157
     158        /** Method as it was sent in the request. */
     159        sysarg_t request_method;
     160
    121161        /** Buffer for IPC_M_DATA_WRITE and IPC_M_DATA_READ. */
    122162        uint8_t *buffer;
    123        
    124         /*
    125          * The forward operation can masquerade the caller phone. For those
    126          * cases, we must keep it aside so that the answer is processed
    127          * correctly.
    128          */
    129         phone_t *caller_phone;
    130163} call_t;
    131164
     
    136169extern call_t *ipc_call_alloc(unsigned int);
    137170extern void ipc_call_free(call_t *);
     171extern void ipc_call_hold(call_t *);
     172extern void ipc_call_release(call_t *);
    138173
    139174extern int ipc_call(phone_t *, call_t *);
     
    141176extern int ipc_forward(call_t *, phone_t *, answerbox_t *, unsigned int);
    142177extern void ipc_answer(answerbox_t *, call_t *);
     178extern void _ipc_answer_free_call(call_t *, bool);
    143179
    144 extern void ipc_phone_init(phone_t *);
    145 extern void ipc_phone_connect(phone_t *, answerbox_t *);
     180extern void ipc_phone_init(phone_t *, struct task *);
     181extern bool ipc_phone_connect(phone_t *, answerbox_t *);
    146182extern int ipc_phone_hangup(phone_t *);
    147183
     
    151187extern void ipc_backsend_err(phone_t *, call_t *, sysarg_t);
    152188extern void ipc_answerbox_slam_phones(answerbox_t *, bool);
    153 extern void ipc_cleanup_call_list(list_t *);
     189extern void ipc_cleanup_call_list(answerbox_t *, list_t *);
    154190
    155191extern void ipc_print_task(task_id_t);
  • kernel/generic/include/ipc/ipcrsc.h

    r8930624 rfedac2f  
    4040
    4141extern call_t *get_call(sysarg_t);
     42extern int phone_get(sysarg_t, phone_t **);
    4243extern int phone_alloc(task_t *);
    43 extern void phone_connect(int, answerbox_t *);
     44extern bool phone_connect(int, answerbox_t *);
    4445extern void phone_dealloc(int);
    4546
  • kernel/generic/include/lib/elf_load.h

    r8930624 rfedac2f  
    4242 * ELF error return codes
    4343 */
    44 #define EE_OK                   0       /* No error */
    45 #define EE_INVALID              1       /* Invalid ELF image */
    46 #define EE_MEMORY               2       /* Cannot allocate address space */
    47 #define EE_INCOMPATIBLE         3       /* ELF image is not compatible with current architecture */
    48 #define EE_UNSUPPORTED          4       /* Non-supported ELF (e.g. dynamic ELFs) */
    49 #define EE_LOADER               5       /* The image is actually a program loader. */
    50 #define EE_IRRECOVERABLE        6
     44#define EE_OK             0  /* No error */
     45#define EE_INVALID        1  /* Invalid ELF image */
     46#define EE_MEMORY         2  /* Cannot allocate address space */
     47#define EE_INCOMPATIBLE   3  /* ELF image is not compatible with current architecture */
     48#define EE_UNSUPPORTED    4  /* Non-supported ELF (e.g. dynamic ELFs) */
     49#define EE_LOADER         5  /* The image is actually a program loader. */
     50#define EE_IRRECOVERABLE  6  /* Irrecoverable error. */
    5151
    5252/**
    5353 * This flags is passed when running the loader, otherwise elf_load()
    5454 * would return with a EE_LOADER error code.
    55  *
    5655 */
    5756#define ELD_F_NONE    0
  • kernel/generic/include/proc/task.h

    r8930624 rfedac2f  
    9191       
    9292        /* IPC stuff */
    93         answerbox_t answerbox;  /**< Communication endpoint */
     93
     94        /** Receiving communication endpoint */
     95        answerbox_t answerbox;
     96
     97        /** Sending communication endpoints */
    9498        phone_t phones[IPC_MAX_PHONES];
    95         stats_ipc_t ipc_info;   /**< IPC statistics */
     99
     100        /** Spinlock protecting the active_calls list. */
     101        SPINLOCK_DECLARE(active_calls_lock);
     102
     103        /**
     104         * List of all calls sent by this task that have not yet been
     105         * answered.
     106         */
     107        list_t active_calls;
     108
    96109        event_t events[EVENT_TASK_END - EVENT_END];
     110
     111        /** IPC statistics */
     112        stats_ipc_t ipc_info;
    97113       
    98114#ifdef CONFIG_UDEBUG
Note: See TracChangeset for help on using the changeset viewer.