Compare commits

...

217 Commits
13.05 ... 13.08

Author SHA1 Message Date
Norman Feske
ef1cd4a276 News item for Genode 13.08 2013-08-15 12:05:39 +02:00
Norman Feske
d13605a9a3 Release notes for version 13.08 2013-08-15 12:05:39 +02:00
Norman Feske
3d42cb0693 doc/getting_started.txt: Mention VESA driver 2013-08-15 12:03:54 +02:00
Norman Feske
a652cb5110 Apply affinity subspacing to session requests 2013-08-15 09:22:50 +02:00
Josef Söntgen
a4066c358e Add trace points (RPC and signal) 2013-08-15 09:22:50 +02:00
Josef Söntgen
17eb342156 os: example trace policy-modules 2013-08-15 09:22:50 +02:00
Alexander Boettcher
baa55dabc4 seoul: add kernelbuild run script 2013-08-15 09:22:49 +02:00
Christian Prochaska
97374cf57e ldso: increase 'MEM_SIZE' in 'mmap()'
Fixes #838.
2013-08-15 09:22:49 +02:00
Christian Prochaska
d39dfef98f Qt: fix examples
With this patch, the 'textedit' example can run on base-linux again and
'qt_lauchpad' contains only runnable launch entries.

Fixes #837.
2013-08-15 09:22:49 +02:00
Christian Prochaska
d47468c005 Qt4: fix download location
Fixes #836.
2013-08-15 09:22:49 +02:00
Christian Prochaska
7f7c24fcc9 Pistachio: tell the compiler about 'edi' changes
Syscall binding functions which use '__L4_INDIRECT_CALL' need to tell the
compiler that the 'edi' register gets modified. Since 'edi' is an input
operand and input operands may not get added to the clobber list, this
patch defines 'edi' also as an output operand instead.

Fixes #834.
2013-08-15 09:22:49 +02:00
Stefan Kalkowski
3a6f639df8 Fix network_test run scripts for recent changes
Fix #833
2013-08-15 09:22:49 +02:00
Stefan Kalkowski
55e1c16c98 ports: enable re-preparation of contrib code
Avoid warnings of missing patches directory

Fixes #832
2013-08-15 09:22:49 +02:00
Norman Feske
0c22f3da75 doc: Update components.txt and top-level README 2013-08-15 09:22:48 +02:00
Norman Feske
7972e4587b qt5: hook for selectively inhibiting qt5 builds 2013-08-15 09:22:48 +02:00
Alexander Boettcher
ed3187aa74 seoul: add invalid guest state handling 2013-08-15 09:22:48 +02:00
Alexander Boettcher
e349c29736 seoul: add test for native runs
and add to autopilot list.
2013-08-15 09:22:48 +02:00
Alexander Boettcher
35f9ceb7ba seoul: fix run script issues 823 and 824
Fix #823
Fix #824
2013-08-15 09:22:48 +02:00
Alexander Boettcher
4474e9d6d6 seoul: add intel82576vf for 64bit 2013-08-15 09:22:48 +02:00
Alexander Boettcher
0654877392 seoul: update to recent seoul branch
Required to use intel82576vf in 64bit host mode
2013-08-15 09:22:48 +02:00
Alexander Boettcher
009adff441 seoul: fix region conflicts
At least 64bit Seoul dies with Region_conflict reliable and reproducible.

When during startup of Seoul some Genode code (caused by executing some
constructors) try to attach a region, the region manager code in the rm_session
will try to place the attachment at the smallest large enough aligned free
virtual region.

For now, I observed one attachment causing trouble (but not knowing who causes
this - it does also not really matter). The questionable region is 0x4000 of
size for 32bit and 0x8000 of size for 64bit.

To steer the region manager a bit, we try now following trick:

With this commit the load address of the binary for 32 and 64 bit is moved
close to the end of the virtual address space, but leaving enough free virtual
space for the above observed attachment (and a bit more).

The region manager code now will try to fill up the virtual region behind
the binary up to the end of the virtual address space, effectively letting the
lower virtual region untouched - hopefully.

Works for now, but it will break again - for sure.

Fixes #519
2013-08-15 09:22:48 +02:00
Josef Söntgen
32e3eee48c linux: add expanding Cpu_session_client 2013-08-15 09:22:48 +02:00
Norman Feske
149356f7ab core: TRACE service interface and implementation 2013-08-15 09:22:47 +02:00
Norman Feske
fe4a6d7d81 base: User-level tracing support 2013-08-14 18:43:19 +02:00
Norman Feske
a2b15349fd base: Add tracing support to CPU session interface 2013-08-13 17:27:40 +02:00
Christian Prochaska
f0b5c5eca5 Rename 'oss_drv' to 'audio_out_drv'
Fixes #829.
2013-08-13 17:27:40 +02:00
Sebastian Sumpf
a125f7179e foc: Fix interrupt-mode handling on x86
Set level/edge high/low values correctly.

Fixes issue #830
2013-08-13 17:27:40 +02:00
Sebastian Sumpf
258c74db59 base-foc: Checkout license file from TUDOS repo 2013-08-13 17:27:40 +02:00
Christian Prochaska
7b54eaaee1 libports: add Qt5
Fixes #345.
2013-08-13 17:27:40 +02:00
Christian Prochaska
572592b0f3 qt4: require 'qt4_deprecated' SPECS variable
To avoid build conflicts with Qt5, with this patch, 'qt4_deprecated' needs
to be added to the 'SPECS' variable (in specs.conf) when building for Qt4.

Issue #345.
2013-08-13 17:08:26 +02:00
Christian Prochaska
5b0a8e54f9 ldso: increase size of managed ELF dataspace
The size needs to be increased for Qt5 libraries.

Issue #345.
2013-08-13 17:08:26 +02:00
Christian Prochaska
fd11bd489e base: increase maximum file name length
This patch increases the maximum file name length to support
'qt5_qnitpickerviewwidget.lib.so'.

Issue #345.
2013-08-13 17:08:26 +02:00
Christian Prochaska
58e8481793 Implement more 'pthread' functions.
Issue #345.
2013-08-13 17:08:26 +02:00
Martin Stein
bb00aebc9e hw & signal: consider initial SLAB blocks
By now Signal_session_component has allocated initial SLAB
blocks in constructor, wich crashed with the root
components assumptions about the RAM quota needs of
session creation. Thus, if the background allocator was already
exhausted from component allocation the session was created
with broken initial SLAB blocks.

fix #574
2013-08-13 17:08:26 +02:00
Josef Söntgen
9b28395f0d noux: construct new child only if binary is valid
If a script is executed which uses a interpreter that does not exist the
construction of the child fails and potentially leaks memory because the
wrong delete operator is called.
Therefore the binary dataspace of the script and the binary dataspace of
the interpreter are now checked before a new child will be created.

