tests: Fix build & link of the DiskDeviceManagerTest.
This commit is contained in:
@@ -1,6 +1,5 @@
|
|||||||
SubDir HAIKU_TOP src system kernel disk_device_manager ;
|
SubDir HAIKU_TOP src system kernel disk_device_manager ;
|
||||||
|
|
||||||
SEARCH_SOURCE += [ FDirName $(SUBDIR) jobs ] ;
|
|
||||||
SEARCH_SOURCE += [ FDirName $(HAIKU_TOP) src kits storage disk_device ] ;
|
SEARCH_SOURCE += [ FDirName $(HAIKU_TOP) src kits storage disk_device ] ;
|
||||||
# DiskDeviceTypes.cpp
|
# DiskDeviceTypes.cpp
|
||||||
|
|
||||||
|
|||||||
@@ -9,7 +9,7 @@
|
|||||||
// RelocationEntryList
|
// RelocationEntryList
|
||||||
struct UserDataWriter::RelocationEntryList : Vector<addr_t*> {};
|
struct UserDataWriter::RelocationEntryList : Vector<addr_t*> {};
|
||||||
|
|
||||||
// constructor
|
|
||||||
UserDataWriter::UserDataWriter()
|
UserDataWriter::UserDataWriter()
|
||||||
: fBuffer(NULL),
|
: fBuffer(NULL),
|
||||||
fBufferSize(0),
|
fBufferSize(0),
|
||||||
@@ -18,7 +18,7 @@ UserDataWriter::UserDataWriter()
|
|||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
// constructor
|
|
||||||
UserDataWriter::UserDataWriter(user_disk_device_data *buffer,
|
UserDataWriter::UserDataWriter(user_disk_device_data *buffer,
|
||||||
size_t bufferSize)
|
size_t bufferSize)
|
||||||
: fBuffer(NULL),
|
: fBuffer(NULL),
|
||||||
@@ -29,13 +29,13 @@ UserDataWriter::UserDataWriter(user_disk_device_data *buffer,
|
|||||||
SetTo(buffer, bufferSize);
|
SetTo(buffer, bufferSize);
|
||||||
}
|
}
|
||||||
|
|
||||||
// destructor
|
|
||||||
UserDataWriter::~UserDataWriter()
|
UserDataWriter::~UserDataWriter()
|
||||||
{
|
{
|
||||||
delete fRelocationEntries;
|
delete fRelocationEntries;
|
||||||
}
|
}
|
||||||
|
|
||||||
// SetTo
|
|
||||||
status_t
|
status_t
|
||||||
UserDataWriter::SetTo(user_disk_device_data *buffer, size_t bufferSize)
|
UserDataWriter::SetTo(user_disk_device_data *buffer, size_t bufferSize)
|
||||||
{
|
{
|
||||||
@@ -44,14 +44,14 @@ UserDataWriter::SetTo(user_disk_device_data *buffer, size_t bufferSize)
|
|||||||
fBufferSize = bufferSize;
|
fBufferSize = bufferSize;
|
||||||
fAllocatedSize = 0;
|
fAllocatedSize = 0;
|
||||||
if (fBuffer && fBufferSize > 0) {
|
if (fBuffer && fBufferSize > 0) {
|
||||||
fRelocationEntries = new(nothrow) RelocationEntryList;
|
fRelocationEntries = new(std::nothrow) RelocationEntryList;
|
||||||
if (!fRelocationEntries)
|
if (!fRelocationEntries)
|
||||||
return B_NO_MEMORY;
|
return B_NO_MEMORY;
|
||||||
}
|
}
|
||||||
return B_OK;
|
return B_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Unset
|
|
||||||
void
|
void
|
||||||
UserDataWriter::Unset()
|
UserDataWriter::Unset()
|
||||||
{
|
{
|
||||||
@@ -62,7 +62,7 @@ UserDataWriter::Unset()
|
|||||||
fRelocationEntries = NULL;
|
fRelocationEntries = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
// AllocateData
|
|
||||||
void *
|
void *
|
||||||
UserDataWriter::AllocateData(size_t size, size_t align)
|
UserDataWriter::AllocateData(size_t size, size_t align)
|
||||||
{
|
{
|
||||||
@@ -80,7 +80,7 @@ UserDataWriter::AllocateData(size_t size, size_t align)
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
// AllocatePartitionData
|
|
||||||
user_partition_data *
|
user_partition_data *
|
||||||
UserDataWriter::AllocatePartitionData(size_t childCount)
|
UserDataWriter::AllocatePartitionData(size_t childCount)
|
||||||
{
|
{
|
||||||
@@ -90,7 +90,7 @@ UserDataWriter::AllocatePartitionData(size_t childCount)
|
|||||||
sizeof(int));
|
sizeof(int));
|
||||||
}
|
}
|
||||||
|
|
||||||
// AllocateDeviceData
|
|
||||||
user_disk_device_data *
|
user_disk_device_data *
|
||||||
UserDataWriter::AllocateDeviceData(size_t childCount)
|
UserDataWriter::AllocateDeviceData(size_t childCount)
|
||||||
{
|
{
|
||||||
@@ -100,7 +100,7 @@ UserDataWriter::AllocateDeviceData(size_t childCount)
|
|||||||
sizeof(int));
|
sizeof(int));
|
||||||
}
|
}
|
||||||
|
|
||||||
// PlaceString
|
|
||||||
char *
|
char *
|
||||||
UserDataWriter::PlaceString(const char *str)
|
UserDataWriter::PlaceString(const char *str)
|
||||||
{
|
{
|
||||||
@@ -113,14 +113,14 @@ UserDataWriter::PlaceString(const char *str)
|
|||||||
return data;
|
return data;
|
||||||
}
|
}
|
||||||
|
|
||||||
// AllocatedSize
|
|
||||||
size_t
|
size_t
|
||||||
UserDataWriter::AllocatedSize() const
|
UserDataWriter::AllocatedSize() const
|
||||||
{
|
{
|
||||||
return fAllocatedSize;
|
return fAllocatedSize;
|
||||||
}
|
}
|
||||||
|
|
||||||
// AddRelocationEntry
|
|
||||||
status_t
|
status_t
|
||||||
UserDataWriter::AddRelocationEntry(void *address)
|
UserDataWriter::AddRelocationEntry(void *address)
|
||||||
{
|
{
|
||||||
@@ -131,7 +131,7 @@ UserDataWriter::AddRelocationEntry(void *address)
|
|||||||
return B_ERROR;
|
return B_ERROR;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Relocate
|
|
||||||
status_t
|
status_t
|
||||||
UserDataWriter::Relocate(void *address)
|
UserDataWriter::Relocate(void *address)
|
||||||
{
|
{
|
||||||
@@ -145,4 +145,3 @@ UserDataWriter::Relocate(void *address)
|
|||||||
}
|
}
|
||||||
return B_OK;
|
return B_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -12,20 +12,22 @@ SharedLibrary libkernelland_emu.so :
|
|||||||
KPath.cpp
|
KPath.cpp
|
||||||
lock.cpp
|
lock.cpp
|
||||||
low_resource_manager.cpp
|
low_resource_manager.cpp
|
||||||
|
MessagingService.cpp
|
||||||
misc.cpp
|
misc.cpp
|
||||||
module.cpp
|
module.cpp
|
||||||
|
node_monitor.cpp
|
||||||
slab.cpp
|
slab.cpp
|
||||||
smp.cpp
|
smp.cpp
|
||||||
team.cpp
|
team.cpp
|
||||||
|
vfs.cpp
|
||||||
vm.cpp
|
vm.cpp
|
||||||
|
|
||||||
list.cpp
|
list.cpp
|
||||||
|
StringHash.cpp
|
||||||
|
|
||||||
: be [ TargetLibstdc++ ] ;
|
: be [ TargetLibstdc++ ] ;
|
||||||
|
|
||||||
AbsSymLink <boot!home!config!lib>libkernelland_emu.so : libkernelland_emu.so
|
|
||||||
: /boot/home/config/lib : false ;
|
|
||||||
|
|
||||||
SEARCH on [ FGristFiles
|
SEARCH on [ FGristFiles
|
||||||
list.cpp
|
list.cpp
|
||||||
|
StringHash.cpp
|
||||||
] = [ FDirName $(HAIKU_TOP) src system kernel util ] ;
|
] = [ FDirName $(HAIKU_TOP) src system kernel util ] ;
|
||||||
|
|||||||
@@ -0,0 +1,14 @@
|
|||||||
|
/*
|
||||||
|
* Copyright 2024, Haiku, Inc. All rights reserved.
|
||||||
|
* Distributed under the terms of the MIT license.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include <messaging.h>
|
||||||
|
|
||||||
|
|
||||||
|
extern "C" status_t
|
||||||
|
send_message(const void *message, int32 messageSize,
|
||||||
|
const messaging_target *targets, int32 targetCount)
|
||||||
|
{
|
||||||
|
return B_NOT_SUPPORTED;
|
||||||
|
}
|
||||||
@@ -12,6 +12,22 @@
|
|||||||
#include <fs/devfs.h>
|
#include <fs/devfs.h>
|
||||||
|
|
||||||
|
|
||||||
|
extern "C" status_t
|
||||||
|
devfs_unpublish_file_device(const char* path)
|
||||||
|
{
|
||||||
|
printf("ubpublish file device: path \"%s\"\n", path);
|
||||||
|
return B_OK;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
extern "C" status_t
|
||||||
|
devfs_publish_file_device(const char* path, const char* filePath)
|
||||||
|
{
|
||||||
|
printf("publish file device: path \"%s\" (file path \"%s\")\n", path, filePath);
|
||||||
|
return B_OK;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
extern "C" status_t
|
extern "C" status_t
|
||||||
devfs_unpublish_partition(const char *path)
|
devfs_unpublish_partition(const char *path)
|
||||||
{
|
{
|
||||||
@@ -29,3 +45,12 @@ devfs_publish_partition(const char *path, const partition_info *info)
|
|||||||
printf("publish partition: %s (device \"%s\", size %lld)\n", path, info->device, info->size);
|
printf("publish partition: %s (device \"%s\", size %lld)\n", path, info->device, info->size);
|
||||||
return B_OK;
|
return B_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
extern "C" status_t
|
||||||
|
devfs_rename_partition(const char* devicePath, const char* oldName, const char* newName)
|
||||||
|
{
|
||||||
|
printf("rename partition: %s (oldName \"%s\", newName \"%s\")\n",
|
||||||
|
devicePath, oldName, newName);
|
||||||
|
return B_OK;
|
||||||
|
}
|
||||||
|
|||||||
@@ -16,8 +16,10 @@
|
|||||||
#include <Entry.h>
|
#include <Entry.h>
|
||||||
#include <KernelExport.h>
|
#include <KernelExport.h>
|
||||||
#include <module.h>
|
#include <module.h>
|
||||||
|
#include <kmodule.h>
|
||||||
#include <List.h>
|
#include <List.h>
|
||||||
#include <Locker.h>
|
#include <Locker.h>
|
||||||
|
#include <Notifications.h>
|
||||||
#include <ObjectList.h>
|
#include <ObjectList.h>
|
||||||
#include <Path.h>
|
#include <Path.h>
|
||||||
#include <String.h>
|
#include <String.h>
|
||||||
@@ -801,3 +803,17 @@ close_module_list(void *cookie)
|
|||||||
return ModuleManager::Default()->CloseModuleList(
|
return ModuleManager::Default()->CloseModuleList(
|
||||||
(module_name_list*)cookie);
|
(module_name_list*)cookie);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
status_t
|
||||||
|
start_watching_modules(const char* prefix, NotificationListener& listener)
|
||||||
|
{
|
||||||
|
return B_NOT_SUPPORTED;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
status_t
|
||||||
|
stop_watching_modules(const char* prefix, NotificationListener& listener)
|
||||||
|
{
|
||||||
|
return B_NOT_SUPPORTED;
|
||||||
|
}
|
||||||
|
|||||||
@@ -0,0 +1,21 @@
|
|||||||
|
/*
|
||||||
|
* Copyright 2024, Haiku, Inc. All rights reserved.
|
||||||
|
* Distributed under the terms of the MIT license.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include <fs/node_monitor.h>
|
||||||
|
|
||||||
|
|
||||||
|
status_t
|
||||||
|
remove_node_listener(dev_t device, ino_t node, NotificationListener& listener)
|
||||||
|
{
|
||||||
|
return B_NOT_SUPPORTED;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
status_t
|
||||||
|
add_node_listener(dev_t device, ino_t node, uint32 flags,
|
||||||
|
NotificationListener& listener)
|
||||||
|
{
|
||||||
|
return B_NOT_SUPPORTED;
|
||||||
|
}
|
||||||
@@ -0,0 +1,36 @@
|
|||||||
|
/*
|
||||||
|
* Copyright 2024, Haiku, Inc. All rights reserved.
|
||||||
|
* Distributed under the terms of the MIT license.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include <vfs.h>
|
||||||
|
|
||||||
|
|
||||||
|
extern "C" status_t
|
||||||
|
vfs_stat_node_ref(dev_t device, ino_t inode, struct stat *stat)
|
||||||
|
{
|
||||||
|
return B_NOT_SUPPORTED;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
extern "C" status_t
|
||||||
|
vfs_normalize_path(const char* path, char* buffer, size_t bufferSize,
|
||||||
|
bool traverseLink, bool kernel)
|
||||||
|
{
|
||||||
|
return B_NOT_SUPPORTED;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
extern "C" status_t
|
||||||
|
vfs_entry_ref_to_path(dev_t device, ino_t inode, const char *leaf,
|
||||||
|
bool kernel, char *path, size_t pathLength)
|
||||||
|
{
|
||||||
|
return B_NOT_SUPPORTED;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
extern "C" status_t
|
||||||
|
vfs_unmount(dev_t mountID, uint32 flags)
|
||||||
|
{
|
||||||
|
return B_NOT_SUPPORTED;
|
||||||
|
}
|
||||||
@@ -93,7 +93,7 @@ SimpleTest sigsuspend_test : sigsuspend_test.cpp ;
|
|||||||
|
|
||||||
SubInclude HAIKU_TOP src tests system kernel cache ;
|
SubInclude HAIKU_TOP src tests system kernel cache ;
|
||||||
SubInclude HAIKU_TOP src tests system kernel fs ;
|
SubInclude HAIKU_TOP src tests system kernel fs ;
|
||||||
#SubInclude HAIKU_TOP src tests system kernel disk_device_manager ;
|
SubInclude HAIKU_TOP src tests system kernel disk_device_manager ;
|
||||||
SubInclude HAIKU_TOP src tests system kernel device_manager ;
|
SubInclude HAIKU_TOP src tests system kernel device_manager ;
|
||||||
SubInclude HAIKU_TOP src tests system kernel file_corruption ;
|
SubInclude HAIKU_TOP src tests system kernel file_corruption ;
|
||||||
SubInclude HAIKU_TOP src tests system kernel scheduler ;
|
SubInclude HAIKU_TOP src tests system kernel scheduler ;
|
||||||
|
|||||||
@@ -31,6 +31,7 @@ main(int argc, char **argv)
|
|||||||
if (id < B_OK)
|
if (id < B_OK)
|
||||||
printf("creating the file device failed: %s\n", strerror(id));
|
printf("creating the file device failed: %s\n", strerror(id));
|
||||||
|
|
||||||
|
#if 0
|
||||||
// wait for scanning jobs to finish
|
// wait for scanning jobs to finish
|
||||||
// (that's hopefully a hack :-))
|
// (that's hopefully a hack :-))
|
||||||
for (;;) {
|
for (;;) {
|
||||||
@@ -40,6 +41,7 @@ main(int argc, char **argv)
|
|||||||
}
|
}
|
||||||
snooze(50000);
|
snooze(50000);
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
// print devices
|
// print devices
|
||||||
for (int32 cookie = 0;
|
for (int32 cookie = 0;
|
||||||
|
|||||||
@@ -1,36 +1,27 @@
|
|||||||
SubDir HAIKU_TOP src tests system kernel disk_device_manager ;
|
SubDir HAIKU_TOP src tests system kernel disk_device_manager ;
|
||||||
|
|
||||||
SEARCH_SOURCE += [ FDirName $(HAIKU_TOP) src system kernel disk_device_manager jobs ] ;
|
|
||||||
SEARCH_SOURCE += [ FDirName $(HAIKU_TOP) src system kernel disk_device_manager ] ;
|
SEARCH_SOURCE += [ FDirName $(HAIKU_TOP) src system kernel disk_device_manager ] ;
|
||||||
SEARCH_SOURCE += [ FDirName $(HAIKU_TOP) src system kernel fs ] ;
|
SEARCH_SOURCE += [ FDirName $(HAIKU_TOP) src system kernel fs ] ;
|
||||||
SEARCH_SOURCE += [ FDirName $(HAIKU_TOP) src kits storage ] ;
|
SEARCH_SOURCE += [ FDirName $(HAIKU_TOP) src kits storage disk_device ] ;
|
||||||
# DiskDeviceTypes.cpp
|
# DiskDeviceTypes.cpp
|
||||||
|
|
||||||
#UsePrivateHeaders $(DOT) ;
|
SEARCH_SOURCE += [ FDirName $(HAIKU_TOP) src system kernel events ] ;
|
||||||
UsePrivateHeaders shared ;
|
# Notifications.cpp
|
||||||
|
|
||||||
|
UsePrivateKernelHeaders ;
|
||||||
UsePrivateHeaders [ FDirName kernel boot platform $(TARGET_KERNEL_PLATFORM) ] ;
|
UsePrivateHeaders [ FDirName kernel boot platform $(TARGET_KERNEL_PLATFORM) ] ;
|
||||||
UsePrivateHeaders [ FDirName kernel disk_device_manager ] ;
|
UsePrivateHeaders [ FDirName kernel disk_device_manager ] ;
|
||||||
UsePrivateHeaders [ FDirName kernel arch $(TARGET_KERNEL_ARCH_DIR) ] ;
|
|
||||||
UsePrivateHeaders [ FDirName kernel fs ] ;
|
UsePrivateHeaders [ FDirName kernel fs ] ;
|
||||||
UsePrivateHeaders [ FDirName kernel ] ;
|
|
||||||
UsePrivateHeaders [ FDirName kernel util ] ;
|
UsePrivateHeaders [ FDirName kernel util ] ;
|
||||||
UsePrivateHeaders storage ;
|
UsePrivateHeaders storage ;
|
||||||
UsePrivateHeaders kernel ;
|
|
||||||
UseHeaders [ FDirName $(HAIKU_TOP) src system kernel disk_device_manager ] ;
|
UseHeaders [ FDirName $(HAIKU_TOP) src system kernel disk_device_manager ] ;
|
||||||
|
|
||||||
# As long as we compile for R5 userland, we define the following macros.
|
DEFINES += _KERNEL_MODE ;
|
||||||
SubDirCcFlags [ FDefines USER R5_MEMORY_LAYOUT ] ;
|
|
||||||
SubDirC++Flags [ FDefines USER R5_MEMORY_LAYOUT ] ;
|
|
||||||
|
|
||||||
SharedLibrary libdisk_device_manager.so :
|
SharedLibrary test_disk_device_manager.so :
|
||||||
ddm_operation_validation.cpp
|
|
||||||
# ddm_userland_interface.cpp
|
# ddm_userland_interface.cpp
|
||||||
disk_device_manager.cpp
|
disk_device_manager.cpp
|
||||||
KDiskDevice.cpp
|
KDiskDevice.cpp
|
||||||
KDiskDeviceJob.cpp
|
|
||||||
KDiskDeviceJobFactory.cpp
|
|
||||||
KDiskDeviceJobGenerator.cpp
|
|
||||||
KDiskDeviceJobQueue.cpp
|
|
||||||
KDiskDeviceManager.cpp
|
KDiskDeviceManager.cpp
|
||||||
KFileDiskDevice.cpp
|
KFileDiskDevice.cpp
|
||||||
KDiskSystem.cpp
|
KDiskSystem.cpp
|
||||||
@@ -39,53 +30,32 @@ SharedLibrary libdisk_device_manager.so :
|
|||||||
KPartitioningSystem.cpp
|
KPartitioningSystem.cpp
|
||||||
KPartitionListener.cpp
|
KPartitionListener.cpp
|
||||||
KPartitionVisitor.cpp
|
KPartitionVisitor.cpp
|
||||||
KPhysicalPartition.cpp
|
|
||||||
KShadowPartition.cpp
|
|
||||||
UserDataWriter.cpp
|
UserDataWriter.cpp
|
||||||
|
|
||||||
|
# disk device types
|
||||||
|
DiskDeviceTypes.cpp
|
||||||
|
|
||||||
# fs
|
# fs
|
||||||
KPath.cpp
|
KPath.cpp
|
||||||
|
|
||||||
# jobs
|
# notifications
|
||||||
KCreateChildJob.cpp
|
Notifications.cpp
|
||||||
KDefragmentJob.cpp
|
|
||||||
KDeleteChildJob.cpp
|
|
||||||
KInitializeJob.cpp
|
|
||||||
KMoveJob.cpp
|
|
||||||
KRepairJob.cpp
|
|
||||||
KResizeJob.cpp
|
|
||||||
KScanPartitionJob.cpp
|
|
||||||
KSetParametersJob.cpp
|
|
||||||
KUninitializeJob.cpp
|
|
||||||
|
|
||||||
# utilities
|
: be libkernelland_emu.so [ TargetLibsupc++ ]
|
||||||
Locker.cpp
|
|
||||||
RWLocker.cpp
|
|
||||||
|
|
||||||
# disk device types
|
|
||||||
DiskDeviceTypes.cpp
|
|
||||||
;
|
;
|
||||||
|
|
||||||
LinkAgainst libdisk_device_manager.so
|
SimpleTest DiskDeviceManagerTest :
|
||||||
: <boot!home!config!lib>libkernelland_emu.so ;
|
DiskDeviceManagerTest.cpp
|
||||||
|
: test_disk_device_manager.so be
|
||||||
AbsSymLink <boot!home!config!lib>libdisk_device_manager.so
|
|
||||||
: libdisk_device_manager.so : /boot/home/config/lib ;
|
|
||||||
|
|
||||||
SimpleTest DiskDeviceManagerTest
|
|
||||||
: DiskDeviceManagerTest.cpp
|
|
||||||
: <boot!home!config!lib>libdisk_device_manager.so be
|
|
||||||
;
|
;
|
||||||
|
|
||||||
Depends DiskDeviceManagerTest : <boot!home!config!lib>libkernelland_emu.so ;
|
|
||||||
|
|
||||||
# Also build all modules:
|
# Also build all modules:
|
||||||
Depends DiskDeviceManagerTest : userland_disk_system_modules ;
|
Depends DiskDeviceManagerTest : userland_disk_system_modules ;
|
||||||
|
|
||||||
# Pseudo target for disk system modules.
|
# Pseudo target for disk system modules.
|
||||||
NotFile userland_disk_system_modules ;
|
NotFile userland_disk_system_modules ;
|
||||||
Depends userland_disk_system_modules :
|
Depends userland_disk_system_modules :
|
||||||
<boot!home!config!lib>libkernelland_emu.so
|
libkernelland_emu.so
|
||||||
<file_system>bfs
|
<file_system>bfs
|
||||||
<partitioning_system>intel
|
<partitioning_system>intel
|
||||||
<partitioning_system>amiga_rdb
|
<partitioning_system>amiga_rdb
|
||||||
|
|||||||
Reference in New Issue
Block a user