Changeset 46b881c in mainline for uspace/srv/hw/char/i8042/i8042.c


Ignore:
Timestamp:
2011-01-29T11:36:41Z (13 years ago)
Author:
Martin Decky <martin@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
0b6931a, 8add9ca5
Parents:
e26a4633 (diff), ffa2c8ef (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:

IPC/async: strictly isolate the use of low-level IPC methods (ipc_*) and async framework methods (async_*) in user code, do not allow a mixture of both in a single source file

Benefits for future plans

  • The async framework could use different communication style under the hood, but keeping the same high-level API
  • The async framework can be integrated more tightly with sessions without potential problems of intermixing session-aware async methods with session-unaware low-level methods in user code
  • The async_serialize_start()/_end() can be deprecated more easily
File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/srv/hw/char/i8042/i8042.c

    re26a4633 r46b881c  
    4040#include <libarch/ddi.h>
    4141#include <devmap.h>
    42 #include <ipc/ipc.h>
    4342#include <async.h>
    4443#include <unistd.h>
     
    199198        i8042_kbd.cmds[0].addr = (void *) &((i8042_t *) i8042_kernel)->status;
    200199        i8042_kbd.cmds[3].addr = (void *) &((i8042_t *) i8042_kernel)->data;
    201         ipc_register_irq(inr_a, device_assign_devno(), 0, &i8042_kbd);
    202         ipc_register_irq(inr_b, device_assign_devno(), 0, &i8042_kbd);
     200        register_irq(inr_a, device_assign_devno(), 0, &i8042_kbd);
     201        register_irq(inr_b, device_assign_devno(), 0, &i8042_kbd);
    203202        printf("%s: registered for interrupts %" PRIun " and %" PRIun "\n",
    204203            NAME, inr_a, inr_b);
     
    236235
    237236        if (dev_id < 0) {
    238                 ipc_answer_0(iid, EINVAL);
     237                async_answer_0(iid, EINVAL);
    239238                return;
    240239        }
    241240
    242241        /* Answer the IPC_M_CONNECT_ME_TO call. */
    243         ipc_answer_0(iid, EOK);
     242        async_answer_0(iid, EOK);
    244243
    245244        printf(NAME ": accepted connection\n");
     
    251250                case IPC_M_PHONE_HUNGUP:
    252251                        /* The other side has hung up. */
    253                         ipc_answer_0(callid, EOK);
     252                        async_answer_0(callid, EOK);
    254253                        return;
    255254                case IPC_M_CONNECT_TO_ME:
     
    272271                        break;
    273272                }
    274                 ipc_answer_0(callid, retval);
     273                async_answer_0(callid, retval);
    275274        }
    276275}
Note: See TracChangeset for help on using the changeset viewer.