mirror of
https://github.com/mmueller41/genode.git
synced 2026-01-22 04:52:56 +01:00
Compare commits
431 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
ef1cd4a276 | ||
|
|
d13605a9a3 | ||
|
|
3d42cb0693 | ||
|
|
a652cb5110 | ||
|
|
a4066c358e | ||
|
|
17eb342156 | ||
|
|
baa55dabc4 | ||
|
|
97374cf57e | ||
|
|
d39dfef98f | ||
|
|
d47468c005 | ||
|
|
7f7c24fcc9 | ||
|
|
3a6f639df8 | ||
|
|
55e1c16c98 | ||
|
|
0c22f3da75 | ||
|
|
7972e4587b | ||
|
|
ed3187aa74 | ||
|
|
e349c29736 | ||
|
|
35f9ceb7ba | ||
|
|
4474e9d6d6 | ||
|
|
0654877392 | ||
|
|
009adff441 | ||
|
|
32e3eee48c | ||
|
|
149356f7ab | ||
|
|
fe4a6d7d81 | ||
|
|
a2b15349fd | ||
|
|
f0b5c5eca5 | ||
|
|
a125f7179e | ||
|
|
258c74db59 | ||
|
|
7b54eaaee1 | ||
|
|
572592b0f3 | ||
|
|
5b0a8e54f9 | ||
|
|
fd11bd489e | ||
|
|
58e8481793 | ||
|
|
bb00aebc9e | ||
|
|
9b28395f0d | ||
|
|
3ec16da03f | ||
|
|
6741af07aa | ||
|
|
c4627fab44 | ||
|
|
35723d813d | ||
|
|
5ec07614e8 | ||
|
|
9111f060f5 | ||
|
|
fd95637289 | ||
|
|
2e6504df62 | ||
|
|
6c994d19fe | ||
|
|
6d837c9e26 | ||
|
|
f1af8e371d | ||
|
|
5fe29e8e4a | ||
|
|
fa7329a3e6 | ||
|
|
70d0b00dde | ||
|
|
071ca39407 | ||
|
|
2e58428b51 | ||
|
|
9e8255948d | ||
|
|
0e83b0b093 | ||
|
|
0079179f05 | ||
|
|
fdaeda47bb | ||
|
|
683832f461 | ||
|
|
4e47cd2568 | ||
|
|
8655b58953 | ||
|
|
4e2e79bf4f | ||
|
|
4ae1faf14d | ||
|
|
e171683b8c | ||
|
|
435b8dd252 | ||
|
|
1a82b664ef | ||
|
|
b5739fc520 | ||
|
|
5cf4e323c5 | ||
|
|
2aafc9d4e6 | ||
|
|
8f3413f487 | ||
|
|
956cab5fdb | ||
|
|
959282403c | ||
|
|
7a4f98f2ed | ||
|
|
dc177e037d | ||
|
|
adf895acad | ||
|
|
9b6d37649b | ||
|
|
01d267e551 | ||
|
|
717be91e16 | ||
|
|
09049278a6 | ||
|
|
b1cb1ceaf9 | ||
|
|
b9449a4279 | ||
|
|
b4283c9121 | ||
|
|
b9e48e94ec | ||
|
|
8afcbce01e | ||
|
|
4e8d0618bb | ||
|
|
ff0eb93569 | ||
|
|
61a3f8c2af | ||
|
|
5094b79a31 | ||
|
|
505f4290ec | ||
|
|
a341f744ce | ||
|
|
dae8ca2952 | ||
|
|
99ae463e5c | ||
|
|
5d75e6676d | ||
|
|
09d81759ee | ||
|
|
6c7a25d08c | ||
|
|
b3eecfcced | ||
|
|
e717ad656f | ||
|
|
76d449ebe6 | ||
|
|
03538a1c3b | ||
|
|
4dd9172888 | ||
|
|
ef4027a7a8 | ||
|
|
86d323d3cf | ||
|
|
946bd297e6 | ||
|
|
2dce04618e | ||
|
|
861bbc81a3 | ||
|
|
ba273fb6fb | ||
|
|
731493641b | ||
|
|
1fa27bb16c | ||
|
|
bdd145f62d | ||
|
|
a1a790664e | ||
|
|
05d807db75 | ||
|
|
400037a5b0 | ||
|
|
4807d469ca | ||
|
|
241c0f38a4 | ||
|
|
92cb97c05b | ||
|
|
02c0fa85cf | ||
|
|
c962240922 | ||
|
|
1b96e8a7e1 | ||
|
|
ee4c98e093 | ||
|
|
6b42fff30e | ||
|
|
e20b773bef | ||
|
|
5a3e340699 | ||
|
|
cb76c0c45f | ||
|
|
136af3764d | ||
|
|
4ba17f7ebd | ||
|
|
dad3f32d0b | ||
|
|
29b8370f73 | ||
|
|
9ec791db9a | ||
|
|
0ba40d01ca | ||
|
|
b7e553d4db | ||
|
|
129c77f02b | ||
|
|
1904a223e8 | ||
|
|
aacb91f22a | ||
|
|
2045fffe2a | ||
|
|
9bff8c454a | ||
|
|
0613e52a49 | ||
|
|
4fe093b01b | ||
|
|
118ca20a2f | ||
|
|
e3c3f9f44f | ||
|
|
089f8dcfc8 | ||
|
|
9263079f70 | ||
|
|
acc24b5905 | ||
|
|
717e4dd362 | ||
|
|
fd7683f6ea | ||
|
|
4c9cee24de | ||
|
|
776a8d3f8c | ||
|
|
4925f77dac | ||
|
|
68ba7a0b57 | ||
|
|
d822b82f5b | ||
|
|
8d9e7d0da2 | ||
|
|
e35dbd3353 | ||
|
|
198f8b65a4 | ||
|
|
cfa3d38417 | ||
|
|
276dbdab60 | ||
|
|
9d23cdc27f | ||
|
|
3fb7e74287 | ||
|
|
0ad284febe | ||
|
|
ad3427e857 | ||
|
|
da930d146f | ||
|
|
770157fea0 | ||
|
|
664d0036c8 | ||
|
|
9f2097669a | ||
|
|
5d79c6be1a | ||
|
|
8a623c6317 | ||
|
|
494bb8ff0d | ||
|
|
4bffa249fd | ||
|
|
f1c99b190f | ||
|
|
ef6450d5d3 | ||
|
|
ada408d2f7 | ||
|
|
686c551b66 | ||
|
|
6ae5d3a04b | ||
|
|
53b186fe01 | ||
|
|
c93e770316 | ||
|
|
0c7c285079 | ||
|
|
e23f24505b | ||
|
|
ae49f6216d | ||
|
|
059bf1c576 | ||
|
|
a73dc1b581 | ||
|
|
5a3c2c33b7 | ||
|
|
cb01f75a9d | ||
|
|
a4eb4bfa07 | ||
|
|
cc0f4bc9d2 | ||
|
|
98ee7612f1 | ||
|
|
71490e131b | ||
|
|
c3537d175c | ||
|
|
f7034369b2 | ||
|
|
1d34589f84 | ||
|
|
8fb8cf1c8b | ||
|
|
231d92f88a | ||
|
|
8cf893e8c6 | ||
|
|
52cf25982a | ||
|
|
e5eeda2ec9 | ||
|
|
1b60fd6147 | ||
|
|
27b6839ee0 | ||
|
|
bdd2935d4a | ||
|
|
1887222b53 | ||
|
|
32fb7bbddd | ||
|
|
c61d832ae3 | ||
|
|
e06a154294 | ||
|
|
d0d5ec92b6 | ||
|
|
d2e883e235 | ||
|
|
9d778a658d | ||
|
|
853d541340 | ||
|
|
153429268e | ||
|
|
8fae7131c8 | ||
|
|
973efe945b | ||
|
|
125d55ce71 | ||
|
|
37856a0ad0 | ||
|
|
7584bdb22e | ||
|
|
b355897f53 | ||
|
|
be8a3c6f08 | ||
|
|
179f742924 | ||
|
|
96e9fcd326 | ||
|
|
64a2447d03 | ||
|
|
056e0792e5 | ||
|
|
a140f134c7 | ||
|
|
4f52e793a0 | ||
|
|
4c89f4f00f | ||
|
|
9b22983e58 | ||
|
|
f07973126d | ||
|
|
87ac608e61 | ||
|
|
8ac5ae2248 | ||
|
|
5e321732df | ||
|
|
6826a07133 | ||
|
|
4a9b1c6aab | ||
|
|
314d5c0975 | ||
|
|
cf9eedca47 | ||
|
|
fbbd2018bb | ||
|
|
3cb6de2e69 | ||
|
|
ee28a69c98 | ||
|
|
89a8c2c211 | ||
|
|
e164671cd1 | ||
|
|
1c38667a96 | ||
|
|
1a7efc0df1 | ||
|
|
37c2f101b1 | ||
|
|
2e7802b799 | ||
|
|
a0d182e25a | ||
|
|
65136c2289 | ||
|
|
1dc9ab9a95 | ||
|
|
df1209aa89 | ||
|
|
33c5469b92 | ||
|
|
8708732e9c | ||
|
|
cda25a481b | ||
|
|
6d07fff07c | ||
|
|
6928821f52 | ||
|
|
5c78ef20a2 | ||
|
|
529e791d66 | ||
|
|
2faca15b2b | ||
|
|
99421a2a82 | ||
|
|
89d0e68983 | ||
|
|
c48a7aa27f | ||
|
|
78204b8f49 | ||
|
|
ba5906e425 | ||
|
|
688375619a | ||
|
|
b2fee4c7b1 | ||
|
|
da310bd726 | ||
|
|
6e1b9a823d | ||
|
|
7566aaebb9 | ||
|
|
6786e6d04c | ||
|
|
37cde31eb3 | ||
|
|
8ac6d8c96c | ||
|
|
65f20262cb | ||
|
|
d43d9900ab | ||
|
|
71cd7b9d2e | ||
|
|
ddffc8765e | ||
|
|
ee572e2f8e | ||
|
|
0561538919 | ||
|
|
ff28ce77b2 | ||
|
|
98cb023f1c | ||
|
|
ae291b557d | ||
|
|
d8f0392c9f | ||
|
|
33bb8662a0 | ||
|
|
ef4a4ea654 | ||
|
|
ca92984bcc | ||
|
|
562ac7d059 | ||
|
|
138a37765f | ||
|
|
ed825c1d46 | ||
|
|
d1f40b86d9 | ||
|
|
3a884bd873 | ||
|
|
5e91acbaa9 | ||
|
|
5bbf1f7eea | ||
|
|
2349cd2dc3 | ||
|
|
86e428cd64 | ||
|
|
2beb851c5a | ||
|
|
aa98450f71 | ||
|
|
1b8e7820d8 | ||
|
|
94629ad493 | ||
|
|
cab27dd713 | ||
|
|
0b906207bb | ||
|
|
85c6640795 | ||
|
|
df985bda84 | ||
|
|
5c6f13b0d3 | ||
|
|
b5d3be9c85 | ||
|
|
0920e322c2 | ||
|
|
901439211c | ||
|
|
3ace475f2d | ||
|
|
a36813cf6f | ||
|
|
5249c0875c | ||
|
|
2a761c7fea | ||
|
|
267239147a | ||
|
|
5485fe6f18 | ||
|
|
0b660eb033 | ||
|
|
4715ad18b0 | ||
|
|
2aa22a25ee | ||
|
|
1589820d05 | ||
|
|
c54fef9274 | ||
|
|
ef572f7ef8 | ||
|
|
ea3adfef9a | ||
|
|
b8d690b9aa | ||
|
|
cc5fddb0a2 | ||
|
|
0355591445 | ||
|
|
09e04d6378 | ||
|
|
5d969cffaf | ||
|
|
e39ff055ba | ||
|
|
511cab6192 | ||
|
|
cddd69a122 | ||
|
|
0950b2f340 | ||
|
|
4fe158a320 | ||
|
|
d2f5deaf33 | ||
|
|
a5d236475a | ||
|
|
1d1081c910 | ||
|
|
8e9e866161 | ||
|
|
8aad441ef0 | ||
|
|
4873f35945 | ||
|
|
ac8633e0e9 | ||
|
|
028ef7d776 | ||
|
|
89109cf377 | ||
|
|
411d736d04 | ||
|
|
e879cb1c32 | ||
|
|
339a0354ce | ||
|
|
d184599a89 | ||
|
|
6f294eddc2 | ||
|
|
f6d31d7243 | ||
|
|
958cdffa7b | ||
|
|
30927f68a7 | ||
|
|
814652d243 | ||
|
|
de2b5c0925 | ||
|
|
fb0ca69fe4 | ||
|
|
b85447c602 | ||
|
|
5d04f88816 | ||
|
|
8a393183e9 | ||
|
|
455f606f31 | ||
|
|
fff1a374ed | ||
|
|
3593c7fb4d | ||
|
|
e9f4e6b37d | ||
|
|
ba9e7185a8 | ||
|
|
d339eb734f | ||
|
|
4b224dd67e | ||
|
|
f3ef943bd8 | ||
|
|
1500d59d0d | ||
|
|
242d51033f | ||
|
|
ea7ed5947a | ||
|
|
8bc14eb75a | ||
|
|
dc814ff0f1 | ||
|
|
5da281c1d8 | ||
|
|
7552d352b6 | ||
|
|
973fdae9d8 | ||
|
|
e4c28a1739 | ||
|
|
0d01fd829f | ||
|
|
3968766170 | ||
|
|
e5c57bddcc | ||
|
|
2bbe840597 | ||
|
|
ae1985bde2 | ||
|
|
074e522990 | ||
|
|
9a4887dcad | ||
|
|
bdc15a4f28 | ||
|
|
3f9bf7e5dd | ||
|
|
5600328d83 | ||
|
|
ff3b73825d | ||
|
|
cae79d30b8 | ||
|
|
da2076e52a | ||
|
|
9a1d13c32d | ||
|
|
b06cc3250a | ||
|
|
c56525f264 | ||
|
|
26710729a3 | ||
|
|
613d980ff4 | ||
|
|
c27364f2df | ||
|
|
3b71a9c986 | ||
|
|
a3afb3dae4 | ||
|
|
95a16adb6f | ||
|
|
e1d0839e19 | ||
|
|
c36909e5dc | ||
|
|
839c0263c9 | ||
|
|
1730132ef1 | ||
|
|
dfe4fd177d | ||
|
|
022e762a40 | ||
|
|
e38983a8fa | ||
|
|
297538678e | ||
|
|
d7f85ef81f | ||
|
|
05027c7935 | ||
|
|
22f65d1afe | ||
|
|
4498a6b6a0 | ||
|
|
764a3656a1 | ||
|
|
82aa092dac | ||
|
|
570156b38c | ||
|
|
3ae2c1712e | ||
|
|
c95a6c54ea | ||
|
|
9abf88c195 | ||
|
|
78c752b1c7 | ||
|
|
87f83c1cff | ||
|
|
ac9c8c769c | ||
|
|
452624e1a6 | ||
|
|
4bb0a8231e | ||
|
|
8bc719ee1d | ||
|
|
e85e11bec1 | ||
|
|
40e27b2379 | ||
|
|
b8eb9b534d | ||
|
|
9d0a377efe | ||
|
|
0c8b996fa4 | ||
|
|
b38fee2867 | ||
|
|
a59b2e3f16 | ||
|
|
0530ff3241 | ||
|
|
171aa332b7 | ||
|
|
91b0578446 | ||
|
|
ce58a63fb6 | ||
|
|
0f38335188 | ||
|
|
0bc02b439a | ||
|
|
21de42c45d | ||
|
|
352f58b94b | ||
|
|
989f662f46 | ||
|
|
a81ad12372 | ||
|
|
90e6cef49b | ||
|
|
8f204ffd26 | ||
|
|
33b59a6276 | ||
|
|
5725c4c122 | ||
|
|
38b2a3dbb4 | ||
|
|
a875b3ea11 | ||
|
|
abf0563815 | ||
|
|
613784f560 | ||
|
|
6f2e36279a | ||
|
|
05b7c3ae3d | ||
|
|
bcd6ef8fab | ||
|
|
a41f77a78a | ||
|
|
94067cf799 |
22
.gitignore
vendored
22
.gitignore
vendored
@@ -19,20 +19,25 @@
|
||||
/dde_oss/download
|
||||
/libports/contrib
|
||||
/libports/download
|
||||
/libports/include/curl/
|
||||
/libports/include/EGL/egl.h
|
||||
/libports/include/EGL/eglext.h
|
||||
/libports/include/GL
|
||||
/libports/include/KHR
|
||||
/libports/include/SDL
|
||||
/libports/include/ffat
|
||||
/libports/include/fribidi
|
||||
/libports/include/freetype
|
||||
/libports/include/ft2build.h
|
||||
/libports/include/iconv/
|
||||
/libports/include/icu/
|
||||
/libports/include/jbig2dec
|
||||
/libports/include/libc-amd64/
|
||||
/libports/include/libc-arm/
|
||||
/libports/include/libc-i386/
|
||||
/libports/include/libc/
|
||||
/libports/include/libpng
|
||||
/libports/include/libssh/
|
||||
/libports/include/lua
|
||||
/libports/include/lwip/lwip
|
||||
/libports/include/lwip/netif
|
||||
@@ -100,6 +105,13 @@
|
||||
/libports/include/stdcxx-genode/bits/nested_exception.h
|
||||
/libports/include/stdcxx-genode/exception
|
||||
/libports/include/stdcxx-genode/new
|
||||
/libports/include/stdcxx-genode/typeinfo
|
||||
/libports/include/x86emu/stdint.h
|
||||
/libports/include/x86emu/stdio.h
|
||||
/libports/include/x86emu/stdlib.h
|
||||
/libports/include/x86emu/string.h
|
||||
/libports/include/x86emu/x86emu.h
|
||||
/libports/include/x86emu/x86emu/
|
||||
/libports/src/lib/gmp/mpn/asm-defs.m4
|
||||
/libports/src/lib/gmp/mpn/arm/hamdist.c
|
||||
/libports/src/lib/gmp/mpn/arm/popcount.c
|
||||
@@ -116,8 +128,18 @@
|
||||
/libports/src/lib/ncurses/make_keys
|
||||
/libports/src/lib/ncurses/names.c
|
||||
/libports/src/lib/ncurses/unctrl.c
|
||||
/libports/src/lib/qt5/qtwebkit/Source/JavaScriptCore
|
||||
/libports/src/lib/qt5/qtwebkit/Source/WebCore/generated
|
||||
/libports/tool/mesa/glsl
|
||||
/libports/tool/mupdf
|
||||
/libports/tool/qt5/bootstrap
|
||||
/libports/tool/qt5/misc/var
|
||||
/libports/tool/qt5/moc
|
||||
/libports/tool/qt5/qmake/*.d
|
||||
/libports/tool/qt5/qmake/*.o
|
||||
/libports/tool/qt5/qmake/qmake
|
||||
/libports/tool/qt5/rcc
|
||||
/libports/tool/qt5/uic
|
||||
/ports-foc/contrib
|
||||
/ports-okl4/contrib
|
||||
/ports-okl4/download
|
||||
|
||||
6
README
6
README
@@ -127,7 +127,8 @@ The Genode source tree is composed of the following subdirectories:
|
||||
to Genode, most importantly the C library. The repository contains no
|
||||
upstream source code but means to download the code and adapt it to Genode.
|
||||
For instructions about how to use this mechanism, please consult the README
|
||||
file at the top level of the repository.
|
||||
file at the top level of the repository. Among the 3rd-party libraries
|
||||
are Qt5, libSDL, freetype, Python, ncurses, Mesa, and libav.
|
||||
|
||||
:'dde_linux':
|
||||
|
||||
@@ -155,7 +156,8 @@ The Genode source tree is composed of the following subdirectories:
|
||||
|
||||
This source-code repository contains the Genode version of Qt4 framework.
|
||||
Please find more information about using Qt4 with Genode in the repository's
|
||||
'README' file.
|
||||
'README' file. Please note that the Qt4 support is deprecated. Use Qt5
|
||||
as contained in 'libports' instead.
|
||||
|
||||
:'ports':
|
||||
|
||||
|
||||
@@ -20,12 +20,13 @@ SRC_CC += elf/elf_binary.cc
|
||||
SRC_CC += lock/lock.cc
|
||||
SRC_CC += signal/signal.cc signal/common.cc
|
||||
SRC_CC += server/server.cc server/common.cc
|
||||
SRC_CC += thread/thread.cc thread/thread_bootstrap.cc
|
||||
SRC_CC += thread/thread.cc thread/thread_bootstrap.cc thread/trace.cc
|
||||
SRC_CC += env/utcb.cc
|
||||
SRC_CC += lock/cmpxchg.cc
|
||||
|
||||
INC_DIR += $(REP_DIR)/src/base/lock
|
||||
INC_DIR += $(REP_DIR)/include/codezero/dummies
|
||||
INC_DIR += $(REP_DIR)/src/base/lock
|
||||
INC_DIR += $(BASE_DIR)/src/base/thread
|
||||
INC_DIR += $(REP_DIR)/include/codezero/dummies
|
||||
|
||||
vpath cap_copy.cc $(BASE_DIR)/src/platform
|
||||
vpath %.cc $(REP_DIR)/src/base
|
||||
|
||||
@@ -83,6 +83,24 @@ proc build_boot_image {binaries} {
|
||||
}
|
||||
|
||||
|
||||
proc run_genode_until {{wait_for_re forever} {timeout_value 0}} {
|
||||
spawn_qemu $wait_for_re $timeout_value }
|
||||
proc run_genode_until {{wait_for_re forever} {timeout_value 0} {running_spawn_id -1}} {
|
||||
#
|
||||
# If a running_spawn_id is specified, wait for the expected output
|
||||
#
|
||||
if {$running_spawn_id != -1} {
|
||||
wait_for_output $wait_for_re $timeout_value $running_spawn_id
|
||||
return
|
||||
}
|
||||
|
||||
#
|
||||
# Try to use one of the supported backends for running the scripts
|
||||
#
|
||||
if {[is_qemu_available]} {
|
||||
spawn_qemu $wait_for_re $timeout_value
|
||||
return
|
||||
}
|
||||
|
||||
global run_target
|
||||
puts stderr "Error: Can't execute automatically on target '$run_target'"
|
||||
exit -1
|
||||
}
|
||||
|
||||
@@ -16,6 +16,7 @@
|
||||
|
||||
/* core includes */
|
||||
#include <platform_thread.h>
|
||||
#include <address_space.h>
|
||||
|
||||
/* Codezero includes */
|
||||
#include <codezero/syscalls.h>
|
||||
@@ -23,7 +24,7 @@
|
||||
namespace Genode {
|
||||
|
||||
class Platform_thread;
|
||||
class Platform_pd
|
||||
class Platform_pd : public Address_space
|
||||
{
|
||||
private:
|
||||
|
||||
@@ -37,12 +38,11 @@ namespace Genode {
|
||||
|
||||
public:
|
||||
|
||||
|
||||
/**
|
||||
* Constructors
|
||||
*/
|
||||
Platform_pd(bool core);
|
||||
Platform_pd(signed pd_id = -1, bool create = true);
|
||||
Platform_pd(char const *, signed pd_id = -1, bool create = true);
|
||||
|
||||
/**
|
||||
* Destructor
|
||||
@@ -68,6 +68,13 @@ namespace Genode {
|
||||
* Assign parent interface to protection domain
|
||||
*/
|
||||
int assign_parent(Native_capability parent) { return 0; }
|
||||
|
||||
|
||||
/*****************************
|
||||
** Address-space interface **
|
||||
*****************************/
|
||||
|
||||
void flush(addr_t, size_t) { PDBG("not implemented"); }
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
@@ -19,6 +19,9 @@
|
||||
#include <base/thread_state.h>
|
||||
#include <base/native_types.h>
|
||||
|
||||
/* core includes */
|
||||
#include <address_space.h>
|
||||
|
||||
namespace Genode {
|
||||
|
||||
class Platform_pd;
|
||||
@@ -30,19 +33,25 @@ namespace Genode {
|
||||
|
||||
enum { PD_NAME_MAX_LEN = 64 };
|
||||
|
||||
unsigned _tid; /* global codezero thread ID */
|
||||
unsigned _space_id;
|
||||
addr_t _utcb;
|
||||
char _name[PD_NAME_MAX_LEN];
|
||||
Pager_object *_pager;
|
||||
unsigned _tid; /* global codezero thread ID */
|
||||
unsigned _space_id;
|
||||
Weak_ptr<Address_space> _address_space;
|
||||
addr_t _utcb;
|
||||
char _name[PD_NAME_MAX_LEN];
|
||||
Pager_object *_pager;
|
||||
|
||||
/**
|
||||
* Assign physical thread ID and UTCB address to thread
|
||||
*
|
||||
* This function is called from 'Platform_pd::bind_thread'.
|
||||
*/
|
||||
void _assign_physical_thread(unsigned tid, unsigned space_id, addr_t utcb) {
|
||||
_tid = tid; _space_id = space_id; _utcb = utcb; }
|
||||
void _assign_physical_thread(unsigned tid, unsigned space_id,
|
||||
addr_t utcb,
|
||||
Weak_ptr<Address_space> address_space)
|
||||
{
|
||||
_tid = tid; _space_id = space_id; _utcb = utcb;
|
||||
_address_space = address_space;
|
||||
}
|
||||
|
||||
public:
|
||||
|
||||
@@ -100,6 +109,11 @@ namespace Genode {
|
||||
*/
|
||||
Thread_state state();
|
||||
|
||||
/**
|
||||
* Return the address space to which the thread is bound
|
||||
*/
|
||||
Weak_ptr<Address_space> address_space();
|
||||
|
||||
|
||||
/************************
|
||||
** Accessor functions **
|
||||
@@ -120,7 +134,12 @@ namespace Genode {
|
||||
/**
|
||||
* Set the executing CPU for this thread
|
||||
*/
|
||||
void affinity(unsigned cpu);
|
||||
void affinity(Affinity::Location) { }
|
||||
|
||||
/**
|
||||
* Get the executing CPU for this thread
|
||||
*/
|
||||
Affinity::Location affinity() { return Affinity::Location(); }
|
||||
|
||||
/**
|
||||
* Get thread name
|
||||
|
||||
@@ -67,7 +67,8 @@ int Platform_pd::bind_thread(Platform_thread *thread)
|
||||
}
|
||||
|
||||
addr_t utcb_addr = UTCB_VIRT_BASE + utcb_idx*sizeof(struct utcb);
|
||||
thread->_assign_physical_thread(ids.tid, _space_id, utcb_addr);
|
||||
thread->_assign_physical_thread(ids.tid, _space_id, utcb_addr,
|
||||
this->Address_space::weak_ptr());
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -97,7 +98,8 @@ Platform_pd::Platform_pd(bool core)
|
||||
}
|
||||
|
||||
|
||||
Platform_pd::Platform_pd(signed pd_id, bool create) : _space_id(TASK_ID_INVALID)
|
||||
Platform_pd::Platform_pd(char const *, signed pd_id, bool create)
|
||||
: _space_id(TASK_ID_INVALID)
|
||||
{
|
||||
_space_id = TASK_ID_INVALID;
|
||||
|
||||
|
||||
@@ -27,12 +27,6 @@ using namespace Genode;
|
||||
using namespace Codezero;
|
||||
|
||||
|
||||
void Platform_thread::affinity(unsigned int cpu_no)
|
||||
{
|
||||
PDBG("not yet implemented");
|
||||
}
|
||||
|
||||
|
||||
int Platform_thread::start(void *ip, void *sp, unsigned int cpu_no)
|
||||
{
|
||||
Native_thread_id pager = _pager ? _pager->cap().dst() : THREAD_INVALID;
|
||||
@@ -98,6 +92,12 @@ void Platform_thread::cancel_blocking()
|
||||
}
|
||||
|
||||
|
||||
Weak_ptr<Address_space> Platform_thread::address_space()
|
||||
{
|
||||
return _address_space;
|
||||
}
|
||||
|
||||
|
||||
Platform_thread::Platform_thread(const char *name, unsigned, addr_t,
|
||||
int thread_id)
|
||||
: _tid(THREAD_INVALID)
|
||||
|
||||
@@ -23,6 +23,7 @@ SRC_CC += \
|
||||
irq_session_component.cc \
|
||||
signal_session_component.cc \
|
||||
signal_source_component.cc \
|
||||
trace_session_component.cc \
|
||||
core_rm_session.cc \
|
||||
core_mem_alloc.cc \
|
||||
dump_alloc.cc \
|
||||
@@ -32,7 +33,8 @@ LIBS += core_printf base-common
|
||||
|
||||
INC_DIR += $(REP_DIR)/src/core/include \
|
||||
$(GEN_CORE_DIR)/include \
|
||||
$(REP_DIR)/include/codezero/dummies
|
||||
$(REP_DIR)/include/codezero/dummies \
|
||||
$(BASE_DIR)/src/base/thread
|
||||
|
||||
vpath main.cc $(GEN_CORE_DIR)
|
||||
vpath ram_session_component.cc $(GEN_CORE_DIR)
|
||||
@@ -45,6 +47,7 @@ vpath io_mem_session_support.cc $(GEN_CORE_DIR)
|
||||
vpath platform_services.cc $(GEN_CORE_DIR)
|
||||
vpath signal_session_component.cc $(GEN_CORE_DIR)
|
||||
vpath signal_source_component.cc $(GEN_CORE_DIR)
|
||||
vpath trace_session_component.cc $(GEN_CORE_DIR)
|
||||
vpath dataspace_component.cc $(GEN_CORE_DIR)
|
||||
vpath core_mem_alloc.cc $(GEN_CORE_DIR)
|
||||
vpath dump_alloc.cc $(GEN_CORE_DIR)
|
||||
|
||||
@@ -10,6 +10,16 @@ DOWNLOAD_DIR = download
|
||||
CONTRIB_DIR = contrib
|
||||
FIASCO_ARCHIVE = 3rd_fiasco.tar.bz2
|
||||
FIASCO_URI = http://downloads.sourceforge.net/project/genode/3rd/$(FIASCO_ARCHIVE)
|
||||
PATCHES = $(shell find patches -name *.patch)
|
||||
|
||||
#
|
||||
# Utility to check if a tool is installed
|
||||
#
|
||||
check_tool = $(if $(shell which $(1)),,$(error Need to have '$(1)' installed.))
|
||||
|
||||
$(call check_tool,wget)
|
||||
$(call check_tool,patch)
|
||||
$(call check_tool,tar)
|
||||
|
||||
#
|
||||
# Print help information by default
|
||||
@@ -33,6 +43,8 @@ $(CONTRIB_DIR): $(DOWNLOAD_DIR)/$(FIASCO_ARCHIVE)
|
||||
$(ECHO) "unpacking source code to '$(CONTRIB_DIR)/'"
|
||||
$(VERBOSE)tar xjf $<
|
||||
$(VERBOSE)mv 3rd $@
|
||||
$(ECHO) "applying patches to '$@/'"
|
||||
$(VERBOSE)for i in $(PATCHES); do patch -d $@ -p0 < $$i; done
|
||||
$(VERBOSE)touch $@
|
||||
|
||||
prepare: $(CONTRIB_DIR)
|
||||
|
||||
@@ -44,6 +44,12 @@ command from within the 'base-fiasco' directory:
|
||||
|
||||
! make prepare
|
||||
|
||||
For the vesa driver on x86 the x86emu library is required and can be downloaded
|
||||
and prepared by invoking the following command from within the 'libports'
|
||||
directory:
|
||||
|
||||
! make prepare PKG=x86emu
|
||||
|
||||
This command will download a prepackaged version of the kernel tested
|
||||
with Genode. The build process of the kernel is integrated with Genode's
|
||||
build system. After creating a build directory using 'create_builddir'
|
||||
|
||||
@@ -20,9 +20,10 @@ SRC_CC += elf/elf_binary.cc
|
||||
SRC_CC += lock/lock.cc
|
||||
SRC_CC += signal/signal.cc signal/common.cc
|
||||
SRC_CC += server/server.cc server/common.cc
|
||||
SRC_CC += thread/thread.cc thread/thread_bootstrap_empty.cc
|
||||
SRC_CC += thread/thread.cc thread/thread_bootstrap_empty.cc thread/trace.cc
|
||||
|
||||
INC_DIR += $(REP_DIR)/src/base/lock
|
||||
INC_DIR += $(REP_DIR)/src/base/lock
|
||||
INC_DIR += $(BASE_DIR)/src/base/thread
|
||||
|
||||
vpath cap_copy.cc $(BASE_DIR)/src/platform
|
||||
vpath %.cc $(REP_DIR)/src/base
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
#
|
||||
|
||||
SPECS += x86_32 fiasco
|
||||
SPECS += pci ps2 vesa
|
||||
SPECS += pci ps2 vesa framebuffer
|
||||
|
||||
#
|
||||
# x86-specific L4v2/sys headers
|
||||
|
||||
15
base-fiasco/patches/bda.patch
Normal file
15
base-fiasco/patches/bda.patch
Normal file
@@ -0,0 +1,15 @@
|
||||
--- fiasco/snapshot/kernel/fiasco/src/kern/kernel_uart.cpp 2008-07-30 13:19:01.000000000 +0200
|
||||
+++ fiasco/snapshot/kernel/fiasco/src/kern/kernel_uart.cpp 2013-06-10 14:21:54.183996620 +0200
|
||||
@@ -72,6 +72,12 @@
|
||||
if ( (s = strstr(cmdline, " -comport "))
|
||||
||(s = strstr(cmdline, " -comport=")))
|
||||
p = strtoul(s + 10, 0, 0);
|
||||
+ else
|
||||
+ {
|
||||
+ unsigned short bda_comports = (*((unsigned short *)0x410) >> 9) & 0x7;
|
||||
+ if (bda_comports)
|
||||
+ p = *((unsigned short *)0x400);
|
||||
+ }
|
||||
|
||||
if ((s = strstr(cmdline, " -comirq=")))
|
||||
i = strtoul(s + 9, 0, 0);
|
||||
@@ -8,6 +8,15 @@
|
||||
#
|
||||
|
||||
|
||||
##
|
||||
# Install files needed to boot via PXE
|
||||
#
|
||||
proc install_pxe_bootloader_to_run_dir { } {
|
||||
exec cp [genode_dir]/tool/boot/pulsar [run_dir]/boot/pulsar
|
||||
exec cp [genode_dir]/tool/boot/bender [run_dir]/boot/bender
|
||||
}
|
||||
|
||||
|
||||
##
|
||||
# Read the location of the Fiasco user directory from 'etc/fiasco.conf'
|
||||
#
|
||||
@@ -76,8 +85,12 @@ proc bin_dir { } {
|
||||
exit 1
|
||||
}
|
||||
|
||||
set fiasco_serial_esc_arg "-serial_esc "
|
||||
|
||||
proc build_boot_image {binaries} {
|
||||
|
||||
global fiasco_serial_esc_arg
|
||||
|
||||
#
|
||||
# Collect contents of the ISO image
|
||||
#
|
||||
@@ -108,7 +121,7 @@ proc build_boot_image {binaries} {
|
||||
puts $fh "default 0"
|
||||
puts $fh "\ntitle Genode on L4/Fiasco"
|
||||
puts $fh " kernel /fiasco/bootstrap -serial -modaddr=0x02000000"
|
||||
puts $fh " module /fiasco/fiasco -serial -serial_esc -jdb_cmd=JH"
|
||||
puts $fh " module /fiasco/fiasco -serial -jdb_cmd=JH $fiasco_serial_esc_arg"
|
||||
puts $fh " module /fiasco/sigma0"
|
||||
puts $fh " module /genode/core"
|
||||
puts $fh " module /genode/config"
|
||||
@@ -118,10 +131,69 @@ proc build_boot_image {binaries} {
|
||||
puts $fh " vbeset 0x117 506070"
|
||||
close $fh
|
||||
|
||||
#
|
||||
# Install PXE bootloader pulsar
|
||||
#
|
||||
install_pxe_bootloader_to_run_dir
|
||||
|
||||
create_iso_image_from_run_dir
|
||||
|
||||
#
|
||||
# Generate pulsar config file
|
||||
#
|
||||
set fh [open "[run_dir]/config-52-54-00-12-34-56" "WRONLY CREAT TRUNC"]
|
||||
puts $fh " exec /boot/bender"
|
||||
puts $fh " load /fiasco/bootstrap -serial -modaddr=0x02000000"
|
||||
puts $fh " load /fiasco/fiasco -serial -serial_esc -jdb_cmd=JH"
|
||||
puts $fh " load /fiasco/sigma0"
|
||||
puts $fh " load /genode/core"
|
||||
puts $fh " load /genode/config"
|
||||
foreach binary $binaries {
|
||||
if {$binary != "core"} {
|
||||
puts $fh " load /genode/$binary" } }
|
||||
close $fh
|
||||
|
||||
#
|
||||
# Generate pulsar config file pointing to the config file above.
|
||||
#
|
||||
if {[info exists ::env(PXE_TFTP_DIR_BASE)] && [info exists ::env(PXE_TFTP_DIR_OFFSET)]} {
|
||||
exec ln -nfs "[pwd]" "$::env(PXE_TFTP_DIR_BASE)$::env(PXE_TFTP_DIR_OFFSET)"
|
||||
|
||||
set tftp_base ""
|
||||
if {[get_cmd_switch --tftp-absolute]} {
|
||||
set tftp_base $::env(PXE_TFTP_DIR_BASE)
|
||||
}
|
||||
|
||||
set fh [open "$::env(PXE_TFTP_DIR_BASE)$::env(PXE_TFTP_DIR_OFFSET)/config-00-00-00-00-00-00" "WRONLY CREAT TRUNC"]
|
||||
puts $fh " root $tftp_base$::env(PXE_TFTP_DIR_OFFSET)/[run_dir]"
|
||||
puts $fh " config config-52-54-00-12-34-56"
|
||||
close $fh
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
proc run_genode_until {{wait_for_re forever} {timeout_value 0}} {
|
||||
spawn_qemu $wait_for_re $timeout_value }
|
||||
proc run_genode_until {{wait_for_re forever} {timeout_value 0} {running_spawn_id -1}} {
|
||||
#
|
||||
# If a running_spawn_id is specified, wait for the expected output
|
||||
#
|
||||
if {$running_spawn_id != -1} {
|
||||
wait_for_output $wait_for_re $timeout_value $running_spawn_id
|
||||
return
|
||||
}
|
||||
|
||||
#
|
||||
# Try to use one of the supported backends for running the scripts
|
||||
#
|
||||
if {[is_amt_available]} {
|
||||
spawn_amt $wait_for_re $timeout_value
|
||||
return
|
||||
}
|
||||
if {[is_qemu_available]} {
|
||||
spawn_qemu $wait_for_re $timeout_value
|
||||
return
|
||||
}
|
||||
|
||||
global run_target
|
||||
puts stderr "Error: Can't execute automatically on target '$run_target'"
|
||||
exit -1
|
||||
}
|
||||
|
||||
@@ -35,6 +35,7 @@ namespace Genode {
|
||||
*/
|
||||
typedef Synchronized_range_allocator<Allocator_avl> Phys_allocator;
|
||||
|
||||
char _core_label[1]; /* to satisfy _core_pd */
|
||||
Platform_pd *_core_pd; /* core protection domain object */
|
||||
Phys_allocator _ram_alloc; /* RAM allocator */
|
||||
Phys_allocator _io_mem_alloc; /* MMIO allocator */
|
||||
|
||||
@@ -18,6 +18,7 @@
|
||||
#define _CORE__INCLUDE__PLATFORM_PD_H_
|
||||
|
||||
#include <platform_thread.h>
|
||||
#include <address_space.h>
|
||||
|
||||
namespace Fiasco {
|
||||
#include <l4/sys/types.h>
|
||||
@@ -26,7 +27,7 @@ namespace Fiasco {
|
||||
namespace Genode {
|
||||
|
||||
class Platform_thread;
|
||||
class Platform_pd
|
||||
class Platform_pd : public Address_space
|
||||
{
|
||||
private:
|
||||
|
||||
@@ -141,7 +142,8 @@ namespace Genode {
|
||||
/**
|
||||
* Constructor
|
||||
*/
|
||||
Platform_pd(signed pd_id = PD_INVALID, bool create = true);
|
||||
Platform_pd(char const *, signed pd_id = PD_INVALID,
|
||||
bool create = true);
|
||||
|
||||
/**
|
||||
* Destructor
|
||||
@@ -176,6 +178,17 @@ namespace Genode {
|
||||
int assign_parent(Native_capability parent) { return 0; }
|
||||
|
||||
int pd_id() const { return _pd_id; }
|
||||
|
||||
|
||||
/*****************************
|
||||
** Address-space interface **
|
||||
*****************************/
|
||||
|
||||
/*
|
||||
* On L4/Fiasco, we don't use directed unmap but rely on the
|
||||
* in-kernel mapping database. See 'rm_session_support.cc'.
|
||||
*/
|
||||
void flush(addr_t, size_t) { PDBG("not implemented"); }
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
@@ -21,6 +21,7 @@
|
||||
|
||||
/* core includes */
|
||||
#include <platform_pd.h>
|
||||
#include <address_space.h>
|
||||
|
||||
/* Fiasco includes */
|
||||
namespace Fiasco {
|
||||
@@ -120,7 +121,17 @@ namespace Genode {
|
||||
*
|
||||
* SMP is not supported on L4/Fiasco.
|
||||
*/
|
||||
void affinity(unsigned) { }
|
||||
void affinity(Affinity::Location) { }
|
||||
|
||||
/**
|
||||
* Request the affinity of this thread
|
||||
*/
|
||||
Affinity::Location affinity() { return Affinity::Location(); }
|
||||
|
||||
/**
|
||||
* Return the address space to which the thread is bound
|
||||
*/
|
||||
Weak_ptr<Address_space> address_space();
|
||||
|
||||
|
||||
/************************
|
||||
|
||||
@@ -130,7 +130,7 @@ static void _core_pager_loop()
|
||||
}
|
||||
|
||||
|
||||
Platform::Sigma0::Sigma0() : Pager_object(0)
|
||||
Platform::Sigma0::Sigma0() : Pager_object(0, Affinity::Location())
|
||||
{
|
||||
cap(reinterpret_cap_cast<Cpu_thread>(Native_capability(Fiasco::sigma0_threadid, 0)));
|
||||
}
|
||||
@@ -145,7 +145,7 @@ Platform::Sigma0 *Platform::sigma0()
|
||||
|
||||
Platform::Core_pager::Core_pager(Platform_pd *core_pd)
|
||||
:
|
||||
Platform_thread("core.pager"), Pager_object(0)
|
||||
Platform_thread("core.pager"), Pager_object(0, Affinity::Location())
|
||||
{
|
||||
Platform_thread::pager(sigma0());
|
||||
|
||||
@@ -489,7 +489,8 @@ Platform::Platform() :
|
||||
Platform_pd::init();
|
||||
|
||||
/* setup pd object for core pd */
|
||||
_core_pd = new(core_mem_alloc()) Platform_pd(myself.id.task, false);
|
||||
_core_label[0] = 0;
|
||||
_core_pd = new(core_mem_alloc()) Platform_pd(_core_label, myself.id.task, false);
|
||||
|
||||
/*
|
||||
* We setup the thread object for thread0 in core pd using a special
|
||||
|
||||
@@ -236,7 +236,7 @@ void Platform_pd::unbind_thread(Platform_thread *thread)
|
||||
}
|
||||
|
||||
|
||||
Platform_pd::Platform_pd(signed pd_id, bool create)
|
||||
Platform_pd::Platform_pd(char const *, signed pd_id, bool create)
|
||||
{
|
||||
/* check correct init */
|
||||
if (!_init)
|
||||
|
||||
@@ -145,6 +145,12 @@ void Platform_thread::cancel_blocking()
|
||||
}
|
||||
|
||||
|
||||
Weak_ptr<Address_space> Platform_thread::address_space()
|
||||
{
|
||||
return _platform_pd->Address_space::weak_ptr();
|
||||
}
|
||||
|
||||
|
||||
Platform_thread::Platform_thread(const char *name, unsigned, addr_t, int thread_id)
|
||||
: _thread_id(thread_id), _l4_thread_id(L4_INVALID_ID), _pager(0)
|
||||
{
|
||||
|
||||
@@ -24,13 +24,15 @@ SRC_CC += main.cc \
|
||||
irq_session_component.cc \
|
||||
signal_session_component.cc \
|
||||
signal_source_component.cc \
|
||||
trace_session_component.cc \
|
||||
dump_alloc.cc \
|
||||
context_area.cc \
|
||||
core_printf.cc
|
||||
|
||||
INC_DIR += $(REP_DIR)/src/core/include \
|
||||
$(GEN_CORE_DIR)/include \
|
||||
$(REP_DIR)/src/base/console
|
||||
$(REP_DIR)/src/base/console \
|
||||
$(BASE_DIR)/src/base/thread
|
||||
|
||||
LIBS += base-common
|
||||
|
||||
@@ -45,6 +47,7 @@ vpath io_mem_session_component.cc $(GEN_CORE_DIR)
|
||||
vpath io_mem_session_support.cc $(GEN_CORE_DIR)
|
||||
vpath signal_session_component.cc $(GEN_CORE_DIR)
|
||||
vpath signal_source_component.cc $(GEN_CORE_DIR)
|
||||
vpath trace_session_component.cc $(GEN_CORE_DIR)
|
||||
vpath dataspace_component.cc $(GEN_CORE_DIR)
|
||||
vpath dump_alloc.cc $(GEN_CORE_DIR)
|
||||
vpath context_area.cc $(GEN_CORE_DIR)
|
||||
|
||||
@@ -9,7 +9,7 @@ VERBOSE ?= @
|
||||
ECHO = @echo
|
||||
SVN_URI = http://svn.tudos.org/repos/oc/tudos/trunk
|
||||
GIT_URI = http://github.com/ssumpf/foc.git
|
||||
GIT_BRANCH = r47
|
||||
GIT_BRANCH = r56
|
||||
CONTRIB_DIR = contrib
|
||||
GNU_FIND ?= find
|
||||
|
||||
@@ -63,6 +63,7 @@ checkout_base:
|
||||
ifeq ($(SVN_REV),)
|
||||
$(error Syntax 'make checkout SVN_REV=<revision>')
|
||||
endif
|
||||
$(VERBOSE)svn export -r $(SVN_REV) $(SVN_URI)/l4/COPYING-GPL-2 $(SVN_REV)
|
||||
$(VERBOSE)svn co -r $(SVN_REV) --depth immediates $(SVN_URI) $(SVN_REV)
|
||||
$(VERBOSE)svn co -r $(SVN_REV) --depth files $(SVN_URI)/l4 $(SVN_REV)/l4
|
||||
$(VERBOSE)svn co -r $(SVN_REV) --depth files $(SVN_URI)/l4/pkg $(SVN_REV)/l4/pkg
|
||||
|
||||
@@ -12,22 +12,35 @@ CONFIG_ARM=y
|
||||
# CONFIG_PF_IMX is not set
|
||||
# CONFIG_PF_REALVIEW is not set
|
||||
# CONFIG_PF_S3C2410 is not set
|
||||
# CONFIG_PF_TEGRA2 is not set
|
||||
# CONFIG_PF_TEGRA is not set
|
||||
# CONFIG_PF_OMAP is not set
|
||||
# CONFIG_PF_SA1100 is not set
|
||||
# CONFIG_PF_XSCALE is not set
|
||||
CONFIG_PF_EXYNOS=y
|
||||
# CONFIG_PF_KIRKWOOD is not set
|
||||
# CONFIG_PF_INTEGRATOR is not set
|
||||
# CONFIG_PF_BCM2835 is not set
|
||||
CONFIG_BSP_NAME="exynos"
|
||||
CONFIG_PF_EXYNOS5=y
|
||||
CONFIG_BSP_NAME="exynos5"
|
||||
CONFIG_PF_EXYNOS5_ARNDALE=y
|
||||
CONFIG_PF_EXYNOS_PKG_IDS=""
|
||||
# CONFIG_PF_EXYNOS4_4210 is not set
|
||||
# CONFIG_PF_EXYNOS4_4412 is not set
|
||||
CONFIG_PF_EXYNOS5_5250=y
|
||||
CONFIG_PF_EXYNOS_UART_NR=2
|
||||
CONFIG_PF_EXYNOS_TIMER_MCT=y
|
||||
# CONFIG_PF_EXYNOS_TIMER_PWM is not set
|
||||
CONFIG_ABI_VF=y
|
||||
CONFIG_PF_ARM_MP_CAPABLE=y
|
||||
CONFIG_CAN_ARM_CPU_CORTEX_A15=y
|
||||
CONFIG_ARM_CORTEX_A15=y
|
||||
# CONFIG_ARM_ALIGNMENT_CHECK is not set
|
||||
CONFIG_ARM_EM_STD=y
|
||||
# CONFIG_ARM_EM_NS is not set
|
||||
# CONFIG_ARM_EM_TZ is not set
|
||||
# CONFIG_ARM_ENABLE_SWP is not set
|
||||
# CONFIG_ARM_LPAE is not set
|
||||
CONFIG_FPU=y
|
||||
# CONFIG_ARM_CPU_ERRATA is not set
|
||||
CONFIG_ARM_CPU_ERRATA=y
|
||||
|
||||
#
|
||||
# Kernel options
|
||||
@@ -37,9 +50,7 @@ CONFIG_MP_MAX_CPUS=4
|
||||
CONFIG_CONTEXT_4K=y
|
||||
# CONFIG_FINE_GRAINED_CPUTIME is not set
|
||||
CONFIG_SCHED_FIXED_PRIO=y
|
||||
# CONFIG_SCHED_WFQ is not set
|
||||
# CONFIG_SCHED_FP_WFQ is not set
|
||||
# CONFIG_DISABLE_VIRT_OBJ_SPACE is not set
|
||||
CONFIG_VIRT_OBJ_SPACE=y
|
||||
|
||||
#
|
||||
# Debugging
|
||||
@@ -51,9 +62,9 @@ CONFIG_INLINE=y
|
||||
# CONFIG_LIST_ALLOC_SANITY is not set
|
||||
CONFIG_SERIAL=y
|
||||
CONFIG_JDB=y
|
||||
CONFIG_JDB_LOGGING=y
|
||||
# CONFIG_JDB_DISASM is not set
|
||||
# CONFIG_JDB_GZIP is not set
|
||||
# CONFIG_JDB_LOGGING is not set
|
||||
CONFIG_JDB_DISASM=y
|
||||
CONFIG_JDB_GZIP=y
|
||||
# CONFIG_VMEM_ALLOC_TEST is not set
|
||||
# CONFIG_DEBUG_KERNEL_PAGE_FAULTS is not set
|
||||
# CONFIG_WARN_NONE is not set
|
||||
@@ -69,7 +80,7 @@ CONFIG_HOST_CC="gcc"
|
||||
CONFIG_HOST_CXX="g++"
|
||||
# CONFIG_MAINTAINER_MODE is not set
|
||||
CONFIG_LABEL=""
|
||||
CONFIG_EXPERIMENTAL=y
|
||||
# CONFIG_EXPERIMENTAL is not set
|
||||
CONFIG_PERF_CNT=y
|
||||
CONFIG_BIT32=y
|
||||
CONFIG_ARM_V7=y
|
||||
|
||||
@@ -23,24 +23,29 @@ CONFIG_CPU_ARM_ARMV7A=y
|
||||
# CONFIG_CPU_ARM_ARMV7R is not set
|
||||
CONFIG_CPU_ARMV6KPLUS=y
|
||||
CONFIG_CPU_ARMV6PLUS=y
|
||||
CONFIG_PLATFORM_TYPE_arndale=y
|
||||
# CONFIG_PLATFORM_TYPE_imx53 is not set
|
||||
# CONFIG_PLATFORM_TYPE_imx35 is not set
|
||||
# CONFIG_PLATFORM_TYPE_rv_pbx is not set
|
||||
CONFIG_PLATFORM_TYPE_exynos5=y
|
||||
# CONFIG_PLATFORM_TYPE_rv is not set
|
||||
# CONFIG_PLATFORM_TYPE_kirkwood is not set
|
||||
# CONFIG_PLATFORM_TYPE_pandaboard is not set
|
||||
# CONFIG_PLATFORM_TYPE_tegra3 is not set
|
||||
# CONFIG_PLATFORM_TYPE_tegra2 is not set
|
||||
# CONFIG_PLATFORM_TYPE_imx6 is not set
|
||||
# CONFIG_PLATFORM_TYPE_exynos4 is not set
|
||||
# CONFIG_PLATFORM_TYPE_omap3_am33xx is not set
|
||||
# CONFIG_PLATFORM_TYPE_rpi_b is not set
|
||||
# CONFIG_PLATFORM_TYPE_rv_vexpress_a15 is not set
|
||||
# CONFIG_PLATFORM_TYPE_imx51 is not set
|
||||
# CONFIG_PLATFORM_TYPE_omap3evm is not set
|
||||
# CONFIG_PLATFORM_TYPE_beagleboard is not set
|
||||
# CONFIG_PLATFORM_TYPE_imx21 is not set
|
||||
# CONFIG_PLATFORM_TYPE_imx35 is not set
|
||||
# CONFIG_PLATFORM_TYPE_imx51 is not set
|
||||
# CONFIG_PLATFORM_TYPE_imx53 is not set
|
||||
# CONFIG_PLATFORM_TYPE_imx6 is not set
|
||||
# CONFIG_PLATFORM_TYPE_integrator is not set
|
||||
# CONFIG_PLATFORM_TYPE_kirkwood is not set
|
||||
# CONFIG_PLATFORM_TYPE_omap3_am33xx is not set
|
||||
# CONFIG_PLATFORM_TYPE_omap3evm is not set
|
||||
# CONFIG_PLATFORM_TYPE_pandaboard is not set
|
||||
# CONFIG_PLATFORM_TYPE_rv is not set
|
||||
# CONFIG_PLATFORM_TYPE_rv_pbx is not set
|
||||
# CONFIG_PLATFORM_TYPE_rv_vexpress is not set
|
||||
# CONFIG_PLATFORM_TYPE_tegra2 is not set
|
||||
# CONFIG_PLATFORM_TYPE_rpi_a is not set
|
||||
# CONFIG_PLATFORM_TYPE_integrator is not set
|
||||
# CONFIG_PLATFORM_TYPE_custom is not set
|
||||
CONFIG_PLATFORM_TYPE="arndale"
|
||||
CONFIG_PLATFORM_TYPE="exynos5"
|
||||
# CONFIG_USE_DROPS_STDDIR is not set
|
||||
# CONFIG_USE_DICE is not set
|
||||
CONFIG_DROPS_STDDIR="/path/to/l4re"
|
||||
|
||||
@@ -12,13 +12,14 @@ CONFIG_ARM=y
|
||||
CONFIG_PF_IMX=y
|
||||
# CONFIG_PF_REALVIEW is not set
|
||||
# CONFIG_PF_S3C2410 is not set
|
||||
# CONFIG_PF_TEGRA2 is not set
|
||||
# CONFIG_PF_TEGRA is not set
|
||||
# CONFIG_PF_OMAP is not set
|
||||
# CONFIG_PF_SA1100 is not set
|
||||
# CONFIG_PF_XSCALE is not set
|
||||
# CONFIG_PF_EXYNOS is not set
|
||||
# CONFIG_PF_KIRKWOOD is not set
|
||||
# CONFIG_PF_INTEGRATOR is not set
|
||||
# CONFIG_PF_EXYNOS5 is not set
|
||||
# CONFIG_PF_BCM2835 is not set
|
||||
CONFIG_BSP_NAME="imx"
|
||||
# CONFIG_PF_IMX_21 is not set
|
||||
# CONFIG_PF_IMX_35 is not set
|
||||
@@ -30,6 +31,9 @@ CONFIG_ABI_VF=y
|
||||
CONFIG_CAN_ARM_CPU_CORTEX_A8=y
|
||||
CONFIG_ARM_CORTEX_A8=y
|
||||
# CONFIG_ARM_ALIGNMENT_CHECK is not set
|
||||
CONFIG_ARM_EM_STD=y
|
||||
# CONFIG_ARM_EM_NS is not set
|
||||
# CONFIG_ARM_EM_TZ is not set
|
||||
# CONFIG_FPU is not set
|
||||
# CONFIG_ARM_CPU_ERRATA is not set
|
||||
|
||||
@@ -39,6 +43,7 @@ CONFIG_ARM_CORTEX_A8=y
|
||||
CONFIG_CONTEXT_4K=y
|
||||
# CONFIG_FINE_GRAINED_CPUTIME is not set
|
||||
CONFIG_SCHED_FIXED_PRIO=y
|
||||
CONFIG_VIRT_OBJ_SPACE=y
|
||||
|
||||
#
|
||||
# Debugging
|
||||
|
||||
@@ -23,22 +23,27 @@ CONFIG_CPU_ARM_ARMV7A=y
|
||||
# CONFIG_CPU_ARM_ARMV7R is not set
|
||||
CONFIG_CPU_ARMV6KPLUS=y
|
||||
CONFIG_CPU_ARMV6PLUS=y
|
||||
# CONFIG_PLATFORM_TYPE_arndale is not set
|
||||
CONFIG_PLATFORM_TYPE_imx53=y
|
||||
# CONFIG_PLATFORM_TYPE_imx35 is not set
|
||||
# CONFIG_PLATFORM_TYPE_rv_pbx is not set
|
||||
# CONFIG_PLATFORM_TYPE_exynos5 is not set
|
||||
# CONFIG_PLATFORM_TYPE_rv is not set
|
||||
# CONFIG_PLATFORM_TYPE_kirkwood is not set
|
||||
# CONFIG_PLATFORM_TYPE_pandaboard is not set
|
||||
# CONFIG_PLATFORM_TYPE_tegra3 is not set
|
||||
# CONFIG_PLATFORM_TYPE_tegra2 is not set
|
||||
# CONFIG_PLATFORM_TYPE_imx6 is not set
|
||||
# CONFIG_PLATFORM_TYPE_exynos4 is not set
|
||||
# CONFIG_PLATFORM_TYPE_omap3_am33xx is not set
|
||||
# CONFIG_PLATFORM_TYPE_rpi_b is not set
|
||||
# CONFIG_PLATFORM_TYPE_rv_vexpress_a15 is not set
|
||||
# CONFIG_PLATFORM_TYPE_imx51 is not set
|
||||
# CONFIG_PLATFORM_TYPE_omap3evm is not set
|
||||
# CONFIG_PLATFORM_TYPE_beagleboard is not set
|
||||
# CONFIG_PLATFORM_TYPE_imx21 is not set
|
||||
# CONFIG_PLATFORM_TYPE_imx35 is not set
|
||||
# CONFIG_PLATFORM_TYPE_imx51 is not set
|
||||
CONFIG_PLATFORM_TYPE_imx53=y
|
||||
# CONFIG_PLATFORM_TYPE_imx6 is not set
|
||||
# CONFIG_PLATFORM_TYPE_integrator is not set
|
||||
# CONFIG_PLATFORM_TYPE_kirkwood is not set
|
||||
# CONFIG_PLATFORM_TYPE_omap3_am33xx is not set
|
||||
# CONFIG_PLATFORM_TYPE_omap3evm is not set
|
||||
# CONFIG_PLATFORM_TYPE_pandaboard is not set
|
||||
# CONFIG_PLATFORM_TYPE_rv is not set
|
||||
# CONFIG_PLATFORM_TYPE_rv_pbx is not set
|
||||
# CONFIG_PLATFORM_TYPE_rv_vexpress is not set
|
||||
# CONFIG_PLATFORM_TYPE_tegra2 is not set
|
||||
# CONFIG_PLATFORM_TYPE_rpi_a is not set
|
||||
# CONFIG_PLATFORM_TYPE_integrator is not set
|
||||
# CONFIG_PLATFORM_TYPE_custom is not set
|
||||
CONFIG_PLATFORM_TYPE="imx53"
|
||||
# CONFIG_USE_DROPS_STDDIR is not set
|
||||
|
||||
@@ -12,14 +12,15 @@ CONFIG_ARM=y
|
||||
# CONFIG_PF_IMX is not set
|
||||
# CONFIG_PF_REALVIEW is not set
|
||||
# CONFIG_PF_S3C2410 is not set
|
||||
# CONFIG_PF_TEGRA2 is not set
|
||||
# CONFIG_PF_TEGRA is not set
|
||||
CONFIG_PF_OMAP=y
|
||||
# CONFIG_PF_SA1100 is not set
|
||||
# CONFIG_PF_XSCALE is not set
|
||||
# CONFIG_PF_EXYNOS is not set
|
||||
# CONFIG_PF_KIRKWOOD is not set
|
||||
# CONFIG_PF_INTEGRATOR is not set
|
||||
# CONFIG_PF_EXYNOS5 is not set
|
||||
CONFIG_BSP_NAME="omap3"
|
||||
# CONFIG_PF_BCM2835 is not set
|
||||
CONFIG_BSP_NAME="omap"
|
||||
# CONFIG_PF_OMAP3_OMAP35XEVM is not set
|
||||
# CONFIG_PF_OMAP3_BEAGLEBOARD is not set
|
||||
# CONFIG_PF_OMAP3_AM33XX is not set
|
||||
@@ -30,8 +31,10 @@ CONFIG_CAN_ARM_CPU_CORTEX_A9=y
|
||||
CONFIG_CAN_ARM_CACHE_L2CXX0=y
|
||||
CONFIG_ARM_CORTEX_A9=y
|
||||
# CONFIG_ARM_ALIGNMENT_CHECK is not set
|
||||
# CONFIG_ARM_TZ is not set
|
||||
CONFIG_ARM_CA9_ENABLE_SWP=y
|
||||
CONFIG_ARM_EM_STD=y
|
||||
# CONFIG_ARM_EM_NS is not set
|
||||
# CONFIG_ARM_EM_TZ is not set
|
||||
# CONFIG_ARM_ENABLE_SWP is not set
|
||||
CONFIG_ARM_CACHE_L2CXX0=y
|
||||
CONFIG_FPU=y
|
||||
# CONFIG_ARM_CPU_ERRATA is not set
|
||||
@@ -47,6 +50,7 @@ CONFIG_SCHED_FIXED_PRIO=y
|
||||
# CONFIG_SCHED_WFQ is not set
|
||||
# CONFIG_SCHED_FP_WFQ is not set
|
||||
# CONFIG_DISABLE_VIRT_OBJ_SPACE is not set
|
||||
CONFIG_VIRT_OBJ_SPACE=y
|
||||
|
||||
#
|
||||
# Debugging
|
||||
|
||||
@@ -23,22 +23,27 @@ CONFIG_CPU_ARM_ARMV7A=y
|
||||
# CONFIG_CPU_ARM_ARMV7R is not set
|
||||
CONFIG_CPU_ARMV6KPLUS=y
|
||||
CONFIG_CPU_ARMV6PLUS=y
|
||||
# CONFIG_PLATFORM_TYPE_arndale is not set
|
||||
# CONFIG_PLATFORM_TYPE_imx53 is not set
|
||||
# CONFIG_PLATFORM_TYPE_imx35 is not set
|
||||
# CONFIG_PLATFORM_TYPE_rv_pbx is not set
|
||||
# CONFIG_PLATFORM_TYPE_exynos5 is not set
|
||||
# CONFIG_PLATFORM_TYPE_rv is not set
|
||||
# CONFIG_PLATFORM_TYPE_kirkwood is not set
|
||||
CONFIG_PLATFORM_TYPE_pandaboard=y
|
||||
# CONFIG_PLATFORM_TYPE_tegra3 is not set
|
||||
# CONFIG_PLATFORM_TYPE_tegra2 is not set
|
||||
# CONFIG_PLATFORM_TYPE_imx6 is not set
|
||||
# CONFIG_PLATFORM_TYPE_exynos4 is not set
|
||||
# CONFIG_PLATFORM_TYPE_omap3_am33xx is not set
|
||||
# CONFIG_PLATFORM_TYPE_rpi_b is not set
|
||||
# CONFIG_PLATFORM_TYPE_rv_vexpress_a15 is not set
|
||||
# CONFIG_PLATFORM_TYPE_imx51 is not set
|
||||
# CONFIG_PLATFORM_TYPE_omap3evm is not set
|
||||
# CONFIG_PLATFORM_TYPE_beagleboard is not set
|
||||
# CONFIG_PLATFORM_TYPE_imx21 is not set
|
||||
# CONFIG_PLATFORM_TYPE_imx35 is not set
|
||||
# CONFIG_PLATFORM_TYPE_imx51 is not set
|
||||
# CONFIG_PLATFORM_TYPE_imx53 is not set
|
||||
# CONFIG_PLATFORM_TYPE_imx6 is not set
|
||||
# CONFIG_PLATFORM_TYPE_integrator is not set
|
||||
# CONFIG_PLATFORM_TYPE_kirkwood is not set
|
||||
# CONFIG_PLATFORM_TYPE_omap3_am33xx is not set
|
||||
# CONFIG_PLATFORM_TYPE_omap3evm is not set
|
||||
CONFIG_PLATFORM_TYPE_pandaboard=y
|
||||
# CONFIG_PLATFORM_TYPE_rv is not set
|
||||
# CONFIG_PLATFORM_TYPE_rv_pbx is not set
|
||||
# CONFIG_PLATFORM_TYPE_rv_vexpress is not set
|
||||
# CONFIG_PLATFORM_TYPE_tegra2 is not set
|
||||
# CONFIG_PLATFORM_TYPE_rpi_a is not set
|
||||
# CONFIG_PLATFORM_TYPE_integrator is not set
|
||||
# CONFIG_PLATFORM_TYPE_custom is not set
|
||||
CONFIG_PLATFORM_TYPE="pandaboard"
|
||||
# CONFIG_USE_DROPS_STDDIR is not set
|
||||
|
||||
@@ -12,13 +12,14 @@ CONFIG_ARM=y
|
||||
# CONFIG_PF_IMX is not set
|
||||
CONFIG_PF_REALVIEW=y
|
||||
# CONFIG_PF_S3C2410 is not set
|
||||
# CONFIG_PF_TEGRA2 is not set
|
||||
# CONFIG_PF_TEGRA is not set
|
||||
# CONFIG_PF_OMAP is not set
|
||||
# CONFIG_PF_SA1100 is not set
|
||||
# CONFIG_PF_XSCALE is not set
|
||||
# CONFIG_PF_EXYNOS is not set
|
||||
# CONFIG_PF_KIRKWOOD is not set
|
||||
# CONFIG_PF_INTEGRATOR is not set
|
||||
# CONFIG_PF_EXYNOS5 is not set
|
||||
# CONFIG_PF_BCM2835 is not set
|
||||
CONFIG_BSP_NAME="realview"
|
||||
# CONFIG_PF_REALVIEW_EB is not set
|
||||
# CONFIG_PF_REALVIEW_PB11MP is not set
|
||||
@@ -34,7 +35,10 @@ CONFIG_CAN_ARM_CPU_CORTEX_A9=y
|
||||
CONFIG_CAN_ARM_CACHE_L2CXX0=y
|
||||
CONFIG_ARM_CORTEX_A9=y
|
||||
# CONFIG_ARM_ALIGNMENT_CHECK is not set
|
||||
# CONFIG_ARM_CA9_ENABLE_SWP is not set
|
||||
CONFIG_ARM_EM_STD=y
|
||||
# CONFIG_ARM_EM_NS is not set
|
||||
# CONFIG_ARM_EM_TZ is not set
|
||||
# CONFIG_ARM_ENABLE_SWP is not set
|
||||
# CONFIG_ARM_CACHE_L2CXX0 is not set
|
||||
CONFIG_FPU=y
|
||||
CONFIG_ARM_CPU_ERRATA=y
|
||||
@@ -46,6 +50,7 @@ CONFIG_ARM_CPU_ERRATA=y
|
||||
CONFIG_CONTEXT_4K=y
|
||||
# CONFIG_FINE_GRAINED_CPUTIME is not set
|
||||
CONFIG_SCHED_FIXED_PRIO=y
|
||||
CONFIG_VIRT_OBJ_SPACE=y
|
||||
|
||||
#
|
||||
# Debugging
|
||||
|
||||
@@ -23,22 +23,27 @@ CONFIG_CPU_ARM_ARMV7A=y
|
||||
# CONFIG_CPU_ARM_ARMV7R is not set
|
||||
CONFIG_CPU_ARMV6KPLUS=y
|
||||
CONFIG_CPU_ARMV6PLUS=y
|
||||
# CONFIG_PLATFORM_TYPE_arndale is not set
|
||||
# CONFIG_PLATFORM_TYPE_imx53 is not set
|
||||
# CONFIG_PLATFORM_TYPE_imx35 is not set
|
||||
CONFIG_PLATFORM_TYPE_rv_pbx=y
|
||||
# CONFIG_PLATFORM_TYPE_exynos5 is not set
|
||||
# CONFIG_PLATFORM_TYPE_rv is not set
|
||||
# CONFIG_PLATFORM_TYPE_kirkwood is not set
|
||||
# CONFIG_PLATFORM_TYPE_pandaboard is not set
|
||||
# CONFIG_PLATFORM_TYPE_tegra3 is not set
|
||||
# CONFIG_PLATFORM_TYPE_tegra2 is not set
|
||||
# CONFIG_PLATFORM_TYPE_imx6 is not set
|
||||
# CONFIG_PLATFORM_TYPE_exynos4 is not set
|
||||
# CONFIG_PLATFORM_TYPE_omap3_am33xx is not set
|
||||
# CONFIG_PLATFORM_TYPE_rpi_b is not set
|
||||
# CONFIG_PLATFORM_TYPE_rv_vexpress_a15 is not set
|
||||
# CONFIG_PLATFORM_TYPE_imx51 is not set
|
||||
# CONFIG_PLATFORM_TYPE_omap3evm is not set
|
||||
# CONFIG_PLATFORM_TYPE_beagleboard is not set
|
||||
# CONFIG_PLATFORM_TYPE_imx21 is not set
|
||||
# CONFIG_PLATFORM_TYPE_imx35 is not set
|
||||
# CONFIG_PLATFORM_TYPE_imx51 is not set
|
||||
# CONFIG_PLATFORM_TYPE_imx53 is not set
|
||||
# CONFIG_PLATFORM_TYPE_imx6 is not set
|
||||
# CONFIG_PLATFORM_TYPE_integrator is not set
|
||||
# CONFIG_PLATFORM_TYPE_kirkwood is not set
|
||||
# CONFIG_PLATFORM_TYPE_omap3_am33xx is not set
|
||||
# CONFIG_PLATFORM_TYPE_omap3evm is not set
|
||||
# CONFIG_PLATFORM_TYPE_pandaboard is not set
|
||||
# CONFIG_PLATFORM_TYPE_rv is not set
|
||||
CONFIG_PLATFORM_TYPE_rv_pbx=y
|
||||
# CONFIG_PLATFORM_TYPE_rv_vexpress is not set
|
||||
# CONFIG_PLATFORM_TYPE_tegra2 is not set
|
||||
# CONFIG_PLATFORM_TYPE_rpi_a is not set
|
||||
# CONFIG_PLATFORM_TYPE_integrator is not set
|
||||
# CONFIG_PLATFORM_TYPE_custom is not set
|
||||
CONFIG_PLATFORM_TYPE="rv_pbx"
|
||||
# CONFIG_USE_DROPS_STDDIR is not set
|
||||
|
||||
@@ -12,28 +12,34 @@ CONFIG_ARM=y
|
||||
# CONFIG_PF_IMX is not set
|
||||
CONFIG_PF_REALVIEW=y
|
||||
# CONFIG_PF_S3C2410 is not set
|
||||
# CONFIG_PF_TEGRA2 is not set
|
||||
# CONFIG_PF_TEGRA is not set
|
||||
# CONFIG_PF_OMAP is not set
|
||||
# CONFIG_PF_SA1100 is not set
|
||||
# CONFIG_PF_XSCALE is not set
|
||||
# CONFIG_PF_EXYNOS is not set
|
||||
# CONFIG_PF_KIRKWOOD is not set
|
||||
# CONFIG_PF_INTEGRATOR is not set
|
||||
# CONFIG_PF_EXYNOS5 is not set
|
||||
# CONFIG_PF_BCM2835 is not set
|
||||
CONFIG_BSP_NAME="realview"
|
||||
# CONFIG_PF_REALVIEW_EB is not set
|
||||
# CONFIG_PF_REALVIEW_PB11MP is not set
|
||||
# CONFIG_PF_REALVIEW_PBX is not set
|
||||
CONFIG_PF_REALVIEW_VEXPRESS=y
|
||||
CONFIG_PF_REALVIEW_VEXPRESS_A9=y
|
||||
# CONFIG_PF_REALVIEW_RAM_PHYS_BASE_0x0 is not set
|
||||
CONFIG_PF_REALVIEW_RAM_PHYS_BASE_0x6=y
|
||||
CONFIG_PF_REALVIEW_RAM_PHYS_BASE=0x60000000
|
||||
CONFIG_ABI_VF=y
|
||||
CONFIG_PF_ARM_MP_CAPABLE=y
|
||||
CONFIG_CAN_ARM_CPU_CORTEX_A9=y
|
||||
CONFIG_CAN_ARM_CPU_CORTEX_A15=y
|
||||
CONFIG_ARM_CORTEX_A9=y
|
||||
# CONFIG_ARM_CORTEX_A15 is not set
|
||||
# CONFIG_ARM_ALIGNMENT_CHECK is not set
|
||||
# CONFIG_ARM_TZ is not set
|
||||
# CONFIG_ARM_CA9_ENABLE_SWP is not set
|
||||
CONFIG_ARM_EM_STD=y
|
||||
# CONFIG_ARM_EM_NS is not set
|
||||
# CONFIG_ARM_EM_TZ is not set
|
||||
# CONFIG_ARM_ENABLE_SWP is not set
|
||||
CONFIG_FPU=y
|
||||
CONFIG_ARM_CPU_ERRATA=y
|
||||
|
||||
@@ -48,6 +54,7 @@ CONFIG_SCHED_FIXED_PRIO=y
|
||||
# CONFIG_SCHED_WFQ is not set
|
||||
# CONFIG_SCHED_FP_WFQ is not set
|
||||
# CONFIG_DISABLE_VIRT_OBJ_SPACE is not set
|
||||
CONFIG_VIRT_OBJ_SPACE=y
|
||||
|
||||
#
|
||||
# Debugging
|
||||
|
||||
@@ -23,22 +23,27 @@ CONFIG_CPU_ARM_ARMV7A=y
|
||||
# CONFIG_CPU_ARM_ARMV7R is not set
|
||||
CONFIG_CPU_ARMV6KPLUS=y
|
||||
CONFIG_CPU_ARMV6PLUS=y
|
||||
# CONFIG_PLATFORM_TYPE_arndale is not set
|
||||
# CONFIG_PLATFORM_TYPE_imx53 is not set
|
||||
# CONFIG_PLATFORM_TYPE_imx35 is not set
|
||||
# CONFIG_PLATFORM_TYPE_rv_pbx is not set
|
||||
# CONFIG_PLATFORM_TYPE_exynos5 is not set
|
||||
# CONFIG_PLATFORM_TYPE_rv is not set
|
||||
# CONFIG_PLATFORM_TYPE_kirkwood is not set
|
||||
# CONFIG_PLATFORM_TYPE_pandaboard is not set
|
||||
# CONFIG_PLATFORM_TYPE_tegra3 is not set
|
||||
# CONFIG_PLATFORM_TYPE_tegra2 is not set
|
||||
# CONFIG_PLATFORM_TYPE_imx6 is not set
|
||||
# CONFIG_PLATFORM_TYPE_exynos4 is not set
|
||||
# CONFIG_PLATFORM_TYPE_omap3_am33xx is not set
|
||||
# CONFIG_PLATFORM_TYPE_rpi_b is not set
|
||||
# CONFIG_PLATFORM_TYPE_rv_vexpress_a15 is not set
|
||||
# CONFIG_PLATFORM_TYPE_imx51 is not set
|
||||
# CONFIG_PLATFORM_TYPE_omap3evm is not set
|
||||
# CONFIG_PLATFORM_TYPE_beagleboard is not set
|
||||
# CONFIG_PLATFORM_TYPE_imx21 is not set
|
||||
# CONFIG_PLATFORM_TYPE_imx35 is not set
|
||||
# CONFIG_PLATFORM_TYPE_imx51 is not set
|
||||
# CONFIG_PLATFORM_TYPE_imx53 is not set
|
||||
# CONFIG_PLATFORM_TYPE_imx6 is not set
|
||||
# CONFIG_PLATFORM_TYPE_integrator is not set
|
||||
# CONFIG_PLATFORM_TYPE_kirkwood is not set
|
||||
# CONFIG_PLATFORM_TYPE_omap3_am33xx is not set
|
||||
# CONFIG_PLATFORM_TYPE_omap3evm is not set
|
||||
# CONFIG_PLATFORM_TYPE_pandaboard is not set
|
||||
# CONFIG_PLATFORM_TYPE_rv is not set
|
||||
# CONFIG_PLATFORM_TYPE_rv_pbx is not set
|
||||
CONFIG_PLATFORM_TYPE_rv_vexpress=y
|
||||
# CONFIG_PLATFORM_TYPE_tegra2 is not set
|
||||
# CONFIG_PLATFORM_TYPE_rpi_a is not set
|
||||
# CONFIG_PLATFORM_TYPE_integrator is not set
|
||||
# CONFIG_PLATFORM_TYPE_custom is not set
|
||||
CONFIG_PLATFORM_TYPE="rv_vexpress"
|
||||
# CONFIG_USE_DROPS_STDDIR is not set
|
||||
|
||||
@@ -39,6 +39,7 @@ CONFIG_CONTEXT_4K=y
|
||||
# CONFIG_SYNC_TSC is not set
|
||||
# CONFIG_FINE_GRAINED_CPUTIME is not set
|
||||
CONFIG_SCHED_FIXED_PRIO=y
|
||||
CONFIG_VIRT_OBJ_SPACE=y
|
||||
|
||||
#
|
||||
# Debugging
|
||||
|
||||
@@ -30,6 +30,7 @@ CONFIG_SCHED_FIXED_PRIO=y
|
||||
# CONFIG_SCHED_WFQ is not set
|
||||
# CONFIG_SCHED_FP_WFQ is not set
|
||||
# CONFIG_DISABLE_VIRT_OBJ_SPACE is not set
|
||||
CONFIG_VIRT_OBJ_SPACE=y
|
||||
|
||||
#
|
||||
# Debugging
|
||||
|
||||
@@ -54,6 +54,12 @@ just do:
|
||||
|
||||
This will install all necessary third-party source code in the 'contrib' folder.
|
||||
|
||||
For the vesa driver on x86 the x86emu library is required and can be downloaded
|
||||
and prepared by invoking the following command from within the 'libports'
|
||||
directory:
|
||||
|
||||
! make prepare PKG=x86emu
|
||||
|
||||
Now, go to a directory where you want the Genode/Fiasco.OC build directory to
|
||||
remain. Use the helper script in the 'tool' directory of the Genode
|
||||
source tree to create the initial build environment. You need to state the
|
||||
@@ -104,15 +110,9 @@ After that you can build and run L4Linux by issuing:
|
||||
! make run/l4linux
|
||||
|
||||
in your build directory. This run-script boots a single L4Linux instance into
|
||||
a minimal console environment. The script depends on an 'initrd.gz' archive,
|
||||
which has to reside in 'bin' in your build directory. You can find an example
|
||||
initramfs here:
|
||||
|
||||
:[http://genode.org/files/release-11.05/l4lx/x86/initrd.gz]:
|
||||
Initramfs archive for X86
|
||||
|
||||
:[http://genode.org/files/release-11.05/l4lx/arm/initrd.gz]:
|
||||
Initramfs archive for ARM
|
||||
a minimal console environment. After booting completes, the run-scripts tries
|
||||
to download the Genode project webpage via the 'wget' tool within the L4Linux
|
||||
environment. If all wents fine the run-script completes successfully.
|
||||
|
||||
|
||||
Integration of Fiasco.OC with Genode
|
||||
|
||||
@@ -68,28 +68,17 @@ namespace Genode {
|
||||
//if (write_combined)
|
||||
// _fpage.fp.cache = Fiasco::L4_FPAGE_BUFFERABLE;
|
||||
|
||||
unsigned char rights = _rw ? Fiasco::L4_FPAGE_RW : Fiasco::L4_FPAGE_RO;
|
||||
unsigned char rights = _rw ? Fiasco::L4_FPAGE_RWX : Fiasco::L4_FPAGE_RX;
|
||||
return Fiasco::l4_fpage(_src_addr, _log2size, rights);
|
||||
}
|
||||
|
||||
bool write_combined() const { return _write_combined; }
|
||||
|
||||
/**
|
||||
* Prepare map operation
|
||||
*
|
||||
* On Fiasco, we need to map a page locally to be able to map it to
|
||||
* another address space.
|
||||
* Prepare map operation is not needed on Fiasco.OC, since we clear the
|
||||
* dataspace before this function is called.
|
||||
*/
|
||||
void prepare_map_operation()
|
||||
{
|
||||
size_t mapping_size = 1 << _log2size;
|
||||
for (addr_t i = 0; i < mapping_size; i += L4_PAGESIZE) {
|
||||
if (_rw)
|
||||
touch_read_write((unsigned char volatile *)(_src_addr + i));
|
||||
else
|
||||
touch_read((unsigned char const volatile *)(_src_addr + i));
|
||||
}
|
||||
}
|
||||
void prepare_map_operation() { }
|
||||
};
|
||||
|
||||
|
||||
|
||||
@@ -11,15 +11,46 @@ namespace Fiasco {
|
||||
#include <l4/sys/task.h>
|
||||
|
||||
enum Cap_selectors {
|
||||
TASK_CAP = L4_BASE_TASK_CAP,
|
||||
PARENT_CAP = 0x8UL << L4_CAP_SHIFT,
|
||||
THREADS_BASE_CAP = 0x9UL << L4_CAP_SHIFT,
|
||||
|
||||
/**********************************************
|
||||
** Capability seclectors controlled by core **
|
||||
**********************************************/
|
||||
|
||||
TASK_CAP = L4_BASE_TASK_CAP, /* use the same task cap selector
|
||||
like L4Re for compatibility in
|
||||
L4Linux */
|
||||
|
||||
/*
|
||||
* To not clash with other L4Re cap selector constants (e.g.: L4Linux)
|
||||
* leave the following selectors (2-7) empty
|
||||
*/
|
||||
|
||||
PARENT_CAP = 0x8UL << L4_CAP_SHIFT, /* cap to parent session */
|
||||
|
||||
/*
|
||||
* Each thread has a designated slot in the core controlled cap
|
||||
* selector area, where its ipc gate capability (for server threads),
|
||||
* its irq capability (for locks), and the capability to its pager
|
||||
* gate are stored
|
||||
*/
|
||||
THREAD_AREA_BASE = 0x9UL << L4_CAP_SHIFT, /* offset to thread area */
|
||||
THREAD_AREA_SLOT = 0x3UL << L4_CAP_SHIFT, /* size of one thread slot */
|
||||
THREAD_GATE_CAP = 0, /* offset to the ipc gate
|
||||
cap selector in the slot */
|
||||
THREAD_PAGER_CAP = 0x1UL << L4_CAP_SHIFT, /* offset to the pager
|
||||
cap selector in the slot */
|
||||
THREAD_IRQ_CAP = 0x2UL << L4_CAP_SHIFT, /* offset to the irq cap
|
||||
selector in the slot */
|
||||
MAIN_THREAD_CAP = THREAD_AREA_BASE + THREAD_GATE_CAP, /* shortcut to the
|
||||
main thread's
|
||||
gate cap */
|
||||
|
||||
|
||||
/*********************************************************
|
||||
** Capability seclectors controlled by the task itself **
|
||||
*********************************************************/
|
||||
|
||||
USER_BASE_CAP = 0x200UL << L4_CAP_SHIFT,
|
||||
THREAD_GATE_CAP = 0,
|
||||
THREAD_PAGER_CAP = 0x1UL << L4_CAP_SHIFT,
|
||||
THREAD_IRQ_CAP = 0x2UL << L4_CAP_SHIFT,
|
||||
THREAD_CAP_SLOT = THREAD_IRQ_CAP + L4_CAP_SIZE,
|
||||
MAIN_THREAD_CAP = THREADS_BASE_CAP + THREAD_GATE_CAP
|
||||
};
|
||||
|
||||
enum Utcb_regs {
|
||||
@@ -138,7 +169,7 @@ namespace Genode {
|
||||
** Interface provided by all platforms **
|
||||
*******************************************/
|
||||
|
||||
int local_name() const { return _idx ? _idx->id() : 0; }
|
||||
long local_name() const { return _idx ? _idx->id() : 0; }
|
||||
Dst dst() const { return _idx ? Dst(_idx->kcap()) : Dst(); }
|
||||
bool valid() const { return (_idx != 0) && _idx->valid(); }
|
||||
void *local() const { return _ptr; }
|
||||
|
||||
@@ -67,11 +67,23 @@ namespace Genode {
|
||||
void single_step(Thread_capability thread, bool enable) {
|
||||
call<Rpc_single_step>(thread, enable); }
|
||||
|
||||
unsigned num_cpus() const {
|
||||
return call<Rpc_num_cpus>(); }
|
||||
Affinity::Space affinity_space() const {
|
||||
return call<Rpc_affinity_space>(); }
|
||||
|
||||
void affinity(Thread_capability thread, unsigned cpu) {
|
||||
call<Rpc_affinity>(thread, cpu); }
|
||||
void affinity(Thread_capability thread, Affinity::Location location) {
|
||||
call<Rpc_affinity>(thread, location); }
|
||||
|
||||
Dataspace_capability trace_control() {
|
||||
return call<Rpc_trace_control>(); }
|
||||
|
||||
unsigned trace_control_index(Thread_capability thread) {
|
||||
return call<Rpc_trace_control_index>(thread); }
|
||||
|
||||
Dataspace_capability trace_buffer(Thread_capability thread) {
|
||||
return call<Rpc_trace_buffer>(thread); }
|
||||
|
||||
Dataspace_capability trace_policy(Thread_capability thread) {
|
||||
return call<Rpc_trace_policy>(thread); }
|
||||
|
||||
void enable_vcpu(Thread_capability cap, addr_t vcpu_state) {
|
||||
call<Rpc_enable_vcpu>(cap, vcpu_state); }
|
||||
|
||||
@@ -5,11 +5,12 @@
|
||||
* \date 2010-02-03
|
||||
*
|
||||
* On Fiasco.OC, the signal source server does not provide a blocking
|
||||
* 'wait_for_signal' function because this kernel does no support
|
||||
* out-of-order IPC replies. Instead, we use an IRQ kernel-object
|
||||
* to let the client block until a signal is present at the
|
||||
* server. The IRQ object gets initialized with the first
|
||||
* call of 'wait_for_signal()'.
|
||||
* 'wait_for_signal' function because this kernel does not support out-of-order
|
||||
* IPC replies. Instead, we use an IRQ kernel-object to let the client block
|
||||
* until a signal is present at the server.
|
||||
*
|
||||
* We request the IRQ object capability and attach to the IRQ on construction
|
||||
* of the 'Signal_source_client' object.
|
||||
*/
|
||||
|
||||
/*
|
||||
|
||||
@@ -2,11 +2,6 @@
|
||||
* \brief Signal-source server interface
|
||||
* \author Norman Feske
|
||||
* \date 2010-02-03
|
||||
*
|
||||
* This file is only included by 'signal_session/server.h' and relies on the
|
||||
* headers included there. No include guards are needed. It is a separate
|
||||
* header file to make it easily replaceable by a platform-specific
|
||||
* implementation.
|
||||
*/
|
||||
|
||||
/*
|
||||
@@ -16,8 +11,8 @@
|
||||
* under the terms of the GNU General Public License version 2.
|
||||
*/
|
||||
|
||||
#ifndef _INCLUDE__SIGNAL_SESSION__SOURCE_SERVER_H_
|
||||
#define _INCLUDE__SIGNAL_SESSION__SOURCE_SERVER_H_
|
||||
#ifndef _INCLUDE__SIGNAL_SESSION__SOURCE_RPC_OBJECT_H_
|
||||
#define _INCLUDE__SIGNAL_SESSION__SOURCE_RPC_OBJECT_H_
|
||||
|
||||
#include <base/rpc_server.h>
|
||||
#include <signal_session/foc_source.h>
|
||||
@@ -39,4 +34,4 @@ namespace Genode {
|
||||
};
|
||||
}
|
||||
|
||||
#endif /* _INCLUDE__SIGNAL_SESSION__SOURCE_SERVER_H_ */
|
||||
#endif /* _INCLUDE__SIGNAL_SESSION__SOURCE_RPC_OBJECT_H_ */
|
||||
|
||||
3
base-foc/lib/mk/arm/base.mk
Normal file
3
base-foc/lib/mk/arm/base.mk
Normal file
@@ -0,0 +1,3 @@
|
||||
include $(REP_DIR)/lib/mk/base.inc
|
||||
|
||||
SRC_CC += thread/thread_context_area.cc
|
||||
@@ -20,9 +20,11 @@ SRC_CC += lock/lock.cc
|
||||
SRC_CC += env/spin_lock.cc env/cap_map.cc
|
||||
SRC_CC += signal/signal.cc signal/common.cc
|
||||
SRC_CC += server/server.cc server/common.cc
|
||||
SRC_CC += thread/thread.cc thread/thread_bootstrap.cc
|
||||
SRC_CC += thread/thread.cc thread/thread_bootstrap.cc thread/trace.cc
|
||||
|
||||
INC_DIR += $(REP_DIR)/src/base/lock $(BASE_DIR)/src/base/lock
|
||||
INC_DIR += $(REP_DIR)/src/base/lock
|
||||
INC_DIR += $(BASE_DIR)/src/base/lock
|
||||
INC_DIR += $(BASE_DIR)/src/base/thread
|
||||
|
||||
vpath %.cc $(REP_DIR)/src/base
|
||||
vpath %.cc $(BASE_DIR)/src/base
|
||||
|
||||
@@ -9,7 +9,7 @@ LIBS += base-common
|
||||
SRC_CC += console/log_console.cc
|
||||
SRC_CC += env/env.cc env/context_area.cc env/reload_parent_cap.cc \
|
||||
env/cap_map_remove.cc env/cap_alloc.cc
|
||||
SRC_CC += thread/thread_start.cc thread/thread_context_area.cc
|
||||
SRC_CC += thread/thread_start.cc
|
||||
|
||||
INC_DIR += $(BASE_DIR)/src/base/env
|
||||
|
||||
3
base-foc/lib/mk/exynos5/base.mk
Normal file
3
base-foc/lib/mk/exynos5/base.mk
Normal file
@@ -0,0 +1,3 @@
|
||||
include $(REP_DIR)/lib/mk/base.inc
|
||||
|
||||
SRC_CC += thread/arndale/thread_context_area.cc
|
||||
3
base-foc/lib/mk/x86/base.mk
Normal file
3
base-foc/lib/mk/x86/base.mk
Normal file
@@ -0,0 +1,3 @@
|
||||
include $(REP_DIR)/lib/mk/base.inc
|
||||
|
||||
SRC_CC += thread/thread_context_area.cc
|
||||
@@ -1,4 +1,5 @@
|
||||
SPECS += foc_arm platform_arndale uboot
|
||||
|
||||
include $(call select_from_repositories,mk/spec-fpu_vfpv3.mk)
|
||||
include $(call select_from_repositories,mk/spec-platform_arndale.mk)
|
||||
include $(call select_from_repositories,mk/spec-foc_arm.mk)
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
#
|
||||
|
||||
SPECS += x86_32 foc
|
||||
SPECS += pci ps2 vesa
|
||||
SPECS += pci ps2 vesa framebuffer
|
||||
|
||||
#
|
||||
# Linker options that are specific for x86
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
#
|
||||
|
||||
SPECS += x86_64 foc
|
||||
SPECS += pci ps2 vesa
|
||||
SPECS += pci ps2 vesa framebuffer
|
||||
|
||||
#
|
||||
# Linker options that are specific for x86
|
||||
|
||||
134
base-foc/run/env
134
base-foc/run/env
@@ -6,6 +6,14 @@
|
||||
# This file is meant to be used as '--include' argument for 'tool/run'.
|
||||
#
|
||||
|
||||
##
|
||||
# Install files needed to boot via PXE
|
||||
#
|
||||
proc install_pxe_bootloader_to_run_dir { } {
|
||||
exec cp [genode_dir]/tool/boot/pulsar [run_dir]/boot/pulsar
|
||||
exec cp [genode_dir]/tool/boot/bender [run_dir]/boot/bender
|
||||
}
|
||||
|
||||
##
|
||||
# Return the location of the Fiasco.OC user directory
|
||||
#
|
||||
@@ -64,6 +72,17 @@ proc fiasco_external { } {
|
||||
return 1
|
||||
}
|
||||
|
||||
##
|
||||
# Reset the target system via the Fiasco.OC kernel debugger
|
||||
#
|
||||
proc reset_target { {spawn_id_arg -1} } {
|
||||
global spawn_id
|
||||
if { $spawn_id_arg == -1 } {
|
||||
set spawn_id_arg $spawn_id
|
||||
}
|
||||
send -i $spawn_id_arg "\033^^"
|
||||
}
|
||||
|
||||
##################################
|
||||
## Test framework API functions ##
|
||||
##################################
|
||||
@@ -105,40 +124,12 @@ proc bin_dir { } {
|
||||
exit 1
|
||||
}
|
||||
|
||||
#
|
||||
# Parse entry point address out of final elf image for u-boot
|
||||
#
|
||||
proc entrypoint { } {
|
||||
global _entrypoint
|
||||
set _entrypoint [exec [cross_dev_prefix]readelf -h [run_dir]/image.elf | grep "Entry point" | sed -e "s/.*Entry point address: *//"]
|
||||
return $_entrypoint
|
||||
}
|
||||
|
||||
|
||||
#
|
||||
# Parse load address out of final elf image for u-boot
|
||||
#
|
||||
proc loadaddr { } {
|
||||
global _loadaddr
|
||||
set _loadaddr [regexp -inline -all -- {\S+} [exec [cross_dev_prefix]readelf -l [run_dir]/image.elf | grep -m 1 "LOAD"]]
|
||||
return [lindex $_loadaddr 3]
|
||||
}
|
||||
|
||||
|
||||
#
|
||||
# Create an u-boot image if appropriated SPEC is set
|
||||
#
|
||||
proc build_boot_uimage { } {
|
||||
if {[have_spec uboot]} {
|
||||
exec [cross_dev_prefix]objcopy -O binary [run_dir]/image.elf [run_dir]/image.bin
|
||||
exec gzip --best --force [run_dir]/image.bin
|
||||
exec mkimage -A arm -O linux -T kernel -C gzip -a [loadaddr] -e [entrypoint] -d [run_dir]/image.bin.gz [run_dir]/uImage
|
||||
}
|
||||
}
|
||||
|
||||
set fiasco_serial_esc_arg "-serial_esc "
|
||||
|
||||
proc build_boot_image_x86 {binaries} {
|
||||
|
||||
global fiasco_serial_esc_arg
|
||||
|
||||
copy_and_strip_binaries $binaries
|
||||
|
||||
set foc_targets { }
|
||||
@@ -171,7 +162,7 @@ proc build_boot_image_x86 {binaries} {
|
||||
puts $fh "default 0"
|
||||
puts $fh "\ntitle Genode on Fiasco.OC"
|
||||
puts $fh " kernel /fiasco/bootstrap -modaddr=0x01100000"
|
||||
puts $fh " module /fiasco/fiasco -serial_esc"
|
||||
puts $fh " module /fiasco/fiasco $fiasco_serial_esc_arg"
|
||||
puts $fh " module /fiasco/sigma0"
|
||||
puts $fh " module /genode/core"
|
||||
puts $fh " module /genode/config"
|
||||
@@ -181,12 +172,47 @@ proc build_boot_image_x86 {binaries} {
|
||||
puts $fh " vbeset 0x117 506070"
|
||||
close $fh
|
||||
|
||||
install_pxe_bootloader_to_run_dir
|
||||
create_iso_image_from_run_dir
|
||||
|
||||
#
|
||||
# Generate pulsar config file
|
||||
#
|
||||
set fh [open "[run_dir]/config-52-54-00-12-34-56" "WRONLY CREAT TRUNC"]
|
||||
puts $fh " exec /boot/bender"
|
||||
puts $fh " load /fiasco/bootstrap -modaddr=0x01100000"
|
||||
puts $fh " load /fiasco/fiasco -serial_esc"
|
||||
puts $fh " load /fiasco/sigma0"
|
||||
puts $fh " load /genode/core"
|
||||
puts $fh " load /genode/config"
|
||||
foreach binary $binaries {
|
||||
if {$binary != "core"} {
|
||||
puts $fh " load /genode/$binary" } }
|
||||
close $fh
|
||||
|
||||
#
|
||||
# Generate pulsar config file pointing to the config file above.
|
||||
#
|
||||
if {[info exists ::env(PXE_TFTP_DIR_BASE)] && [info exists ::env(PXE_TFTP_DIR_OFFSET)]} {
|
||||
exec ln -nfs "[pwd]" "$::env(PXE_TFTP_DIR_BASE)$::env(PXE_TFTP_DIR_OFFSET)"
|
||||
|
||||
set tftp_base ""
|
||||
if {[get_cmd_switch --tftp-absolute]} {
|
||||
set tftp_base $::env(PXE_TFTP_DIR_BASE)
|
||||
}
|
||||
|
||||
set fh [open "$::env(PXE_TFTP_DIR_BASE)$::env(PXE_TFTP_DIR_OFFSET)/config-00-00-00-00-00-00" "WRONLY CREAT TRUNC"]
|
||||
puts $fh " root $tftp_base$::env(PXE_TFTP_DIR_OFFSET)/[run_dir]"
|
||||
puts $fh " config config-52-54-00-12-34-56"
|
||||
close $fh
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
proc build_boot_image_arm {binaries} {
|
||||
|
||||
global fiasco_serial_esc_arg
|
||||
|
||||
copy_and_strip_binaries $binaries
|
||||
|
||||
build "kernel sigma0 bootstrap"
|
||||
@@ -198,7 +224,7 @@ proc build_boot_image_arm {binaries} {
|
||||
|
||||
puts $fh "modaddr 0x01100000\n"
|
||||
puts $fh "entry genode"
|
||||
puts $fh "kernel [fiasco] -serial_esc"
|
||||
puts $fh "kernel [fiasco] $fiasco_serial_esc_arg"
|
||||
puts $fh "roottask genode/core"
|
||||
puts $fh "module genode/config"
|
||||
foreach binary $binaries {
|
||||
@@ -220,9 +246,18 @@ proc build_boot_image_arm {binaries} {
|
||||
}
|
||||
|
||||
exec cp [bin_dir]/bootstrap.elf [run_dir]/image.elf
|
||||
build_boot_uimage
|
||||
build_uboot_image [run_dir]/image.elf
|
||||
|
||||
puts "\nboot image: [run_dir]/image.elf\n"
|
||||
|
||||
# set symbolic link to image.elf file in TFTP directory for PXE boot
|
||||
if {[info exists ::env(PXE_TFTP_DIR_BASE)] &&
|
||||
[info exists ::env(PXE_TFTP_DIR_OFFSET)]} {
|
||||
exec ln -sf "[pwd]/[run_dir]/image.elf" "$::env(PXE_TFTP_DIR_BASE)$::env(PXE_TFTP_DIR_OFFSET)"
|
||||
if {[have_spec uboot]} {
|
||||
exec ln -sf "[pwd]/[run_dir]/uImage" "$::env(PXE_TFTP_DIR_BASE)$::env(PXE_TFTP_DIR_OFFSET)/uImage"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -232,5 +267,32 @@ proc build_boot_image {binaries} {
|
||||
}
|
||||
|
||||
|
||||
proc run_genode_until {{wait_for_re forever} {timeout_value 0}} {
|
||||
spawn_qemu $wait_for_re $timeout_value }
|
||||
proc run_genode_until {{wait_for_re forever} {timeout_value 0} {running_spawn_id -1}} {
|
||||
#
|
||||
# If a running_spawn_id is specified, wait for the expected output
|
||||
#
|
||||
if {$running_spawn_id != -1} {
|
||||
wait_for_output $wait_for_re $timeout_value $running_spawn_id
|
||||
return
|
||||
}
|
||||
|
||||
#
|
||||
# Try to use one of the supported backends for running the scripts
|
||||
#
|
||||
if {[is_amt_available]} {
|
||||
spawn_amt $wait_for_re $timeout_value
|
||||
return
|
||||
}
|
||||
if {[is_qemu_available]} {
|
||||
spawn_qemu $wait_for_re $timeout_value
|
||||
return
|
||||
}
|
||||
if {[is_serial_available]} {
|
||||
spawn_serial $wait_for_re $timeout_value "L4 Bootstrapper"
|
||||
return
|
||||
}
|
||||
|
||||
global run_target
|
||||
puts stderr "Error: Can't execute automatically on target '$run_target'"
|
||||
exit -1
|
||||
}
|
||||
|
||||
@@ -6,6 +6,10 @@
|
||||
* We need to place the context area within core outside the physical memory.
|
||||
* Sigma0 maps physical to core-local memory always 1:1 when using
|
||||
* SIGMA0_REQ_FPAGE_ANY. Those mappings would interfere with the context area.
|
||||
*
|
||||
* Because the UTCB area of a task resides at the end of the context area and
|
||||
* its address gets calculated by core, the context area in other tasks needs
|
||||
* to be at the same address as in core.
|
||||
*/
|
||||
|
||||
#include <base/native_types.h>
|
||||
@@ -182,7 +182,8 @@ void Thread_base::name(char *dst, size_t dst_len)
|
||||
}
|
||||
|
||||
|
||||
Thread_base *Thread_base::myself() {
|
||||
Thread_base *Thread_base::myself()
|
||||
{
|
||||
using namespace Fiasco;
|
||||
|
||||
return reinterpret_cast<Thread_base*>(l4_utcb_tcr()->user[UTCB_TCR_THREAD_OBJ]);
|
||||
|
||||
@@ -27,6 +27,3 @@ void Genode::Thread_base::_thread_start()
|
||||
Lock sleep_forever_lock(Lock::LOCKED);
|
||||
sleep_forever_lock.lock();
|
||||
}
|
||||
|
||||
|
||||
void Genode::Thread_base::_init_platform_thread() { }
|
||||
|
||||
@@ -38,10 +38,8 @@ void Thread_base::_deinit_platform_thread()
|
||||
}
|
||||
|
||||
|
||||
void Thread_base::start()
|
||||
void Genode::Thread_base::_init_platform_thread()
|
||||
{
|
||||
using namespace Fiasco;
|
||||
|
||||
/* create thread at core */
|
||||
char buf[48];
|
||||
name(buf, sizeof(buf));
|
||||
@@ -49,6 +47,12 @@ void Thread_base::start()
|
||||
|
||||
/* assign thread to protection domain */
|
||||
env()->pd_session()->bind_thread(_thread_cap);
|
||||
}
|
||||
|
||||
|
||||
void Thread_base::start()
|
||||
{
|
||||
using namespace Fiasco;
|
||||
|
||||
/* create new pager object and assign it to the new thread */
|
||||
_pager_cap = env()->rm_session()->add_client(_thread_cap);
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
# override default location of thread context area within core
|
||||
vpath thread_context_area.cc $(PRG_DIR)
|
||||
vpath thread_context_area.cc $(REP_DIR)/src/base/thread/arndale
|
||||
|
||||
include $(PRG_DIR)/../target.inc
|
||||
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
/*
|
||||
* \brief Core-specific instance of the CPU session/thread interfaces
|
||||
* \author Christian Helmuth
|
||||
* \author Norman Feske
|
||||
* \author Stefan Kalkowski
|
||||
* \date 2006-07-17
|
||||
*/
|
||||
@@ -26,6 +27,8 @@
|
||||
|
||||
/* core includes */
|
||||
#include <platform_thread.h>
|
||||
#include <trace/control_area.h>
|
||||
#include <trace/source_registry.h>
|
||||
|
||||
namespace Genode {
|
||||
|
||||
@@ -45,18 +48,33 @@ namespace Genode {
|
||||
class Cpu_thread_component : public Rpc_object<Cpu_thread>,
|
||||
public List<Cpu_thread_component>::Element
|
||||
{
|
||||
public:
|
||||
|
||||
typedef Trace::Session_label Session_label;
|
||||
typedef Trace::Thread_name Thread_name;
|
||||
|
||||
private:
|
||||
|
||||
Thread_name const _name;
|
||||
Platform_thread _platform_thread;
|
||||
bool _bound; /* pd binding flag */
|
||||
Signal_context_capability _sigh; /* exception handler */
|
||||
unsigned const _trace_control_index;
|
||||
Trace::Source _trace_source;
|
||||
|
||||
public:
|
||||
|
||||
Cpu_thread_component(const char *name, unsigned priority, addr_t utcb,
|
||||
Signal_context_capability sigh)
|
||||
Cpu_thread_component(Session_label const &label,
|
||||
Thread_name const &name,
|
||||
unsigned priority, addr_t utcb,
|
||||
Signal_context_capability sigh,
|
||||
unsigned trace_control_index,
|
||||
Trace::Control &trace_control)
|
||||
:
|
||||
_platform_thread(name, priority), _bound(false), _sigh(sigh)
|
||||
_name(name),
|
||||
_platform_thread(name.string(), priority, utcb), _bound(false),
|
||||
_sigh(sigh), _trace_control_index(trace_control_index),
|
||||
_trace_source(label, _name, trace_control)
|
||||
{
|
||||
update_exception_sigh();
|
||||
}
|
||||
@@ -66,9 +84,10 @@ namespace Genode {
|
||||
** Accessor functions **
|
||||
************************/
|
||||
|
||||
inline Platform_thread * platform_thread() { return &_platform_thread; }
|
||||
inline bool bound() const { return _bound; }
|
||||
inline void bound(bool b) { _bound = b; }
|
||||
Platform_thread *platform_thread() { return &_platform_thread; }
|
||||
bool bound() const { return _bound; }
|
||||
void bound(bool b) { _bound = b; }
|
||||
Trace::Source *trace_source() { return &_trace_source; }
|
||||
|
||||
void sigh(Signal_context_capability sigh)
|
||||
{
|
||||
@@ -80,11 +99,20 @@ namespace Genode {
|
||||
* Propagate exception handler to platform thread
|
||||
*/
|
||||
void update_exception_sigh();
|
||||
|
||||
/**
|
||||
* Return index within the CPU-session's trace control area
|
||||
*/
|
||||
unsigned trace_control_index() const { return _trace_control_index; }
|
||||
};
|
||||
|
||||
|
||||
class Cpu_session_component : public Rpc_object<Foc_cpu_session>
|
||||
{
|
||||
public:
|
||||
|
||||
typedef Cpu_thread_component::Session_label Session_label;
|
||||
|
||||
private:
|
||||
|
||||
/**
|
||||
@@ -93,16 +121,21 @@ namespace Genode {
|
||||
*/
|
||||
typedef Tslab<Cpu_thread_component, 1024> Cpu_thread_allocator;
|
||||
|
||||
Session_label _label;
|
||||
Rpc_entrypoint *_thread_ep;
|
||||
Pager_entrypoint *_pager_ep;
|
||||
Allocator_guard _md_alloc; /* guarded meta-data allocator */
|
||||
Cpu_thread_allocator _thread_alloc; /* meta-data allocator */
|
||||
Lock _thread_alloc_lock; /* protect alloc access */
|
||||
Lock _thread_alloc_lock; /* protect allocator access */
|
||||
List<Cpu_thread_component> _thread_list;
|
||||
Lock _thread_list_lock; /* protect thread list */
|
||||
unsigned _priority; /* priority of threads
|
||||
created with this
|
||||
session */
|
||||
Affinity::Location _location; /* CPU affinity of this
|
||||
session */
|
||||
Trace::Source_registry &_trace_sources;
|
||||
Trace::Control_area _trace_control_area;
|
||||
|
||||
/**
|
||||
* Exception handler that will be invoked unless overridden by a
|
||||
@@ -125,9 +158,11 @@ namespace Genode {
|
||||
/**
|
||||
* Constructor
|
||||
*/
|
||||
Cpu_session_component(Rpc_entrypoint *thread_ep,
|
||||
Pager_entrypoint *pager_ep,
|
||||
Allocator *md_alloc, const char *args);
|
||||
Cpu_session_component(Rpc_entrypoint *thread_ep,
|
||||
Pager_entrypoint *pager_ep,
|
||||
Allocator *md_alloc,
|
||||
Trace::Source_registry &trace_sources,
|
||||
const char *args, Affinity const &affinity);
|
||||
|
||||
/**
|
||||
* Destructor
|
||||
@@ -159,8 +194,12 @@ namespace Genode {
|
||||
Thread_state state(Thread_capability);
|
||||
void state(Thread_capability, Thread_state const &);
|
||||
void exception_handler(Thread_capability, Signal_context_capability);
|
||||
unsigned num_cpus() const;
|
||||
void affinity(Thread_capability, unsigned);
|
||||
Affinity::Space affinity_space() const;
|
||||
void affinity(Thread_capability, Affinity::Location);
|
||||
Dataspace_capability trace_control();
|
||||
unsigned trace_control_index(Thread_capability);
|
||||
Dataspace_capability trace_buffer(Thread_capability);
|
||||
Dataspace_capability trace_policy(Thread_capability);
|
||||
|
||||
|
||||
/***********************************
|
||||
|
||||
@@ -159,6 +159,7 @@ namespace Genode {
|
||||
addr_t vm_start() const { return _vm_start; }
|
||||
size_t vm_size() const { return _vm_size; }
|
||||
Rom_fs *rom_fs() { return &_rom_fs; }
|
||||
Affinity::Space affinity_space() const;
|
||||
|
||||
void wait_for_exit();
|
||||
};
|
||||
|
||||
@@ -27,6 +27,7 @@
|
||||
|
||||
/* core includes */
|
||||
#include <cap_mapping.h>
|
||||
#include <address_space.h>
|
||||
|
||||
/* Fiasco.OC includes */
|
||||
namespace Fiasco {
|
||||
@@ -36,7 +37,7 @@ namespace Fiasco {
|
||||
namespace Genode {
|
||||
|
||||
class Platform_thread;
|
||||
class Platform_pd
|
||||
class Platform_pd : public Address_space
|
||||
{
|
||||
private:
|
||||
|
||||
@@ -97,11 +98,23 @@ namespace Genode {
|
||||
*/
|
||||
int assign_parent(Native_capability parent);
|
||||
|
||||
|
||||
/*******************************
|
||||
** Fiasco-specific Accessors **
|
||||
*******************************/
|
||||
|
||||
Native_capability native_task() { return _task.local; }
|
||||
|
||||
|
||||
/*****************************
|
||||
** Address-space interface **
|
||||
*****************************/
|
||||
|
||||
/*
|
||||
* On Fiasco.OC, we don't use directed unmap but rely on the
|
||||
* in-kernel mapping database. See 'rm_session_support.cc'.
|
||||
*/
|
||||
void flush(addr_t, size_t) { PDBG("not implemented"); }
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
@@ -24,6 +24,7 @@
|
||||
#include <platform_pd.h>
|
||||
#include <cap_session_component.h>
|
||||
#include <cap_mapping.h>
|
||||
#include <address_space.h>
|
||||
|
||||
namespace Genode {
|
||||
|
||||
@@ -32,21 +33,26 @@ namespace Genode {
|
||||
{
|
||||
private:
|
||||
|
||||
enum State { DEAD, RUNNING };
|
||||
|
||||
friend class Platform_pd;
|
||||
|
||||
bool _core_thread;
|
||||
Cap_mapping _thread;
|
||||
Cap_mapping _gate;
|
||||
Cap_mapping _pager;
|
||||
Cap_mapping _irq;
|
||||
Native_utcb _utcb;
|
||||
char _name[32]; /* thread name that will be
|
||||
registered at the kernel
|
||||
debugger */
|
||||
Platform_pd *_platform_pd; /* protection domain thread
|
||||
is bound to */
|
||||
Pager_object *_pager_obj;
|
||||
unsigned _prio;
|
||||
State _state;
|
||||
bool _core_thread;
|
||||
Cap_mapping _thread;
|
||||
Cap_mapping _gate;
|
||||
Cap_mapping _pager;
|
||||
Cap_mapping _irq;
|
||||
Native_utcb _utcb;
|
||||
char _name[32]; /* thread name that will be
|
||||
registered at the kernel
|
||||
debugger */
|
||||
Platform_pd *_platform_pd; /* protection domain thread
|
||||
is bound to */
|
||||
Pager_object *_pager_obj;
|
||||
unsigned _prio;
|
||||
|
||||
Affinity::Location _location;
|
||||
|
||||
void _create_thread(void);
|
||||
void _finalize_construction(const char *name);
|
||||
@@ -59,7 +65,7 @@ namespace Genode {
|
||||
/**
|
||||
* Constructor for non-core threads
|
||||
*/
|
||||
Platform_thread(const char *name, unsigned priority);
|
||||
Platform_thread(const char *name, unsigned priority, addr_t);
|
||||
|
||||
/**
|
||||
* Constructor for core main-thread
|
||||
@@ -132,7 +138,17 @@ namespace Genode {
|
||||
/**
|
||||
* Set the executing CPU for this thread
|
||||
*/
|
||||
void affinity(unsigned cpu);
|
||||
void affinity(Affinity::Location location);
|
||||
|
||||
/**
|
||||
* Get the executing CPU for this thread
|
||||
*/
|
||||
Affinity::Location affinity();
|
||||
|
||||
/**
|
||||
* Return the address space to which the thread is bound
|
||||
*/
|
||||
Weak_ptr<Address_space> address_space();
|
||||
|
||||
|
||||
/************************
|
||||
|
||||
@@ -170,7 +170,7 @@ Irq_session_component::Irq_session_component(Cap_session *cap_session,
|
||||
PERR("Unavailable IRQ %lx requested", irq_number);
|
||||
throw Root::Invalid_args();
|
||||
}
|
||||
|
||||
|
||||
long irq_trigger = Arg_string::find_arg(args, "irq_trigger").long_value(-1);
|
||||
irq_trigger = irq_trigger == -1 ? 0 : irq_trigger;
|
||||
|
||||
@@ -216,10 +216,8 @@ void Irq_session_component::wait_for_irq()
|
||||
}
|
||||
|
||||
|
||||
Irq_session_component::~Irq_session_component()
|
||||
{
|
||||
PERR("Implement me, immediately!");
|
||||
}
|
||||
Irq_session_component::~Irq_session_component() {
|
||||
_proxy->remove_sharer(); }
|
||||
|
||||
|
||||
/***************************************
|
||||
|
||||
@@ -35,6 +35,7 @@ namespace Fiasco {
|
||||
#include <l4/sys/thread.h>
|
||||
#include <l4/sys/types.h>
|
||||
#include <l4/sys/utcb.h>
|
||||
#include <l4/sys/scheduler.h>
|
||||
|
||||
static l4_kernel_info_t *kip;
|
||||
}
|
||||
@@ -120,7 +121,7 @@ static void _core_pager_loop()
|
||||
}
|
||||
|
||||
|
||||
Platform::Sigma0::Sigma0(Cap_index* i) : Pager_object(0)
|
||||
Platform::Sigma0::Sigma0(Cap_index* i) : Pager_object(0, Affinity::Location())
|
||||
{
|
||||
/*
|
||||
* We use the Pager_object here in a slightly different manner,
|
||||
@@ -131,7 +132,7 @@ Platform::Sigma0::Sigma0(Cap_index* i) : Pager_object(0)
|
||||
|
||||
|
||||
Platform::Core_pager::Core_pager(Platform_pd *core_pd, Sigma0 *sigma0)
|
||||
: Platform_thread("core.pager"), Pager_object(0)
|
||||
: Platform_thread("core.pager"), Pager_object(0, Affinity::Location())
|
||||
{
|
||||
Platform_thread::pager(sigma0);
|
||||
|
||||
@@ -250,8 +251,6 @@ static inline int sigma0_req_region(addr_t *addr, unsigned log2size)
|
||||
|
||||
*addr = l4_utcb_mr()->mr[0] & (~0UL << L4_PAGESHIFT);
|
||||
|
||||
touch_rw((void *)addr, 1);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -297,7 +296,7 @@ void Platform::_setup_mem_alloc()
|
||||
|
||||
for (unsigned i = 0; i < sizeof(log2_sizes)/sizeof(*log2_sizes); ++i) {
|
||||
size_t log2_size = log2_sizes[i];
|
||||
size_t size = 1 << log2_size;
|
||||
size_t size = 1UL << log2_size;
|
||||
int err = 0;
|
||||
addr_t addr = 0;
|
||||
Region region;
|
||||
@@ -513,4 +512,31 @@ void Platform::wait_for_exit()
|
||||
}
|
||||
|
||||
|
||||
Affinity::Space Platform::affinity_space() const
|
||||
{
|
||||
using namespace Genode;
|
||||
using namespace Fiasco;
|
||||
|
||||
l4_sched_cpu_set_t cpus = l4_sched_cpu_set(0, 0, 1);
|
||||
l4_umword_t cpus_max;
|
||||
l4_msgtag_t res = l4_scheduler_info(L4_BASE_SCHEDULER_CAP, &cpus_max,
|
||||
&cpus);
|
||||
if (l4_error(res)) {
|
||||
PERR("could not detect number of CPUs - assuming 1 CPU");
|
||||
return 1;
|
||||
}
|
||||
|
||||
unsigned cpus_online = 0;
|
||||
for (unsigned i = 0; i < sizeof(cpus.map) * 8; i++)
|
||||
if ((cpus.map >> i) & 0x1)
|
||||
cpus_online ++;
|
||||
|
||||
/*
|
||||
* Currently, we do not gather any information about the topology of CPU
|
||||
* nodes but just return a one-dimensional affinity space.
|
||||
*/
|
||||
return Affinity::Space(cpus_online, 1);
|
||||
}
|
||||
|
||||
|
||||
void Core_parent::exit(int exit_value) { }
|
||||
|
||||
@@ -53,7 +53,7 @@ int Platform_pd::bind_thread(Platform_thread *thread)
|
||||
else
|
||||
thread->_utcb =
|
||||
reinterpret_cast<l4_utcb_t*>(utcb_area_start() + i * L4_UTCB_OFFSET);
|
||||
Native_thread cap_offset = THREADS_BASE_CAP + i * THREAD_CAP_SLOT;
|
||||
Native_thread cap_offset = THREAD_AREA_BASE + i * THREAD_AREA_SLOT;
|
||||
thread->_gate.remote = cap_offset + THREAD_GATE_CAP;
|
||||
thread->_pager.remote = cap_offset + THREAD_PAGER_CAP;
|
||||
thread->_irq.remote = cap_offset + THREAD_IRQ_CAP;
|
||||
|
||||
@@ -54,6 +54,8 @@ int Platform_thread::start(void *ip, void *sp)
|
||||
return -1;
|
||||
}
|
||||
|
||||
_state = RUNNING;
|
||||
|
||||
/* set ip and sp and run the thread */
|
||||
tag = l4_thread_ex_regs(_thread.local.dst(), (l4_addr_t) ip,
|
||||
(l4_addr_t) sp, 0);
|
||||
@@ -93,7 +95,11 @@ void Platform_thread::pause()
|
||||
*/
|
||||
l4_thread_ex_regs_ret(_thread.local.dst(), &_pager_obj->state.ip,
|
||||
&_pager_obj->state.sp, &flags);
|
||||
bool in_syscall = flags == 0;
|
||||
|
||||
/*
|
||||
* The thread state ("ready") is encoded in the lowest bit of the flags.
|
||||
*/
|
||||
bool in_syscall = (flags & 1) == 0;
|
||||
_pager_obj->state.lock.unlock();
|
||||
|
||||
/**
|
||||
@@ -139,16 +145,18 @@ void Platform_thread::bind(Platform_pd *pd)
|
||||
|
||||
void Platform_thread::unbind()
|
||||
{
|
||||
/* first set the thread as its own pager */
|
||||
l4_thread_control_start();
|
||||
l4_thread_control_pager(_gate.remote);
|
||||
l4_thread_control_exc_handler(_gate.remote);
|
||||
if (l4_msgtag_has_error(l4_thread_control_commit(_thread.local.dst())))
|
||||
PWRN("l4_thread_control_commit for %lx failed!",
|
||||
(unsigned long) _thread.local.dst());
|
||||
if (_state == RUNNING) {
|
||||
/* first set the thread as its own pager */
|
||||
l4_thread_control_start();
|
||||
l4_thread_control_pager(_gate.remote);
|
||||
l4_thread_control_exc_handler(_gate.remote);
|
||||
if (l4_msgtag_has_error(l4_thread_control_commit(_thread.local.dst())))
|
||||
PWRN("l4_thread_control_commit for %lx failed!",
|
||||
(unsigned long) _thread.local.dst());
|
||||
|
||||
/* now force it into a pagefault */
|
||||
l4_thread_ex_regs(_thread.local.dst(), 0, 0, L4_THREAD_EX_REGS_CANCEL);
|
||||
/* now force it into a pagefault */
|
||||
l4_thread_ex_regs(_thread.local.dst(), 0, 0, L4_THREAD_EX_REGS_CANCEL);
|
||||
}
|
||||
|
||||
_platform_pd = (Platform_pd*) 0;
|
||||
}
|
||||
@@ -190,8 +198,12 @@ void Platform_thread::cancel_blocking()
|
||||
}
|
||||
|
||||
|
||||
void Platform_thread::affinity(unsigned cpu)
|
||||
void Platform_thread::affinity(Affinity::Location location)
|
||||
{
|
||||
_location = location;
|
||||
|
||||
int const cpu = location.xpos();
|
||||
|
||||
l4_sched_param_t params = l4_sched_param(_prio);
|
||||
params.affinity = l4_sched_cpu_set(cpu, 0, 1);
|
||||
l4_msgtag_t tag = l4_scheduler_run_thread(L4_BASE_SCHEDULER_CAP,
|
||||
@@ -201,6 +213,12 @@ void Platform_thread::affinity(unsigned cpu)
|
||||
}
|
||||
|
||||
|
||||
Affinity::Location Platform_thread::affinity()
|
||||
{
|
||||
return _location;
|
||||
}
|
||||
|
||||
|
||||
void Platform_thread::_create_thread()
|
||||
{
|
||||
l4_msgtag_t tag = l4_factory_create_thread(L4_BASE_FACTORY_CAP,
|
||||
@@ -237,9 +255,15 @@ void Platform_thread::_finalize_construction(const char *name)
|
||||
}
|
||||
|
||||
|
||||
Platform_thread::Platform_thread(const char *name,
|
||||
unsigned prio)
|
||||
: _core_thread(false),
|
||||
Weak_ptr<Address_space> Platform_thread::address_space()
|
||||
{
|
||||
return _platform_pd->Address_space::weak_ptr();
|
||||
}
|
||||
|
||||
|
||||
Platform_thread::Platform_thread(const char *name, unsigned prio, addr_t)
|
||||
: _state(DEAD),
|
||||
_core_thread(false),
|
||||
_thread(true),
|
||||
_irq(true),
|
||||
_utcb(0),
|
||||
@@ -255,7 +279,8 @@ Platform_thread::Platform_thread(const char *name,
|
||||
|
||||
Platform_thread::Platform_thread(Core_cap_index* thread,
|
||||
Core_cap_index* irq, const char *name)
|
||||
: _core_thread(true),
|
||||
: _state(RUNNING),
|
||||
_core_thread(true),
|
||||
_thread(Native_capability(thread), L4_BASE_THREAD_CAP),
|
||||
_irq(Native_capability(irq)),
|
||||
_utcb(0),
|
||||
@@ -269,7 +294,8 @@ Platform_thread::Platform_thread(Core_cap_index* thread,
|
||||
|
||||
|
||||
Platform_thread::Platform_thread(const char *name)
|
||||
: _core_thread(true),
|
||||
: _state(DEAD),
|
||||
_core_thread(true),
|
||||
_thread(true),
|
||||
_irq(true),
|
||||
_utcb(0),
|
||||
|
||||
@@ -70,8 +70,10 @@ Signal_source::Signal Signal_source_component::wait_for_signal()
|
||||
|
||||
|
||||
Signal_source_component::Signal_source_component(Rpc_entrypoint *ep)
|
||||
: Signal_source_rpc_object(cap_map()->insert(platform_specific()->cap_id_alloc()->alloc())),
|
||||
_entrypoint(ep)
|
||||
:
|
||||
Signal_source_rpc_object(cap_map()->insert(platform_specific()->cap_id_alloc()->alloc())),
|
||||
_entrypoint(ep), _finalizer(*this),
|
||||
_finalizer_cap(_entrypoint->manage(&_finalizer))
|
||||
{
|
||||
using namespace Fiasco;
|
||||
|
||||
@@ -80,3 +82,20 @@ Signal_source_component::Signal_source_component(Rpc_entrypoint *ep)
|
||||
if (l4_error(res))
|
||||
PERR("Allocation of irq object failed!");
|
||||
}
|
||||
|
||||
|
||||
Signal_source_component::~Signal_source_component()
|
||||
{
|
||||
_finalizer_cap.call<Finalizer::Rpc_exit>();
|
||||
_entrypoint->dissolve(&_finalizer);
|
||||
}
|
||||
|
||||
|
||||
void Signal_source_component::Finalizer_component::exit()
|
||||
{
|
||||
/*
|
||||
* On Fiasco.OC, the signal-source client does not use a blocking call
|
||||
* to wait for signals. Hence, we do not need to take care of
|
||||
* releasing the reply capability of such a call.
|
||||
*/
|
||||
}
|
||||
|
||||
@@ -31,6 +31,7 @@ SRC_CC = cap_session_component.cc \
|
||||
rom_session_component.cc \
|
||||
signal_session_component.cc \
|
||||
signal_source_component.cc \
|
||||
trace_session_component.cc \
|
||||
thread_start.cc \
|
||||
thread_context_area.cc \
|
||||
core_printf.cc
|
||||
@@ -39,6 +40,7 @@ INC_DIR += $(REP_DIR)/src/core/include \
|
||||
$(GEN_CORE_DIR)/include \
|
||||
$(REP_DIR)/src/base/lock \
|
||||
$(BASE_DIR)/src/base/lock \
|
||||
$(BASE_DIR)/src/base/thread \
|
||||
$(REP_DIR)/src/base/console
|
||||
|
||||
vpath context_area.cc $(GEN_CORE_DIR)
|
||||
@@ -54,6 +56,7 @@ vpath ram_session_component.cc $(GEN_CORE_DIR)
|
||||
vpath rm_session_component.cc $(GEN_CORE_DIR)
|
||||
vpath rom_session_component.cc $(GEN_CORE_DIR)
|
||||
vpath signal_session_component.cc $(GEN_CORE_DIR)
|
||||
vpath trace_session_component.cc $(GEN_CORE_DIR)
|
||||
vpath core_printf.cc $(BASE_DIR)/src/base/console
|
||||
vpath %.cc $(REP_DIR)/src/core
|
||||
vpath %.cc $(REP_DIR)/src/base/thread
|
||||
|
||||
@@ -35,6 +35,9 @@ void Thread_base::_deinit_platform_thread()
|
||||
}
|
||||
|
||||
|
||||
void Genode::Thread_base::_init_platform_thread() { }
|
||||
|
||||
|
||||
void Thread_base::start()
|
||||
{
|
||||
using namespace Fiasco;
|
||||
|
||||
@@ -51,24 +51,34 @@ void Genode::Platform::setup_irq_mode(unsigned irq_number, unsigned trigger,
|
||||
{
|
||||
using namespace Fiasco;
|
||||
|
||||
/* don't touch anything below IRQ 16 in the default case */
|
||||
if (irq_number < 16 && trigger == Irq_session::TRIGGER_UNCHANGED &&
|
||||
polarity == Irq_session::TRIGGER_UNCHANGED)
|
||||
return;
|
||||
|
||||
/*
|
||||
* Translate ACPI interrupt mode (trigger/polarity) to Fiasco APIC
|
||||
* values. Default is level low for IRQs > 15
|
||||
*/
|
||||
l4_umword_t mode;
|
||||
mode = (trigger == Irq_session::TRIGGER_LEVEL) ||
|
||||
(irq_number > 15 && trigger == Irq_session::TRIGGER_UNCHANGED)
|
||||
? L4_IRQ_F_LEVEL : L4_IRQ_F_EDGE;
|
||||
|
||||
mode |= (polarity == Irq_session::POLARITY_LOW) ||
|
||||
(irq_number > 15 && polarity == Irq_session::POLARITY_UNCHANGED)
|
||||
? L4_IRQ_F_NEG : L4_IRQ_F_POS;
|
||||
/* set edge-high as default for legacy interrupts */
|
||||
if (irq_number < 16
|
||||
&& trigger == Irq_session::TRIGGER_UNCHANGED
|
||||
&& polarity == Irq_session::TRIGGER_UNCHANGED) {
|
||||
|
||||
mode = L4_IRQ_F_POS_EDGE;
|
||||
|
||||
} else {
|
||||
|
||||
/*
|
||||
* Translate ACPI interrupt mode (trigger/polarity) to Fiasco APIC
|
||||
* values. Default is level low
|
||||
*/
|
||||
if (trigger == Irq_session::TRIGGER_LEVEL || trigger == Irq_session::TRIGGER_UNCHANGED) {
|
||||
if (polarity == Irq_session::POLARITY_LOW || polarity == Irq_session::POLARITY_UNCHANGED)
|
||||
mode = L4_IRQ_F_LEVEL_LOW;
|
||||
else
|
||||
mode = L4_IRQ_F_LEVEL_HIGH;
|
||||
}
|
||||
else {
|
||||
if (polarity == Irq_session::POLARITY_LOW || polarity == Irq_session::POLARITY_UNCHANGED)
|
||||
mode = L4_IRQ_F_NEG_EDGE;
|
||||
else
|
||||
mode = L4_IRQ_F_POS_EDGE;
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Set mode
|
||||
|
||||
@@ -16,36 +16,19 @@
|
||||
|
||||
/* Genode includes */
|
||||
#include <base/native_types.h>
|
||||
#include <base/thread.h>
|
||||
|
||||
|
||||
static inline void thread_yield() { }
|
||||
|
||||
|
||||
static bool thread_check_stopped_and_restart(Genode::Native_thread_id tid)
|
||||
static bool thread_check_stopped_and_restart(Genode::Thread_base *)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
static inline Genode::Native_thread_id thread_get_my_native_id()
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
||||
static inline Genode::Native_thread_id thread_invalid_id()
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
||||
static inline bool thread_id_valid(Genode::Native_thread_id tid)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
static inline void thread_switch_to(Genode::Native_thread_id tid)
|
||||
static inline void thread_switch_to(Genode::Thread_base *)
|
||||
{ }
|
||||
|
||||
|
||||
|
||||
@@ -27,7 +27,7 @@ namespace Genode {
|
||||
* Constructors
|
||||
*/
|
||||
Platform_pd(bool core);
|
||||
Platform_pd(signed pd_id = -1, bool create = true);
|
||||
Platform_pd(char const *, signed pd_id = -1, bool create = true);
|
||||
|
||||
/**
|
||||
* Destructor
|
||||
|
||||
@@ -19,6 +19,9 @@
|
||||
#include <base/thread_state.h>
|
||||
#include <base/native_types.h>
|
||||
|
||||
/* core includes */
|
||||
#include <address_space.h>
|
||||
|
||||
namespace Genode {
|
||||
|
||||
class Platform_pd;
|
||||
@@ -80,6 +83,11 @@ namespace Genode {
|
||||
*/
|
||||
Thread_state state();
|
||||
|
||||
/**
|
||||
* Return the address space to which the thread is bound
|
||||
*/
|
||||
Weak_ptr<Address_space> address_space();
|
||||
|
||||
|
||||
/************************
|
||||
** Accessor functions **
|
||||
|
||||
@@ -43,7 +43,7 @@ Platform_pd::Platform_pd(bool core)
|
||||
}
|
||||
|
||||
|
||||
Platform_pd::Platform_pd(signed pd_id, bool create)
|
||||
Platform_pd::Platform_pd(char const *, signed pd_id, bool create)
|
||||
{
|
||||
PWRN("not yet implemented");
|
||||
}
|
||||
|
||||
@@ -73,6 +73,13 @@ unsigned long Platform_thread::pager_object_badge() const
|
||||
}
|
||||
|
||||
|
||||
Weak_ptr<Address_space> Platform_thread::address_space()
|
||||
{
|
||||
PWRN("not implemented");
|
||||
return Weak_ptr<Address_space>();
|
||||
}
|
||||
|
||||
|
||||
Platform_thread::Platform_thread(const char *name, unsigned, addr_t,
|
||||
int thread_id)
|
||||
{
|
||||
|
||||
@@ -31,10 +31,11 @@ namespace Genode {
|
||||
* \param priority designated priority of all threads created
|
||||
* with this CPU session
|
||||
*/
|
||||
Cpu_connection(const char *label = "", long priority = DEFAULT_PRIORITY)
|
||||
Cpu_connection(const char *label = "", long priority = DEFAULT_PRIORITY,
|
||||
Affinity const &affinity = Affinity())
|
||||
:
|
||||
Connection<Cpu_session>(
|
||||
session("priority=0x%lx, ram_quota=128K, label=\"%s\"",
|
||||
session(affinity, "priority=0x%lx, ram_quota=128K, label=\"%s\"",
|
||||
priority, label)),
|
||||
Cpu_session_client(cap()) { }
|
||||
};
|
||||
|
||||
@@ -20,6 +20,7 @@
|
||||
namespace Genode
|
||||
{
|
||||
class Platform_thread;
|
||||
class Platform_pd;
|
||||
class Tlb;
|
||||
}
|
||||
|
||||
@@ -29,6 +30,7 @@ namespace Kernel
|
||||
typedef Genode::addr_t addr_t;
|
||||
typedef Genode::size_t size_t;
|
||||
typedef Genode::Platform_thread Platform_thread;
|
||||
typedef Genode::Platform_pd Platform_pd;
|
||||
|
||||
/**
|
||||
* Unique opcodes of all syscalls supported by the kernel
|
||||
@@ -58,6 +60,7 @@ namespace Kernel
|
||||
/* management of resource protection-domains */
|
||||
SET_PAGER = 11,
|
||||
UPDATE_PD = 12,
|
||||
UPDATE_REGION = 32,
|
||||
NEW_PD = 13,
|
||||
|
||||
/* interrupt handling */
|
||||
@@ -78,8 +81,9 @@ namespace Kernel
|
||||
ACK_SIGNAL = 29,
|
||||
|
||||
/* vm specific */
|
||||
NEW_VM = 24,
|
||||
RUN_VM = 25,
|
||||
NEW_VM = 24,
|
||||
RUN_VM = 25,
|
||||
PAUSE_VM = 31,
|
||||
};
|
||||
|
||||
/*****************************************************************
|
||||
@@ -143,6 +147,7 @@ namespace Kernel
|
||||
*
|
||||
* \param dst physical base of an appropriate portion of memory
|
||||
* that is thereupon allocated to the kernel
|
||||
* \param pd core local Platform_pd object
|
||||
*
|
||||
* \retval >0 ID of the new PD
|
||||
* \retval 0 if no new PD was created
|
||||
@@ -150,8 +155,8 @@ namespace Kernel
|
||||
* Restricted to core threads. Regaining of the supplied memory is not
|
||||
* supported by now.
|
||||
*/
|
||||
inline int new_pd(void * const dst) {
|
||||
return syscall(NEW_PD, (Syscall_arg)dst); }
|
||||
inline int new_pd(void * const dst, Platform_pd * const pd) {
|
||||
return syscall(NEW_PD, (Syscall_arg)dst, (Syscall_arg)pd); }
|
||||
|
||||
|
||||
/**
|
||||
@@ -165,13 +170,27 @@ namespace Kernel
|
||||
* applied from the moment it returns to the userland. This syscall is
|
||||
* inappropriate in case that a PD wants to change its own configuration.
|
||||
* There's no need for this syscall after a configuration change that
|
||||
* can't affect the kernel and/or hardware caches.
|
||||
* can't affect the kernel- and/or hardware-caches.
|
||||
*
|
||||
* Restricted to core threads.
|
||||
*/
|
||||
inline void update_pd(unsigned const pd_id) {
|
||||
syscall(UPDATE_PD, (Syscall_arg)pd_id); }
|
||||
|
||||
/**
|
||||
* Propagate memory-updates within a given virtual region
|
||||
*
|
||||
* \param base virtual base of the region
|
||||
* \param size size of the region
|
||||
*
|
||||
* If one updates a memory region and must ensure that the update
|
||||
* gets visible directly to other address spaces, this syscall does
|
||||
* the job.
|
||||
*
|
||||
* Restricted to core threads.
|
||||
*/
|
||||
inline void update_region(addr_t base, size_t size) {
|
||||
syscall(UPDATE_REGION, (Syscall_arg)base, (Syscall_arg)size); }
|
||||
|
||||
/**
|
||||
* Create a new thread that is stopped initially
|
||||
@@ -249,6 +268,9 @@ namespace Kernel
|
||||
* \retval >0 if syscall was successful and thread were already active
|
||||
* \retval <0 if targeted thread doesn't participate in CPU
|
||||
* scheduling after
|
||||
*
|
||||
* If the targeted thread blocks for any event except a 'start_thread'
|
||||
* call this call cancels the blocking.
|
||||
*/
|
||||
inline int resume_thread(unsigned const id = 0) {
|
||||
return syscall(RESUME_THREAD, id); }
|
||||
@@ -505,12 +527,14 @@ namespace Kernel
|
||||
*
|
||||
* \param context_id kernel name of the targeted signal context
|
||||
*
|
||||
* \return wether the context could be destructed
|
||||
*
|
||||
* Blocks the caller until the last delivered signal of the targeted
|
||||
* context is acknowledged. Then the context gets destructed, losing
|
||||
* all submits that were not delivered when this syscall occured.
|
||||
*/
|
||||
inline void kill_signal_context(unsigned context_id) {
|
||||
syscall(KILL_SIGNAL_CONTEXT, (Syscall_arg)context_id); }
|
||||
inline bool kill_signal_context(unsigned context_id) {
|
||||
return syscall(KILL_SIGNAL_CONTEXT, (Syscall_arg)context_id); }
|
||||
|
||||
/**
|
||||
* Create a new virtual-machine that is stopped initially
|
||||
@@ -543,6 +567,17 @@ namespace Kernel
|
||||
*/
|
||||
inline void run_vm(unsigned const id) {
|
||||
syscall(RUN_VM, (Syscall_arg)id); }
|
||||
|
||||
|
||||
/**
|
||||
* Stop execution of a virtual-machine
|
||||
*
|
||||
* \param id ID of the targeted VM
|
||||
*
|
||||
* Restricted to core threads.
|
||||
*/
|
||||
inline void pause_vm(unsigned const id) {
|
||||
syscall(PAUSE_VM, (Syscall_arg)id); }
|
||||
}
|
||||
|
||||
#endif /* _INCLUDE__KERNEL__SYSCALLS_H_ */
|
||||
|
||||
@@ -1,33 +0,0 @@
|
||||
/*
|
||||
* \brief base-hw specific (higher ram-quota) connection to signal service
|
||||
* \author Norman Feske
|
||||
* \author Stefan Kalkowski
|
||||
* \date 2009-08-05
|
||||
*/
|
||||
|
||||
/*
|
||||
* Copyright (C) 2009-2013 Genode Labs GmbH
|
||||
*
|
||||
* This file is part of the Genode OS framework, which is distributed
|
||||
* under the terms of the GNU General Public License version 2.
|
||||
*/
|
||||
|
||||
#ifndef _INCLUDE__SIGNAL_SESSION__CONNECTION_H_
|
||||
#define _INCLUDE__SIGNAL_SESSION__CONNECTION_H_
|
||||
|
||||
#include <signal_session/client.h>
|
||||
#include <base/connection.h>
|
||||
|
||||
namespace Genode {
|
||||
|
||||
struct Signal_connection : Connection<Signal_session>, Signal_session_client
|
||||
{
|
||||
Signal_connection()
|
||||
:
|
||||
Connection<Signal_session>(session("ram_quota=16K")),
|
||||
Signal_session_client(cap())
|
||||
{ }
|
||||
};
|
||||
}
|
||||
|
||||
#endif /* _INCLUDE__CAP_SESSION__CONNECTION_H_ */
|
||||
@@ -41,8 +41,8 @@ namespace Genode
|
||||
void exception_handler(Signal_context_capability handler) {
|
||||
call<Rpc_exception_handler>(handler); }
|
||||
|
||||
void run() {
|
||||
call<Rpc_run>(); }
|
||||
void run() { call<Rpc_run>(); }
|
||||
void pause() { call<Rpc_pause>(); }
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
@@ -46,6 +46,12 @@ namespace Genode {
|
||||
*/
|
||||
virtual void run(void) {}
|
||||
|
||||
/**
|
||||
* Stop execution of the VM
|
||||
*/
|
||||
virtual void pause(void) {}
|
||||
|
||||
|
||||
/*********************
|
||||
** RPC declaration **
|
||||
*********************/
|
||||
@@ -54,7 +60,9 @@ namespace Genode {
|
||||
GENODE_RPC(Rpc_exception_handler, void, exception_handler,
|
||||
Signal_context_capability);
|
||||
GENODE_RPC(Rpc_run, void, run);
|
||||
GENODE_RPC_INTERFACE(Rpc_cpu_state, Rpc_exception_handler, Rpc_run);
|
||||
GENODE_RPC(Rpc_pause, void, pause);
|
||||
GENODE_RPC_INTERFACE(Rpc_cpu_state, Rpc_exception_handler,
|
||||
Rpc_run, Rpc_pause);
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
@@ -1,10 +0,0 @@
|
||||
#
|
||||
# \brief Linked against any program expect LDSO and dynamic binaries
|
||||
# \author Martin Stein
|
||||
# \date 2012-04-16
|
||||
#
|
||||
|
||||
include $(BASE_DIR)/lib/mk/startup.inc
|
||||
|
||||
vpath crt0.s $(REP_DIR)/src/platform/arm
|
||||
|
||||
@@ -18,9 +18,11 @@ SRC_CC += console/console.cc
|
||||
SRC_CC += lock/lock.cc
|
||||
SRC_CC += signal/signal.cc signal/common.cc
|
||||
SRC_CC += server/server.cc server/common.cc
|
||||
SRC_CC += thread/thread_bootstrap.cc
|
||||
SRC_CC += thread/thread_bootstrap.cc thread/trace.cc
|
||||
|
||||
INC_DIR += $(REP_DIR)/src/base/lock $(BASE_DIR)/src/base/lock
|
||||
INC_DIR += $(REP_DIR)/src/base/lock
|
||||
INC_DIR += $(BASE_DIR)/src/base/lock
|
||||
INC_DIR += $(BASE_DIR)/src/base/thread
|
||||
|
||||
vpath %.cc $(REP_DIR)/src/base
|
||||
vpath %.cc $(BASE_DIR)/src/base
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
#
|
||||
|
||||
# denote wich specs are also fullfilled by this spec
|
||||
SPECS += hw platform_imx31
|
||||
SPECS += hw platform_imx31 epit
|
||||
|
||||
# set address where to link the text segment at
|
||||
LD_TEXT_ADDR ?= 0x82000000
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
#
|
||||
|
||||
# denote wich specs are also fullfilled by this spec
|
||||
SPECS += hw platform_imx53
|
||||
SPECS += hw platform_imx53 epit
|
||||
|
||||
# set address where to link the text segment at
|
||||
LD_TEXT_ADDR ?= 0x70001000
|
||||
|
||||
15
base-hw/mk/spec-hw_rpi.mk
Normal file
15
base-hw/mk/spec-hw_rpi.mk
Normal file
@@ -0,0 +1,15 @@
|
||||
#
|
||||
# \brief Build configurations specific to base-hw and Raspberry Pi
|
||||
# \author Norman Feske
|
||||
# \date 2013-04-05
|
||||
#
|
||||
|
||||
# denote wich specs are also fullfilled by this spec
|
||||
SPECS += hw platform_rpi
|
||||
|
||||
# set address where to link the text segment at
|
||||
LD_TEXT_ADDR ?= 0x400000
|
||||
|
||||
# include implied specs
|
||||
include $(call select_from_repositories,mk/spec-hw.mk)
|
||||
include $(call select_from_repositories,mk/spec-platform_rpi.mk)
|
||||
@@ -18,12 +18,6 @@ proc clean_boot_modules { } {
|
||||
exec rm -rf boot_modules.s var/libcache/boot_modules/boot_modules.o }
|
||||
|
||||
|
||||
#
|
||||
# Get target argument
|
||||
#
|
||||
proc target { } { return [get_cmd_arg --target "qemu"] }
|
||||
|
||||
|
||||
##########################
|
||||
## 'tool/run' interface ##
|
||||
##########################
|
||||
@@ -59,6 +53,7 @@ proc create_boot_directory { } {
|
||||
|
||||
|
||||
proc build_boot_image {binaries} {
|
||||
global run_target
|
||||
|
||||
# strip binaries
|
||||
copy_and_strip_genode_binaries_to_run_dir $binaries
|
||||
@@ -177,40 +172,47 @@ proc build_boot_image {binaries} {
|
||||
exec cp -L bin/core $elf_img
|
||||
exec [cross_dev_prefix]strip $elf_img
|
||||
|
||||
# target specific ops
|
||||
if {[target] == "uboot"} {
|
||||
build_uboot_image $elf_img
|
||||
|
||||
# parse ELF entrypoint and load address
|
||||
set entrypoint [exec [cross_dev_prefix]readelf -h $elf_img | \
|
||||
grep "Entry point address: " | \
|
||||
sed -e "s/.*Entry point address: *//"]
|
||||
set load_addr [exec [cross_dev_prefix]readelf -l $elf_img | \
|
||||
grep -m 1 "LOAD"]
|
||||
set load_addr [lindex [regexp -inline -all -- {\S+} $load_addr] 3]
|
||||
# set symbolic link to image.elf file in TFTP directory for PXE boot
|
||||
if {[info exists ::env(PXE_TFTP_DIR_BASE)] &&
|
||||
[info exists ::env(PXE_TFTP_DIR_OFFSET)]} {
|
||||
exec ln -sf "[pwd]/$elf_img" "$::env(PXE_TFTP_DIR_BASE)$::env(PXE_TFTP_DIR_OFFSET)"
|
||||
|
||||
# compress ELF
|
||||
set bin_img "[run_dir]/image.bin"
|
||||
exec [cross_dev_prefix]objcopy -O binary $elf_img $bin_img
|
||||
exec gzip --best --force $bin_img
|
||||
|
||||
# create compressed uImage
|
||||
set uboot_img [run_dir]/uImage
|
||||
exec mkimage -A arm -O linux -T kernel -C gzip -a $load_addr \
|
||||
-e $entrypoint -d $bin_img.gz $uboot_img
|
||||
exec rm -rf $bin_img.gz
|
||||
if {[regexp "uboot" $run_target]} {
|
||||
exec ln -sf "[pwd]/[run_dir]/uImage" "$::env(PXE_TFTP_DIR_BASE)$::env(PXE_TFTP_DIR_OFFSET)"
|
||||
}
|
||||
}
|
||||
|
||||
# retrieve stand-alone core
|
||||
exec mv core/core.standalone bin/core
|
||||
exec cp core/core.standalone bin/core
|
||||
exec rm core/core.standalone
|
||||
}
|
||||
|
||||
|
||||
proc run_genode_until {{wait_for_re forever} {timeout_value 0}} {
|
||||
|
||||
if {[target] == "qemu"} { spawn_qemu $wait_for_re $timeout_value
|
||||
} else {
|
||||
puts stderr "Error: Can't execute automatically on target '$target'"
|
||||
puts stderr " Target might be: 'qemu'"
|
||||
exit -1
|
||||
proc run_genode_until {{wait_for_re forever} {timeout_value 0} {running_spawn_id -1}} {
|
||||
#
|
||||
# If a running_spawn_id is specified, wait for the expected output
|
||||
#
|
||||
if {$running_spawn_id != -1} {
|
||||
wait_for_output $wait_for_re $timeout_value $running_spawn_id
|
||||
return
|
||||
}
|
||||
|
||||
#
|
||||
# Try to use one of the supported backends for running the scripts
|
||||
#
|
||||
if {[is_qemu_available]} {
|
||||
spawn_qemu $wait_for_re $timeout_value
|
||||
return
|
||||
}
|
||||
if {[is_serial_available]} {
|
||||
spawn_serial $wait_for_re $timeout_value "Kernel started!"
|
||||
return
|
||||
}
|
||||
|
||||
global run_target
|
||||
puts stderr "Error: Can't execute automatically on target '$run_target'"
|
||||
exit -1
|
||||
}
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/**
|
||||
/*
|
||||
* \brief Genode-console backend
|
||||
* \author Martin Stein
|
||||
* \date 2011-10-17
|
||||
@@ -16,6 +16,9 @@
|
||||
#include <base/printf.h>
|
||||
#include <drivers/serial_log.h>
|
||||
|
||||
/* base-hw includes */
|
||||
#include "singleton.h"
|
||||
|
||||
namespace Genode
|
||||
{
|
||||
/**
|
||||
@@ -63,8 +66,7 @@ using namespace Genode;
|
||||
*/
|
||||
static Platform_console * platform_console()
|
||||
{
|
||||
static Platform_console static_platform_console;
|
||||
return &static_platform_console;
|
||||
return unsynchronized_singleton<Platform_console>();
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -92,15 +92,16 @@ Signal_receiver::Signal_receiver()
|
||||
while (1) {
|
||||
try {
|
||||
_cap = s->alloc_receiver();
|
||||
break;
|
||||
return;
|
||||
} catch (Signal_session::Out_of_metadata)
|
||||
{
|
||||
/* upgrade session quota and try again, but only once */
|
||||
if (session_upgraded) {
|
||||
PDBG("Failed to alloc signal receiver");
|
||||
break;
|
||||
PERR("failed to alloc signal receiver");
|
||||
_cap = Signal_receiver_capability();
|
||||
return;
|
||||
}
|
||||
PINF("upgrading quota donation for Signal session");
|
||||
PINF("upgrading quota donation for SIGNAL session");
|
||||
env()->parent()->upgrade(s->cap(), "ram_quota=4K");
|
||||
session_upgraded = 1;
|
||||
}
|
||||
@@ -115,8 +116,12 @@ void Signal_receiver::_unsynchronized_dissolve(Signal_context * c)
|
||||
* that no delivered but unacked signals of this context exist
|
||||
* in userland anymore.
|
||||
*/
|
||||
Kernel::kill_signal_context(c->_cap.dst());
|
||||
if (!Kernel::kill_signal_context(c->_cap.dst())) {
|
||||
PERR("failed to kill signal context");
|
||||
|
||||
/* we have to keep the signal context alive for other */
|
||||
while (1) ;
|
||||
}
|
||||
/*
|
||||
* Now we can tell core to regain the memory of the
|
||||
* destructed kernel object.
|
||||
@@ -145,20 +150,21 @@ Signal_context_capability Signal_receiver::manage(Signal_context * const c)
|
||||
while (1) {
|
||||
try {
|
||||
c->_cap = s->alloc_context(_cap, (unsigned)c);
|
||||
break;
|
||||
c->_receiver = this;
|
||||
_contexts.insert(&c->_receiver_le);
|
||||
return c->_cap;
|
||||
} catch (Signal_session::Out_of_metadata)
|
||||
{
|
||||
/* upgrade session quota and try again, but only once */
|
||||
PINF("upgrading quota donation for Signal session");
|
||||
if (session_upgraded) return Signal_context_capability();
|
||||
if (session_upgraded) {
|
||||
PERR("failed to alloc signal context");
|
||||
return Signal_context_capability();
|
||||
}
|
||||
PINF("upgrading quota donation for SIGNAL session");
|
||||
env()->parent()->upgrade(s->cap(), "ram_quota=4K");
|
||||
session_upgraded = 1;
|
||||
}
|
||||
}
|
||||
/* assign the context to us */
|
||||
c->_receiver = this;
|
||||
_contexts.insert(&c->_receiver_le);
|
||||
return c->_cap;
|
||||
}
|
||||
|
||||
|
||||
|
||||
53
base-hw/src/base/singleton.h
Normal file
53
base-hw/src/base/singleton.h
Normal file
@@ -0,0 +1,53 @@
|
||||
/*
|
||||
* \brief Helper for creating singleton objects
|
||||
* \author Norman Feske
|
||||
* \date 2013-05-14
|
||||
*
|
||||
* Before enabling the MMU on ARM, the 'cmpxchg' implementation is not always
|
||||
* guaranteed to work. For example, on the Raspberry Pi, the 'ldrex' as used by
|
||||
* 'cmpxchg' causes the machine to reboot. After enabling the MMU, everything
|
||||
* is fine. Hence, we need to avoid executing 'cmpxchg' prior this point.
|
||||
* Unfortunately, 'cmpxchg' is implicitly called each time when creating a
|
||||
* singleton object via a local-static object pattern. In this case, the
|
||||
* compiler generates code that calls the '__cxa_guard_acquire' function of the
|
||||
* C++ runtime, which, in turn, relies 'cmpxchg' for synchronization.
|
||||
*
|
||||
* The utility provided herein is an alternative way to create single object
|
||||
* instances without implicitly calling 'cmpxchg'. Because object creation is
|
||||
* not synchronized via a spin lock, it must not be used in scenarios where
|
||||
* multiple threads may contend.
|
||||
*/
|
||||
|
||||
/*
|
||||
* Copyright (C) 2013 Genode Labs GmbH
|
||||
*
|
||||
* This file is part of the Genode OS framework, which is distributed
|
||||
* under the terms of the GNU General Public License version 2.
|
||||
*/
|
||||
|
||||
#ifndef _SINGLETON_H_
|
||||
#define _SINGLETON_H_
|
||||
|
||||
inline void *operator new(Genode::size_t, void *at) { return at; }
|
||||
|
||||
|
||||
template <typename T, int ALIGN = 2, typename... Args>
|
||||
static inline T *unsynchronized_singleton(Args... args)
|
||||
{
|
||||
/*
|
||||
* Each instantiation of the function template with a different type 'T'
|
||||
* yields a dedicated instance of the local static variables, thereby
|
||||
* creating the living space for the singleton objects.
|
||||
*/
|
||||
static bool initialized;
|
||||
static int inst[sizeof(T)/sizeof(int) + 1] __attribute__((aligned(ALIGN)));
|
||||
|
||||
/* execute constructor on first call */
|
||||
if (!initialized) {
|
||||
initialized = true;
|
||||
new (&inst) T(args...);
|
||||
}
|
||||
return reinterpret_cast<T *>(inst);
|
||||
}
|
||||
|
||||
#endif /* _SINGLETON_H_ */
|
||||
@@ -19,7 +19,7 @@
|
||||
|
||||
using namespace Genode;
|
||||
|
||||
extern Native_utcb * _main_utcb;
|
||||
extern Native_utcb * __initial_sp;
|
||||
|
||||
namespace Genode { Rm_session *env_context_area_rm_session(); }
|
||||
|
||||
@@ -31,7 +31,7 @@ namespace Genode { Rm_session *env_context_area_rm_session(); }
|
||||
Native_utcb * Thread_base::utcb()
|
||||
{
|
||||
/* this is a main thread, so CRT0 provides UTCB through '_main_utcb' */
|
||||
if (!this) return _main_utcb;
|
||||
if (!this) return __initial_sp;
|
||||
|
||||
/* otherwise we have a valid thread base */
|
||||
return &_context->utcb;
|
||||
@@ -99,6 +99,6 @@ void Thread_base::start()
|
||||
}
|
||||
|
||||
|
||||
void Thread_base::cancel_blocking()
|
||||
{ env()->cpu_session()->cancel_blocking(_thread_cap); }
|
||||
void Thread_base::cancel_blocking() {
|
||||
env()->cpu_session()->cancel_blocking(_thread_cap); }
|
||||
|
||||
|
||||
@@ -66,6 +66,7 @@ Native_region * Platform::_core_only_mmio_regions(unsigned const i)
|
||||
static Native_region _regions[] =
|
||||
{
|
||||
{ Board::GIC_CPU_MMIO_BASE, Board::GIC_CPU_MMIO_SIZE },
|
||||
{ Board::MCT_MMIO_BASE, Board::MCT_MMIO_SIZE },
|
||||
};
|
||||
return i < sizeof(_regions)/sizeof(_regions[0]) ? &_regions[i] : 0;
|
||||
}
|
||||
|
||||
@@ -16,24 +16,24 @@
|
||||
|
||||
/* core includes */
|
||||
#include <board.h>
|
||||
#include <timer/exynos_pwm.h>
|
||||
#include <timer/exynos_mct.h>
|
||||
|
||||
namespace Kernel
|
||||
{
|
||||
/**
|
||||
* Kernel timer
|
||||
*/
|
||||
class Timer : public Exynos_pwm::Timer
|
||||
class Timer : public Exynos_mct::Timer
|
||||
{
|
||||
public:
|
||||
|
||||
enum { IRQ = Genode::Board::PWM_IRQ_0 };
|
||||
enum { IRQ = Genode::Board::MCT_IRQ_L0 };
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*/
|
||||
Timer() : Exynos_pwm::Timer(Genode::Board::PWM_MMIO_BASE,
|
||||
Genode::Board::PWM_CLOCK) { }
|
||||
Timer() : Exynos_mct::Timer(Genode::Board::MCT_MMIO_BASE,
|
||||
Genode::Board::MCT_CLOCK) { }
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
28
base-hw/src/core/context_area.cc
Normal file
28
base-hw/src/core/context_area.cc
Normal file
@@ -0,0 +1,28 @@
|
||||
/*
|
||||
* \brief Support code for the thread API
|
||||
* \author Martin Stein
|
||||
* \date 2013-05-07
|
||||
*/
|
||||
|
||||
/*
|
||||
* Copyright (C) 2013 Genode Labs GmbH
|
||||
*
|
||||
* This file is part of the Genode OS framework, which is distributed
|
||||
* under the terms of the GNU General Public License version 2.
|
||||
*/
|
||||
|
||||
/* Genode includes */
|
||||
#include <rm_session/rm_session.h>
|
||||
|
||||
using namespace Genode;
|
||||
|
||||
/**
|
||||
* Return single instance of the context-area RM-session
|
||||
*
|
||||
* In base-hw core this object is never used because contexts
|
||||
* get allocated through the phys-mem allocator. Anyways the
|
||||
* accessor must exist because generic main-thread startup calls
|
||||
* it to ensure that common allocations do not steal context area.
|
||||
*/
|
||||
namespace Genode { Rm_session * env_context_area_rm_session() { return 0; } }
|
||||
|
||||
@@ -18,6 +18,10 @@
|
||||
#include <util/register.h>
|
||||
#include <cpu/cpu_state.h>
|
||||
|
||||
/* local includes */
|
||||
#include <board.h>
|
||||
#include <util.h>
|
||||
|
||||
namespace Arm
|
||||
{
|
||||
using namespace Genode;
|
||||
@@ -465,16 +469,6 @@ namespace Arm
|
||||
uint32_t cidr; /* context ID register backup */
|
||||
uint32_t section_table; /* base address of applied section table */
|
||||
|
||||
/***************
|
||||
** Accessors **
|
||||
***************/
|
||||
|
||||
void tlb(addr_t const st) { section_table = st; }
|
||||
|
||||
addr_t tlb() const { return section_table; }
|
||||
|
||||
void protection_domain(unsigned const id) { cidr = id; }
|
||||
|
||||
/**
|
||||
* Copy CPU state data to 'c'
|
||||
*/
|
||||
@@ -520,6 +514,21 @@ namespace Arm
|
||||
lr = s->lr;
|
||||
ip = s->ip;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get base of assigned translation lookaside buffer
|
||||
*/
|
||||
addr_t tlb() const { return section_table; }
|
||||
|
||||
/**
|
||||
* Assign translation lookaside buffer
|
||||
*/
|
||||
void tlb(addr_t const st) { section_table = st; }
|
||||
|
||||
/**
|
||||
* Assign protection domain
|
||||
*/
|
||||
void protection_domain(unsigned const id) { cidr = id; }
|
||||
};
|
||||
|
||||
/**
|
||||
@@ -553,6 +562,62 @@ namespace Arm
|
||||
unsigned user_arg_6() const { return r6; }
|
||||
unsigned user_arg_7() const { return r7; }
|
||||
|
||||
/**
|
||||
* Part of context init that is common for all types of threads
|
||||
*/
|
||||
void init_thread_common(void * const instr_p,
|
||||
addr_t const tlb,
|
||||
unsigned const pd_id)
|
||||
{
|
||||
ip = (addr_t)instr_p;
|
||||
cidr = pd_id;
|
||||
section_table = tlb;
|
||||
}
|
||||
|
||||
/**
|
||||
* Init context of the first thread of core
|
||||
*/
|
||||
void init_core_main_thread(void * const instr_p,
|
||||
void * const stack_p,
|
||||
addr_t const tlb,
|
||||
unsigned const pd_id)
|
||||
{
|
||||
sp = (addr_t)stack_p;
|
||||
init_thread_common(instr_p, tlb, pd_id);
|
||||
}
|
||||
|
||||
/**
|
||||
* Init context of a thread that isn't first thread of a program
|
||||
*/
|
||||
void init_thread(void * const instr_p,
|
||||
void * const stack_p,
|
||||
addr_t const tlb,
|
||||
unsigned const pd_id)
|
||||
{
|
||||
sp = (addr_t)stack_p;
|
||||
init_thread_common(instr_p, tlb, pd_id);
|
||||
}
|
||||
|
||||
/**
|
||||
* Init context of the first thread of a program other than core
|
||||
*/
|
||||
void init_main_thread(void * const instr_p,
|
||||
void * const utcb_virt,
|
||||
addr_t const tlb,
|
||||
unsigned const pd_id)
|
||||
{
|
||||
/*
|
||||
* Normally threads receive their UTCB pointer through their
|
||||
* 'Thread_base' but the first thread of a program doesn't
|
||||
* have such object. Thus the kernel hands out the UTCB pointer
|
||||
* through the main threads initial CPU context. 'crt0.s' then
|
||||
* can save the received pointer to local mem before polluting
|
||||
* the CPU context.
|
||||
*/
|
||||
sp = (addr_t)utcb_virt;
|
||||
init_thread_common(instr_p, tlb, pd_id);
|
||||
}
|
||||
|
||||
/**
|
||||
* Check if a pagefault has occured due to a translation miss
|
||||
*
|
||||
@@ -637,6 +702,22 @@ namespace Arm
|
||||
asm volatile ("mcr p15, 0, %[rd], c8, c7, 0" :: [rd]"r"(0) : );
|
||||
flush_caches();
|
||||
}
|
||||
|
||||
/*
|
||||
* Clean every data-cache entry within a region via MVA
|
||||
*/
|
||||
static void flush_data_cache_by_virt_region(addr_t base, size_t const size)
|
||||
{
|
||||
enum {
|
||||
CACHE_LINE_SIZE = 1 << Board::CACHE_LINE_SIZE_LOG2,
|
||||
CACHE_LINE_ALIGNM_MASK = ~(CACHE_LINE_SIZE - 1),
|
||||
};
|
||||
addr_t const top = base + size;
|
||||
base = base & CACHE_LINE_ALIGNM_MASK;
|
||||
for (; base < top; base += CACHE_LINE_SIZE)
|
||||
asm volatile ("mcr p15, 0, %[base], c7, c10, 1\n" /* DCCMVAC */
|
||||
:: [base] "r" (base) : );
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
@@ -53,8 +53,8 @@ namespace Arm_v6
|
||||
enum { LITTLE = 0 };
|
||||
};
|
||||
|
||||
struct S : Bitfield<8,1> { }; /* enbale MMU protection */
|
||||
struct R : Bitfield<9,1> { }; /* enbale ROM protection */
|
||||
struct S : Bitfield<8,1> { }; /* enable MMU protection */
|
||||
struct R : Bitfield<9,1> { }; /* enable ROM protection */
|
||||
struct L4 : Bitfield<15,1> { }; /* raise T bit on LOAD-to-PC */
|
||||
struct Dt : Bitfield<16,1> { }; /* global data TCM enable */
|
||||
struct It : Bitfield<18,1> { }; /* global instruction TCM enable */
|
||||
|
||||
@@ -122,7 +122,7 @@ namespace Arm_v7
|
||||
*/
|
||||
struct Ttbr0 : Arm::Cpu::Ttbr0
|
||||
{
|
||||
struct Nos : Bitfield<6,1> { }; /* not outer shareable */
|
||||
struct Nos : Bitfield<5,1> { }; /* not outer shareable */
|
||||
|
||||
struct Irgn_1 : Bitfield<0,1> { }; /* inner cachable mode */
|
||||
struct Irgn_0 : Bitfield<6,1> { }; /* inner cachable mode */
|
||||
|
||||
@@ -20,6 +20,7 @@
|
||||
/* Core includes */
|
||||
#include <platform.h>
|
||||
#include <platform_thread.h>
|
||||
#include <address_space.h>
|
||||
|
||||
namespace Kernel
|
||||
{
|
||||
@@ -34,19 +35,20 @@ namespace Genode
|
||||
/**
|
||||
* Platform specific part of a Genode protection domain
|
||||
*/
|
||||
class Platform_pd
|
||||
class Platform_pd : public Address_space
|
||||
{
|
||||
unsigned _id; /* ID of our kernel object */
|
||||
Native_capability _parent; /* our parent interface */
|
||||
Native_thread_id _main_thread; /* the first thread that gets
|
||||
* executed in this PD */
|
||||
unsigned _id; /* ID of our kernel object */
|
||||
Native_capability _parent; /* our parent interface */
|
||||
Native_thread_id _main_thread; /* the first thread that gets
|
||||
* executed in this PD */
|
||||
char const * const _label; /* PD-connection label */
|
||||
|
||||
public:
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*/
|
||||
Platform_pd() : _main_thread(0)
|
||||
Platform_pd(char const *label) : _main_thread(0), _label(label)
|
||||
{
|
||||
/* get some aligned space for the kernel object */
|
||||
void * kernel_pd;
|
||||
@@ -55,7 +57,7 @@ namespace Genode
|
||||
Kernel::pd_alignm_log2()).is_ok())
|
||||
|
||||
/* create kernel object */
|
||||
_id = Kernel::new_pd(kernel_pd);
|
||||
_id = Kernel::new_pd(kernel_pd, this);
|
||||
assert(_id);
|
||||
}
|
||||
|
||||
@@ -77,9 +79,9 @@ namespace Genode
|
||||
{
|
||||
/* annotate that we've got a main thread from now on */
|
||||
_main_thread = t->id();
|
||||
return t->join_pd(_id, 1);
|
||||
return t->join_pd(_id, 1, Address_space::weak_ptr());
|
||||
}
|
||||
return t->join_pd(_id, 0);
|
||||
return t->join_pd(_id, 0, Address_space::weak_ptr());
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -98,6 +100,20 @@ namespace Genode
|
||||
_parent = parent;
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
/***************
|
||||
** Accessors **
|
||||
***************/
|
||||
|
||||
char const * const label() { return _label; }
|
||||
|
||||
|
||||
/*****************************
|
||||
** Address-space interface **
|
||||
*****************************/
|
||||
|
||||
void flush(addr_t, size_t) { PDBG("not implemented"); }
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
@@ -24,6 +24,7 @@
|
||||
|
||||
/* core includes */
|
||||
#include <assert.h>
|
||||
#include <address_space.h>
|
||||
|
||||
namespace Genode {
|
||||
|
||||
@@ -43,9 +44,9 @@ namespace Genode {
|
||||
Thread_base * _thread_base;
|
||||
size_t _stack_size;
|
||||
unsigned _pd_id;
|
||||
Weak_ptr<Address_space> _address_space;
|
||||
unsigned _id;
|
||||
Rm_client * _rm_client;
|
||||
bool _main_thread;
|
||||
Native_utcb * _phys_utcb;
|
||||
Native_utcb * _virt_utcb;
|
||||
Tlb * _tlb;
|
||||
@@ -53,6 +54,16 @@ namespace Genode {
|
||||
char _name[NAME_MAX_LEN];
|
||||
char _kernel_thread[sizeof(Kernel::Thread)];
|
||||
|
||||
/*
|
||||
* Wether this thread is the main thread of a program.
|
||||
* This should be used only after 'join_pd' was called
|
||||
* or if this is a core thread. For core threads its save
|
||||
* also without 'join_pd' because '_main_thread' is initialized
|
||||
* with 0 wich is always true as cores main thread has no
|
||||
* 'Platform_thread'.
|
||||
*/
|
||||
bool _main_thread;
|
||||
|
||||
/**
|
||||
* Common construction part
|
||||
*/
|
||||
@@ -91,7 +102,8 @@ namespace Genode {
|
||||
* \retval 0 on success
|
||||
* \retval <0 otherwise
|
||||
*/
|
||||
int join_pd(unsigned const pd_id, bool const main_thread);
|
||||
int join_pd(unsigned const pd_id, bool const main_thread,
|
||||
Weak_ptr<Address_space> address_space);
|
||||
|
||||
/**
|
||||
* Run this thread
|
||||
@@ -139,8 +151,17 @@ namespace Genode {
|
||||
/**
|
||||
* Set the executing CPU for this thread
|
||||
*/
|
||||
void affinity(unsigned cpu) {
|
||||
kernel_log() << __PRETTY_FUNCTION__ << ": not implemented\n"; };
|
||||
void affinity(Affinity::Location) { }
|
||||
|
||||
/**
|
||||
* Get the executing CPU for this thread
|
||||
*/
|
||||
Affinity::Location affinity() { return Affinity::Location(); };
|
||||
|
||||
/**
|
||||
* Return the address space to which the thread is bound
|
||||
*/
|
||||
Weak_ptr<Address_space> address_space();
|
||||
|
||||
|
||||
/***************
|
||||
@@ -161,7 +182,7 @@ namespace Genode {
|
||||
|
||||
Thread_base * thread_base()
|
||||
{
|
||||
if (!_thread_base) assert(_main_thread);
|
||||
if (!_thread_base) assert(main_thread());
|
||||
return _thread_base;
|
||||
}
|
||||
|
||||
@@ -171,6 +192,8 @@ namespace Genode {
|
||||
|
||||
Ram_dataspace_capability utcb() const { return _utcb; }
|
||||
|
||||
bool main_thread() const { return _main_thread; }
|
||||
|
||||
Tlb * tlb() const { return _tlb; }
|
||||
};
|
||||
}
|
||||
|
||||
@@ -16,6 +16,7 @@
|
||||
|
||||
/* Genode includes */
|
||||
#include <root/component.h>
|
||||
#include <kernel/syscalls.h>
|
||||
|
||||
/* core includes */
|
||||
#include <signal_session_component.h>
|
||||
@@ -75,6 +76,22 @@ namespace Genode
|
||||
{
|
||||
size_t ram_quota =
|
||||
Arg_string::find_arg(args, "ram_quota").long_value(0);
|
||||
|
||||
/*
|
||||
* FIXME
|
||||
* We check these assertions because space for initial SLAB
|
||||
* blocks can be scaled pragmatically only via
|
||||
* RECEIVERS_SLAB_BLOCK_SIZE and CONTEXTS_SLAB_BLOCK_SIZE
|
||||
* (array size can't come from a function)
|
||||
*/
|
||||
if (Signal_session_component::RECEIVERS_SB_SIZE <
|
||||
32 * Kernel::signal_receiver_size() ||
|
||||
Signal_session_component::CONTEXTS_SB_SIZE <
|
||||
32 * Kernel::signal_context_size())
|
||||
{
|
||||
PERR("Undersized SLAB blocks");
|
||||
throw Root::Exception();
|
||||
}
|
||||
return new (md_alloc())
|
||||
Signal_session_component(md_alloc(), ram_quota);
|
||||
}
|
||||
|
||||
@@ -27,9 +27,20 @@ namespace Genode
|
||||
*/
|
||||
class Signal_session_component : public Rpc_object<Signal_session>
|
||||
{
|
||||
Allocator_guard _md_alloc; /* Metadata allocator */
|
||||
Slab _receivers_slab; /* SLAB to allocate receiver kernel-objects */
|
||||
Slab _contexts_slab; /* SLAB to allocate context kernel-objects */
|
||||
public:
|
||||
|
||||
enum {
|
||||
RECEIVERS_SB_SIZE = 4096,
|
||||
CONTEXTS_SB_SIZE = 4096,
|
||||
};
|
||||
|
||||
private:
|
||||
|
||||
Allocator_guard _md_alloc;
|
||||
Slab _receivers_slab;
|
||||
Slab _contexts_slab;
|
||||
char _initial_receivers_sb [RECEIVERS_SB_SIZE];
|
||||
char _initial_contexts_sb [CONTEXTS_SB_SIZE];
|
||||
|
||||
public:
|
||||
|
||||
|
||||
@@ -67,6 +67,7 @@ namespace Genode {
|
||||
Dataspace_capability cpu_state(void) { return _ds_cap; }
|
||||
void exception_handler(Signal_context_capability handler);
|
||||
void run(void);
|
||||
void pause(void);
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
@@ -29,9 +29,13 @@
|
||||
|
||||
/* core includes */
|
||||
#include <platform_thread.h>
|
||||
#include <platform_pd.h>
|
||||
#include <tlb.h>
|
||||
#include <trustzone.h>
|
||||
|
||||
/* base-hw includes */
|
||||
#include <singleton.h>
|
||||
|
||||
using namespace Kernel;
|
||||
|
||||
/* get core configuration */
|
||||
@@ -56,6 +60,14 @@ namespace Kernel
|
||||
}
|
||||
|
||||
|
||||
void Kernel::Ipc_node::cancel_waiting()
|
||||
{
|
||||
if (_state == PREPARE_AND_AWAIT_REPLY) _state = PREPARE_REPLY;
|
||||
if (_state == AWAIT_REPLY || _state == AWAIT_REQUEST) _state = INACTIVE;
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
void Kernel::Ipc_node::_receive_request(Message_buf * const r)
|
||||
{
|
||||
/* assertions */
|
||||
@@ -75,9 +87,11 @@ void Kernel::Ipc_node::_receive_request(Message_buf * const r)
|
||||
void Kernel::Ipc_node::_receive_reply(void * const base, size_t const size)
|
||||
{
|
||||
/* assertions */
|
||||
assert(_awaits_reply());
|
||||
assert(size <= _inbuf.size);
|
||||
|
||||
if (!_awaits_reply()) {
|
||||
PDBG("discard unexpected IPC reply");
|
||||
return;
|
||||
}
|
||||
/* receive reply */
|
||||
Genode::memcpy(_inbuf.base, base, size);
|
||||
_inbuf.size = size;
|
||||
@@ -261,14 +275,15 @@ namespace Kernel
|
||||
* Static mode transition control
|
||||
*/
|
||||
static Mode_transition_control * mtc()
|
||||
{ static Mode_transition_control _object; return &_object; }
|
||||
{ return unsynchronized_singleton<Mode_transition_control>(); }
|
||||
|
||||
/**
|
||||
* Kernel object that represents a Genode PD
|
||||
*/
|
||||
class Pd : public Object<Pd, MAX_PDS>
|
||||
{
|
||||
Tlb * const _tlb;
|
||||
Tlb * const _tlb;
|
||||
Platform_pd * const _platform_pd;
|
||||
|
||||
/* keep ready memory for size aligned extra costs at construction */
|
||||
enum { EXTRA_SPACE_SIZE = 2*Tlb::MAX_COSTS_PER_TRANSLATION };
|
||||
@@ -279,7 +294,8 @@ namespace Kernel
|
||||
/**
|
||||
* Constructor
|
||||
*/
|
||||
Pd(Tlb * const t) : _tlb(t)
|
||||
Pd(Tlb * const t, Platform_pd * const platform_pd)
|
||||
: _tlb(t), _platform_pd(platform_pd)
|
||||
{
|
||||
/* try to add translation for mode transition region */
|
||||
Page_flags::access_t const flags = Page_flags::mode_transition();
|
||||
@@ -322,14 +338,15 @@ namespace Kernel
|
||||
** Accessors **
|
||||
***************/
|
||||
|
||||
Tlb * tlb() { return _tlb; }
|
||||
Tlb * const tlb() { return _tlb; }
|
||||
Platform_pd * const platform_pd() { return _platform_pd; }
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* Access to static interrupt-controller
|
||||
*/
|
||||
static Pic * pic() { static Pic _object; return &_object; }
|
||||
static Pic * pic() { return unsynchronized_singleton<Pic>(); }
|
||||
}
|
||||
|
||||
|
||||
@@ -366,6 +383,10 @@ void Kernel::Irq_owner::await_irq()
|
||||
}
|
||||
|
||||
|
||||
void Kernel::Irq_owner::cancel_waiting() {
|
||||
if (_id) pic()->mask(id_to_irq(_id)); }
|
||||
|
||||
|
||||
void Kernel::Irq_owner::receive_irq(unsigned const irq)
|
||||
{
|
||||
assert(_id == irq_to_id(irq));
|
||||
@@ -403,9 +424,11 @@ namespace Kernel
|
||||
*/
|
||||
static Pd * core()
|
||||
{
|
||||
static Core_tlb tlb;
|
||||
static Pd _pd(&tlb);
|
||||
return &_pd;
|
||||
constexpr int tlb_align = 1 << Core_tlb::ALIGNM_LOG2;
|
||||
|
||||
Core_tlb *core_tlb = unsynchronized_singleton<Core_tlb, tlb_align>();
|
||||
Pd *pd = unsynchronized_singleton<Pd>(core_tlb, nullptr);
|
||||
return pd;
|
||||
}
|
||||
|
||||
|
||||
@@ -424,16 +447,16 @@ namespace Kernel
|
||||
}
|
||||
|
||||
|
||||
void Kernel::Thread::_activate()
|
||||
void Kernel::Thread::_schedule()
|
||||
{
|
||||
cpu_scheduler()->insert(this);
|
||||
_state = ACTIVE;
|
||||
_state = SCHEDULED;
|
||||
}
|
||||
|
||||
|
||||
void Kernel::Thread::pause()
|
||||
{
|
||||
assert(_state == AWAIT_RESUMPTION || _state == ACTIVE);
|
||||
assert(_state == AWAIT_RESUMPTION || _state == SCHEDULED);
|
||||
cpu_scheduler()->remove(this);
|
||||
_state = AWAIT_RESUMPTION;
|
||||
}
|
||||
@@ -442,20 +465,7 @@ void Kernel::Thread::pause()
|
||||
void Kernel::Thread::stop()
|
||||
{
|
||||
cpu_scheduler()->remove(this);
|
||||
_state = STOPPED;
|
||||
}
|
||||
|
||||
|
||||
int Kernel::Thread::resume()
|
||||
{
|
||||
if (_state != AWAIT_RESUMPTION && _state != ACTIVE) {
|
||||
PDBG("Unexpected thread state");
|
||||
return -1;
|
||||
}
|
||||
cpu_scheduler()->insert(this);
|
||||
if (_state == ACTIVE) return 1;
|
||||
_state = ACTIVE;
|
||||
return 0;
|
||||
_state = AWAIT_START;
|
||||
}
|
||||
|
||||
|
||||
@@ -480,17 +490,25 @@ void Kernel::Thread::reply(size_t const size, bool const await_request)
|
||||
}
|
||||
|
||||
|
||||
void Kernel::Thread::await_signal()
|
||||
void Kernel::Thread::await_signal(Kernel::Signal_receiver * receiver)
|
||||
{
|
||||
cpu_scheduler()->remove(this);
|
||||
_state = AWAIT_IRQ;
|
||||
_state = AWAIT_SIGNAL;
|
||||
_signal_receiver = receiver;
|
||||
}
|
||||
|
||||
|
||||
void Kernel::Thread::received_signal()
|
||||
{
|
||||
assert(_state == AWAIT_SIGNAL);
|
||||
_schedule();
|
||||
}
|
||||
|
||||
|
||||
void Kernel::Thread::_received_irq()
|
||||
{
|
||||
assert(_state == AWAIT_IRQ);
|
||||
_activate();
|
||||
_schedule();
|
||||
}
|
||||
|
||||
|
||||
@@ -524,7 +542,7 @@ void Kernel::Thread::scheduled_next()
|
||||
void Kernel::Thread::_has_received(size_t const s)
|
||||
{
|
||||
user_arg_0(s);
|
||||
if (_state != ACTIVE) _activate();
|
||||
if (_state != SCHEDULED) _schedule();
|
||||
}
|
||||
|
||||
|
||||
@@ -589,16 +607,19 @@ namespace Kernel
|
||||
|
||||
/**
|
||||
* Destruct or prepare to do it at next call of 'ack'
|
||||
*
|
||||
* \return wether destruction is done
|
||||
*/
|
||||
void kill(Thread * const killer)
|
||||
bool kill(Thread * const killer)
|
||||
{
|
||||
assert(!_killer);
|
||||
_killer = killer;
|
||||
if (_await_ack) {
|
||||
_killer->kill_signal_context_blocks();
|
||||
return;
|
||||
return 0;
|
||||
}
|
||||
this->~Signal_context();
|
||||
return 1;
|
||||
}
|
||||
};
|
||||
|
||||
@@ -646,11 +667,17 @@ namespace Kernel
|
||||
*/
|
||||
void add_listener(Thread * const t)
|
||||
{
|
||||
t->await_signal();
|
||||
t->await_signal(this);
|
||||
_listeners.enqueue(t);
|
||||
_listen();
|
||||
}
|
||||
|
||||
/**
|
||||
* Stop a thread from listening to our contexts
|
||||
*/
|
||||
void remove_listener(Thread * const t) {
|
||||
_listeners.remove(t); }
|
||||
|
||||
/**
|
||||
* If any of our contexts is pending
|
||||
*/
|
||||
@@ -687,8 +714,13 @@ namespace Kernel
|
||||
Signal_context * const context)
|
||||
: _state(state), _context(context) { }
|
||||
|
||||
void run() {
|
||||
cpu_scheduler()->insert(this); }
|
||||
|
||||
/**************************
|
||||
** Vm_session interface **
|
||||
**************************/
|
||||
|
||||
void run() { cpu_scheduler()->insert(this); }
|
||||
void pause() { cpu_scheduler()->remove(this); }
|
||||
|
||||
|
||||
/**********************
|
||||
@@ -734,7 +766,15 @@ namespace Kernel
|
||||
/* initialize idle thread */
|
||||
void * sp;
|
||||
sp = (void *)&idle_stack[sizeof(idle_stack)/sizeof(idle_stack[0])];
|
||||
idle.init_context((void *)&idle_main, sp, core_id());
|
||||
|
||||
/*
|
||||
* Idle doesn't use its UTCB pointer, thus
|
||||
* utcb_phys = utcb_virt = 0 is save.
|
||||
* Base-hw doesn't support multiple cores, thus
|
||||
* cpu_no = 0 is ok. We don't use 'start' to avoid
|
||||
* recursive call of'cpu_scheduler'.
|
||||
*/
|
||||
idle.prepare_to_start((void *)&idle_main, sp, 0, core_id(), 0, 0);
|
||||
initial = 0;
|
||||
}
|
||||
/* create scheduler with a permanent idle thread */
|
||||
@@ -833,7 +873,7 @@ namespace Kernel
|
||||
void * dst = (void *)user->user_arg_1();
|
||||
Tlb * const tlb = new (dst) Tlb();
|
||||
dst = (void *)((addr_t)dst + sizeof(Tlb));
|
||||
Pd * const pd = new (dst) Pd(tlb);
|
||||
Pd * const pd = new (dst) Pd(tlb, (Platform_pd *)user->user_arg_2());
|
||||
|
||||
/* return success */
|
||||
user->user_arg_0(pd->id());
|
||||
@@ -897,8 +937,7 @@ namespace Kernel
|
||||
assert(t);
|
||||
|
||||
/* start thread */
|
||||
assert(!t->start(ip, sp, cpu, pt->pd_id(),
|
||||
pt->phys_utcb(), pt->virt_utcb()))
|
||||
t->start(ip, sp, cpu, pt->pd_id(), pt->phys_utcb(), pt->virt_utcb());
|
||||
|
||||
/* return software TLB that the thread is assigned to */
|
||||
Pd::Pool * const pp = Pd::pool();
|
||||
@@ -1078,6 +1117,19 @@ namespace Kernel
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Do specific syscall for 'user', for details see 'syscall.h'
|
||||
*/
|
||||
void do_update_region(Thread * const user)
|
||||
{
|
||||
assert(user->pd_id() == core_id());
|
||||
|
||||
/* FIXME we don't handle instruction caches by now */
|
||||
Cpu::flush_data_cache_by_virt_region((addr_t)user->user_arg_1(),
|
||||
(size_t)user->user_arg_2());
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Do specific syscall for 'user', for details see 'syscall.h'
|
||||
*/
|
||||
@@ -1252,7 +1304,7 @@ namespace Kernel
|
||||
Signal_context * const c =
|
||||
Signal_context::pool()->object(user->user_arg_1());
|
||||
assert(c);
|
||||
c->kill(user);
|
||||
user->user_arg_0(c->kill(user));
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -1296,6 +1348,23 @@ namespace Kernel
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Do specific syscall for 'user', for details see 'syscall.h'
|
||||
*/
|
||||
void do_pause_vm(Thread * const user)
|
||||
{
|
||||
/* check permissions */
|
||||
assert(user->pd_id() == core_id());
|
||||
|
||||
/* get targeted vm via its id */
|
||||
Vm * const vm = Vm::pool()->object(user->user_arg_1());
|
||||
assert(vm);
|
||||
|
||||
/* pause targeted vm */
|
||||
vm->pause();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Handle a syscall request
|
||||
*
|
||||
@@ -1340,6 +1409,8 @@ namespace Kernel
|
||||
/* 28 */ do_resume_faulter,
|
||||
/* 29 */ do_ack_signal,
|
||||
/* 30 */ do_kill_signal_context,
|
||||
/* 31 */ do_pause_vm,
|
||||
/* 32 */ do_update_region,
|
||||
};
|
||||
enum { MAX_SYSCALL = sizeof(handle_sysc)/sizeof(handle_sysc[0]) - 1 };
|
||||
|
||||
@@ -1377,6 +1448,8 @@ extern "C" void kernel()
|
||||
/* kernel initialization */
|
||||
} else {
|
||||
|
||||
Genode::printf("Kernel started!\n");
|
||||
|
||||
/* compose kernel CPU context */
|
||||
static Cpu::Context kernel_context;
|
||||
kernel_context.ip = (addr_t)kernel;
|
||||
@@ -1394,6 +1467,12 @@ extern "C" void kernel()
|
||||
/* switch to core address space */
|
||||
Cpu::init_virt_kernel(core()->tlb()->base(), core_id());
|
||||
|
||||
/*
|
||||
* From this point on, it is safe to use 'cmpxchg', i.e., to create
|
||||
* singleton objects via the static-local object pattern. See
|
||||
* the comment in 'src/base/singleton.h'.
|
||||
*/
|
||||
|
||||
/* create the core main thread */
|
||||
static Native_utcb cm_utcb;
|
||||
static char cm_stack[DEFAULT_STACK_SIZE]
|
||||
@@ -1424,42 +1503,84 @@ extern "C" void kernel()
|
||||
** Kernel::Thread **
|
||||
********************/
|
||||
|
||||
int Thread::start(void *ip, void *sp, unsigned cpu_no,
|
||||
unsigned const pd_id,
|
||||
Native_utcb * const phys_utcb,
|
||||
Native_utcb * const virt_utcb)
|
||||
int Kernel::Thread::resume()
|
||||
{
|
||||
/* check state and arguments */
|
||||
assert(_state == STOPPED)
|
||||
assert(!cpu_no);
|
||||
|
||||
/* apply thread configuration */
|
||||
init_context(ip, sp, pd_id);
|
||||
_phys_utcb = phys_utcb;
|
||||
_virt_utcb = virt_utcb;
|
||||
|
||||
/* offer thread-entry arguments */
|
||||
user_arg_0((unsigned)_virt_utcb);
|
||||
|
||||
/* start thread */
|
||||
_activate();
|
||||
return 0;
|
||||
switch (_state) {
|
||||
case AWAIT_RESUMPTION:
|
||||
_schedule();
|
||||
return 0;
|
||||
case SCHEDULED:
|
||||
return 1;
|
||||
case AWAIT_IPC:
|
||||
PDBG("cancel IPC receipt");
|
||||
Ipc_node::cancel_waiting();
|
||||
_schedule();
|
||||
return 0;
|
||||
case AWAIT_IRQ:
|
||||
PDBG("cancel IRQ receipt");
|
||||
Irq_owner::cancel_waiting();
|
||||
_schedule();
|
||||
return 0;
|
||||
case AWAIT_SIGNAL:
|
||||
PDBG("cancel signal receipt");
|
||||
_signal_receiver->remove_listener(this);
|
||||
_schedule();
|
||||
return 0;
|
||||
case AWAIT_SIGNAL_CONTEXT_DESTRUCT:
|
||||
PDBG("cancel signal context destruction");
|
||||
_schedule();
|
||||
return 0;
|
||||
case AWAIT_START:
|
||||
default:
|
||||
PERR("unresumable state");
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void Thread::init_context(void * const instr_p, void * const stack_p,
|
||||
unsigned const pd_id)
|
||||
void Thread::prepare_to_start(void * const ip,
|
||||
void * const sp,
|
||||
unsigned const cpu_id,
|
||||
unsigned const pd_id,
|
||||
Native_utcb * const utcb_phys,
|
||||
Native_utcb * const utcb_virt)
|
||||
{
|
||||
/* basic thread state */
|
||||
sp = (addr_t)stack_p;
|
||||
ip = (addr_t)instr_p;
|
||||
/* check state and arguments */
|
||||
assert(_state == AWAIT_START)
|
||||
assert(!cpu_id);
|
||||
|
||||
/* join a pd */
|
||||
_pd_id = pd_id;
|
||||
/* store thread parameters */
|
||||
_phys_utcb = utcb_phys;
|
||||
_virt_utcb = utcb_virt;
|
||||
_pd_id = pd_id;
|
||||
|
||||
/* join a protection domain */
|
||||
Pd * const pd = Pd::pool()->object(_pd_id);
|
||||
assert(pd)
|
||||
protection_domain(pd_id);
|
||||
tlb(pd->tlb()->base());
|
||||
addr_t const tlb = pd->tlb()->base();
|
||||
|
||||
/* initialize CPU context */
|
||||
if (!_platform_thread)
|
||||
/* this is the main thread of core */
|
||||
User_context::init_core_main_thread(ip, sp, tlb, pd_id);
|
||||
else if (!_platform_thread->main_thread())
|
||||
/* this is not a main thread */
|
||||
User_context::init_thread(ip, sp, tlb, pd_id);
|
||||
else
|
||||
/* this is the main thread of a program other than core */
|
||||
User_context::init_main_thread(ip, _virt_utcb, tlb, pd_id);
|
||||
}
|
||||
|
||||
|
||||
void Thread::start(void * const ip,
|
||||
void * const sp,
|
||||
unsigned const cpu_id,
|
||||
unsigned const pd_id,
|
||||
Native_utcb * const utcb_phys,
|
||||
Native_utcb * const utcb_virt)
|
||||
{
|
||||
prepare_to_start(ip, sp, cpu_id, pd_id, utcb_phys, utcb_virt);
|
||||
_schedule();
|
||||
}
|
||||
|
||||
|
||||
@@ -1479,14 +1600,18 @@ void Thread::pagefault(addr_t const va, bool const w)
|
||||
void Thread::kill_signal_context_blocks()
|
||||
{
|
||||
cpu_scheduler()->remove(this);
|
||||
_state = KILL_SIGNAL_CONTEXT_BLOCKS;
|
||||
_state = AWAIT_SIGNAL_CONTEXT_DESTRUCT;
|
||||
}
|
||||
|
||||
|
||||
void Thread::kill_signal_context_done()
|
||||
{
|
||||
assert(_state == KILL_SIGNAL_CONTEXT_BLOCKS)
|
||||
_activate();
|
||||
if (_state != AWAIT_SIGNAL_CONTEXT_DESTRUCT) {
|
||||
PDBG("ignore unexpected signal-context destruction");
|
||||
return;
|
||||
}
|
||||
user_arg_0(1);
|
||||
_schedule();
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -25,6 +25,9 @@
|
||||
#include <timer.h>
|
||||
#include <assert.h>
|
||||
|
||||
/* base-hw includes */
|
||||
#include <singleton.h>
|
||||
|
||||
namespace Genode
|
||||
{
|
||||
class Platform_thread;
|
||||
@@ -211,8 +214,7 @@ namespace Kernel
|
||||
*/
|
||||
static Id_alloc * _id_alloc()
|
||||
{
|
||||
static Id_alloc _id_alloc;
|
||||
return &_id_alloc;
|
||||
return unsynchronized_singleton<Id_alloc>();
|
||||
}
|
||||
|
||||
public:
|
||||
@@ -224,8 +226,7 @@ namespace Kernel
|
||||
*/
|
||||
static Pool * pool()
|
||||
{
|
||||
static Pool _pool;
|
||||
return &_pool;
|
||||
return unsynchronized_singleton<Pool>();
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -531,23 +532,26 @@ namespace Kernel
|
||||
* IPC node states:
|
||||
*
|
||||
* +----------+ +---------------+ +---------------+
|
||||
* --new-->| inactive |--send-request-await-reply---->| await reply | +--send-note--| prepare reply |
|
||||
* --new-->| inactive |---send-request-await-reply--->| await reply | +--send-note--| prepare reply |
|
||||
* | |<--receive-reply---------------| | | | |
|
||||
* | |<--cancel-waiting--------------| | | | |
|
||||
* | | +---------------+ +------------>| |
|
||||
* | |<--request-is-a-note-------+---request-is-not-a-note------------------------>| |
|
||||
* | |<--------------------------(---not-await-request-----+ | |
|
||||
* | | | +---------------+ | | |
|
||||
* | |--await-request------------+-->| await request |<----+--send-reply-----------| |
|
||||
* | |--send-reply---------+-----+-->| |--announce-request-+-------->| |
|
||||
* | |--send-note--+ | | +---------------+ | | |
|
||||
* | | | | request available | | |
|
||||
* | |<------------+ | | | | |
|
||||
* | |<--not-await-request-+ | | | |
|
||||
* | |<--request-is-a-note-------+---request-is-not-a-note---------------|-------->| |
|
||||
* | |<--request-is-a-note-----------------------------------------------+ | |
|
||||
* | |<--------------------------(---not-await-request---+ | |
|
||||
* | | | +---------------+ | | |
|
||||
* | |---await-request-----------+-->| await request |<--+--send-reply-------------| |
|
||||
* | |<--cancel-waiting--------------| |------announce-request--+--->| |
|
||||
* | |---send-reply---------+----+-->| | | | |
|
||||
* | |---send-note--+ | | +---------------+ | | |
|
||||
* | | | | | | | |
|
||||
* | |<-------------+ | request available | | |
|
||||
* | |<--not-await-request--+ | | | |
|
||||
* | |<--request-is-a-note-------+-------------------request-is-not-a-note----(--->| |
|
||||
* | |<--request-is-a-note----------------------------------------------------+ | |
|
||||
* +----------+ +-------------------------+ | |
|
||||
* | prepare and await reply |<--send-request-and-await-reply--| |
|
||||
* | |--receive-reply----------------->| |
|
||||
* | |---receive-reply---------------->| |
|
||||
* | |---cancel-waiting--------------->| |
|
||||
* +-------------------------+ +---------------+
|
||||
*
|
||||
* State model propagated to deriving classes:
|
||||
@@ -564,6 +568,7 @@ namespace Kernel
|
||||
* | |<--request-available-or-not-await-request--+ | |
|
||||
* | |<--announce-request----------------------------| |
|
||||
* | |<--receive-reply-------------------------------| |
|
||||
* | |<--cancel-waiting------------------------------| |
|
||||
* +--------------+ +----------------+
|
||||
*/
|
||||
class Ipc_node
|
||||
@@ -592,9 +597,9 @@ namespace Kernel
|
||||
|
||||
Fifo<Message_buf> _request_queue; /* requests that waits to be
|
||||
* received by us */
|
||||
Message_buf _inbuf; /* buffers message we have received lastly */
|
||||
Message_buf _inbuf; /* buffers message we have received lastly */
|
||||
Message_buf _outbuf; /* buffers the message we aim to send */
|
||||
State _state; /* current node state */
|
||||
State _state; /* current node state */
|
||||
|
||||
/**
|
||||
* Buffer next request from request queue in 'r' to handle it
|
||||
@@ -689,6 +694,11 @@ namespace Kernel
|
||||
void send_note(Ipc_node * const dest,
|
||||
void * const note_base,
|
||||
size_t const note_size);
|
||||
|
||||
/**
|
||||
* Stop waiting for a receipt if in a waiting state
|
||||
*/
|
||||
void cancel_waiting();
|
||||
};
|
||||
|
||||
/**
|
||||
@@ -753,6 +763,11 @@ namespace Kernel
|
||||
*/
|
||||
void await_irq();
|
||||
|
||||
/**
|
||||
* Stop waiting for an IRQ if in a waiting state
|
||||
*/
|
||||
void cancel_waiting();
|
||||
|
||||
/**
|
||||
* Denote occurence of an IRQ if we own it and awaited it
|
||||
*/
|
||||
@@ -774,8 +789,16 @@ namespace Kernel
|
||||
public Ipc_node,
|
||||
public Irq_owner
|
||||
{
|
||||
enum State { STOPPED, ACTIVE, AWAIT_IPC, AWAIT_RESUMPTION,
|
||||
AWAIT_IRQ, AWAIT_SIGNAL, KILL_SIGNAL_CONTEXT_BLOCKS };
|
||||
enum State
|
||||
{
|
||||
SCHEDULED,
|
||||
AWAIT_START,
|
||||
AWAIT_IPC,
|
||||
AWAIT_RESUMPTION,
|
||||
AWAIT_IRQ,
|
||||
AWAIT_SIGNAL,
|
||||
AWAIT_SIGNAL_CONTEXT_DESTRUCT,
|
||||
};
|
||||
|
||||
Platform_thread * const _platform_thread; /* userland object wich
|
||||
* addresses this thread */
|
||||
@@ -785,11 +808,13 @@ namespace Kernel
|
||||
unsigned _pd_id; /* ID of the PD this thread runs on */
|
||||
Native_utcb * _phys_utcb; /* physical UTCB base */
|
||||
Native_utcb * _virt_utcb; /* virtual UTCB base */
|
||||
Signal_receiver * _signal_receiver; /* receiver we are currently
|
||||
* listen to */
|
||||
|
||||
/**
|
||||
* Resume execution
|
||||
*/
|
||||
void _activate();
|
||||
void _schedule();
|
||||
|
||||
|
||||
/**************
|
||||
@@ -805,7 +830,7 @@ namespace Kernel
|
||||
** Irq_owner **
|
||||
***************/
|
||||
|
||||
void _received_irq() { _activate(); }
|
||||
void _received_irq();
|
||||
|
||||
void _awaits_irq();
|
||||
|
||||
@@ -818,23 +843,43 @@ namespace Kernel
|
||||
*/
|
||||
Thread(Platform_thread * const platform_thread) :
|
||||
_platform_thread(platform_thread),
|
||||
_state(STOPPED), _pager(0), _pd_id(0),
|
||||
_phys_utcb(0), _virt_utcb(0)
|
||||
_state(AWAIT_START), _pager(0), _pd_id(0),
|
||||
_phys_utcb(0), _virt_utcb(0), _signal_receiver(0)
|
||||
{ }
|
||||
|
||||
/**
|
||||
* Prepare thread to get scheduled the first time
|
||||
*
|
||||
* \param ip initial instruction pointer
|
||||
* \param sp initial stack pointer
|
||||
* \param cpu_id target cpu
|
||||
* \param pd_id target protection-domain
|
||||
* \param utcb_phys physical UTCB pointer
|
||||
* \param utcb_virt virtual UTCB pointer
|
||||
*/
|
||||
void prepare_to_start(void * const ip,
|
||||
void * const sp,
|
||||
unsigned const cpu_id,
|
||||
unsigned const pd_id,
|
||||
Native_utcb * const utcb_phys,
|
||||
Native_utcb * const utcb_virt);
|
||||
|
||||
/**
|
||||
* Start this thread
|
||||
*
|
||||
* \param ip instruction pointer to start at
|
||||
* \param sp stack pointer to use
|
||||
* \param cpu_no target cpu
|
||||
*
|
||||
* \retval 0 successful
|
||||
* \retval -1 thread could not be started
|
||||
* \param ip initial instruction pointer
|
||||
* \param sp initial stack pointer
|
||||
* \param cpu_id target cpu
|
||||
* \param pd_id target protection-domain
|
||||
* \param utcb_phys physical UTCB pointer
|
||||
* \param utcb_virt virtual UTCB pointer
|
||||
*/
|
||||
int start(void *ip, void *sp, unsigned cpu_no,
|
||||
unsigned const pd_id, Native_utcb * const phys_utcb,
|
||||
Native_utcb * const virt_utcb);
|
||||
void start(void * const ip,
|
||||
void * const sp,
|
||||
unsigned const cpu_id,
|
||||
unsigned const pd_id,
|
||||
Native_utcb * const utcb_phys,
|
||||
Native_utcb * const utcb_virt);
|
||||
|
||||
/**
|
||||
* Pause this thread
|
||||
@@ -866,16 +911,6 @@ namespace Kernel
|
||||
*/
|
||||
void reply(size_t const size, bool const await_request);
|
||||
|
||||
/**
|
||||
* Initialize our execution context
|
||||
*
|
||||
* \param ip instruction pointer
|
||||
* \param sp stack pointer
|
||||
* \param pd_id identifies protection domain we're assigned to
|
||||
*/
|
||||
void init_context(void * const ip, void * const sp,
|
||||
unsigned const pd_id);
|
||||
|
||||
/**
|
||||
* Handle a pagefault that originates from this thread
|
||||
*
|
||||
@@ -890,9 +925,9 @@ namespace Kernel
|
||||
unsigned id() const { return Object::id(); }
|
||||
|
||||
/**
|
||||
* Gets called when we await a signal at a signal receiver
|
||||
* Gets called when we await a signal at 'receiver'
|
||||
*/
|
||||
void await_signal();
|
||||
void await_signal(Kernel::Signal_receiver * receiver);
|
||||
|
||||
/**
|
||||
* Gets called when we have received a signal at a signal receiver
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user