FreeNOS
CoreClient.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2020 Niek Linnenbank
3  *
4  * This program is free software: you can redistribute it and/or modify
5  * it under the terms of the GNU General Public License as published by
6  * the Free Software Foundation, either version 3 of the License, or
7  * (at your option) any later version.
8  *
9  * This program is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12  * GNU General Public License for more details.
13  *
14  * You should have received a copy of the GNU General Public License
15  * along with this program. If not, see <http://www.gnu.org/licenses/>.
16  */
17 
18 #ifndef __LIB_LIBRUNTIME_CORECLIENT_H
19 #define __LIB_LIBRUNTIME_CORECLIENT_H
20 
21 #include <FreeNOS/API/ProcessID.h>
22 #include <Types.h>
23 #include "Core.h"
24 
25 struct CoreMessage;
26 
41 {
42  public:
43 
49  CoreClient(const ProcessID pid = CORESRV_PID);
50 
58  Core::Result getCoreCount(Size &numCores) const;
59 
71  const Address programAddr,
72  const Size programSize,
73  const char *programCmd) const;
74 
75  private:
76 
84  Core::Result request(CoreMessage &msg) const;
85 
86  private:
87 
90 };
91 
97 #endif /* __LIB_LIBRUNTIME_CORECLIENT_H */
CoreClient
CoreClient provides a simple interface to a CoreServer.
Definition: CoreClient.h:40
Types.h
CoreMessage
Message format for communication with the CoreServer.
Definition: CoreMessage.h:38
ProcessID
u32 ProcessID
Process Identification Number.
Definition: Types.h:140
Address
unsigned long Address
A memory address.
Definition: Types.h:131
CoreClient::createProcess
Core::Result createProcess(const Size coreId, const Address programAddr, const Size programSize, const char *programCmd) const
Create a new process on a different core.
Definition: CoreClient.cpp:54
CoreClient::m_pid
const ProcessID m_pid
ProcessID of the CoreServer.
Definition: CoreClient.h:89
CoreClient::getCoreCount
Core::Result getCoreCount(Size &numCores) const
Get number of processor cores in the system.
Definition: CoreClient.cpp:39
CoreClient::CoreClient
CoreClient(const ProcessID pid=CORESRV_PID)
Class constructor function.
Definition: CoreClient.cpp:22
CORESRV_PID
#define CORESRV_PID
Definition: ProcessID.h:38
Size
unsigned int Size
Any sane size indicator cannot go negative.
Definition: Types.h:128
Core::Result
Result
Result code for Actions.
Definition: Core.h:47
Core.h
coreId
u8 coreId
Definition: IntelACPI.h:64
CoreClient::request
Core::Result request(CoreMessage &msg) const
Send an IPC request to the CoreServer.
Definition: CoreClient.cpp:27