* <DiskDeviceTypes.h>: Removed kPartitionTypeIntel{Primary,Logical} constants.

* Added new header headers/private/system/disk_device_types.h, which defines
  the <DiskDeviceTypes.h> constants as macros and which can be used where the
  constants cannot be used. The constants are defined using the macros, so now
  there's only one place where the string literals should be specified.
* Use the macros in the partitioning systems. I was too lazy to also adjust the
  file systems -- most of them seem to hard-code the string literal yet.



git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@33386 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Ingo Weinhold 2009-10-01 03:07:42 +00:00
parent a9689e8492
commit d6778355ee
17 changed files with 93 additions and 45 deletions

View File

@ -1,5 +1,5 @@
/*
* Copyright 2003-2007, Haiku Inc.
* Copyright 2003-2009, Haiku Inc.
* Distributed under the terms of the MIT License.
*/
#ifndef _DISK_DEVICE_TYPES_H
@ -16,7 +16,6 @@ extern const char *kDeviceTypeOptical;
extern const char *kPartitionTypeUnrecognized;
extern const char *kPartitionTypeMultisession;
extern const char *kPartitionTypeAudioSession;
extern const char *kPartitionTypeDataSession;
@ -24,10 +23,8 @@ extern const char *kPartitionTypeAmiga;
extern const char *kPartitionTypeApple;
extern const char *kPartitionTypeEFI;
extern const char *kPartitionTypeIntel;
extern const char *kPartitionTypeIntelPrimary;
extern const char *kPartitionTypeIntelExtended;
extern const char *kPartitionTypeIntelLogical;
extern const char *kPartitionTypeVMDK;
extern const char *kPartitionTypeAmigaFFS;
extern const char *kPartitionTypeBFS;

View File

@ -0,0 +1,46 @@
/*
* Copyright 2009, Ingo Weinhold, ingo_weinhold@gmx.de.
* Distributed under the terms of the MIT License.
*
* Disk device type macros for kernel and boot loader. In userland use
* <DiskDeviceTypes.h>.
*/
#ifndef _SYSTEM_DISK_DEVICE_TYPES_H
#define _SYSTEM_DISK_DEVICE_TYPES_H
// Device Types
#define FLOPPY_DEVICE_NAME "Floppy Disk Media"
#define HARD_DISK_DEVICE_NAME "Hard Disk Media"
#define OPTICAL_DEVICE_NAME "Optical Media"
// Partition types
#define UNRECOGNIZED_PARTITION_NAME "Unrecognized"
#define MULTISESSION_PARTITION_NAME "Multisession Storage Device"
#define AUDIO_SESSION_PARTITION_NAME "Audio Session"
#define DATA_SESSION_PARTITION_NAME "Data Session"
#define AMIGA_PARTITION_NAME "Amiga Partition Map"
#define APPLE_PARTITION_NAME "Apple Partition Map"
#define EFI_PARTITION_NAME "EFI GUID Partition Map"
#define INTEL_PARTITION_NAME "Intel Partition Map"
#define INTEL_EXTENDED_PARTITION_NAME "Intel Extended Partition"
#define VMDK_PARTITION_NAME "VMDK Partition"
#define AMIGA_FFS_NAME "AmigaFFS File System"
#define BFS_NAME "Be File System"
#define EXT2_FS_NAME "EXT2 File System"
#define EXT3_FS_NAME "EXT3 File System"
#define FAT12_FS_NAME "FAT12 File System"
#define FAT32_FS_NAME "FAT32 File System"
#define HFS_NAME "HFS File System"
#define HFS_PLUS_NAME "HFS+ File System"
#define ISO9660_FS_NAME "ISO9660 File System"
#define REISER_FS_NAME "Reiser File System"
#define UDF_FS_NAME "UDF File System"
#endif // _SYSTEM_DISK_DEVICE_TYPES_H

View File

@ -1,6 +1,7 @@
SubDir HAIKU_TOP src add-ons disk_systems intel ;
UsePrivateHeaders shared storage ;
UsePrivateSystemHeaders ;
SEARCH_SOURCE
+= [ FDirName $(HAIKU_TOP) src add-ons kernel partitioning_systems intel ] ;

View File

@ -3,6 +3,7 @@ SubDir HAIKU_TOP src add-ons kernel partitioning_systems amiga ;
UsePrivateHeaders [ FDirName kernel disk_device_manager ] ;
UsePrivateHeaders [ FDirName kernel ] ;
UsePrivateHeaders [ FDirName storage ] ;
UsePrivateSystemHeaders ;
KernelAddon amiga_rdb :
amiga_rdb.cpp

View File

