This fixes the intel/apple/amiga partitioning modules.
String references, const or not, require the static object to be initialized by a constructor; it will be put into the BSS region. Now, kernel modules are not linked against crtbegin.o, and the kernel does not call any init functions on the module. git-svn-id: file:///srv/svn/repos/haiku/trunk/current@8166 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
** Copyright 2003, Axel Dörfler, [email protected]. All rights reserved.
|
** Copyright 2003-2004, Axel Dörfler, [email protected]. All rights reserved.
|
||||||
** Distributed under the terms of the OpenBeOS License.
|
** Distributed under the terms of the Haiku License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
@@ -20,18 +20,16 @@
|
|||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
||||||
|
|
||||||
#define TRACE_AMIGA_RDB 0
|
//#define TRACE_AMIGA_RDB
|
||||||
#if TRACE_AMIGA_RDB
|
#ifdef TRACE_AMIGA_RDB
|
||||||
# define TRACE(x) dprintf x
|
# define TRACE(x) dprintf x
|
||||||
#else
|
#else
|
||||||
# define TRACE(x) ;
|
# define TRACE(x) ;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef _BOOT_MODE
|
|
||||||
static const char *kPartitionModuleName = "partitioning_systems/amiga_rdb/v1";
|
#define AMIGA_PARTITION_MODULE_NAME "partitioning_systems/amiga_rdb/v1"
|
||||||
#else
|
#define AMIGA_PARTITION_NAME "Amiga Partition Map"
|
||||||
static const char *kPartitionModuleName = NULL;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|
||||||
template<typename Type> bool
|
template<typename Type> bool
|
||||||
@@ -46,7 +44,7 @@ validate_check_sum(Type *type)
|
|||||||
for (uint32 i = 0; i < type->SummedLongs(); i++)
|
for (uint32 i = 0; i < type->SummedLongs(); i++)
|
||||||
sum += B_BENDIAN_TO_HOST_INT32(longs[i]);
|
sum += B_BENDIAN_TO_HOST_INT32(longs[i]);
|
||||||
|
|
||||||
#if TRACE_AMIGA_RDB
|
#ifdef TRACE_AMIGA_RDB
|
||||||
if (sum != 0)
|
if (sum != 0)
|
||||||
TRACE(("search_rdb: check sum is incorrect!\n"));
|
TRACE(("search_rdb: check sum is incorrect!\n"));
|
||||||
#endif
|
#endif
|
||||||
@@ -55,7 +53,7 @@ validate_check_sum(Type *type)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
#if TRACE_AMIGA_RDB
|
#ifdef TRACE_AMIGA_RDB
|
||||||
static char *
|
static char *
|
||||||
get_tupel(uint32 id)
|
get_tupel(uint32 id)
|
||||||
{
|
{
|
||||||
@@ -211,16 +209,16 @@ amiga_rdb_free_identify_partition_cookie(partition_data *partition, void *_cooki
|
|||||||
|
|
||||||
|
|
||||||
#ifndef _BOOT_MODE
|
#ifndef _BOOT_MODE
|
||||||
static partition_module_info gAmigaPartitionModule = {
|
static partition_module_info sAmigaPartitionModule = {
|
||||||
#else
|
#else
|
||||||
partition_module_info gAmigaPartitionModule = {
|
partition_module_info gAmigaPartitionModule = {
|
||||||
#endif
|
#endif
|
||||||
{
|
{
|
||||||
kPartitionModuleName,
|
AMIGA_PARTITION_MODULE_NAME,
|
||||||
0,
|
0,
|
||||||
amiga_rdb_std_ops
|
amiga_rdb_std_ops
|
||||||
},
|
},
|
||||||
kPartitionTypeAmiga, // pretty_name
|
AMIGA_PARTITION_NAME, // pretty_name
|
||||||
0, // flags
|
0, // flags
|
||||||
|
|
||||||
// scanning
|
// scanning
|
||||||
@@ -234,7 +232,7 @@ partition_module_info gAmigaPartitionModule = {
|
|||||||
|
|
||||||
#ifndef _BOOT_MODE
|
#ifndef _BOOT_MODE
|
||||||
partition_module_info *modules[] = {
|
partition_module_info *modules[] = {
|
||||||
&gAmigaPartitionModule,
|
&sAmigaPartitionModule,
|
||||||
NULL
|
NULL
|
||||||
};
|
};
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
** Copyright 2003, Axel Dörfler, [email protected]. All rights reserved.
|
** Copyright 2003-2004, Axel Dörfler, [email protected]. All rights reserved.
|
||||||
** Distributed under the terms of the OpenBeOS License.
|
** Distributed under the terms of the Haiku License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
@@ -26,7 +26,8 @@
|
|||||||
# define TRACE(x) ;
|
# define TRACE(x) ;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
static const char *kPartitionModuleName = "partitioning_systems/apple/v1";
|
#define APPLE_PARTITION_MODULE_NAME "partitioning_systems/apple/v1"
|
||||||
|
#define APPLE_PARTITION_NAME "Apple Partition Map"
|
||||||
|
|
||||||
static const char *kApplePartitionTypes[] = {
|
static const char *kApplePartitionTypes[] = {
|
||||||
"partition_map", // the partition map itself
|
"partition_map", // the partition map itself
|
||||||
@@ -198,11 +199,11 @@ static partition_module_info sApplePartitionModule = {
|
|||||||
partition_module_info gApplePartitionModule = {
|
partition_module_info gApplePartitionModule = {
|
||||||
#endif
|
#endif
|
||||||
{
|
{
|
||||||
kPartitionModuleName,
|
APPLE_PARTITION_MODULE_NAME,
|
||||||
0,
|
0,
|
||||||
apple_std_ops
|
apple_std_ops
|
||||||
},
|
},
|
||||||
kPartitionTypeApple, // pretty_name
|
APPLE_PARTITION_NAME, // pretty_name
|
||||||
0, // flags
|
0, // flags
|
||||||
|
|
||||||
// scanning
|
// scanning
|
||||||
|
|||||||
@@ -1,6 +1,5 @@
|
|||||||
SubDir OBOS_TOP src add-ons kernel partitioning_systems intel ;
|
SubDir OBOS_TOP src add-ons kernel partitioning_systems intel ;
|
||||||
|
|
||||||
#UsePrivateHeaders $(DOT) ;
|
|
||||||
UsePrivateHeaders [ FDirName kernel disk_device_manager ] ;
|
UsePrivateHeaders [ FDirName kernel disk_device_manager ] ;
|
||||||
UsePrivateHeaders [ FDirName kernel ] ;
|
UsePrivateHeaders [ FDirName kernel ] ;
|
||||||
UsePrivateHeaders [ FDirName storage ] ;
|
UsePrivateHeaders [ FDirName storage ] ;
|
||||||
@@ -10,7 +9,8 @@ KernelAddon intel : kernel partitioning_systems :
|
|||||||
PartitionMap.cpp
|
PartitionMap.cpp
|
||||||
;
|
;
|
||||||
|
|
||||||
# For now build a userland version only.
|
# Also build a userland version
|
||||||
|
# ToDo: it's probably not a good idea to build them into the same directory
|
||||||
Addon <partitioning_system>intel : userland partitioning_systems :
|
Addon <partitioning_system>intel : userland partitioning_systems :
|
||||||
intel.cpp
|
intel.cpp
|
||||||
PartitionMap.cpp
|
PartitionMap.cpp
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
// This software is part of the OpenBeOS distribution and is covered
|
// This software is part of the Haiku distribution and is covered
|
||||||
// by the OpenBeOS license.
|
// by the Haiku license.
|
||||||
//---------------------------------------------------------------------
|
//---------------------------------------------------------------------
|
||||||
/*!
|
/*!
|
||||||
\file intel.cpp
|
\file intel.cpp
|
||||||
@@ -33,10 +33,12 @@
|
|||||||
//#define TRACE(x) dprintf x
|
//#define TRACE(x) dprintf x
|
||||||
|
|
||||||
// module names
|
// module names
|
||||||
static const char *kPartitionMapModuleName
|
#define INTEL_PARTITION_MODULE_NAME "partitioning_systems/intel/map/v1"
|
||||||
= "partitioning_systems/intel/map/v1";
|
#define INTEL_EXTENDED_PARTITION_MODULE_NAME "partitioning_systems/intel/extended/v1"
|
||||||
static const char *kExtendedPartitionModuleName
|
|
||||||
= "partitioning_systems/intel/extended/v1";
|
// these match those in DiskDeviceTypes.cpp
|
||||||
|
#define INTEL_PARTITION_NAME "Intel Partition Map"
|
||||||
|
#define INTEL_EXTENDED_PARTITION_NAME "Intel Extended Partition"
|
||||||
|
|
||||||
// Maximal number of logical partitions per extended partition we allow.
|
// Maximal number of logical partitions per extended partition we allow.
|
||||||
static const int32 kMaxLogicalPartitionCount = 128;
|
static const int32 kMaxLogicalPartitionCount = 128;
|
||||||
@@ -314,11 +316,11 @@ partition_module_info gIntelPartitionMapModule = {
|
|||||||
static partition_module_info intel_partition_map_module = {
|
static partition_module_info intel_partition_map_module = {
|
||||||
#endif
|
#endif
|
||||||
{
|
{
|
||||||
kPartitionMapModuleName,
|
INTEL_PARTITION_MODULE_NAME,
|
||||||
0,
|
0,
|
||||||
pm_std_ops
|
pm_std_ops
|
||||||
},
|
},
|
||||||
kPartitionTypeIntel, // pretty_name
|
INTEL_PARTITION_NAME, // pretty_name
|
||||||
0, // flags
|
0, // flags
|
||||||
|
|
||||||
// scanning
|
// scanning
|
||||||
@@ -405,11 +407,11 @@ partition_module_info gIntelExtendedPartitionModule = {
|
|||||||
static partition_module_info intel_extended_partition_module = {
|
static partition_module_info intel_extended_partition_module = {
|
||||||
#endif
|
#endif
|
||||||
{
|
{
|
||||||
kExtendedPartitionModuleName,
|
INTEL_EXTENDED_PARTITION_MODULE_NAME,
|
||||||
0,
|
0,
|
||||||
ep_std_ops
|
ep_std_ops
|
||||||
},
|
},
|
||||||
kPartitionTypeIntelExtended, // pretty_name
|
INTEL_EXTENDED_PARTITION_NAME, // pretty_name
|
||||||
0, // flags
|
0, // flags
|
||||||
|
|
||||||
// scanning
|
// scanning
|
||||||
|
|||||||
Reference in New Issue
Block a user