FreeNOS
Public Member Functions | Private Attributes | Static Private Attributes
IntelCoreServer Class Reference

Represents a single Core in a Central Processing Unit (CPU). More...

#include <IntelCoreServer.h>

Inheritance diagram for IntelCoreServer:
CoreServer ChannelServer< CoreServer, CoreMessage > AbstractFactory< CoreServer >

Public Member Functions

 IntelCoreServer ()
 Class constructor function. More...
 
virtual Result initialize ()
 Initialize the server. More...
 
virtual Core::Result bootCore (uint coreId, CoreInfo *info)
 Boot a processor core. More...
 
virtual Core::Result discoverCores ()
 Discover processor cores. More...
 
virtual void waitIPI () const
 Wait for Inter-Processor-Interrupt. More...
 
virtual Core::Result sendIPI (uint coreId)
 Send Inter-Processor-Interrupt. More...
 
- Public Member Functions inherited from CoreServer
 CoreServer ()
 Class constructor function. More...
 
Core::Result test ()
 Run a ping-pong test. More...
 
int runCore ()
 Routine for the slave processor core. More...
 
- Public Member Functions inherited from ChannelServer< CoreServer, CoreMessage >
 ChannelServer (CoreServer *inst)
 Constructor function. More...
 
virtual ~ChannelServer ()
 Destructor function. More...
 
int run ()
 Enters an infinite loop, serving incoming requests. More...
 
void setTimeout (const uint msec)
 Set a sleep timeout. More...
 

Private Attributes

IntelAPIC m_apic
 
IntelMP m_mp
 
IntelACPI m_acpi
 

Static Private Attributes

static const uint IPIVector = 50
 Inter-Processor-Interrupt vector number. More...
 

Additional Inherited Members

- Public Types inherited from ChannelServer< CoreServer, CoreMessage >
enum  Result
 Result codes. More...
 
- Static Public Member Functions inherited from AbstractFactory< CoreServer >
static CoreServercreate ()
 Abstract function to create an instance of T. More...
 
- Protected Types inherited from ChannelServer< CoreServer, CoreMessage >
typedef void(CoreServer ::* IPCHandlerFunction) (CoreMessage *)
 Member function pointer inside Base, to handle IPC messages. More...
 
typedef void(CoreServer ::* IRQHandlerFunction) (Size)
 Member function pointer inside Base, to handle interrupts. More...
 
- Protected Member Functions inherited from ChannelServer< CoreServer, CoreMessage >
void addIPCHandler (const Size slot, IPCHandlerFunction h, const bool sendReply=true)
 Register a new IPC message action handler. More...
 
void addIRQHandler (const Size slot, IRQHandlerFunction h)
 Register a new IRQ message vector handler. More...
 
virtual void timeout ()
 Called when sleep timeout is reached. More...
 
virtual bool retryRequests ()
 Retry any pending requests. More...
 
virtual void onProcessTerminated (const ProcessID pid)
 Called whenever another Process is terminated. More...
 
void retryAllRequests ()
 Keep retrying requests until all served. More...
 
- Protected Attributes inherited from CoreServer
CoreManagerm_cores
 
- Protected Attributes inherited from ChannelServer< CoreServer, CoreMessage >
CoreServerm_instance
 Server object instance. More...
 
ChannelClientm_client
 Client for sending replies. More...
 
ChannelRegistrym_registry
 Contains registered channels. More...
 
MemoryChannel m_kernelEvent
 Kernel event channel. More...
 
Index< MessageHandler< IPCHandlerFunction >, MaximumHandlerCountm_ipcHandlers
 IPC handler functions. More...
 
Index< MessageHandler< IRQHandlerFunction >, MaximumHandlerCountm_irqHandlers
 IRQ handler functions. More...
 
ProcessID m_self
 ProcessID of ourselves. More...
 
Timer::Info m_time
 System timer value. More...
 
Timer::Info m_expiry
 System timer expiration value. More...
 

Detailed Description

Represents a single Core in a Central Processing Unit (CPU).

Each core in a system will run its own instance of CoreServer. CoreServers will communicate and collaborate together to implement functionality.

See also
IntelMP

Definition at line 42 of file IntelCoreServer.h.

Constructor & Destructor Documentation

◆ IntelCoreServer()

IntelCoreServer::IntelCoreServer ( )

Class constructor function.

Definition at line 29 of file IntelCoreServer.cpp.

Member Function Documentation

◆ bootCore()

Core::Result IntelCoreServer::bootCore ( uint  coreId,
CoreInfo info 
)
virtual

Boot a processor core.

Parameters
coreIdCore identifier number
infoCoreInfo pointer containing specific core information
Returns
Result code

Implements CoreServer.

Definition at line 49 of file IntelCoreServer.cpp.

References IntelMP::boot(), Core::BootError, coreId, ERROR, m_mp, NOTICE, CoreManager::Success, and Core::Success.

◆ discoverCores()

Core::Result IntelCoreServer::discoverCores ( )
virtual

◆ initialize()

IntelCoreServer::Result IntelCoreServer::initialize ( )
virtual

Initialize the server.

Returns
Result code

Reimplemented from CoreServer.

Definition at line 35 of file IntelCoreServer.cpp.

References ERROR, CoreServer::initialize(), ChannelServer< CoreServer, CoreMessage >::IOError, IPIVector, ProcessCtl(), SELF, API::Success, and WatchIRQ.

◆ sendIPI()

Core::Result IntelCoreServer::sendIPI ( uint  coreId)
virtual

Send Inter-Processor-Interrupt.

Parameters
coreIdCore identifier number
Returns
Result code

Implements CoreServer.

Definition at line 93 of file IntelCoreServer.cpp.

References coreId, ERROR, Core::IOError, IPIVector, m_apic, IntelAPIC::sendIPI(), IntController::Success, and Core::Success.

◆ waitIPI()

void IntelCoreServer::waitIPI ( ) const
virtual

Wait for Inter-Processor-Interrupt.

Implements CoreServer.

Definition at line 86 of file IntelCoreServer.cpp.

References EnableIRQ, EnterSleep, IPIVector, ProcessCtl(), and SELF.

Field Documentation

◆ IPIVector

const uint IntelCoreServer::IPIVector = 50
staticprivate

Inter-Processor-Interrupt vector number.

Definition at line 47 of file IntelCoreServer.h.

Referenced by initialize(), sendIPI(), and waitIPI().

◆ m_acpi

IntelACPI IntelCoreServer::m_acpi
private

Definition at line 98 of file IntelCoreServer.h.

Referenced by discoverCores().

◆ m_apic

IntelAPIC IntelCoreServer::m_apic
private

Definition at line 96 of file IntelCoreServer.h.

Referenced by sendIPI().

◆ m_mp

IntelMP IntelCoreServer::m_mp
private

Definition at line 97 of file IntelCoreServer.h.

Referenced by bootCore(), and discoverCores().


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