Made the module working in the boot loader.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@4552 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -2,6 +2,7 @@ SubDir OBOS_TOP src add-ons kernel partitioning_systems intel ;
|
|||||||
|
|
||||||
#UsePrivateHeaders $(DOT) ;
|
#UsePrivateHeaders $(DOT) ;
|
||||||
UsePrivateHeaders [ FDirName kernel disk_device_manager ] ;
|
UsePrivateHeaders [ FDirName kernel disk_device_manager ] ;
|
||||||
|
UsePrivateHeaders [ FDirName kernel ] ;
|
||||||
UsePrivateHeaders [ FDirName storage ] ;
|
UsePrivateHeaders [ FDirName storage ] ;
|
||||||
|
|
||||||
# For now build a userland version only.
|
# For now build a userland version only.
|
||||||
|
|||||||
@@ -8,12 +8,16 @@
|
|||||||
of related classes.
|
of related classes.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <new.h>
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
||||||
#include <DiskDeviceTypes.h>
|
#include <util/kernel_cpp.h>
|
||||||
|
#ifndef _BOOT_MODE
|
||||||
|
# include <DiskDeviceTypes.h>
|
||||||
|
#else
|
||||||
|
# include <boot/partitions.h>
|
||||||
|
#endif
|
||||||
#include <KernelExport.h>
|
#include <KernelExport.h>
|
||||||
|
|
||||||
#include "PartitionMap.h"
|
#include "PartitionMap.h"
|
||||||
|
|||||||
@@ -13,14 +13,18 @@
|
|||||||
// descriptor or the whole partition table sector.
|
// descriptor or the whole partition table sector.
|
||||||
|
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
#include <new>
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
|
|
||||||
|
#include <util/kernel_cpp.h>
|
||||||
#include <ddm_modules.h>
|
#include <ddm_modules.h>
|
||||||
#include <DiskDeviceTypes.h>
|
#ifndef _BOOT_MODE
|
||||||
|
# include <DiskDeviceTypes.h>
|
||||||
|
#else
|
||||||
|
# include <boot/partitions.h>
|
||||||
|
#endif
|
||||||
#include <KernelExport.h>
|
#include <KernelExport.h>
|
||||||
|
|
||||||
#include "PartitionMap.h"
|
#include "PartitionMap.h"
|
||||||
@@ -266,9 +270,13 @@ PartitionMapParser::_ReadPTS(off_t offset, partition_table_sector *pts)
|
|||||||
// read
|
// read
|
||||||
} else if (read_pos(fDeviceFD, fSessionOffset + offset, pts, toRead)
|
} else if (read_pos(fDeviceFD, fSessionOffset + offset, pts, toRead)
|
||||||
!= toRead) {
|
!= toRead) {
|
||||||
|
#ifndef _BOOT_MODE
|
||||||
error = errno;
|
error = errno;
|
||||||
if (error == B_OK)
|
if (error == B_OK)
|
||||||
error = B_IO_ERROR;
|
error = B_IO_ERROR;
|
||||||
|
#else
|
||||||
|
error = B_IO_ERROR;
|
||||||
|
#endif
|
||||||
TRACE(("intel: _ReadPTS(): reading the PTS failed: %s\n",
|
TRACE(("intel: _ReadPTS(): reading the PTS failed: %s\n",
|
||||||
strerror(error)));
|
strerror(error)));
|
||||||
}
|
}
|
||||||
@@ -299,7 +307,11 @@ static bool pm_validate_resize_child(partition_data *partition,
|
|||||||
partition_data *child, off_t *size);
|
partition_data *child, off_t *size);
|
||||||
|
|
||||||
|
|
||||||
|
#ifdef _BOOT_MODE
|
||||||
|
partition_module_info gIntelPartitionMapModule = {
|
||||||
|
#else
|
||||||
static partition_module_info intel_partition_map_module = {
|
static partition_module_info intel_partition_map_module = {
|
||||||
|
#endif
|
||||||
{
|
{
|
||||||
kPartitionMapModuleName,
|
kPartitionMapModuleName,
|
||||||
0,
|
0,
|
||||||
@@ -315,6 +327,7 @@ static partition_module_info intel_partition_map_module = {
|
|||||||
pm_free_partition_cookie, // free_partition_cookie
|
pm_free_partition_cookie, // free_partition_cookie
|
||||||
pm_free_partition_content_cookie, // free_partition_content_cookie
|
pm_free_partition_content_cookie, // free_partition_content_cookie
|
||||||
|
|
||||||
|
#ifndef _BOOT_MODE
|
||||||
// querying
|
// querying
|
||||||
NULL, // supports_repairing
|
NULL, // supports_repairing
|
||||||
NULL, // supports_resizing
|
NULL, // supports_resizing
|
||||||
@@ -364,6 +377,9 @@ static partition_module_info intel_partition_map_module = {
|
|||||||
NULL, // initialize
|
NULL, // initialize
|
||||||
NULL, // create_child
|
NULL, // create_child
|
||||||
NULL, // delete_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_cookie(partition_data *partition);
|
||||||
static void ep_free_partition_content_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 = {
|
static partition_module_info intel_extended_partition_module = {
|
||||||
|
#endif
|
||||||
{
|
{
|
||||||
kExtendedPartitionModuleName,
|
kExtendedPartitionModuleName,
|
||||||
0,
|
0,
|
||||||
@@ -398,6 +418,7 @@ static partition_module_info intel_extended_partition_module = {
|
|||||||
ep_free_partition_cookie, // free_partition_cookie
|
ep_free_partition_cookie, // free_partition_cookie
|
||||||
ep_free_partition_content_cookie, // free_partition_content_cookie
|
ep_free_partition_content_cookie, // free_partition_content_cookie
|
||||||
|
|
||||||
|
#ifndef _BOOT_MODE
|
||||||
// querying
|
// querying
|
||||||
NULL, // supports_repairing
|
NULL, // supports_repairing
|
||||||
NULL, // supports_resizing
|
NULL, // supports_resizing
|
||||||
@@ -447,9 +468,13 @@ static partition_module_info intel_extended_partition_module = {
|
|||||||
NULL, // initialize
|
NULL, // initialize
|
||||||
NULL, // create_child
|
NULL, // create_child
|
||||||
NULL, // delete_child
|
NULL, // delete_child
|
||||||
|
#else
|
||||||
|
NULL
|
||||||
|
#endif // _BOOT_MODE
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
#ifndef _BOOT_MODE
|
||||||
extern "C" partition_module_info *modules[];
|
extern "C" partition_module_info *modules[];
|
||||||
_EXPORT partition_module_info *modules[] =
|
_EXPORT partition_module_info *modules[] =
|
||||||
{
|
{
|
||||||
@@ -457,6 +482,7 @@ _EXPORT partition_module_info *modules[] =
|
|||||||
&intel_extended_partition_module,
|
&intel_extended_partition_module,
|
||||||
NULL
|
NULL
|
||||||
};
|
};
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
// intel partition map module
|
// intel partition map module
|
||||||
@@ -616,6 +642,7 @@ pm_free_partition_content_cookie(partition_data *partition)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifndef _BOOT_MODE
|
||||||
// pm_supports_resizing_child
|
// pm_supports_resizing_child
|
||||||
static
|
static
|
||||||
bool
|
bool
|
||||||
@@ -663,6 +690,7 @@ pm_validate_resize_child(partition_data *partition, partition_data *child,
|
|||||||
*size = *size / partition->block_size * partition->block_size;
|
*size = *size / partition->block_size * partition->block_size;
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
#endif // _BOOT_MODE
|
||||||
|
|
||||||
|
|
||||||
// intel extended partition module
|
// intel extended partition module
|
||||||
|
|||||||
Reference in New Issue
Block a user