Changes in / [b711f62:92b41f33] in mainline
- Location:
- uspace
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/drv/pciintel/pci.c
rb711f62 r92b41f33 92 92 pci_fun_t *dev_data = (pci_fun_t *) fnode->driver_data; 93 93 94 95 94 sysarg_t apic; 95 sysarg_t i8259; 96 96 97 97 int irc_phone = -1; 98 int irc_service = -1;99 100 101 98 int irc_service = 0; 99 100 if ((sysinfo_get_value("apic", &apic) == EOK) && (apic)) { 101 irc_service = SERVICE_APIC; 102 102 } else if ((sysinfo_get_value("i8259", &i8259) == EOK) && (i8259)) { 103 104 } 105 106 if (irc_service == -1) { 103 irc_service = SERVICE_I8259; 104 } 105 106 if (irc_service == 0) 107 107 return false; 108 }109 108 110 109 irc_phone = service_connect_blocking(irc_service, 0, 0); 111 if (irc_phone < 0) {110 if (irc_phone < 0) 112 111 return false; 113 }114 112 115 113 size_t i; 116 114 for (i = 0; i < dev_data->hw_resources.count; i++) { 117 115 if (dev_data->hw_resources.resources[i].type == INTERRUPT) { 118 116 int irq = dev_data->hw_resources.resources[i].res.interrupt.irq; -
uspace/srv/hw/irc/apic/apic.c
rb711f62 r92b41f33 54 54 #define NAME "apic" 55 55 56 static bool apic_found = false;57 58 56 static int apic_enable_irq(sysarg_t irq) 59 57 { … … 81 79 callid = async_get_call(&call); 82 80 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)) { 94 82 case IRC_ENABLE_INTERRUPT: 95 83 async_answer_0(callid, apic_enable_irq(IPC_GET_ARG1(call))); … … 109 97 * 110 98 */ 111 static voidapic_init(void)99 static bool apic_init(void) 112 100 { 113 101 sysarg_t apic; 114 102 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; 118 106 } 119 107 120 108 async_set_client_connection(apic_connection); 121 109 service_register(SERVICE_APIC); 110 111 return true; 122 112 } 123 113 … … 126 116 printf(NAME ": HelenOS APIC driver\n"); 127 117 128 apic_init(); 129 118 if (!apic_init()) 119 return -1; 120 130 121 printf(NAME ": Accepting connections\n"); 131 122 async_manager();
Note:
See TracChangeset
for help on using the changeset viewer.