Changeset 48d4231 in mainline for uspace/srv/hw/irc/apic/apic.c


Ignore:
Timestamp:
2011-03-30T19:44:49Z (13 years ago)
Author:
Vojtech Horky <vojtechhorky@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
ecb107b
Parents:
f62468c (diff), 27bdfa5 (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 development/ changes

File:
1 edited

Legend:

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

    rf62468c r48d4231  
    5454#define NAME  "apic"
    5555
    56 static bool apic_found = false;
    57 
    5856static int apic_enable_irq(sysarg_t irq)
    5957{
     
    8179                callid = async_get_call(&call);
    8280               
    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) {
     81                switch (IPC_GET_IMETHOD(call)) {
    9482                case IRC_ENABLE_INTERRUPT:
    9583                        async_answer_0(callid, apic_enable_irq(IPC_GET_ARG1(call)));
     
    10997 *
    11098 */
    111 static void apic_init(void)
     99static bool apic_init(void)
    112100{
    113101        sysarg_t apic;
    114102       
    115         apic_found = sysinfo_get_value("apic", &apic) && apic;
    116         if (!apic_found) {
    117                 printf(NAME ": Warning: no APIC found\n");
     103        if ((sysinfo_get_value("apic", &apic) != EOK) || (!apic)) {
     104                printf(NAME ": No APIC found\n");
     105                return false;
    118106        }
    119107       
    120108        async_set_client_connection(apic_connection);
    121         service_register(SERVICE_APIC);
     109        service_register(SERVICE_IRC);
     110       
     111        return true;
    122112}
    123113
     
    126116        printf(NAME ": HelenOS APIC driver\n");
    127117       
    128         apic_init();
    129 
     118        if (!apic_init())
     119                return -1;
     120       
    130121        printf(NAME ": Accepting connections\n");
    131122        async_manager();
Note: See TracChangeset for help on using the changeset viewer.