From 2664bace2e43940eed36e6ba2eeb367b7070ece5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Axel=20D=C3=B6rfler?= Date: Tue, 14 Oct 2003 00:33:11 +0000 Subject: [PATCH] Changed to use the DoublyLinked::List implementation. git-svn-id: file:///srv/svn/repos/haiku/trunk/current@5019 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/kernel/boot/platform/openfirmware/devices.cpp | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/src/kernel/boot/platform/openfirmware/devices.cpp b/src/kernel/boot/platform/openfirmware/devices.cpp index 617f5294cc..aa3c7fb2c4 100644 --- a/src/kernel/boot/platform/openfirmware/devices.cpp +++ b/src/kernel/boot/platform/openfirmware/devices.cpp @@ -85,7 +85,9 @@ platform_get_boot_device(struct stage2_args *args, Node **_device) { // print out the boot path (to be removed later?) - of_getprop(gChosen, "bootpath", sBootPath, sizeof(sBootPath)); + int length = of_getprop(gChosen, "bootpath", sBootPath, sizeof(sBootPath)); + if (length <= 1) + return B_ENTRY_NOT_FOUND; printf("boot path = \"%s\"\n", sBootPath); int node = of_finddevice(sBootPath); @@ -112,11 +114,12 @@ platform_get_boot_device(struct stage2_args *args, Node **_device) status_t -platform_get_boot_partition(struct stage2_args *args, struct list *list, +platform_get_boot_partition(struct stage2_args *args, NodeList *list, boot::Partition **_partition) { + NodeIterator iterator = list->Iterator(); boot::Partition *partition = NULL; - while ((partition = (boot::Partition *)list_get_next_item(list, partition)) != NULL) { + while ((partition = (boot::Partition *)iterator.Next()) != NULL) { // ToDo: just take the first partition for now *_partition = partition; return B_OK; @@ -127,7 +130,7 @@ platform_get_boot_partition(struct stage2_args *args, struct list *list, status_t -platform_add_block_devices(stage2_args *args, list *devicesList) +platform_add_block_devices(stage2_args *args, NodeList *devicesList) { // add all block devices to the list of possible boot devices @@ -147,10 +150,10 @@ platform_add_block_devices(stage2_args *args, list *devicesList) continue; } - printf("\t\t(could open device, handle = %p)\n", (void *)handle); Handle *device = new Handle(handle); + printf("\t\t(could open device, handle = %p, node = %p)\n", (void *)handle, device); - list_add_item(devicesList, device); + devicesList->Add(device); } printf("\t(loop ended with %ld)\n", status);