Changeset cf2af94 in mainline for uspace/srv/hw
- Timestamp:
- 2011-02-09T11:46:47Z (15 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- cb15135a
- Parents:
- a49c4002 (diff), 0b37882 (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:
-
- 6 added
- 5 deleted
- 3 edited
- 10 moved
-
bus/cuda_adb/cuda_adb.c (modified) (6 diffs)
-
char/i8042/i8042.c (modified) (7 diffs)
-
char/s3c24xx_uart/s3c24xx_uart.c (modified) (5 diffs)
-
irc/apic/Makefile (added)
-
irc/apic/apic.c (moved) (moved from uspace/app/tester/ipc/register.c ) (3 diffs)
-
irc/fhc/Makefile (moved) (moved from uspace/srv/hw/cir/fhc/Makefile )
-
irc/fhc/fhc.c (moved) (moved from uspace/srv/hw/cir/fhc/fhc.c ) (4 diffs)
-
irc/i8259/Makefile (added)
-
irc/i8259/i8259.c (added)
-
irc/obio/Makefile (moved) (moved from uspace/srv/hw/cir/obio/Makefile )
-
irc/obio/obio.c (moved) (moved from uspace/srv/hw/cir/obio/obio.c ) (5 diffs)
-
netif/DRIVER_REMOVAL (deleted)
-
netif/dp8390/dp8390.c (deleted)
-
netif/dp8390/dp8390.h (deleted)
-
netif/dp8390/dp8390_module.c (deleted)
-
netif/dp8390/ne2000.c (deleted)
-
netif/ne2000/Makefile (moved) (moved from uspace/srv/hw/netif/dp8390/Makefile ) (1 diff)
-
netif/ne2000/dp8390.c (added)
-
netif/ne2000/dp8390.h (added)
-
netif/ne2000/dp8390_drv.h (moved) (moved from uspace/srv/hw/netif/dp8390/dp8390_drv.h )
-
netif/ne2000/dp8390_port.h (moved) (moved from uspace/srv/hw/netif/dp8390/dp8390_port.h )
-
netif/ne2000/local.h (moved) (moved from uspace/srv/hw/netif/dp8390/local.h )
-
netif/ne2000/ne2000.c (added)
-
netif/ne2000/ne2000.h (moved) (moved from uspace/srv/hw/netif/dp8390/ne2000.h )
Legend:
- Unmodified
- Added
- Removed
-
uspace/srv/hw/bus/cuda_adb/cuda_adb.c
ra49c4002 rcf2af94 162 162 rc = devmap_device_register("adb/kbd", &devmap_handle); 163 163 if (rc != EOK) { 164 devmap_hangup_phone(DEVMAP_DRIVER);165 164 printf(NAME ": Unable to register device %s.\n", "adb/kdb"); 166 165 return rc; … … 172 171 rc = devmap_device_register("adb/mouse", &devmap_handle); 173 172 if (rc != EOK) { 174 devmap_hangup_phone(DEVMAP_DRIVER);175 173 printf(NAME ": Unable to register device %s.\n", "adb/mouse"); 176 174 return rc; … … 195 193 ipc_callid_t callid; 196 194 ipc_call_t call; 197 ipcarg_t method;195 sysarg_t method; 198 196 devmap_handle_t dh; 199 197 int retval; … … 211 209 212 210 if (dev_addr < 0) { 213 ipc_answer_0(iid, EINVAL);211 async_answer_0(iid, EINVAL); 214 212 return; 215 213 } 216 214 217 215 /* Answer the IPC_M_CONNECT_ME_TO call. */ 218 ipc_answer_0(iid, EOK);216 async_answer_0(iid, EOK); 219 217 220 218 while (1) { 221 219 callid = async_get_call(&call); 222 method = IPC_GET_ METHOD(call);220 method = IPC_GET_IMETHOD(call); 223 221 switch (method) { 224 222 case IPC_M_PHONE_HUNGUP: 225 223 /* The other side has hung up. */ 226 ipc_answer_0(callid, EOK);224 async_answer_0(callid, EOK); 227 225 return; 228 226 case IPC_M_CONNECT_TO_ME: … … 247 245 break; 248 246 } 249 ipc_answer_0(callid, retval);247 async_answer_0(callid, retval); 250 248 } 251 249 } … … 278 276 cuda_irq_code.cmds[0].addr = (void *) &((cuda_t *) instance->cuda_kernel)->ifr; 279 277 async_set_interrupt_received(cuda_irq_handler); 280 ipc_register_irq(10, device_assign_devno(), 0, &cuda_irq_code);278 register_irq(10, device_assign_devno(), 0, &cuda_irq_code); 281 279 282 280 /* Enable SR interrupt. */ -
uspace/srv/hw/char/i8042/i8042.c
ra49c4002 rcf2af94 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> … … 148 147 rc = devmap_device_register(name, &i8042_port[i].devmap_handle); 149 148 if (rc != EOK) { 150 devmap_hangup_phone(DEVMAP_DRIVER);151 149 printf(NAME ": Unable to register device %s.\n", name); 152 150 return rc; … … 200 198 i8042_kbd.cmds[0].addr = (void *) &((i8042_t *) i8042_kernel)->status; 201 199 i8042_kbd.cmds[3].addr = (void *) &((i8042_t *) i8042_kernel)->data; 202 ipc_register_irq(inr_a, device_assign_devno(), 0, &i8042_kbd);203 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); 204 202 printf("%s: registered for interrupts %" PRIun " and %" PRIun "\n", 205 203 NAME, inr_a, inr_b); … … 219 217 ipc_callid_t callid; 220 218 ipc_call_t call; 221 ipcarg_t method;219 sysarg_t method; 222 220 devmap_handle_t dh; 223 221 int retval; … … 237 235 238 236 if (dev_id < 0) { 239 ipc_answer_0(iid, EINVAL);237 async_answer_0(iid, EINVAL); 240 238 return; 241 239 } 242 240 243 241 /* Answer the IPC_M_CONNECT_ME_TO call. */ 244 ipc_answer_0(iid, EOK);242 async_answer_0(iid, EOK); 245 243 246 244 printf(NAME ": accepted connection\n"); … … 248 246 while (1) { 249 247 callid = async_get_call(&call); 250 method = IPC_GET_ METHOD(call);248 method = IPC_GET_IMETHOD(call); 251 249 switch (method) { 252 250 case IPC_M_PHONE_HUNGUP: 253 251 /* The other side has hung up. */ 254 ipc_answer_0(callid, EOK);252 async_answer_0(callid, EOK); 255 253 return; 256 254 case IPC_M_CONNECT_TO_ME: … … 273 271 break; 274 272 } 275 ipc_answer_0(callid, retval);273 async_answer_0(callid, retval); 276 274 } 277 275 } -
uspace/srv/hw/char/s3c24xx_uart/s3c24xx_uart.c
ra49c4002 rcf2af94 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> … … 95 94 rc = devmap_device_register(NAMESPACE "/" NAME, &uart->devmap_handle); 96 95 if (rc != EOK) { 97 devmap_hangup_phone(DEVMAP_DRIVER);98 96 printf(NAME ": Unable to register device %s.\n", 99 97 NAMESPACE "/" NAME); … … 116 114 ipc_callid_t callid; 117 115 ipc_call_t call; 118 ipcarg_t method;116 sysarg_t method; 119 117 int retval; 120 118 121 119 /* Answer the IPC_M_CONNECT_ME_TO call. */ 122 ipc_answer_0(iid, EOK);120 async_answer_0(iid, EOK); 123 121 124 122 while (1) { 125 123 callid = async_get_call(&call); 126 method = IPC_GET_ METHOD(call);124 method = IPC_GET_IMETHOD(call); 127 125 switch (method) { 128 126 case IPC_M_PHONE_HUNGUP: 129 127 /* The other side has hung up. */ 130 ipc_answer_0(callid, EOK);128 async_answer_0(callid, EOK); 131 129 return; 132 130 case IPC_M_CONNECT_TO_ME: … … 145 143 break; 146 144 } 147 ipc_answer_0(callid, retval);145 async_answer_0(callid, retval); 148 146 } 149 147 } … … 192 190 async_set_interrupt_received(s3c24xx_uart_irq_handler); 193 191 194 ipc_register_irq(inr, device_assign_devno(), 0, &uart_irq_code);192 register_irq(inr, device_assign_devno(), 0, &uart_irq_code); 195 193 196 194 /* Enable FIFO, Tx trigger level: empty, Rx trigger level: 1 byte. */ -
uspace/srv/hw/irc/apic/apic.c
ra49c4002 rcf2af94 1 1 /* 2 * Copyright (c) 20 06 Ondrej Palkovsky2 * Copyright (c) 2011 Martin Decky 3 3 * All rights reserved. 4 4 * … … 27 27 */ 28 28 29 #include <inttypes.h> 29 /** @addtogroup apic 30 * @{ 31 */ 32 33 /** 34 * @file apic.c 35 * @brief APIC driver. 36 */ 37 38 #include <ipc/services.h> 39 #include <ipc/irc.h> 40 #include <ipc/ns.h> 41 #include <sysinfo.h> 42 #include <as.h> 43 #include <ddi.h> 44 #include <libarch/ddi.h> 45 #include <align.h> 46 #include <bool.h> 47 #include <errno.h> 48 #include <async.h> 49 #include <align.h> 50 #include <async.h> 30 51 #include <stdio.h> 31 #include <unistd.h> 32 #include <async.h> 33 #include <errno.h> 34 #include "../tester.h" 52 #include <ipc/devmap.h> 35 53 36 #define MAX_CONNECTIONS 5054 #define NAME "apic" 37 55 38 static int connections[MAX_CONNECTIONS]; 56 static int apic_enable_irq(sysarg_t irq) 57 { 58 // FIXME: TODO 59 return ENOTSUP; 60 } 39 61 40 static void client_connection(ipc_callid_t iid, ipc_call_t *icall) 62 /** Handle one connection to APIC. 63 * 64 * @param iid Hash of the request that opened the connection. 65 * @param icall Call data of the request that opened the connection. 66 * 67 */ 68 static void apic_connection(ipc_callid_t iid, ipc_call_t *icall) 41 69 { 42 unsigned int i; 70 ipc_callid_t callid; 71 ipc_call_t call; 43 72 44 TPRINTF("Connected phone %" PRIun " accepting\n", icall->in_phone_hash); 45 ipc_answer_0(iid, EOK); 46 for (i = 0; i < MAX_CONNECTIONS; i++) { 47 if (!connections[i]) { 48 connections[i] = icall->in_phone_hash; 49 break; 50 } 51 } 73 /* 74 * Answer the first IPC_M_CONNECT_ME_TO call. 75 */ 76 async_answer_0(iid, EOK); 52 77 53 78 while (true) { 54 ipc_call_t call; 55 ipc_callid_t callid = async_get_call(&call); 56 int retval; 79 callid = async_get_call(&call); 57 80 58 switch (IPC_GET_METHOD(call)) { 59 case IPC_M_PHONE_HUNGUP: 60 TPRINTF("Phone %" PRIun " hung up\n", icall->in_phone_hash); 61 retval = 0; 81 switch (IPC_GET_IMETHOD(call)) { 82 case IRC_ENABLE_INTERRUPT: 83 async_answer_0(callid, apic_enable_irq(IPC_GET_ARG1(call))); 62 84 break; 63 case IPC_TEST_METHOD: 64 TPRINTF("Received well known message from %" PRIun ": %" PRIun "\n", 65 icall->in_phone_hash, callid); 66 ipc_answer_0(callid, EOK); 85 case IRC_CLEAR_INTERRUPT: 86 /* Noop */ 87 async_answer_0(callid, EOK); 67 88 break; 68 89 default: 69 TPRINTF("Received unknown message from %" PRIun ": %" PRIun "\n", 70 icall->in_phone_hash, callid); 71 ipc_answer_0(callid, ENOENT); 90 async_answer_0(callid, EINVAL); 72 91 break; 73 92 } … … 75 94 } 76 95 77 const char *test_register(void) 96 /** Initialize the APIC driver. 97 * 98 */ 99 static bool apic_init(void) 78 100 { 79 async_set_client_connection(client_connection);101 sysarg_t apic; 80 102 81 i pcarg_t phonead;82 int res = ipc_connect_to_me(PHONE_NS, IPC_TEST_SERVICE, 0, 0, &phonead);83 if (res != 0)84 return "Failed registering IPC service";103 if ((sysinfo_get_value("apic", &apic) != EOK) || (!apic)) { 104 printf(NAME ": No APIC found\n"); 105 return false; 106 } 85 107 86 TPRINTF("Registered as service %u, accepting connections\n", IPC_TEST_SERVICE); 108 async_set_client_connection(apic_connection); 109 service_register(SERVICE_APIC); 110 111 return true; 112 } 113 114 int main(int argc, char **argv) 115 { 116 printf(NAME ": HelenOS APIC driver\n"); 117 118 if (!apic_init()) 119 return -1; 120 121 printf(NAME ": Accepting connections\n"); 87 122 async_manager(); 88 123 89 return NULL; 124 /* Never reached */ 125 return 0; 90 126 } 127 128 /** 129 * @} 130 */ -
uspace/srv/hw/irc/fhc/fhc.c
ra49c4002 rcf2af94 29 29 /** @addtogroup fhc 30 30 * @{ 31 */ 31 */ 32 32 33 33 /** 34 * @file fhc.c35 * @brief FHC bus controller driver.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 #include <ipc/ bus.h>39 #include <ipc/irc.h> 41 40 #include <ipc/ns.h> 42 41 #include <sysinfo.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) { … … 82 81 83 82 callid = async_get_call(&call); 84 switch (IPC_GET_METHOD(call)) { 85 case BUS_CLEAR_INTERRUPT: 83 switch (IPC_GET_IMETHOD(call)) { 84 case IRC_ENABLE_INTERRUPT: 85 /* Noop */ 86 async_answer_0(callid, EOK); 87 break; 88 case IRC_CLEAR_INTERRUPT: 86 89 inr = IPC_GET_ARG1(call); 87 90 switch (inr) { 88 91 case FHC_UART_INR: 89 92 fhc_uart_virt[FHC_UART_ICLR] = 0; 90 ipc_answer_0(callid, EOK);93 async_answer_0(callid, EOK); 91 94 break; 92 95 default: 93 ipc_answer_0(callid, ENOTSUP);96 async_answer_0(callid, ENOTSUP); 94 97 break; 95 98 } 96 99 break; 97 100 default: 98 ipc_answer_0(callid, EINVAL);101 async_answer_0(callid, EINVAL); 99 102 break; 100 103 } … … 133 136 134 137 async_set_client_connection(fhc_connection); 135 ipcarg_t phonead; 136 ipc_connect_to_me(PHONE_NS, SERVICE_FHC, 0, 0, &phonead); 138 service_register(SERVICE_FHC); 137 139 138 140 return true; -
uspace/srv/hw/irc/obio/obio.c
ra49c4002 rcf2af94 27 27 */ 28 28 29 /** @addtogroup obio 29 /** @addtogroup obio 30 30 * @{ 31 */ 31 */ 32 32 33 33 /** 34 * @file obio.c35 * @brief OBIO driver.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 #include <ipc/ bus.h>45 #include <ipc/irc.h> 47 46 #include <ipc/ns.h> 48 47 #include <sysinfo.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) { … … 92 91 93 92 callid = async_get_call(&call); 94 switch (IPC_GET_METHOD(call)) { 95 case BUS_CLEAR_INTERRUPT: 93 switch (IPC_GET_IMETHOD(call)) { 94 case IRC_ENABLE_INTERRUPT: 95 /* Noop */ 96 async_answer_0(callid, EOK); 97 break; 98 case IRC_CLEAR_INTERRUPT: 96 99 inr = IPC_GET_ARG1(call); 97 100 base_virt[OBIO_CIR(inr & INO_MASK)] = 0; 98 ipc_answer_0(callid, EOK);101 async_answer_0(callid, EOK); 99 102 break; 100 103 default: 101 ipc_answer_0(callid, EINVAL);104 async_answer_0(callid, EINVAL); 102 105 break; 103 106 } … … 134 137 135 138 async_set_client_connection(obio_connection); 136 ipcarg_t phonead; 137 ipc_connect_to_me(PHONE_NS, SERVICE_OBIO, 0, 0, &phonead); 139 service_register(SERVICE_OBIO); 138 140 139 141 return true; -
uspace/srv/hw/netif/ne2000/Makefile
ra49c4002 rcf2af94 39 39 -include $(CONFIG_MAKEFILE) 40 40 41 ifeq ($(CONFIG_NETIF_NIL_BUNDLE),y) 42 LIBS += $(USPACE_PREFIX)/srv/net/nil/eth/libeth.a 43 endif 44 45 BINARY = dp8390 41 BINARY = ne2000 46 42 47 43 SOURCES = \ 48 44 dp8390.c \ 49 dp8390_module.c \50 45 ne2000.c 51 46
Note:
See TracChangeset
for help on using the changeset viewer.