Fixes #812.
2013-08-13 17:08:26 +02:00
Christian Prochaska
3ec16da03f libports: add ICU library
The ICU (International Components for Unicode) library is needed for Qt5.

Fixes #828.
2013-08-13 17:08:26 +02:00
Christian Prochaska
6741af07aa stdcxx: create 'typeinfo' symlink
The 'typeinfo' header file is needed by the ICU library.

Issue #828.
2013-08-13 17:08:26 +02:00
Norman Feske
c4627fab44 Update os/doc/init.txt with affinity information 2013-08-13 17:08:25 +02:00
Norman Feske
35723d813d core: evaluate CPU session affinity argument 2013-08-13 17:08:25 +02:00
Norman Feske
5ec07614e8 init: Read affinity assignments from config
The assignment of affinities consists of two parts, the definition
of the affinity space dimensions as used for the init process, and
the association sub systems with affinity locations (relative to the
affinity space). The affinity space is configured as a sub node of the
config node. For example, the following declaration describes an
affinity space of 4x2:

<config>
  ...
  <affinity_space width="4" height="2" />
  ...
</config>

Subsystems can be constrained to parts of the affinity space using
the '<affinity>' sub node of a '<start>' entry:

<config>
  ...
  <start name="loader">
    <affinity xpos="0" ypos="1" width="2" height="1" />
    ...
  </start>
  ...
</config>
2013-08-13 17:08:25 +02:00
Norman Feske
9111f060f5 Shortcut for 'Xml_node::Attribute::value()'
Also provide accessor function 'has_attribute'.
2013-08-13 17:08:25 +02:00
Norman Feske
fd95637289 Interface for setting CPU connection affinity 2013-08-13 17:08:25 +02:00
Alexander Boettcher
2e6504df62 run: disable libc_ffat test for some qemu versions
Disable qemu version known to be not working with the atapi driver.

Issue #827
2013-08-13 17:08:25 +02:00
Alexander Boettcher
6c994d19fe lwip: use alignment solely of 4
Temporarily 64bit fix for issue #817.
2013-08-13 17:08:25 +02:00
Norman Feske
6d837c9e26 Attach affinity information to session requests
This patch extends the 'Parent::session()' and 'Root::session()'
functions with an additional 'affinity' parameter, which is inteded to
express the preferred affinity of the new session. For CPU sessions
provided by core, the values will be used to select the set of CPUs
assigned to the CPU session. For other services, the session affinity
information can be utilized to optimize the locality of the server
thread with the client. For example, to enable the IRQ session to route
an IRQ to the CPU core on which the corresponding device driver (the IRQ
client) is running.
2013-08-13 17:08:25 +02:00
Alexander Boettcher
f1af8e371d nova: unify code for normal and server threads 2013-08-13 17:08:25 +02:00
Norman Feske
5fe29e8e4a Express affinities via Cartesian coordinates
This patch introduces new types for expressing CPU affinities. Instead
of dealing with physical CPU numbers, affinities are expressed as
rectangles in a grid of virtual CPU nodes. This clears the way to
conveniently assign sets of adjacent CPUs to subsystems, each of them
managing their respective viewport of the coordinate space.

By using 2D Cartesian coordinates, the locality of CPU nodes can be
modeled for different topologies such as SMP (simple Nx1 grid), grids of
NUMA nodes, or ring topologies.
2013-08-13 17:08:24 +02:00
Alexander Boettcher
fa7329a3e6 run: remove duplicated include in seoul-fancy
Fixes #820
2013-08-13 17:08:24 +02:00
Alexander Boettcher
70d0b00dde nova: update to kernel revision r3
r3 contains the recent Nova upstream kernel version plus the Genode specific
extensions and changes as known from r2.

Additionally, the r3 branch

* contains the assign_pci patch now directly,
* adds support for cross CPU IPC,
* fixes some issues with freeing up kernel memory part of r2 and
* update the documentation a bit.

Fixes #814
2013-08-13 17:08:24 +02:00
Alexander Boettcher
071ca39407 run: make bomb test ready for auto tests 2013-08-13 17:08:24 +02:00
Alexander Boettcher
2e58428b51 run: Rpc_entrypoint test running on multiple CPUs
Add run script to autopilot list

Issue #814
2013-08-13 17:08:24 +02:00
Alexander Boettcher
9e8255948d base: add affinity to rpc_entrypoint constructor
Issue #814
2013-08-13 17:08:24 +02:00
Alexander Boettcher
0e83b0b093 nova: create core threads on boot cpu
The boot CPU is not necessarily 0 as currently assumed for base-nova.
Replace all hard coded values by the actual boot cpu number.

Issue #814
2013-08-13 17:08:24 +02:00
Alexander Boettcher
0079179f05 base: store initial ax and di registers in crt0.s
The values are used by a follow up commit by nova to get the boot CPU number.

Issue #814
2013-08-13 17:08:24 +02:00
Alexander Boettcher
fdaeda47bb run: extend affinity test
* read out supported number of CPUs
* start per CPU a thread
* monitor by main thread liveness of remote CPU threads
* add a round variable
* terminate run script after a specific round or after 90s
* on qemu wait 5 rounds, on native runs 40

Add run script to autopilot list

Issue #814
2013-08-13 17:08:24 +02:00
Alexander Boettcher
683832f461 base: avoid deadlock if invalid object is called
This avoids a deadlock if during issuing a printf the low level IPC fails.
. Printf uses an address space local lock and if we are trying again
to make a printf we deadlock forever ...
2013-08-13 17:08:23 +02:00
Alexander Boettcher
4e47cd2568 nova: catch exception when leaving thread::entry()
Catch exceptions and try to make a printf. If this also fails, catch
it and die causing some noise output in core to detect the situation.
2013-08-13 17:08:23 +02:00
Alexander Boettcher
8655b58953 nova: show client name for unhandled page faults
This patch eases debugging.
2013-08-13 17:08:23 +02:00
Alexander Boettcher
4e2e79bf4f nova: create pager/server thread on specific cpus
issue #814
2013-08-13 17:08:23 +02:00
Alexander Boettcher
4ae1faf14d base: add affinity support to pager construction
Propagating the affinity information is needed to allow for assigning
a pager thread that is local to the CPU of the to-be-created thread.

