Changeset b2d06fa in mainline
- Timestamp:
- 2010-12-25T17:14:36Z (14 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 092e4f1
- Parents:
- 59e9398b (diff), 3ac66f69 (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. - Files:
-
- 5 added
- 3 deleted
- 46 edited
- 1 moved
Legend:
- Unmodified
- Added
- Removed
-
boot/Makefile.common
r59e9398b rb2d06fa 140 140 $(USPACE_PATH)/app/stats/stats \ 141 141 $(USPACE_PATH)/app/tasks/tasks \ 142 $(USPACE_PATH)/app/top/top 142 $(USPACE_PATH)/app/top/top \ 143 $(USPACE_PATH)/app/sysinfo/sysinfo 143 144 144 145 ifneq ($(CONFIG_BAREBONE),y) -
kernel/arch/amd64/src/amd64.c
r59e9398b rb2d06fa 199 199 void arch_post_smp_init(void) 200 200 { 201 /* Currently the only supported platform for amd64 is 'pc'. */ 202 static const char *platform = "pc"; 203 204 sysinfo_set_item_data("platform", NULL, (void *) platform, 205 str_size(platform)); 206 201 207 #ifdef CONFIG_PC_KBD 202 208 /* -
kernel/arch/arm32/include/mach/integratorcp/integratorcp.h
r59e9398b rb2d06fa 106 106 extern void icp_frame_init(void); 107 107 extern size_t icp_get_irq_count(void); 108 extern const char *icp_get_platform_name(void); 108 109 109 110 extern struct arm_machine_ops icp_machine_ops; -
kernel/arch/arm32/include/mach/testarm/testarm.h
r59e9398b rb2d06fa 74 74 extern void gxemul_frame_init(void); 75 75 extern size_t gxemul_get_irq_count(void); 76 extern const char *gxemul_get_platform_name(void); 76 77 77 78 extern struct arm_machine_ops gxemul_machine_ops; -
kernel/arch/arm32/include/machine_func.h
r59e9398b rb2d06fa 56 56 void (*machine_input_init)(void); 57 57 size_t (*machine_get_irq_count)(void); 58 const char *(*machine_get_platform_name)(void); 58 59 }; 59 60 -
kernel/arch/arm32/src/mach/gta02/gta02.c
r59e9398b rb2d06fa 71 71 static void gta02_input_init(void); 72 72 static size_t gta02_get_irq_count(void); 73 static const char *gta02_get_platform_name(void); 73 74 74 75 static void gta02_timer_irq_init(void); … … 92 93 gta02_output_init, 93 94 gta02_input_init, 94 gta02_get_irq_count 95 gta02_get_irq_count, 96 gta02_get_platform_name 95 97 }; 96 98 … … 235 237 } 236 238 239 const char *gta02_get_platform_name(void) 240 { 241 return "gta02"; 242 } 243 237 244 static void gta02_timer_irq_init(void) 238 245 { -
kernel/arch/arm32/src/mach/integratorcp/integratorcp.c
r59e9398b rb2d06fa 65 65 icp_output_init, 66 66 icp_input_init, 67 icp_get_irq_count 67 icp_get_irq_count, 68 icp_get_platform_name 68 69 }; 69 70 … … 342 343 } 343 344 345 const char *icp_get_platform_name(void) 346 { 347 return "integratorcp"; 348 } 349 344 350 /** @} 345 351 */ -
kernel/arch/arm32/src/mach/testarm/testarm.c
r59e9398b rb2d06fa 65 65 gxemul_output_init, 66 66 gxemul_input_init, 67 gxemul_get_irq_count 67 gxemul_get_irq_count, 68 gxemul_get_platform_name 68 69 }; 69 70 … … 132 133 } 133 134 135 const char *gxemul_get_platform_name(void) 136 { 137 return "gxemul"; 138 } 139 134 140 /** Starts gxemul Real Time Clock device, which asserts regular interrupts. 135 141 * -
kernel/arch/ia32/src/ia32.c
r59e9398b rb2d06fa 157 157 void arch_post_smp_init(void) 158 158 { 159 /* Currently the only supported platform for ia32 is 'pc'. */ 160 static const char *platform = "pc"; 161 162 sysinfo_set_item_data("platform", NULL, (void *) platform, 163 str_size(platform)); 164 159 165 #ifdef CONFIG_PC_KBD 160 166 /* -
kernel/arch/ia64/src/ia64.c
r59e9398b rb2d06fa 147 147 void arch_post_smp_init(void) 148 148 { 149 static const char *platform; 150 151 /* Set platform name. */ 152 #ifdef MACHINE_ski 153 platform = "pc"; 154 #endif 155 #ifdef MACHINE_i460GX 156 platform = "i460GX"; 157 #endif 158 sysinfo_set_item_data("platform", NULL, (void *) platform, 159 str_size(platform)); 160 149 161 #ifdef MACHINE_ski 150 162 ski_instance_t *ski_instance = skiin_init(); -
kernel/arch/mips32/src/mips32.c
r59e9398b rb2d06fa 168 168 void arch_post_smp_init(void) 169 169 { 170 static const char *platform; 171 172 /* Set platform name. */ 173 #ifdef MACHINE_msim 174 platform = "msim"; 175 #endif 176 #ifdef MACHINE_bgxemul 177 platform = "gxemul"; 178 #endif 179 #ifdef MACHINE_lgxemul 180 platform = "gxemul"; 181 #endif 182 sysinfo_set_item_data("platform", NULL, (void *) platform, 183 str_size(platform)); 184 170 185 #ifdef CONFIG_MIPS_KBD 171 186 /* -
kernel/arch/ppc32/src/ppc32.c
r59e9398b rb2d06fa 249 249 void arch_post_smp_init(void) 250 250 { 251 /* Currently the only supported platform for ppc32 is 'mac'. */ 252 static const char *platform = "mac"; 253 254 sysinfo_set_item_data("platform", NULL, (void *) platform, 255 str_size(platform)); 256 251 257 ofw_tree_walk_by_device_type("mac-io", macio_register, NULL); 252 258 } -
kernel/arch/sparc64/src/sun4u/sparc64.c
r59e9398b rb2d06fa 50 50 #include <ddi/irq.h> 51 51 #include <str.h> 52 #include <sysinfo/sysinfo.h> 52 53 53 54 memmap_t memmap; … … 111 112 void arch_post_smp_init(void) 112 113 { 114 /* Currently the only supported platform for sparc64/sun4u is 'sun4u'. */ 115 static const char *platform = "sun4u"; 116 117 sysinfo_set_item_data("platform", NULL, (void *) platform, 118 str_size(platform)); 119 113 120 standalone_sparc64_console_init(); 114 121 } -
kernel/arch/sparc64/src/sun4v/sparc64.c
r59e9398b rb2d06fa 52 52 #include <str.h> 53 53 #include <arch/drivers/niagara.h> 54 #include <sysinfo/sysinfo.h> 54 55 55 56 memmap_t memmap; … … 109 110 void arch_post_smp_init(void) 110 111 { 112 /* Currently the only supported platform for sparc64/sun4v is 'sun4v'. */ 113 static const char *platform = "sun4v"; 114 115 sysinfo_set_item_data("platform", NULL, (void *) platform, 116 str_size(platform)); 117 111 118 niagarain_init(); 112 119 } -
kernel/generic/include/ddi/irq.h
r59e9398b rb2d06fa 189 189 extern hash_table_t irq_uspace_hash_table; 190 190 191 extern inr_t last_inr; 192 191 193 extern void irq_init(size_t, size_t); 192 194 extern void irq_initialize(irq_t *); -
kernel/generic/src/ddi/irq.c
r59e9398b rb2d06fa 136 136 static size_t buckets; 137 137 138 /** Last valid INR. */ 139 inr_t last_inr = 0; 140 138 141 /** Initialize IRQ subsystem. 139 142 * … … 145 148 { 146 149 buckets = chains; 150 last_inr = inrs - 1; 151 147 152 /* 148 153 * Be smart about the choice of the hash table operations. -
kernel/generic/src/ipc/irq.c
r59e9398b rb2d06fa 131 131 /** Register an answerbox as a receiving end for IRQ notifications. 132 132 * 133 * @param box Receiving answerbox. 134 * @param inr IRQ number. 135 * @param devno Device number. 136 * @param imethod Interface and method to be associated 137 * with the notification. 138 * @param ucode Uspace pointer to top-half pseudocode. 139 * 140 * @return EBADMEM, ENOENT or EEXISTS on failure or 0 on success. 133 * @param box Receiving answerbox. 134 * @param inr IRQ number. 135 * @param devno Device number. 136 * @param imethod Interface and method to be associated with the 137 * notification. 138 * @param ucode Uspace pointer to top-half pseudocode. 139 * @return EOK on success or a negative error code. 141 140 * 142 141 */ … … 148 147 (sysarg_t) devno 149 148 }; 149 150 if ((inr < 0) || (inr > last_inr)) 151 return ELIMIT; 150 152 151 153 irq_code_t *code; … … 208 210 /** Unregister task from IRQ notification. 209 211 * 210 * @param box 211 * @param inr 212 * @param devno 213 * 212 * @param box Answerbox associated with the notification. 213 * @param inr IRQ number. 214 * @param devno Device number. 215 * @return EOK on success or a negative error code. 214 216 */ 215 217 int ipc_irq_unregister(answerbox_t *box, inr_t inr, devno_t devno) … … 219 221 (sysarg_t) devno 220 222 }; 223 224 if ((inr < 0) || (inr > last_inr)) 225 return ELIMIT; 221 226 222 227 irq_spinlock_lock(&irq_uspace_hash_table_lock, true); -
uspace/Makefile
r59e9398b rb2d06fa 53 53 app/nettest2 \ 54 54 app/ping \ 55 app/sysinfo \ 55 56 srv/clip \ 56 57 srv/devmap \ -
uspace/app/init/init.c
r59e9398b rb2d06fa 57 57 #define DEVFS_MOUNT_POINT "/dev" 58 58 59 #define SCRATCH_FS_TYPE "tmpfs"60 #define SCRATCH_MOUNT_POINT "/scratch"59 #define TMPFS_FS_TYPE "tmpfs" 60 #define TMPFS_MOUNT_POINT "/tmp" 61 61 62 62 #define DATA_FS_TYPE "fat" … … 235 235 } 236 236 237 static bool mount_ scratch(void)238 { 239 int rc = mount( SCRATCH_FS_TYPE, SCRATCH_MOUNT_POINT, "", "", 0);240 return mount_report(" Scratch filesystem", SCRATCH_MOUNT_POINT,241 SCRATCH_FS_TYPE, NULL, rc);237 static bool mount_tmpfs(void) 238 { 239 int rc = mount(TMPFS_FS_TYPE, TMPFS_MOUNT_POINT, "", "", 0); 240 return mount_report("Temporary filesystem", TMPFS_MOUNT_POINT, 241 TMPFS_FS_TYPE, NULL, rc); 242 242 } 243 243 … … 271 271 } 272 272 273 mount_ scratch();273 mount_tmpfs(); 274 274 275 275 spawn("/srv/fhc"); -
uspace/app/tester/Makefile
r59e9398b rb2d06fa 47 47 vfs/vfs1.c \ 48 48 ipc/ping_pong.c \ 49 ipc/register.c \50 ipc/connect.c \51 49 loop/loop1.c \ 52 50 mm/malloc1.c \ 51 hw/misc/virtchar1.c \ 53 52 hw/serial/serial1.c 54 53 -
uspace/app/tester/tester.c
r59e9398b rb2d06fa 60 60 #include "vfs/vfs1.def" 61 61 #include "ipc/ping_pong.def" 62 #include "ipc/register.def"63 #include "ipc/connect.def"64 62 #include "loop/loop1.def" 65 63 #include "mm/malloc1.def" 66 64 #include "hw/serial/serial1.def" 65 #include "hw/misc/virtchar1.def" 67 66 {NULL, NULL, NULL, false} 68 67 }; -
uspace/app/tester/tester.h
r59e9398b rb2d06fa 77 77 extern const char *test_vfs1(void); 78 78 extern const char *test_ping_pong(void); 79 extern const char *test_register(void);80 extern const char *test_connect(void);81 79 extern const char *test_loop1(void); 82 80 extern const char *test_malloc1(void); 83 81 extern const char *test_serial1(void); 82 extern const char *test_virtchar1(void); 84 83 85 84 extern test_t tests[]; -
uspace/app/tester/vfs/vfs1.c
r59e9398b rb2d06fa 40 40 #include "../tester.h" 41 41 42 #define FS_TYPE "tmpfs" 43 #define MOUNT_POINT "/tmp" 44 #define OPTIONS "" 45 #define FLAGS 0 46 47 #define TEST_DIRECTORY MOUNT_POINT "/testdir" 42 #define TEST_DIRECTORY "/tmp/testdir" 48 43 #define TEST_FILE TEST_DIRECTORY "/testfile" 49 44 #define TEST_FILE2 TEST_DIRECTORY "/nextfile" … … 75 70 const char *test_vfs1(void) 76 71 { 77 if (mkdir(MOUNT_POINT, 0) != 0) 72 int rc; 73 if ((rc = mkdir(TEST_DIRECTORY, 0)) != 0) { 74 TPRINTF("rc=%d\n", rc); 78 75 return "mkdir() failed"; 79 TPRINTF("Created directory %s\n", MOUNT_POINT);80 81 int rc = mount(FS_TYPE, MOUNT_POINT, "", OPTIONS, FLAGS);82 switch (rc) {83 case EOK:84 TPRINTF("Mounted %s on %s\n", FS_TYPE, MOUNT_POINT);85 break;86 case EBUSY:87 TPRINTF("(INFO) Filesystem already mounted on %s\n", MOUNT_POINT);88 break;89 default:90 TPRINTF("(ERR) IPC returned errno %d (is tmpfs loaded?)\n", rc);91 return "mount() failed";92 76 } 93 94 if (mkdir(TEST_DIRECTORY, 0) != 0)95 return "mkdir() failed";96 77 TPRINTF("Created directory %s\n", TEST_DIRECTORY); 97 78 -
uspace/drv/ns8250/ns8250.c
r59e9398b rb2d06fa 342 342 printf(NAME ": failed to connect to the parent driver of the " 343 343 "device %s.\n", dev->name); 344 ret = EPARTY; /* FIXME: use another EC */344 ret = dev->parent_phone; 345 345 goto failed; 346 346 } 347 347 348 348 /* Get hw resources. */ 349 if (!get_hw_resources(dev->parent_phone, &hw_resources)) { 349 ret = get_hw_resources(dev->parent_phone, &hw_resources); 350 if (ret != EOK) { 350 351 printf(NAME ": failed to get hw resources for the device " 351 352 "%s.\n", dev->name); 352 ret = EPARTY; /* FIXME: use another EC */353 353 goto failed; 354 354 } … … 374 374 printf(NAME ": i/o range assigned to the device " 375 375 "%s is too small.\n", dev->name); 376 ret = E PARTY; /* FIXME: use another EC */376 ret = ELIMIT; 377 377 goto failed; 378 378 } … … 390 390 printf(NAME ": missing hw resource(s) for the device %s.\n", 391 391 dev->name); 392 ret = E PARTY; /* FIXME: use another EC */392 ret = ENOENT; 393 393 goto failed; 394 394 } -
uspace/drv/pciintel/pci.c
r59e9398b rb2d06fa 452 452 static int pci_add_device(device_t *dev) 453 453 { 454 int rc; 455 454 456 printf(NAME ": pci_add_device\n"); 455 457 … … 466 468 "parent's driver.\n"); 467 469 delete_pci_bus_data(bus_data); 468 return EPARTY; /* FIXME: use another EC */470 return dev->parent_phone; 469 471 } 470 472 471 473 hw_resource_list_t hw_resources; 472 474 473 if (!get_hw_resources(dev->parent_phone, &hw_resources)) { 475 rc = get_hw_resources(dev->parent_phone, &hw_resources); 476 if (rc != EOK) { 474 477 printf(NAME ": pci_add_device failed to get hw resources for " 475 478 "the device.\n"); 476 479 delete_pci_bus_data(bus_data); 477 480 ipc_hangup(dev->parent_phone); 478 return EPARTY; /* FIXME: use another EC */481 return rc; 479 482 } 480 483 -
uspace/drv/root/root.c
r59e9398b rb2d06fa 47 47 #include <macros.h> 48 48 #include <inttypes.h> 49 #include <sysinfo.h> 49 50 50 51 #include <driver.h> … … 55 56 56 57 #define PLATFORM_DEVICE_NAME "hw" 57 #define PLATFORM_DEVICE_MATCH_ID STRING(UARCH)58 #define PLATFORM_DEVICE_MATCH_ID_FMT "platform/%s" 58 59 #define PLATFORM_DEVICE_MATCH_SCORE 100 59 60 … … 99 100 static int add_platform_child(device_t *parent) 100 101 { 102 char *match_id; 103 char *platform; 104 size_t platform_size; 105 int res; 106 107 /* Get platform name from sysinfo. */ 108 109 platform = sysinfo_get_data("platform", &platform_size); 110 if (platform == NULL) { 111 printf(NAME ": Failed to obtain platform name.\n"); 112 return ENOENT; 113 } 114 115 /* Null-terminate string. */ 116 platform = realloc(platform, platform_size + 1); 117 if (platform == NULL) { 118 printf(NAME ": Memory allocation failed.\n"); 119 return ENOMEM; 120 } 121 122 platform[platform_size] = '\0'; 123 124 /* Construct match ID. */ 125 126 if (asprintf(&match_id, PLATFORM_DEVICE_MATCH_ID_FMT, platform) == -1) { 127 printf(NAME ": Memory allocation failed.\n"); 128 return ENOMEM; 129 } 130 131 /* Add child. */ 132 101 133 printf(NAME ": adding new child for platform device.\n"); 102 134 printf(NAME ": device node is `%s' (%d %s)\n", PLATFORM_DEVICE_NAME, 103 PLATFORM_DEVICE_MATCH_SCORE, PLATFORM_DEVICE_MATCH_ID);104 105 intres = child_device_register_wrapper(parent, PLATFORM_DEVICE_NAME,106 PLATFORM_DEVICE_MATCH_ID, PLATFORM_DEVICE_MATCH_SCORE);135 PLATFORM_DEVICE_MATCH_SCORE, match_id); 136 137 res = child_device_register_wrapper(parent, PLATFORM_DEVICE_NAME, 138 match_id, PLATFORM_DEVICE_MATCH_SCORE); 107 139 108 140 return res; -
uspace/drv/rootpc/rootpc.c
r59e9398b rb2d06fa 28 28 29 29 /** 30 * @defgroup root_pc Root HW device driver for ia32 and amd64 platform.31 * @brief HelenOS root HW device driver for ia32 and amd64 platform.30 * @defgroup root_pc PC platform driver. 31 * @brief HelenOS PC platform driver. 32 32 * @{ 33 33 */ … … 182 182 /* Register child devices. */ 183 183 if (!rootpc_add_children(dev)) { 184 printf(NAME ": failed to add child devices for platform " 185 "ia32.\n"); 184 printf(NAME ": failed to add child devices for PC platform.\n"); 186 185 } 187 186 … … 196 195 int main(int argc, char *argv[]) 197 196 { 198 printf(NAME ": HelenOS rootpc devicedriver\n");197 printf(NAME ": HelenOS PC platform driver\n"); 199 198 root_pc_init(); 200 199 return driver_main(&rootpc_driver); -
uspace/drv/rootpc/rootpc.ma
r59e9398b rb2d06fa 1 10 ia32 2 10 amd64 1 10 platform/pc -
uspace/drv/rootvirt/devices.def
r59e9398b rb2d06fa 17 17 .match_id = "virtual&test2" 18 18 }, 19 { 20 .name = "null", 21 .match_id = "virtual&test1" 22 }, 19 23 #endif -
uspace/drv/test1/Makefile
r59e9398b rb2d06fa 33 33 34 34 SOURCES = \ 35 char.c \ 35 36 test1.c 36 37 -
uspace/drv/test1/char.c
r59e9398b rb2d06fa 1 1 /* 2 * Copyright (c) 20 06 Ondrej Palkovsky2 * Copyright (c) 2010 Vojtech Horky 3 3 * All rights reserved. 4 4 * … … 27 27 */ 28 28 29 #include <stdio.h> 30 #include <unistd.h> 31 #include <atomic.h> 32 #include "../tester.h" 29 /** @file 30 */ 33 31 34 static atomic_t finish; 32 #include <assert.h> 33 #include <errno.h> 34 #include <mem.h> 35 #include <char.h> 35 36 36 static void callback(void *priv, int retval, ipc_call_t *data) 37 { 38 atomic_set(&finish, 1); 37 #include "test1.h" 38 39 static int impl_char_read(device_t *dev, char *buf, size_t count) { 40 memset(buf, 0, count); 41 return count; 39 42 } 40 43 41 const char *test_connect(void) 42 { 43 TPRINTF("Connecting to %u...", IPC_TEST_SERVICE); 44 int phone = ipc_connect_me_to(PHONE_NS, IPC_TEST_SERVICE, 0, 0); 45 if (phone > 0) { 46 TPRINTF("phoneid %d\n", phone); 47 } else { 48 TPRINTF("\n"); 49 return "ipc_connect_me_to() failed"; 50 } 51 52 printf("Sending synchronous message...\n"); 53 int retval = ipc_call_sync_0_0(phone, IPC_TEST_METHOD); 54 TPRINTF("Received response to synchronous message\n"); 55 56 TPRINTF("Sending asynchronous message...\n"); 57 atomic_set(&finish, 0); 58 ipc_call_async_0(phone, IPC_TEST_METHOD, NULL, callback, 1); 59 while (atomic_get(&finish) != 1) 60 TPRINTF("."); 61 TPRINTF("Received response to asynchronous message\n"); 62 63 TPRINTF("Hanging up..."); 64 retval = ipc_hangup(phone); 65 if (retval == 0) { 66 TPRINTF("OK\n"); 67 } else { 68 TPRINTF("\n"); 69 return "ipc_hangup() failed"; 70 } 71 72 return NULL; 44 static int imp_char_write(device_t *dev, char *buf, size_t count) { 45 return count; 73 46 } 47 48 static char_iface_t char_interface = { 49 .read = &impl_char_read, 50 .write = &imp_char_write 51 }; 52 53 device_ops_t char_device_ops = { 54 .interfaces[CHAR_DEV_IFACE] = &char_interface 55 }; 56 -
uspace/drv/test1/test1.c
r59e9398b rb2d06fa 34 34 #include <errno.h> 35 35 #include <str_error.h> 36 #include <driver.h> 37 38 #define NAME "test1" 36 #include "test1.h" 39 37 40 38 static int add_device(device_t *dev); … … 98 96 add_device_to_class(dev, "virtual"); 99 97 100 if (dev->parent == NULL) { 98 if (str_cmp(dev->name, "null") == 0) { 99 dev->ops = &char_device_ops; 100 add_device_to_class(dev, "virt-null"); 101 } else if (dev->parent == NULL) { 101 102 register_child_verbose(dev, "cloning myself ;-)", "clone", 102 103 "virtual&test1", 10); … … 117 118 } 118 119 119 -
uspace/lib/c/generic/async_rel.c
r59e9398b rb2d06fa 239 239 */ 240 240 retry: 241 rel_phone = ipc_connect_me_to(key_phone, 0, 0, 0);241 rel_phone = async_connect_me_to(key_phone, 0, 0, 0); 242 242 if (rel_phone >= 0) { 243 243 /* success, do nothing */ -
uspace/lib/c/generic/device/hw_res.c
r59e9398b rb2d06fa 38 38 #include <malloc.h> 39 39 40 boolget_hw_resources(int dev_phone, hw_resource_list_t *hw_resources)40 int get_hw_resources(int dev_phone, hw_resource_list_t *hw_resources) 41 41 { 42 42 sysarg_t count = 0; 43 43 int rc = async_req_1_1(dev_phone, DEV_IFACE_ID(HW_RES_DEV_IFACE), GET_RESOURCE_LIST, &count); 44 44 hw_resources->count = count; 45 if (EOK != rc) { 46 return false; 47 } 45 if (rc != EOK) 46 return rc; 48 47 49 48 size_t size = count * sizeof(hw_resource_t); 50 49 hw_resources->resources = (hw_resource_t *)malloc(size); 51 if (NULL == hw_resources->resources) { 52 return false; 53 } 50 if (!hw_resources->resources) 51 return ENOMEM; 54 52 55 53 rc = async_data_read_start(dev_phone, hw_resources->resources, size); 56 if ( EOK != rc) {54 if (rc != EOK) { 57 55 free(hw_resources->resources); 58 56 hw_resources->resources = NULL; 59 return false;57 return rc; 60 58 } 61 59 62 return true;60 return EOK; 63 61 } 64 62 -
uspace/lib/c/generic/devmap.c
r59e9398b rb2d06fa 127 127 /** Register new device. 128 128 * 129 * @param namespace Namespace name. 129 * The @p interface is used when forwarding connection to the driver. 130 * If not 0, the first argument is the interface and the second argument 131 * is the devmap handle of the device. 132 * When the interface is zero (default), the first argument is directly 133 * the handle (to ensure backward compatibility). 134 * 135 * @param fqdn Fully qualified device name. 136 * @param[out] handle Handle to the created instance of device. 137 * @param interface Interface when forwarding. 138 * 139 */ 140 int devmap_device_register_with_iface(const char *fqdn, 141 devmap_handle_t *handle, sysarg_t interface) 142 { 143 int phone = devmap_get_phone(DEVMAP_DRIVER, IPC_FLAG_BLOCKING); 144 145 if (phone < 0) 146 return phone; 147 148 async_serialize_start(); 149 150 ipc_call_t answer; 151 aid_t req = async_send_2(phone, DEVMAP_DEVICE_REGISTER, interface, 0, 152 &answer); 153 154 sysarg_t retval = async_data_write_start(phone, fqdn, str_size(fqdn)); 155 if (retval != EOK) { 156 async_wait_for(req, NULL); 157 async_serialize_end(); 158 return retval; 159 } 160 161 async_wait_for(req, &retval); 162 163 async_serialize_end(); 164 165 if (retval != EOK) { 166 if (handle != NULL) 167 *handle = -1; 168 return retval; 169 } 170 171 if (handle != NULL) 172 *handle = (devmap_handle_t) IPC_GET_ARG1(answer); 173 174 return retval; 175 } 176 177 /** Register new device. 178 * 130 179 * @param fqdn Fully qualified device name. 131 180 * @param handle Output: Handle to the created instance of device. … … 134 183 int devmap_device_register(const char *fqdn, devmap_handle_t *handle) 135 184 { 136 int phone = devmap_get_phone(DEVMAP_DRIVER, IPC_FLAG_BLOCKING); 137 138 if (phone < 0) 139 return phone; 140 141 async_serialize_start(); 142 143 ipc_call_t answer; 144 aid_t req = async_send_2(phone, DEVMAP_DEVICE_REGISTER, 0, 0, 145 &answer); 146 147 sysarg_t retval = async_data_write_start(phone, fqdn, str_size(fqdn)); 148 if (retval != EOK) { 149 async_wait_for(req, NULL); 150 async_serialize_end(); 151 return retval; 152 } 153 154 async_wait_for(req, &retval); 155 156 async_serialize_end(); 157 158 if (retval != EOK) { 159 if (handle != NULL) 160 *handle = -1; 161 return retval; 162 } 163 164 if (handle != NULL) 165 *handle = (devmap_handle_t) IPC_GET_ARG1(answer); 166 167 return retval; 168 } 185 return devmap_device_register_with_iface(fqdn, handle, 0); 186 } 187 169 188 170 189 int devmap_device_get_handle(const char *fqdn, devmap_handle_t *handle, unsigned int flags) … … 260 279 261 280 if (flags & IPC_FLAG_BLOCKING) { 262 phone = ipc_connect_me_to_blocking(PHONE_NS, SERVICE_DEVMAP,281 phone = async_connect_me_to_blocking(PHONE_NS, SERVICE_DEVMAP, 263 282 DEVMAP_CONNECT_TO_DEVICE, handle); 264 283 } else { 265 phone = ipc_connect_me_to(PHONE_NS, SERVICE_DEVMAP,284 phone = async_connect_me_to(PHONE_NS, SERVICE_DEVMAP, 266 285 DEVMAP_CONNECT_TO_DEVICE, handle); 267 286 } -
uspace/lib/c/generic/fibril_synch.c
r59e9398b rb2d06fa 139 139 static void _fibril_mutex_unlock_unsafe(fibril_mutex_t *fm) 140 140 { 141 assert(fm->counter <= 0);142 141 if (fm->counter++ < 0) { 143 142 link_t *tmp; … … 165 164 void fibril_mutex_unlock(fibril_mutex_t *fm) 166 165 { 166 assert(fibril_mutex_is_locked(fm)); 167 167 futex_down(&async_futex); 168 168 _fibril_mutex_unlock_unsafe(fm); 169 169 futex_up(&async_futex); 170 } 171 172 bool fibril_mutex_is_locked(fibril_mutex_t *fm) 173 { 174 bool locked = false; 175 176 futex_down(&async_futex); 177 if (fm->counter <= 0) 178 locked = true; 179 futex_up(&async_futex); 180 181 return locked; 170 182 } 171 183 … … 230 242 { 231 243 futex_down(&async_futex); 232 assert(frw->readers || (frw->writers == 1));233 244 if (frw->readers) { 234 245 if (--frw->readers) { … … 296 307 void fibril_rwlock_read_unlock(fibril_rwlock_t *frw) 297 308 { 309 assert(fibril_rwlock_is_read_locked(frw)); 298 310 _fibril_rwlock_common_unlock(frw); 299 311 } … … 301 313 void fibril_rwlock_write_unlock(fibril_rwlock_t *frw) 302 314 { 315 assert(fibril_rwlock_is_write_locked(frw)); 303 316 _fibril_rwlock_common_unlock(frw); 317 } 318 319 bool fibril_rwlock_is_read_locked(fibril_rwlock_t *frw) 320 { 321 bool locked = false; 322 323 futex_down(&async_futex); 324 if (frw->readers) 325 locked = true; 326 futex_up(&async_futex); 327 328 return locked; 329 } 330 331 bool fibril_rwlock_is_write_locked(fibril_rwlock_t *frw) 332 { 333 bool locked = false; 334 335 futex_down(&async_futex); 336 if (frw->writers) { 337 assert(frw->writers == 1); 338 locked = true; 339 } 340 futex_up(&async_futex); 341 342 return locked; 343 } 344 345 bool fibril_rwlock_is_locked(fibril_rwlock_t *frw) 346 { 347 return fibril_rwlock_is_read_locked(frw) || 348 fibril_rwlock_is_write_locked(frw); 304 349 } 305 350 … … 314 359 { 315 360 awaiter_t wdata; 361 362 assert(fibril_mutex_is_locked(fm)); 316 363 317 364 if (timeout < 0) -
uspace/lib/c/include/device/hw_res.h
r59e9398b rb2d06fa 95 95 96 96 97 bool get_hw_resources(int dev_phone, hw_resource_list_t *hw_resources); 98 99 bool enable_interrupt(int dev_phone); 97 extern int get_hw_resources(int, hw_resource_list_t *); 98 extern bool enable_interrupt(int); 100 99 101 100 -
uspace/lib/c/include/devmap.h
r59e9398b rb2d06fa 45 45 extern int devmap_driver_register(const char *, async_client_conn_t); 46 46 extern int devmap_device_register(const char *, devmap_handle_t *); 47 extern int devmap_device_register_with_iface(const char *, devmap_handle_t *, sysarg_t); 47 48 48 49 extern int devmap_device_get_handle(const char *, devmap_handle_t *, unsigned int); -
uspace/lib/c/include/fibril_synch.h
r59e9398b rb2d06fa 105 105 extern bool fibril_mutex_trylock(fibril_mutex_t *); 106 106 extern void fibril_mutex_unlock(fibril_mutex_t *); 107 extern bool fibril_mutex_is_locked(fibril_mutex_t *); 107 108 108 109 extern void fibril_rwlock_initialize(fibril_rwlock_t *); … … 111 112 extern void fibril_rwlock_read_unlock(fibril_rwlock_t *); 112 113 extern void fibril_rwlock_write_unlock(fibril_rwlock_t *); 114 extern bool fibril_rwlock_is_read_locked(fibril_rwlock_t *); 115 extern bool fibril_rwlock_is_write_locked(fibril_rwlock_t *); 116 extern bool fibril_rwlock_is_locked(fibril_rwlock_t *); 113 117 114 118 extern void fibril_condvar_initialize(fibril_condvar_t *); -
uspace/lib/c/include/ipc/devman.h
r59e9398b rb2d06fa 123 123 DEVMAN_CLIENT, 124 124 DEVMAN_CONNECT_TO_DEVICE, 125 DEVMAN_CONNECT_FROM_DEVMAP, 125 126 DEVMAN_CONNECT_TO_PARENTS_DEVICE 126 127 } devman_interface_t; -
uspace/lib/packet/generic/packet_server.c
r59e9398b rb2d06fa 135 135 /** Creates a new packet of dimensions at least as given. 136 136 * 137 * Should be used only when the global data are locked.138 *139 137 * @param[in] length The total length of the packet, including the header, 140 138 * the addresses and the data of the packet. … … 153 151 packet_t *packet; 154 152 int rc; 153 154 assert(fibril_mutex_is_locked(&ps_globals.lock)); 155 155 156 156 // already locked … … 233 233 /** Release the packet and returns it to the appropriate free packet queue. 234 234 * 235 * Should be used only when the global data are locked.236 *237 235 * @param[in] packet The packet to be released. 238 236 * … … 242 240 int index; 243 241 int result; 242 243 assert(fibril_mutex_is_locked(&ps_globals.lock)); 244 244 245 245 for (index = 0; (index < FREE_QUEUES_COUNT - 1) && -
uspace/srv/devman/devman.c
r59e9398b rb2d06fa 62 62 } 63 63 64 static int devmap_devices_class_compare(unsigned long key[], hash_count_t keys, 65 link_t *item) 66 { 67 dev_class_info_t *class_info 68 = hash_table_get_instance(item, dev_class_info_t, devmap_link); 69 assert(class_info != NULL); 70 71 return (class_info->devmap_handle == (devmap_handle_t) key[0]); 72 } 73 64 74 static void devices_remove_callback(link_t *item) 65 75 { … … 75 85 .hash = devices_hash, 76 86 .compare = devmap_devices_compare, 87 .remove_callback = devices_remove_callback 88 }; 89 90 static hash_table_operations_t devmap_devices_class_ops = { 91 .hash = devices_hash, 92 .compare = devmap_devices_class_compare, 77 93 .remove_callback = devices_remove_callback 78 94 }; … … 368 384 printf(NAME ": create_root_node\n"); 369 385 386 fibril_rwlock_write_lock(&tree->rwlock); 370 387 node = create_dev_node(); 371 388 if (node != NULL) { … … 377 394 tree->root_node = node; 378 395 } 396 fibril_rwlock_write_unlock(&tree->rwlock); 379 397 380 398 return node != NULL; … … 439 457 /** Start a driver 440 458 * 441 * The driver's mutex is assumed to be locked.442 *443 459 * @param drv The driver's structure. 444 460 * @return True if the driver's task is successfully spawned, false … … 449 465 int rc; 450 466 467 assert(fibril_mutex_is_locked(&drv->driver_mutex)); 468 451 469 printf(NAME ": start_driver '%s'\n", drv->name); 452 470 … … 670 688 } 671 689 672 devmap_device_register(devmap_pathname, &node->devmap_handle); 690 devmap_device_register_with_iface(devmap_pathname, 691 &node->devmap_handle, DEVMAN_CONNECT_FROM_DEVMAP); 673 692 674 693 tree_add_devmap_device(tree, node); … … 842 861 /** Find the device node structure of the device witch has the specified handle. 843 862 * 844 * Device tree's rwlock should be held at least for reading.845 *846 863 * @param tree The device tree where we look for the device node. 847 864 * @param handle The handle of the device. … … 851 868 { 852 869 unsigned long key = handle; 853 link_t *link = hash_table_find(&tree->devman_devices, &key); 870 link_t *link; 871 872 assert(fibril_rwlock_is_locked(&tree->rwlock)); 873 874 link = hash_table_find(&tree->devman_devices, &key); 854 875 return hash_table_get_instance(link, node_t, devman_link); 855 876 } … … 907 928 /** Insert new device into device tree. 908 929 * 909 * The device tree's rwlock should be already held exclusively when calling this910 * function.911 *912 930 * @param tree The device tree. 913 931 * @param node The newly added device node. … … 924 942 assert(tree != NULL); 925 943 assert(dev_name != NULL); 944 assert(fibril_rwlock_is_write_locked(&tree->rwlock)); 926 945 927 946 node->name = dev_name; … … 1042 1061 1043 1062 info = (dev_class_info_t *) malloc(sizeof(dev_class_info_t)); 1044 if (info != NULL) 1063 if (info != NULL) { 1045 1064 memset(info, 0, sizeof(dev_class_info_t)); 1065 list_initialize(&info->dev_classes); 1066 list_initialize(&info->devmap_link); 1067 list_initialize(&info->link); 1068 } 1046 1069 1047 1070 return info; … … 1167 1190 fibril_rwlock_initialize(&class_list->rwlock); 1168 1191 hash_table_create(&class_list->devmap_devices, DEVICE_BUCKETS, 1, 1169 &devmap_devices_ ops);1192 &devmap_devices_class_ops); 1170 1193 } 1171 1194 … … 1215 1238 hash_table_insert(&class_list->devmap_devices, &key, &cli->devmap_link); 1216 1239 fibril_rwlock_write_unlock(&class_list->rwlock); 1240 1241 assert(find_devmap_class_device(class_list, cli->devmap_handle) != NULL); 1217 1242 } 1218 1243 -
uspace/srv/devman/main.c
r59e9398b rb2d06fa 281 281 * handle. 282 282 */ 283 devmap_device_register(devmap_pathname, &cli->devmap_handle); 283 devmap_device_register_with_iface(devmap_pathname, 284 &cli->devmap_handle, DEVMAN_CONNECT_FROM_DEVMAP); 284 285 285 286 /* … … 486 487 static void devman_connection_devmapper(ipc_callid_t iid, ipc_call_t *icall) 487 488 { 488 devmap_handle_t devmap_handle = IPC_GET_ IMETHOD(*icall);489 devmap_handle_t devmap_handle = IPC_GET_ARG2(*icall); 489 490 node_t *dev; 490 491 … … 503 504 } 504 505 505 printf(NAME ": devman_connection_devmapper: forward connection to "506 "device %s to driver %s.\n", dev->pathname, dev->drv->name);507 506 ipc_forward_fast(iid, dev->drv->phone, DRIVER_CLIENT, dev->handle, 0, 508 507 IPC_FF_NONE); 508 printf(NAME ": devman_connection_devmapper: forwarded connection to " 509 "device %s to driver %s.\n", dev->pathname, dev->drv->name); 509 510 } 510 511 … … 512 513 static void devman_connection(ipc_callid_t iid, ipc_call_t *icall) 513 514 { 514 /*515 * Silly hack to enable the device manager to register as a driver by516 * the device mapper. If the ipc method is not IPC_M_CONNECT_ME_TO, this517 * is not the forwarded connection from naming service, so it must be a518 * connection from the devmapper which thinks this is a devmapper-style519 * driver. So pretend this is a devmapper-style driver. (This does not520 * work for device with handle == IPC_M_CONNECT_ME_TO, because devmapper521 * passes device handle to the driver as an ipc method.)522 */523 if (IPC_GET_IMETHOD(*icall) != IPC_M_CONNECT_ME_TO)524 devman_connection_devmapper(iid, icall);525 526 /*527 * ipc method is IPC_M_CONNECT_ME_TO, so this is forwarded connection528 * from naming service by which we registered as device manager, so be529 * device manager.530 */531 532 515 /* Select interface. */ 533 516 switch ((sysarg_t) (IPC_GET_ARG1(*icall))) { … … 542 525 devman_forward(iid, icall, false); 543 526 break; 527 case DEVMAN_CONNECT_FROM_DEVMAP: 528 /* Someone connected through devmap node. */ 529 devman_connection_devmapper(iid, icall); 530 break; 544 531 case DEVMAN_CONNECT_TO_PARENTS_DEVICE: 545 532 /* Connect client to selected device. */ -
uspace/srv/devmap/devmap.c
r59e9398b rb2d06fa 46 46 #include <str.h> 47 47 #include <ipc/devmap.h> 48 #include <assert.h> 48 49 49 50 #define NAME "devmap" … … 99 100 /** Device driver handling this device */ 100 101 devmap_driver_t *driver; 102 /** Use this interface when forwarding to driver. */ 103 sysarg_t forward_interface; 101 104 } devmap_device_t; 102 105 … … 206 209 } 207 210 208 /** Find namespace with given name. 209 * 210 * The devices_list_mutex should be already held when 211 * calling this function. 212 * 213 */ 211 /** Find namespace with given name. */ 214 212 static devmap_namespace_t *devmap_namespace_find_name(const char *name) 215 213 { 216 214 link_t *item; 215 216 assert(fibril_mutex_is_locked(&devices_list_mutex)); 217 217 218 for (item = namespaces_list.next; item != &namespaces_list; item = item->next) { 218 219 devmap_namespace_t *namespace = … … 227 228 /** Find namespace with given handle. 228 229 * 229 * The devices_list_mutex should be already held when230 * calling this function.231 *232 230 * @todo: use hash table 233 231 * … … 236 234 { 237 235 link_t *item; 236 237 assert(fibril_mutex_is_locked(&devices_list_mutex)); 238 238 239 for (item = namespaces_list.next; item != &namespaces_list; item = item->next) { 239 240 devmap_namespace_t *namespace = … … 246 247 } 247 248 248 /** Find device with given name. 249 * 250 * The devices_list_mutex should be already held when 251 * calling this function. 252 * 253 */ 249 /** Find device with given name. */ 254 250 static devmap_device_t *devmap_device_find_name(const char *ns_name, 255 251 const char *name) 256 252 { 257 253 link_t *item; 254 255 assert(fibril_mutex_is_locked(&devices_list_mutex)); 256 258 257 for (item = devices_list.next; item != &devices_list; item = item->next) { 259 258 devmap_device_t *device = … … 269 268 /** Find device with given handle. 270 269 * 271 * The devices_list_mutex should be already held when272 * calling this function.273 *274 270 * @todo: use hash table 275 271 * … … 278 274 { 279 275 link_t *item; 276 277 assert(fibril_mutex_is_locked(&devices_list_mutex)); 278 280 279 for (item = devices_list.next; item != &devices_list; item = item->next) { 281 280 devmap_device_t *device = … … 288 287 } 289 288 290 /** Create a namespace (if not already present) 291 * 292 * The devices_list_mutex should be already held when 293 * calling this function. 294 * 295 */ 289 /** Create a namespace (if not already present). */ 296 290 static devmap_namespace_t *devmap_namespace_create(const char *ns_name) 297 291 { 298 devmap_namespace_t *namespace = devmap_namespace_find_name(ns_name); 292 devmap_namespace_t *namespace; 293 294 assert(fibril_mutex_is_locked(&devices_list_mutex)); 295 296 namespace = devmap_namespace_find_name(ns_name); 299 297 if (namespace != NULL) 300 298 return namespace; … … 321 319 } 322 320 323 /** Destroy a namespace (if it is no longer needed) 324 * 325 * The devices_list_mutex should be already held when 326 * calling this function. 327 * 328 */ 321 /** Destroy a namespace (if it is no longer needed). */ 329 322 static void devmap_namespace_destroy(devmap_namespace_t *namespace) 330 323 { 324 assert(fibril_mutex_is_locked(&devices_list_mutex)); 325 331 326 if (namespace->refcnt == 0) { 332 327 list_remove(&(namespace->namespaces)); … … 337 332 } 338 333 339 /** Increase namespace reference count by including device 340 * 341 * The devices_list_mutex should be already held when 342 * calling this function. 343 * 344 */ 334 /** Increase namespace reference count by including device. */ 345 335 static void devmap_namespace_addref(devmap_namespace_t *namespace, 346 336 devmap_device_t *device) 347 337 { 338 assert(fibril_mutex_is_locked(&devices_list_mutex)); 339 348 340 device->namespace = namespace; 349 341 namespace->refcnt++; 350 342 } 351 343 352 /** Decrease namespace reference count 353 * 354 * The devices_list_mutex should be already held when 355 * calling this function. 356 * 357 */ 344 /** Decrease namespace reference count. */ 358 345 static void devmap_namespace_delref(devmap_namespace_t *namespace) 359 346 { 347 assert(fibril_mutex_is_locked(&devices_list_mutex)); 348 360 349 namespace->refcnt--; 361 350 devmap_namespace_destroy(namespace); 362 351 } 363 352 364 /** Unregister device and free it 365 * 366 * The devices_list_mutex should be already held when 367 * calling this function. 368 * 369 */ 353 /** Unregister device and free it. */ 370 354 static void devmap_device_unregister_core(devmap_device_t *device) 371 355 { 356 assert(fibril_mutex_is_locked(&devices_list_mutex)); 357 372 358 devmap_namespace_delref(device->namespace); 373 359 list_remove(&(device->devices)); … … 517 503 } 518 504 505 /* Set the interface, if any. */ 506 device->forward_interface = IPC_GET_ARG1(*icall); 507 519 508 /* Get fqdn */ 520 509 char *fqdn; … … 566 555 /* Get unique device handle */ 567 556 device->handle = devmap_create_handle(); 568 557 569 558 devmap_namespace_addref(namespace, device); 570 559 device->driver = driver; … … 617 606 } 618 607 619 ipc_forward_fast(callid, dev->driver->phone, dev->handle, 620 IPC_GET_ARG3(*call), 0, IPC_FF_NONE); 608 if (dev->forward_interface == 0) { 609 ipc_forward_fast(callid, dev->driver->phone, 610 dev->handle, 0, 0, 611 IPC_FF_NONE); 612 } else { 613 ipc_forward_fast(callid, dev->driver->phone, 614 dev->forward_interface, dev->handle, 0, 615 IPC_FF_NONE); 616 } 621 617 622 618 fibril_mutex_unlock(&devices_list_mutex); -
uspace/srv/fs/devfs/devfs_ops.c
r59e9398b rb2d06fa 60 60 typedef struct { 61 61 devmap_handle_t handle; 62 int phone; 62 int phone; /**< When < 0, the structure is incomplete. */ 63 63 size_t refcount; 64 64 link_t link; 65 fibril_condvar_t cv; /**< Broadcast when completed. */ 65 66 } device_t; 66 67 … … 227 228 [DEVICES_KEY_HANDLE] = (unsigned long) node->handle 228 229 }; 229 230 link_t *lnk; 231 230 232 fibril_mutex_lock(&devices_mutex); 231 link_t *lnk = hash_table_find(&devices, key); 233 restart: 234 lnk = hash_table_find(&devices, key); 232 235 if (lnk == NULL) { 233 236 device_t *dev = (device_t *) malloc(sizeof(device_t)); … … 237 240 } 238 241 242 dev->handle = node->handle; 243 dev->phone = -1; /* mark as incomplete */ 244 dev->refcount = 1; 245 fibril_condvar_initialize(&dev->cv); 246 247 /* 248 * Insert the incomplete device structure so that other 249 * fibrils will not race with us when we drop the mutex 250 * below. 251 */ 252 hash_table_insert(&devices, key, &dev->link); 253 254 /* 255 * Drop the mutex to allow recursive devfs requests. 256 */ 257 fibril_mutex_unlock(&devices_mutex); 258 239 259 int phone = devmap_device_connect(node->handle, 0); 260 261 fibril_mutex_lock(&devices_mutex); 262 263 /* 264 * Notify possible waiters about this device structure 265 * being completed (or destroyed). 266 */ 267 fibril_condvar_broadcast(&dev->cv); 268 240 269 if (phone < 0) { 270 /* 271 * Connecting failed, need to remove the 272 * entry and free the device structure. 273 */ 274 hash_table_remove(&devices, key, DEVICES_KEYS); 241 275 fibril_mutex_unlock(&devices_mutex); 276 242 277 free(dev); 243 278 return ENOENT; 244 279 } 245 280 246 dev->handle = node->handle;281 /* Set the correct phone. */ 247 282 dev->phone = phone; 248 dev->refcount = 1;249 250 hash_table_insert(&devices, key, &dev->link);251 283 } else { 252 284 device_t *dev = hash_table_get_instance(lnk, device_t, link); 285 286 if (dev->phone < 0) { 287 /* 288 * Wait until the device structure is completed 289 * and start from the beginning as the device 290 * structure might have entirely disappeared 291 * while we were not holding the mutex in 292 * fibril_condvar_wait(). 293 */ 294 fibril_condvar_wait(&dev->cv, &devices_mutex); 295 goto restart; 296 } 297 253 298 dev->refcount++; 254 299 } … … 564 609 565 610 device_t *dev = hash_table_get_instance(lnk, device_t, link); 611 assert(dev->phone >= 0); 566 612 567 613 ipc_callid_t callid; … … 627 673 628 674 device_t *dev = hash_table_get_instance(lnk, device_t, link); 675 assert(dev->phone >= 0); 629 676 630 677 ipc_callid_t callid; … … 696 743 697 744 device_t *dev = hash_table_get_instance(lnk, device_t, link); 745 assert(dev->phone >= 0); 698 746 dev->refcount--; 699 747 … … 743 791 744 792 device_t *dev = hash_table_get_instance(lnk, device_t, link); 793 assert(dev->phone >= 0); 745 794 746 795 /* Make a request at the driver */ -
uspace/srv/net/tl/tcp/tcp.c
r59e9398b rb2d06fa 1803 1803 fibril_rwlock_write_unlock(socket_data->local_lock); 1804 1804 1805 socket_data->state = TCP_SOCKET_SYN_SENT; 1806 1805 1807 /* Send the packet */ 1806 1808 printf("connecting %d\n", packet_get_id(packet)); … … 2085 2087 if (!fibril) { 2086 2088 free(operation_timeout); 2087 return EPARTY; /* FIXME: use another EC */ 2088 } 2089 return ENOMEM; 2090 } 2091 2089 2092 // fibril_mutex_lock(&socket_data->operation.mutex); 2090 2093 /* Start the timeout fibril */ -
uspace/srv/vfs/vfs_lookup.c
r59e9398b rb2d06fa 179 179 fibril_mutex_unlock(&plb_mutex); 180 180 181 if (( (int) rc < EOK) || (!result))181 if ((int) rc < EOK) 182 182 return (int) rc; 183 184 if (!result) 185 return EOK; 183 186 184 187 result->triplet.fs_handle = (fs_handle_t) rc;
Note:
See TracChangeset
for help on using the changeset viewer.