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
60typedef 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}
112
120extern CoreInfo coreInfo;
121
123extern C uint isKernel;
124
125#endif /* __ASSEMBLER__ */
126
132#endif /* __LIBARCH_COREINFO_H */
CoreInfo coreInfo
Local CoreInfo instance.
#define KERNEL_PATHLEN
Definition CoreInfo.h:29
C uint isKernel
Non-zero if this executable is linked as the kernel.
unsigned long Address
A memory address.
Definition Types.h:131
unsigned int uint
Unsigned integer number.
Definition Types.h:44
unsigned int Size
Any sane size indicator cannot go negative.
Definition Types.h:128
#define C
Used to define external C functions.
Definition Macros.h:134
Per-Core information structure.
Definition CoreInfo.h:61
uint timerCounter
Arch-specific timer counter.
Definition CoreInfo.h:99
Address bootImageSize
Boot image size in bytes.
Definition CoreInfo.h:84
Memory::Range kernel
Kernel memory range.
Definition CoreInfo.h:75
Size coreChannelSize
Size of the IPC channel in bytes.
Definition CoreInfo.h:90
uint coreId
Core identifier.
Definition CoreInfo.h:66
Address coreChannelAddress
Physical memory address of IPC channel for CoreServer of this core.
Definition CoreInfo.h:87
Address bootImageAddress
Boot image physical memory address.
Definition CoreInfo.h:81
bool operator!=(const struct CoreInfo &info) const
Definition CoreInfo.h:106
Memory::Range memory
Defines the physical memory available to the core.
Definition CoreInfo.h:69
Size heapSize
Size in bytes of the kernel heap.
Definition CoreInfo.h:96
Address heapAddress
Physical memory address of the kernel heap.
Definition CoreInfo.h:93
Address kernelEntry
Kernel entry point.
Definition CoreInfo.h:72
uint booted
Set to non-zero by early boot code when this core is running.
Definition CoreInfo.h:63
char kernelCommand[KERNEL_PATHLEN]
Kernel command.
Definition CoreInfo.h:78
bool operator==(const struct CoreInfo &info) const
Definition CoreInfo.h:101
Memory range.
Definition Memory.h:56