issue #814
2013-08-13 17:08:23 +02:00
Alexander Boettcher
e171683b8c nova: support setting affinity via cpu session
issue #814
2013-08-13 17:08:23 +02:00
Alexander Boettcher
435b8dd252 foc: determine number of CPUs
Issue #814
Fixes #578
2013-08-13 17:08:23 +02:00
Alexander Boettcher
1a82b664ef nova: determine number of CPUs
Issue #813
2013-08-13 17:08:23 +02:00
Josef Söntgen
b5739fc520 ports: add grep and sed to noux_tool_chain
Fixes #821
2013-08-13 17:08:23 +02:00
Josef Söntgen
5cf4e323c5 Noux: add noux-pkg/grep 2013-08-13 17:08:22 +02:00
Josef Söntgen
2aafc9d4e6 Noux: add noux-pkg/sed 2013-08-13 17:08:22 +02:00
Sebastian Sumpf
8f3413f487 usb_drv: Fix USB storage for x86 on hardware
Also fix 'usb_storage.run' for x86

Fixes #822
2013-08-13 17:08:22 +02:00
Norman Feske
956cab5fdb noux: Keep track of how dataspaces are used
This patch eliminates the "no attachment at..." warnings, which
were caused by a use-after-free problem of dataspaces. When a
dataspace was destroyed, the users of the dataspace were not
informed and therefore could not revert possible attachments to
RM sessions. The fix introduces a callback mechanism that allows
dataspace users (i.e., RM regions) to register for the event that
a dataspace vanishes.

The following types of dataspaces are handled:
* RAM dataspaces
* ROM dataspaces
* The process binary
* The binary of the dynamic linker
* Args dataspace
* Sysio dataspace
* Env dataspace
* managed RM dataspaces

The handling of ROM dataspaces is still not complete. When forking,
the ROM dataspace of the parent process gets just reused without
creating proper meta data ('Dataspace_info') for the forked process.
Similar issues might arise from other special dataspaces (e.g.,
args, env, sysio).

This patch removes all "no attachment at..." warnings except for
one (an attachment at 0).

Issue #485
2013-08-06 17:40:10 +02:00
Sebastian Sumpf
959282403c l4linux: Update to L4Linux l4box 3.9.0-l4-svn37
This is the Genode side of the L4Linux update to r37. I also moved L4Linux
sources to GitHub.

Issue #819
2013-08-06 17:40:10 +02:00
Sebastian Sumpf
7a4f98f2ed foc: SVN revision r56
Genode side of the update.

Issue #819
2013-08-06 17:40:10 +02:00
Christian Prochaska
dc177e037d bash: don't call 'check_dev_tty()'
The 'check_dev_tty()' function calls 'ttyname()', which calls the pthread
stub function 'pthread_main_np()', which prints a 'not implemented'
message. Calling 'check_dev_tty()' doesn't seem to be necessary, so this
patch removes the call.

Issue #815.
2013-08-05 15:18:03 +02:00
Christian Prochaska
adf895acad Print pthread stub messages to Genode log console
With this patch, the 'not implemented' messages of the pthread function
stubs always get printed to the Genode log console instead of stdout.

Issue #815.
2013-08-05 15:17:42 +02:00
Alexander Boettcher
9b6d37649b run: restrict noux-auto to platforms known to work
* add to autopilot list

Issue #591
2013-08-05 15:16:11 +02:00
Alexander Boettcher
01d267e551 noux: calculate rm::attach parameters correctly
Previous commit denies the creation of regions larger then the dataspace.
Noux does it by setting the default size to the dataspace size without
subtracting the offset.

Fixes #591
2013-08-05 15:15:56 +02:00
Alexander Boettcher
717be91e16 base: deny region creation exceeding size of a ds
The rm_session implementation expects that offset + size must be
part of one dataspace. Unfortunately the parameters are not checked
properly during an rm::attach.

During an detach memory behind the actual region can be unmapped by such
bogus region entries.

Issues #591
2013-08-05 15:15:40 +02:00
Christian Prochaska
09049278a6 Round up RM session size to page granularity
Since RM sessions can be used as dataspaces and dataspace sizes are
supposed to have page granularity, RM session sizes should have page
granularity, too.

Fixes #799.
2013-07-18 11:56:44 +02:00
Alexander Boettcher
b1cb1ceaf9 seoul: fix disc boot
Additionally use the block session interface asynchronously to let the VM
continue execution.

Fixes #806
2013-07-18 11:55:18 +02:00
Alexander Boettcher
b9449a4279 seoul: fix console output in vga text mode
Issue #806
2013-07-18 11:55:18 +02:00
Alexander Boettcher
b4283c9121 seoul: use utcb guard
Forgetting to restore the old utcb content results in hard to debug bugs.
Save only the amount of word items which are actually on the UTCB.

Issue #806
2013-07-18 11:55:18 +02:00
Alexander Boettcher
b9e48e94ec seoul: catch exception during block session creation
Leads to invalid utcb state and later on to invalid vCPU state.

Issue #806
2013-07-18 11:55:18 +02:00
Alexander Boettcher
8afcbce01e seoul: implement heap_free
Avoids the message

cxx: operator delete (void *) called - not implemented. A working implementation is available in the 'stdcxx' library

during a " new ..." which causes exceptions. Happens for seoul in disk.cc

Issue #806
2013-07-18 11:55:17 +02:00
Alexander Boettcher
4e8d0618bb seoul: split vancouver run script into smaller ones
Issue #806
2013-07-18 11:55:17 +02:00
Alexander Boettcher
ff0eb93569 run: dump output of noux_net_netcat
Issue #742
2013-07-16 17:26:55 +02:00
Alexander Boettcher
61a3f8c2af pistachio: exclude io memory from ram allocator
Fixes #798
2013-07-16 16:23:49 +02:00
Alexander Boettcher
5094b79a31 pistachio: return kip structure from get_kip
to avoid lot of unnecessary casts afterwards

Issue #798
2013-07-16 16:23:49 +02:00
Josef Söntgen
505f4290ec base: activate Rpc_entrypoint explicitly in dtor
The Rpc_exit call is delivered via RPC which results in a deadlock
if the Rpc_entrypoint has not been started yet. To prevent this
situation we active the Rpc_entrypoint explicitly before we call
Rpc_exit.

Fixes #811.
2013-07-16 12:32:29 +02:00
Stefan Kalkowski
a341f744ce Cortex A15: temporarily remove -mcpu switch again
Make compiler stop complaining about every compilation unit.

Fixes #810.
2013-07-16 12:29:47 +02:00
Sebastian Sumpf
dae8ca2952 usb_drv: Remove wait events for Nic
'alloc_skb' might now fail, the Nic component will then send a 'packet
available' signal and return. Fix broken SKB list implementation as well as
completely bogus initialization of SKBs.

