Changeset cf2af94 in mainline for uspace/srv/hw


Ignore:
Timestamp:
2011-02-09T11:46:47Z (15 years ago)
Author:
Martin Sucha <sucha14@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
cb15135a
Parents:
a49c4002 (diff), 0b37882 (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

Local modifications:

  • change pipefs and ext2 to build again (use async_* calls instead of ipc_*)
Location:
uspace/srv/hw
Files:
6 added
5 deleted
3 edited
10 moved

Legend:

Unmodified
Added
Removed
  • uspace/srv/hw/bus/cuda_adb/cuda_adb.c

    ra49c4002 rcf2af94  
    162162        rc = devmap_device_register("adb/kbd", &devmap_handle);
    163163        if (rc != EOK) {
    164                 devmap_hangup_phone(DEVMAP_DRIVER);
    165164                printf(NAME ": Unable to register device %s.\n", "adb/kdb");
    166165                return rc;
     
    172171        rc = devmap_device_register("adb/mouse", &devmap_handle);
    173172        if (rc != EOK) {
    174                 devmap_hangup_phone(DEVMAP_DRIVER);
    175173                printf(NAME ": Unable to register device %s.\n", "adb/mouse");
    176174                return rc;
     
    195193        ipc_callid_t callid;
    196194        ipc_call_t call;
    197         ipcarg_t method;
     195        sysarg_t method;
    198196        devmap_handle_t dh;
    199197        int retval;
     
    211209
    212210        if (dev_addr < 0) {
    213                 ipc_answer_0(iid, EINVAL);
     211                async_answer_0(iid, EINVAL);
    214212                return;
    215213        }
    216214
    217215        /* Answer the IPC_M_CONNECT_ME_TO call. */
    218         ipc_answer_0(iid, EOK);
     216        async_answer_0(iid, EOK);
    219217
    220218        while (1) {
    221219                callid = async_get_call(&call);
    222                 method = IPC_GET_METHOD(call);
     220                method = IPC_GET_IMETHOD(call);
    223221                switch (method) {
    224222                case IPC_M_PHONE_HUNGUP:
    225223                        /* The other side has hung up. */
    226                         ipc_answer_0(callid, EOK);
     224                        async_answer_0(callid, EOK);
    227225                        return;
    228226                case IPC_M_CONNECT_TO_ME:
     
    247245                        break;
    248246                }
    249                 ipc_answer_0(callid, retval);
     247                async_answer_0(callid, retval);
    250248        }
    251249}
     
    278276        cuda_irq_code.cmds[0].addr = (void *) &((cuda_t *) instance->cuda_kernel)->ifr;
    279277        async_set_interrupt_received(cuda_irq_handler);
    280         ipc_register_irq(10, device_assign_devno(), 0, &cuda_irq_code);
     278        register_irq(10, device_assign_devno(), 0, &cuda_irq_code);
    281279
    282280        /* Enable SR interrupt. */
  • uspace/srv/hw/char/i8042/i8042.c

    ra49c4002 rcf2af94  
    4040#include <libarch/ddi.h>
    4141#include <devmap.h>
    42 #include <ipc/ipc.h>
    4342#include <async.h>
    4443#include <unistd.h>
     
    148147                rc = devmap_device_register(name, &i8042_port[i].devmap_handle);
    149148                if (rc != EOK) {
    150                         devmap_hangup_phone(DEVMAP_DRIVER);
    151149                        printf(NAME ": Unable to register device %s.\n", name);
    152150                        return rc;
     
    200198        i8042_kbd.cmds[0].addr = (void *) &((i8042_t *) i8042_kernel)->status;
    201199        i8042_kbd.cmds[3].addr = (void *) &((i8042_t *) i8042_kernel)->data;
    202         ipc_register_irq(inr_a, device_assign_devno(), 0, &i8042_kbd);
    203         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);
    204202        printf("%s: registered for interrupts %" PRIun " and %" PRIun "\n",
    205203            NAME, inr_a, inr_b);
     
    219217        ipc_callid_t callid;
    220218        ipc_call_t call;
    221         ipcarg_t method;
     219        sysarg_t method;
    222220        devmap_handle_t dh;
    223221        int retval;
     
    237235
    238236        if (dev_id < 0) {
    239                 ipc_answer_0(iid, EINVAL);
     237                async_answer_0(iid, EINVAL);
    240238                return;
    241239        }
    242240
    243241        /* Answer the IPC_M_CONNECT_ME_TO call. */
    244         ipc_answer_0(iid, EOK);
     242        async_answer_0(iid, EOK);
    245243
    246244        printf(NAME ": accepted connection\n");
     
    248246        while (1) {
    249247                callid = async_get_call(&call);
    250                 method = IPC_GET_METHOD(call);
     248                method = IPC_GET_IMETHOD(call);
    251249                switch (method) {
    252250                case IPC_M_PHONE_HUNGUP:
    253251                        /* The other side has hung up. */
    254                         ipc_answer_0(callid, EOK);
     252                        async_answer_0(callid, EOK);
    255253                        return;
    256254                case IPC_M_CONNECT_TO_ME:
     
    273271                        break;
    274272                }
    275                 ipc_answer_0(callid, retval);
     273                async_answer_0(callid, retval);
    276274        }
    277275}
  • uspace/srv/hw/char/s3c24xx_uart/s3c24xx_uart.c

    ra49c4002 rcf2af94  
    4040#include <libarch/ddi.h>
    4141#include <devmap.h>
    42 #include <ipc/ipc.h>
    4342#include <ipc/char.h>
    4443#include <async.h>
     
    9594        rc = devmap_device_register(NAMESPACE "/" NAME, &uart->devmap_handle);
    9695        if (rc != EOK) {
    97                 devmap_hangup_phone(DEVMAP_DRIVER);
    9896                printf(NAME ": Unable to register device %s.\n",
    9997                    NAMESPACE "/" NAME);
     
    116114        ipc_callid_t callid;
    117115        ipc_call_t call;
    118         ipcarg_t method;
     116        sysarg_t method;
    119117        int retval;
    120118
    121119        /* Answer the IPC_M_CONNECT_ME_TO call. */
    122         ipc_answer_0(iid, EOK);
     120        async_answer_0(iid, EOK);
    123121
    124122        while (1) {
    125123                callid = async_get_call(&call);
    126                 method = IPC_GET_METHOD(call);
     124                method = IPC_GET_IMETHOD(call);
    127125                switch (method) {
    128126                case IPC_M_PHONE_HUNGUP:
    129127                        /* The other side has hung up. */
    130                         ipc_answer_0(callid, EOK);
     128                        async_answer_0(callid, EOK);
    131129                        return;
    132130                case IPC_M_CONNECT_TO_ME:
     
    145143                        break;
    146144                }
    147                 ipc_answer_0(callid, retval);
     145                async_answer_0(callid, retval);
    148146        }
    149147}
     
    192190        async_set_interrupt_received(s3c24xx_uart_irq_handler);
    193191
    194         ipc_register_irq(inr, device_assign_devno(), 0, &uart_irq_code);
     192        register_irq(inr, device_assign_devno(), 0, &uart_irq_code);
    195193
    196194        /* Enable FIFO, Tx trigger level: empty, Rx trigger level: 1 byte. */
  • uspace/srv/hw/irc/apic/apic.c

    ra49c4002 rcf2af94  
    11/*
    2  * Copyright (c) 2006 Ondrej Palkovsky
     2 * Copyright (c) 2011 Martin Decky
    33 * All rights reserved.
    44 *
     
    2727 */
    2828
    29 #include <inttypes.h>
     29/** @addtogroup apic
     30 * @{
     31 */
     32
     33/**
     34 * @file apic.c
     35 * @brief APIC driver.
     36 */
     37
     38#include <ipc/services.h>
     39#include <ipc/irc.h>
     40#include <ipc/ns.h>
     41#include <sysinfo.h>
     42#include <as.h>
     43#include <ddi.h>
     44#include <libarch/ddi.h>
     45#include <align.h>
     46#include <bool.h>
     47#include <errno.h>
     48#include <async.h>
     49#include <align.h>
     50#include <async.h>
    3051#include <stdio.h>
    31 #include <unistd.h>
    32 #include <async.h>
    33 #include <errno.h>
    34 #include "../tester.h"
     52#include <ipc/devmap.h>
    3553
    36 #define MAX_CONNECTIONS  50
     54#define NAME  "apic"
    3755
    38 static int connections[MAX_CONNECTIONS];
     56static int apic_enable_irq(sysarg_t irq)
     57{
     58        // FIXME: TODO
     59        return ENOTSUP;
     60}
    3961
    40 static void client_connection(ipc_callid_t iid, ipc_call_t *icall)
     62/** Handle one connection to APIC.
     63 *
     64 * @param iid   Hash of the request that opened the connection.
     65 * @param icall Call data of the request that opened the connection.
     66 *
     67 */
     68static void apic_connection(ipc_callid_t iid, ipc_call_t *icall)
    4169{
    42         unsigned int i;
     70        ipc_callid_t callid;
     71        ipc_call_t call;
    4372       
    44         TPRINTF("Connected phone %" PRIun " accepting\n", icall->in_phone_hash);
    45         ipc_answer_0(iid, EOK);
    46         for (i = 0; i < MAX_CONNECTIONS; i++) {
    47                 if (!connections[i]) {
    48                         connections[i] = icall->in_phone_hash;
    49                         break;
    50                 }
    51         }
     73        /*
     74         * Answer the first IPC_M_CONNECT_ME_TO call.
     75         */
     76        async_answer_0(iid, EOK);
    5277       
    5378        while (true) {
    54                 ipc_call_t call;
    55                 ipc_callid_t callid = async_get_call(&call);
    56                 int retval;
     79                callid = async_get_call(&call);
    5780               
    58                 switch (IPC_GET_METHOD(call)) {
    59                 case IPC_M_PHONE_HUNGUP:
    60                         TPRINTF("Phone %" PRIun " hung up\n", icall->in_phone_hash);
    61                         retval = 0;
     81                switch (IPC_GET_IMETHOD(call)) {
     82                case IRC_ENABLE_INTERRUPT:
     83                        async_answer_0(callid, apic_enable_irq(IPC_GET_ARG1(call)));
    6284                        break;
    63                 case IPC_TEST_METHOD:
    64                         TPRINTF("Received well known message from %" PRIun ": %" PRIun "\n",
    65                             icall->in_phone_hash, callid);
    66                         ipc_answer_0(callid, EOK);
     85                case IRC_CLEAR_INTERRUPT:
     86                        /* Noop */
     87                        async_answer_0(callid, EOK);
    6788                        break;
    6889                default:
    69                         TPRINTF("Received unknown message from %" PRIun ": %" PRIun "\n",
    70                             icall->in_phone_hash, callid);
    71                         ipc_answer_0(callid, ENOENT);
     90                        async_answer_0(callid, EINVAL);
    7291                        break;
    7392                }
     
    7594}
    7695
    77 const char *test_register(void)
     96/** Initialize the APIC driver.
     97 *
     98 */
     99static bool apic_init(void)
    78100{
    79         async_set_client_connection(client_connection);
     101        sysarg_t apic;
    80102       
    81         ipcarg_t phonead;
    82         int res = ipc_connect_to_me(PHONE_NS, IPC_TEST_SERVICE, 0, 0, &phonead);
    83         if (res != 0)
    84                 return "Failed registering IPC service";
     103        if ((sysinfo_get_value("apic", &apic) != EOK) || (!apic)) {
     104                printf(NAME ": No APIC found\n");
     105                return false;
     106        }
    85107       
    86         TPRINTF("Registered as service %u, accepting connections\n", IPC_TEST_SERVICE);
     108        async_set_client_connection(apic_connection);
     109        service_register(SERVICE_APIC);
     110       
     111        return true;
     112}
     113
     114int main(int argc, char **argv)
     115{
     116        printf(NAME ": HelenOS APIC driver\n");
     117       
     118        if (!apic_init())
     119                return -1;
     120       
     121        printf(NAME ": Accepting connections\n");
    87122        async_manager();
    88123       
    89         return NULL;
     124        /* Never reached */
     125        return 0;
    90126}
     127
     128/**
     129 * @}
     130 */
  • uspace/srv/hw/irc/fhc/fhc.c

    ra49c4002 rcf2af94  
    2929/** @addtogroup fhc
    3030 * @{
    31  */ 
     31 */
    3232
    3333/**
    34  * @file        fhc.c
    35  * @brief       FHC bus controller driver.
     34 * @file fhc.c
     35 * @brief FHC bus controller driver.
    3636 */
    3737
    38 #include <ipc/ipc.h>
    3938#include <ipc/services.h>
    40 #include <ipc/bus.h>
     39#include <ipc/irc.h>
    4140#include <ipc/ns.h>
    4241#include <sysinfo.h>
     
    7675         * Answer the first IPC_M_CONNECT_ME_TO call.
    7776         */
    78         ipc_answer_0(iid, EOK);
     77        async_answer_0(iid, EOK);
    7978
    8079        while (1) {
     
    8281       
    8382                callid = async_get_call(&call);
    84                 switch (IPC_GET_METHOD(call)) {
    85                 case BUS_CLEAR_INTERRUPT:
     83                switch (IPC_GET_IMETHOD(call)) {
     84                case IRC_ENABLE_INTERRUPT:
     85                        /* Noop */
     86                        async_answer_0(callid, EOK);
     87                        break;
     88                case IRC_CLEAR_INTERRUPT:
    8689                        inr = IPC_GET_ARG1(call);
    8790                        switch (inr) {
    8891                        case FHC_UART_INR:
    8992                                fhc_uart_virt[FHC_UART_ICLR] = 0;
    90                                 ipc_answer_0(callid, EOK);
     93                                async_answer_0(callid, EOK);
    9194                                break;
    9295                        default:
    93                                 ipc_answer_0(callid, ENOTSUP);
     96                                async_answer_0(callid, ENOTSUP);
    9497                                break;
    9598                        }
    9699                        break;
    97100                default:
    98                         ipc_answer_0(callid, EINVAL);
     101                        async_answer_0(callid, EINVAL);
    99102                        break;
    100103                }
     
    133136       
    134137        async_set_client_connection(fhc_connection);
    135         ipcarg_t phonead;
    136         ipc_connect_to_me(PHONE_NS, SERVICE_FHC, 0, 0, &phonead);
     138        service_register(SERVICE_FHC);
    137139       
    138140        return true;
  • uspace/srv/hw/irc/obio/obio.c

    ra49c4002 rcf2af94  
    2727 */
    2828
    29 /** @addtogroup obio 
     29/** @addtogroup obio
    3030 * @{
    31  */ 
     31 */
    3232
    3333/**
    34  * @file        obio.c
    35  * @brief       OBIO driver.
     34 * @file obio.c
     35 * @brief OBIO driver.
    3636 *
    3737 * OBIO is a short for on-board I/O. On UltraSPARC IIi and systems with U2P,
     
    4242 */
    4343
    44 #include <ipc/ipc.h>
    4544#include <ipc/services.h>
    46 #include <ipc/bus.h>
     45#include <ipc/irc.h>
    4746#include <ipc/ns.h>
    4847#include <sysinfo.h>
     
    8685         * Answer the first IPC_M_CONNECT_ME_TO call.
    8786         */
    88         ipc_answer_0(iid, EOK);
     87        async_answer_0(iid, EOK);
    8988
    9089        while (1) {
     
    9291       
    9392                callid = async_get_call(&call);
    94                 switch (IPC_GET_METHOD(call)) {
    95                 case BUS_CLEAR_INTERRUPT:
     93                switch (IPC_GET_IMETHOD(call)) {
     94                case IRC_ENABLE_INTERRUPT:
     95                        /* Noop */
     96                        async_answer_0(callid, EOK);
     97                        break;
     98                case IRC_CLEAR_INTERRUPT:
    9699                        inr = IPC_GET_ARG1(call);
    97100                        base_virt[OBIO_CIR(inr & INO_MASK)] = 0;
    98                         ipc_answer_0(callid, EOK);
     101                        async_answer_0(callid, EOK);
    99102                        break;
    100103                default:
    101                         ipc_answer_0(callid, EINVAL);
     104                        async_answer_0(callid, EINVAL);
    102105                        break;
    103106                }
     
    134137       
    135138        async_set_client_connection(obio_connection);
    136         ipcarg_t phonead;
    137         ipc_connect_to_me(PHONE_NS, SERVICE_OBIO, 0, 0, &phonead);
     139        service_register(SERVICE_OBIO);
    138140       
    139141        return true;
  • uspace/srv/hw/netif/ne2000/Makefile

    ra49c4002 rcf2af94  
    3939-include $(CONFIG_MAKEFILE)
    4040
    41 ifeq ($(CONFIG_NETIF_NIL_BUNDLE),y)
    42         LIBS += $(USPACE_PREFIX)/srv/net/nil/eth/libeth.a
    43 endif
    44 
    45 BINARY = dp8390
     41BINARY = ne2000
    4642
    4743SOURCES = \
    4844        dp8390.c \
    49         dp8390_module.c \
    5045        ne2000.c
    5146
Note: See TracChangeset for help on using the changeset viewer.