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:
Axel Dörfler
2004-06-25 13:45:29 +00:00
parent ad2cab6ddc
commit 1fac18e1bb
4 changed files with 33 additions and 32 deletions
@@ -1,6 +1,6 @@
/*
** Copyright 2003, Axel Dörfler, [email protected]. All rights reserved.
** Distributed under the terms of the OpenBeOS License.
** Copyright 2003-2004, Axel Dörfler, [email protected]. All rights reserved.
** Distributed under the terms of the Haiku License.
*/
@@ -20,18 +20,16 @@
#include <string.h>
#define TRACE_AMIGA_RDB 0
#if TRACE_AMIGA_RDB
//#define TRACE_AMIGA_RDB
#ifdef TRACE_AMIGA_RDB
# define TRACE(x) dprintf x
#else
# define TRACE(x) ;
#endif
#ifdef _BOOT_MODE
static const char *kPartitionModuleName = "partitioning_systems/amiga_rdb/v1";
#else
static const char *kPartitionModuleName = NULL;
#endif
#define AMIGA_PARTITION_MODULE_NAME "partitioning_systems/amiga_rdb/v1"
#define AMIGA_PARTITION_NAME "Amiga Partition Map"
template<typename Type> bool
@@ -46,7 +44,7 @@ validate_check_sum(Type *type)
for (uint32 i = 0; i < type->SummedLongs(); i++)
sum += B_BENDIAN_TO_HOST_INT32(longs[i]);
#if TRACE_AMIGA_RDB
#ifdef TRACE_AMIGA_RDB
if (sum != 0)
TRACE(("search_rdb: check sum is incorrect!\n"));
#endif
@@ -55,7 +53,7 @@ validate_check_sum(Type *type)
}
#if TRACE_AMIGA_RDB
#ifdef TRACE_AMIGA_RDB
static char *
get_tupel(uint32 id)
{
@@ -211,16 +209,16 @@ amiga_rdb_free_identify_partition_cookie(partition_data *partition, void *_cooki
#ifndef _BOOT_MODE
static partition_module_info gAmigaPartitionModule = {
static partition_module_info sAmigaPartitionModule = {
#else
partition_module_info gAmigaPartitionModule = {
#endif
{
kPartitionModuleName,
AMIGA_PARTITION_MODULE_NAME,
0,
amiga_rdb_std_ops
},
kPartitionTypeAmiga, // pretty_name
AMIGA_PARTITION_NAME, // pretty_name
0, // flags
// scanning
@@ -234,7 +232,7 @@ partition_module_info gAmigaPartitionModule = {
#ifndef _BOOT_MODE
partition_module_info *modules[] = {
&gAmigaPartitionModule,
&sAmigaPartitionModule,
NULL
};
#endif
@@ -1,6 +1,6 @@
/*
** Copyright 2003, Axel Dörfler, [email protected]. All rights reserved.
** Distributed under the terms of the OpenBeOS License.
** Copyright 2003-2004, Axel Dörfler, [email protected]. All rights reserved.
** Distributed under the terms of the Haiku License.
*/
@@ -26,7 +26,8 @@
# define TRACE(x) ;
#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[] = {
"partition_map", // the partition map itself
@@ -198,11 +199,11 @@ static partition_module_info sApplePartitionModule = {
partition_module_info gApplePartitionModule = {
#endif
{
kPartitionModuleName,
APPLE_PARTITION_MODULE_NAME,
0,
apple_std_ops
},
kPartitionTypeApple, // pretty_name
APPLE_PARTITION_NAME, // pretty_name
0, // flags
// scanning
@@ -1,6 +1,5 @@
SubDir OBOS_TOP src add-ons kernel partitioning_systems intel ;
#UsePrivateHeaders $(DOT) ;
UsePrivateHeaders [ FDirName kernel disk_device_manager ] ;
UsePrivateHeaders [ FDirName kernel ] ;
UsePrivateHeaders [ FDirName storage ] ;
@@ -10,7 +9,8 @@ KernelAddon intel : kernel partitioning_systems :
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 :
intel.cpp
PartitionMap.cpp
@@ -1,6 +1,6 @@
//----------------------------------------------------------------------
// This software is part of the OpenBeOS distribution and is covered
// by the OpenBeOS license.
// This software is part of the Haiku distribution and is covered
// by the Haiku license.
//---------------------------------------------------------------------
/*!
\file intel.cpp
@@ -33,10 +33,12 @@
//#define TRACE(x) dprintf x
// module names
static const char *kPartitionMapModuleName
= "partitioning_systems/intel/map/v1";
static const char *kExtendedPartitionModuleName
= "partitioning_systems/intel/extended/v1";
#define INTEL_PARTITION_MODULE_NAME "partitioning_systems/intel/map/v1"
#define INTEL_EXTENDED_PARTITION_MODULE_NAME "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.
static const int32 kMaxLogicalPartitionCount = 128;
@@ -314,11 +316,11 @@ partition_module_info gIntelPartitionMapModule = {
static partition_module_info intel_partition_map_module = {
#endif
{
kPartitionMapModuleName,
INTEL_PARTITION_MODULE_NAME,
0,
pm_std_ops
},
kPartitionTypeIntel, // pretty_name
INTEL_PARTITION_NAME, // pretty_name
0, // flags
// scanning
@@ -405,11 +407,11 @@ partition_module_info gIntelExtendedPartitionModule = {
static partition_module_info intel_extended_partition_module = {
#endif
{
kExtendedPartitionModuleName,
INTEL_EXTENDED_PARTITION_MODULE_NAME,
0,
ep_std_ops
},
kPartitionTypeIntelExtended, // pretty_name
INTEL_EXTENDED_PARTITION_NAME, // pretty_name
0, // flags
// scanning