Related to #778.
2013-07-15 17:11:06 +02:00
Alexander Boettcher
99ae463e5c run: zero pad hello.py to succeed on OKL4
Fixes #804.
2013-07-15 17:06:27 +02:00
Stefan Kalkowski
5d75e6676d run-tool: be more failure tolerant in spawn_serial
Fixes #809
2013-07-15 13:06:08 +02:00
Stefan Kalkowski
09d81759ee run-tool: unify building of u-boot image (fix #807) 2013-07-15 11:13:28 +02:00
Martin Stein
6c7a25d08c base-hw: use generic signal_session/connection.h
base-hw extended the signal quota in a specific connection
implementation, which just conceals other issues if quota upgrade is
triggered.

Fixes #410.
2013-07-12 16:41:33 +02:00
Stefan Kalkowski
b3eecfcced base-foc: Improve documentation of capability enums
Fixes #568
2013-07-12 15:33:27 +02:00
Stefan Kalkowski
e717ad656f base-hw: preserve symbolic link bin/core
In this case "mv A B" works slightly different than "cp A B; rm A" as
symbolic links come into play. The statements should copy the contents
of A into the symboliv link at B (preserving it as is) and remove A. The
mv would replace the link B by the binary A.

Fixes #805.
2013-07-12 15:23:33 +02:00
Stefan Kalkowski
76d449ebe6 Start receiver thread in LwIP after initialization
Otherwise the receiver thread might access variables not initialized properly,
and thereby raising pagefaults.

Fixes #802
2013-07-11 17:35:24 +02:00
Stefan Kalkowski
03538a1c3b Disable run test for base-hw as long as it fails
Ref #801
2013-07-11 16:40:42 +02:00
Alexander Boettcher
4dd9172888 run: add success message to lx_hybrid_pthread_ipc 2013-07-11 12:44:24 +02:00
Stefan Kalkowski
ef4027a7a8 Disable noux run script for i.MX53 platform
This platform misses necessary UART driver support.
2013-07-11 12:44:24 +02:00
Alexander Boettcher
86d323d3cf run: disable network tests for imx53
We have no network driver on this platform by now.
2013-07-11 12:44:24 +02:00
Stefan Kalkowski
946bd297e6 Add -mcpu flag to ARM CPU spec files (Ref #797)
When using certain assembler instructions, e.g. 'smc' that are
only available on some CPUs of the same architecture like ARMv7a,
it's necessary to specify the target CPU for the assembler. Otherwise
it will complain about.
2013-07-11 12:44:24 +02:00
Sebastian Sumpf
2dce04618e atapi_drv: Implement LBA48 specific block count
Use NATIVE MAX ADDRESS EXT to retrieve last block for LBA48. Also check not only
for enabled LBA48 support but for the 'host protected area' bit before using the
LBA48 version. This is because the high order byte (HOB) data retrieval is
broken in Qemu.

Fixes #761.
2013-07-11 12:44:18 +02:00
Alexander Boettcher
861bbc81a3 run: check size of reported disc in part_blk
Triggers bug if LBA48 mode is used.

Issue #761
2013-07-11 12:40:19 +02:00
Stefan Kalkowski
ba273fb6fb base-hw: disable L2 cache on Pandaboard (fix #797)
* Fix bitfield typo in TTBR0 register for ARMv7
2013-07-11 12:40:19 +02:00
Alexander Boettcher
731493641b run: add netperf tests to autopilot list
* native Genode (using lwIP) netperf
as
* L4Linux netperf
2013-07-11 12:40:19 +02:00
Alexander Boettcher
1fa27bb16c run: prepare netperf l4lx output for post processing
Issue #794.
2013-07-11 12:40:10 +02:00
Alexander Boettcher
bdd145f62d run: split netperf l4linux script
Split the netperf run script into 3 ones so that it can be used more easily
in an automated run.

It is solely for foc_arndale by now.

l4linux_netperf.run        - use nic via usb2.0
l4linux_netperf-usb30.run  - use nic via usb3.0
l4linux_netperf-bridge.run - use nic via usb3.0 + bridge
2013-07-11 11:02:04 +02:00
Alexander Boettcher
a1a790664e run: check for netperf version in user environment
For L4linux version on foc_arndale.
2013-07-11 11:02:04 +02:00
Alexander Boettcher
05d807db75 run: split native Genode netperf script
Split the netperf run script into 3 ones so that it can be used more easily
in an automated run.

netperf.run        - use native nic driver (x86) or usb2.0 (arndale, panda)
netperf_usb30.run  - use native nic driver (x86) or usb3.0
netperf_bridge.run - use native nic driver (x86) or usb3.0 (arndale) and bridge

Issue #794
2013-07-11 11:01:37 +02:00
Alexander Boettcher
400037a5b0 run: check for netperf version in user environment
For native Genode netperf port.
2013-07-09 18:57:30 +02:00
Christian Helmuth
4807d469ca Revert "usb_drv: Wait for IRQ on SKB exhaustion"
The fix overly influences gigabit ethernet performance (~200 MBit), so,
we need to investigate further.

This reverts commit aacb91f22a.

Reopen #788.
2013-07-08 15:55:31 +02:00
Alexander Boettcher
241c0f38a4 run: remove tar file also after native runs
Fixes #679
2013-07-05 12:46:56 +02:00
Norman Feske
92cb97c05b Let Git ignore libports/include/x86emu
The headers are mere symlinks created via 'make prepare'.
2013-07-05 12:43:26 +02:00
Christian Prochaska
02c0fa85cf nic_bridge: increase entrypoint stack size
Issue #782
2013-07-05 12:37:43 +02:00
Christian Prochaska
c962240922 crt0 cleanup
- use the generic 'crt0.s' for Linux
- move the read-only '__dso_handle' definition into the '.text' section
- move the '__initial_sp' definition into the '.bss' section
- remove the '_main_utcb' definition

Part of #766.
2013-07-05 12:37:43 +02:00
Martin Stein
1b96e8a7e1 hw: use generic genode.ld
Ref #766
2013-07-05 12:37:43 +02:00
Martin Stein
ee4c98e093 base: provide BSS boundary marks in genode.ld
This enables us to use the generic linker script for
base-hw also.

Ref #766
2013-07-05 12:37:43 +02:00
Martin Stein
6b42fff30e hw: use generic crt0.s for progs other than core
Use '__initial_sp' instead of '_main_utcb' to receive a main threads
UTCB pointer outside core.

Ref #766
2013-07-05 12:37:42 +02:00
Martin Stein
e20b773bef hw & arm: use sp to hand out main UTCB pointer
Also don't hand out UTCB pointers to cores main thread and to threads
other than main threads.

Ref #766
2013-07-05 12:37:42 +02:00
Martin Stein
5a3e340699 hw: initialize Platform_thread::_main_thread right
Ref #766
2013-07-05 12:37:42 +02:00
Josef Söntgen
cb76c0c45f core: remove hardcoded 'init' from Log output
Until now the print procedure call in the Log_session_component
did contain a hardcoded 'init' string. Adding a method to filter
the session args to prefix the label and labelling the initial
Cpu_connection for the init-process enabled us to remove the
hardcoded string.

Fixes #789.
2013-07-05 12:37:42 +02:00
Josef Söntgen
136af3764d core: add session args filter to Core_child
Add the filter_session_args() method to Core_child to prefix the labels
of its children.

Fixes #789.
2013-07-05 12:37:42 +02:00
Josef Söntgen
4ba17f7ebd core: use label for init's Cpu_session
Fixes #789.
2013-07-05 12:37:42 +02:00
Josef Söntgen
dad3f32d0b linux: thread name wrongly truncated by one byte
The terminating NUL char was not considerd in the calculation of
the space needed for storing the string.

Fixes #790.
2013-07-05 12:37:42 +02:00
Josef Söntgen
29b8370f73 noux: add local cpu and ram service
Use a local CPU service to prevent a redirection to noux' parent (in
this case init which does not know noux' local capabilities).

Fixes #791.
2013-07-05 12:37:42 +02:00
Josef Söntgen
9ec791db9a base: add method to withdraw memory w/o allocating
The given number of bytes is consumed but not actually allocated. This
feature may be used for accounting and use memory within core which is
in fact provided by a session client.

Fixes #792.
2013-07-05 12:37:42 +02:00
Stefan Kalkowski
0ba40d01ca Don't use daemonized telnet in netcat run-script
Fix #782
2013-07-05 12:37:42 +02:00
Norman Feske
b7e553d4db nic_bridge: Documentation update 2013-07-05 12:37:41 +02:00
Norman Feske
129c77f02b doc: Update location of VESA driver 2013-07-05 12:37:41 +02:00
Stefan Kalkowski
1904a223e8 Check md5 sum of initramfs file in l4lx run-script
* Always download md5sum file and check downloaded binaries
* Extend sleep time in l4linux_netperf script, so that DHCP has enough time
* Fix regexp rule in l4linux_netperf run script to work with MAC addresses
  containing only numbers

Fix #787
2013-07-05 12:37:41 +02:00
Sebastian Sumpf
aacb91f22a usb_drv: Wait for IRQ on SKB exhaustion
Do not use 'wait_event' when SKB-backend allocation fails, explicitly wait for
an interrupt, which in turn frees SKBs, instead.

Fixes issue #788
2013-07-02 08:50:40 +02:00
Norman Feske
2045fffe2a ports-foc: assert use of 32-bit platforms
L4Linux does not support x86_64. Detect this case early in the run
script.
2013-06-30 13:48:10 +02:00
Norman Feske
9bff8c454a ports-foc: Mention prepare step of dde_ipxe
Thanks to Rudolf Weber for reporting.
2013-06-30 13:44:40 +02:00
Martin Stein
0613e52a49 ahci & exynos5: adjust ouput format in ahci_bench 2013-06-28 17:23:31 +02:00
Martin Stein
4fe093b01b ahci & exynos5: opt-in app and part in ahci_bench 2013-06-28 17:23:25 +02:00
Martin Stein
118ca20a2f ahci & exynos5: do test repetitions in ahci_bench 2013-06-28 17:23:17 +02:00
Alexander Boettcher
e3c3f9f44f run: restrict ports solely for qemu case
Sometimes the ports are not freed up quick enough by the host system after the
first test finished. The port restriction is mainly required for qemu, so don't
use it for bare metal hardware tests.
2013-06-28 16:21:08 +02:00
Stefan Kalkowski
089f8dcfc8 Extend l4linux_dynamic run-script with SATA driver
* Add platform_drv for usb_drv, sd_card_drv and ahci
* Add ahci driver and part_blk on top of it
* add linux instance using SATA partition
* add VIM using SATA partition
2013-06-28 16:18:15 +02:00
Stefan Kalkowski
9263079f70 USB 3.0 & exynos5: don't close regulator session
When leaving constructor of EHCI & XHCI driver don't close the regulator session,
otherwise it'll power down the device.
2013-06-28 14:27:27 +02:00
Stefan Kalkowski
acc24b5905 Switch off regulators when closing session 2013-06-28 14:24:34 +02:00
Stefan Kalkowski
717e4dd362 Let genode_org run script work on various platforms 2013-06-28 14:22:45 +02:00
Alexander Boettcher
fd7683f6ea lwip: use memcpy of Genode 2013-06-27 20:12:43 +02:00
Alexander Boettcher
4c9cee24de run: add nic_bridge to netperf native test 2013-06-27 20:12:36 +02:00
Alexander Boettcher
776a8d3f8c lwip: set to max snd window which is known to work
The window scale option (http://tools.ietf.org/html/rfc1323) patch of lwIP
definitely works solely for the receive window, not for the send window.
Setting the send window size to the maximum of an 16bit value, 65535,
or multiple of it (x * 65536 - 1) results in the same performance.

Everything else decrease performance.

We will have to check this window scale patch before using higher values.
2013-06-27 20:12:29 +02:00
Alexander Boettcher
4925f77dac run: skip libc_ffat test for non qemu test runs
Print a warning that the sd respectively hard disc must be prepared manually.

Fixes #783
2013-06-27 20:12:23 +02:00
Stefan Kalkowski
68ba7a0b57 L4Linux ARM: enable ext4 by default 2013-06-27 20:03:36 +02:00
Alexander Boettcher
d822b82f5b lwip: align the pbuf on 32 resp. 64 bit addresses
Minor speed improvements of ~6Mbit. Additionally a ethernet frame fits now
into one memory allocation per pbuf. Beforehand two were allocated - one being
1514 bytes and another one being 2 bytes (monitored by instrumenting copy loop
in libports/src/lib/lwip/platform/nic.cc).
2013-06-26 17:42:11 +02:00
Alexander Boettcher
8d9e7d0da2 lwip: set some reasonable default rcv buf size
lwip reports via getsockopt the size of the default size of the receive buffer
to the netperf server. lwip returns 2GB and netperf server uses this value to
allocate some buffers - which of course fails with out of memory.

Reduces the "default size" to some smaller value.

With the commit we are not forced anymore to (but still can) use specific
netperf client options regarding memory allocations of the receive buffer.
2013-06-26 17:42:02 +02:00
Alexander Boettcher
e35dbd3353 run: add TCP_MAERTS to netperf test
MAERTS is STREAM backwards and effectively lets the netserver sends the packets
to the netperf client. So, TCP_STREAM measure the receive performance of the
lwIP stack on Genode and TCP_MAERTS the send performance of the lwIP stack
on Genode.
2013-06-26 17:41:54 +02:00
Martin Stein
198f8b65a4 ahci & exynos5: compliant exceptions on creation
Use Root::Unavailable exceptions instead of driver specific ones
on session construction.
2013-06-26 16:02:30 +02:00
Stefan Kalkowski
cfa3d38417 Use Genode's memcpy in L4Linux block driver 2013-06-26 16:02:20 +02:00
Martin Stein
276dbdab60 l4lx: raise block TX buffer size to 5 MiB
Buffer sizes lower than 5 MiB slow down the Arndale AHCI benchmark
with fast 6 Gbps SSDs and 1MiB blocks.
2013-06-26 16:02:13 +02:00
Martin Stein
9d23cdc27f part_blk: raise max packet size to 1 MiB
This is because the old packet size of 128 KiB slowed
down l4linux AHCI benchmark on arndale with large block sizes.
2013-06-26 15:05:20 +02:00
Martin Stein
3fb7e74287 ahci & exynos5: avoid large DMA buf in AHCI bench
Normally this bench has read all data to one large buffer and
than written it back to the drive but for SATA 3 (6 Gbps) benchmarks
we would need a buffer of approximately 1.2 GB to do it this way
and reach 2 seconds bench time. Thus we use a buffer of SATA request size
and override it with every request.
2013-06-26 15:05:20 +02:00
Martin Stein
0ad284febe ahci & exynos5: AHCI (+ part_blk) bench in l4linux 2013-06-26 15:05:19 +02:00
Martin Stein
ad3427e857 ahci & exynos5: allow 6 Gbps port speed 2013-06-26 15:05:15 +02:00
Martin Stein
da930d146f ahci & exynos5: enable SSDs like OCZ Agility 3
Declare ATA device-register structure and check it with more detail.

Fasten error recovery about 9 ms.
2013-06-26 15:05:11 +02:00
Stefan Kalkowski
770157fea0 Enable re-use of singleton, but closed IRQ session
Fix #784
2013-06-26 14:27:19 +02:00
Stefan Kalkowski
664d0036c8 Use cpu regulator in cli_monitor only on Arndale
This commit splits the Fiasco.OC-specific extension for the cli_monitor
into one for the Arndale platform, and one for all others. On Arndale
we add the cpu_frequency command beside the ones defined on all platforms.
2013-06-26 11:29:26 +02:00
Alexander Boettcher
9f2097669a netperf: add support to timeout if host went away 2013-06-25 17:42:42 +02:00
Alexander Boettcher
5d79c6be1a lwip: increase send performance for arndale USB2.0
Getting up to 91 Mbit out of a 100 Mbit card.
2013-06-25 17:42:42 +02:00
Alexander Boettcher
8a623c6317 lwip: support send, recv timeouts 2013-06-25 17:42:42 +02:00
Alexander Boettcher
494bb8ff0d run: print packets/s at end of netperf script 2013-06-25 17:42:42 +02:00
Alexander Boettcher
4bffa249fd lwip: tweak foc_panda to netperf tcp >90MBit/s 2013-06-25 17:42:42 +02:00
Alexander Boettcher
f1c99b190f run: add platform_drv to netperf run script 2013-06-25 17:42:42 +02:00
Alexander Boettcher
ef6450d5d3 run: fix noux_net_netcat for most x86_32 platforms
native pistachio x86 is broken in general

arm fix still pending

Issue #782
2013-06-25 17:36:34 +02:00
Martin Stein
ada408d2f7 ahci & exynos5: enable HDDs like Seagate Barracuda
Initialize and limit port speed to 3 Gbps in general because the Seagate
Barracuda 1TB throws much errors with 6 Gbps by now.

Try all port speeds from the highest to the lowest as long as debouncing fails
and try them all again in this order when falling back to slower debouncing.

Try to recover from all types of interface error.

When a port was recovered from an error during a NCQ command
get the last LBA that was accessed successfully and continue command from
this point.

Use a platform driver through the 'Regulator' service to do CMU and PMU config.

Switch off verbosity by default.
2013-06-25 16:35:22 +02:00
Martin Stein
686c551b66 ahci & exynos5: driver internal benchmark
To raise expressiveness of the benchmark it dynamically adjusts the
transfer amount at any test to get a result that was measured
over a transfer time of 2000 ms at least and 2300 ms at a max.
2013-06-25 15:08:33 +02:00
Martin Stein
6ae5d3a04b ahci & exynos5: basic recovery from NCQ errors
Fix little bugs in scatter/gather-list setup, FIS creation, and
command-slot creation of Exynos5 AHCI driver.
2013-06-25 15:00:52 +02:00
Martin Stein
53b186fe01 ahci & exynos5: enable SSDs like Samsung 840 Pro
* Retry debouncing first with a higher trial time and if this also doesn't
  work with lower link speed additionaly.
* Ignore DevSlp feature because it isn't needed anyway as far as i can see.
* Relax some restrictions according the feedback of the drive as far as it
  seem to have no effect in Linux too

Fix #753
2013-06-25 15:00:42 +02:00
Martin Stein
c93e770316 ahci & exynos5: use platform driver in AHCI test 2013-06-25 15:00:35 +02:00
Martin Stein
0c7c285079 mmio: provide basic verbosity
The verbosity must be enabled at two levels: at compile time
via an enum that switches the availability of verbosity code
and via two members of 'Mmio' named '_read_verbose' and
'_write_verbose'. The latter are initialized to 0 (change this to
enable verbosity globally) and can be used to locally enable
(or disable) verbosity in deriving classes.

Ref #753
2013-06-25 14:52:53 +02:00
Stefan Kalkowski
e23f24505b Add platform_drv to relevant run-scripts (fix #778) 2013-06-25 14:37:03 +02:00
Stefan Kalkowski
ae49f6216d Add regulators for EHCI controller on Arndale
Fix #780
2013-06-25 14:36:57 +02:00
Alexander Boettcher
059bf1c576 nova: fix page fault during core bootup
Fixes #781
2013-06-25 11:16:22 +02:00
Stefan Kalkowski
a73dc1b581 Fix coding style in regulator interface (fix #777) 2013-06-25 11:10:59 +02:00
Stefan Kalkowski
5a3c2c33b7 Add 'cpu_frequency' command to cli_monitor (fix #776)
This commit extends the Fiasco.OC specific extensions of the cli_monitor
to enable the user to interactively change or show current CPU frequency
2013-06-25 11:10:58 +02:00
Christian Prochaska
cb01f75a9d foc-arndale: use same context area location
Currently, on the Arndale platform, core uses a different thread context
area base address than the other tasks (0x20000000 vs. 0x40000000). This
is problematic, because core calculates the location of the UTCB area of a
new thread relatively to core's own thread context area base. So, the UTCB
area of non-core threads ends up in a virtual address range which is
outside of the task's thread context area and not marked as used in the
task's RM session.

With this patch, the same thread context area base address gets used in
core and in the other tasks.

Fixes #779.
2013-06-25 11:10:58 +02:00
Stefan Kalkowski
a4eb4bfa07 Arndale: save power by default (Fix #774)
* Use regulator interface in eMMC driver to enable its clock
2013-06-24 11:50:53 +02:00
Sebastian Sumpf
cc0f4bc9d2 usb_drv: Fix performance of ASIX AX88772
Caused by #773
2013-06-24 11:48:37 +02:00
Sebastian Sumpf
98ee7612f1 base: ARM-FPU 'memcpy_cpu' implementation
Added spec file for ARM-VFPv3 floating-point unit. This shadows
'base/include/arm/' with 'base/include/arm/vfp' and enables a 'memcpy_cpu'
version that mainly uses the FPU. Enabled VFP support for 'foc_arndale'.

Ref #773
2013-06-24 11:48:37 +02:00
Sebastian Sumpf
71490e131b usb_drv: Dimension queues for usbnet
+ Some code cleanup

Ref #773
2013-06-24 11:48:37 +02:00
Sebastian Sumpf
c3537d175c usb_drv: Use platform drivers and regulator
Ref #773
2013-06-24 11:48:37 +02:00
Stefan Kalkowski
f7034369b2 Extend clock and power units in platform driver
* Add clock and power management for SATA and USB3.0 for Arndale

Fix #771
2013-06-24 11:48:37 +02:00
Stefan Kalkowski
1d34589f84 Implement cpu frequency scaling for Arndale
* Implements platform driver for Arndale providing Regulator for CPU clock
* Implements a cpu frequency scaling test using the affinity test
* Fixes #770
2013-06-24 11:48:36 +02:00
Stefan Kalkowski
8fb8cf1c8b Implement abstract regulator session interface
Ref #770
2013-06-24 11:48:36 +02:00
Sebastian Sumpf
231d92f88a usb: Fix AX88179 receive CRC errors
Call 'set_multicast' and 'link_reset' during card startup. Increase TX skb
buffer allocator.

Ref #773
2013-06-24 11:48:36 +02:00
Sebastian Sumpf
8cf893e8c6 ports-foc: Add l4linux netperf run script
Ref #773
2013-06-24 11:48:36 +02:00
Alexander Boettcher
52cf25982a run: clean pulsar config file during a clean_run
tool/autopilot complains about this left over file
2013-06-17 12:14:10 +02:00
Alexander Boettcher
e5eeda2ec9 run: support TFTP servers using absolute paths
TFTP server requiring absolute directory names are supported (better) -
specify in RUN_OPT "--tftp-absolute" to create Pulsar config with absolute
path names for PXE boot.

Additional a symbolic link is created from the build directory to
"$PXE_TFTP_DIR_BASE$PXE_TFTP_DIR_OFFSET" automatically. This eases the use
together with autopilot for x86.
2013-06-14 14:27:14 +02:00
Alexander Boettcher
1b60fd6147 run: power off only the port which was switched on 2013-06-12 15:32:26 +02:00
Alexander Boettcher
27b6839ee0 fiasco: use bender, read out comport from BDA
Fix #768
2013-06-12 11:36:14 +02:00
Alexander Boettcher
bdd2935d4a pistachio: use bender, read out comport from BDA
Issue #768
2013-06-12 11:36:14 +02:00
Alexander Boettcher
1887222b53 okl4: use bender, read out comport from BDA
Issue #768
2013-06-12 11:36:14 +02:00
Alexander Boettcher
32fb7bbddd foc: add 'bender' to pulsar run script
Depends on - https://github.com/ssumpf/foc/pull/4 - which adds BDA read out
of I/O ports to FOC kernel.

Issue #768
2013-06-12 11:36:14 +02:00
Stefan Kalkowski
c61d832ae3 Fix nic_loopback, after recent NIC session changes
Commit c464ee2e6673fe328a8717342dca30f3b0204cb8 removed the RX_BUF_SIZE from
the NIC session interface. Mistakenly, the nic_loopback server was missed
when doing this change.
2013-06-12 11:35:13 +02:00
Stefan Kalkowski
e06a154294 Add __initial_sp variable to base-hw specific crt0
Fixes #756
2013-06-12 11:35:13 +02:00
Norman Feske
d0d5ec92b6 ports/libports: Use repository-local PWD
The PWD variable contains the current working directory of the original
location where 'make -C' is executed, not the directory specified as
argument of '-C'. The tools referenced by ports/libports, however,
expect PWD to point to the root of the respective repository.
2013-06-12 11:35:13 +02:00
Norman Feske
d2e883e235 libports: Fix qoost download 2013-06-12 11:35:13 +02:00
Norman Feske
9d778a658d ports/libports: Avoid multi-target rules
This patch splits the download of signatures from the download of the
archive to improve robustness. This way, signature files will be
downloaded even if the corresponding archive is already in place.

Issue #748
2013-06-12 11:35:13 +02:00
Stefan Kalkowski
853d541340 Let the nic_bridge work event driven (fix #749) 2013-06-12 11:35:13 +02:00
Stefan Kalkowski
153429268e Simplify use of custom data-flow signal handlers
This is analogue to the changes done in packet_stream_tx in commit:
cb9b2724de
2013-06-12 11:35:13 +02:00
Stefan Kalkowski
8fae7131c8 Unify buffer sizes of RX and TX in nic_session
In fact, the sizes were the same the whole time, but by using
the same enum in both cases to instantiate the Packet_stream_tx
and Packet_stream_rx members of the e.g. RPC object, it allows
for more flexible generalization between e.g. source or, sink
objects, when programming event-driven, and implementing generic
handlers for their signals.
2013-06-12 11:35:13 +02:00
Stefan Kalkowski
973efe945b Add sd_card drivers to some run scripts (fix #757)
Moreover, extend l4android script to run on OMAP4 and Exynos5.
2013-06-12 11:35:12 +02:00
Stefan Kalkowski
125d55ce71 Don't abort when reading config in OMAP4 fb driver
Just use configuration values when existent, otherwise when no configuration
is given use the default values. When an incomplete configuration is given,
take the supplied ones, and for the rest the default ones. Fix #762
2013-06-12 11:35:12 +02:00
Stefan Kalkowski
37856a0ad0 Add print-only dummy UART driver for Exynos5 SoC
Fix #759
2013-06-12 11:35:12 +02:00
Stefan Kalkowski
7584bdb22e Fix usb driver configuartion in l4linux run script
Don't use the xhci USB host controller for HID and NIC in the l4linux
run script. It doesn't work on the Pandaboard, and isn't needed for the
Arndale board. Moreover, provide a MAC address, and add a providing
rule in the KDB UART driver to supress ugly warnings. Fix #763
2013-06-12 11:35:12 +02:00
Christian Helmuth
b355897f53 update x86emu to 1.20
+ document x86emu move from os -> libports

Fixes #456
2013-06-12 11:35:12 +02:00
Christian Prochaska
be8a3c6f08 liquid_framebuffer: fix initial window size
Fixes #764.
2013-06-10 10:45:31 +02:00
Norman Feske
179f742924 ports/libports: Handle failed integrity checks
This patch makes the handling of failed integrity checks of 3rd-party
packages more robust. Previously, a once failed 'make prepare PKG=curl'
would not leave any trace of the verification state. Hence, a successive
attempt to perform the 'make prepare' step again succeeded even if the
signature check failed.

To solve this problem, the outcome of a successful signature check is
represented by a tag file called 'download/<archive-name>.verified'.
Because the rule for extracting the archive depends on the .verify tag
file, the extraction step is not performed until the signature check
succeeds.

Issue #748
2013-06-10 10:44:10 +02:00
Stephan Mueller
96e9fcd326 ports: Verify signatures of 3rd-party code
This patch adds integrity checks for the packages of the ports
repository.

Issue #748
2013-06-10 10:44:09 +02:00
Stephan Mueller
64a2447d03 ports: Global variables for integrity check
Add global variables to the signature and hash verification tool to
ports/Makefile for use in the individual make templates.

Issue #748
2013-06-10 10:44:09 +02:00
Stephan Mueller
056e0792e5 libports: Verify signatures of 3rd-party code
This patch adds integrity checks for the packages of the libports
repository.

Issue #748
2013-06-10 10:44:09 +02:00
Stephan Mueller
a140f134c7 libports: Global variables for integrity check
Add global variables to the signature and hash verification tool for use
in the individual make templates.

Issue #748
2013-06-10 10:44:09 +02:00
Stephan Mueller
4f52e793a0 GPG signature verification of tool chain
The downloaded archives for building the tool chain are checked for its
signature before using them. In case of a signature failure, the build
is interrupted.

Issue #748
2013-06-10 10:44:09 +02:00
Stephan Mueller
4c89f4f00f Hash verification tool
This tool verifies the integrity of a given file with a hash. It uses
md5sum, sha1sum and sha256sum as needed.

Issue #748
2013-06-10 10:44:09 +02:00
Stephan Mueller
9b22983e58 GPG signature verification tool
The signature verification tool uses gpg to verify the detached
signature of the given file.

It also tries to obtain the signing key if it is not part of the local
key ring.

Signature verification implies the verification of the integrity and
authenticity of a given file.

Issue #748
2013-06-10 10:44:09 +02:00
Norman Feske
f07973126d News item for Genode 13.05 2013-05-30 10:28:15 +02:00
700 changed files with 36638 additions and 27727 deletions

18
.gitignore vendored
View File

@@ -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
View File

@@ -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':

View File

@@ -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

View File

@@ -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

View File

@@ -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;

View File

@@ -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)

View File

@@ -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)

View File

@@ -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'

View File

@@ -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

View 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);

View File

@@ -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
}

View File

@@ -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

View File

@@ -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());

View File

@@ -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)

View File

@@ -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

View File

@@ -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

View File

@@ -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"

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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 {

View File

@@ -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); }

View File

@@ -0,0 +1,3 @@
include $(REP_DIR)/lib/mk/base.inc
SRC_CC += thread/thread_context_area.cc

View File

@@ -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

View File

@@ -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

View File

@@ -0,0 +1,3 @@
include $(REP_DIR)/lib/mk/base.inc
SRC_CC += thread/arndale/thread_context_area.cc

View File

@@ -0,0 +1,3 @@
include $(REP_DIR)/lib/mk/base.inc
SRC_CC += thread/thread_context_area.cc

View File

@@ -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)

View File

@@ -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
}

View File

@@ -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>

View File

@@ -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]);

