FreeNOS
Public Member Functions | Private Member Functions | Private Attributes
CoreClient Class Reference

CoreClient provides a simple interface to a CoreServer. More...

#include <CoreClient.h>

Public Member Functions

 CoreClient (const ProcessID pid=CORESRV_PID)
 Class constructor function. More...
 
Core::Result getCoreCount (Size &numCores) const
 Get number of processor cores in the system. More...
 
Core::Result createProcess (const Size coreId, const Address programAddr, const Size programSize, const char *programCmd) const
 Create a new process on a different core. More...
 

Private Member Functions

Core::Result request (CoreMessage &msg) const
 Send an IPC request to the CoreServer. More...
 

Private Attributes

const ProcessID m_pid
 ProcessID of the CoreServer. More...
 

Detailed Description

CoreClient provides a simple interface to a CoreServer.

See also
CoreServer

Definition at line 40 of file CoreClient.h.

Constructor & Destructor Documentation

◆ CoreClient()

CoreClient::CoreClient ( const ProcessID  pid = CORESRV_PID)

Class constructor function.

Parameters
pidOptional ProcessID of the CoreServer.

Definition at line 22 of file CoreClient.cpp.

Member Function Documentation

◆ createProcess()

Core::Result CoreClient::createProcess ( const Size  coreId,
const Address  programAddr,
const Size  programSize,
const char *  programCmd 
) const

Create a new process on a different core.

Parameters
coreIdSpecifies the core on which the process will be created.
programAddrVirtual address of the loaded program to start.
programSizeSize of the loaded program in bytes.
programCmdCommand-line string for starting the program.
Returns
Result code

Definition at line 54 of file CoreClient.cpp.

References CoreMessage::action, coreId, CoreMessage::coreNumber, Core::CreateProcess, CoreMessage::programAddr, CoreMessage::programCmd, CoreMessage::programSize, ChannelMessage::Request, request(), and ChannelMessage::type.

Referenced by MpiTarget::initializeMaster(), and MpiProxy::startRemoteProcess().

◆ getCoreCount()

Core::Result CoreClient::getCoreCount ( Size numCores) const

Get number of processor cores in the system.

Parameters
numCoresOn output, contains the number of processor cores.
Returns
Result code

Definition at line 39 of file CoreClient.cpp.

References CoreMessage::action, CoreMessage::coreNumber, Core::GetCoreCount, ChannelMessage::Request, request(), Core::Success, and ChannelMessage::type.

Referenced by SysInfo::exec(), and MpiTarget::initializeMaster().

◆ request()

Core::Result CoreClient::request ( CoreMessage msg) const
inlineprivate

Send an IPC request to the CoreServer.

Parameters
msgReference to the CoreMessage to send
Returns
Result code

Definition at line 27 of file CoreClient.cpp.

References StrictSingleton< ChannelClient >::instance(), Core::IpcError, m_pid, CoreMessage::result, and ChannelClient::Success.

Referenced by createProcess(), and getCoreCount().

Field Documentation

◆ m_pid

const ProcessID CoreClient::m_pid
private

ProcessID of the CoreServer.

Definition at line 89 of file CoreClient.h.

Referenced by request().


The documentation for this class was generated from the following files: