From b132797ec38dac2755fdc8954689aa1318f45f52 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Axel=20D=C3=B6rfler?= Date: Mon, 8 Sep 2003 02:41:05 +0000 Subject: [PATCH] Made the module working in the boot loader. git-svn-id: file:///srv/svn/repos/haiku/trunk/current@4552 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- .../kernel/partitioning_systems/intel/Jamfile | 1 + .../intel/PartitionMap.cpp | 8 +++-- .../partitioning_systems/intel/intel.cpp | 32 +++++++++++++++++-- 3 files changed, 37 insertions(+), 4 deletions(-) diff --git a/src/add-ons/kernel/partitioning_systems/intel/Jamfile b/src/add-ons/kernel/partitioning_systems/intel/Jamfile index 534cb6f35e..93ca0f38c8 100644 --- a/src/add-ons/kernel/partitioning_systems/intel/Jamfile +++ b/src/add-ons/kernel/partitioning_systems/intel/Jamfile @@ -2,6 +2,7 @@ SubDir OBOS_TOP src add-ons kernel partitioning_systems intel ; #UsePrivateHeaders $(DOT) ; UsePrivateHeaders [ FDirName kernel disk_device_manager ] ; +UsePrivateHeaders [ FDirName kernel ] ; UsePrivateHeaders [ FDirName storage ] ; # For now build a userland version only. diff --git a/src/add-ons/kernel/partitioning_systems/intel/PartitionMap.cpp b/src/add-ons/kernel/partitioning_systems/intel/PartitionMap.cpp index 2a9e339bb4..fbb0bb3f8a 100644 --- a/src/add-ons/kernel/partitioning_systems/intel/PartitionMap.cpp +++ b/src/add-ons/kernel/partitioning_systems/intel/PartitionMap.cpp @@ -8,12 +8,16 @@ of related classes. */ -#include #include #include #include -#include +#include +#ifndef _BOOT_MODE +# include +#else +# include +#endif #include #include "PartitionMap.h" diff --git a/src/add-ons/kernel/partitioning_systems/intel/intel.cpp b/src/add-ons/kernel/partitioning_systems/intel/intel.cpp index 016a572807..4ac24f25d9 100644 --- a/src/add-ons/kernel/partitioning_systems/intel/intel.cpp +++ b/src/add-ons/kernel/partitioning_systems/intel/intel.cpp @@ -13,14 +13,18 @@ // descriptor or the whole partition table sector. #include -#include #include #include #include #include +#include #include -#include +#ifndef _BOOT_MODE +# include +#else +# include +#endif #include #include "PartitionMap.h" @@ -266,9 +270,13 @@ PartitionMapParser::_ReadPTS(off_t offset, partition_table_sector *pts) // read } else if (read_pos(fDeviceFD, fSessionOffset + offset, pts, toRead) != toRead) { +#ifndef _BOOT_MODE error = errno; if (error == B_OK) error = B_IO_ERROR; +#else + error = B_IO_ERROR; +#endif TRACE(("intel: _ReadPTS(): reading the PTS failed: %s\n", strerror(error))); } @@ -299,7 +307,11 @@ static bool pm_validate_resize_child(partition_data *partition, partition_data *child, off_t *size); +#ifdef _BOOT_MODE +partition_module_info gIntelPartitionMapModule = { +#else static partition_module_info intel_partition_map_module = { +#endif { kPartitionMapModuleName, 0, @@ -315,6 +327,7 @@ static partition_module_info intel_partition_map_module = { pm_free_partition_cookie, // free_partition_cookie pm_free_partition_content_cookie, // free_partition_content_cookie +#ifndef _BOOT_MODE // querying NULL, // supports_repairing NULL, // supports_resizing @@ -364,6 +377,9 @@ static partition_module_info intel_partition_map_module = { NULL, // initialize NULL, // create_child NULL, // delete_child +#else + NULL +#endif // _BOOT_MODE }; @@ -382,7 +398,11 @@ static void ep_free_identify_partition_cookie(partition_data *partition, static void ep_free_partition_cookie(partition_data *partition); static void ep_free_partition_content_cookie(partition_data *partition); +#ifdef _BOOT_MODE +partition_module_info gIntelExtendedPartitionModule = { +#else static partition_module_info intel_extended_partition_module = { +#endif { kExtendedPartitionModuleName, 0, @@ -398,6 +418,7 @@ static partition_module_info intel_extended_partition_module = { ep_free_partition_cookie, // free_partition_cookie ep_free_partition_content_cookie, // free_partition_content_cookie +#ifndef _BOOT_MODE // querying NULL, // supports_repairing NULL, // supports_resizing @@ -447,9 +468,13 @@ static partition_module_info intel_extended_partition_module = { NULL, // initialize NULL, // create_child NULL, // delete_child +#else + NULL +#endif // _BOOT_MODE }; +#ifndef _BOOT_MODE extern "C" partition_module_info *modules[]; _EXPORT partition_module_info *modules[] = { @@ -457,6 +482,7 @@ _EXPORT partition_module_info *modules[] = &intel_extended_partition_module, NULL }; +#endif // intel partition map module @@ -616,6 +642,7 @@ pm_free_partition_content_cookie(partition_data *partition) } } +#ifndef _BOOT_MODE // pm_supports_resizing_child static bool @@ -663,6 +690,7 @@ pm_validate_resize_child(partition_data *partition, partition_data *child, *size = *size / partition->block_size * partition->block_size; return true; } +#endif // _BOOT_MODE // intel extended partition module