View File

@@ -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

View File

@@ -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);
/***********************************

View File

@@ -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();
};

View File

@@ -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

View File

@@ -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(); }
/***************************************

View File

@@ -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) { }

View File

@@ -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;

View File

@@ -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),

View File

@@ -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

View File

@@ -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;
}
}
/*

View File

@@ -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()) { }
};

View File

@@ -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_ */

View File

@@ -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

View File

@@ -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

View File

@@ -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
}

View File

@@ -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;
}

View File

@@ -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;

View File

@@ -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
*

View File

@@ -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 */

View File

@@ -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; }
};
}

View File

@@ -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);
}

View File

@@ -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:

View File

@@ -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();
}

View File

@@ -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
*

View File

@@ -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);

View File

@@ -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);

View File

@@ -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)
{ }

View File

@@ -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

View File

@@ -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

View File

@@ -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)
}
}

View File

@@ -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); }
/*****************************

View File

@@ -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() { }

View File

@@ -1,5 +0,0 @@
LIBS += syscall
include $(BASE_DIR)/lib/mk/startup.inc
vpath crt0.s $(REP_DIR)/src/platform/arm

View File

@@ -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

View File

@@ -1,5 +0,0 @@
LIBS += syscall
include $(BASE_DIR)/lib/mk/startup.inc
vpath crt0.s $(REP_DIR)/src/platform/x86_32

View File

@@ -1,5 +0,0 @@
LIBS += syscall
include $(BASE_DIR)/lib/mk/startup.inc
vpath crt0.s $(REP_DIR)/src/platform/x86_64

View File

@@ -46,3 +46,4 @@ build_boot_image $boot_modules
run_genode_until "--- finished pthread IPC test ---.*\n" 10
puts "Test succeeded"

View File

@@ -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);
}

View File

@@ -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);
/**

View File

@@ -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);
/*******************************

View File

@@ -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

View File

@@ -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);
}

View File

@@ -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)

View File

@@ -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();

View File

@@ -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:

View File

@@ -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:

View File

@@ -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:

View File

@@ -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')

View File

@@ -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.

View File

@@ -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();

View File

@@ -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(); }
};
}

View File

@@ -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));

View File

@@ -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

View File

@@ -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.

View File

@@ -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>();
}

View File

@@ -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
}

View File

@@ -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();

View File

@@ -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),

View File

@@ -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);
}

View File

@@ -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))(); }

View File

@@ -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