Changeset ebc9c2c in mainline


Ignore:
Timestamp:
2014-07-18T09:05:46Z (10 years ago)
Author:
Jiri Svoboda <jiri@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
350274a
Parents:
e5424e9
Message:

Other clients should also use the IRC client stub.

Location:
uspace/drv
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • uspace/drv/block/ahci/ahci.c

    re5424e9 rebc9c2c  
    3838#include <device/hw_res_parsed.h>
    3939#include <pci_dev_iface.h>
    40 #include <sysinfo.h>
    41 #include <ipc/irc.h>
    42 #include <ns.h>
     40#include <irc.h>
    4341#include <ahci_iface.h>
    4442#include "ahci.h"
     
    129127
    130128static void ahci_get_model_name(uint16_t *, char *);
    131 static int ahci_enable_interrupt(int);
    132129
    133130static fibril_mutex_t sata_devices_count_lock;
     
    11951192        }
    11961193       
    1197         rc = ahci_enable_interrupt(hw_res_parsed.irqs.irqs[0]);
     1194        rc = irc_enable_interrupt(hw_res_parsed.irqs.irqs[0]);
    11981195        if (rc != EOK) {
    11991196                ddf_msg(LVL_ERROR, "Failed enable interupt.");
     
    13151312}
    13161313
    1317 /** Enable interrupt using SERVICE_IRC.
    1318  *
    1319  * @param irq Requested irq number.
    1320  *
    1321  * @return EOK if succeed, error code otherwise.
    1322  *
    1323  */
    1324 static int ahci_enable_interrupt(int irq)
    1325 {
    1326         async_sess_t *irc_sess = NULL;
    1327         irc_sess = service_connect_blocking(EXCHANGE_SERIALIZE, SERVICE_IRC, 0, 0);
    1328         if (!irc_sess)
    1329                 return EINTR;
    1330        
    1331         async_exch_t *exch = async_exchange_begin(irc_sess);
    1332         const int rc = async_req_1_0(exch, IRC_ENABLE_INTERRUPT, irq);
    1333         async_exchange_end(exch);
    1334        
    1335         async_hangup(irc_sess);
    1336         return rc;
    1337 }
    1338 
    13391314/*----------------------------------------------------------------------------*/
    13401315/*-- AHCI Main routine -------------------------------------------------------*/
  • uspace/drv/bus/isa/isa.c

    re5424e9 rebc9c2c  
    5454#include <ipc/irc.h>
    5555#include <ipc/services.h>
    56 #include <sysinfo.h>
    57 #include <ns.h>
    5856#include <sys/stat.h>
    59 #include <ipc/irc.h>
    60 #include <ipc/services.h>
    61 #include <sysinfo.h>
     57#include <irc.h>
    6258#include <ns.h>
    6359
     
    120116        assert(fun);
    121117
    122         sysarg_t apic;
    123         sysarg_t i8259;
    124 
    125         async_sess_t *irc_sess = NULL;
    126 
    127         if (((sysinfo_get_value("apic", &apic) == EOK) && (apic))
    128             || ((sysinfo_get_value("i8259", &i8259) == EOK) && (i8259))) {
    129                 irc_sess = service_connect_blocking(EXCHANGE_SERIALIZE,
    130                     SERVICE_IRC, 0, 0);
    131         }
    132 
    133         if (!irc_sess)
    134                 return false;
    135 
    136118        const hw_resource_list_t *res = &fun->hw_resources;
    137119        assert(res);
    138120        for (size_t i = 0; i < res->count; ++i) {
    139121                if (res->resources[i].type == INTERRUPT) {
    140                         const int irq = res->resources[i].res.interrupt.irq;
    141 
    142                         async_exch_t *exch = async_exchange_begin(irc_sess);
    143                         const int rc =
    144                             async_req_1_0(exch, IRC_ENABLE_INTERRUPT, irq);
    145                         async_exchange_end(exch);
    146 
    147                         if (rc != EOK) {
    148                                 async_hangup(irc_sess);
     122                        int rc = irc_enable_interrupt(
     123                            res->resources[i].res.interrupt.irq);
     124
     125                        if (rc != EOK)
    149126                                return false;
    150                         }
    151                 }
    152         }
    153 
    154         async_hangup(irc_sess);
     127                }
     128        }
     129
    155130        return true;
    156131}
  • uspace/drv/bus/pci/pciintel/pci.c

    re5424e9 rebc9c2c  
    5151#include <ddf/log.h>
    5252#include <ipc/dev_iface.h>
    53 #include <ipc/irc.h>
    54 #include <ns.h>
    55 #include <ipc/services.h>
    56 #include <sysinfo.h>
     53#include <irc.h>
    5754#include <ops/hw_res.h>
    5855#include <device/hw_res.h>
     
    107104        pci_fun_t *dev_data = pci_fun(fnode);
    108105       
    109         sysarg_t apic;
    110         sysarg_t i8259;
    111        
    112         async_sess_t *irc_sess = NULL;
    113        
    114         if (((sysinfo_get_value("apic", &apic) == EOK) && (apic))
    115             || ((sysinfo_get_value("i8259", &i8259) == EOK) && (i8259))) {
    116                 irc_sess = service_connect_blocking(EXCHANGE_SERIALIZE,
    117                     SERVICE_IRC, 0, 0);
    118         }
    119        
    120         if (!irc_sess)
    121                 return false;
    122        
    123106        size_t i = 0;
    124107        hw_resource_list_t *res = &dev_data->hw_resources;
    125108        for (; i < res->count; i++) {
    126109                if (res->resources[i].type == INTERRUPT) {
    127                         const int irq = res->resources[i].res.interrupt.irq;
    128                        
    129                         async_exch_t *exch = async_exchange_begin(irc_sess);
    130                         const int rc =
    131                             async_req_1_0(exch, IRC_ENABLE_INTERRUPT, irq);
    132                         async_exchange_end(exch);
    133                        
    134                         if (rc != EOK) {
    135                                 async_hangup(irc_sess);
     110                        int rc = irc_enable_interrupt(
     111                            res->resources[i].res.interrupt.irq);
     112                       
     113                        if (rc != EOK)
    136114                                return false;
    137                         }
    138115                }
    139116        }
    140117       
    141         async_hangup(irc_sess);
    142118        return true;
    143119}
  • uspace/drv/char/ns8250/ns8250.c

    re5424e9 rebc9c2c  
    5757#include <ops/char_dev.h>
    5858
    59 #include <ns.h>
    60 #include <ipc/services.h>
    61 #include <ipc/irc.h>
     59#include <irc.h>
    6260#include <device/hw_res.h>
    6361#include <ipc/serial_ctl.h>
     
    488486static int ns8250_interrupt_enable(ns8250_t *ns)
    489487{
    490         /*
    491          * Enable interrupt using IRC service.
    492          * TODO: This is a temporary solution until the device framework
    493          * takes care of this itself.
    494          */
    495         async_sess_t *irc_sess = service_connect_blocking(EXCHANGE_SERIALIZE,
    496             SERVICE_IRC, 0, 0);
    497         if (!irc_sess) {
     488        /* Enable interrupt using IRC service. */
     489        int rc = irc_enable_interrupt(ns->irq);
     490        if (rc != EOK)
    498491                return EIO;
    499         }
    500 
    501         async_exch_t *exch = async_exchange_begin(irc_sess);
    502         if (!exch) {
    503                 return EIO;
    504         }
    505         async_msg_1(exch, IRC_ENABLE_INTERRUPT, ns->irq);
    506         async_exchange_end(exch);
    507 
     492       
    508493        /* Read LSR to clear possible previous LSR interrupt */
    509494        pio_read_8(&ns->regs->lsr);
    510 
     495       
    511496        /* Enable interrupt on the serial port. */
    512497        ns8250_port_interrupts_enable(ns->regs);
Note: See TracChangeset for help on using the changeset viewer.