Changeset c4fb95d3 in mainline for uspace/srv/hw
- Timestamp:
- 2011-02-18T20:04:56Z (14 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- d011038
- Parents:
- 87e373b (diff), 8b1ea2d4 (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. - Location:
- uspace/srv/hw
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/srv/hw/bus/cuda_adb/cuda_adb.c
r87e373b rc4fb95d3 209 209 210 210 if (dev_addr < 0) { 211 ipc_answer_0(iid, EINVAL);211 async_answer_0(iid, EINVAL); 212 212 return; 213 213 } 214 214 215 215 /* Answer the IPC_M_CONNECT_ME_TO call. */ 216 ipc_answer_0(iid, EOK);216 async_answer_0(iid, EOK); 217 217 218 218 while (1) { … … 222 222 case IPC_M_PHONE_HUNGUP: 223 223 /* The other side has hung up. */ 224 ipc_answer_0(callid, EOK);224 async_answer_0(callid, EOK); 225 225 return; 226 226 case IPC_M_CONNECT_TO_ME: … … 245 245 break; 246 246 } 247 ipc_answer_0(callid, retval);247 async_answer_0(callid, retval); 248 248 } 249 249 } … … 276 276 cuda_irq_code.cmds[0].addr = (void *) &((cuda_t *) instance->cuda_kernel)->ifr; 277 277 async_set_interrupt_received(cuda_irq_handler); 278 ipc_register_irq(10, device_assign_devno(), 0, &cuda_irq_code);278 register_irq(10, device_assign_devno(), 0, &cuda_irq_code); 279 279 280 280 /* Enable SR interrupt. */ -
uspace/srv/hw/char/i8042/i8042.c
r87e373b rc4fb95d3 40 40 #include <libarch/ddi.h> 41 41 #include <devmap.h> 42 #include <ipc/ipc.h>43 42 #include <async.h> 44 43 #include <unistd.h> … … 199 198 i8042_kbd.cmds[0].addr = (void *) &((i8042_t *) i8042_kernel)->status; 200 199 i8042_kbd.cmds[3].addr = (void *) &((i8042_t *) i8042_kernel)->data; 201 ipc_register_irq(inr_a, device_assign_devno(), 0, &i8042_kbd);202 ipc_register_irq(inr_b, device_assign_devno(), 0, &i8042_kbd);200 register_irq(inr_a, device_assign_devno(), 0, &i8042_kbd); 201 register_irq(inr_b, device_assign_devno(), 0, &i8042_kbd); 203 202 printf("%s: registered for interrupts %" PRIun " and %" PRIun "\n", 204 203 NAME, inr_a, inr_b); … … 236 235 237 236 if (dev_id < 0) { 238 ipc_answer_0(iid, EINVAL);237 async_answer_0(iid, EINVAL); 239 238 return; 240 239 } 241 240 242 241 /* Answer the IPC_M_CONNECT_ME_TO call. */ 243 ipc_answer_0(iid, EOK);242 async_answer_0(iid, EOK); 244 243 245 244 printf(NAME ": accepted connection\n"); … … 251 250 case IPC_M_PHONE_HUNGUP: 252 251 /* The other side has hung up. */ 253 ipc_answer_0(callid, EOK);252 async_answer_0(callid, EOK); 254 253 return; 255 254 case IPC_M_CONNECT_TO_ME: … … 272 271 break; 273 272 } 274 ipc_answer_0(callid, retval);273 async_answer_0(callid, retval); 275 274 } 276 275 } -
uspace/srv/hw/char/s3c24xx_uart/s3c24xx_uart.c
r87e373b rc4fb95d3 40 40 #include <libarch/ddi.h> 41 41 #include <devmap.h> 42 #include <ipc/ipc.h>43 42 #include <ipc/char.h> 44 43 #include <async.h> … … 119 118 120 119 /* Answer the IPC_M_CONNECT_ME_TO call. */ 121 ipc_answer_0(iid, EOK);120 async_answer_0(iid, EOK); 122 121 123 122 while (1) { … … 127 126 case IPC_M_PHONE_HUNGUP: 128 127 /* The other side has hung up. */ 129 ipc_answer_0(callid, EOK);128 async_answer_0(callid, EOK); 130 129 return; 131 130 case IPC_M_CONNECT_TO_ME: … … 144 143 break; 145 144 } 146 ipc_answer_0(callid, retval);145 async_answer_0(callid, retval); 147 146 } 148 147 } … … 191 190 async_set_interrupt_received(s3c24xx_uart_irq_handler); 192 191 193 ipc_register_irq(inr, device_assign_devno(), 0, &uart_irq_code);192 register_irq(inr, device_assign_devno(), 0, &uart_irq_code); 194 193 195 194 /* Enable FIFO, Tx trigger level: empty, Rx trigger level: 1 byte. */ -
uspace/srv/hw/irc/apic/apic.c
r87e373b rc4fb95d3 36 36 */ 37 37 38 #include <ipc/ipc.h>39 38 #include <ipc/services.h> 40 39 #include <ipc/irc.h> … … 75 74 * Answer the first IPC_M_CONNECT_ME_TO call. 76 75 */ 77 ipc_answer_0(iid, EOK);76 async_answer_0(iid, EOK); 78 77 79 78 while (true) { … … 82 81 switch (IPC_GET_IMETHOD(call)) { 83 82 case IRC_ENABLE_INTERRUPT: 84 ipc_answer_0(callid, apic_enable_irq(IPC_GET_ARG1(call)));83 async_answer_0(callid, apic_enable_irq(IPC_GET_ARG1(call))); 85 84 break; 86 85 case IRC_CLEAR_INTERRUPT: 87 86 /* Noop */ 88 ipc_answer_0(callid, EOK);87 async_answer_0(callid, EOK); 89 88 break; 90 89 default: 91 ipc_answer_0(callid, EINVAL);90 async_answer_0(callid, EINVAL); 92 91 break; 93 92 } … … 108 107 109 108 async_set_client_connection(apic_connection); 110 sysarg_t phonead; 111 ipc_connect_to_me(PHONE_NS, SERVICE_APIC, 0, 0, &phonead); 109 service_register(SERVICE_APIC); 112 110 113 111 return true; -
uspace/srv/hw/irc/fhc/fhc.c
r87e373b rc4fb95d3 29 29 /** @addtogroup fhc 30 30 * @{ 31 */ 31 */ 32 32 33 33 /** 34 * @file 35 * @brief 34 * @file fhc.c 35 * @brief FHC bus controller driver. 36 36 */ 37 37 38 #include <ipc/ipc.h>39 38 #include <ipc/services.h> 40 39 #include <ipc/irc.h> … … 76 75 * Answer the first IPC_M_CONNECT_ME_TO call. 77 76 */ 78 ipc_answer_0(iid, EOK);77 async_answer_0(iid, EOK); 79 78 80 79 while (1) { … … 85 84 case IRC_ENABLE_INTERRUPT: 86 85 /* Noop */ 87 ipc_answer_0(callid, EOK);86 async_answer_0(callid, EOK); 88 87 break; 89 88 case IRC_CLEAR_INTERRUPT: … … 92 91 case FHC_UART_INR: 93 92 fhc_uart_virt[FHC_UART_ICLR] = 0; 94 ipc_answer_0(callid, EOK);93 async_answer_0(callid, EOK); 95 94 break; 96 95 default: 97 ipc_answer_0(callid, ENOTSUP);96 async_answer_0(callid, ENOTSUP); 98 97 break; 99 98 } 100 99 break; 101 100 default: 102 ipc_answer_0(callid, EINVAL);101 async_answer_0(callid, EINVAL); 103 102 break; 104 103 } … … 137 136 138 137 async_set_client_connection(fhc_connection); 139 sysarg_t phonead; 140 ipc_connect_to_me(PHONE_NS, SERVICE_FHC, 0, 0, &phonead); 138 service_register(SERVICE_FHC); 141 139 142 140 return true; -
uspace/srv/hw/irc/i8259/i8259.c
r87e373b rc4fb95d3 36 36 */ 37 37 38 #include <ipc/ipc.h>39 38 #include <ipc/services.h> 40 39 #include <ipc/irc.h> … … 109 108 * Answer the first IPC_M_CONNECT_ME_TO call. 110 109 */ 111 ipc_answer_0(iid, EOK);110 async_answer_0(iid, EOK); 112 111 113 112 while (true) { … … 116 115 switch (IPC_GET_IMETHOD(call)) { 117 116 case IRC_ENABLE_INTERRUPT: 118 ipc_answer_0(callid, pic_enable_irq(IPC_GET_ARG1(call)));117 async_answer_0(callid, pic_enable_irq(IPC_GET_ARG1(call))); 119 118 break; 120 119 case IRC_CLEAR_INTERRUPT: 121 120 /* Noop */ 122 ipc_answer_0(callid, EOK);121 async_answer_0(callid, EOK); 123 122 break; 124 123 default: 125 ipc_answer_0(callid, EINVAL);124 async_answer_0(callid, EINVAL); 126 125 break; 127 126 } … … 150 149 151 150 async_set_client_connection(i8259_connection); 152 sysarg_t phonead; 153 ipc_connect_to_me(PHONE_NS, SERVICE_I8259, 0, 0, &phonead); 151 service_register(SERVICE_I8259); 154 152 155 153 return true; -
uspace/srv/hw/irc/obio/obio.c
r87e373b rc4fb95d3 27 27 */ 28 28 29 /** @addtogroup obio 29 /** @addtogroup obio 30 30 * @{ 31 */ 31 */ 32 32 33 33 /** 34 * @file 35 * @brief 34 * @file obio.c 35 * @brief OBIO driver. 36 36 * 37 37 * OBIO is a short for on-board I/O. On UltraSPARC IIi and systems with U2P, … … 42 42 */ 43 43 44 #include <ipc/ipc.h>45 44 #include <ipc/services.h> 46 45 #include <ipc/irc.h> … … 86 85 * Answer the first IPC_M_CONNECT_ME_TO call. 87 86 */ 88 ipc_answer_0(iid, EOK);87 async_answer_0(iid, EOK); 89 88 90 89 while (1) { … … 95 94 case IRC_ENABLE_INTERRUPT: 96 95 /* Noop */ 97 ipc_answer_0(callid, EOK);96 async_answer_0(callid, EOK); 98 97 break; 99 98 case IRC_CLEAR_INTERRUPT: 100 99 inr = IPC_GET_ARG1(call); 101 100 base_virt[OBIO_CIR(inr & INO_MASK)] = 0; 102 ipc_answer_0(callid, EOK);101 async_answer_0(callid, EOK); 103 102 break; 104 103 default: 105 ipc_answer_0(callid, EINVAL);104 async_answer_0(callid, EINVAL); 106 105 break; 107 106 } … … 138 137 139 138 async_set_client_connection(obio_connection); 140 sysarg_t phonead; 141 ipc_connect_to_me(PHONE_NS, SERVICE_OBIO, 0, 0, &phonead); 139 service_register(SERVICE_OBIO); 142 140 143 141 return true; -
uspace/srv/hw/netif/ne2000/ne2000.c
r87e373b rc4fb95d3 43 43 #include <malloc.h> 44 44 #include <sysinfo.h> 45 #include <ipc/ipc.h>46 45 #include <ipc/services.h> 46 #include <ipc/ns.h> 47 47 #include <ipc/irc.h> 48 48 #include <net/modules.h> … … 316 316 ne2k_cmds[5].addr = ne2k->port + DP_TSR; 317 317 318 int rc = ipc_register_irq(ne2k->irq, device->device_id,318 int rc = register_irq(ne2k->irq, device->device_id, 319 319 device->device_id, &ne2k_code); 320 320 if (rc != EOK) … … 323 323 rc = ne2k_up(ne2k); 324 324 if (rc != EOK) { 325 ipc_unregister_irq(ne2k->irq, device->device_id);325 unregister_irq(ne2k->irq, device->device_id); 326 326 return rc; 327 327 } … … 342 342 343 343 ne2k_down(ne2k); 344 ipc_unregister_irq(ne2k->irq, device->device_id);344 unregister_irq(ne2k->irq, device->device_id); 345 345 change_state(device, NETIF_STOPPED); 346 346 } … … 389 389 390 390 if (irc_service) { 391 while (irc_phone < 0) { 392 irc_phone = ipc_connect_me_to_blocking(PHONE_NS, irc_service, 393 0, 0); 394 } 391 while (irc_phone < 0) 392 irc_phone = service_connect_blocking(irc_service, 0, 0); 395 393 } 396 394 397 395 async_set_interrupt_received(irq_handler); 398 396 399 sysarg_t phonehash; 400 return ipc_connect_to_me(PHONE_NS, SERVICE_NE2000, 0, 0, &phonehash); 397 return async_connect_to_me(PHONE_NS, SERVICE_NE2000, 0, 0, NULL); 401 398 } 402 399
Note:
See TracChangeset
for help on using the changeset viewer.