Changeset 9a2eb14 in mainline for uspace/srv/hw/irc/obio/obio.c


Ignore:
Timestamp:
2017-10-15T15:04:15Z (7 years ago)
Author:
Jiri Svoboda <jiri@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
1974f56a
Parents:
75911d24
Message:

As a temporary measure, let IRC servers use the location service for DDF-compatible naming. This is needed until all interrupt controller drivers are in DDF and we can switch to DDF-based naming.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/srv/hw/irc/obio/obio.c

    r75911d24 r9a2eb14  
    4242 */
    4343
    44 #include <ipc/services.h>
    4544#include <ipc/irc.h>
    46 #include <ns.h>
     45#include <loc.h>
    4746#include <as.h>
    4847#include <ddi.h>
     
    5554#include <async.h>
    5655#include <stdio.h>
    57 #include <ipc/loc.h>
    5856
    5957#define NAME "obio"
    6058
    61 #define OBIO_SIZE       0x1898 
     59#define OBIO_SIZE       0x1898
    6260
    6361#define OBIO_IMR_BASE   0x200
     
    120118static bool obio_init(void)
    121119{
     120        category_id_t irc_cat;
     121        service_id_t svc_id;
     122        int rc;
     123       
    122124        base_phys = (uintptr_t) 0x1fe00000000ULL;
    123125       
     
    135137       
    136138        async_set_fallback_port_handler(obio_connection, NULL);
    137         service_register(SERVICE_IRC);
     139       
     140        rc = loc_server_register(NAME);
     141        if (rc != EOK) {
     142                printf("%s: Failed registering server. (%d)\n", NAME, rc);
     143                return false;
     144        }
     145       
     146        rc = loc_service_register("irc/" NAME, &svc_id);
     147        if (rc != EOK) {
     148                printf("%s: Failed registering service. (%d)\n", NAME, rc);
     149                return false;
     150        }
     151       
     152        rc = loc_category_get_id("irc", &irc_cat, IPC_FLAG_BLOCKING);
     153        if (rc != EOK) {
     154                printf("%s: Failed resolving category 'iplink' (%d).\n", NAME,
     155                    rc);
     156                return false;
     157        }
     158       
     159        rc = loc_service_add_to_cat(svc_id, irc_cat);
     160        if (rc != EOK) {
     161                printf("%s: Failed adding service to category (%d).\n", NAME,
     162                    rc);
     163                return false;
     164        }
    138165       
    139166        return true;
Note: See TracChangeset for help on using the changeset viewer.