@ -9,6 +9,7 @@
#include <ByteOrder.h>
#include <KernelExport.h>
#include <ddm_modules.h>
#include <disk_device_types.h>
#ifdef _BOOT_MODE
# include <boot/partitions.h>
#else
@ -29,7 +30,6 @@
#define AMIGA_PARTITION_MODULE_NAME "partitioning_systems/amiga_rdb/v1"
#define AMIGA_PARTITION_NAME "Amiga Partition Map"
template<typename Type> bool

View File

@ -3,6 +3,7 @@ SubDir HAIKU_TOP src add-ons kernel partitioning_systems apple ;
UsePrivateHeaders [ FDirName kernel disk_device_manager ] ;
UsePrivateHeaders [ FDirName kernel ] ;
UsePrivateHeaders [ FDirName storage ] ;
UsePrivateSystemHeaders ;
KernelAddon apple :
apple.cpp

View File

@ -7,6 +7,7 @@
#include "apple.h"
#include <ddm_modules.h>
#include <disk_device_types.h>
#include <KernelExport.h>
#ifdef _BOOT_MODE
# include <boot/partitions.h>
@ -27,7 +28,6 @@
#endif
#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

View File

@ -2,6 +2,7 @@ SubDir HAIKU_TOP src add-ons kernel partitioning_systems efi ;
UsePrivateHeaders [ FDirName kernel disk_device_manager ] ;
UsePrivateHeaders interface kernel storage ;
UsePrivateSystemHeaders ;
KernelAddon efi_gpt :
efi_gpt.cpp

View File

