FreeNOS
CoreInfo.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2015 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 __LIBARCH_COREINFO_H
19 #define __LIBARCH_COREINFO_H
20 
29 #define KERNEL_PATHLEN 64
30 
32 #define COREINFO_SIZE (KERNEL_PATHLEN + (8 * 4) + (4 * 4) + (4 * 4))
33 
39 #ifndef __ASSEMBLER__
40 
41 #include <Macros.h>
42 #include <Types.h>
43 #include <Memory.h>
44 
60 typedef struct CoreInfo
61 {
64 
67 
70 
73 
76 
79 
82 
85 
88 
91 
94 
97 
100 
101  bool operator == (const struct CoreInfo & info) const
102  {
103  return false;
104  }
105 
106  bool operator != (const struct CoreInfo & info) const
107  {
108  return true;
109  }
110 }
111 CoreInfo;
112 
120 extern CoreInfo coreInfo;
121 
123 extern C uint isKernel;
124 
125 #endif /* __ASSEMBLER__ */
126 
132 #endif /* __LIBARCH_COREINFO_H */
Memory::Range
Memory range.
Definition: Memory.h:55
Macros.h
Types.h
CoreInfo::bootImageSize
Address bootImageSize
Boot image size in bytes.
Definition: CoreInfo.h:84
CoreInfo::heapAddress
Address heapAddress
Physical memory address of the kernel heap.
Definition: CoreInfo.h:93
isKernel
C uint isKernel
Non-zero if this executable is linked as the kernel.
Address
unsigned long Address
A memory address.
Definition: Types.h:131
CoreInfo::memory
Memory::Range memory
Defines the physical memory available to the core.
Definition: CoreInfo.h:69
CoreInfo::coreChannelAddress
Address coreChannelAddress
Physical memory address of IPC channel for CoreServer of this core.
Definition: CoreInfo.h:87
uint
unsigned int uint
Unsigned integer number.
Definition: Types.h:44
CoreInfo::coreId
uint coreId
Core identifier.
Definition: CoreInfo.h:66
CoreInfo
struct CoreInfo CoreInfo
Per-Core information structure.
C
#define C
Used to define external C functions.
Definition: Macros.h:134
CoreInfo::kernelCommand
char kernelCommand[KERNEL_PATHLEN]
Kernel command.
Definition: CoreInfo.h:78
CoreInfo::kernelEntry
Address kernelEntry
Kernel entry point.
Definition: CoreInfo.h:72
KERNEL_PATHLEN
#define KERNEL_PATHLEN
Definition: CoreInfo.h:29
Size
unsigned int Size
Any sane size indicator cannot go negative.
Definition: Types.h:128
CoreInfo::bootImageAddress
Address bootImageAddress
Boot image physical memory address.
Definition: CoreInfo.h:81
CoreInfo::booted
uint booted
Set to non-zero by early boot code when this core is running.
Definition: CoreInfo.h:63
CoreInfo
Per-Core information structure.
Definition: CoreInfo.h:60
Memory.h
coreInfo
CoreInfo coreInfo
Local CoreInfo instance.
CoreInfo::timerCounter
uint timerCounter
Arch-specific timer counter.
Definition: CoreInfo.h:99
CoreInfo::coreChannelSize
Size coreChannelSize
Size of the IPC channel in bytes.
Definition: CoreInfo.h:90
CoreInfo::kernel
Memory::Range kernel
Kernel memory range.
Definition: CoreInfo.h:75
CoreInfo::operator==
bool operator==(const struct CoreInfo &info) const
Definition: CoreInfo.h:101
CoreInfo::heapSize
Size heapSize
Size in bytes of the kernel heap.
Definition: CoreInfo.h:96
CoreInfo::operator!=
bool operator!=(const struct CoreInfo &info) const
Definition: CoreInfo.h:106