Changeset c5b6431c in mainline


Ignore:
Timestamp:
2011-03-13T23:26:06Z (13 years ago)
Author:
Vojtech Horky <vojtechhorky@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
6dd35e0, b711f62
Parents:
91579d5
Message:

APIC service running even without APIC

The service is kept running even when there is no APIC found on the host
machine.
This shall prevent problems with blocking connections to this service.

File:
1 edited

Legend:

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

    r91579d5 rc5b6431c  
    5454#define NAME  "apic"
    5555
     56static bool apic_found = false;
     57
    5658static int apic_enable_irq(sysarg_t irq)
    5759{
     
    7981                callid = async_get_call(&call);
    8082               
    81                 switch (IPC_GET_IMETHOD(call)) {
     83                sysarg_t method = IPC_GET_IMETHOD(call);
     84                if (method == IPC_M_PHONE_HUNGUP) {
     85                        return;
     86                }
     87
     88                if (!apic_found) {
     89                        async_answer_0(callid, ENOTSUP);
     90                        break;
     91                }
     92
     93                switch (method) {
    8294                case IRC_ENABLE_INTERRUPT:
    8395                        async_answer_0(callid, apic_enable_irq(IPC_GET_ARG1(call)));
     
    97109 *
    98110 */
    99 static bool apic_init(void)
     111static void apic_init(void)
    100112{
    101113        sysarg_t apic;
    102114       
    103         if ((sysinfo_get_value("apic", &apic) != EOK) || (!apic)) {
    104                 printf(NAME ": No APIC found\n");
    105                 return false;
     115        apic_found = sysinfo_get_value("apic", &apic) && apic;
     116        if (!apic_found) {
     117                printf(NAME ": Warning: no APIC found\n");
    106118        }
    107119       
    108120        async_set_client_connection(apic_connection);
    109121        service_register(SERVICE_APIC);
    110        
    111         return true;
    112122}
    113123
     
    116126        printf(NAME ": HelenOS APIC driver\n");
    117127       
    118         if (!apic_init())
    119                 return -1;
    120        
     128        apic_init();
     129
    121130        printf(NAME ": Accepting connections\n");
    122131        async_manager();
Note: See TracChangeset for help on using the changeset viewer.