mirror of
https://github.com/mmueller41/genode.git
synced 2026-01-22 04:52:56 +01:00
Compare commits
217 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 |
18
.gitignore
vendored
18
.gitignore
vendored
@@ -30,6 +30,7 @@
|
||||
/libports/include/freetype
|
||||
/libports/include/ft2build.h
|
||||
/libports/include/iconv/
|
||||
/libports/include/icu/
|
||||
/libports/include/jbig2dec
|
||||
/libports/include/libc-amd64/
|
||||
/libports/include/libc-arm/
|
||||
@@ -104,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
|
||||
@@ -120,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
|
||||
|
||||
@@ -134,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
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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
|
||||
|
||||
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);
|
||||
@@ -13,6 +13,7 @@
|
||||
#
|
||||
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
|
||||
}
|
||||
|
||||
|
||||
@@ -141,7 +142,8 @@ proc build_boot_image {binaries} {
|
||||
# Generate pulsar config file
|
||||
#
|
||||
set fh [open "[run_dir]/config-52-54-00-12-34-56" "WRONLY CREAT TRUNC"]
|
||||
puts $fh " exec /fiasco/bootstrap -serial -modaddr=0x02000000"
|
||||
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"
|
||||
@@ -155,17 +157,15 @@ proc build_boot_image {binaries} {
|
||||
# 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)]} {
|
||||
set len [string length $::env(PXE_TFTP_DIR_BASE)]
|
||||
set tmp [string range [pwd] 0 $len-1]
|
||||
# if PXE_TFTP_DIR_BASE is part of pwd (autopilot) we don't need DIR_OFFSET
|
||||
if ([string match $tmp $::env(PXE_TFTP_DIR_BASE)]) {
|
||||
set tftp_local_offset [string range [pwd] $len [string length [pwd]]]
|
||||
} else {
|
||||
set tftp_local_offset $::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_local_offset/[run_dir]"
|
||||
puts $fh " root $tftp_base$::env(PXE_TFTP_DIR_OFFSET)/[run_dir]"
|
||||
puts $fh " config config-52-54-00-12-34-56"
|
||||
close $fh
|
||||
}
|
||||
|
||||
@@ -121,7 +121,12 @@ 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
|
||||
|
||||
@@ -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());
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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 {
|
||||
|
||||
@@ -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); }
|
||||
|
||||
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)
|
||||
|
||||
@@ -11,6 +11,7 @@
|
||||
#
|
||||
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
|
||||
}
|
||||
|
||||
##
|
||||
@@ -123,37 +124,6 @@ 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} {
|
||||
@@ -209,7 +179,8 @@ proc build_boot_image_x86 {binaries} {
|
||||
# Generate pulsar config file
|
||||
#
|
||||
set fh [open "[run_dir]/config-52-54-00-12-34-56" "WRONLY CREAT TRUNC"]
|
||||
puts $fh " exec /fiasco/bootstrap -modaddr=0x01100000"
|
||||
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"
|
||||
@@ -223,17 +194,15 @@ proc build_boot_image_x86 {binaries} {
|
||||
# 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)]} {
|
||||
set len [string length $::env(PXE_TFTP_DIR_BASE)]
|
||||
set tmp [string range [pwd] 0 $len-1]
|
||||
# if PXE_TFTP_DIR_BASE is part of pwd (autopilot) we don't need DIR_OFFSET
|
||||
if ([string match $tmp $::env(PXE_TFTP_DIR_BASE)]) {
|
||||
set tftp_local_offset [string range [pwd] $len [string length [pwd]]]
|
||||
} else {
|
||||
set tftp_local_offset $::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_local_offset/[run_dir]"
|
||||
puts $fh " root $tftp_base$::env(PXE_TFTP_DIR_OFFSET)/[run_dir]"
|
||||
puts $fh " config config-52-54-00-12-34-56"
|
||||
close $fh
|
||||
}
|
||||
@@ -277,7 +246,7 @@ 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"
|
||||
|
||||
@@ -319,7 +288,7 @@ proc run_genode_until {{wait_for_re forever} {timeout_value 0} {running_spawn_id
|
||||
return
|
||||
}
|
||||
if {[is_serial_available]} {
|
||||
spawn_serial $wait_for_re $timeout_value
|
||||
spawn_serial $wait_for_re $timeout_value "L4 Bootstrapper"
|
||||
return
|
||||
}
|
||||
|
||||
|
||||
@@ -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]);
|
||||
|
||||
@@ -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();
|
||||
};
|
||||
|
||||
@@ -37,20 +37,22 @@ namespace Genode {
|
||||
|
||||
friend class Platform_pd;
|
||||
|
||||
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;
|
||||
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);
|
||||
@@ -63,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
|
||||
@@ -136,7 +138,12 @@ 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
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -511,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;
|
||||
|
||||
@@ -198,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,
|
||||
@@ -209,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,
|
||||
@@ -251,8 +261,7 @@ Weak_ptr<Address_space> Platform_thread::address_space()
|
||||
}
|
||||
|
||||
|
||||
Platform_thread::Platform_thread(const char *name,
|
||||
unsigned prio)
|
||||
Platform_thread::Platform_thread(const char *name, unsigned prio, addr_t)
|
||||
: _state(DEAD),
|
||||
_core_thread(false),
|
||||
_thread(true),
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -64,15 +64,20 @@ void Genode::Platform::setup_irq_mode(unsigned irq_number, unsigned trigger,
|
||||
|
||||
/*
|
||||
* Translate ACPI interrupt mode (trigger/polarity) to Fiasco APIC
|
||||
* values. Default is level low for IRQs > 15
|
||||
* values. Default is level low
|
||||
*/
|
||||
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;
|
||||
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;
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
|
||||
@@ -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()) { }
|
||||
};
|
||||
|
||||
@@ -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_ */
|
||||
@@ -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
|
||||
|
||||
@@ -172,29 +172,7 @@ proc build_boot_image {binaries} {
|
||||
exec cp -L bin/core $elf_img
|
||||
exec [cross_dev_prefix]strip $elf_img
|
||||
|
||||
# target specific ops
|
||||
if {[regexp "uboot" $run_target]} {
|
||||
|
||||
# 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]
|
||||
|
||||
# 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
|
||||
|
||||
}
|
||||
build_uboot_image $elf_img
|
||||
|
||||
# set symbolic link to image.elf file in TFTP directory for PXE boot
|
||||
if {[info exists ::env(PXE_TFTP_DIR_BASE)] &&
|
||||
@@ -207,7 +185,8 @@ proc build_boot_image {binaries} {
|
||||
}
|
||||
|
||||
# retrieve stand-alone core
|
||||
exec mv core/core.standalone bin/core
|
||||
exec cp core/core.standalone bin/core
|
||||
exec rm core/core.standalone
|
||||
}
|
||||
|
||||
|
||||
@@ -228,7 +207,7 @@ proc run_genode_until {{wait_for_re forever} {timeout_value 0} {running_spawn_id
|
||||
return
|
||||
}
|
||||
if {[is_serial_available]} {
|
||||
spawn_serial $wait_for_re $timeout_value
|
||||
spawn_serial $wait_for_re $timeout_value "Kernel started!"
|
||||
return
|
||||
}
|
||||
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
@@ -149,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;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -469,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'
|
||||
*/
|
||||
@@ -524,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; }
|
||||
};
|
||||
|
||||
/**
|
||||
@@ -557,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
|
||||
*
|
||||
|
||||
@@ -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 */
|
||||
|
||||
@@ -47,7 +47,6 @@ namespace Genode {
|
||||
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;
|
||||
@@ -55,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
|
||||
*/
|
||||
@@ -142,8 +151,12 @@ 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
|
||||
@@ -169,7 +182,7 @@ namespace Genode {
|
||||
|
||||
Thread_base * thread_base()
|
||||
{
|
||||
if (!_thread_base) assert(_main_thread);
|
||||
if (!_thread_base) assert(main_thread());
|
||||
return _thread_base;
|
||||
}
|
||||
|
||||
@@ -179,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:
|
||||
|
||||
|
||||
@@ -766,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 */
|
||||
@@ -929,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();
|
||||
@@ -1441,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;
|
||||
@@ -1529,42 +1538,49 @@ int Kernel::Thread::resume()
|
||||
}
|
||||
|
||||
|
||||
int Thread::start(void *ip, void *sp, unsigned cpu_no,
|
||||
unsigned const pd_id,
|
||||
Native_utcb * const phys_utcb,
|
||||
Native_utcb * const virt_utcb)
|
||||
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)
|
||||
{
|
||||
/* check state and arguments */
|
||||
assert(_state == AWAIT_START)
|
||||
assert(!cpu_no);
|
||||
assert(!cpu_id);
|
||||
|
||||
/* apply thread configuration */
|
||||
init_context(ip, sp, pd_id);
|
||||
_phys_utcb = phys_utcb;
|
||||
_virt_utcb = virt_utcb;
|
||||
/* store thread parameters */
|
||||
_phys_utcb = utcb_phys;
|
||||
_virt_utcb = utcb_virt;
|
||||
_pd_id = pd_id;
|
||||
|
||||
/* offer thread-entry arguments */
|
||||
user_arg_0((unsigned)_virt_utcb);
|
||||
/* join a protection domain */
|
||||
Pd * const pd = Pd::pool()->object(_pd_id);
|
||||
assert(pd)
|
||||
addr_t const tlb = pd->tlb()->base();
|
||||
|
||||
/* start thread */
|
||||
_schedule();
|
||||
return 0;
|
||||
/* 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::init_context(void * const instr_p, void * const stack_p,
|
||||
unsigned const 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)
|
||||
{
|
||||
/* basic thread state */
|
||||
sp = (addr_t)stack_p;
|
||||
ip = (addr_t)instr_p;
|
||||
|
||||
/* join a pd */
|
||||
_pd_id = pd_id;
|
||||
Pd * const pd = Pd::pool()->object(_pd_id);
|
||||
assert(pd)
|
||||
protection_domain(pd_id);
|
||||
tlb(pd->tlb()->base());
|
||||
prepare_to_start(ip, sp, cpu_id, pd_id, utcb_phys, utcb_virt);
|
||||
_schedule();
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -847,19 +847,39 @@ namespace Kernel
|
||||
_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
|
||||
@@ -891,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
|
||||
*
|
||||
|
||||
@@ -29,6 +29,23 @@ namespace Genode
|
||||
*/
|
||||
class Core_tlb : public Tlb
|
||||
{
|
||||
private:
|
||||
|
||||
/**
|
||||
* On Pandaboard the L2 cache needs to be disabled by a
|
||||
* TrustZone hypervisor call
|
||||
*/
|
||||
void _disable_outer_l2_cache()
|
||||
{
|
||||
asm volatile (
|
||||
"stmfd sp!, {r0-r12} \n"
|
||||
"mov r0, #0 \n"
|
||||
"ldr r12, =0x102 \n"
|
||||
"dsb \n"
|
||||
"smc #0 \n"
|
||||
"ldmfd sp!, {r0-r12}");
|
||||
}
|
||||
|
||||
public:
|
||||
|
||||
/**
|
||||
@@ -37,6 +54,13 @@ namespace Genode
|
||||
Core_tlb()
|
||||
{
|
||||
using namespace Genode;
|
||||
|
||||
/*
|
||||
* Disable L2-cache by now, or we get into deep trouble with the MMU
|
||||
* not using the L2 cache
|
||||
*/
|
||||
_disable_outer_l2_cache();
|
||||
|
||||
map_core_area(Board::RAM_0_BASE, Board::RAM_0_SIZE, 0);
|
||||
map_core_area(Board::MMIO_0_BASE, Board::MMIO_0_SIZE, 1);
|
||||
map_core_area(Board::MMIO_1_BASE, Board::MMIO_1_SIZE, 1);
|
||||
|
||||
@@ -28,7 +28,7 @@ bool Platform_thread::_attaches_utcb_by_itself()
|
||||
* virtual context area by itself, as it is done for other threads
|
||||
* through a sub RM-session.
|
||||
*/
|
||||
return _pd_id == Kernel::core_id() || !_main_thread;
|
||||
return _pd_id == Kernel::core_id() || !main_thread();
|
||||
}
|
||||
|
||||
|
||||
@@ -60,13 +60,12 @@ Platform_thread::~Platform_thread()
|
||||
Kernel::delete_thread(_id);
|
||||
}
|
||||
|
||||
|
||||
Platform_thread::Platform_thread(const char * name,
|
||||
Thread_base * const thread_base,
|
||||
size_t const stack_size, unsigned const pd_id)
|
||||
:
|
||||
_thread_base(thread_base), _stack_size(stack_size),
|
||||
_pd_id(pd_id), _rm_client(0), _virt_utcb(0)
|
||||
_pd_id(pd_id), _rm_client(0), _virt_utcb(0), _main_thread(0)
|
||||
{
|
||||
strncpy(_name, name, NAME_MAX_LEN);
|
||||
|
||||
@@ -85,7 +84,7 @@ Platform_thread::Platform_thread(const char * name, unsigned int priority,
|
||||
addr_t utcb)
|
||||
:
|
||||
_thread_base(0), _stack_size(0), _pd_id(0), _rm_client(0),
|
||||
_virt_utcb((Native_utcb *)utcb)
|
||||
_virt_utcb((Native_utcb *)utcb), _main_thread(0)
|
||||
{
|
||||
strncpy(_name, name, NAME_MAX_LEN);
|
||||
|
||||
|
||||
@@ -20,22 +20,14 @@
|
||||
|
||||
using namespace Genode;
|
||||
|
||||
enum {
|
||||
RECEIVER_SLAB_CHUNK_SIZE = 32,
|
||||
CONTEXT_SLAB_CHUNK_SIZE = 32,
|
||||
};
|
||||
|
||||
|
||||
Signal_session_component::Signal_session_component(Allocator * const md,
|
||||
size_t const ram_quota) :
|
||||
_md_alloc(md, ram_quota),
|
||||
_receivers_slab(Kernel::signal_receiver_size(),
|
||||
RECEIVER_SLAB_CHUNK_SIZE * Kernel::signal_receiver_size(),
|
||||
0, &_md_alloc),
|
||||
|
||||
_contexts_slab(Kernel::signal_context_size(),
|
||||
CONTEXT_SLAB_CHUNK_SIZE * Kernel::signal_context_size(),
|
||||
0, &_md_alloc)
|
||||
_receivers_slab(Kernel::signal_receiver_size(), RECEIVERS_SB_SIZE,
|
||||
(Slab_block *)&_initial_receivers_sb, &_md_alloc),
|
||||
_contexts_slab(Kernel::signal_context_size(), CONTEXTS_SB_SIZE,
|
||||
(Slab_block *)&_initial_contexts_sb, &_md_alloc)
|
||||
{ }
|
||||
|
||||
|
||||
|
||||
@@ -24,7 +24,8 @@ INC_DIR += $(REP_DIR)/src/core \
|
||||
$(REP_DIR)/src/base \
|
||||
$(BASE_DIR)/src/core/include \
|
||||
$(BASE_DIR)/include \
|
||||
$(BASE_DIR)/src/platform
|
||||
$(BASE_DIR)/src/platform \
|
||||
$(BASE_DIR)/src/base/thread
|
||||
|
||||
# add C++ sources
|
||||
SRC_CC += console.cc \
|
||||
@@ -46,6 +47,7 @@ SRC_CC += console.cc \
|
||||
rm_session_component.cc \
|
||||
rom_session_component.cc \
|
||||
signal_session_component.cc \
|
||||
trace_session_component.cc \
|
||||
thread.cc \
|
||||
kernel.cc \
|
||||
rm_session_support.cc \
|
||||
@@ -65,6 +67,7 @@ vpath pd_session_component.cc $(BASE_DIR)/src/core
|
||||
vpath ram_session_component.cc $(BASE_DIR)/src/core
|
||||
vpath rm_session_component.cc $(BASE_DIR)/src/core
|
||||
vpath rom_session_component.cc $(BASE_DIR)/src/core
|
||||
vpath trace_session_component.cc $(BASE_DIR)/src/core
|
||||
vpath dump_alloc.cc $(BASE_DIR)/src/core
|
||||
vpath console.cc $(REP_DIR)/src/base
|
||||
vpath pager.cc $(REP_DIR)/src/base
|
||||
|
||||
@@ -1,50 +0,0 @@
|
||||
|
||||
/**
|
||||
* \brief Startup code for Genode programs on Cortex A9
|
||||
* \author Martin Stein
|
||||
* \date 2011-10-01
|
||||
*/
|
||||
|
||||
/*
|
||||
* Copyright (C) 2012-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.
|
||||
*/
|
||||
|
||||
.section .text
|
||||
|
||||
/* ELF entry symbol */
|
||||
.global _start
|
||||
_start:
|
||||
|
||||
/* fetch thread-entry arguments to their destinations in BSS */
|
||||
ldr r1, =_main_utcb
|
||||
str r0, [r1]
|
||||
|
||||
/* call _main routine */
|
||||
ldr sp, =_stack_high
|
||||
.extern _main
|
||||
bl _main
|
||||
1: b 1b
|
||||
|
||||
/* dynamic symbol object handle */
|
||||
.p2align 2
|
||||
.global __dso_handle
|
||||
__dso_handle: .long 0
|
||||
|
||||
.section .bss
|
||||
|
||||
/* main-thread stack */
|
||||
.p2align 2
|
||||
.global _stack_low
|
||||
_stack_low:
|
||||
.space 64*1024
|
||||
.global _stack_high
|
||||
_stack_high:
|
||||
|
||||
/* main-thread UTCB-pointer for the Genode thread-API */
|
||||
.p2align 2
|
||||
.global _main_utcb
|
||||
_main_utcb: .long 0
|
||||
|
||||
@@ -1,123 +0,0 @@
|
||||
/*
|
||||
* \brief Linker script for Genode programs
|
||||
* \author Christian Helmuth
|
||||
* \date 2006-04-12
|
||||
*/
|
||||
|
||||
/*
|
||||
* Copyright (C) 2006-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.
|
||||
*/
|
||||
|
||||
ENTRY(_start)
|
||||
|
||||
PHDRS
|
||||
{
|
||||
ro PT_LOAD;
|
||||
rw PT_LOAD;
|
||||
}
|
||||
|
||||
SECTIONS
|
||||
{
|
||||
.text : {
|
||||
_prog_img_beg = .;
|
||||
|
||||
*(.init)
|
||||
*(.text .text.* .gnu.linkonce.t.*)
|
||||
*(.fini)
|
||||
*(.rodata .rodata.* .gnu.linkonce.r.*)
|
||||
|
||||
. = ALIGN(0x08);
|
||||
|
||||
_ctors_start = .;
|
||||
KEEP (*(.ctors))
|
||||
KEEP (*(SORT(.ctors.*)))
|
||||
KEEP (*(.init_array)) /* list of constructors specific for ARM eabi */
|
||||
_ctors_end = .;
|
||||
_dtors_start = .;
|
||||
KEEP (*(SORT(.dtors.*)))
|
||||
KEEP (*(.dtors))
|
||||
_dtors_end = .;
|
||||
} : ro = 0x90909090
|
||||
|
||||
/* Linux: exception section for uaccess mechanism */
|
||||
__ex_table : { *(__ex_table) }
|
||||
|
||||
.eh_frame_hdr : { *(.eh_frame_hdr) }
|
||||
|
||||
. = ALIGN(0x1000);
|
||||
|
||||
_prog_img_data = .;
|
||||
|
||||
.data : {
|
||||
/*
|
||||
* Leave space for parent capability parameters at start of data
|
||||
* section. The protection domain creator is reponsible for storing
|
||||
* sane values here.
|
||||
*/
|
||||
_parent_cap = .;
|
||||
_parent_cap_thread_id = .;
|
||||
LONG(0xffffffff);
|
||||
_parent_cap_local_name = .;
|
||||
LONG(0xffffffff);
|
||||
|
||||
/*
|
||||
* Platform-specific entry for Fiasco.OC.
|
||||
*
|
||||
* PIC-code compiled for Fiasco.OC, needs some PIC-compatible
|
||||
* way to enter the kernel, the fixed address of the kernel
|
||||
* entry code address needs to be found here.
|
||||
*/
|
||||
__l4sys_invoke_indirect = .;
|
||||
LONG(0xeacff000);
|
||||
|
||||
*(.data .data.* .gnu.linkonce.d.*)
|
||||
} : rw
|
||||
|
||||
/* exception frames for C++ */
|
||||
.eh_frame : {
|
||||
__eh_frame_start__ = .;
|
||||
KEEP (*(.eh_frame))
|
||||
LONG(0)
|
||||
} : rw
|
||||
|
||||
.init_array : {
|
||||
__init_array_start = .;
|
||||
KEEP (*(SORT(.init_array.*)))
|
||||
KEEP (*(.init_array))
|
||||
__init_array_end = .;
|
||||
}
|
||||
|
||||
.gcc_except_table : {
|
||||
KEEP(*(.gcc_except_table))
|
||||
KEEP(*(.gcc_except_table.*))
|
||||
}
|
||||
|
||||
.dynamic : { *(.dynamic) }
|
||||
|
||||
/* .ARM.exidx is sorted, so has to go in its own output section */
|
||||
__exidx_start = .;
|
||||
.ARM.exidx : {
|
||||
*(.ARM.exidx* .gnu.linkonce.armexidx.*)
|
||||
}
|
||||
__exidx_end = .;
|
||||
|
||||
.ARM.extab : {
|
||||
*(.ARM.extab*)
|
||||
} : rw
|
||||
|
||||
.bss : {
|
||||
_bss_start = ALIGN(4);
|
||||
*(.bss .bss.* .gnu.linkonce.b.* COMMON)
|
||||
}
|
||||
_bss_end = ALIGN(4);
|
||||
_prog_img_end = .;
|
||||
|
||||
/DISCARD/ : {
|
||||
*(.note)
|
||||
*(.note.ABI-tag)
|
||||
*(.comment)
|
||||
}
|
||||
}
|
||||
@@ -60,11 +60,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); }
|
||||
|
||||
|
||||
/*****************************
|
||||
|
||||
@@ -23,7 +23,7 @@ namespace Genode {
|
||||
|
||||
struct Linux_dataspace : Dataspace
|
||||
{
|
||||
enum { FNAME_LEN = 32 };
|
||||
enum { FNAME_LEN = 40 };
|
||||
struct Filename { char buf[FNAME_LEN]; };
|
||||
|
||||
virtual ~Linux_dataspace() { }
|
||||
|
||||
@@ -1,5 +0,0 @@
|
||||
LIBS += syscall
|
||||
|
||||
include $(BASE_DIR)/lib/mk/startup.inc
|
||||
|
||||
vpath crt0.s $(REP_DIR)/src/platform/arm
|
||||
@@ -19,11 +19,13 @@ SRC_CC += lock/lock.cc
|
||||
SRC_CC += env/rm_session_mmap.cc env/debug.cc
|
||||
SRC_CC += signal/signal.cc signal/common.cc
|
||||
SRC_CC += server/server.cc server/common.cc
|
||||
SRC_CC += thread/trace.cc
|
||||
|
||||
INC_DIR += $(REP_DIR)/src/base/lock $(BASE_DIR)/src/base/lock
|
||||
INC_DIR += $(REP_DIR)/src/base/ipc
|
||||
INC_DIR += $(REP_DIR)/src/base/env
|
||||
INC_DIR += $(REP_DIR)/src/platform $(BASE_DIR)/src/platform
|
||||
INC_DIR += $(REP_DIR)/src/base/lock $(BASE_DIR)/src/base/lock
|
||||
INC_DIR += $(REP_DIR)/src/base/ipc
|
||||
INC_DIR += $(REP_DIR)/src/base/env
|
||||
INC_DIR += $(REP_DIR)/src/platform $(BASE_DIR)/src/platform
|
||||
INC_DIR += $(BASE_DIR)/src/base/thread
|
||||
|
||||
vpath %.cc $(REP_DIR)/src/base
|
||||
vpath %.cc $(BASE_DIR)/src/base
|
||||
|
||||
@@ -1,5 +0,0 @@
|
||||
LIBS += syscall
|
||||
|
||||
include $(BASE_DIR)/lib/mk/startup.inc
|
||||
|
||||
vpath crt0.s $(REP_DIR)/src/platform/x86_32
|
||||
@@ -1,5 +0,0 @@
|
||||
LIBS += syscall
|
||||
|
||||
include $(BASE_DIR)/lib/mk/startup.inc
|
||||
|
||||
vpath crt0.s $(REP_DIR)/src/platform/x86_64
|
||||
@@ -46,3 +46,4 @@ build_boot_image $boot_modules
|
||||
|
||||
run_genode_until "--- finished pthread IPC test ---.*\n" 10
|
||||
|
||||
puts "Test succeeded"
|
||||
|
||||
7
base-linux/src/base/env/platform_env.cc
vendored
7
base-linux/src/base/env/platform_env.cc
vendored
@@ -56,7 +56,8 @@ Platform_env_base::Rm_session_mmap::_dataspace_writable(Dataspace_capability ds)
|
||||
|
||||
Session_capability
|
||||
Platform_env::Local_parent::session(Service_name const &service_name,
|
||||
Session_args const &args)
|
||||
Session_args const &args,
|
||||
Affinity const &affinity)
|
||||
{
|
||||
if (strcmp(service_name.string(),
|
||||
Rm_session::service_name()) == 0)
|
||||
@@ -66,7 +67,7 @@ Platform_env::Local_parent::session(Service_name const &service_name,
|
||||
.ulong_value(~0);
|
||||
|
||||
if (size == 0)
|
||||
return Parent_client::session(service_name, args);
|
||||
return Parent_client::session(service_name, args, affinity);
|
||||
|
||||
Rm_session_mmap *rm = new (env()->heap())
|
||||
Rm_session_mmap(true, size);
|
||||
@@ -74,7 +75,7 @@ Platform_env::Local_parent::session(Service_name const &service_name,
|
||||
return Session_capability::local_cap(rm);
|
||||
}
|
||||
|
||||
return Parent_client::session(service_name, args);
|
||||
return Parent_client::session(service_name, args, affinity);
|
||||
}
|
||||
|
||||
|
||||
|
||||
37
base-linux/src/base/env/platform_env.h
vendored
37
base-linux/src/base/env/platform_env.h
vendored
@@ -293,7 +293,8 @@ namespace Genode {
|
||||
Expanding_ram_session_client(Ram_session_capability cap)
|
||||
: Ram_session_client(cap), _cap(cap) { }
|
||||
|
||||
Ram_dataspace_capability alloc(size_t size, bool cached) {
|
||||
Ram_dataspace_capability alloc(size_t size, bool cached)
|
||||
{
|
||||
bool try_again;
|
||||
do {
|
||||
try_again = false;
|
||||
@@ -316,6 +317,35 @@ namespace Genode {
|
||||
}
|
||||
};
|
||||
|
||||
class Expanding_cpu_session_client : public Linux_cpu_session_client
|
||||
{
|
||||
Cpu_session_capability _cap;
|
||||
|
||||
public:
|
||||
|
||||
Expanding_cpu_session_client(Cpu_session_capability cap)
|
||||
: Linux_cpu_session_client(static_cap_cast<Linux_cpu_session>(cap)), _cap(cap) { }
|
||||
|
||||
Thread_capability create_thread(Name const &name, addr_t utcb = 0) {
|
||||
bool try_again;
|
||||
do {
|
||||
try_again = false;
|
||||
try {
|
||||
return Linux_cpu_session_client::create_thread(name, utcb);
|
||||
}
|
||||
catch (Cpu_session::Out_of_metadata) {
|
||||
if (try_again)
|
||||
break;
|
||||
PINF("upgrade quota donation for Env::CPU session");
|
||||
env()->parent()->upgrade(_cap, "ram_quota=8K");
|
||||
try_again = true;
|
||||
}
|
||||
} while (try_again);
|
||||
|
||||
return Thread_capability();
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
/*******************************
|
||||
** Platform-specific members **
|
||||
@@ -324,7 +354,7 @@ namespace Genode {
|
||||
Ram_session_capability _ram_session_cap;
|
||||
Expanding_ram_session_client _ram_session_client;
|
||||
Cpu_session_capability _cpu_session_cap;
|
||||
Linux_cpu_session_client _cpu_session_client;
|
||||
Expanding_cpu_session_client _cpu_session_client;
|
||||
Rm_session_mmap _rm_session_mmap;
|
||||
Pd_session_client _pd_session_client;
|
||||
|
||||
@@ -387,7 +417,8 @@ namespace Genode {
|
||||
**********************/
|
||||
|
||||
Session_capability session(Service_name const &,
|
||||
Session_args const &);
|
||||
Session_args const &,
|
||||
Affinity const & = Affinity());
|
||||
void close(Session_capability);
|
||||
|
||||
/**
|
||||
|
||||
@@ -26,6 +26,8 @@
|
||||
/* core includes */
|
||||
#include <cpu_thread_allocator.h>
|
||||
#include <platform_thread.h>
|
||||
#include <trace/control_area.h>
|
||||
#include <trace/source_registry.h>
|
||||
|
||||
namespace Genode {
|
||||
|
||||
@@ -45,18 +47,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, utcb), _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 +83,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,13 +98,23 @@ 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<Linux_cpu_session>
|
||||
{
|
||||
public:
|
||||
|
||||
typedef Cpu_thread_component::Session_label Session_label;
|
||||
|
||||
private:
|
||||
|
||||
Session_label _label;
|
||||
Rpc_entrypoint *_thread_ep;
|
||||
Pager_entrypoint *_pager_ep;
|
||||
Allocator_guard _md_alloc; /* guarded meta-data allocator */
|
||||
@@ -97,6 +125,10 @@ namespace Genode {
|
||||
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
|
||||
@@ -119,9 +151,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
|
||||
@@ -150,8 +184,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);
|
||||
|
||||
|
||||
/*******************************
|
||||
|
||||
@@ -114,7 +114,7 @@ namespace Genode {
|
||||
}
|
||||
|
||||
const char *name() { return _name; }
|
||||
void affinity(unsigned) { }
|
||||
void affinity(Affinity::Location) { }
|
||||
|
||||
/**
|
||||
* Register process ID and thread ID of thread
|
||||
|
||||
@@ -77,7 +77,7 @@ Platform_thread::Registry *Platform_thread::_registry()
|
||||
Platform_thread::Platform_thread(const char *name, unsigned, addr_t)
|
||||
: _tid(-1), _pid(-1)
|
||||
{
|
||||
strncpy(_name, name, min(sizeof(_name), strlen(name)));
|
||||
strncpy(_name, name, min(sizeof(_name), strlen(name) + 1));
|
||||
|
||||
_registry()->insert(this);
|
||||
}
|
||||
|
||||
@@ -18,6 +18,7 @@ SRC_CC = main.cc \
|
||||
io_mem_session_component.cc \
|
||||
signal_session_component.cc \
|
||||
signal_source_component.cc \
|
||||
trace_session_component.cc \
|
||||
thread_linux.cc \
|
||||
context_area.cc \
|
||||
core_printf.cc \
|
||||
@@ -28,7 +29,8 @@ INC_DIR += $(REP_DIR)/src/core/include \
|
||||
$(REP_DIR)/src/platform \
|
||||
$(REP_DIR)/src/base/ipc \
|
||||
$(REP_DIR)/src/base/env \
|
||||
$(REP_DIR)/src/base/console
|
||||
$(REP_DIR)/src/base/console \
|
||||
$(BASE_DIR)/src/base/thread \
|
||||
|
||||
HOST_INC_DIR += /usr/include
|
||||
|
||||
@@ -48,6 +50,8 @@ vpath cpu_session_component.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 core_printf.cc $(BASE_DIR)/src/base/console
|
||||
vpath thread.cc $(BASE_DIR)/src/base/thread
|
||||
vpath trace.cc $(BASE_DIR)/src/base/thread
|
||||
vpath %.cc $(PRG_DIR)
|
||||
|
||||
@@ -19,11 +19,9 @@
|
||||
#include <linux_syscalls.h>
|
||||
|
||||
/*
|
||||
* Define 'lx_environ' pointer that is supposed to be initialized by the
|
||||
* startup code.
|
||||
* Define 'lx_environ' pointer.
|
||||
*/
|
||||
__attribute__((weak)) char **lx_environ = (char **)0;
|
||||
|
||||
char **lx_environ;
|
||||
|
||||
|
||||
/**
|
||||
@@ -36,6 +34,20 @@ static inline void main_thread_bootstrap()
|
||||
{
|
||||
using namespace Genode;
|
||||
|
||||
extern Genode::addr_t *__initial_sp;
|
||||
|
||||
/*
|
||||
* Initialize the 'lx_environ' pointer
|
||||
*
|
||||
* environ = &argv[argc + 1]
|
||||
* __initial_sp[0] = argc (always 1 in Genode)
|
||||
* __initial_sp[1] = argv[0]
|
||||
* __initial_sp[2] = NULL
|
||||
* __initial_sp[3] = environ
|
||||
*
|
||||
*/
|
||||
lx_environ = (char**)&__initial_sp[3];
|
||||
|
||||
/* reserve context area */
|
||||
Genode::addr_t base = Native_config::context_area_virtual_base();
|
||||
Genode::size_t size = Native_config::context_area_virtual_size();
|
||||
|
||||
@@ -1,66 +0,0 @@
|
||||
/*
|
||||
* \brief Startup code for Genode applications
|
||||
* \author Christian Helmuth
|
||||
* \author Christian Prochaska
|
||||
* \date 2006-07-06
|
||||
*/
|
||||
|
||||
/*
|
||||
* Copyright (C) 2006-2012 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.
|
||||
*/
|
||||
|
||||
/*--- .text (program code) -------------------------*/
|
||||
.text
|
||||
|
||||
.globl _start
|
||||
_start:
|
||||
|
||||
ldr r1,=__initial_sp
|
||||
str sp,[r1]
|
||||
|
||||
/*
|
||||
* environ = &argv[argc + 1]
|
||||
* in Genode argc is always 1
|
||||
*/
|
||||
add sp,sp,#12
|
||||
ldr r1,=lx_environ
|
||||
str sp,[r1]
|
||||
|
||||
/* XXX Switch to our own stack. */
|
||||
ldr sp,=_stack_high
|
||||
|
||||
/* Clear the frame pointer and the link register so that stack backtraces will work. */
|
||||
mov fp,#0
|
||||
mov lr,#0
|
||||
|
||||
/* Jump into init C code */
|
||||
b _main
|
||||
|
||||
/*--------------------------------------------------*/
|
||||
.data
|
||||
.globl __dso_handle
|
||||
__dso_handle:
|
||||
.long 0
|
||||
|
||||
.globl __initial_sp
|
||||
__initial_sp:
|
||||
.long 0
|
||||
|
||||
/*--- .eh_frame (exception frames) -----------------*/
|
||||
/*
|
||||
.section .eh_frame,"aw"
|
||||
.globl __EH_FRAME_BEGIN__
|
||||
__EH_FRAME_BEGIN__:
|
||||
*/
|
||||
|
||||
/*--- .bss (non-initialized data) ------------------*/
|
||||
.bss
|
||||
.p2align 4
|
||||
.globl _stack_low
|
||||
_stack_low:
|
||||
.space 64*1024
|
||||
.globl _stack_high
|
||||
_stack_high:
|
||||
@@ -1,70 +0,0 @@
|
||||
/*
|
||||
* \brief Startup code for Genode applications
|
||||
* \author Christian Helmuth
|
||||
* \date 2006-07-06
|
||||
*/
|
||||
|
||||
/*
|
||||
* Copyright (C) 2006-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.
|
||||
*/
|
||||
|
||||
/*--- .text (program code) -------------------------*/
|
||||
.text
|
||||
|
||||
.globl _start
|
||||
_start:
|
||||
|
||||
movl %esp, __initial_sp
|
||||
/*
|
||||
* environ = &argv[argc + 1]
|
||||
* in Genode argc is always 1
|
||||
*/
|
||||
popl %eax /* argc */
|
||||
popl %eax /* argv[0] */
|
||||
popl %eax /* NULL */
|
||||
movl %esp, lx_environ
|
||||
|
||||
/* XXX Switch to our own stack. */
|
||||
movl $_stack_high,%esp
|
||||
|
||||
/* Clear the base pointer so that stack backtraces will work. */
|
||||
xorl %ebp,%ebp
|
||||
|
||||
/* Jump into init C code */
|
||||
call _main
|
||||
|
||||
/* We should never get here since _main does not return */
|
||||
1: int $3
|
||||
jmp 2f
|
||||
.ascii "_main() returned."
|
||||
2: jmp 1b
|
||||
|
||||
|
||||
/*--------------------------------------------------*/
|
||||
.data
|
||||
.globl __dso_handle
|
||||
__dso_handle:
|
||||
.long 0
|
||||
|
||||
.globl __initial_sp
|
||||
__initial_sp:
|
||||
.long 0
|
||||
|
||||
/*--- .eh_frame (exception frames) -----------------*/
|
||||
/*
|
||||
.section .eh_frame,"aw"
|
||||
.globl __EH_FRAME_BEGIN__
|
||||
__EH_FRAME_BEGIN__:
|
||||
*/
|
||||
|
||||
/*--- .bss (non-initialized data) ------------------*/
|
||||
.bss
|
||||
.p2align 4
|
||||
.globl _stack_low
|
||||
_stack_low:
|
||||
.space 64*1024
|
||||
.globl _stack_high
|
||||
_stack_high:
|
||||
@@ -1,74 +0,0 @@
|
||||
/*
|
||||
* \brief Startup code for Genode applications
|
||||
* \author Christian Helmuth
|
||||
* \date 2006-07-06
|
||||
*/
|
||||
|
||||
/*
|
||||
* Copyright (C) 2006-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.
|
||||
*/
|
||||
|
||||
/*--- .text (program code) -------------------------*/
|
||||
.text
|
||||
|
||||
.globl _start
|
||||
_start:
|
||||
|
||||
movq __initial_sp@GOTPCREL(%rip), %rax
|
||||
movq %rsp, (%rax)
|
||||
/*
|
||||
* environ = &argv[argc + 1]
|
||||
* in Genode argc is always 1
|
||||
*/
|
||||
popq %rax /* argc */
|
||||
popq %rax /* argv[0] */
|
||||
popq %rax /* NULL */
|
||||
movq lx_environ@GOTPCREL(%rip), %rax
|
||||
movq %rsp, (%rax)
|
||||
|
||||
/* XXX Switch to our own stack. */
|
||||
leaq _stack_high@GOTPCREL(%rip), %rax
|
||||
movq (%rax), %rsp
|
||||
|
||||
/* Clear the base pointer so that stack backtraces will work. */
|
||||
xorq %rbp,%rbp
|
||||
|
||||
/* Jump into init C code */
|
||||
callq _main
|
||||
|
||||
/* We should never get here since _main does not return */
|
||||
1: int $3
|
||||
jmp 2f
|
||||
.ascii "_main() returned."
|
||||
2: jmp 1b
|
||||
|
||||
|
||||
/*--------------------------------------------------*/
|
||||
.data
|
||||
.p2align 8
|
||||
.globl __dso_handle
|
||||
__dso_handle:
|
||||
.quad 0
|
||||
|
||||
.globl __initial_sp
|
||||
__initial_sp:
|
||||
.quad 0
|
||||
|
||||
/*--- .eh_frame (exception frames) -----------------*/
|
||||
/*
|
||||
.section .eh_frame,"aw"
|
||||
.globl __EH_FRAME_BEGIN__
|
||||
__EH_FRAME_BEGIN__:
|
||||
*/
|
||||
|
||||
/*--- .bss (non-initialized data) ------------------*/
|
||||
.bss
|
||||
.p2align 8
|
||||
.globl _stack_low
|
||||
_stack_low:
|
||||
.space 64*1024
|
||||
.globl _stack_high
|
||||
_stack_high:
|
||||
@@ -9,7 +9,7 @@ VERBOSE ?= @
|
||||
ECHO = @echo
|
||||
GIT_URL = https://github.com/alex-ab/NOVA.git
|
||||
GIT_REV = HEAD
|
||||
GIT_BRANCH = r2
|
||||
GIT_BRANCH = r3
|
||||
CONTRIB_DIR = contrib
|
||||
PATCHES = $(shell find patches -name '*.patch')
|
||||
|
||||
|
||||
@@ -63,10 +63,16 @@ command from within the 'base-nova' 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
|
||||
|
||||
For creating a preconfigured build directory prepared for compiling Genode for
|
||||
NOVA, use the 'create_builddir' tool:
|
||||
|
||||
! <genode-dir>/tool/create_builddir nova_x86 BUILD_DIR=<build-dir>
|
||||
! <genode-dir>/tool/create_builddir nova_x86_32 BUILD_DIR=<build-dir>
|
||||
|
||||
This tool will create a fresh build directory at the location specified
|
||||
as 'BUILD_DIR'. Provided that you have installed the
|
||||
@@ -114,11 +120,7 @@ on NOVA:
|
||||
All other Genode programs use Genode's generic linker script.
|
||||
|
||||
* The Genode 'Capability' type consists of a portal selector expressing the
|
||||
destination of a capability invocation and a global object ID expressing
|
||||
the identity of the object when the capability is specified as an invocation
|
||||
argument. In the latter case, the global ID is needed because of a limitation
|
||||
of the current system-call interface. In the future, we are going to entirely
|
||||
remove the global ID.
|
||||
destination of a capability invocation.
|
||||
|
||||
* Thread-local data such as the UTCB pointer is provided by the new thread
|
||||
context management introduced with the Genode release 10.02. It enables
|
||||
@@ -126,7 +128,7 @@ on NOVA:
|
||||
pointer.
|
||||
|
||||
* NOVA provides threads without time called local execution contexts (EC).
|
||||
Local ECs are intended as server-side RPC handlers. The processing time
|
||||
Local ECs are used as server-side RPC handlers. The processing time
|
||||
needed to perform RPC requests is provided by the client during the RPC call.
|
||||
This way, RPC semantics becomes very similar to function call semantics with
|
||||
regard to the accounting of CPU time. Genode already distinguishes normal
|
||||
@@ -178,9 +180,6 @@ on NOVA:
|
||||
code for the signal interface and remains completely transparent at API
|
||||
level.
|
||||
|
||||
For the timer service, we currently use one thread per client to avoid the need
|
||||
for out-of-order RPC processing.
|
||||
|
||||
* Because NOVA provides no time source, we use the x86 PIT as user-level time
|
||||
source, similar as on OKL4.
|
||||
|
||||
@@ -200,26 +199,24 @@ Manually booting Genode on NOVA
|
||||
|
||||
NOVA supports multi-boot-compliant boot loaders such as GRUB, Pulsar, or gPXE.
|
||||
For example, a GRUB configuration entry for booting the Genode demo scenario
|
||||
with NOVA looks as follows, whereas 'genode/' is a symbolic link to the 'bin/'
|
||||
subdirectory of the Genode build directory and the 'config' file is a copy of
|
||||
'os/config/demo'.
|
||||
with NOVA looks as follows, whereas 'genode/' is a symbolic link to the
|
||||
'var/run/demo/genode' directory created by invoking the 'demo' run script.
|
||||
|
||||
! title Genode demo scenario
|
||||
! kernel /hypervisor noapic
|
||||
! kernel /hypervisor iommu serial
|
||||
! module /genode/core
|
||||
! module /genode/config
|
||||
! module /genode/init
|
||||
! module /config/demo/config
|
||||
! module /genode/timer
|
||||
! module /genode/ps2_drv
|
||||
! module /genode/pci_drv
|
||||
! module /genode/fb_drv
|
||||
! module /genode/launchpad
|
||||
! module /genode/nitpicker
|
||||
! module /genode/liquid_fb
|
||||
! module /genode/nitlog
|
||||
! module /genode/testnit
|
||||
! module /genode/launchpad
|
||||
! module /genode/scout
|
||||
|
||||
! module /genode/testnit
|
||||
! module /genode/nitlog
|
||||
! module /genode/pci_drv
|
||||
! module /genode/ps2_drv
|
||||
! module /genode/fb_drv
|
||||
|
||||
Limitations
|
||||
###########
|
||||
@@ -229,26 +226,10 @@ scenario including several device drivers (PIT, PS/2, VESA, PCI) and the GUI.
|
||||
Still the NOVA support is not on par with some of the other platforms.
|
||||
The current limitations are:
|
||||
|
||||
* No real-time priority support: NOVA supports priority-based scheduling
|
||||
but, in the current version, it allows each thread to create scheduling
|
||||
contexts with arbitrary scheduling parameters. This makes it impossible
|
||||
to enforce priority assignment from a central point as facilitated with
|
||||
Genode's priority concept.
|
||||
|
||||
* No multi-processor support: NOVA supports multi-processor CPUs through
|
||||
binding each execution context (ECs) to a particular CPU. Because everyone
|
||||
can create ECs, every process could use multiple CPUs. However, Genode's API
|
||||
devises a more restrictive way of allocating and assigning resources. In
|
||||
short, physical resource usage should be arbitrated by core and the creation
|
||||
of physical ECs should be performed by core only. However, Remote EC creation
|
||||
is not yet supported by NOVA. Even though, multiple CPU can be used with
|
||||
Genode on NOVA right now by using NOVA system calls directly, there is no
|
||||
support at the Genode API level.
|
||||
|
||||
* No cancel-blocking semantics: The cancellation of locks is not support,
|
||||
yet. Because of this missing functionality, applications can freeze
|
||||
in situations where a subsystems that blocks for a service is attempted
|
||||
to get destroyed.
|
||||
|
||||
* Threads (ECs) can not be migrated to another CPU once started.
|
||||
|
||||
* For portals used as exception vectors for threads, the thread causing the
|
||||
exception and the handler thread which is bound to the exception portal must
|
||||
be on the same CPU.
|
||||
|
||||
* Priorities for Genode threads are not supported.
|
||||
|
||||
@@ -81,7 +81,7 @@ namespace Genode {
|
||||
static Nova::Utcb * _check_handler(Thread_base *&, Pager_object *&);
|
||||
public:
|
||||
|
||||
Pager_object(unsigned long badge);
|
||||
Pager_object(unsigned long badge, Affinity::Location location);
|
||||
|
||||
virtual ~Pager_object();
|
||||
|
||||
|
||||
@@ -76,17 +76,28 @@ namespace Genode {
|
||||
Native_capability native_cap(Thread_capability cap) {
|
||||
return call<Rpc_native_cap>(cap); }
|
||||
|
||||
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); }
|
||||
|
||||
private:
|
||||
|
||||
Native_capability pause_sync(Thread_capability target) {
|
||||
return Native_capability::invalid_cap(); }
|
||||
|
||||
Native_capability pause_sync(Thread_capability target) {
|
||||
return Native_capability::invalid_cap(); }
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
@@ -77,7 +77,7 @@ namespace Nova {
|
||||
NOVA_INV_SELECTOR = 4,
|
||||
NOVA_INV_PARAMETER = 5,
|
||||
NOVA_INV_FEATURE = 6,
|
||||
NOVA_INV_CPU_NUMBER = 7,
|
||||
NOVA_INV_CPU = 7,
|
||||
NOVA_INVD_DEVICE_ID = 8,
|
||||
};
|
||||
|
||||
@@ -123,6 +123,22 @@ namespace Nova {
|
||||
|
||||
bool has_feature_vmx() const { return feature_flags & (1 << 1); }
|
||||
bool has_feature_svm() const { return feature_flags & (1 << 2); }
|
||||
|
||||
unsigned cpu_max() const {
|
||||
return (mem_desc_offset - cpu_desc_offset) / cpu_desc_size; }
|
||||
|
||||
unsigned cpus() const {
|
||||
unsigned cpu_num = 0;
|
||||
const char * cpu_desc =
|
||||
reinterpret_cast<const char *>(this) + cpu_desc_offset;
|
||||
|
||||
for (unsigned i = 0; i < cpu_max(); i++) {
|
||||
if ((*cpu_desc) & 0x1) cpu_num++;
|
||||
cpu_desc += cpu_desc_size;
|
||||
}
|
||||
|
||||
return cpu_num;
|
||||
}
|
||||
} __attribute__((packed));
|
||||
|
||||
|
||||
|
||||
@@ -18,9 +18,11 @@ SRC_CC += elf/elf_binary.cc
|
||||
SRC_CC += lock/lock.cc
|
||||
SRC_CC += signal/signal.cc signal/common.cc
|
||||
SRC_CC += server/server.cc
|
||||
SRC_CC += thread/thread.cc thread/thread_context.cc
|
||||
SRC_CC += thread/thread.cc thread/thread_context.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
|
||||
|
||||
@@ -1,2 +1,2 @@
|
||||
This directory contains patches for the NOVA microhypervisor @ github
|
||||
required for using this kernel with Genode.
|
||||
This directory contains patches for the Genode adjusted version of the NOVA
|
||||
microhypervisor @ github required for using this kernel with Genode.
|
||||
|
||||
@@ -1,16 +0,0 @@
|
||||
diff --git a/src/syscall.cpp b/src/syscall.cpp
|
||||
index ee6dc42..9d5eba3 100644
|
||||
--- a/src/syscall.cpp
|
||||
+++ b/src/syscall.cpp
|
||||
@@ -462,8 +487,10 @@ void Ec::sys_assign_pci()
|
||||
sys_finish<Sys_regs::BAD_CAP>();
|
||||
}
|
||||
|
||||
+ Pd * pd = static_cast<Pd *>(obj);
|
||||
+
|
||||
Paddr phys; unsigned rid;
|
||||
- if (EXPECT_FALSE (!Pd::current->Space_mem::lookup (r->dev(), phys) || (rid = Pci::phys_to_rid (phys)) == ~0U)) {
|
||||
+ if (EXPECT_FALSE (!pd->Space_mem::lookup (r->dev(), phys) || (rid = Pci::phys_to_rid (phys)) == ~0U)) {
|
||||
trace (TRACE_ERROR, "%s: Non-DEV CAP (%#lx)", __func__, r->dev());
|
||||
sys_finish<Sys_regs::BAD_DEV>();
|
||||
}
|
||||
@@ -101,17 +101,15 @@ proc build_boot_image {binaries} {
|
||||
# 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)]} {
|
||||
set len [string length $::env(PXE_TFTP_DIR_BASE)]
|
||||
set tmp [string range [pwd] 0 $len-1]
|
||||
# if PXE_TFTP_DIR_BASE is part of pwd (autopilot) we don't need DIR_OFFSET
|
||||
if ([string match $tmp $::env(PXE_TFTP_DIR_BASE)]) {
|
||||
set tftp_local_offset [string range [pwd] $len [string length [pwd]]]
|
||||
} else {
|
||||
set tftp_local_offset $::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_local_offset/[run_dir]"
|
||||
puts $fh " root $tftp_base$::env(PXE_TFTP_DIR_OFFSET)/[run_dir]"
|
||||
puts $fh " config config-52-54-00-12-34-56"
|
||||
close $fh
|
||||
}
|
||||
|
||||
@@ -79,9 +79,13 @@ void Pager_object::_page_fault_handler()
|
||||
obj->_state.dead = true;
|
||||
}
|
||||
|
||||
if (ret == 1)
|
||||
PDBG("unhandled page fault, address=0x%lx ip=0x%lx",
|
||||
ipc_pager.fault_addr(), ipc_pager.fault_ip());
|
||||
if (ret == 1) {
|
||||
char client_name[Context::NAME_LEN];
|
||||
myself->name(client_name, sizeof(client_name));
|
||||
|
||||
PDBG("unhandled page fault, '%s' address=0x%lx ip=0x%lx",
|
||||
client_name, ipc_pager.fault_addr(), ipc_pager.fault_ip());
|
||||
}
|
||||
|
||||
utcb->set_msg_word(0);
|
||||
utcb->mtd = 0;
|
||||
@@ -257,7 +261,7 @@ static uint8_t create_portal(addr_t pt, addr_t pd, addr_t ec, Mtd mtd,
|
||||
return res;
|
||||
}
|
||||
|
||||
Pager_object::Pager_object(unsigned long badge)
|
||||
Pager_object::Pager_object(unsigned long badge, Affinity::Location location)
|
||||
: Thread_base("pager:", PF_HANDLER_STACK_SIZE), _badge(badge)
|
||||
{
|
||||
class Create_exception_pt_failed { };
|
||||
@@ -275,6 +279,9 @@ Pager_object::Pager_object(unsigned long badge)
|
||||
_state.singlestep = false;
|
||||
_state.sel_client_ec = Native_thread::INVALID_INDEX;
|
||||
|
||||
/* tell thread starting code on which CPU to let run the pager */
|
||||
reinterpret_cast<Affinity::Location *>(stack_top())[-1] = location;
|
||||
|
||||
/* creates local EC */
|
||||
Thread_base::start();
|
||||
|
||||
|
||||
@@ -198,65 +198,30 @@ void Rpc_entrypoint::activate()
|
||||
|
||||
|
||||
Rpc_entrypoint::Rpc_entrypoint(Cap_session *cap_session, size_t stack_size,
|
||||
const char *name, bool start_on_construction)
|
||||
const char *name, bool start_on_construction,
|
||||
Affinity::Location location)
|
||||
:
|
||||
Thread_base(name, stack_size),
|
||||
_curr_obj(start_on_construction ? 0 : (Rpc_object_base *)~0UL),
|
||||
_delay_start(Lock::LOCKED),
|
||||
_cap_session(cap_session)
|
||||
{
|
||||
/*
|
||||
* Create thread if we aren't running in core.
|
||||
*
|
||||
* For core this code can't be performed since the sessions aren't
|
||||
* setup in the early bootstrap phase of core. In core the thread
|
||||
* is created 'manually'.
|
||||
*/
|
||||
/* when not running in core set the affinity via cpu session */
|
||||
if (_tid.ec_sel == Native_thread::INVALID_INDEX) {
|
||||
/* create new pager object and assign it to the new thread */
|
||||
_pager_cap = env()->rm_session()->add_client(_thread_cap);
|
||||
if (!_pager_cap.valid())
|
||||
throw Cpu_session::Thread_creation_failed();
|
||||
|
||||
if (env()->cpu_session()->set_pager(_thread_cap, _pager_cap))
|
||||
throw Cpu_session::Thread_creation_failed();
|
||||
/* place new thread on the specified CPU */
|
||||
if (location.valid())
|
||||
env()->cpu_session()->affinity(_thread_cap, location);
|
||||
|
||||
addr_t thread_sp = (addr_t)&_context->stack[-4];
|
||||
|
||||
Thread_state state;
|
||||
state.sel_exc_base = _tid.exc_pt_sel;
|
||||
|
||||
try { env()->cpu_session()->state(_thread_cap, state); }
|
||||
catch(...) { throw Cpu_session::Thread_creation_failed(); }
|
||||
if (env()->cpu_session()->start(_thread_cap, 0, thread_sp))
|
||||
throw Cpu_session::Thread_creation_failed();
|
||||
|
||||
for (unsigned i = 0; i < Nova::PT_SEL_PARENT; i++)
|
||||
request_event_portal(_pager_cap, _tid.exc_pt_sel, i);
|
||||
|
||||
request_event_portal(_pager_cap, _tid.exc_pt_sel,
|
||||
Nova::PT_SEL_STARTUP);
|
||||
request_event_portal(_pager_cap, _tid.exc_pt_sel,
|
||||
Nova::SM_SEL_EC);
|
||||
request_event_portal(_pager_cap, _tid.exc_pt_sel,
|
||||
Nova::PT_SEL_RECALL);
|
||||
|
||||
/*
|
||||
* Request native thread cap, _thread_cap only a token.
|
||||
* The native thread cap is required to attach new rpc objects
|
||||
* (to create portals bound to the ec)
|
||||
*/
|
||||
Genode::Nova_cpu_connection cpu;
|
||||
Native_capability ec_cap = cpu.native_cap(_thread_cap);
|
||||
if (!ec_cap.valid())
|
||||
throw Cpu_session::Thread_creation_failed();
|
||||
_tid.ec_sel = ec_cap.local_name();
|
||||
/* magic value evaluated by thread_nova.cc to start a local thread */
|
||||
_tid.ec_sel = Native_thread::INVALID_INDEX - 1;
|
||||
} else {
|
||||
/* tell affinity CPU in 'core' via stack */
|
||||
reinterpret_cast<Affinity::Location *>(stack_top())[-1] = location;
|
||||
}
|
||||
else
|
||||
/*
|
||||
* Required for core threads (creates local EC)
|
||||
*/
|
||||
Thread_base::start();
|
||||
|
||||
/* required to create a 'local' EC */
|
||||
Thread_base::start();
|
||||
|
||||
/* create cleanup portal */
|
||||
_cap = _cap_session->alloc(Native_capability(_tid.ec_sel),
|
||||
|
||||
@@ -36,8 +36,29 @@ using namespace Genode;
|
||||
*/
|
||||
void Thread_base::_thread_start()
|
||||
{
|
||||
Genode::Thread_base::myself()->entry();
|
||||
Thread_base::myself()->_join_lock.unlock();
|
||||
using namespace Genode;
|
||||
|
||||
/* if the inner catch handling fails, let thread die with some noise */
|
||||
try {
|
||||
|
||||
/* catch any exception at this point and try to print a error message */
|
||||
try {
|
||||
Thread_base::myself()->entry();
|
||||
} catch (...) {
|
||||
char thread_name[48];
|
||||
Thread_base::myself()->name(thread_name, sizeof(thread_name));
|
||||
|
||||
PERR("Thread '%s' died because of an uncaught exception", thread_name);
|
||||
}
|
||||
|
||||
Thread_base::myself()->_join_lock.unlock();
|
||||
|
||||
} catch (...) {
|
||||
/* die in a noisy way */
|
||||
nova_die();
|
||||
}
|
||||
|
||||
/* sleep silently */
|
||||
Genode::sleep_forever();
|
||||
}
|
||||
|
||||
@@ -106,9 +127,15 @@ void Thread_base::_deinit_platform_thread()
|
||||
|
||||
void Thread_base::start()
|
||||
{
|
||||
if (_tid.ec_sel != ~0UL)
|
||||
if (_tid.ec_sel < Native_thread::INVALID_INDEX - 1)
|
||||
throw Cpu_session::Thread_creation_failed();
|
||||
|
||||
/*
|
||||
* Default: create global thread - ec.sel == INVALID_INDEX
|
||||
* create local thread - ec.sel == INVALID_INDEX - 1
|
||||
*/
|
||||
bool global = _tid.ec_sel == Native_thread::INVALID_INDEX;
|
||||
|
||||
using namespace Genode;
|
||||
|
||||
/* create new pager object and assign it to the new thread */
|
||||
@@ -121,15 +148,19 @@ void Thread_base::start()
|
||||
|
||||
/* create EC at core */
|
||||
addr_t thread_sp = reinterpret_cast<addr_t>(&_context->stack[-4]);
|
||||
thread_sp &= ~0xfUL; /* align initial stack to 16 byte boundary */
|
||||
|
||||
Thread_state state;
|
||||
state.sel_exc_base = _tid.exc_pt_sel;
|
||||
state.is_vcpu = _tid.is_vcpu;
|
||||
|
||||
/* local thread have no start instruction pointer - set via portal entry */
|
||||
addr_t thread_ip = global ? reinterpret_cast<addr_t>(_thread_start) : 0;
|
||||
|
||||
try { env()->cpu_session()->state(_thread_cap, state); }
|
||||
catch (...) { throw Cpu_session::Thread_creation_failed(); }
|
||||
if (env()->cpu_session()->start(_thread_cap, (addr_t)_thread_start,
|
||||
thread_sp))
|
||||
|
||||
if (env()->cpu_session()->start(_thread_cap, thread_ip, thread_sp))
|
||||
throw Cpu_session::Thread_creation_failed();
|
||||
|
||||
/* request native EC thread cap */
|
||||
@@ -156,8 +187,9 @@ void Thread_base::start()
|
||||
utcb_obj->crd_xlt = Obj_crd();
|
||||
}
|
||||
|
||||
/* request creation of SC to let thread run*/
|
||||
env()->cpu_session()->resume(_thread_cap);
|
||||
if (global)
|
||||
/* request creation of SC to let thread run*/
|
||||
env()->cpu_session()->resume(_thread_cap);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -20,10 +20,10 @@
|
||||
|
||||
/* local includes */
|
||||
#include <echo.h>
|
||||
#include <nova_util.h>
|
||||
|
||||
enum {
|
||||
ECHO_STACK_SIZE = 1024,
|
||||
ECHO_CPU_NO = 0,
|
||||
ECHO_GLOBAL = false,
|
||||
ECHO_EXC_BASE = 0
|
||||
};
|
||||
@@ -72,8 +72,9 @@ Echo::Echo(Genode::addr_t utcb_addr)
|
||||
|
||||
/* create echo EC */
|
||||
Genode::addr_t pd_sel = Genode::Platform_pd::pd_core_sel();
|
||||
uint8_t res = create_ec(_ec_sel, pd_sel, ECHO_CPU_NO, utcb_addr,
|
||||
(mword_t)echo_stack_top(), ECHO_EXC_BASE, ECHO_GLOBAL);
|
||||
uint8_t res = create_ec(_ec_sel, pd_sel, boot_cpu(), utcb_addr,
|
||||
reinterpret_cast<mword_t>(echo_stack_top()),
|
||||
ECHO_EXC_BASE, ECHO_GLOBAL);
|
||||
|
||||
/* make error condition visible by raising an unhandled page fault */
|
||||
if (res) { ((void (*)())(res*0x10000UL))(); }
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
/*
|
||||
* \brief Core-specific instance of the CPU session/thread interfaces
|
||||
* \author Christian Helmuth
|
||||
\author Norman Feske
|
||||
* \author Alexander Boettcher
|
||||
* \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, utcb), _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<Nova_cpu_session>
|
||||
{
|
||||
public:
|
||||
|
||||
typedef Cpu_thread_component::Session_label Session_label;
|
||||
|
||||
private:
|
||||
|
||||
/**
|
||||
@@ -93,16 +121,22 @@ 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
|
||||
* call of 'Cpu_session::exception_handler'.
|
||||
@@ -124,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
|
||||
@@ -156,8 +192,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);
|
||||
|
||||
|
||||
/******************************
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user