Files
exectos/xtoskrnl/ob/devmap.cc
Aiken Harris 195c749396
Some checks failed
Builds / ExectOS (i686, debug) (push) Failing after 27s
Builds / ExectOS (amd64, release) (push) Failing after 39s
Builds / ExectOS (i686, release) (push) Failing after 36s
Builds / ExectOS (amd64, debug) (push) Failing after 28s
Implement core Object Manager subsystem
2026-07-09 08:11:44 +02:00

83 lines
2.0 KiB
C++

/**
* PROJECT: ExectOS
* COPYRIGHT: See COPYING.md in the top level directory
* FILE: xtoskrnl/ob/devmap.cc
* DESCRIPTION: Object Manager Device Map
* DEVELOPERS: Aiken Harris <harraiken91@gmail.com>
*/
#include <xtos.hh>
/**
* Retrieves the Global Devices Directory associated with a given directory's device map.
*
* @param Directory
* Supplies a pointer to the object directory to query.
*
* @return Returns a pointer to the global devices directory, or NULLPTR if none exists.
*
* @since XT 1.0
*/
XTAPI
POBJECT_DIRECTORY
OB::DeviceMap::GetGlobalDevicesDirectory(IN POBJECT_DIRECTORY Directory)
{
POBJECT_DIRECTORY GlobalDevicesDirectory;
/* Assume no mapping exists */
GlobalDevicesDirectory = NULLPTR;
/* Acquire the device map lock */
KE::PushLock::AcquireExclusivePushLock(&DeviceMapLock);
/* Check if the directory has an associated device map */
if(Directory->DeviceMap)
{
/* Extract the global devices directory */
GlobalDevicesDirectory = Directory->DeviceMap->GlobalDevicesDirectory;
}
/* Release the device map lock */
KE::PushLock::ReleaseExclusivePushLock(&DeviceMapLock);
/* Return the resolved directory */
return GlobalDevicesDirectory;
}
/**
* Retrieves the current state of the unique device maps configuration.
*
* @return This routine returns TRUE if unique device maps are enabled, or FALSE otherwise.
*
* @since XT 1.0
*/
XTAPI
BOOLEAN
OB::DeviceMap::GetUniqueDeviceMaps(VOID)
{
/* Return the unique device maps flag */
return UniqueDeviceMaps;
}
/**
* Initializes the Object Manager's device map subsystem.
*
* @return This routine returns a status code indicating the success or failure of the operation.
*
* @since XT 1.0
*/
XTAPI
XTSTATUS
OB::DeviceMap::InitializeDeviceMap(VOID)
{
/* Initialize device map lock */
KE::PushLock::InitializePushLock(&DeviceMapLock);
/* Temporarily disable unique device maps */
UniqueDeviceMaps = FALSE;
/* Return success */
return STATUS_SUCCESS;
}