3 #include <ddekit/initcall.h>
6 #ifdef DDEKIT_DEBUG_INITCALL
8 #define DDEBUG DDEKIT_DEBUG_INITCALL
13 static struct __ddekit_initcall_s head
= {0,0,0};
15 /****************************************************************************/
16 /* __ddekit_add_initcall */
17 /****************************************************************************/
18 void __attribute__((used
))
19 __ddekit_add_initcall(struct __ddekit_initcall_s
* ic
) {
21 /* This function is required for the DDEKIT_INITCALL makro */
23 struct __ddekit_initcall_s
*i
= 0;
25 DDEBUG_MSG_VERBOSE("adding initcall (%p) to %p with prio %d head at %p",
26 ic
, ic
->func
, ic
->prio
, &head
);
28 for (i
= &head
; i
; i
=i
->next
)
34 if (i
->next
->prio
> ic
->prio
) {
42 /****************************************************************************/
43 /* ddekit_do_initcalls */
44 /****************************************************************************/
45 void ddekit_do_initcalls()
47 struct __ddekit_initcall_s
*i
= 0;
49 DDEBUG_MSG_VERBOSE("exectuing initcalls (head at %p, head->next = %p)",
52 for (i
= head
.next
; i
; i
=i
->next
) {
53 DDEBUG_MSG_VERBOSE("executing initcall: %p with prio %d",