Changeset 357b5f5 in mainline for uspace/srv/hw
- Timestamp:
- 2011-01-23T20:09:13Z (15 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- fdb9982c
- Parents:
- cead2aa (diff), 7e36c8d (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
Legend:
- Unmodified
- Added
- Removed
-
uspace/srv/hw/bus/cuda_adb/cuda_adb.c
rcead2aa r357b5f5 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; … … 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: -
uspace/srv/hw/char/i8042/i8042.c
rcead2aa r357b5f5 148 148 rc = devmap_device_register(name, &i8042_port[i].devmap_handle); 149 149 if (rc != EOK) { 150 devmap_hangup_phone(DEVMAP_DRIVER);151 150 printf(NAME ": Unable to register device %s.\n", name); 152 151 return rc; … … 219 218 ipc_callid_t callid; 220 219 ipc_call_t call; 221 ipcarg_t method;220 sysarg_t method; 222 221 devmap_handle_t dh; 223 222 int retval; … … 248 247 while (1) { 249 248 callid = async_get_call(&call); 250 method = IPC_GET_ METHOD(call);249 method = IPC_GET_IMETHOD(call); 251 250 switch (method) { 252 251 case IPC_M_PHONE_HUNGUP: -
uspace/srv/hw/char/s3c24xx_uart/s3c24xx_uart.c
rcead2aa r357b5f5 95 95 rc = devmap_device_register(NAMESPACE "/" NAME, &uart->devmap_handle); 96 96 if (rc != EOK) { 97 devmap_hangup_phone(DEVMAP_DRIVER);98 97 printf(NAME ": Unable to register device %s.\n", 99 98 NAMESPACE "/" NAME); … … 116 115 ipc_callid_t callid; 117 116 ipc_call_t call; 118 ipcarg_t method;117 sysarg_t method; 119 118 int retval; 120 119 … … 124 123 while (1) { 125 124 callid = async_get_call(&call); 126 method = IPC_GET_ METHOD(call);125 method = IPC_GET_IMETHOD(call); 127 126 switch (method) { 128 127 case IPC_M_PHONE_HUNGUP: -
uspace/srv/hw/irc/apic/apic.c
rcead2aa r357b5f5 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/ipc.h> 39 #include <ipc/services.h> 40 #include <ipc/irc.h> 41 #include <ipc/ns.h> 42 #include <sysinfo.h> 43 #include <as.h> 44 #include <ddi.h> 45 #include <libarch/ddi.h> 46 #include <align.h> 47 #include <bool.h> 48 #include <errno.h> 49 #include <async.h> 50 #include <align.h> 51 #include <async.h> 30 52 #include <stdio.h> 31 #include <unistd.h> 32 #include <async.h> 33 #include <errno.h> 34 #include "../tester.h" 53 #include <ipc/devmap.h> 35 54 36 #define MAX_CONNECTIONS 5055 #define NAME "apic" 37 56 38 static int connections[MAX_CONNECTIONS]; 57 static int apic_enable_irq(sysarg_t irq) 58 { 59 // FIXME: TODO 60 return ENOTSUP; 61 } 39 62 40 static void client_connection(ipc_callid_t iid, ipc_call_t *icall) 63 /** Handle one connection to APIC. 64 * 65 * @param iid Hash of the request that opened the connection. 66 * @param icall Call data of the request that opened the connection. 67 * 68 */ 69 static void apic_connection(ipc_callid_t iid, ipc_call_t *icall) 41 70 { 42 unsigned int i; 71 ipc_callid_t callid; 72 ipc_call_t call; 43 73 44 TPRINTF("Connected phone %" PRIun " accepting\n", icall->in_phone_hash); 74 /* 75 * Answer the first IPC_M_CONNECT_ME_TO call. 76 */ 45 77 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 }52 78 53 79 while (true) { 54 ipc_call_t call; 55 ipc_callid_t callid = async_get_call(&call); 56 int retval; 80 callid = async_get_call(&call); 57 81 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; 82 switch (IPC_GET_IMETHOD(call)) { 83 case IRC_ENABLE_INTERRUPT: 84 ipc_answer_0(callid, apic_enable_irq(IPC_GET_ARG1(call))); 62 85 break; 63 case IPC_TEST_METHOD: 64 TPRINTF("Received well known message from %" PRIun ": %" PRIun "\n", 65 icall->in_phone_hash, callid); 86 case IRC_CLEAR_INTERRUPT: 87 /* Noop */ 66 88 ipc_answer_0(callid, EOK); 67 89 break; 68 90 default: 69 TPRINTF("Received unknown message from %" PRIun ": %" PRIun "\n", 70 icall->in_phone_hash, callid); 71 ipc_answer_0(callid, ENOENT); 91 ipc_answer_0(callid, EINVAL); 72 92 break; 73 93 } … … 75 95 } 76 96 77 const char *test_register(void) 97 /** Initialize the APIC driver. 98 * 99 */ 100 static bool apic_init(void) 78 101 { 79 async_set_client_connection(client_connection);102 sysarg_t apic; 80 103 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";104 if ((sysinfo_get_value("apic", &apic) != EOK) || (!apic)) { 105 printf(NAME ": No APIC found\n"); 106 return false; 107 } 85 108 86 TPRINTF("Registered as service %u, accepting connections\n", IPC_TEST_SERVICE); 109 async_set_client_connection(apic_connection); 110 sysarg_t phonead; 111 ipc_connect_to_me(PHONE_NS, SERVICE_APIC, 0, 0, &phonead); 112 113 return true; 114 } 115 116 int main(int argc, char **argv) 117 { 118 printf(NAME ": HelenOS APIC driver\n"); 119 120 if (!apic_init()) 121 return -1; 122 123 printf(NAME ": Accepting connections\n"); 87 124 async_manager(); 88 125 89 return NULL; 126 /* Never reached */ 127 return 0; 90 128 } 129 130 /** 131 * @} 132 */ -
uspace/srv/hw/irc/fhc/fhc.c
rcead2aa r357b5f5 38 38 #include <ipc/ipc.h> 39 39 #include <ipc/services.h> 40 #include <ipc/ bus.h>40 #include <ipc/irc.h> 41 41 #include <ipc/ns.h> 42 42 #include <sysinfo.h> … … 82 82 83 83 callid = async_get_call(&call); 84 switch (IPC_GET_METHOD(call)) { 85 case BUS_CLEAR_INTERRUPT: 84 switch (IPC_GET_IMETHOD(call)) { 85 case IRC_ENABLE_INTERRUPT: 86 /* Noop */ 87 ipc_answer_0(callid, EOK); 88 break; 89 case IRC_CLEAR_INTERRUPT: 86 90 inr = IPC_GET_ARG1(call); 87 91 switch (inr) { … … 133 137 134 138 async_set_client_connection(fhc_connection); 135 ipcarg_t phonead;139 sysarg_t phonead; 136 140 ipc_connect_to_me(PHONE_NS, SERVICE_FHC, 0, 0, &phonead); 137 141 -
uspace/srv/hw/irc/obio/obio.c
rcead2aa r357b5f5 44 44 #include <ipc/ipc.h> 45 45 #include <ipc/services.h> 46 #include <ipc/ bus.h>46 #include <ipc/irc.h> 47 47 #include <ipc/ns.h> 48 48 #include <sysinfo.h> … … 92 92 93 93 callid = async_get_call(&call); 94 switch (IPC_GET_METHOD(call)) { 95 case BUS_CLEAR_INTERRUPT: 94 switch (IPC_GET_IMETHOD(call)) { 95 case IRC_ENABLE_INTERRUPT: 96 /* Noop */ 97 ipc_answer_0(callid, EOK); 98 break; 99 case IRC_CLEAR_INTERRUPT: 96 100 inr = IPC_GET_ARG1(call); 97 101 base_virt[OBIO_CIR(inr & INO_MASK)] = 0; … … 134 138 135 139 async_set_client_connection(obio_connection); 136 ipcarg_t phonead;140 sysarg_t phonead; 137 141 ipc_connect_to_me(PHONE_NS, SERVICE_OBIO, 0, 0, &phonead); 138 142 -
uspace/srv/hw/netif/ne2000/Makefile
rcead2aa r357b5f5 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.