Moved queue functionality out of module.c and into kqueue.h.

Changed module.c and int.c to use that one.
Some minor cleanups in module.c.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@1744 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Axel Dörfler 2002-10-29 03:42:40 +00:00
parent b026d723ba
commit 88fae79de6
2 changed files with 38 additions and 65 deletions

View File

@ -13,6 +13,7 @@
#include <stage2.h>
#include <string.h>
#include <stdio.h>
#include <kqueue.h>
#define NUM_IO_VECTORS 256

View File

@ -1,4 +1,4 @@
/* Module manager. Uses hash.c */
/* Module manager */
/*
** Copyright 2001, Thomas Kurschel. All rights reserved.
@ -12,6 +12,7 @@
#include <arch/cpu.h>
#include <debug.h>
#include <khash.h>
#include <kqueue.h>
#include <memheap.h>
#include <elf.h>
#include <stdio.h>
@ -137,35 +138,6 @@ typedef struct module_dir_iterator {
} module_dir_iterator;
/* XXX - These should really be in a header so they are system wide... */
/* These are GCC only, so we'll need PPC version eventually... */
struct quehead {
struct quehead *qh_link;
struct quehead *qh_rlink;
};
__inline void
insque(void *a, void *b)
{
struct quehead *element = (struct quehead *)a,
*head = (struct quehead *)b;
element->qh_link = head->qh_link;
element->qh_rlink = head;
head->qh_link = element;
element->qh_link->qh_rlink = element;
}
__inline void
remque(void *a)
{
struct quehead *element = (struct quehead *)a;
element->qh_link->qh_rlink = element->qh_rlink;
element->qh_rlink->qh_link = element->qh_link;
element->qh_rlink = 0;
}
/* XXX locking scheme: there is a global lock only; having several locks
* makes trouble if dependent modules get loaded concurrently ->
* they have to wait for each other, i.e. we need one lock per module;