2 * Copyright 2005-2008, Axel Dörfler, axeld@pinc-software.de. All rights reserved.
3 * Distributed under the terms of the MIT License.
8 #include <util/DoublyLinkedList.h>
9 #include <util/kernel_cpp.h>
14 // ToDo: the boot items are not supposed to be changed after kernel startup
15 // so no locking is done. So for now, we need to be careful with adding
18 struct boot_item
: public DoublyLinkedListLinkImpl
<boot_item
> {
24 typedef DoublyLinkedList
<boot_item
> ItemList
;
27 static ItemList sItemList
;
31 add_boot_item(const char *name
, void *data
, size_t size
)
33 boot_item
*item
= new(nothrow
) boot_item
;
47 get_boot_item(const char *name
, size_t *_size
)
49 if (name
== NULL
|| name
[0] == '\0')
53 for (ItemList::Iterator it
= sItemList
.GetIterator(); it
.HasNext();) {
54 boot_item
*item
= it
.Next();
56 if (!strcmp(name
, item
->name
)) {
71 new(&sItemList
) ItemList
;
72 // static initializers do not work in the kernel,
73 // so we have to do it here, manually