18#ifndef __SERVER_CORE_CORESERVER_H
19#define __SERVER_CORE_CORESERVER_H
21#include <FreeNOS/User.h>
Abstract Factory pattern providing a creation function declaration.
Template class which serves incoming messages from Channels using MessageHandlers.
Represents a single Core in a Central Processing Unit (CPU).
Core::Result sendToMaster(CoreMessage *msg)
Send message to master.
MemoryChannel * m_toMaster
Core::Result bootAll()
Boot all processor cores.
Index< MemoryChannel, MaxCores > * m_fromSlave
virtual Core::Result sendIPI(uint coreId)=0
Send Inter-Processor-Interrupt.
void getCoreCount(CoreMessage *msg)
Get and fill the number of processor cores.
void createProcess(CoreMessage *msg)
Create a process on the current processor core.
virtual void waitIPI() const =0
Wait for Inter-Processor-Interrupt.
Memory::Range m_kernelImage
Core::Result loadKernel()
Load operating system kernel program.
virtual Result initialize()
Initialize the server.
ExecutableFormat * m_kernel
Index< MemoryChannel, MaxCores > * m_toSlave
int runCore()
Routine for the slave processor core.
Core::Result receiveFromMaster(CoreMessage *msg)
Receive message from master.
virtual Core::Result bootCore(uint coreId, CoreInfo *info)=0
Boot a processor core.
Core::Result unloadKernel()
Unload operating system kernel program.
static const Size MaxCores
Maximum number of cores currently supported.
Core::Result prepareCore(uint coreId, CoreInfo *info, ExecutableFormat::Region *regions)
Prepare processor core for booting.
virtual Core::Result discoverCores()=0
Discover processor cores.
Index< CoreInfo, MaxCores > * m_coreInfo
Core::Result sendToSlave(uint coreId, CoreMessage *msg)
Send message to slave.
Core::Result prepareCoreInfo()
Prepare the CoreInfo array.
Core::Result test()
Run a ping-pong test.
Core::Result receiveFromSlave(uint coreId, CoreMessage *msg)
Receive message from slave.
static const char * kernelPath
The default kernel for starting new cores.
MemoryChannel * m_fromMaster
static const Size MaxMessageRetry
Number of times to busy wait on receiving a message.
Core::Result clearPages(Address addr, Size size)
Clear memory pages with zeroes.
ExecutableFormat::Region m_regions[16]
Core::Result setupChannels()
Setup communication channels between CoreServers.
CoreServer()
Class constructor function.
Index is a N-sized array of pointers to items of type T.
Unidirectional point-to-point channel using shared memory.
unsigned long Address
A memory address.
unsigned int uint
Unsigned integer number.
unsigned int Size
Any sane size indicator cannot go negative.
Result
Result code for Actions.
Per-Core information structure.
Message format for communication with the CoreServer.