Changes in / [f126c87:bdfdc51c] in mainline


Ignore:
Files:
4 deleted
32 edited

Legend:

Unmodified
Added
Removed
  • abi/include/abi/ipc/interfaces.h

    rf126c87 rbdfdc51c  
    8181        INTERFACE_LOADER =
    8282            FOURCC_COMPACT('l', 'o', 'a', 'd') | IFACE_EXCHANGE_SERIALIZE,
    83         INTERFACE_PAGER =
    84             FOURCC_COMPACT('p', 'a', 'g', 'e') | IFACE_EXCHANGE_ATOMIC,
    8583        INTERFACE_LOGGER_WRITER =
    8684            FOURCC_COMPACT('l', 'o', 'g', 'w') | IFACE_EXCHANGE_SERIALIZE,
  • abi/include/abi/ipc/methods.h

    rf126c87 rbdfdc51c  
    5151 */
    5252
    53 enum {
    54         /** This message is sent to answerbox when the phone is hung up
    55          *
    56          * The numerical value zero (0) of this method is important,
    57          * so as the value can be easily tested in conditions.
    58          */
    59         IPC_M_PHONE_HUNGUP = 0,
    60 
    61         /** Clone connection.
    62          *
    63          * The calling task clones one of its phones for the callee.
    64          *
    65          * - ARG1 - The caller sets ARG1 to the phone of the cloned connection.
    66          *        - The callee gets the new phone from ARG1.
    67          *
    68          * - on answer, the callee acknowledges the new connection by sending EOK back
    69          *   or the kernel closes it
    70          */
    71         IPC_M_CONNECTION_CLONE,
    72 
    73         /** Protocol for establishing a cloned connection.
    74          *
    75          * Through this call, the recipient learns about the new cloned connection.
    76          *
    77          * - ARG5 - the kernel sets ARG5 to contain the hash of the used phone
    78          * - on answer, the callee acknowledges the new connection by sending EOK back
    79          *   or the kernel closes it
    80          */
    81         IPC_M_CLONE_ESTABLISH,
    82 
    83         /** Protocol for initializing callback connections.
    84          *
    85          * Calling process asks the callee to create a callback connection,
    86          * so that it can start initiating new messages.
    87          *
    88          * The protocol for negotiating is:
    89          * - sys_connect_to_me - sends a message IPC_M_CONNECT_TO_ME
    90          * - recipient         - upon receipt tries to allocate new phone
    91          *                       - if it fails, responds with ELIMIT
    92          *                     - passes call to userspace. If userspace
    93          *                       responds with error, phone is deallocated and
    94          *                       error is sent back to caller. Otherwise
    95          *                       the call is accepted and the response is sent back.
    96          *                     - the hash of the allocated phone is passed to userspace
    97          *                       (on the receiving side) as ARG5 of the call.
    98          */
    99         IPC_M_CONNECT_TO_ME,
    100 
    101         /** Protocol for initializing new foward connections.
    102          *
    103          * Calling process asks the callee to create for him a new connection.
    104          * E.g. the caller wants a name server to connect him to print server.
    105          *
    106          * The protocol for negotiating is:
    107          * - sys_connect_me_to - send a synchronous message to name server
    108          *                       indicating that it wants to be connected to some
    109          *                       service
    110          *                     - arg1/2/3 are user specified, arg5 contains
    111          *                       address of the phone that should be connected
    112          *                       (TODO: it leaks to userspace)
    113          *  - recipient        - if ipc_answer == 0, then accept connection
    114          *                     - otherwise connection refused
    115          *                     - recepient may forward message.
    116          */
    117         IPC_M_CONNECT_ME_TO,
    118 
    119         /** Share a single page over IPC.
    120          *
    121          * - ARG1 - page-aligned offset from the beginning of the memory object
    122          * - ARG2 - page size
    123          *
    124          * on answer, the recipient must set:
    125          *
    126          * - ARG1 - source user page address
    127          */
    128         IPC_M_PAGE_IN,
    129 
    130         /** Receive as_area over IPC.
    131          *
    132          * - ARG1 - destination as_area size
    133          * - ARG2 - user defined argument
    134          *
    135          * on answer, the recipient must set:
    136          *
    137          * - ARG1 - source as_area base address
    138          * - ARG2 - flags that will be used for sharing
    139          * - ARG3 - dst as_area lower bound
    140          * - ARG4 - dst as_area base address (filled automatically by kernel)
    141          */
    142         IPC_M_SHARE_IN,
    143 
    144         /** Send as_area over IPC.
    145          *
    146          * - ARG1 - source as_area base address
    147          * - ARG2 - size of source as_area (filled automatically by kernel)
    148          * - ARG3 - flags of the as_area being sent
    149          *
    150          * on answer, the recipient must set:
    151          *
    152          * - ARG1 - dst as_area lower bound
    153          * - ARG2 - dst as_area base adress pointer
    154          *          (filled automatically by the kernel)
    155          */
    156         IPC_M_SHARE_OUT,
    157 
    158         /** Receive data from another address space over IPC.
    159          *
    160          * - ARG1 - destination virtual address in the source address space
    161          * - ARG2 - size of data to be received, may be cropped by the recipient
    162          *
    163          * on answer, the recipient must set:
    164          *
    165          * - ARG1 - source virtual address in the destination address space
    166          * - ARG2 - final size of data to be copied
    167          */
    168         IPC_M_DATA_READ,
    169 
    170         /** Send data to another address space over IPC.
    171          *
    172          * - ARG1 - source address space virtual address
    173          * - ARG2 - size of data to be copied, may be overriden by the recipient
    174          *
    175          * on answer, the recipient must set:
    176          *
    177          * - ARG1 - final destination address space virtual address
    178          * - ARG2 - final size of data to be copied
    179          */
    180         IPC_M_DATA_WRITE,
    181 
    182         /** Authorize change of recipient's state in a third party task.
    183          *
    184          * - ARG1 - user protocol defined data
    185          * - ARG2 - user protocol defined data
    186          * - ARG3 - user protocol defined data
    187          * - ARG5 - sender's phone to the third party task
    188          *
    189          * on EOK answer, the recipient must set:
    190          *
    191          * - ARG1 - recipient's phone to the third party task
    192          */
    193         IPC_M_STATE_CHANGE_AUTHORIZE,
    194 
    195         /** Debug the recipient.
    196          *
    197          * - ARG1 - specifies the debug method (from udebug_method_t)
    198          * - other arguments are specific to the debug method
    199          */
    200         IPC_M_DEBUG,
    201 };
     53/** This message is sent to answerbox when the phone is hung up
     54 *
     55 * The numerical value zero (0) of this method is important,
     56 * so as the value can be easily tested in conditions.
     57 *
     58 */
     59#define IPC_M_PHONE_HUNGUP  0
     60
     61/** Clone connection.
     62 *
     63 * The calling task clones one of its phones for the callee.
     64 *
     65 * - ARG1 - The caller sets ARG1 to the phone of the cloned connection.
     66 *        - The callee gets the new phone from ARG1.
     67 *
     68 * - on answer, the callee acknowledges the new connection by sending EOK back
     69 *   or the kernel closes it
     70 *
     71 */
     72#define IPC_M_CONNECTION_CLONE  1
     73
     74/** Protocol for establishing a cloned connection.
     75 *
     76 * Through this call, the recipient learns about the new cloned connection.
     77 *
     78 * - ARG5 - the kernel sets ARG5 to contain the hash of the used phone
     79 * - on answer, the callee acknowledges the new connection by sending EOK back
     80 *   or the kernel closes it
     81 *
     82 */
     83#define IPC_M_CLONE_ESTABLISH  2
     84
     85/** Protocol for initializing callback connections.
     86 *
     87 * Calling process asks the callee to create a callback connection,
     88 * so that it can start initiating new messages.
     89 *
     90 * The protocol for negotiating is:
     91 * - sys_connect_to_me - sends a message IPC_M_CONNECT_TO_ME
     92 * - recipient         - upon receipt tries to allocate new phone
     93 *                       - if it fails, responds with ELIMIT
     94 *                     - passes call to userspace. If userspace
     95 *                       responds with error, phone is deallocated and
     96 *                       error is sent back to caller. Otherwise
     97 *                       the call is accepted and the response is sent back.
     98 *                     - the hash of the allocated phone is passed to userspace
     99 *                       (on the receiving side) as ARG5 of the call.
     100 *
     101 */
     102#define IPC_M_CONNECT_TO_ME  3
     103
     104/** Protocol for initializing new foward connections.
     105 *
     106 * Calling process asks the callee to create for him a new connection.
     107 * E.g. the caller wants a name server to connect him to print server.
     108 *
     109 * The protocol for negotiating is:
     110 * - sys_connect_me_to - send a synchronous message to name server
     111 *                       indicating that it wants to be connected to some
     112 *                       service
     113 *                     - arg1/2/3 are user specified, arg5 contains
     114 *                       address of the phone that should be connected
     115 *                       (TODO: it leaks to userspace)
     116 *  - recipient        -  if ipc_answer == 0, then accept connection
     117 *                     -  otherwise connection refused
     118 *                     -  recepient may forward message.
     119 *
     120 */
     121#define IPC_M_CONNECT_ME_TO  4
     122
     123/** Send as_area over IPC.
     124 * - ARG1 - source as_area base address
     125 * - ARG2 - size of source as_area (filled automatically by kernel)
     126 * - ARG3 - flags of the as_area being sent
     127 *
     128 * on answer, the recipient must set:
     129 *
     130 * - ARG1 - dst as_area lower bound
     131 * - ARG2 - dst as_area base adress pointer
     132 *          (filled automatically by the kernel)
     133 *
     134 */
     135#define IPC_M_SHARE_OUT  5
     136
     137/** Receive as_area over IPC.
     138 * - ARG1 - destination as_area size
     139 * - ARG2 - user defined argument
     140 *
     141 * on answer, the recipient must set:
     142 *
     143 * - ARG1 - source as_area base address
     144 * - ARG2 - flags that will be used for sharing
     145 * - ARG3 - dst as_area lower bound
     146 * - ARG4 - dst as_area base address (filled automatically by kernel)
     147 *
     148 */
     149#define IPC_M_SHARE_IN  6
     150
     151/** Send data to another address space over IPC.
     152 * - ARG1 - source address space virtual address
     153 * - ARG2 - size of data to be copied, may be overriden by the recipient
     154 *
     155 * on answer, the recipient must set:
     156 *
     157 * - ARG1 - final destination address space virtual address
     158 * - ARG2 - final size of data to be copied
     159 *
     160 */
     161#define IPC_M_DATA_WRITE  7
     162
     163/** Receive data from another address space over IPC.
     164 * - ARG1 - destination virtual address in the source address space
     165 * - ARG2 - size of data to be received, may be cropped by the recipient
     166 *
     167 * on answer, the recipient must set:
     168 *
     169 * - ARG1 - source virtual address in the destination address space
     170 * - ARG2 - final size of data to be copied
     171 *
     172 */
     173#define IPC_M_DATA_READ  8
     174
     175/** Authorize change of recipient's state in a third party task.
     176 * - ARG1 - user protocol defined data
     177 * - ARG2 - user protocol defined data
     178 * - ARG3 - user protocol defined data
     179 * - ARG5 - sender's phone to the third party task
     180 *
     181 * on EOK answer, the recipient must set:
     182 *
     183 * - ARG1 - recipient's phone to the third party task
     184 */
     185#define IPC_M_STATE_CHANGE_AUTHORIZE  9
     186
     187/** Debug the recipient.
     188 * - ARG1 - specifies the debug method (from udebug_method_t)
     189 * - other arguments are specific to the debug method
     190 *
     191 */
     192#define IPC_M_DEBUG  10
    202193
    203194/** Last system IPC method */
  • abi/include/abi/mm/as.h

    rf126c87 rbdfdc51c  
    4444#define AS_AREA_LATE_RESERVE 0x20
    4545
    46 #define AS_AREA_ANY    ((void *) -1)
    47 #define AS_MAP_FAILED  ((void *) -1)
    48 
    49 #define AS_AREA_UNPAGED -1
    50 
    5146/** Address space area info exported to uspace. */
    5247typedef struct {
  • kernel/Makefile

    rf126c87 rbdfdc51c  
    237237        generic/src/mm/backend_elf.c \
    238238        generic/src/mm/backend_phys.c \
    239         generic/src/mm/backend_user.c \
    240239        generic/src/mm/slab.c \
    241240        generic/src/lib/func.c \
     
    279278        generic/src/ipc/ops/datawrite.c \
    280279        generic/src/ipc/ops/debug.c \
    281         generic/src/ipc/ops/pagein.c \
    282280        generic/src/ipc/ops/sharein.c \
    283281        generic/src/ipc/ops/shareout.c \
  • kernel/generic/include/ipc/ipc.h

    rf126c87 rbdfdc51c  
    147147        struct task *sender;
    148148       
    149         /*
    150          * Answerbox that will receive the answer.
    151          * This will most of the times be the sender's answerbox,
    152          * but we allow for useful exceptions.
    153          */
    154         answerbox_t *callerbox;
    155 
    156149        /** Phone which was used to send the call. */
    157150        phone_t *caller_phone;
     
    179172extern void ipc_call_release(call_t *);
    180173
    181 extern int ipc_call_sync(phone_t *, call_t *);
    182174extern int ipc_call(phone_t *, call_t *);
    183175extern call_t *ipc_wait_for_call(answerbox_t *, uint32_t, unsigned int);
  • kernel/generic/include/ipc/sysipc.h

    rf126c87 rbdfdc51c  
    4040#include <typedefs.h>
    4141
    42 extern int ipc_req_internal(int, ipc_data_t *);
    43 
    4442extern sysarg_t sys_ipc_call_async_fast(sysarg_t, sysarg_t, sysarg_t,
    4543    sysarg_t, sysarg_t, sysarg_t);
  • kernel/generic/include/mm/as.h

    rf126c87 rbdfdc51c  
    169169/** Backend data stored in address space area. */
    170170typedef union mem_backend_data {
    171         /* anon_backend members */
    172         struct {
    173         };
    174 
    175171        /** elf_backend members */
    176172        struct {
     
    185181                bool anonymous;
    186182        };
    187 
    188         /** user_backend members */
    189         struct {
    190                 int pager;      /**< Phone to the pager. */
    191         };
    192 
    193183} mem_backend_data_t;
    194184
     
    306296extern mem_backend_t elf_backend;
    307297extern mem_backend_t phys_backend;
    308 extern mem_backend_t user_backend;
    309298
    310299/* Address space area related syscalls. */
    311 extern sysarg_t sys_as_area_create(uintptr_t, size_t, unsigned int, uintptr_t,
    312     int);
     300extern sysarg_t sys_as_area_create(uintptr_t, size_t, unsigned int, uintptr_t);
    313301extern sysarg_t sys_as_area_resize(uintptr_t, size_t, unsigned int);
    314302extern sysarg_t sys_as_area_change_flags(uintptr_t, unsigned int);
  • kernel/generic/src/ipc/ipc.c

    rf126c87 rbdfdc51c  
    7777        call->forget = false;
    7878        call->sender = NULL;
    79         call->callerbox = &TASK->answerbox;
    8079        call->buffer = NULL;
    8180}
     
    186185        phone->state = IPC_PHONE_FREE;
    187186        atomic_set(&phone->active_calls, 0);
    188 }
    189 
    190 /** Helper function to facilitate synchronous calls.
    191  *
    192  * @param phone   Destination kernel phone structure.
    193  * @param request Call structure with request.
    194  *
    195  * @return EOK on success or a negative error code.
    196  *
    197  */
    198 int ipc_call_sync(phone_t *phone, call_t *request)
    199 {
    200         answerbox_t *mybox = slab_alloc(ipc_answerbox_slab, 0);
    201         ipc_answerbox_init(mybox, TASK);
    202        
    203         /* We will receive data in a special box. */
    204         request->callerbox = mybox;
    205        
    206         int rc = ipc_call(phone, request);
    207         if (rc != EOK) {
    208                 slab_free(ipc_answerbox_slab, mybox);
    209                 return rc;
    210         }
    211         // TODO: forget the call if interrupted
    212         (void) ipc_wait_for_call(mybox, SYNCH_NO_TIMEOUT, SYNCH_FLAGS_NONE);
    213        
    214         slab_free(ipc_answerbox_slab, mybox);
    215         return EOK;
    216187}
    217188
     
    249220        spinlock_unlock(&call->forget_lock);
    250221
    251         answerbox_t *callerbox = call->callerbox;
     222        answerbox_t *callerbox = &call->sender->answerbox;
    252223        bool do_lock = ((!selflocked) || (callerbox != &TASK->answerbox));
    253224       
     
    784755        ipc_cleanup_call_list(&TASK->answerbox,
    785756            &TASK->answerbox.dispatched_calls);
    786        
     757
    787758        ipc_forget_all_active_calls();
    788759        ipc_wait_for_all_answered_calls();
  • kernel/generic/src/ipc/sysipc.c

    rf126c87 rbdfdc51c  
    106106{
    107107        switch (imethod) {
    108         case IPC_M_PAGE_IN:
    109108        case IPC_M_SHARE_OUT:
    110109        case IPC_M_SHARE_IN:
     
    138137        case IPC_M_CONNECT_TO_ME:
    139138        case IPC_M_CONNECT_ME_TO:
    140         case IPC_M_PAGE_IN:
    141139        case IPC_M_SHARE_OUT:
    142140        case IPC_M_SHARE_IN:
     
    259257{
    260258        return SYSIPC_OP(request_process, call, box);
    261 }
    262 
    263 /** Make a call over IPC and wait for reply.
    264  *
    265  * @param phoneid     Phone handle for the call.
    266  * @param data[inout] Structure with request/reply data.
    267  *
    268  * @return EOK on success.
    269  * @return ENOENT if there is no such phone handle.
    270  *
    271  */
    272 int ipc_req_internal(int phoneid, ipc_data_t *data)
    273 {
    274         phone_t *phone;
    275         if (phone_get(phoneid, &phone) != EOK)
    276                 return ENOENT;
    277        
    278         call_t *call = ipc_call_alloc(0);
    279         memcpy(call->data.args, data->args, sizeof(data->args));
    280        
    281         int rc = request_preprocess(call, phone);
    282         if (!rc) {
    283 #ifdef CONFIG_UDEBUG
    284                 udebug_stoppable_begin();
    285 #endif
    286 
    287                 rc = ipc_call_sync(phone, call);
    288 
    289 #ifdef CONFIG_UDEBUG
    290                 udebug_stoppable_end();
    291 #endif
    292 
    293                 if (rc != EOK)
    294                         return EINTR;
    295 
    296                 process_answer(call);
    297         } else
    298                 IPC_SET_RETVAL(call->data, rc);
    299        
    300         memcpy(data->args, call->data.args, sizeof(data->args));
    301         ipc_call_free(call);
    302        
    303         return EOK;
    304259}
    305260
  • kernel/generic/src/ipc/sysipc_ops.c

    rf126c87 rbdfdc51c  
    4242sysipc_ops_t ipc_m_connect_to_me_ops;
    4343sysipc_ops_t ipc_m_connect_me_to_ops;
    44 sysipc_ops_t ipc_m_page_in_ops;
    4544sysipc_ops_t ipc_m_share_out_ops;
    4645sysipc_ops_t ipc_m_share_in_ops;
     
    5554        [IPC_M_CONNECT_TO_ME] = &ipc_m_connect_to_me_ops,
    5655        [IPC_M_CONNECT_ME_TO] = &ipc_m_connect_me_to_ops,
    57         [IPC_M_PAGE_IN] = &ipc_m_page_in_ops,
    5856        [IPC_M_SHARE_OUT] = &ipc_m_share_out_ops,
    5957        [IPC_M_SHARE_IN] = &ipc_m_share_in_ops,
  • kernel/generic/src/mm/as.c

    rf126c87 rbdfdc51c  
    574574 * @param backend_data NULL or a pointer to custom backend data.
    575575 * @param base         Starting virtual address of the area.
    576  *                     If set to AS_AREA_ANY, a suitable mappable area is
    577  *                     found.
    578  * @param bound        Lowest address bound if base is set to AS_AREA_ANY.
     576 *                     If set to -1, a suitable mappable area is found.
     577 * @param bound        Lowest address bound if base is set to -1.
    579578 *                     Otherwise ignored.
    580579 *
     
    586585    mem_backend_data_t *backend_data, uintptr_t *base, uintptr_t bound)
    587586{
    588         if ((*base != (uintptr_t) AS_AREA_ANY) && !IS_ALIGNED(*base, PAGE_SIZE))
     587        if ((*base != (uintptr_t) -1) && !IS_ALIGNED(*base, PAGE_SIZE))
    589588                return NULL;
    590589       
     
    602601        mutex_lock(&as->lock);
    603602       
    604         if (*base == (uintptr_t) AS_AREA_ANY) {
     603        if (*base == (uintptr_t) -1) {
    605604                *base = as_get_unmapped_area(as, bound, size, guarded);
    606605                if (*base == (uintptr_t) -1) {
     
    21832182
    21842183sysarg_t sys_as_area_create(uintptr_t base, size_t size, unsigned int flags,
    2185     uintptr_t bound, int pager)
     2184    uintptr_t bound)
    21862185{
    21872186        uintptr_t virt = base;
    2188         mem_backend_t *backend;
    2189         mem_backend_data_t backend_data;
    2190 
    2191         if (pager == AS_AREA_UNPAGED)
    2192                 backend = &anon_backend;
    2193         else {
    2194                 backend = &user_backend;
    2195                 backend_data.pager = pager;
    2196         }
    21972187        as_area_t *area = as_area_create(AS, flags, size,
    2198             AS_AREA_ATTR_NONE, backend, &backend_data, &virt, bound);
     2188            AS_AREA_ATTR_NONE, &anon_backend, NULL, &virt, bound);
    21992189        if (area == NULL)
    2200                 return (sysarg_t) AS_MAP_FAILED;
     2190                return (sysarg_t) -1;
    22012191       
    22022192        return (sysarg_t) virt;
  • uspace/app/tester/Makefile

    rf126c87 rbdfdc51c  
    7474        mm/malloc3.c \
    7575        mm/mapping1.c \
    76         mm/pager1.c \
    7776        hw/misc/virtchar1.c \
    7877        hw/serial/serial1.c
  • uspace/app/tester/mm/common.c

    rf126c87 rbdfdc51c  
    341341       
    342342        area->addr = as_area_create(AS_AREA_ANY, size,
    343             AS_AREA_WRITE | AS_AREA_READ | AS_AREA_CACHEABLE,
    344             AS_AREA_UNPAGED);
     343            AS_AREA_WRITE | AS_AREA_READ | AS_AREA_CACHEABLE);
    345344        if (area->addr == AS_MAP_FAILED) {
    346345                free(area);
  • uspace/app/tester/mm/mapping1.c

    rf126c87 rbdfdc51c  
    4343       
    4444        void *result = as_area_create(AS_AREA_ANY, size,
    45             AS_AREA_READ | AS_AREA_WRITE | AS_AREA_CACHEABLE, AS_AREA_UNPAGED);
     45            AS_AREA_READ | AS_AREA_WRITE | AS_AREA_CACHEABLE);
    4646        if (result == AS_MAP_FAILED)
    4747                return NULL;
  • uspace/app/tester/tester.c

    rf126c87 rbdfdc51c  
    7474#include "mm/malloc3.def"
    7575#include "mm/mapping1.def"
    76 #include "mm/pager1.def"
    7776#include "hw/serial/serial1.def"
    7877#include "hw/misc/virtchar1.def"
  • uspace/app/tester/tester.h

    rf126c87 rbdfdc51c  
    107107extern const char *test_malloc3(void);
    108108extern const char *test_mapping1(void);
    109 extern const char *test_pager1(void);
    110109extern const char *test_serial1(void);
    111110extern const char *test_virtchar1(void);
  • uspace/app/trace/syscalls.c

    rf126c87 rbdfdc51c  
    4949    [SYS_FUTEX_WAKEUP] = { "futex_wakeup",              1,      V_ERRNO },
    5050
    51     [SYS_AS_AREA_CREATE] = { "as_area_create",          5,      V_ERRNO },
     51    [SYS_AS_AREA_CREATE] = { "as_area_create",          3,      V_ERRNO },
    5252    [SYS_AS_AREA_RESIZE] = { "as_area_resize",          3,      V_ERRNO },
    5353    [SYS_AS_AREA_DESTROY] = { "as_area_destroy",        1,      V_ERRNO },
  • uspace/lib/c/generic/as.c

    rf126c87 rbdfdc51c  
    5050 * @param size  Size of the area.
    5151 * @param flags Flags describing type of the area.
    52  * @param pager If non-negative, phone to the external pager backing the area.
    53  *              If AS_AREA_UNPAGED (-1), the area is anonymous.
    5452 *
    5553 * @return Starting virtual address of the created area on success.
     
    5755 *
    5856 */
    59 void *as_area_create(void *base, size_t size, unsigned int flags, int pager)
     57void *as_area_create(void *base, size_t size, unsigned int flags)
    6058{
    61         return (void *) __SYSCALL5(SYS_AS_AREA_CREATE, (sysarg_t) base,
    62             (sysarg_t) size, (sysarg_t) flags, (sysarg_t) __entry,
    63             (sysarg_t) pager);
     59        return (void *) __SYSCALL4(SYS_AS_AREA_CREATE, (sysarg_t) base,
     60            (sysarg_t) size, (sysarg_t) flags, (sysarg_t) __entry);
    6461}
    6562
  • uspace/lib/c/generic/async.c

    rf126c87 rbdfdc51c  
    116116#include <stdlib.h>
    117117#include <macros.h>
    118 #include <as.h>
    119118#include "private/libc.h"
    120119
     
    33823381}
    33833382
    3384 void *async_as_area_create(void *base, size_t size, unsigned int flags,
    3385     async_sess_t *pager)
    3386 {
    3387         return as_area_create(base, size, flags, pager->phone);
    3388 }
    3389 
    33903383/** @}
    33913384 */
  • uspace/lib/c/generic/elf/elf_mod.c

    rf126c87 rbdfdc51c  
    370370         */
    371371        a = as_area_create((uint8_t *) base + bias, mem_sz,
    372             AS_AREA_READ | AS_AREA_WRITE | AS_AREA_CACHEABLE,
    373             AS_AREA_UNPAGED);
     372            AS_AREA_READ | AS_AREA_WRITE | AS_AREA_CACHEABLE);
    374373        if (a == AS_MAP_FAILED) {
    375374                DPRINTF("memory mapping failed (%p, %zu)\n",
  • uspace/lib/c/generic/fibril.c

    rf126c87 rbdfdc51c  
    279279        size_t stack_size = (stksz == FIBRIL_DFLT_STK_SIZE) ?
    280280            stack_size_get() : stksz;
    281         fibril->stack = as_area_create(AS_AREA_ANY, stack_size,
     281        fibril->stack = as_area_create((void *) -1, stack_size,
    282282            AS_AREA_READ | AS_AREA_WRITE | AS_AREA_CACHEABLE | AS_AREA_GUARD |
    283             AS_AREA_LATE_RESERVE, AS_AREA_UNPAGED);
     283            AS_AREA_LATE_RESERVE);
    284284        if (fibril->stack == (void *) -1) {
    285285                fibril_teardown(fibril, false);
  • uspace/lib/c/generic/io/chargrid.c

    rf126c87 rbdfdc51c  
    6060        if ((flags & CHARGRID_FLAG_SHARED) == CHARGRID_FLAG_SHARED) {
    6161                scrbuf = (chargrid_t *) as_area_create(AS_AREA_ANY, size,
    62                     AS_AREA_READ | AS_AREA_WRITE | AS_AREA_CACHEABLE,
    63                     AS_AREA_UNPAGED);
     62                    AS_AREA_READ | AS_AREA_WRITE | AS_AREA_CACHEABLE);
    6463                if (scrbuf == AS_MAP_FAILED)
    6564                        return NULL;
  • uspace/lib/c/generic/malloc.c

    rf126c87 rbdfdc51c  
    354354        size_t asize = ALIGN_UP(size, PAGE_SIZE);
    355355        void *astart = as_area_create(AS_AREA_ANY, asize,
    356             AS_AREA_WRITE | AS_AREA_READ | AS_AREA_CACHEABLE, AS_AREA_UNPAGED);
     356            AS_AREA_WRITE | AS_AREA_READ | AS_AREA_CACHEABLE);
    357357        if (astart == AS_MAP_FAILED)
    358358                return false;
  • uspace/lib/c/generic/thread.c

    rf126c87 rbdfdc51c  
    116116        void *stack = as_area_create(AS_AREA_ANY, stack_size,
    117117            AS_AREA_READ | AS_AREA_WRITE | AS_AREA_CACHEABLE | AS_AREA_GUARD |
    118             AS_AREA_LATE_RESERVE, AS_AREA_UNPAGED);
     118            AS_AREA_LATE_RESERVE);
    119119        if (stack == AS_MAP_FAILED) {
    120120                free(uarg);
  • uspace/lib/c/include/as.h

    rf126c87 rbdfdc51c  
    3838#include <sys/types.h>
    3939#include <abi/mm/as.h>
     40#include <task.h>
    4041#include <libarch/config.h>
     42
     43#define AS_AREA_ANY    ((void *) -1)
     44#define AS_MAP_FAILED  ((void *) -1)
    4145
    4246static inline size_t SIZE2PAGES(size_t size)
     
    5357}
    5458
    55 extern void *as_area_create(void *, size_t, unsigned int, int);
     59extern void *as_area_create(void *, size_t, unsigned int);
    5660extern int as_area_resize(void *, size_t, unsigned int);
    5761extern int as_area_change_flags(void *, unsigned int);
  • uspace/lib/c/include/async.h

    rf126c87 rbdfdc51c  
    488488extern void async_remote_state_release_exchange(async_exch_t *);
    489489
    490 extern void *async_as_area_create(void *, size_t, unsigned int, async_sess_t *);
    491 
    492490#endif
    493491
  • uspace/lib/draw/surface.c

    rf126c87 rbdfdc51c  
    6464        if (!pixbuf) {
    6565                if ((flags & SURFACE_FLAG_SHARED) == SURFACE_FLAG_SHARED) {
    66                         pixbuf = (pixel_t *) as_area_create(AS_AREA_ANY,
    67                             pixbuf_size,
    68                             AS_AREA_READ | AS_AREA_WRITE | AS_AREA_CACHEABLE,
    69                             AS_AREA_UNPAGED);
     66                        pixbuf = (pixel_t *) as_area_create(AS_AREA_ANY, pixbuf_size,
     67                            AS_AREA_READ | AS_AREA_WRITE | AS_AREA_CACHEABLE);
    7068                        if (pixbuf == AS_MAP_FAILED) {
    7169                                free(surface);
  • uspace/lib/posix/source/sys/mman.c

    rf126c87 rbdfdc51c  
    5454                return MAP_FAILED;
    5555       
    56         return as_area_create(start, length, prot, AS_AREA_UNPAGED);
     56        return as_area_create(start, length, prot);
    5757}
    5858
  • uspace/srv/hid/compositor/compositor.c

    rf126c87 rbdfdc51c  
    5555#include <async.h>
    5656#include <loc.h>
    57 #include <task.h>
    5857
    5958#include <io/keycode.h>
  • uspace/srv/hid/console/console.c

    rf126c87 rbdfdc51c  
    4949#include <malloc.h>
    5050#include <as.h>
    51 #include <task.h>
    5251#include <fibril_synch.h>
    5352#include "console.h"
  • uspace/srv/hid/output/output.c

    rf126c87 rbdfdc51c  
    3232#include <macros.h>
    3333#include <as.h>
    34 #include <task.h>
    3534#include <ipc/output.h>
    3635#include "port/ega.h"
  • uspace/srv/vfs/vfs.c

    rf126c87 rbdfdc51c  
    3737
    3838#include <vfs/vfs.h>
    39 #include <stdlib.h>
    4039#include <ipc/services.h>
    41 #include <abi/ipc/methods.h>
    42 #include <libarch/config.h>
    4340#include <ns.h>
    4441#include <async.h>
     
    5451#define NAME  "vfs"
    5552
    56 static void vfs_pager(ipc_callid_t iid, ipc_call_t *icall, void *arg)
    57 {
    58         async_answer_0(iid, EOK);
    59 
    60         char *buf = memalign(PAGE_SIZE, 1);
    61         const char hello[] = "Hello world!";
    62 
    63         memcpy(buf, hello, sizeof(hello));
    64 
    65         while (true) {
    66                 ipc_call_t call;
    67                 ipc_callid_t callid = async_get_call(&call);
    68                
    69                 if (!IPC_GET_IMETHOD(call))
    70                         break;
    71                
    72                 switch (IPC_GET_IMETHOD(call)) {
    73                 case IPC_M_PAGE_IN:
    74                         if (buf)
    75                                 async_answer_1(callid, EOK, (sysarg_t) buf);
    76                         else
    77                                 async_answer_0(callid, ENOMEM);
    78                         break;
    79                        
    80                 default:
    81                         async_answer_0(callid, ENOTSUP);
    82                         break;
    83                 }
    84         }
    85 }
    86 
    8753static void vfs_connection(ipc_callid_t iid, ipc_call_t *icall, void *arg)
    8854{
     
    184150int main(int argc, char **argv)
    185151{
    186         int rc;
    187 
    188152        printf("%s: HelenOS VFS server\n", NAME);
    189153       
     
    201165         */
    202166        plb = as_area_create(AS_AREA_ANY, PLB_SIZE,
    203             AS_AREA_READ | AS_AREA_WRITE | AS_AREA_CACHEABLE, AS_AREA_UNPAGED);
     167            AS_AREA_READ | AS_AREA_WRITE | AS_AREA_CACHEABLE);
    204168        if (plb == AS_MAP_FAILED) {
    205169                printf("%s: Cannot create address space area\n", NAME);
     
    215179
    216180        /*
    217          * Create a port for the pager.
    218          */
    219         port_id_t port;
    220         rc = async_create_port(INTERFACE_PAGER, vfs_pager, NULL, &port);
    221         if (rc != EOK)
    222                 return rc;
    223                
    224         /*
    225181         * Set a connection handling function/fibril.
    226182         */
     
    236192         * Register at the naming service.
    237193         */
    238         rc = service_register(SERVICE_VFS);
     194        int rc = service_register(SERVICE_VFS);
    239195        if (rc != EOK) {
    240196                printf("%s: Cannot register VFS service\n", NAME);
Note: See TracChangeset for help on using the changeset viewer.