Changeset 9a2eb14 in mainline
- Timestamp:
- 2017-10-15T15:04:15Z (7 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 1974f56a
- Parents:
- 75911d24
- Location:
- uspace
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/c/generic/irc.c
r75911d24 r9a2eb14 35 35 #include <assert.h> 36 36 #include <errno.h> 37 #include <fibril_synch.h> 37 38 #include <ipc/irc.h> 38 39 #include <ipc/services.h> 39 40 #include <irc.h> 40 #include <ns.h> 41 #include <loc.h> 42 #include <stdlib.h> 41 43 #include <sysinfo.h> 42 44 … … 49 51 static int irc_init(void) 50 52 { 53 category_id_t irc_cat; 54 service_id_t *svcs; 55 size_t count; 56 int rc; 57 51 58 assert(irc_sess == NULL); 59 rc = loc_category_get_id("irc", &irc_cat, IPC_FLAG_BLOCKING); 60 if (rc != EOK) 61 return EIO; 52 62 53 irc_sess = service_connect_blocking(SERVICE_IRC, INTERFACE_IRC, 0); 63 while (true) { 64 rc = loc_category_get_svcs(irc_cat, &svcs, &count); 65 if (rc != EOK) 66 return EIO; 67 68 if (count > 0) 69 break; 70 71 free(svcs); 72 73 // XXX This is just a temporary hack 74 fibril_usleep(500 * 1000); 75 } 76 77 irc_sess = loc_service_connect(svcs[0], INTERFACE_IRC, 78 IPC_FLAG_BLOCKING); 79 free(svcs); 54 80 55 81 if (irc_sess == NULL) -
uspace/srv/hw/irc/apic/apic.c
r75911d24 r9a2eb14 36 36 */ 37 37 38 #include <ipc/services.h>39 38 #include <ipc/irc.h> 40 #include < ns.h>39 #include <loc.h> 41 40 #include <sysinfo.h> 42 41 #include <as.h> … … 206 205 { 207 206 sysarg_t apic; 207 category_id_t irc_cat; 208 service_id_t svc_id; 208 209 209 210 if ((sysinfo_get_value("apic", &apic) != EOK) || (!apic)) { … … 220 221 221 222 async_set_fallback_port_handler(apic_connection, NULL); 222 service_register(SERVICE_IRC); 223 224 rc = loc_server_register(NAME); 225 if (rc != EOK) { 226 printf("%s: Failed registering server. (%d)\n", NAME, rc); 227 return false; 228 } 229 230 rc = loc_service_register("irc/" NAME, &svc_id); 231 if (rc != EOK) { 232 printf("%s: Failed registering service. (%d)\n", NAME, rc); 233 return false; 234 } 235 236 rc = loc_category_get_id("irc", &irc_cat, IPC_FLAG_BLOCKING); 237 if (rc != EOK) { 238 printf("%s: Failed resolving category 'iplink' (%d).\n", NAME, 239 rc); 240 return false; 241 } 242 243 rc = loc_service_add_to_cat(svc_id, irc_cat); 244 if (rc != EOK) { 245 printf("%s: Failed adding service to category (%d).\n", NAME, 246 rc); 247 return false; 248 } 223 249 224 250 return true; -
uspace/srv/hw/irc/i8259/i8259.c
r75911d24 r9a2eb14 36 36 */ 37 37 38 #include <ipc/services.h>39 38 #include <ipc/irc.h> 40 #include < ns.h>39 #include <loc.h> 41 40 #include <sysinfo.h> 42 41 #include <as.h> … … 47 46 #include <async.h> 48 47 #include <stdio.h> 49 #include <ipc/loc.h>50 48 51 49 #define NAME "i8259" … … 141 139 { 142 140 sysarg_t i8259; 141 category_id_t irc_cat; 142 service_id_t svc_id; 143 int rc; 143 144 144 145 if ((sysinfo_get_value("i8259", &i8259) != EOK) || (!i8259)) { … … 156 157 157 158 async_set_fallback_port_handler(i8259_connection, NULL); 158 service_register(SERVICE_IRC); 159 160 rc = loc_server_register(NAME); 161 if (rc != EOK) { 162 printf("%s: Failed registering server. (%d)\n", NAME, rc); 163 return false; 164 } 165 166 rc = loc_service_register("irc/" NAME, &svc_id); 167 if (rc != EOK) { 168 printf("%s: Failed registering service. (%d)\n", NAME, rc); 169 return false; 170 } 171 172 rc = loc_category_get_id("irc", &irc_cat, IPC_FLAG_BLOCKING); 173 if (rc != EOK) { 174 printf("%s: Failed resolving category 'iplink' (%d).\n", NAME, 175 rc); 176 return false; 177 } 178 179 rc = loc_service_add_to_cat(svc_id, irc_cat); 180 if (rc != EOK) { 181 printf("%s: Failed adding service to category (%d).\n", NAME, 182 rc); 183 return false; 184 } 159 185 160 186 return true; -
uspace/srv/hw/irc/icp-ic/icp-ic.c
r75911d24 r9a2eb14 41 41 #include <errno.h> 42 42 #include <io/log.h> 43 #include <ipc/services.h>44 43 #include <ipc/irc.h> 45 #include < ns.h>44 #include <loc.h> 46 45 #include <sysinfo.h> 47 46 #include <stdio.h> … … 121 120 char *pstr = NULL; 122 121 size_t platform_size; 122 category_id_t irc_cat; 123 service_id_t svc_id; 123 124 void *regs; 124 125 int rc; … … 155 156 156 157 async_set_fallback_port_handler(icpic_connection, NULL); 157 service_register(SERVICE_IRC); 158 159 rc = loc_server_register(NAME); 160 if (rc != EOK) { 161 printf("%s: Failed registering server. (%d)\n", NAME, rc); 162 return rc; 163 } 164 165 rc = loc_service_register("irc/" NAME, &svc_id); 166 if (rc != EOK) { 167 printf("%s: Failed registering service. (%d)\n", NAME, rc); 168 return rc; 169 } 170 171 rc = loc_category_get_id("irc", &irc_cat, IPC_FLAG_BLOCKING); 172 if (rc != EOK) { 173 printf("%s: Failed resolving category 'iplink' (%d).\n", NAME, 174 rc); 175 goto error; 176 } 177 178 rc = loc_service_add_to_cat(svc_id, irc_cat); 179 if (rc != EOK) { 180 printf("%s: Failed adding service to category (%d).\n", NAME, 181 rc); 182 goto error; 183 } 158 184 159 185 free(platform); -
uspace/srv/hw/irc/obio/obio.c
r75911d24 r9a2eb14 42 42 */ 43 43 44 #include <ipc/services.h>45 44 #include <ipc/irc.h> 46 #include < ns.h>45 #include <loc.h> 47 46 #include <as.h> 48 47 #include <ddi.h> … … 55 54 #include <async.h> 56 55 #include <stdio.h> 57 #include <ipc/loc.h>58 56 59 57 #define NAME "obio" 60 58 61 #define OBIO_SIZE 0x1898 59 #define OBIO_SIZE 0x1898 62 60 63 61 #define OBIO_IMR_BASE 0x200 … … 120 118 static bool obio_init(void) 121 119 { 120 category_id_t irc_cat; 121 service_id_t svc_id; 122 int rc; 123 122 124 base_phys = (uintptr_t) 0x1fe00000000ULL; 123 125 … … 135 137 136 138 async_set_fallback_port_handler(obio_connection, NULL); 137 service_register(SERVICE_IRC); 139 140 rc = loc_server_register(NAME); 141 if (rc != EOK) { 142 printf("%s: Failed registering server. (%d)\n", NAME, rc); 143 return false; 144 } 145 146 rc = loc_service_register("irc/" NAME, &svc_id); 147 if (rc != EOK) { 148 printf("%s: Failed registering service. (%d)\n", NAME, rc); 149 return false; 150 } 151 152 rc = loc_category_get_id("irc", &irc_cat, IPC_FLAG_BLOCKING); 153 if (rc != EOK) { 154 printf("%s: Failed resolving category 'iplink' (%d).\n", NAME, 155 rc); 156 return false; 157 } 158 159 rc = loc_service_add_to_cat(svc_id, irc_cat); 160 if (rc != EOK) { 161 printf("%s: Failed adding service to category (%d).\n", NAME, 162 rc); 163 return false; 164 } 138 165 139 166 return true; -
uspace/srv/locsrv/locsrv.c
r75911d24 r9a2eb14 1359 1359 categ_dir_add_cat(&cdir, cat); 1360 1360 1361 cat = category_new("irc"); 1362 categ_dir_add_cat(&cdir, cat); 1363 1361 1364 cat = category_new("visualizer"); 1362 1365 categ_dir_add_cat(&cdir, cat);
Note:
See TracChangeset
for help on using the changeset viewer.