Changeset 7f1c620 in mainline for generic/src/ipc


Ignore:
Timestamp:
2006-07-04T17:17:56Z (20 years ago)
Author:
Jakub Jermar <jakub@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
0ffa3ef5
Parents:
991779c5
Message:

Replace old u?? types with respective C99 variants (e.g. uint32_t, int64_t, uintptr_t etc.).

Location:
generic/src/ipc
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • generic/src/ipc/ipc.c

    r991779c5 r7f1c620  
    6262static void _ipc_call_init(call_t *call)
    6363{
    64         memsetb((__address)call, sizeof(*call), 0);
     64        memsetb((uintptr_t)call, sizeof(*call), 0);
    6565        call->callerbox = &TASK->answerbox;
    6666        call->sender = TASK;
     
    186186 * message and sending it as a normal answer.
    187187 */
    188 void ipc_backsend_err(phone_t *phone, call_t *call, __native err)
     188void ipc_backsend_err(phone_t *phone, call_t *call, unative_t err)
    189189{
    190190        call->data.phone = phone;
     
    309309 * - to distinguish between call and answer, look at call->flags
    310310 */
    311 call_t * ipc_wait_for_call(answerbox_t *box, __u32 usec, int flags)
     311call_t * ipc_wait_for_call(answerbox_t *box, uint32_t usec, int flags)
    312312{
    313313        call_t *request;
  • generic/src/ipc/ipcrsc.c

    r991779c5 r7f1c620  
    139139 * @return NULL on not found, otherwise pointer to call structure
    140140 */
    141 call_t * get_call(__native callid)
     141call_t * get_call(unative_t callid)
    142142{
    143143        link_t *lst;
     
    148148             lst != &TASK->answerbox.dispatched_calls; lst = lst->next) {
    149149                call = list_get_instance(lst, call_t, link);
    150                 if ((__native)call == callid) {
     150                if ((unative_t)call == callid) {
    151151                        result = call;
    152152                        break;
  • generic/src/ipc/irq.c

    r991779c5 r7f1c620  
    7373{
    7474        int i;
    75         __native dstval = 0;
     75        unative_t dstval = 0;
    7676       
    7777        if (!code)
     
    8181                switch (code->cmds[i].cmd) {
    8282                case CMD_MEM_READ_1:
    83                         dstval = *((__u8 *)code->cmds[i].addr);
     83                        dstval = *((uint8_t *)code->cmds[i].addr);
    8484                        break;
    8585                case CMD_MEM_READ_2:
    86                         dstval = *((__u16 *)code->cmds[i].addr);
     86                        dstval = *((uint16_t *)code->cmds[i].addr);
    8787                        break;
    8888                case CMD_MEM_READ_4:
    89                         dstval = *((__u32 *)code->cmds[i].addr);
     89                        dstval = *((uint32_t *)code->cmds[i].addr);
    9090                        break;
    9191                case CMD_MEM_READ_8:
    92                         dstval = *((__u64 *)code->cmds[i].addr);
     92                        dstval = *((uint64_t *)code->cmds[i].addr);
    9393                        break;
    9494                case CMD_MEM_WRITE_1:
    95                         *((__u8 *)code->cmds[i].addr) = code->cmds[i].value;
     95                        *((uint8_t *)code->cmds[i].addr) = code->cmds[i].value;
    9696                        break;
    9797                case CMD_MEM_WRITE_2:
    98                         *((__u16 *)code->cmds[i].addr) = code->cmds[i].value;
     98                        *((uint16_t *)code->cmds[i].addr) = code->cmds[i].value;
    9999                        break;
    100100                case CMD_MEM_WRITE_4:
    101                         *((__u32 *)code->cmds[i].addr) = code->cmds[i].value;
     101                        *((uint32_t *)code->cmds[i].addr) = code->cmds[i].value;
    102102                        break;
    103103                case CMD_MEM_WRITE_8:
    104                         *((__u64 *)code->cmds[i].addr) = code->cmds[i].value;
     104                        *((uint64_t *)code->cmds[i].addr) = code->cmds[i].value;
    105105                        break;
    106106#if defined(ia32) || defined(amd64)
     
    235235 *
    236236 */
    237 void ipc_irq_send_msg(int irq, __native a1, __native a2, __native a3)
     237void ipc_irq_send_msg(int irq, unative_t a1, unative_t a2, unative_t a3)
    238238{
    239239        call_t *call;
  • generic/src/ipc/sysipc.c

    r991779c5 r7f1c620  
    5757
    5858/** Return true if the method is a system method */
    59 static inline int is_system_method(__native method)
     59static inline int is_system_method(unative_t method)
    6060{
    6161        if (method <= IPC_M_LAST_SYSTEM)
     
    6969 *   it is useless
    7070 */
    71 static inline int is_forwardable(__native method)
     71static inline int is_forwardable(unative_t method)
    7272{
    7373        if (method == IPC_M_PHONE_HUNGUP || method == IPC_M_AS_AREA_SEND \
     
    132132                        phone_connect(phoneid,&answer->sender->answerbox);
    133133                        /* Set 'phone identification' as arg3 of response */
    134                         IPC_SET_ARG3(answer->data, (__native)&TASK->phones[phoneid]);
     134                        IPC_SET_ARG3(answer->data, (unative_t)&TASK->phones[phoneid]);
    135135                }
    136136        } else if (IPC_GET_METHOD(*olddata) == IPC_M_CONNECT_ME_TO) {
     
    192192                        return ELIMIT;
    193193                /* Set arg3 for server */
    194                 IPC_SET_ARG3(call->data, (__native)&TASK->phones[newphid]);
     194                IPC_SET_ARG3(call->data, (unative_t)&TASK->phones[newphid]);
    195195                call->flags |= IPC_CALL_CONN_ME_TO;
    196196                call->private = newphid;
     
    254254           -2 on 'Too many async request, handle answers first
    255255 */
    256 __native sys_ipc_call_sync_fast(__native phoneid, __native method,
    257                                 __native arg1, ipc_data_t *data)
     256unative_t sys_ipc_call_sync_fast(unative_t phoneid, unative_t method,
     257                                unative_t arg1, ipc_data_t *data)
    258258{
    259259        call_t call;
     
    278278
    279279/** Synchronous IPC call allowing to send whole message */
    280 __native sys_ipc_call_sync(__native phoneid, ipc_data_t *question,
     280unative_t sys_ipc_call_sync(unative_t phoneid, ipc_data_t *question,
    281281                           ipc_data_t *reply)
    282282{
     
    289289        rc = copy_from_uspace(&call.data.args, &question->args, sizeof(call.data.args));
    290290        if (rc != 0)
    291                 return (__native) rc;
     291                return (unative_t) rc;
    292292
    293293        GET_CHECK_PHONE(phone, phoneid, return ENOENT);
     
    324324           -2 on 'Too many async request, handle answers first
    325325 */
    326 __native sys_ipc_call_async_fast(__native phoneid, __native method,
    327                                  __native arg1, __native arg2)
     326unative_t sys_ipc_call_async_fast(unative_t phoneid, unative_t method,
     327                                 unative_t arg1, unative_t arg2)
    328328{
    329329        call_t *call;
     
    347347                ipc_backsend_err(phone, call, res);
    348348
    349         return (__native) call;
     349        return (unative_t) call;
    350350}
    351351
     
    354354 * @return The same as sys_ipc_call_async
    355355 */
    356 __native sys_ipc_call_async(__native phoneid, ipc_data_t *data)
     356unative_t sys_ipc_call_async(unative_t phoneid, ipc_data_t *data)
    357357{
    358358        call_t *call;
     
    370370        if (rc != 0) {
    371371                ipc_call_free(call);
    372                 return (__native) rc;
     372                return (unative_t) rc;
    373373        }
    374374        if (!(res=request_preprocess(call)))
     
    377377                ipc_backsend_err(phone, call, res);
    378378
    379         return (__native) call;
     379        return (unative_t) call;
    380380}
    381381
     
    387387 *          arg3 is not rewritten for certain system IPC
    388388 */
    389 __native sys_ipc_forward_fast(__native callid, __native phoneid,
    390                               __native method, __native arg1)
     389unative_t sys_ipc_forward_fast(unative_t callid, unative_t phoneid,
     390                              unative_t method, unative_t arg1)
    391391{
    392392        call_t *call;
     
    429429
    430430/** Send IPC answer */
    431 __native sys_ipc_answer_fast(__native callid, __native retval,
    432                              __native arg1, __native arg2)
     431unative_t sys_ipc_answer_fast(unative_t callid, unative_t retval,
     432                             unative_t arg1, unative_t arg2)
    433433{
    434434        call_t *call;
     
    460460
    461461/** Send IPC answer */
    462 __native sys_ipc_answer(__native callid, ipc_data_t *data)
     462unative_t sys_ipc_answer(unative_t callid, ipc_data_t *data)
    463463{
    464464        call_t *call;
     
    494494 *
    495495 */
    496 __native sys_ipc_hangup(int phoneid)
     496unative_t sys_ipc_hangup(int phoneid)
    497497{
    498498        phone_t *phone;
     
    514514 * @return Callid, if callid & 1, then the call is answer
    515515 */
    516 __native sys_ipc_wait_for_call(ipc_data_t *calldata, __u32 usec, int flags)
     516unative_t sys_ipc_wait_for_call(ipc_data_t *calldata, uint32_t usec, int flags)
    517517{
    518518        call_t *call;
     
    533533                ipc_call_free(call);
    534534               
    535                 return ((__native)call) | IPC_CALLID_NOTIFICATION;
     535                return ((unative_t)call) | IPC_CALLID_NOTIFICATION;
    536536        }
    537537
     
    551551                ipc_call_free(call);
    552552
    553                 return ((__native)call) | IPC_CALLID_ANSWERED;
     553                return ((unative_t)call) | IPC_CALLID_ANSWERED;
    554554        }
    555555
     
    562562                return 0;
    563563        }
    564         return (__native)call;
     564        return (unative_t)call;
    565565}
    566566
    567567/** Connect irq handler to task */
    568 __native sys_ipc_register_irq(int irq, irq_code_t *ucode)
     568unative_t sys_ipc_register_irq(int irq, irq_code_t *ucode)
    569569{
    570570        if (!(cap_get(TASK) & CAP_IRQ_REG))
     
    572572
    573573        if (irq >= IRQ_COUNT || irq <= -IPC_IRQ_RESERVED_VIRTUAL)
    574                 return (__native) ELIMIT;
     574                return (unative_t) ELIMIT;
    575575       
    576576        irq_ipc_bind_arch(irq);
     
    580580
    581581/* Disconnect irq handler from task */
    582 __native sys_ipc_unregister_irq(int irq)
     582unative_t sys_ipc_unregister_irq(int irq)
    583583{
    584584        if (!(cap_get(TASK) & CAP_IRQ_REG))
     
    586586
    587587        if (irq >= IRQ_COUNT || irq <= -IPC_IRQ_RESERVED_VIRTUAL)
    588                 return (__native) ELIMIT;
     588                return (unative_t) ELIMIT;
    589589
    590590        ipc_irq_unregister(&TASK->answerbox, irq);
Note: See TracChangeset for help on using the changeset viewer.