Checked one of Marcus' comments in int.c, and changed the list initialization
to use the newly provided function for this. module.c now also uses the initque() function, some minor cleanups. git-svn-id: file:///srv/svn/repos/haiku/trunk/current@1973 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -100,11 +100,9 @@ install_interrupt_handler(long vector, interrupt_handler handler, void *data)
|
|||||||
state = disable_interrupts();
|
state = disable_interrupts();
|
||||||
acquire_spinlock(&io_vectors[vector].vector_lock);
|
acquire_spinlock(&io_vectors[vector].vector_lock);
|
||||||
|
|
||||||
/* Make sure our list is init'd or bad things will happen */ //XXX this should not be needed
|
/* The list must be inited before the first item is inserted */
|
||||||
if (io_vectors[vector].handler_list.next == NULL) {
|
if (io_vectors[vector].handler_list.next == NULL)
|
||||||
io_vectors[vector].handler_list.next = &io_vectors[vector].handler_list;
|
initque(&io_vectors[vector].handler_list);
|
||||||
io_vectors[vector].handler_list.prev = &io_vectors[vector].handler_list;
|
|
||||||
}
|
|
||||||
|
|
||||||
insque(io, &io_vectors[vector].handler_list);
|
insque(io, &io_vectors[vector].handler_list);
|
||||||
|
|
||||||
|
|||||||
+14
-12
@@ -790,15 +790,15 @@ module_enter_base_path(module_iterator *iter)
|
|||||||
|
|
||||||
++iter->base_path_id;
|
++iter->base_path_id;
|
||||||
|
|
||||||
if (iter->base_path_id >= (int)num_module_paths ) {
|
if (iter->base_path_id >= (int)num_module_paths) {
|
||||||
SHOW_FLOW0( 3, "no locations left\n" );
|
SHOW_FLOW0(3, "no locations left\n");
|
||||||
return ENOENT;
|
return ENOENT;
|
||||||
}
|
}
|
||||||
|
|
||||||
SHOW_FLOW(3, "trying base path (%s)\n", module_paths[iter->base_path_id]);
|
SHOW_FLOW(3, "trying base path (%s)\n", module_paths[iter->base_path_id]);
|
||||||
|
|
||||||
if (iter->base_path_id == 0 && modules_disable_user_addons) {
|
if (iter->base_path_id == 0 && modules_disable_user_addons) {
|
||||||
SHOW_FLOW0( 3, "ignoring user add-ons (they are disabled)\n" );
|
SHOW_FLOW0(3, "ignoring user add-ons (they are disabled)\n");
|
||||||
return B_NO_ERROR;
|
return B_NO_ERROR;
|
||||||
}
|
}
|
||||||
strcpy(path, module_paths[iter->base_path_id]);
|
strcpy(path, module_paths[iter->base_path_id]);
|
||||||
@@ -826,7 +826,7 @@ open_module_list(const char *prefix)
|
|||||||
{
|
{
|
||||||
module_iterator *iter;
|
module_iterator *iter;
|
||||||
|
|
||||||
SHOW_FLOW( 3, "prefix: %s\n", prefix );
|
SHOW_FLOW(3, "prefix: %s\n", prefix);
|
||||||
|
|
||||||
iter = (module_iterator *)malloc(sizeof( module_iterator));
|
iter = (module_iterator *)malloc(sizeof( module_iterator));
|
||||||
if (!iter)
|
if (!iter)
|
||||||
@@ -898,12 +898,12 @@ close_module_list(void *cookie)
|
|||||||
{
|
{
|
||||||
module_iterator *iter = (module_iterator *)cookie;
|
module_iterator *iter = (module_iterator *)cookie;
|
||||||
|
|
||||||
SHOW_FLOW0( 3, "\n" );
|
SHOW_FLOW0(3, "\n");
|
||||||
|
|
||||||
if (!iter )
|
if (!iter)
|
||||||
return EINVAL;
|
return EINVAL;
|
||||||
|
|
||||||
while(iter->cur_dir)
|
while (iter->cur_dir)
|
||||||
module_leave_dir(iter);
|
module_leave_dir(iter);
|
||||||
|
|
||||||
free(iter->prefix);
|
free(iter->prefix);
|
||||||
@@ -912,14 +912,16 @@ close_module_list(void *cookie)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/* module_init
|
/* module_init
|
||||||
* setup module structures and data for use
|
* setup module structures and data for use
|
||||||
*/
|
*/
|
||||||
|
|
||||||
status_t
|
status_t
|
||||||
module_init(kernel_args *ka, module_info **sys_module_headers)
|
module_init(kernel_args *ka, module_info **sys_module_headers)
|
||||||
{
|
{
|
||||||
SHOW_FLOW0( 0, "\n" );
|
SHOW_FLOW0(0, "\n");
|
||||||
recursive_lock_create( &modules_lock );
|
recursive_lock_create(&modules_lock);
|
||||||
|
|
||||||
modules_list = hash_make();
|
modules_list = hash_make();
|
||||||
module_files = hash_make();
|
module_files = hash_make();
|
||||||
@@ -927,8 +929,8 @@ module_init(kernel_args *ka, module_info **sys_module_headers)
|
|||||||
if (modules_list == NULL || module_files == NULL)
|
if (modules_list == NULL || module_files == NULL)
|
||||||
return ENOMEM;
|
return ENOMEM;
|
||||||
|
|
||||||
loaded_modules.next = loaded_modules.prev = &loaded_modules;
|
initque(&loaded_modules);
|
||||||
known_modules.next = known_modules.prev = &known_modules;
|
initque(&known_modules);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
if (sys_module_headers) {
|
if (sys_module_headers) {
|
||||||
@@ -937,7 +939,7 @@ module_init(kernel_args *ka, module_info **sys_module_headers)
|
|||||||
}
|
}
|
||||||
*/
|
*/
|
||||||
|
|
||||||
return B_NO_ERROR;
|
return B_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user