@ -10,6 +10,7 @@
#include <KernelExport.h>
#include <ddm_modules.h>
#include <disk_device_types.h>
#ifdef _BOOT_MODE
# include <boot/partitions.h>
#else
@ -33,7 +34,6 @@
#define EFI_PARTITION_MODULE_NAME "partitioning_systems/efi_gpt/v1"
#define EFI_PARTITION_NAME "EFI GUID Partition Map"
struct static_guid {

View File

@ -4,6 +4,7 @@ UsePrivateHeaders [ FDirName kernel disk_device_manager ] ;
UsePrivateHeaders kernel ;
UsePrivateHeaders shared ;
UsePrivateHeaders storage ;
UsePrivateSystemHeaders ;
KernelAddon intel :
intel.cpp

View File

@ -16,17 +16,14 @@
#include <SupportDefs.h>
#include <driver_settings.h>
#include <disk_device_types.h>
#ifndef _USER_MODE
# include <util/kernel_cpp.h>
#else
# include <new>
#endif
// These match those in DiskDeviceTypes.cpp and *must* be kept in sync.
#define INTEL_PARTITION_NAME "Intel Partition Map"
#define INTEL_EXTENDED_PARTITION_NAME "Intel Extended Partition"
#define BFS_NAME "Be File System"
// partition_type
struct partition_type {

View File

@ -4,14 +4,15 @@ SubDir HAIKU_TOP src add-ons kernel partitioning_systems session ;
UsePrivateHeaders [ FDirName kernel disk_device_manager ] ;
UsePrivateHeaders [ FDirName kernel ] ;
UsePrivateHeaders [ FDirName storage ] ;
UsePrivateSystemHeaders ;
{
# local defines = [ FDefines USER ] ;
# local defines = [ FDefines USER ] ;
# SubDirCcFlags $(defines) ;
# SubDirC++Flags $(defines) ;
}
local session_files =
local session_files =
Debug.cpp
Disc.cpp
session.cpp

View File

@ -11,6 +11,7 @@
#include <unistd.h>
#include <ddm_modules.h>
#include <disk_device_types.h>
#include <DiskDeviceTypes.h>
#include <KernelExport.h>
@ -19,7 +20,6 @@
#define SESSION_PARTITION_MODULE_NAME "partitioning_systems/session/v1"
#define SESSION_PARTITION_NAME "Multisession Storage Device"
static status_t
@ -115,7 +115,7 @@ static partition_module_info sSessionModule = {
standard_operations
},
"session", // short_name
SESSION_PARTITION_NAME, // pretty_name
MULTISESSION_PARTITION_NAME, // pretty_name
0, // flags
// scanning

View File

@ -3,6 +3,7 @@ SubDir HAIKU_TOP src bin makebootable platform bios_ia32 ;
SubDirHdrs $(HAIKU_TOP) src add-ons kernel file_systems bfs ;
UsePrivateHeaders shared storage ;
UsePrivateSystemHeaders ;
# write the stage 1 boot loader into the makebootable resources
AddFileDataResource makebootable : RAWT:666:BootCode : stage1.bin ;

View File

@ -1,5 +1,5 @@
/*
* Copyright 2003-2007, Haiku Inc.
* Copyright 2003-2009, Haiku Inc.
* Distributed under the terms of the MIT License.
*
* Authors:
@ -9,39 +9,38 @@
#include <DiskDeviceTypes.h>
#include <disk_device_types.h>
// Device Types
const char *kDeviceTypeFloppyDisk = "Floppy Disk Media";
const char *kDeviceTypeHardDisk = "Hard Disk Media";
const char *kDeviceTypeOptical = "Optical Media";
const char *kDeviceTypeFloppyDisk = FLOPPY_DEVICE_NAME;
const char *kDeviceTypeHardDisk = HARD_DISK_DEVICE_NAME;
const char *kDeviceTypeOptical = OPTICAL_DEVICE_NAME;
// Partition types
const char *kPartitionTypeUnrecognized = "Unrecognized";
const char *kPartitionTypeUnrecognized = UNRECOGNIZED_PARTITION_NAME;
const char *kPartitionTypeMultisession = "Multisession Storage Device";
const char *kPartitionTypeMultisession = MULTISESSION_PARTITION_NAME;
const char *kPartitionTypeAudioSession = AUDIO_SESSION_PARTITION_NAME;
const char *kPartitionTypeDataSession = DATA_SESSION_PARTITION_NAME;
const char *kPartitionTypeAudioSession = "Audio Session";
const char *kPartitionTypeDataSession = "Data Session";
const char *kPartitionTypeAmiga = AMIGA_PARTITION_NAME;
const char *kPartitionTypeApple = APPLE_PARTITION_NAME;
const char *kPartitionTypeEFI = EFI_PARTITION_NAME;
const char *kPartitionTypeIntel = INTEL_PARTITION_NAME;
const char *kPartitionTypeIntelExtended = INTEL_EXTENDED_PARTITION_NAME;
const char *kPartitionTypeVMDK = VMDK_PARTITION_NAME;
const char *kPartitionTypeAmiga = "Amiga Partition Map";
const char *kPartitionTypeApple = "Apple Partition Map";
const char *kPartitionTypeEFI = "EFI GUID Partition Map";
const char *kPartitionTypeIntel = "Intel Partition Map";
const char *kPartitionTypeIntelPrimary = "Intel Primary Partition";
const char *kPartitionTypeIntelExtended = "Intel Extended Partition";
const char *kPartitionTypeIntelLogical = "Intel Logical Partition";
const char *kPartitionTypeAmigaFFS = "AmigaFFS File System";
const char *kPartitionTypeBFS = "Be File System";
const char *kPartitionTypeEXT2 = "EXT2 File System";
const char *kPartitionTypeEXT3 = "EXT3 File System";
const char *kPartitionTypeFAT12 = "FAT12 File System";
const char *kPartitionTypeFAT32 = "FAT32 File System";
const char *kPartitionTypeHFS = "HFS File System";
const char *kPartitionTypeHFSPlus = "HFS+ File System";
const char *kPartitionTypeISO9660 = "ISO9660 File System";
const char *kPartitionTypeReiser = "Reiser File System";
const char *kPartitionTypeUDF = "UDF File System";
const char *kPartitionTypeAmigaFFS = AMIGA_FFS_NAME;
const char *kPartitionTypeBFS = BFS_NAME;
const char *kPartitionTypeEXT2 = EXT2_FS_NAME;
const char *kPartitionTypeEXT3 = EXT3_FS_NAME;
const char *kPartitionTypeFAT12 = FAT12_FS_NAME;
const char *kPartitionTypeFAT32 = FAT32_FS_NAME;
const char *kPartitionTypeHFS = HFS_NAME;
const char *kPartitionTypeHFSPlus = HFS_PLUS_NAME;
const char *kPartitionTypeISO9660 = ISO9660_FS_NAME;
const char *kPartitionTypeReiser = REISER_FS_NAME;
const char *kPartitionTypeUDF = UDF_FS_NAME;

View File

@ -9,6 +9,7 @@ UsePrivateHeaders [ FDirName kernel disk_device_manager ] ;
UsePrivateHeaders [ FDirName kernel ] ;
UsePrivateHeaders [ FDirName kernel fs ] ;
UsePrivateHeaders [ FDirName kernel util ] ;
UsePrivateSystemHeaders ;
UsePrivateHeaders shared ;
UsePrivateHeaders storage ;

View File

@ -3,6 +3,7 @@ SubDir HAIKU_TOP src tools makebootable platform bios_ia32 ;
SubDirHdrs $(HAIKU_TOP) src add-ons kernel file_systems bfs ;
UsePrivateHeaders storage shared ;
UsePrivateSystemHeaders system ;
SEARCH_SOURCE
+= [ FDirName $(HAIKU_TOP) src bin makebootable platform bios_ia32 ] ;