Compare commits

...

431 Commits
13.02 ... 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
Norman Feske
87ac608e61 Release notes for Genode 13.05 2013-05-29 20:57:15 +02:00
Stefan Kalkowski
8ac5ae2248 Increase flexibility for serial devices in run-tool
Instead of using a fixed command like picocom in the run tool,
it's better to have the flexibility to set the whole command that
connects to the serial device. Therefore, it's possible for instance
to connect to a remote serial device exported via TCP/IP by using tools
like socat.
2013-05-28 11:40:56 +02:00
Stefan Kalkowski
5e321732df Make NETIO-230B power plug configureable 2013-05-28 11:33:14 +02:00
Stefan Kalkowski
6826a07133 Fix typo in run tool 2013-05-28 11:24:02 +02:00
Christian Prochaska
4a9b1c6aab base-linux: add ARM support
This patch introduces a new platform 'linux_arm' for building and running
Genode/Linux on an ARM device.

Known limitations:

- libc 'setjmp()'/'longjmp()' doesn't currently save/restore floating
  point registers

Fixes #746.
2013-05-24 14:55:37 +02:00
Christian Prochaska
314d5c0975 liquid_fb: dynamic reconfiguration support
With this patch, 'liquid_framebuffer' can be reconfigured at runtime.
The configuration arguments are now provided as XML attributes, matching
those for 'nit_fb'. Furthermore, two new configuration options are added:

<config ...
  resize_handle="off" - show/hide a resize handle widget in the lower
                        right window corner
  decoration="on"     - show/hide window decoration
                        (title bar and borders)
/>

Fixes #740
Fixes #14
2013-05-22 21:30:17 +02:00
Norman Feske
cf9eedca47 Window-resize support for liquid_fb
Related to #740.
2013-05-22 21:29:23 +02:00
Sebastian Sumpf
fbbd2018bb usb: Storage support for ARM 2013-05-22 21:01:14 +02:00
Alexander Tarasikov
3cb6de2e69 Implement LCD output and config parsing for omap4
Fixes #743
2013-05-22 18:58:51 +02:00
Martin Stein
ee28a69c98 hw: fully functional Thread_base::cancel_blocking
Thread_base::cancel_blocking brings a thread back to execution
from every state, except the thread is created but not started yet.

Fix #745
2013-05-22 18:53:18 +02:00
Stefan Kalkowski
89a8c2c211 Update run scripts using usb_drv (fix #744)
Updates all run scripts, which use the usb_drv to enable the appropriated
USB host controllers.
2013-05-22 18:52:54 +02:00
Martin Stein
e164671cd1 ahci_drv: basic support for exynos 5
This is a first version of the AHCI driver. It supports SATA HDDs
with UDMA-133 only, up to 6 Gbps and native command queueing.
The more blocks one transfers with one command, the higher is the
chance that the driver produces a fatal handshake error. Nevertheless
the driver is stable with one block per ATA command. Although NCQ is
used the driver doesn't queue multiple commands simultanously.

The driver was tested with a western digital HDD "WDC WD2500BEVS-08VAT1
13.01A13" (250 GB) with hw_arndale (run/ahci) and foc_arndale
(run/ahci, run/l4linux: dd). SSDs were not tested.

Fix #706
2013-05-22 18:36:55 +02:00
Martin Stein
1c38667a96 base: Mmio::wait_for(...) for whole registers
Ref #706
2013-05-22 18:32:05 +02:00
Martin Stein
1a7efc0df1 os: helper Attached_mmio
Genode::Attached_mmio is the fusion of Genode::Attached_io_mem_dataspace
and Genode::Mmio.

Ref #706
2013-05-22 18:32:05 +02:00
Martin Stein
37c2f101b1 ahci_drv: separate PCI specifics from the rest
Ref #706
2013-05-22 18:32:05 +02:00
Martin Stein
2e7802b799 base-hw: flush cached zeroes in 'clear_ds(...)'
Ref #706
2013-05-22 18:32:05 +02:00
Martin Stein
a0d182e25a hw_arndale: userland timer driver
Ref #706
2013-05-22 18:32:05 +02:00
Martin Stein
65136c2289 hw_arndale: use core local timer in kernel
Ref #706
2013-05-22 18:32:05 +02:00
Stefan Kalkowski
1dc9ab9a95 Adapt i.MX53 fb driver to GPIO session changes 2013-05-21 10:10:43 +02:00
Christian Helmuth
df1209aa89 dde_ipxe: use recent iPXE upstream version 2013-05-21 10:08:34 +02:00
Norman Feske
33c5469b92 vancouver: Improved PS/2 mouse backend
The previous version of the PS/2 mouse backend manged mouse motion
events in a strange way, effectively throwing away most information
about the motion vector. Furthermore, the tracking of the mouse-button
states were missing. So drag-and-drop in a guest OS won't work. The new
version fixes those issues. For the transformation of input events to
PS/2 packets, a the Genode::Register facility is used. This greatly
simplifies the code.
2013-05-20 10:54:59 +02:00
Sebastian Sumpf
8708732e9c usb: Upgrade to Linux-3.9.0 stack 2013-05-18 11:23:02 +02:00
Sebastian Sumpf
cda25a481b usb: Make host controller types configurable
The host controller type (u/e/xhci) usded by the drivers can be configured
through attributes of the config node. See: README
2013-05-18 11:23:02 +02:00
Sebastian Sumpf
6d07fff07c usb: ASIX AX88179 Gigabit-Ethernet Adapter support 2013-05-18 11:23:02 +02:00
Sebastian Sumpf
6928821f52 usb: DWC3 and XHCI support
Arndale platform only.
2013-05-18 11:23:02 +02:00
Sebastian Sumpf
5c78ef20a2 usb: Upgrade to Linux-3.9.0-rc8 stack 2013-05-18 11:23:02 +02:00
Sebastian Sumpf
529e791d66 usb: Upgrade to Linux-3.8.6 stack 2013-05-18 11:23:02 +02:00
Sebastian Sumpf
2faca15b2b base-foc: Set executable bit when mapping pages
If these are not set, this leads to page faults, during code execution on
x86_64, ARM, and x86_32 with PAE enabled.
2013-05-18 11:23:02 +02:00
Alexander Boettcher
99421a2a82 run: switch off IP power_plug adapter after test
Avoid running the native machines if not used after test.
2013-05-17 15:24:50 +02:00
Norman Feske
89d0e68983 vancouver: Improve locking scheme
This patch replaces the error-prone manual locking with the use of the
'Synced_interface' for the motherboard and the VCPU dispatcher. It also
removes all globally visible locks. Locks are now explicitly passed to
subsystems when needed.
2013-05-17 12:05:07 +02:00
Norman Feske
c48a7aa27f vancouver: Avoid busy startup synchronizations 2013-05-17 12:05:00 +02:00
Norman Feske
78204b8f49 Utility for synchronizing interface calls 2013-05-17 12:04:45 +02:00
Norman Feske
ba5906e425 vancouver: handle CPUID 0x40000000
This instruction is issued by Linux when the KVM guest support is
compiled in. We have to return deterministic values to let the Linux
kernel survive.
2013-05-17 12:04:40 +02:00
Alexander Boettcher
688375619a run: extend lwip test for arndale board 2013-05-17 12:04:12 +02:00
Alexander Boettcher
b2fee4c7b1 autopilot: option to keep existing test directory 2013-05-17 12:03:57 +02:00
Alexander Boettcher
da310bd726 tool: create appropriate build.conf for hw_arndale 2013-05-17 12:03:33 +02:00
Alexander Boettcher
6e1b9a823d autopilot: redirect stderr to log file 2013-05-17 11:54:01 +02:00
Alexander Boettcher
7566aaebb9 run: add succeeded message to network_test 2013-05-17 11:52:34 +02:00
Alexander Boettcher
6786e6d04c run: support native l4linux test on panda/arndale 2013-05-17 11:52:19 +02:00
Alexander Boettcher
37cde31eb3 run: add support to run noux_net_netcat natively 2013-05-17 11:51:56 +02:00
Norman Feske
8ac6d8c96c base-hw: Support for Raspberry Pi 2013-05-15 20:48:07 +02:00
Norman Feske
65f20262cb base-hw: Enable caches on ARM v6 2013-05-15 20:48:00 +02:00
Norman Feske
d43d9900ab base-hw: Make memory_region_attr CPU-specific
This patch moves the implementation of the 'Arm::memory_region_attr'
function from the generic ARM code to the ARM v6/v7 specific code
to enable the customization of page-table bits depending on the
specific CPU core type. I.e., the ARM1176 apparently does not cope
well with setting the 'Tex::bits(2)' for MMIO mappings.
2013-05-15 20:47:52 +02:00
Norman Feske
71cd7b9d2e base-hw: Avoid early calls of cmpxchg
This patch eliminates calls of 'cmpxchg' prior enabling the MMU. This is
needed because the 'ldrex' and 'strex' instructions do not always work
with MMU and L1 cache disabled, i.e., on Raspberry Pi.
2013-05-15 20:47:46 +02:00
Norman Feske
ddffc8765e core: Be more precise in IO_MEM error message 2013-05-15 20:47:38 +02:00
Norman Feske
ee572e2f8e Add missing session route to printf.run 2013-05-15 20:47:31 +02:00
Norman Feske
0561538919 Spelling fix 2013-05-15 20:47:24 +02:00
Christian Prochaska
ff28ce77b2 libports: update zlib to version 1.2.8
Fixes #741.
2013-05-15 19:58:46 +02:00
Norman Feske
98cb023f1c seoul: Patch executor/build_instructions.py
We need to specify the actual python version in the build_instructios.py
script too.
2013-05-13 14:36:49 +02:00
Stefan Kalkowski
ae291b557d Extend base-hw specific vm-session (fix #738)
Introduce pause syscall for VM objects, and extend the vm-session interface
to support it.
2013-05-10 11:16:13 +02:00
Alexander Tarasikov
d8f0392c9f Add a service to log into a file
Original version by Alexander Tarasikov, refined by Norman Feske.

Fixes #736
2013-05-10 11:16:13 +02:00
Christian Prochaska
33bb8662a0 tool/run: fix 'interact' command invocation
Use the '-i' option to pass the spawn id to the 'interact' command.

Fixes #737.
2013-05-10 11:16:13 +02:00
Stefan Kalkowski
ef4a4ea654 Implement input driver for i.MX53 tablet (fix #724)
The input driver implements support for the Egalaxy touchscreen and
for Freescale's MPR121 capacitative touch buttons.
2013-05-10 11:16:13 +02:00
Stefan Kalkowski
ca92984bcc Simplify GPIO session interface (fix #707)
Changes GPIO session interface to a one-GPIO-pin-per-session style. Moreover,
this commit introduces a generic driver interface for GPIO drivers. Thereby
generalizes root- and session component for GPIO.
2013-05-10 11:16:12 +02:00
Christian Prochaska
562ac7d059 64-bit fixes
Fixes #734.
2013-05-10 11:16:12 +02:00
Alexander Boettcher
138a37765f run: add support for IP power switch NETIO-230B 2013-05-10 11:16:12 +02:00
Alexander Boettcher
ed825c1d46 nova: fix bootstrap bug
commandline_to_basename may adjust the pointer of the string, recalculate the
length accordingly.
2013-05-10 11:16:12 +02:00
Alexander Boettcher
d1f40b86d9 fix use-after-free bug in loader 2013-05-10 11:16:12 +02:00
Alexander Boettcher
3a884bd873 lwip: add "window scaling" support, RFC 1323
Apply patch from lwip webpage to recent lwip git master branch.
2013-05-10 11:16:12 +02:00
Alexander Boettcher
5e91acbaa9 lwip: use git and master branch 2013-05-10 11:16:12 +02:00
Alexander Boettcher
5bbf1f7eea netperf: use omni and rely on SO_RCVBUF available 2013-05-10 11:16:11 +02:00
Alexander Boettcher
2349cd2dc3 lwip: enable SO_RCVBUF socket option
In issue #313 the SO_RCVBUF was intended to be enabled, however the current
lwip port looks for another define LWIP_SO_RCVBUF instead of LWIP_RCVBUF.

Fixes #716
2013-05-10 11:16:11 +02:00
Alexander Boettcher
86e428cd64 port of netperf server to native Genode 2013-05-10 11:16:11 +02:00
Alexander Boettcher
2beb851c5a run: add acpi spec as default to foc/nova 64bit 2013-05-10 11:16:11 +02:00
Alexander Boettcher
aa98450f71 run: use kdb_uart and acpi_drv with l4linux
Test now succeeds also on native x86 32bit hardware.
2013-05-10 11:16:11 +02:00
Alexander Boettcher
1b8e7820d8 run: update tcp_terminal to run in 64bit setups 2013-05-10 11:16:11 +02:00
Alexander Boettcher
94629ad493 run: adjust lwip pingpong test for x86 2013-05-10 11:16:11 +02:00
Christian Prochaska
cab27dd713 run: adjust lwip pingpong test for foc_arndale 2013-05-10 11:16:10 +02:00
Josef Söntgen
0b906207bb run: add lwip pingpong test using tcp 2013-05-10 11:16:10 +02:00
Alexander Boettcher
85c6640795 run: add support to specify 'serial' via RUN_OPT
If the target machine is connected locally one may specify
"serial" as target in the RUN_OPT variable to get the test output.

Used for panda and arndale on foc and hw.
2013-05-10 11:16:10 +02:00
Alexander Boettcher
df985bda84 run: support RUN_OPT for all platforms
Use RUN_OPT="--target ..." to select the backend test method.

Supported values so far:

qemu     - qemu + grub bootloader (default)
qemu+pxe - qemu + pulsar bootloader (PXE)
amt      - Intel AMT (reset+serial output) + pulsar bootloader

Related to issue #598
2013-05-10 11:16:10 +02:00
Alexander Boettcher
5c6f13b0d3 run: lwip use is_qemu 2013-05-10 11:16:10 +02:00
Alexander Boettcher
b5d3be9c85 run: add nic driver performance test
A run script which sends raw ethernet packets from the host machine to the
target machine. Three tests are implemented:
- The network_stat instrumented driver of usb_drv and net_drv
  are used to get the raw receive performance of the network driver.
- A simple nic_session client is receiving from the un-instrumented network
  driver raw ethernet packets.
- A bridge is added between driver and simple nic_session client.
2013-05-10 11:16:10 +02:00
Alexander Boettcher
0920e322c2 net: nic session client using net_stat lib
A simple nic session client using the performance measurement library.
2013-05-10 11:16:10 +02:00
Alexander Boettcher
901439211c net: net_stat instrumented version of usb_drv 2013-05-10 11:16:10 +02:00
Alexander Boettcher
3ace475f2d net: net_stat instrumented version of iPXE driver 2013-05-10 11:16:09 +02:00
Alexander Boettcher
a36813cf6f net: add library for performance measurements 2013-05-10 11:16:09 +02:00
Alexander Boettcher
5249c0875c run: extend noux to run automatically natively 2013-05-10 11:16:09 +02:00
Alexander Boettcher
2a761c7fea run: extend genode_until_run by a spawn id
genode_until_run can be called now with a spawn id to able to reattach to a
spawned process (amt, serial output). Run scripts can now call genode_until_run
multiple times.
2013-05-08 09:42:44 +02:00
Alexander Boettcher
267239147a run: introduce explicit wait_for_output
To be used by base-* run/env scripts
2013-05-08 09:42:44 +02:00
Alexander Boettcher
5485fe6f18 run: add support to query qemu support
To be used by the base-* specific run/env scripts to choose the appropriate
test backend.
2013-05-08 09:42:44 +02:00
Norman Feske
0b660eb033 Blacklist failsafe.run test on L4/Fiasco 2013-05-08 09:38:32 +02:00
Norman Feske
4715ad18b0 Spelling fix 2013-05-07 21:59:15 +02:00
Norman Feske
2aa22a25ee Adapt chroot.run to changed timer 2013-05-07 21:56:07 +02:00
Norman Feske
1589820d05 Add missing route to chroot_loader test
Additionally, we do the cleanup of the remains of a previously failed
run prior creating the run directory. Otherwise, the directly creation
may fail because of a pending bindmount.
2013-05-07 21:56:07 +02:00
Norman Feske
c54fef9274 Add missing route to lx_uid.run 2013-05-07 21:56:07 +02:00
Martin Stein
ef572f7ef8 hw & core: provide env_context_area_rm_session()
Ref #734
2013-05-07 21:56:07 +02:00
Christian Prochaska
ea3adfef9a Create the context area RM session at startup
With this patch, the thread context area RM session gets created at
program startup to have the thread context area's virtual address range
reserved right from the beginning.

Fixes #734.

This patch implies that all Genode processes try to create an RM
session. So a route to the RM service must be present even for processes
that have only a single thread. Hence, the patch contains an update of
affected components.
2013-05-07 21:56:07 +02:00
Christian Prochaska
b8d690b9aa libc_lwip: accept 'AF_INET' sockets only
lwIP only supports the 'AF_INET' domain, but doesn't check the 'domain'
argument of the 'lwip_socket()' function.

This patch avoids an error message from lwIP when the Arora browser
tries to connect a socket of the 'AF_LOCAL' domain.

Fixes #732.
2013-05-07 21:56:07 +02:00
Norman Feske
cc5fddb0a2 Loader: Free entries of parent-service registry
The parent-service registry is populated on demand by the
'Loader::Child' whenever a prior unknown service is requested. Since the
number of parent services is limited, we expect the registry to settle
after a while. However, each loader session has a private instance of
a parent-service registry. So when creating and destroying loader
sessions, parent registries will be populated again and again. We
have to make sure to discard the entries along with the destruction
of a loader session to avoid the leakage of memory.

Issue #717
2013-05-07 21:56:06 +02:00
Norman Feske
0355591445 lx_hybrid: Safety check when freeing thread
Try to free the metadata of a thread only if created by Genode. The code
did not cause any actual problems. I just stumbled over the inconsistency
while reviewing the code.
2013-05-07 21:56:06 +02:00
Norman Feske
09e04d6378 Avoid leakage of signal-source reply capabilities
Issue #717
2013-05-07 21:56:06 +02:00
Norman Feske
5d969cffaf base-linux: Fix condition in ~Reply_channel
Issue #717
2013-05-07 21:56:06 +02:00
Norman Feske
e39ff055ba base-linux: Fix use-after-free problem of ds fds
Fixes #717
2013-05-07 21:56:06 +02:00
Stefan Kalkowski
511cab6192 Remove superfluous pl11x target.mk file (fix #722) 2013-05-07 21:56:06 +02:00
Stefan Kalkowski
cddd69a122 Double buffering for i.MX53 fb driver (fix #721)
Enable optinal support for double buffering in the i.MX53 framebuffer
driver. This prevents flickering in certain scenarios, where applications
directly render in the framebuffer dataspace given by the driver.
2013-05-07 21:56:06 +02:00
Stefan Kalkowski
0950b2f340 Rework i.MX53 framebuffer driver
* Simplify IPU register definitions using templates
* Distinguish between i.MX53 QSB and SMD board in driver
* Support IPU specific overlay mechanism by framebuffer session extension
2013-05-07 21:56:06 +02:00
Stefan Kalkowski
4fe158a320 Implement platform driver for i.MX53 platform
Move clock and reset controller functionality out of framebuffer driver
into platform driver.
2013-05-07 13:04:30 +02:00
Nikolay Golikov
d2f5deaf33 Implement i.MX53 framebuffer driver 2013-05-07 13:04:30 +02:00
Stefan Kalkowski
a5d236475a Unify GPIO driver binary names to 'gpio_drv'
Introduce 'gpio' SPEC variable to easily support a corresponding driver within
run scripts.
2013-05-07 13:04:30 +02:00
Nikolay Golikov
1d1081c910 Implement i.MX53 gpio driver 2013-05-07 13:04:30 +02:00
Stefan Kalkowski
8e9e866161 Unify framebuffer driver binary names (fix #720)
Introduce 'framebuffer' SPEC variable to distinguish hardware framebuffer
drivers furthermore from the SDL framebuffer driver used by Genode/Linux.
2013-05-07 13:04:30 +02:00
Stefan Kalkowski
8aad441ef0 Remove obsolete Fiasco UX framebuffer driver 2013-05-06 18:50:35 +02:00
Sebastian Sumpf
4873f35945 LWIP: Use LWIP_SO_RCVBUF instead of LWIP_RCVBUF
The name of this option has changed

Issue #382
2013-05-06 18:50:35 +02:00
Christian Prochaska
ac8633e0e9 Update Qt to version 4.8.4
Fixes #703.
2013-05-06 18:50:35 +02:00
Martin Stein
028ef7d776 mmio: fix bug in read/write array items
Fix #668
2013-05-06 11:11:04 +02:00
Christian Prochaska
89109cf377 core: preserve more memory
core needs to preserve more memory when built with -O0 for the 64-bit
'linux_x86' platform

Fixes #727.
2013-05-06 11:11:03 +02:00
Christian Prochaska
411d736d04 ldso: increase 'MEM_SIZE' in 'mmap()'
Fixes #728.
2013-05-06 11:11:03 +02:00
Christian Prochaska
e879cb1c32 libc_fs: don't throw exception in 'open()'
Fixes #729.
2013-05-06 11:11:03 +02:00
Christian Prochaska
339a0354ce libc_lwip_nic_dhcp: provide '/etc/resolv.conf'
With this patch, the 'libc_lwip_nic_dhcp' plugin provides the DNS server
address acquired by lwIP via DHCP in the file '/etc/resolv.conf'.

This feature can be disabled from the config file:

<libc resolv="no" />

The static network interface configuration attributes are now also a part
of the '<libc>' config node:

<libc ip_addr="..." netmask="..." gateway="..." />

Fixes #731.
2013-05-06 11:11:03 +02:00
Christian Prochaska
d184599a89 libc: print 'not implemented' in pthread stubs
Print a 'not implemented' debug message if one of the libc-internal
pthread dummy functions gets called.

Fixes #730.
2013-05-06 11:11:03 +02:00
Norman Feske
6f294eddc2 Fix warning about initializer of 'Local_addr'
Fixes #726
2013-05-06 11:11:03 +02:00
Alexander Boettcher
f6d31d7243 dde_ipxe: catch exception instead of dying silently
Fix #593
2013-04-26 16:49:20 +02:00
Alexander Boettcher
958cdffa7b dde_ipxe: fix null pointer de-referencing
Issue #593
2013-04-26 16:49:09 +02:00
Alexander Boettcher
30927f68a7 check wakeup situation in rx() after dequeuing
Issue #593
2013-04-26 16:48:54 +02:00
Stefan Kalkowski
814652d243 Add dependency rule for CXX_OBJECTS (fix #719) 2013-04-26 16:47:15 +02:00
Stefan Kalkowski
de2b5c0925 Fix alignment bug in memcpy_arm (fix #718) 2013-04-26 16:42:59 +02:00
Alexander Boettcher
fb0ca69fe4 libports: make include paths absolute
If contrib and/or download in libports are symlinks, then using ".." ends up
in the wrong directory. Use CURDIR variable set by make.
2013-04-15 13:14:04 +02:00
Alexander Boettcher
b85447c602 run scripts: add "Test succeeded" message
Issue #679
2013-04-12 10:56:27 +02:00
Alexander Boettcher
5d04f88816 lwip: adjust test to run with remote machine (AMT)
Issue #679
2013-04-12 10:56:27 +02:00
Alexander Boettcher
8a393183e9 run: PXE+AMT support for x86 kernels
Issue #679
2013-04-12 10:56:27 +02:00
Alexander Boettcher
455f606f31 run: add Pulsar PXE boot support for x86 kernels
Issue #679
2013-04-12 10:56:27 +02:00
Alexander Boettcher
fff1a374ed run: add Intel AMT support to x86 kernels
Issue #679
2013-04-12 10:56:27 +02:00
Alexander Boettcher
3593c7fb4d run: move general AMT support to tool/run
Issue #679
2013-04-12 10:56:27 +02:00
Martin Stein
e9f4e6b37d base: bug in util_mmio.run
Fix #659
2013-04-12 10:52:29 +02:00
Stefan Kalkowski
ba9e7185a8 Omap4 sd_card driver: fix recursive usleep loop
This commit removes an endless loop, that occurred when the sd_card driver
called usleep, or msleep on its Timer_delayer object. Fixes #705

Also fixes the same problem for the Omap4 GPIO driver.
2013-04-12 10:51:45 +02:00
Norman Feske
d339eb734f base-hw: Fix error message in run env 2013-04-10 14:33:47 +02:00
Martin Stein
4b224dd67e base-hw: store Platform_pd pointer in Kernel::Pd
This enables the kernel to print out the label of the program
a thread belongs to.

fix #662
2013-04-09 14:24:25 +02:00
Norman Feske
f3ef943bd8 Add missing libports includes to .gitignore 2013-04-09 12:03:49 +02:00
Christian Prochaska
1500d59d0d nic_bridge: drop 'gratuitous ARP' messages
'Gratuitous ARP' broadcast messages are used to announce newly created
IP<->MAC address mappings to other hosts. nic_bridge-internal hosts
would expect a nic_bridge-internal MAC address in this message, whereas
external hosts would expect the NIC's MAC address in this message.
The simplest solution to this problem is to just drop those messages,
since they are not really necessary.

Fixes #709.
2013-04-08 18:48:40 +02:00
Norman Feske
242d51033f terminal_mux.run: Don't use uart_drv on Fiasco.OC 2013-04-08 11:42:25 +02:00
Martin Stein
ea7ed5947a base: hand over Pd_connection label to Platform_pd
fix: #656
2013-04-08 11:42:24 +02:00
Alexander Boettcher
8bc14eb75a usb: enable 64bit support for x86
Fix #436
2013-04-05 12:55:59 +02:00
Martin Stein
dc814ff0f1 timer: bugfix and test trigger_periodic (run/timer)
Fix #699
2013-04-05 12:51:30 +02:00
Norman Feske
5da281c1d8 libports: Add GNU FriBidi 2013-04-05 12:49:55 +02:00
Norman Feske
7552d352b6 libports/SDL: Add ttf, image, mixer, loadso 2013-04-05 12:49:55 +02:00
Norman Feske
973fdae9d8 libc_fs: Fix seek report for ro (non-append) files 2013-03-29 22:48:44 +01:00
Norman Feske
e4c28a1739 terminal_mux: Free ncurses meta data 2013-03-27 19:27:25 +01:00
Norman Feske
0d01fd829f heap: Reduce maximum chunk size to 1 MiB on 32bit
With the previous maximum, the heap would allocate chunks of up to 4
MiB, which may lead to overly large slack memory.
2013-03-27 19:27:25 +01:00
Norman Feske
3968766170 lwip: Print IP address in release mode 2013-03-27 19:27:25 +01:00
Norman Feske
e5c57bddcc Add ports-foc to build.conf for foc_arndale 2013-03-27 19:27:25 +01:00
Norman Feske
2bbe840597 core: Handle disappearing managed dataspaces
This patch adds the consideration of suddenly disappearing managed
dataspaces in the 'Rm_session_component::reverse_lookup' function.
Previously, this case resulted in a seamingly valid translation.

Fixes #701
2013-03-27 19:27:24 +01:00
Stefan Kalkowski
ae1985bde2 l4lx: avoid creation of redundant thread for vcpus
This commit simplifies the creation of additional threads and VCPUs in L4linux.
By now, some Genode::Thread_base methods where overridden to use a Fiasco.OC
specific Cpu_session when creating threads.
Recent commit: 297538678e moved the actual creation
of the platform thread into the constructor of the generic Thread_base class.
Thereby the Vcpu class, which extended the Thread_base class, now unnecessarily
created two platform threads for each thread created via Vcpu. Nowadays, the
cpu_session capability is available via the Genode::env() environment. So we can
use the Thread_base parent class for the setup of the platform thread, and
afterwards create a Fiasco.OC specific cpu session client with the same cpu
session capability, Thread_base used for creation, to make use of the L4Linux
specific features of this interface (VCPU enabling, irq object creation etc.).
2013-03-26 17:59:59 +01:00
Stefan Kalkowski
074e522990 base-foc: introduce state in platform thread
When destroying a thread, which was not bound to a protection domain via kernel
primitives beforehand, it is critical to change the pager and exregs the thread
in the destruction process. Therefore, this commit introduces two thread states:
DEAD and RUNNING. On the basis of the thread state, we can decide whether to
reset the thread before destroying it, or not.
2013-03-26 17:59:44 +01:00
Christian Prochaska
9a4887dcad New 'l4linux_dynamic.run' script
This run script allows the user to dynamically start and stop L4Linux
instances using a command-line interface over a serial line.
2013-03-26 17:06:17 +01:00
Sebastian Sumpf
bdc15a4f28 sd_card: Support multiple DMA descriptors 2013-03-26 12:21:45 +01:00
Christian Prochaska
3f9bf7e5dd Add missing route to timer 2013-03-26 12:21:45 +01:00
Christian Prochaska
5600328d83 terminal_mux: Clear terminal when activating menu
This patch clears the terminal each time the menu appears and thereby
wipes away artifacts that might occur when combining terminal_mux with
kdb_uart_drv and the kernel prints messages directly.
2013-03-26 12:21:45 +01:00
Christian Prochaska
ff3b73825d terminal: Add escape handling for CUB
This VT102 command is triggered by busybox when pressing the 'pos1' key.
2013-03-26 12:21:44 +01:00
Christian Prochaska
cae79d30b8 cli_monitor: Support dynamically linked binaries 2013-03-26 12:21:44 +01:00
Christian Helmuth
da2076e52a usb: fix support for HID keyboard
This fixes issues with several HID keyboards by implementing
get_unaligned_le16(), which obviously may also fix other not-yet-known
issues. Hint: I had to look out for suspicious lines like follows in the
verbose log.

  [init -> usb_drv] get_unaligned_le16 called, not implemented

Also, quirks for cherry keyboards are now applied.
2013-03-26 12:21:44 +01:00
Alexander Boettcher
9a1d13c32d panda: add route to timer in run script
Fix #700
2013-03-25 11:21:32 +01:00
Norman Feske
b06cc3250a Coding style fixes 2013-03-23 13:37:57 +01:00
Norman Feske
c56525f264 cli_monitor: Add reboot command for Fiasco.OC
In addition to the new reboot command, this patch tries to reduce the
artifacts caused by the interplay of the kernel debugger and
terminal_mux.
2013-03-22 21:41:50 +01:00
Norman Feske
26710729a3 Suppress warnings in release mode
Fixes #698
2013-03-22 17:28:07 +01:00
Norman Feske
613d980ff4 Remove debug message 2013-03-22 17:23:52 +01:00
Sebastian Sumpf
c27364f2df sd_card: Enable 8-bit/52Mhz mode for eMMC 2013-03-22 16:35:31 +01:00
Norman Feske
3b71a9c986 Add missing licensing headers 2013-03-22 15:31:16 +01:00
Sebastian Sumpf
a3afb3dae4 sd_card: Exynos5/MMC support
Added MMC specific parts to Sd-card implemntation. Read/Write takes advantage of
DMA. Currently we leave card in one bit mode.
2013-03-22 15:28:52 +01:00
Sebastian Sumpf
95a16adb6f sd_card: Make OMAP4 'sd_card.h' default 2013-03-22 15:26:13 +01:00
Norman Feske
e1d0839e19 terminal: Check bounds of cursor position
Thanks @cproc for the fix.
2013-03-22 15:24:29 +01:00
Norman Feske
c36909e5dc acpi: Adjust device_pd quota for 64bit machines 2013-03-22 12:45:31 +01:00
Norman Feske
839c0263c9 Fix warning on 64bit
Because the template instantiation rules of C++ do not deal well with
null pointers specified as '0', the constructor of 'Local_addr' was
instantiated for [T = int], which does not make sense. To avoid the
warning "cast to pointer from integer of different size", we need to
explicitly state that '0' is a pointer. In C++11, there is the 'nullptr'
keyword, but until we switch to this version, we have to state (void *)0.
2013-03-22 12:41:21 +01:00
Alexander Boettcher
1730132ef1 usb: fix linux header include setup phase
In usb.inc all required Linux include files of the Linux code are looked up
by 'sed'ing through the files of SRC_C and SRC_CC. The Linux include files
are then added as dependency to the SRC_C and SRC_CC files and during dependency
resolution symbolic links to the lx_emul.h will be created.

In the platform specific usb.mk file there are the Linux driver files
added, but unfortunately after including usb.inc. So, for them no dependency
to any Linux include header file is generated and so no symbolic files are
generated.

If the driver code file is compiled as first, as for asix.c, the symbolic links
of the include files are missing and compilation fails.

Add the Linux driver code files to SRC_C before including usb.inc in the
platform specific usb.mk files.
2013-03-21 17:09:08 +01:00
Norman Feske
dfe4fd177d cli_monitor: Add foc-specific kdebug command 2013-03-21 15:50:32 +01:00
Norman Feske
022e762a40 timer: Remove debug message 2013-03-21 15:49:27 +01:00
Norman Feske
e38983a8fa Simple thread-affinity test 2013-03-21 12:54:02 +01:00
Norman Feske
297538678e foc: Create thread at core at construction time
Originally, a thread was created at core not before calling the 'start'
function. In order to configure the thread affinity before starting the
thread, we have to make the thread known at core right at construction
time. This patch moves the needed thread-creation sequence from the
'start' function to the '_init_platform_thread' function.
2013-03-21 12:47:42 +01:00
Norman Feske
d7f85ef81f Add cli_monitor to terminal_mux.run 2013-03-21 11:44:34 +01:00
Norman Feske
05027c7935 Simple CLI for managing Genode subsystems 2013-03-21 11:44:34 +01:00
Norman Feske
22f65d1afe Move gems/include/terminal to os/include/terminal
The terminal utilities provided under 'include/terminal' depend on the
base API and the 'os' repository only. So we can incorporate them into
'os'.
2013-03-21 11:44:34 +01:00
Norman Feske
4498a6b6a0 terminal: Add support for EL0 2013-03-21 11:44:34 +01:00
Norman Feske
764a3656a1 cxx: Decouple C++ runtime from 'env()->heap()' 2013-03-21 11:04:56 +01:00
Christian Prochaska
82aa092dac terminal_mux: increase RAM quota in run script
Fixes #694.
2013-03-20 14:22:43 +01:00
Christian Prochaska
570156b38c l4lx: allocate memory in chunks
When L4Linux tries to allocate a dataspace of the size of its physical
memory, this allocation can fail, because the 'l4re_ma_alloc()' function
in the 'l4lx' library always tries to allocate a contiguous dataspace of
the given size and there might be no contiguous free area left.

With this patch, memory gets allocated in chunks: if the size to be
allocated exceeds the configured chunk size, a managed dataspace gets
created and filled with multiple memory chunks of at most the chunk size.

The chunk size is 16M by default and can be configured in an l4linux
config node:

<config args="...">
	<ram chunk_size="16M"/>
</config>

Fixes #695.
2013-03-20 14:22:04 +01:00
Sebastian Sumpf
3ae2c1712e base-foc: Do not touch memory during map operation
Don't do anything in Mapping::prepare_map_operation.  At this point and in the
current implementation, the memory has been mapped and cleared already. Touching
the memory may only pollute the cache causing data corruption in DMA memory.

Fixes issue #452
2013-03-20 10:06:16 +01:00
Alexander Boettcher
c95a6c54ea usb: grab urb sizes from driver
Instead of hardcoding the values, ask the driver for the supported sizes and
allocate the skb allocators accordingly.
2013-03-20 10:06:16 +01:00
Alexander Boettcher
9abf88c195 usb: add network support for arndale board 2013-03-20 10:06:16 +01:00
Sebastian Sumpf
78c752b1c7 usb: Rewrote back-end allocators
Allocate back-end memory dynamically.
2013-03-20 10:06:16 +01:00
Torsten Hilbrich
87f83c1cff build.mk: Fix dependency on $(LIB_DEP_FILE)
The previous fix in 6b33757154 was
invalid.
2013-03-20 10:02:34 +01:00
Alexander Boettcher
ac9c8c769c remove obsolete port target 2013-03-20 10:00:54 +01:00
Christian Prochaska
452624e1a6 Fiasco(.OC) KDB UART driver
The KDB UART driver uses the Fiasco(.OC) kernel debugger console as backend
for input and output. This is useful in the case that only one UART is
available.

Fixes #665.
2013-03-18 15:28:16 +01:00
Markus Partheymüller
4bb0a8231e vancouver: calculate STACK_SIZE from addr_t size.
This is necessary on 64bit host.
2013-03-18 13:10:29 +01:00
Alexander Boettcher
8bc719ee1d nova: show badge as name during page fault message 2013-03-18 13:10:21 +01:00
Alexander Boettcher
e85e11bec1 vmm: try to reserve lower virtual address space
It's not guaranteed to be robust and will break in the future - I told you.

Related to issue #365, issue #519, issue #666
2013-03-18 13:10:03 +01:00
Markus Partheymüller
40e27b2379 vancouver: correct framebuffer size. 2013-03-18 13:09:53 +01:00
Markus Partheymüller
b8eb9b534d Switch to Seoul VMM repository instead of NUL
In this version of the transition the Hip structure from Genode is reused,
@nfeskes seoul_libc_support is used for the string functions and the
nul/config.h is replaced by just using a constant value in the one place where
the file was needed.

Related to #666.
2013-03-18 13:09:45 +01:00
Norman Feske
9d0a377efe Add 'seoul_libc_support' library
This library contains the subset of the libc that is needed for the
Seoul VMM.

Related to issue #666.
2013-03-18 13:09:16 +01:00
Alexander Boettcher
0c8b996fa4 base: calculate initial junk based on 32/64 host
Issue #666
2013-03-18 13:07:22 +01:00
Christian Prochaska
b38fee2867 L4Linux stability improvements
- search for alternative virtual address regions upwards, starting from
  the given start address, in the 'l4re_rm_attach()' and
  'Region_manager::reserve_range()' functions

- don't treat memory locations above 0x80000000 in l4linux's virtual
  address space as device memory

- align the start address of the vmalloc area according to the assumption
  in 'devicemaps_init()'

Fixes #414.
2013-03-18 13:06:06 +01:00
Christian Prochaska
a59b2e3f16 terminal: 'ED' command fix
Fixes #691.
2013-03-18 13:02:21 +01:00
Christian Prochaska
0530ff3241 terminal: weaken color argument order requirement
With this patch, the escape sequence decoder can handle a two-argument
'SGR' command with the attribute/color arguments in any order.

Fixes #690.
2013-03-18 13:02:02 +01:00
Norman Feske
171aa332b7 foc: Extend irq mode heuristics
Explicitly set default mode for legacy interrupts to not rely on kernel
default settings. This patch fixes the constantly busy IRQ threads for
IRQ 1 and 12 as soon as the PS/2 driver was loaded until the point when
the first IRQ occurred.
2013-03-14 19:24:52 +01:00
Norman Feske
91b0578446 foc: Select "thread-ready" bit in pause function 2013-03-14 16:37:29 +01:00
Stefan Kalkowski
ce58a63fb6 Remove 'epit' from generic i.MX platform spec
Remove the 'epit' variable from the generic imx31 and imx53 specification,
and only add it to base-hw specific i.MX specs. Thereby the EPIT timer
library gets build for base-hw only.
Moreover, fix some const-ness issues in the platform_timer implementation
for the EPIT timer.
Fixes #688.
2013-03-14 11:27:51 +01:00
Stefan Kalkowski
0f38335188 base-foc: remove links to obsolete initrd archives
Fix #686
2013-03-14 10:50:33 +01:00
Stefan Kalkowski
0bc02b439a L4Linux: fix usage of l4_touch_xx (fix #682)
Use size in bytes, when touching memory via l4_touch_ro or l4_touch_rw, instead
of log2 size.
2013-03-14 10:50:14 +01:00
Norman Feske
21de42c45d core: Introduce 'Address_space' interface
The new core-internal 'Address_space' interface enables cores RM service
to flush mappings of a PD in which a given 'Rm_client' thread resides.
Prior this patch, each platform invented their own way to flush mappings
in the respective 'rm_session_support.cc' implementation. However, those
implementations used to deal poorly with some corner cases. In
particular, if a PD session was destroyed prior a RM session, the RM
session would try to use no longer existing PD session. The new
'Address_space' uses the just added weak-pointer mechanism to deal with
this issue.

Furthermore, the generic 'Rm_session_component::detach' function has
been improved to avoid duplicated unmap operations for platforms that
implement the 'Address_space' interface. Therefore, it is related to
issue #595. Right now, this is OKL4 only, but other platforms will follow.
2013-03-12 21:53:08 +01:00
Norman Feske
352f58b94b core: New utilities for object lifetime management 2013-03-12 21:53:08 +01:00
Norman Feske
989f662f46 base-host: Adaptation to changed lock-internal API 2013-03-12 21:53:08 +01:00
Norman Feske
a81ad12372 l4linux.run: Increase quota of PCI driver 2013-03-12 21:50:29 +01:00
Christian Prochaska
90e6cef49b gdb_monitor: increase RAM quotas in run scripts
Fixes #685.
2013-03-11 16:39:51 +01:00
Alexander Boettcher
8f204ffd26 nova: improve page fault debugging messages
Ease debugging.

Fixes #674
2013-03-08 12:15:02 +01:00
Ivan Loskutov
33b59a6276 atapi_drv: Add LBA48 support
Fixes #678
2013-03-08 12:14:38 +01:00
Ivan Loskutov
5725c4c122 Fix l4linux block driver for large partitions
Fixes #678
2013-03-08 12:09:53 +01:00
Alexander Boettcher
38b2a3dbb4 nova: support to run script automatically with AMT
This enables us to use the run scripts applied to a native machine equipped
with Intel's AMT. If the environment variables are correctly set up, the remote
test machine is reseted via 'amttool', then via 'amtterm' the serial output
is collected and the normal run script matching pattern for success/failure of
the run script are applied.

'amttool' and 'amtterm' are part of the package called 'amtterm' shipped with
the Linux distributions like Ubuntu, Debian and lot more.

Following environment variables are required, to run the run scripts with a
native AMT test machine:

PXE_TFTP_DIR_BASE   - absolute path of TFTP directory
PXE_TFTP_DIR_OFFSET - relative path to PXE_TFTP_DIR_BASE where the config file
                      will be generated - named 'config-00-00-00-00-00-00'

AMT_TEST_MACHINE_IP  - TCP/IP address of target AMT test machine
AMT_TEST_MACHINE_PWD - password of target AMT test machine

Issue #679
2013-03-08 12:09:10 +01:00
Josef Söntgen
a875b3ea11 libports: enable SSL in curl
Fixes #681
2013-03-08 12:07:58 +01:00
Josef Söntgen
abf0563815 libports: workaround for downloading libssh
Since checking if the certificate is valid is not that important
(we currently do not check the signature of the archive which is the
bigger issue) we disable the checking to prevent certain wget version
from refusing to download the archive.

Fixes #681
2013-03-08 12:07:31 +01:00
Josef Söntgen
613784f560 libports: fix missing clean-libiconv target
Fixes #681
2013-03-08 12:07:18 +01:00
Christian Helmuth
6f2e36279a Use mkisofs to create ISO images
mkisofs is the original ISO creation tool from cdrtools available on
many UNIX systems. genisoimage on the other hand is part of a mostly
unmaintained fork of cdrtools very specific to Debian Linux and its
derivates (e.g., Ubuntu). Fortunately, genisoimage (as we used it) is
completely invocation-compatible to mkisofs.

Fixes #627.
2013-03-07 13:41:30 +01:00
Christian Helmuth
05b7c3ae3d base-foc: Improve documentation of signal_session
Fixes #566.
2013-03-06 11:23:52 +01:00
Norman Feske
bcd6ef8fab Spelling fix (thanks @udosteinberg) 2013-03-01 12:35:42 +01:00
Norman Feske
a41f77a78a Minor style fix 2013-02-28 12:40:07 +01:00
Norman Feske
94067cf799 News item for Genode 13.02 2013-02-28 10:33:33 +01:00
1189 changed files with 61461 additions and 33606 deletions

22
.gitignore vendored
View File

@@ -19,20 +19,25 @@
/dde_oss/download
/libports/contrib
/libports/download
/libports/include/curl/
/libports/include/EGL/egl.h
/libports/include/EGL/eglext.h
/libports/include/GL
/libports/include/KHR
/libports/include/SDL
/libports/include/ffat
/libports/include/fribidi
/libports/include/freetype
/libports/include/ft2build.h
/libports/include/iconv/
/libports/include/icu/
/libports/include/jbig2dec
/libports/include/libc-amd64/
/libports/include/libc-arm/
/libports/include/libc-i386/
/libports/include/libc/
/libports/include/libpng
/libports/include/libssh/
/libports/include/lua
/libports/include/lwip/lwip
/libports/include/lwip/netif
@@ -100,6 +105,13 @@
/libports/include/stdcxx-genode/bits/nested_exception.h
/libports/include/stdcxx-genode/exception
/libports/include/stdcxx-genode/new
/libports/include/stdcxx-genode/typeinfo
/libports/include/x86emu/stdint.h
/libports/include/x86emu/stdio.h
/libports/include/x86emu/stdlib.h
/libports/include/x86emu/string.h
/libports/include/x86emu/x86emu.h
/libports/include/x86emu/x86emu/
/libports/src/lib/gmp/mpn/asm-defs.m4
/libports/src/lib/gmp/mpn/arm/hamdist.c
/libports/src/lib/gmp/mpn/arm/popcount.c
@@ -116,8 +128,18 @@
/libports/src/lib/ncurses/make_keys
/libports/src/lib/ncurses/names.c
/libports/src/lib/ncurses/unctrl.c
/libports/src/lib/qt5/qtwebkit/Source/JavaScriptCore
/libports/src/lib/qt5/qtwebkit/Source/WebCore/generated
/libports/tool/mesa/glsl
/libports/tool/mupdf
/libports/tool/qt5/bootstrap
/libports/tool/qt5/misc/var
/libports/tool/qt5/moc
/libports/tool/qt5/qmake/*.d
/libports/tool/qt5/qmake/*.o
/libports/tool/qt5/qmake/qmake
/libports/tool/qt5/rcc
/libports/tool/qt5/uic
/ports-foc/contrib
/ports-okl4/contrib
/ports-okl4/download

6
README
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

@@ -83,6 +83,24 @@ proc build_boot_image {binaries} {
}
proc run_genode_until {{wait_for_re forever} {timeout_value 0}} {
spawn_qemu $wait_for_re $timeout_value }
proc run_genode_until {{wait_for_re forever} {timeout_value 0} {running_spawn_id -1}} {
#
# If a running_spawn_id is specified, wait for the expected output
#
if {$running_spawn_id != -1} {
wait_for_output $wait_for_re $timeout_value $running_spawn_id
return
}
#
# Try to use one of the supported backends for running the scripts
#
if {[is_qemu_available]} {
spawn_qemu $wait_for_re $timeout_value
return
}
global run_target
puts stderr "Error: Can't execute automatically on target '$run_target'"
exit -1
}

View File

@@ -16,6 +16,7 @@
/* core includes */
#include <platform_thread.h>
#include <address_space.h>
/* Codezero includes */
#include <codezero/syscalls.h>
@@ -23,7 +24,7 @@
namespace Genode {
class Platform_thread;
class Platform_pd
class Platform_pd : public Address_space
{
private:
@@ -37,12 +38,11 @@ namespace Genode {
public:
/**
* Constructors
*/
Platform_pd(bool core);
Platform_pd(signed pd_id = -1, bool create = true);
Platform_pd(char const *, signed pd_id = -1, bool create = true);
/**
* Destructor
@@ -68,6 +68,13 @@ namespace Genode {
* Assign parent interface to protection domain
*/
int assign_parent(Native_capability parent) { return 0; }
/*****************************
** Address-space interface **
*****************************/
void flush(addr_t, size_t) { PDBG("not implemented"); }
};
}

View File

@@ -19,6 +19,9 @@
#include <base/thread_state.h>
#include <base/native_types.h>
/* core includes */
#include <address_space.h>
namespace Genode {
class Platform_pd;
@@ -30,19 +33,25 @@ namespace Genode {
enum { PD_NAME_MAX_LEN = 64 };
unsigned _tid; /* global codezero thread ID */
unsigned _space_id;
addr_t _utcb;
char _name[PD_NAME_MAX_LEN];
Pager_object *_pager;
unsigned _tid; /* global codezero thread ID */
unsigned _space_id;
Weak_ptr<Address_space> _address_space;
addr_t _utcb;
char _name[PD_NAME_MAX_LEN];
Pager_object *_pager;
/**
* Assign physical thread ID and UTCB address to thread
*
* This function is called from 'Platform_pd::bind_thread'.
*/
void _assign_physical_thread(unsigned tid, unsigned space_id, addr_t utcb) {
_tid = tid; _space_id = space_id; _utcb = utcb; }
void _assign_physical_thread(unsigned tid, unsigned space_id,
addr_t utcb,
Weak_ptr<Address_space> address_space)
{
_tid = tid; _space_id = space_id; _utcb = utcb;
_address_space = address_space;
}
public:
@@ -100,6 +109,11 @@ namespace Genode {
*/
Thread_state state();
/**
* Return the address space to which the thread is bound
*/
Weak_ptr<Address_space> address_space();
/************************
** Accessor functions **
@@ -120,7 +134,12 @@ namespace Genode {
/**
* Set the executing CPU for this thread
*/
void affinity(unsigned cpu);
void affinity(Affinity::Location) { }
/**
* Get the executing CPU for this thread
*/
Affinity::Location affinity() { return Affinity::Location(); }
/**
* Get thread name

View File

@@ -67,7 +67,8 @@ int Platform_pd::bind_thread(Platform_thread *thread)
}
addr_t utcb_addr = UTCB_VIRT_BASE + utcb_idx*sizeof(struct utcb);
thread->_assign_physical_thread(ids.tid, _space_id, utcb_addr);
thread->_assign_physical_thread(ids.tid, _space_id, utcb_addr,
this->Address_space::weak_ptr());
return 0;
}
@@ -97,7 +98,8 @@ Platform_pd::Platform_pd(bool core)
}
Platform_pd::Platform_pd(signed pd_id, bool create) : _space_id(TASK_ID_INVALID)
Platform_pd::Platform_pd(char const *, signed pd_id, bool create)
: _space_id(TASK_ID_INVALID)
{
_space_id = TASK_ID_INVALID;

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;
@@ -98,6 +92,12 @@ void Platform_thread::cancel_blocking()
}
Weak_ptr<Address_space> Platform_thread::address_space()
{
return _address_space;
}
Platform_thread::Platform_thread(const char *name, unsigned, addr_t,
int thread_id)
: _tid(THREAD_INVALID)

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

@@ -3,7 +3,7 @@
#
SPECS += x86_32 fiasco
SPECS += pci ps2 vesa
SPECS += pci ps2 vesa framebuffer
#
# x86-specific L4v2/sys headers

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

@@ -8,6 +8,15 @@
#
##
# Install files needed to boot via PXE
#
proc install_pxe_bootloader_to_run_dir { } {
exec cp [genode_dir]/tool/boot/pulsar [run_dir]/boot/pulsar
exec cp [genode_dir]/tool/boot/bender [run_dir]/boot/bender
}
##
# Read the location of the Fiasco user directory from 'etc/fiasco.conf'
#
@@ -76,8 +85,12 @@ proc bin_dir { } {
exit 1
}
set fiasco_serial_esc_arg "-serial_esc "
proc build_boot_image {binaries} {
global fiasco_serial_esc_arg
#
# Collect contents of the ISO image
#
@@ -108,7 +121,7 @@ proc build_boot_image {binaries} {
puts $fh "default 0"
puts $fh "\ntitle Genode on L4/Fiasco"
puts $fh " kernel /fiasco/bootstrap -serial -modaddr=0x02000000"
puts $fh " module /fiasco/fiasco -serial -serial_esc -jdb_cmd=JH"
puts $fh " module /fiasco/fiasco -serial -jdb_cmd=JH $fiasco_serial_esc_arg"
puts $fh " module /fiasco/sigma0"
puts $fh " module /genode/core"
puts $fh " module /genode/config"
@@ -118,10 +131,69 @@ proc build_boot_image {binaries} {
puts $fh " vbeset 0x117 506070"
close $fh
#
# Install PXE bootloader pulsar
#
install_pxe_bootloader_to_run_dir
create_iso_image_from_run_dir
#
# Generate pulsar config file
#
set fh [open "[run_dir]/config-52-54-00-12-34-56" "WRONLY CREAT TRUNC"]
puts $fh " exec /boot/bender"
puts $fh " load /fiasco/bootstrap -serial -modaddr=0x02000000"
puts $fh " load /fiasco/fiasco -serial -serial_esc -jdb_cmd=JH"
puts $fh " load /fiasco/sigma0"
puts $fh " load /genode/core"
puts $fh " load /genode/config"
foreach binary $binaries {
if {$binary != "core"} {
puts $fh " load /genode/$binary" } }
close $fh
#
# Generate pulsar config file pointing to the config file above.
#
if {[info exists ::env(PXE_TFTP_DIR_BASE)] && [info exists ::env(PXE_TFTP_DIR_OFFSET)]} {
exec ln -nfs "[pwd]" "$::env(PXE_TFTP_DIR_BASE)$::env(PXE_TFTP_DIR_OFFSET)"
set tftp_base ""
if {[get_cmd_switch --tftp-absolute]} {
set tftp_base $::env(PXE_TFTP_DIR_BASE)
}
set fh [open "$::env(PXE_TFTP_DIR_BASE)$::env(PXE_TFTP_DIR_OFFSET)/config-00-00-00-00-00-00" "WRONLY CREAT TRUNC"]
puts $fh " root $tftp_base$::env(PXE_TFTP_DIR_OFFSET)/[run_dir]"
puts $fh " config config-52-54-00-12-34-56"
close $fh
}
}
proc run_genode_until {{wait_for_re forever} {timeout_value 0}} {
spawn_qemu $wait_for_re $timeout_value }
proc run_genode_until {{wait_for_re forever} {timeout_value 0} {running_spawn_id -1}} {
#
# If a running_spawn_id is specified, wait for the expected output
#
if {$running_spawn_id != -1} {
wait_for_output $wait_for_re $timeout_value $running_spawn_id
return
}
#
# Try to use one of the supported backends for running the scripts
#
if {[is_amt_available]} {
spawn_amt $wait_for_re $timeout_value
return
}
if {[is_qemu_available]} {
spawn_qemu $wait_for_re $timeout_value
return
}
global run_target
puts stderr "Error: Can't execute automatically on target '$run_target'"
exit -1
}

View File

@@ -35,6 +35,7 @@ namespace Genode {
*/
typedef Synchronized_range_allocator<Allocator_avl> Phys_allocator;
char _core_label[1]; /* to satisfy _core_pd */
Platform_pd *_core_pd; /* core protection domain object */
Phys_allocator _ram_alloc; /* RAM allocator */
Phys_allocator _io_mem_alloc; /* MMIO allocator */

View File

@@ -18,6 +18,7 @@
#define _CORE__INCLUDE__PLATFORM_PD_H_
#include <platform_thread.h>
#include <address_space.h>
namespace Fiasco {
#include <l4/sys/types.h>
@@ -26,7 +27,7 @@ namespace Fiasco {
namespace Genode {
class Platform_thread;
class Platform_pd
class Platform_pd : public Address_space
{
private:
@@ -141,7 +142,8 @@ namespace Genode {
/**
* Constructor
*/
Platform_pd(signed pd_id = PD_INVALID, bool create = true);
Platform_pd(char const *, signed pd_id = PD_INVALID,
bool create = true);
/**
* Destructor
@@ -176,6 +178,17 @@ namespace Genode {
int assign_parent(Native_capability parent) { return 0; }
int pd_id() const { return _pd_id; }
/*****************************
** Address-space interface **
*****************************/
/*
* On L4/Fiasco, we don't use directed unmap but rely on the
* in-kernel mapping database. See 'rm_session_support.cc'.
*/
void flush(addr_t, size_t) { PDBG("not implemented"); }
};
}

View File

@@ -21,6 +21,7 @@
/* core includes */
#include <platform_pd.h>
#include <address_space.h>
/* Fiasco includes */
namespace Fiasco {
@@ -120,7 +121,17 @@ namespace Genode {
*
* SMP is not supported on L4/Fiasco.
*/
void affinity(unsigned) { }
void affinity(Affinity::Location) { }
/**
* Request the affinity of this thread
*/
Affinity::Location affinity() { return Affinity::Location(); }
/**
* Return the address space to which the thread is bound
*/
Weak_ptr<Address_space> address_space();
/************************

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());
@@ -489,7 +489,8 @@ Platform::Platform() :
Platform_pd::init();
/* setup pd object for core pd */
_core_pd = new(core_mem_alloc()) Platform_pd(myself.id.task, false);
_core_label[0] = 0;
_core_pd = new(core_mem_alloc()) Platform_pd(_core_label, myself.id.task, false);
/*
* We setup the thread object for thread0 in core pd using a special

View File

@@ -236,7 +236,7 @@ void Platform_pd::unbind_thread(Platform_thread *thread)
}
Platform_pd::Platform_pd(signed pd_id, bool create)
Platform_pd::Platform_pd(char const *, signed pd_id, bool create)
{
/* check correct init */
if (!_init)

View File

@@ -145,6 +145,12 @@ void Platform_thread::cancel_blocking()
}
Weak_ptr<Address_space> Platform_thread::address_space()
{
return _platform_pd->Address_space::weak_ptr();
}
Platform_thread::Platform_thread(const char *name, unsigned, addr_t, int thread_id)
: _thread_id(thread_id), _l4_thread_id(L4_INVALID_ID), _pager(0)
{

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
@@ -104,15 +110,9 @@ After that you can build and run L4Linux by issuing:
! make run/l4linux
in your build directory. This run-script boots a single L4Linux instance into
a minimal console environment. The script depends on an 'initrd.gz' archive,
which has to reside in 'bin' in your build directory. You can find an example
initramfs here:
:[http://genode.org/files/release-11.05/l4lx/x86/initrd.gz]:
Initramfs archive for X86
:[http://genode.org/files/release-11.05/l4lx/arm/initrd.gz]:
Initramfs archive for ARM
a minimal console environment. After booting completes, the run-scripts tries
to download the Genode project webpage via the 'wget' tool within the L4Linux
environment. If all wents fine the run-script completes successfully.
Integration of Fiasco.OC with Genode

View File

@@ -68,28 +68,17 @@ namespace Genode {
//if (write_combined)
// _fpage.fp.cache = Fiasco::L4_FPAGE_BUFFERABLE;
unsigned char rights = _rw ? Fiasco::L4_FPAGE_RW : Fiasco::L4_FPAGE_RO;
unsigned char rights = _rw ? Fiasco::L4_FPAGE_RWX : Fiasco::L4_FPAGE_RX;
return Fiasco::l4_fpage(_src_addr, _log2size, rights);
}
bool write_combined() const { return _write_combined; }
/**
* Prepare map operation
*
* On Fiasco, we need to map a page locally to be able to map it to
* another address space.
* Prepare map operation is not needed on Fiasco.OC, since we clear the
* dataspace before this function is called.
*/
void prepare_map_operation()
{
size_t mapping_size = 1 << _log2size;
for (addr_t i = 0; i < mapping_size; i += L4_PAGESIZE) {
if (_rw)
touch_read_write((unsigned char volatile *)(_src_addr + i));
else
touch_read((unsigned char const volatile *)(_src_addr + i));
}
}
void prepare_map_operation() { }
};

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 {
@@ -138,7 +169,7 @@ namespace Genode {
** Interface provided by all platforms **
*******************************************/
int local_name() const { return _idx ? _idx->id() : 0; }
long local_name() const { return _idx ? _idx->id() : 0; }
Dst dst() const { return _idx ? Dst(_idx->kcap()) : Dst(); }
bool valid() const { return (_idx != 0) && _idx->valid(); }
void *local() const { return _ptr; }

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

@@ -5,11 +5,12 @@
* \date 2010-02-03
*
* On Fiasco.OC, the signal source server does not provide a blocking
* 'wait_for_signal' function because this kernel does no support
* out-of-order IPC replies. Instead, we use an IRQ kernel-object
* to let the client block until a signal is present at the
* server. The IRQ object gets initialized with the first
* call of 'wait_for_signal()'.
* 'wait_for_signal' function because this kernel does not support out-of-order
* IPC replies. Instead, we use an IRQ kernel-object to let the client block
* until a signal is present at the server.
*
* We request the IRQ object capability and attach to the IRQ on construction
* of the 'Signal_source_client' object.
*/
/*

View File

@@ -2,11 +2,6 @@
* \brief Signal-source server interface
* \author Norman Feske
* \date 2010-02-03
*
* This file is only included by 'signal_session/server.h' and relies on the
* headers included there. No include guards are needed. It is a separate
* header file to make it easily replaceable by a platform-specific
* implementation.
*/
/*
@@ -16,8 +11,8 @@
* under the terms of the GNU General Public License version 2.
*/
#ifndef _INCLUDE__SIGNAL_SESSION__SOURCE_SERVER_H_
#define _INCLUDE__SIGNAL_SESSION__SOURCE_SERVER_H_
#ifndef _INCLUDE__SIGNAL_SESSION__SOURCE_RPC_OBJECT_H_
#define _INCLUDE__SIGNAL_SESSION__SOURCE_RPC_OBJECT_H_
#include <base/rpc_server.h>
#include <signal_session/foc_source.h>
@@ -39,4 +34,4 @@ namespace Genode {
};
}
#endif /* _INCLUDE__SIGNAL_SESSION__SOURCE_SERVER_H_ */
#endif /* _INCLUDE__SIGNAL_SESSION__SOURCE_RPC_OBJECT_H_ */

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

@@ -3,7 +3,7 @@
#
SPECS += x86_32 foc
SPECS += pci ps2 vesa
SPECS += pci ps2 vesa framebuffer
#
# Linker options that are specific for x86

View File

@@ -3,7 +3,7 @@
#
SPECS += x86_64 foc
SPECS += pci ps2 vesa
SPECS += pci ps2 vesa framebuffer
#
# Linker options that are specific for x86

View File

@@ -6,6 +6,14 @@
# This file is meant to be used as '--include' argument for 'tool/run'.
#
##
# Install files needed to boot via PXE
#
proc install_pxe_bootloader_to_run_dir { } {
exec cp [genode_dir]/tool/boot/pulsar [run_dir]/boot/pulsar
exec cp [genode_dir]/tool/boot/bender [run_dir]/boot/bender
}
##
# Return the location of the Fiasco.OC user directory
#
@@ -64,6 +72,17 @@ proc fiasco_external { } {
return 1
}
##
# Reset the target system via the Fiasco.OC kernel debugger
#
proc reset_target { {spawn_id_arg -1} } {
global spawn_id
if { $spawn_id_arg == -1 } {
set spawn_id_arg $spawn_id
}
send -i $spawn_id_arg "\033^^"
}
##################################
## Test framework API functions ##
##################################
@@ -105,40 +124,12 @@ proc bin_dir { } {
exit 1
}
#
# Parse entry point address out of final elf image for u-boot
#
proc entrypoint { } {
global _entrypoint
set _entrypoint [exec [cross_dev_prefix]readelf -h [run_dir]/image.elf | grep "Entry point" | sed -e "s/.*Entry point address: *//"]
return $_entrypoint
}
#
# Parse load address out of final elf image for u-boot
#
proc loadaddr { } {
global _loadaddr
set _loadaddr [regexp -inline -all -- {\S+} [exec [cross_dev_prefix]readelf -l [run_dir]/image.elf | grep -m 1 "LOAD"]]
return [lindex $_loadaddr 3]
}
#
# Create an u-boot image if appropriated SPEC is set
#
proc build_boot_uimage { } {
if {[have_spec uboot]} {
exec [cross_dev_prefix]objcopy -O binary [run_dir]/image.elf [run_dir]/image.bin
exec gzip --best --force [run_dir]/image.bin
exec mkimage -A arm -O linux -T kernel -C gzip -a [loadaddr] -e [entrypoint] -d [run_dir]/image.bin.gz [run_dir]/uImage
}
}
set fiasco_serial_esc_arg "-serial_esc "
proc build_boot_image_x86 {binaries} {
global fiasco_serial_esc_arg
copy_and_strip_binaries $binaries
set foc_targets { }
@@ -171,7 +162,7 @@ proc build_boot_image_x86 {binaries} {
puts $fh "default 0"
puts $fh "\ntitle Genode on Fiasco.OC"
puts $fh " kernel /fiasco/bootstrap -modaddr=0x01100000"
puts $fh " module /fiasco/fiasco -serial_esc"
puts $fh " module /fiasco/fiasco $fiasco_serial_esc_arg"
puts $fh " module /fiasco/sigma0"
puts $fh " module /genode/core"
puts $fh " module /genode/config"
@@ -181,12 +172,47 @@ proc build_boot_image_x86 {binaries} {
puts $fh " vbeset 0x117 506070"
close $fh
install_pxe_bootloader_to_run_dir
create_iso_image_from_run_dir
#
# Generate pulsar config file
#
set fh [open "[run_dir]/config-52-54-00-12-34-56" "WRONLY CREAT TRUNC"]
puts $fh " exec /boot/bender"
puts $fh " load /fiasco/bootstrap -modaddr=0x01100000"
puts $fh " load /fiasco/fiasco -serial_esc"
puts $fh " load /fiasco/sigma0"
puts $fh " load /genode/core"
puts $fh " load /genode/config"
foreach binary $binaries {
if {$binary != "core"} {
puts $fh " load /genode/$binary" } }
close $fh
#
# Generate pulsar config file pointing to the config file above.
#
if {[info exists ::env(PXE_TFTP_DIR_BASE)] && [info exists ::env(PXE_TFTP_DIR_OFFSET)]} {
exec ln -nfs "[pwd]" "$::env(PXE_TFTP_DIR_BASE)$::env(PXE_TFTP_DIR_OFFSET)"
set tftp_base ""
if {[get_cmd_switch --tftp-absolute]} {
set tftp_base $::env(PXE_TFTP_DIR_BASE)
}
set fh [open "$::env(PXE_TFTP_DIR_BASE)$::env(PXE_TFTP_DIR_OFFSET)/config-00-00-00-00-00-00" "WRONLY CREAT TRUNC"]
puts $fh " root $tftp_base$::env(PXE_TFTP_DIR_OFFSET)/[run_dir]"
puts $fh " config config-52-54-00-12-34-56"
close $fh
}
}
proc build_boot_image_arm {binaries} {
global fiasco_serial_esc_arg
copy_and_strip_binaries $binaries
build "kernel sigma0 bootstrap"
@@ -198,7 +224,7 @@ proc build_boot_image_arm {binaries} {
puts $fh "modaddr 0x01100000\n"
puts $fh "entry genode"
puts $fh "kernel [fiasco] -serial_esc"
puts $fh "kernel [fiasco] $fiasco_serial_esc_arg"
puts $fh "roottask genode/core"
puts $fh "module genode/config"
foreach binary $binaries {
@@ -220,9 +246,18 @@ proc build_boot_image_arm {binaries} {
}
exec cp [bin_dir]/bootstrap.elf [run_dir]/image.elf
build_boot_uimage
build_uboot_image [run_dir]/image.elf
puts "\nboot image: [run_dir]/image.elf\n"
# set symbolic link to image.elf file in TFTP directory for PXE boot
if {[info exists ::env(PXE_TFTP_DIR_BASE)] &&
[info exists ::env(PXE_TFTP_DIR_OFFSET)]} {
exec ln -sf "[pwd]/[run_dir]/image.elf" "$::env(PXE_TFTP_DIR_BASE)$::env(PXE_TFTP_DIR_OFFSET)"
if {[have_spec uboot]} {
exec ln -sf "[pwd]/[run_dir]/uImage" "$::env(PXE_TFTP_DIR_BASE)$::env(PXE_TFTP_DIR_OFFSET)/uImage"
}
}
}
@@ -232,5 +267,32 @@ proc build_boot_image {binaries} {
}
proc run_genode_until {{wait_for_re forever} {timeout_value 0}} {
spawn_qemu $wait_for_re $timeout_value }
proc run_genode_until {{wait_for_re forever} {timeout_value 0} {running_spawn_id -1}} {
#
# If a running_spawn_id is specified, wait for the expected output
#
if {$running_spawn_id != -1} {
wait_for_output $wait_for_re $timeout_value $running_spawn_id
return
}
#
# Try to use one of the supported backends for running the scripts
#
if {[is_amt_available]} {
spawn_amt $wait_for_re $timeout_value
return
}
if {[is_qemu_available]} {
spawn_qemu $wait_for_re $timeout_value
return
}
if {[is_serial_available]} {
spawn_serial $wait_for_re $timeout_value "L4 Bootstrapper"
return
}
global run_target
puts stderr "Error: Can't execute automatically on target '$run_target'"
exit -1
}

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

@@ -27,6 +27,3 @@ void Genode::Thread_base::_thread_start()
Lock sleep_forever_lock(Lock::LOCKED);
sleep_forever_lock.lock();
}
void Genode::Thread_base::_init_platform_thread() { }

View File

@@ -38,10 +38,8 @@ void Thread_base::_deinit_platform_thread()
}
void Thread_base::start()
void Genode::Thread_base::_init_platform_thread()
{
using namespace Fiasco;
/* create thread at core */
char buf[48];
name(buf, sizeof(buf));
@@ -49,6 +47,12 @@ void Thread_base::start()
/* assign thread to protection domain */
env()->pd_session()->bind_thread(_thread_cap);
}
void Thread_base::start()
{
using namespace Fiasco;
/* create new pager object and assign it to the new thread */
_pager_cap = env()->rm_session()->add_client(_thread_cap);

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

@@ -27,6 +27,7 @@
/* core includes */
#include <cap_mapping.h>
#include <address_space.h>
/* Fiasco.OC includes */
namespace Fiasco {
@@ -36,7 +37,7 @@ namespace Fiasco {
namespace Genode {
class Platform_thread;
class Platform_pd
class Platform_pd : public Address_space
{
private:
@@ -97,11 +98,23 @@ namespace Genode {
*/
int assign_parent(Native_capability parent);
/*******************************
** Fiasco-specific Accessors **
*******************************/
Native_capability native_task() { return _task.local; }
/*****************************
** Address-space interface **
*****************************/
/*
* On Fiasco.OC, we don't use directed unmap but rely on the
* in-kernel mapping database. See 'rm_session_support.cc'.
*/
void flush(addr_t, size_t) { PDBG("not implemented"); }
};
}

View File

@@ -24,6 +24,7 @@
#include <platform_pd.h>
#include <cap_session_component.h>
#include <cap_mapping.h>
#include <address_space.h>
namespace Genode {
@@ -32,21 +33,26 @@ namespace Genode {
{
private:
enum State { DEAD, RUNNING };
friend class Platform_pd;
bool _core_thread;
Cap_mapping _thread;
Cap_mapping _gate;
Cap_mapping _pager;
Cap_mapping _irq;
Native_utcb _utcb;
char _name[32]; /* thread name that will be
registered at the kernel
debugger */
Platform_pd *_platform_pd; /* protection domain thread
is bound to */
Pager_object *_pager_obj;
unsigned _prio;
State _state;
bool _core_thread;
Cap_mapping _thread;
Cap_mapping _gate;
Cap_mapping _pager;
Cap_mapping _irq;
Native_utcb _utcb;
char _name[32]; /* thread name that will be
registered at the kernel
debugger */
Platform_pd *_platform_pd; /* protection domain thread
is bound to */
Pager_object *_pager_obj;
unsigned _prio;
Affinity::Location _location;
void _create_thread(void);
void _finalize_construction(const char *name);
@@ -59,7 +65,7 @@ namespace Genode {
/**
* Constructor for non-core threads
*/
Platform_thread(const char *name, unsigned priority);
Platform_thread(const char *name, unsigned priority, addr_t);
/**
* Constructor for core main-thread
@@ -132,7 +138,17 @@ namespace Genode {
/**
* Set the executing CPU for this thread
*/
void affinity(unsigned cpu);
void affinity(Affinity::Location location);
/**
* Get the executing CPU for this thread
*/
Affinity::Location affinity();
/**
* Return the address space to which the thread is bound
*/
Weak_ptr<Address_space> address_space();
/************************

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);
@@ -250,8 +251,6 @@ static inline int sigma0_req_region(addr_t *addr, unsigned log2size)
*addr = l4_utcb_mr()->mr[0] & (~0UL << L4_PAGESHIFT);
touch_rw((void *)addr, 1);
return 0;
}
@@ -297,7 +296,7 @@ void Platform::_setup_mem_alloc()
for (unsigned i = 0; i < sizeof(log2_sizes)/sizeof(*log2_sizes); ++i) {
size_t log2_size = log2_sizes[i];
size_t size = 1 << log2_size;
size_t size = 1UL << log2_size;
int err = 0;
addr_t addr = 0;
Region region;
@@ -513,4 +512,31 @@ void Platform::wait_for_exit()
}
Affinity::Space Platform::affinity_space() const
{
using namespace Genode;
using namespace Fiasco;
l4_sched_cpu_set_t cpus = l4_sched_cpu_set(0, 0, 1);
l4_umword_t cpus_max;
l4_msgtag_t res = l4_scheduler_info(L4_BASE_SCHEDULER_CAP, &cpus_max,
&cpus);
if (l4_error(res)) {
PERR("could not detect number of CPUs - assuming 1 CPU");
return 1;
}
unsigned cpus_online = 0;
for (unsigned i = 0; i < sizeof(cpus.map) * 8; i++)
if ((cpus.map >> i) & 0x1)
cpus_online ++;
/*
* Currently, we do not gather any information about the topology of CPU
* nodes but just return a one-dimensional affinity space.
*/
return Affinity::Space(cpus_online, 1);
}
void Core_parent::exit(int exit_value) { }

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

@@ -54,6 +54,8 @@ int Platform_thread::start(void *ip, void *sp)
return -1;
}
_state = RUNNING;
/* set ip and sp and run the thread */
tag = l4_thread_ex_regs(_thread.local.dst(), (l4_addr_t) ip,
(l4_addr_t) sp, 0);
@@ -93,7 +95,11 @@ void Platform_thread::pause()
*/
l4_thread_ex_regs_ret(_thread.local.dst(), &_pager_obj->state.ip,
&_pager_obj->state.sp, &flags);
bool in_syscall = flags == 0;
/*
* The thread state ("ready") is encoded in the lowest bit of the flags.
*/
bool in_syscall = (flags & 1) == 0;
_pager_obj->state.lock.unlock();
/**
@@ -139,16 +145,18 @@ void Platform_thread::bind(Platform_pd *pd)
void Platform_thread::unbind()
{
/* first set the thread as its own pager */
l4_thread_control_start();
l4_thread_control_pager(_gate.remote);
l4_thread_control_exc_handler(_gate.remote);
if (l4_msgtag_has_error(l4_thread_control_commit(_thread.local.dst())))
PWRN("l4_thread_control_commit for %lx failed!",
(unsigned long) _thread.local.dst());
if (_state == RUNNING) {
/* first set the thread as its own pager */
l4_thread_control_start();
l4_thread_control_pager(_gate.remote);
l4_thread_control_exc_handler(_gate.remote);
if (l4_msgtag_has_error(l4_thread_control_commit(_thread.local.dst())))
PWRN("l4_thread_control_commit for %lx failed!",
(unsigned long) _thread.local.dst());
/* now force it into a pagefault */
l4_thread_ex_regs(_thread.local.dst(), 0, 0, L4_THREAD_EX_REGS_CANCEL);
/* now force it into a pagefault */
l4_thread_ex_regs(_thread.local.dst(), 0, 0, L4_THREAD_EX_REGS_CANCEL);
}
_platform_pd = (Platform_pd*) 0;
}
@@ -190,8 +198,12 @@ void Platform_thread::cancel_blocking()
}
void Platform_thread::affinity(unsigned cpu)
void Platform_thread::affinity(Affinity::Location location)
{
_location = location;
int const cpu = location.xpos();
l4_sched_param_t params = l4_sched_param(_prio);
params.affinity = l4_sched_cpu_set(cpu, 0, 1);
l4_msgtag_t tag = l4_scheduler_run_thread(L4_BASE_SCHEDULER_CAP,
@@ -201,6 +213,12 @@ void Platform_thread::affinity(unsigned cpu)
}
Affinity::Location Platform_thread::affinity()
{
return _location;
}
void Platform_thread::_create_thread()
{
l4_msgtag_t tag = l4_factory_create_thread(L4_BASE_FACTORY_CAP,
@@ -237,9 +255,15 @@ void Platform_thread::_finalize_construction(const char *name)
}
Platform_thread::Platform_thread(const char *name,
unsigned prio)
: _core_thread(false),
Weak_ptr<Address_space> Platform_thread::address_space()
{
return _platform_pd->Address_space::weak_ptr();
}
Platform_thread::Platform_thread(const char *name, unsigned prio, addr_t)
: _state(DEAD),
_core_thread(false),
_thread(true),
_irq(true),
_utcb(0),
@@ -255,7 +279,8 @@ Platform_thread::Platform_thread(const char *name,
Platform_thread::Platform_thread(Core_cap_index* thread,
Core_cap_index* irq, const char *name)
: _core_thread(true),
: _state(RUNNING),
_core_thread(true),
_thread(Native_capability(thread), L4_BASE_THREAD_CAP),
_irq(Native_capability(irq)),
_utcb(0),
@@ -269,7 +294,8 @@ Platform_thread::Platform_thread(Core_cap_index* thread,
Platform_thread::Platform_thread(const char *name)
: _core_thread(true),
: _state(DEAD),
_core_thread(true),
_thread(true),
_irq(true),
_utcb(0),

View File

@@ -70,8 +70,10 @@ Signal_source::Signal Signal_source_component::wait_for_signal()
Signal_source_component::Signal_source_component(Rpc_entrypoint *ep)
: Signal_source_rpc_object(cap_map()->insert(platform_specific()->cap_id_alloc()->alloc())),
_entrypoint(ep)
:
Signal_source_rpc_object(cap_map()->insert(platform_specific()->cap_id_alloc()->alloc())),
_entrypoint(ep), _finalizer(*this),
_finalizer_cap(_entrypoint->manage(&_finalizer))
{
using namespace Fiasco;
@@ -80,3 +82,20 @@ Signal_source_component::Signal_source_component(Rpc_entrypoint *ep)
if (l4_error(res))
PERR("Allocation of irq object failed!");
}
Signal_source_component::~Signal_source_component()
{
_finalizer_cap.call<Finalizer::Rpc_exit>();
_entrypoint->dissolve(&_finalizer);
}
void Signal_source_component::Finalizer_component::exit()
{
/*
* On Fiasco.OC, the signal-source client does not use a blocking call
* to wait for signals. Hence, we do not need to take care of
* releasing the reply capability of such a call.
*/
}

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

@@ -35,6 +35,9 @@ void Thread_base::_deinit_platform_thread()
}
void Genode::Thread_base::_init_platform_thread() { }
void Thread_base::start()
{
using namespace Fiasco;

View File

@@ -51,24 +51,34 @@ void Genode::Platform::setup_irq_mode(unsigned irq_number, unsigned trigger,
{
using namespace Fiasco;
/* don't touch anything below IRQ 16 in the default case */
if (irq_number < 16 && trigger == Irq_session::TRIGGER_UNCHANGED &&
polarity == Irq_session::TRIGGER_UNCHANGED)
return;
/*
* Translate ACPI interrupt mode (trigger/polarity) to Fiasco APIC
* values. Default is level low for IRQs > 15
*/
l4_umword_t mode;
mode = (trigger == Irq_session::TRIGGER_LEVEL) ||
(irq_number > 15 && trigger == Irq_session::TRIGGER_UNCHANGED)
? L4_IRQ_F_LEVEL : L4_IRQ_F_EDGE;
mode |= (polarity == Irq_session::POLARITY_LOW) ||
(irq_number > 15 && polarity == Irq_session::POLARITY_UNCHANGED)
? L4_IRQ_F_NEG : L4_IRQ_F_POS;
/* set edge-high as default for legacy interrupts */
if (irq_number < 16
&& trigger == Irq_session::TRIGGER_UNCHANGED
&& polarity == Irq_session::TRIGGER_UNCHANGED) {
mode = L4_IRQ_F_POS_EDGE;
} else {
/*
* Translate ACPI interrupt mode (trigger/polarity) to Fiasco APIC
* values. Default is level low
*/
if (trigger == Irq_session::TRIGGER_LEVEL || trigger == Irq_session::TRIGGER_UNCHANGED) {
if (polarity == Irq_session::POLARITY_LOW || polarity == Irq_session::POLARITY_UNCHANGED)
mode = L4_IRQ_F_LEVEL_LOW;
else
mode = L4_IRQ_F_LEVEL_HIGH;
}
else {
if (polarity == Irq_session::POLARITY_LOW || polarity == Irq_session::POLARITY_UNCHANGED)
mode = L4_IRQ_F_NEG_EDGE;
else
mode = L4_IRQ_F_POS_EDGE;
}
}
/*
* Set mode

View File

@@ -16,36 +16,19 @@
/* Genode includes */
#include <base/native_types.h>
#include <base/thread.h>
static inline void thread_yield() { }
static bool thread_check_stopped_and_restart(Genode::Native_thread_id tid)
static bool thread_check_stopped_and_restart(Genode::Thread_base *)
{
return true;
}
static inline Genode::Native_thread_id thread_get_my_native_id()
{
return -1;
}
static inline Genode::Native_thread_id thread_invalid_id()
{
return -1;
}
static inline bool thread_id_valid(Genode::Native_thread_id tid)
{
return false;
}
static inline void thread_switch_to(Genode::Native_thread_id tid)
static inline void thread_switch_to(Genode::Thread_base *)
{ }

View File

@@ -27,7 +27,7 @@ namespace Genode {
* Constructors
*/
Platform_pd(bool core);
Platform_pd(signed pd_id = -1, bool create = true);
Platform_pd(char const *, signed pd_id = -1, bool create = true);
/**
* Destructor

View File

@@ -19,6 +19,9 @@
#include <base/thread_state.h>
#include <base/native_types.h>
/* core includes */
#include <address_space.h>
namespace Genode {
class Platform_pd;
@@ -80,6 +83,11 @@ namespace Genode {
*/
Thread_state state();
/**
* Return the address space to which the thread is bound
*/
Weak_ptr<Address_space> address_space();
/************************
** Accessor functions **

View File

@@ -43,7 +43,7 @@ Platform_pd::Platform_pd(bool core)
}
Platform_pd::Platform_pd(signed pd_id, bool create)
Platform_pd::Platform_pd(char const *, signed pd_id, bool create)
{
PWRN("not yet implemented");
}

View File

@@ -73,6 +73,13 @@ unsigned long Platform_thread::pager_object_badge() const
}
Weak_ptr<Address_space> Platform_thread::address_space()
{
PWRN("not implemented");
return Weak_ptr<Address_space>();
}
Platform_thread::Platform_thread(const char *name, unsigned, addr_t,
int thread_id)
{

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

@@ -20,6 +20,7 @@
namespace Genode
{
class Platform_thread;
class Platform_pd;
class Tlb;
}
@@ -29,6 +30,7 @@ namespace Kernel
typedef Genode::addr_t addr_t;
typedef Genode::size_t size_t;
typedef Genode::Platform_thread Platform_thread;
typedef Genode::Platform_pd Platform_pd;
/**
* Unique opcodes of all syscalls supported by the kernel
@@ -58,6 +60,7 @@ namespace Kernel
/* management of resource protection-domains */
SET_PAGER = 11,
UPDATE_PD = 12,
UPDATE_REGION = 32,
NEW_PD = 13,
/* interrupt handling */
@@ -78,8 +81,9 @@ namespace Kernel
ACK_SIGNAL = 29,
/* vm specific */
NEW_VM = 24,
RUN_VM = 25,
NEW_VM = 24,
RUN_VM = 25,
PAUSE_VM = 31,
};
/*****************************************************************
@@ -143,6 +147,7 @@ namespace Kernel
*
* \param dst physical base of an appropriate portion of memory
* that is thereupon allocated to the kernel
* \param pd core local Platform_pd object
*
* \retval >0 ID of the new PD
* \retval 0 if no new PD was created
@@ -150,8 +155,8 @@ namespace Kernel
* Restricted to core threads. Regaining of the supplied memory is not
* supported by now.
*/
inline int new_pd(void * const dst) {
return syscall(NEW_PD, (Syscall_arg)dst); }
inline int new_pd(void * const dst, Platform_pd * const pd) {
return syscall(NEW_PD, (Syscall_arg)dst, (Syscall_arg)pd); }
/**
@@ -165,13 +170,27 @@ namespace Kernel
* applied from the moment it returns to the userland. This syscall is
* inappropriate in case that a PD wants to change its own configuration.
* There's no need for this syscall after a configuration change that
* can't affect the kernel and/or hardware caches.
* can't affect the kernel- and/or hardware-caches.
*
* Restricted to core threads.
*/
inline void update_pd(unsigned const pd_id) {
syscall(UPDATE_PD, (Syscall_arg)pd_id); }
/**
* Propagate memory-updates within a given virtual region
*
* \param base virtual base of the region
* \param size size of the region
*
* If one updates a memory region and must ensure that the update
* gets visible directly to other address spaces, this syscall does
* the job.
*
* Restricted to core threads.
*/
inline void update_region(addr_t base, size_t size) {
syscall(UPDATE_REGION, (Syscall_arg)base, (Syscall_arg)size); }
/**
* Create a new thread that is stopped initially
@@ -249,6 +268,9 @@ namespace Kernel
* \retval >0 if syscall was successful and thread were already active
* \retval <0 if targeted thread doesn't participate in CPU
* scheduling after
*
* If the targeted thread blocks for any event except a 'start_thread'
* call this call cancels the blocking.
*/
inline int resume_thread(unsigned const id = 0) {
return syscall(RESUME_THREAD, id); }
@@ -505,12 +527,14 @@ namespace Kernel
*
* \param context_id kernel name of the targeted signal context
*
* \return wether the context could be destructed
*
* Blocks the caller until the last delivered signal of the targeted
* context is acknowledged. Then the context gets destructed, losing
* all submits that were not delivered when this syscall occured.
*/
inline void kill_signal_context(unsigned context_id) {
syscall(KILL_SIGNAL_CONTEXT, (Syscall_arg)context_id); }
inline bool kill_signal_context(unsigned context_id) {
return syscall(KILL_SIGNAL_CONTEXT, (Syscall_arg)context_id); }
/**
* Create a new virtual-machine that is stopped initially
@@ -543,6 +567,17 @@ namespace Kernel
*/
inline void run_vm(unsigned const id) {
syscall(RUN_VM, (Syscall_arg)id); }
/**
* Stop execution of a virtual-machine
*
* \param id ID of the targeted VM
*
* Restricted to core threads.
*/
inline void pause_vm(unsigned const id) {
syscall(PAUSE_VM, (Syscall_arg)id); }
}
#endif /* _INCLUDE__KERNEL__SYSCALLS_H_ */

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

@@ -41,8 +41,8 @@ namespace Genode
void exception_handler(Signal_context_capability handler) {
call<Rpc_exception_handler>(handler); }
void run() {
call<Rpc_run>(); }
void run() { call<Rpc_run>(); }
void pause() { call<Rpc_pause>(); }
};
}

View File

@@ -46,6 +46,12 @@ namespace Genode {
*/
virtual void run(void) {}
/**
* Stop execution of the VM
*/
virtual void pause(void) {}
/*********************
** RPC declaration **
*********************/
@@ -54,7 +60,9 @@ namespace Genode {
GENODE_RPC(Rpc_exception_handler, void, exception_handler,
Signal_context_capability);
GENODE_RPC(Rpc_run, void, run);
GENODE_RPC_INTERFACE(Rpc_cpu_state, Rpc_exception_handler, Rpc_run);
GENODE_RPC(Rpc_pause, void, pause);
GENODE_RPC_INTERFACE(Rpc_cpu_state, Rpc_exception_handler,
Rpc_run, Rpc_pause);
};
}

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

@@ -5,7 +5,7 @@
#
# denote wich specs are also fullfilled by this spec
SPECS += hw platform_imx31
SPECS += hw platform_imx31 epit
# set address where to link the text segment at
LD_TEXT_ADDR ?= 0x82000000

View File

@@ -5,7 +5,7 @@
#
# denote wich specs are also fullfilled by this spec
SPECS += hw platform_imx53
SPECS += hw platform_imx53 epit
# set address where to link the text segment at
LD_TEXT_ADDR ?= 0x70001000

15
base-hw/mk/spec-hw_rpi.mk Normal file
View File

@@ -0,0 +1,15 @@
#
# \brief Build configurations specific to base-hw and Raspberry Pi
# \author Norman Feske
# \date 2013-04-05
#
# denote wich specs are also fullfilled by this spec
SPECS += hw platform_rpi
# set address where to link the text segment at
LD_TEXT_ADDR ?= 0x400000
# include implied specs
include $(call select_from_repositories,mk/spec-hw.mk)
include $(call select_from_repositories,mk/spec-platform_rpi.mk)

View File

@@ -18,12 +18,6 @@ proc clean_boot_modules { } {
exec rm -rf boot_modules.s var/libcache/boot_modules/boot_modules.o }
#
# Get target argument
#
proc target { } { return [get_cmd_arg --target "qemu"] }
##########################
## 'tool/run' interface ##
##########################
@@ -59,6 +53,7 @@ proc create_boot_directory { } {
proc build_boot_image {binaries} {
global run_target
# strip binaries
copy_and_strip_genode_binaries_to_run_dir $binaries
@@ -177,40 +172,47 @@ proc build_boot_image {binaries} {
exec cp -L bin/core $elf_img
exec [cross_dev_prefix]strip $elf_img
# target specific ops
if {[target] == "uboot"} {
build_uboot_image $elf_img
# parse ELF entrypoint and load address
set entrypoint [exec [cross_dev_prefix]readelf -h $elf_img | \
grep "Entry point address: " | \
sed -e "s/.*Entry point address: *//"]
set load_addr [exec [cross_dev_prefix]readelf -l $elf_img | \
grep -m 1 "LOAD"]
set load_addr [lindex [regexp -inline -all -- {\S+} $load_addr] 3]
# set symbolic link to image.elf file in TFTP directory for PXE boot
if {[info exists ::env(PXE_TFTP_DIR_BASE)] &&
[info exists ::env(PXE_TFTP_DIR_OFFSET)]} {
exec ln -sf "[pwd]/$elf_img" "$::env(PXE_TFTP_DIR_BASE)$::env(PXE_TFTP_DIR_OFFSET)"
# compress ELF
set bin_img "[run_dir]/image.bin"
exec [cross_dev_prefix]objcopy -O binary $elf_img $bin_img
exec gzip --best --force $bin_img
# create compressed uImage
set uboot_img [run_dir]/uImage
exec mkimage -A arm -O linux -T kernel -C gzip -a $load_addr \
-e $entrypoint -d $bin_img.gz $uboot_img
exec rm -rf $bin_img.gz
if {[regexp "uboot" $run_target]} {
exec ln -sf "[pwd]/[run_dir]/uImage" "$::env(PXE_TFTP_DIR_BASE)$::env(PXE_TFTP_DIR_OFFSET)"
}
}
# retrieve stand-alone core
exec mv core/core.standalone bin/core
exec cp core/core.standalone bin/core
exec rm core/core.standalone
}
proc run_genode_until {{wait_for_re forever} {timeout_value 0}} {
if {[target] == "qemu"} { spawn_qemu $wait_for_re $timeout_value
} else {
puts stderr "Error: Can't execute automatically on target '$target'"
puts stderr " Target might be: 'qemu'"
exit -1
proc run_genode_until {{wait_for_re forever} {timeout_value 0} {running_spawn_id -1}} {
#
# If a running_spawn_id is specified, wait for the expected output
#
if {$running_spawn_id != -1} {
wait_for_output $wait_for_re $timeout_value $running_spawn_id
return
}
#
# Try to use one of the supported backends for running the scripts
#
if {[is_qemu_available]} {
spawn_qemu $wait_for_re $timeout_value
return
}
if {[is_serial_available]} {
spawn_serial $wait_for_re $timeout_value "Kernel started!"
return
}
global run_target
puts stderr "Error: Can't execute automatically on target '$run_target'"
exit -1
}

View File

@@ -1,4 +1,4 @@
/**
/*
* \brief Genode-console backend
* \author Martin Stein
* \date 2011-10-17
@@ -16,6 +16,9 @@
#include <base/printf.h>
#include <drivers/serial_log.h>
/* base-hw includes */
#include "singleton.h"
namespace Genode
{
/**
@@ -63,8 +66,7 @@ using namespace Genode;
*/
static Platform_console * platform_console()
{
static Platform_console static_platform_console;
return &static_platform_console;
return unsynchronized_singleton<Platform_console>();
}

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;
}
@@ -115,8 +116,12 @@ void Signal_receiver::_unsynchronized_dissolve(Signal_context * c)
* that no delivered but unacked signals of this context exist
* in userland anymore.
*/
Kernel::kill_signal_context(c->_cap.dst());
if (!Kernel::kill_signal_context(c->_cap.dst())) {
PERR("failed to kill signal context");
/* we have to keep the signal context alive for other */
while (1) ;
}
/*
* Now we can tell core to regain the memory of the
* destructed kernel object.
@@ -145,20 +150,21 @@ Signal_context_capability Signal_receiver::manage(Signal_context * const c)
while (1) {
try {
c->_cap = s->alloc_context(_cap, (unsigned)c);
break;
c->_receiver = this;
_contexts.insert(&c->_receiver_le);
return c->_cap;
} catch (Signal_session::Out_of_metadata)
{
/* upgrade session quota and try again, but only once */
PINF("upgrading quota donation for Signal session");
if (session_upgraded) return Signal_context_capability();
if (session_upgraded) {
PERR("failed to alloc signal context");
return Signal_context_capability();
}
PINF("upgrading quota donation for SIGNAL session");
env()->parent()->upgrade(s->cap(), "ram_quota=4K");
session_upgraded = 1;
}
}
/* assign the context to us */
c->_receiver = this;
_contexts.insert(&c->_receiver_le);
return c->_cap;
}

View File

@@ -0,0 +1,53 @@
/*
* \brief Helper for creating singleton objects
* \author Norman Feske
* \date 2013-05-14
*
* Before enabling the MMU on ARM, the 'cmpxchg' implementation is not always
* guaranteed to work. For example, on the Raspberry Pi, the 'ldrex' as used by
* 'cmpxchg' causes the machine to reboot. After enabling the MMU, everything
* is fine. Hence, we need to avoid executing 'cmpxchg' prior this point.
* Unfortunately, 'cmpxchg' is implicitly called each time when creating a
* singleton object via a local-static object pattern. In this case, the
* compiler generates code that calls the '__cxa_guard_acquire' function of the
* C++ runtime, which, in turn, relies 'cmpxchg' for synchronization.
*
* The utility provided herein is an alternative way to create single object
* instances without implicitly calling 'cmpxchg'. Because object creation is
* not synchronized via a spin lock, it must not be used in scenarios where
* multiple threads may contend.
*/
/*
* Copyright (C) 2013 Genode Labs GmbH
*
* This file is part of the Genode OS framework, which is distributed
* under the terms of the GNU General Public License version 2.
*/
#ifndef _SINGLETON_H_
#define _SINGLETON_H_
inline void *operator new(Genode::size_t, void *at) { return at; }
template <typename T, int ALIGN = 2, typename... Args>
static inline T *unsynchronized_singleton(Args... args)
{
/*
* Each instantiation of the function template with a different type 'T'
* yields a dedicated instance of the local static variables, thereby
* creating the living space for the singleton objects.
*/
static bool initialized;
static int inst[sizeof(T)/sizeof(int) + 1] __attribute__((aligned(ALIGN)));
/* execute constructor on first call */
if (!initialized) {
initialized = true;
new (&inst) T(args...);
}
return reinterpret_cast<T *>(inst);
}
#endif /* _SINGLETON_H_ */

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;
@@ -99,6 +99,6 @@ void Thread_base::start()
}
void Thread_base::cancel_blocking()
{ env()->cpu_session()->cancel_blocking(_thread_cap); }
void Thread_base::cancel_blocking() {
env()->cpu_session()->cancel_blocking(_thread_cap); }

View File

@@ -66,6 +66,7 @@ Native_region * Platform::_core_only_mmio_regions(unsigned const i)
static Native_region _regions[] =
{
{ Board::GIC_CPU_MMIO_BASE, Board::GIC_CPU_MMIO_SIZE },
{ Board::MCT_MMIO_BASE, Board::MCT_MMIO_SIZE },
};
return i < sizeof(_regions)/sizeof(_regions[0]) ? &_regions[i] : 0;
}

View File

@@ -16,24 +16,24 @@
/* core includes */
#include <board.h>
#include <timer/exynos_pwm.h>
#include <timer/exynos_mct.h>
namespace Kernel
{
/**
* Kernel timer
*/
class Timer : public Exynos_pwm::Timer
class Timer : public Exynos_mct::Timer
{
public:
enum { IRQ = Genode::Board::PWM_IRQ_0 };
enum { IRQ = Genode::Board::MCT_IRQ_L0 };
/**
* Constructor
*/
Timer() : Exynos_pwm::Timer(Genode::Board::PWM_MMIO_BASE,
Genode::Board::PWM_CLOCK) { }
Timer() : Exynos_mct::Timer(Genode::Board::MCT_MMIO_BASE,
Genode::Board::MCT_CLOCK) { }
};
}

View File

@@ -0,0 +1,28 @@
/*
* \brief Support code for the thread API
* \author Martin Stein
* \date 2013-05-07
*/
/*
* Copyright (C) 2013 Genode Labs GmbH
*
* This file is part of the Genode OS framework, which is distributed
* under the terms of the GNU General Public License version 2.
*/
/* Genode includes */
#include <rm_session/rm_session.h>
using namespace Genode;
/**
* Return single instance of the context-area RM-session
*
* In base-hw core this object is never used because contexts
* get allocated through the phys-mem allocator. Anyways the
* accessor must exist because generic main-thread startup calls
* it to ensure that common allocations do not steal context area.
*/
namespace Genode { Rm_session * env_context_area_rm_session() { return 0; } }

View File

@@ -18,6 +18,10 @@
#include <util/register.h>
#include <cpu/cpu_state.h>
/* local includes */
#include <board.h>
#include <util.h>
namespace Arm
{
using namespace Genode;
@@ -465,16 +469,6 @@ namespace Arm
uint32_t cidr; /* context ID register backup */
uint32_t section_table; /* base address of applied section table */
/***************
** Accessors **
***************/
void tlb(addr_t const st) { section_table = st; }
addr_t tlb() const { return section_table; }
void protection_domain(unsigned const id) { cidr = id; }
/**
* Copy CPU state data to 'c'
*/
@@ -520,6 +514,21 @@ namespace Arm
lr = s->lr;
ip = s->ip;
}
/**
* Get base of assigned translation lookaside buffer
*/
addr_t tlb() const { return section_table; }
/**
* Assign translation lookaside buffer
*/
void tlb(addr_t const st) { section_table = st; }
/**
* Assign protection domain
*/
void protection_domain(unsigned const id) { cidr = id; }
};
/**
@@ -553,6 +562,62 @@ namespace Arm
unsigned user_arg_6() const { return r6; }
unsigned user_arg_7() const { return r7; }
/**
* Part of context init that is common for all types of threads
*/
void init_thread_common(void * const instr_p,
addr_t const tlb,
unsigned const pd_id)
{
ip = (addr_t)instr_p;
cidr = pd_id;
section_table = tlb;
}
/**
* Init context of the first thread of core
*/
void init_core_main_thread(void * const instr_p,
void * const stack_p,
addr_t const tlb,
unsigned const pd_id)
{
sp = (addr_t)stack_p;
init_thread_common(instr_p, tlb, pd_id);
}
/**
* Init context of a thread that isn't first thread of a program
*/
void init_thread(void * const instr_p,
void * const stack_p,
addr_t const tlb,
unsigned const pd_id)
{
sp = (addr_t)stack_p;
init_thread_common(instr_p, tlb, pd_id);
}
/**
* Init context of the first thread of a program other than core
*/
void init_main_thread(void * const instr_p,
void * const utcb_virt,
addr_t const tlb,
unsigned const pd_id)
{
/*
* Normally threads receive their UTCB pointer through their
* 'Thread_base' but the first thread of a program doesn't
* have such object. Thus the kernel hands out the UTCB pointer
* through the main threads initial CPU context. 'crt0.s' then
* can save the received pointer to local mem before polluting
* the CPU context.
*/
sp = (addr_t)utcb_virt;
init_thread_common(instr_p, tlb, pd_id);
}
/**
* Check if a pagefault has occured due to a translation miss
*
@@ -637,6 +702,22 @@ namespace Arm
asm volatile ("mcr p15, 0, %[rd], c8, c7, 0" :: [rd]"r"(0) : );
flush_caches();
}
/*
* Clean every data-cache entry within a region via MVA
*/
static void flush_data_cache_by_virt_region(addr_t base, size_t const size)
{
enum {
CACHE_LINE_SIZE = 1 << Board::CACHE_LINE_SIZE_LOG2,
CACHE_LINE_ALIGNM_MASK = ~(CACHE_LINE_SIZE - 1),
};
addr_t const top = base + size;
base = base & CACHE_LINE_ALIGNM_MASK;
for (; base < top; base += CACHE_LINE_SIZE)
asm volatile ("mcr p15, 0, %[base], c7, c10, 1\n" /* DCCMVAC */
:: [base] "r" (base) : );
}
};
}

View File

@@ -53,8 +53,8 @@ namespace Arm_v6
enum { LITTLE = 0 };
};
struct S : Bitfield<8,1> { }; /* enbale MMU protection */
struct R : Bitfield<9,1> { }; /* enbale ROM protection */
struct S : Bitfield<8,1> { }; /* enable MMU protection */
struct R : Bitfield<9,1> { }; /* enable ROM protection */
struct L4 : Bitfield<15,1> { }; /* raise T bit on LOAD-to-PC */
struct Dt : Bitfield<16,1> { }; /* global data TCM enable */
struct It : Bitfield<18,1> { }; /* global instruction TCM enable */

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

@@ -20,6 +20,7 @@
/* Core includes */
#include <platform.h>
#include <platform_thread.h>
#include <address_space.h>
namespace Kernel
{
@@ -34,19 +35,20 @@ namespace Genode
/**
* Platform specific part of a Genode protection domain
*/
class Platform_pd
class Platform_pd : public Address_space
{
unsigned _id; /* ID of our kernel object */
Native_capability _parent; /* our parent interface */
Native_thread_id _main_thread; /* the first thread that gets
* executed in this PD */
unsigned _id; /* ID of our kernel object */
Native_capability _parent; /* our parent interface */
Native_thread_id _main_thread; /* the first thread that gets
* executed in this PD */
char const * const _label; /* PD-connection label */
public:
/**
* Constructor
*/
Platform_pd() : _main_thread(0)
Platform_pd(char const *label) : _main_thread(0), _label(label)
{
/* get some aligned space for the kernel object */
void * kernel_pd;
@@ -55,7 +57,7 @@ namespace Genode
Kernel::pd_alignm_log2()).is_ok())
/* create kernel object */
_id = Kernel::new_pd(kernel_pd);
_id = Kernel::new_pd(kernel_pd, this);
assert(_id);
}
@@ -77,9 +79,9 @@ namespace Genode
{
/* annotate that we've got a main thread from now on */
_main_thread = t->id();
return t->join_pd(_id, 1);
return t->join_pd(_id, 1, Address_space::weak_ptr());
}
return t->join_pd(_id, 0);
return t->join_pd(_id, 0, Address_space::weak_ptr());
}
/**
@@ -98,6 +100,20 @@ namespace Genode
_parent = parent;
return 0;
}
/***************
** Accessors **
***************/
char const * const label() { return _label; }
/*****************************
** Address-space interface **
*****************************/
void flush(addr_t, size_t) { PDBG("not implemented"); }
};
}

View File

@@ -24,6 +24,7 @@
/* core includes */
#include <assert.h>
#include <address_space.h>
namespace Genode {
@@ -43,9 +44,9 @@ namespace Genode {
Thread_base * _thread_base;
size_t _stack_size;
unsigned _pd_id;
Weak_ptr<Address_space> _address_space;
unsigned _id;
Rm_client * _rm_client;
bool _main_thread;
Native_utcb * _phys_utcb;
Native_utcb * _virt_utcb;
Tlb * _tlb;
@@ -53,6 +54,16 @@ namespace Genode {
char _name[NAME_MAX_LEN];
char _kernel_thread[sizeof(Kernel::Thread)];
/*
* Wether this thread is the main thread of a program.
* This should be used only after 'join_pd' was called
* or if this is a core thread. For core threads its save
* also without 'join_pd' because '_main_thread' is initialized
* with 0 wich is always true as cores main thread has no
* 'Platform_thread'.
*/
bool _main_thread;
/**
* Common construction part
*/
@@ -91,7 +102,8 @@ namespace Genode {
* \retval 0 on success
* \retval <0 otherwise
*/
int join_pd(unsigned const pd_id, bool const main_thread);
int join_pd(unsigned const pd_id, bool const main_thread,
Weak_ptr<Address_space> address_space);
/**
* Run this thread
@@ -139,8 +151,17 @@ namespace Genode {
/**
* Set the executing CPU for this thread
*/
void affinity(unsigned cpu) {
kernel_log() << __PRETTY_FUNCTION__ << ": not implemented\n"; };
void affinity(Affinity::Location) { }
/**
* Get the executing CPU for this thread
*/
Affinity::Location affinity() { return Affinity::Location(); };
/**
* Return the address space to which the thread is bound
*/
Weak_ptr<Address_space> address_space();
/***************
@@ -161,7 +182,7 @@ namespace Genode {
Thread_base * thread_base()
{
if (!_thread_base) assert(_main_thread);
if (!_thread_base) assert(main_thread());
return _thread_base;
}
@@ -171,6 +192,8 @@ namespace Genode {
Ram_dataspace_capability utcb() const { return _utcb; }
bool main_thread() const { return _main_thread; }
Tlb * tlb() const { return _tlb; }
};
}

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

@@ -67,6 +67,7 @@ namespace Genode {
Dataspace_capability cpu_state(void) { return _ds_cap; }
void exception_handler(Signal_context_capability handler);
void run(void);
void pause(void);
};
}

View File

@@ -29,9 +29,13 @@
/* core includes */
#include <platform_thread.h>
#include <platform_pd.h>
#include <tlb.h>
#include <trustzone.h>
/* base-hw includes */
#include <singleton.h>
using namespace Kernel;
/* get core configuration */
@@ -56,6 +60,14 @@ namespace Kernel
}
void Kernel::Ipc_node::cancel_waiting()
{
if (_state == PREPARE_AND_AWAIT_REPLY) _state = PREPARE_REPLY;
if (_state == AWAIT_REPLY || _state == AWAIT_REQUEST) _state = INACTIVE;
return;
}
void Kernel::Ipc_node::_receive_request(Message_buf * const r)
{
/* assertions */
@@ -75,9 +87,11 @@ void Kernel::Ipc_node::_receive_request(Message_buf * const r)
void Kernel::Ipc_node::_receive_reply(void * const base, size_t const size)
{
/* assertions */
assert(_awaits_reply());
assert(size <= _inbuf.size);
if (!_awaits_reply()) {
PDBG("discard unexpected IPC reply");
return;
}
/* receive reply */
Genode::memcpy(_inbuf.base, base, size);
_inbuf.size = size;
@@ -261,14 +275,15 @@ namespace Kernel
* Static mode transition control
*/
static Mode_transition_control * mtc()
{ static Mode_transition_control _object; return &_object; }
{ return unsynchronized_singleton<Mode_transition_control>(); }
/**
* Kernel object that represents a Genode PD
*/
class Pd : public Object<Pd, MAX_PDS>
{
Tlb * const _tlb;
Tlb * const _tlb;
Platform_pd * const _platform_pd;
/* keep ready memory for size aligned extra costs at construction */
enum { EXTRA_SPACE_SIZE = 2*Tlb::MAX_COSTS_PER_TRANSLATION };
@@ -279,7 +294,8 @@ namespace Kernel
/**
* Constructor
*/
Pd(Tlb * const t) : _tlb(t)
Pd(Tlb * const t, Platform_pd * const platform_pd)
: _tlb(t), _platform_pd(platform_pd)
{
/* try to add translation for mode transition region */
Page_flags::access_t const flags = Page_flags::mode_transition();
@@ -322,14 +338,15 @@ namespace Kernel
** Accessors **
***************/
Tlb * tlb() { return _tlb; }
Tlb * const tlb() { return _tlb; }
Platform_pd * const platform_pd() { return _platform_pd; }
};
/**
* Access to static interrupt-controller
*/
static Pic * pic() { static Pic _object; return &_object; }
static Pic * pic() { return unsynchronized_singleton<Pic>(); }
}
@@ -366,6 +383,10 @@ void Kernel::Irq_owner::await_irq()
}
void Kernel::Irq_owner::cancel_waiting() {
if (_id) pic()->mask(id_to_irq(_id)); }
void Kernel::Irq_owner::receive_irq(unsigned const irq)
{
assert(_id == irq_to_id(irq));
@@ -403,9 +424,11 @@ namespace Kernel
*/
static Pd * core()
{
static Core_tlb tlb;
static Pd _pd(&tlb);
return &_pd;
constexpr int tlb_align = 1 << Core_tlb::ALIGNM_LOG2;
Core_tlb *core_tlb = unsynchronized_singleton<Core_tlb, tlb_align>();
Pd *pd = unsynchronized_singleton<Pd>(core_tlb, nullptr);
return pd;
}
@@ -424,16 +447,16 @@ namespace Kernel
}
void Kernel::Thread::_activate()
void Kernel::Thread::_schedule()
{
cpu_scheduler()->insert(this);
_state = ACTIVE;
_state = SCHEDULED;
}
void Kernel::Thread::pause()
{
assert(_state == AWAIT_RESUMPTION || _state == ACTIVE);
assert(_state == AWAIT_RESUMPTION || _state == SCHEDULED);
cpu_scheduler()->remove(this);
_state = AWAIT_RESUMPTION;
}
@@ -442,20 +465,7 @@ void Kernel::Thread::pause()
void Kernel::Thread::stop()
{
cpu_scheduler()->remove(this);
_state = STOPPED;
}
int Kernel::Thread::resume()
{
if (_state != AWAIT_RESUMPTION && _state != ACTIVE) {
PDBG("Unexpected thread state");
return -1;
}
cpu_scheduler()->insert(this);
if (_state == ACTIVE) return 1;
_state = ACTIVE;
return 0;
_state = AWAIT_START;
}
@@ -480,17 +490,25 @@ void Kernel::Thread::reply(size_t const size, bool const await_request)
}
void Kernel::Thread::await_signal()
void Kernel::Thread::await_signal(Kernel::Signal_receiver * receiver)
{
cpu_scheduler()->remove(this);
_state = AWAIT_IRQ;
_state = AWAIT_SIGNAL;
_signal_receiver = receiver;
}
void Kernel::Thread::received_signal()
{
assert(_state == AWAIT_SIGNAL);
_schedule();
}
void Kernel::Thread::_received_irq()
{
assert(_state == AWAIT_IRQ);
_activate();
_schedule();
}
@@ -524,7 +542,7 @@ void Kernel::Thread::scheduled_next()
void Kernel::Thread::_has_received(size_t const s)
{
user_arg_0(s);
if (_state != ACTIVE) _activate();
if (_state != SCHEDULED) _schedule();
}
@@ -589,16 +607,19 @@ namespace Kernel
/**
* Destruct or prepare to do it at next call of 'ack'
*
* \return wether destruction is done
*/
void kill(Thread * const killer)
bool kill(Thread * const killer)
{
assert(!_killer);
_killer = killer;
if (_await_ack) {
_killer->kill_signal_context_blocks();
return;
return 0;
}
this->~Signal_context();
return 1;
}
};
@@ -646,11 +667,17 @@ namespace Kernel
*/
void add_listener(Thread * const t)
{
t->await_signal();
t->await_signal(this);
_listeners.enqueue(t);
_listen();
}
/**
* Stop a thread from listening to our contexts
*/
void remove_listener(Thread * const t) {
_listeners.remove(t); }
/**
* If any of our contexts is pending
*/
@@ -687,8 +714,13 @@ namespace Kernel
Signal_context * const context)
: _state(state), _context(context) { }
void run() {
cpu_scheduler()->insert(this); }
/**************************
** Vm_session interface **
**************************/
void run() { cpu_scheduler()->insert(this); }
void pause() { cpu_scheduler()->remove(this); }
/**********************
@@ -734,7 +766,15 @@ namespace Kernel
/* initialize idle thread */
void * sp;
sp = (void *)&idle_stack[sizeof(idle_stack)/sizeof(idle_stack[0])];
idle.init_context((void *)&idle_main, sp, core_id());
/*
* Idle doesn't use its UTCB pointer, thus
* utcb_phys = utcb_virt = 0 is save.
* Base-hw doesn't support multiple cores, thus
* cpu_no = 0 is ok. We don't use 'start' to avoid
* recursive call of'cpu_scheduler'.
*/
idle.prepare_to_start((void *)&idle_main, sp, 0, core_id(), 0, 0);
initial = 0;
}
/* create scheduler with a permanent idle thread */
@@ -833,7 +873,7 @@ namespace Kernel
void * dst = (void *)user->user_arg_1();
Tlb * const tlb = new (dst) Tlb();
dst = (void *)((addr_t)dst + sizeof(Tlb));
Pd * const pd = new (dst) Pd(tlb);
Pd * const pd = new (dst) Pd(tlb, (Platform_pd *)user->user_arg_2());
/* return success */
user->user_arg_0(pd->id());
@@ -897,8 +937,7 @@ namespace Kernel
assert(t);
/* start thread */
assert(!t->start(ip, sp, cpu, pt->pd_id(),
pt->phys_utcb(), pt->virt_utcb()))
t->start(ip, sp, cpu, pt->pd_id(), pt->phys_utcb(), pt->virt_utcb());
/* return software TLB that the thread is assigned to */
Pd::Pool * const pp = Pd::pool();
@@ -1078,6 +1117,19 @@ namespace Kernel
}
/**
* Do specific syscall for 'user', for details see 'syscall.h'
*/
void do_update_region(Thread * const user)
{
assert(user->pd_id() == core_id());
/* FIXME we don't handle instruction caches by now */
Cpu::flush_data_cache_by_virt_region((addr_t)user->user_arg_1(),
(size_t)user->user_arg_2());
}
/**
* Do specific syscall for 'user', for details see 'syscall.h'
*/
@@ -1252,7 +1304,7 @@ namespace Kernel
Signal_context * const c =
Signal_context::pool()->object(user->user_arg_1());
assert(c);
c->kill(user);
user->user_arg_0(c->kill(user));
}
/**
@@ -1296,6 +1348,23 @@ namespace Kernel
}
/**
* Do specific syscall for 'user', for details see 'syscall.h'
*/
void do_pause_vm(Thread * const user)
{
/* check permissions */
assert(user->pd_id() == core_id());
/* get targeted vm via its id */
Vm * const vm = Vm::pool()->object(user->user_arg_1());
assert(vm);
/* pause targeted vm */
vm->pause();
}
/**
* Handle a syscall request
*
@@ -1340,6 +1409,8 @@ namespace Kernel
/* 28 */ do_resume_faulter,
/* 29 */ do_ack_signal,
/* 30 */ do_kill_signal_context,
/* 31 */ do_pause_vm,
/* 32 */ do_update_region,
};
enum { MAX_SYSCALL = sizeof(handle_sysc)/sizeof(handle_sysc[0]) - 1 };
@@ -1377,6 +1448,8 @@ extern "C" void kernel()
/* kernel initialization */
} else {
Genode::printf("Kernel started!\n");
/* compose kernel CPU context */
static Cpu::Context kernel_context;
kernel_context.ip = (addr_t)kernel;
@@ -1394,6 +1467,12 @@ extern "C" void kernel()
/* switch to core address space */
Cpu::init_virt_kernel(core()->tlb()->base(), core_id());
/*
* From this point on, it is safe to use 'cmpxchg', i.e., to create
* singleton objects via the static-local object pattern. See
* the comment in 'src/base/singleton.h'.
*/
/* create the core main thread */
static Native_utcb cm_utcb;
static char cm_stack[DEFAULT_STACK_SIZE]
@@ -1424,42 +1503,84 @@ extern "C" void kernel()
** Kernel::Thread **
********************/
int Thread::start(void *ip, void *sp, unsigned cpu_no,
unsigned const pd_id,
Native_utcb * const phys_utcb,
Native_utcb * const virt_utcb)
int Kernel::Thread::resume()
{
/* check state and arguments */
assert(_state == STOPPED)
assert(!cpu_no);
/* apply thread configuration */
init_context(ip, sp, pd_id);
_phys_utcb = phys_utcb;
_virt_utcb = virt_utcb;
/* offer thread-entry arguments */
user_arg_0((unsigned)_virt_utcb);
/* start thread */
_activate();
return 0;
switch (_state) {
case AWAIT_RESUMPTION:
_schedule();
return 0;
case SCHEDULED:
return 1;
case AWAIT_IPC:
PDBG("cancel IPC receipt");
Ipc_node::cancel_waiting();
_schedule();
return 0;
case AWAIT_IRQ:
PDBG("cancel IRQ receipt");
Irq_owner::cancel_waiting();
_schedule();
return 0;
case AWAIT_SIGNAL:
PDBG("cancel signal receipt");
_signal_receiver->remove_listener(this);
_schedule();
return 0;
case AWAIT_SIGNAL_CONTEXT_DESTRUCT:
PDBG("cancel signal context destruction");
_schedule();
return 0;
case AWAIT_START:
default:
PERR("unresumable state");
return -1;
}
}
void Thread::init_context(void * const instr_p, void * const stack_p,
unsigned const pd_id)
void Thread::prepare_to_start(void * const ip,
void * const sp,
unsigned const cpu_id,
unsigned const pd_id,
Native_utcb * const utcb_phys,
Native_utcb * const utcb_virt)
{
/* basic thread state */
sp = (addr_t)stack_p;
ip = (addr_t)instr_p;
/* check state and arguments */
assert(_state == AWAIT_START)
assert(!cpu_id);
/* join a pd */
_pd_id = pd_id;
/* store thread parameters */
_phys_utcb = utcb_phys;
_virt_utcb = utcb_virt;
_pd_id = pd_id;
/* join a protection domain */
Pd * const pd = Pd::pool()->object(_pd_id);
assert(pd)
protection_domain(pd_id);
tlb(pd->tlb()->base());
addr_t const tlb = pd->tlb()->base();
/* initialize CPU context */
if (!_platform_thread)
/* this is the main thread of core */
User_context::init_core_main_thread(ip, sp, tlb, pd_id);
else if (!_platform_thread->main_thread())
/* this is not a main thread */
User_context::init_thread(ip, sp, tlb, pd_id);
else
/* this is the main thread of a program other than core */
User_context::init_main_thread(ip, _virt_utcb, tlb, pd_id);
}
void Thread::start(void * const ip,
void * const sp,
unsigned const cpu_id,
unsigned const pd_id,
Native_utcb * const utcb_phys,
Native_utcb * const utcb_virt)
{
prepare_to_start(ip, sp, cpu_id, pd_id, utcb_phys, utcb_virt);
_schedule();
}
@@ -1479,14 +1600,18 @@ void Thread::pagefault(addr_t const va, bool const w)
void Thread::kill_signal_context_blocks()
{
cpu_scheduler()->remove(this);
_state = KILL_SIGNAL_CONTEXT_BLOCKS;
_state = AWAIT_SIGNAL_CONTEXT_DESTRUCT;
}
void Thread::kill_signal_context_done()
{
assert(_state == KILL_SIGNAL_CONTEXT_BLOCKS)
_activate();
if (_state != AWAIT_SIGNAL_CONTEXT_DESTRUCT) {
PDBG("ignore unexpected signal-context destruction");
return;
}
user_arg_0(1);
_schedule();
}

View File

@@ -25,6 +25,9 @@
#include <timer.h>
#include <assert.h>
/* base-hw includes */
#include <singleton.h>
namespace Genode
{
class Platform_thread;
@@ -211,8 +214,7 @@ namespace Kernel
*/
static Id_alloc * _id_alloc()
{
static Id_alloc _id_alloc;
return &_id_alloc;
return unsynchronized_singleton<Id_alloc>();
}
public:
@@ -224,8 +226,7 @@ namespace Kernel
*/
static Pool * pool()
{
static Pool _pool;
return &_pool;
return unsynchronized_singleton<Pool>();
}
/**
@@ -531,23 +532,26 @@ namespace Kernel
* IPC node states:
*
* +----------+ +---------------+ +---------------+
* --new-->| inactive |--send-request-await-reply---->| await reply | +--send-note--| prepare reply |
* --new-->| inactive |---send-request-await-reply--->| await reply | +--send-note--| prepare reply |
* | |<--receive-reply---------------| | | | |
* | |<--cancel-waiting--------------| | | | |
* | | +---------------+ +------------>| |
* | |<--request-is-a-note-------+---request-is-not-a-note------------------------>| |
* | |<--------------------------(---not-await-request-----+ | |
* | | | +---------------+ | | |
* | |--await-request------------+-->| await request |<----+--send-reply-----------| |
* | |--send-reply---------+-----+-->| |--announce-request-+-------->| |
* | |--send-note--+ | | +---------------+ | | |
* | | | | request available | | |
* | |<------------+ | | | | |
* | |<--not-await-request-+ | | | |
* | |<--request-is-a-note-------+---request-is-not-a-note---------------|-------->| |
* | |<--request-is-a-note-----------------------------------------------+ | |
* | |<--------------------------(---not-await-request---+ | |
* | | | +---------------+ | | |
* | |---await-request-----------+-->| await request |<--+--send-reply-------------| |
* | |<--cancel-waiting--------------| |------announce-request--+--->| |
* | |---send-reply---------+----+-->| | | | |
* | |---send-note--+ | | +---------------+ | | |
* | | | | | | | |
* | |<-------------+ | request available | | |
* | |<--not-await-request--+ | | | |
* | |<--request-is-a-note-------+-------------------request-is-not-a-note----(--->| |
* | |<--request-is-a-note----------------------------------------------------+ | |
* +----------+ +-------------------------+ | |
* | prepare and await reply |<--send-request-and-await-reply--| |
* | |--receive-reply----------------->| |
* | |---receive-reply---------------->| |
* | |---cancel-waiting--------------->| |
* +-------------------------+ +---------------+
*
* State model propagated to deriving classes:
@@ -564,6 +568,7 @@ namespace Kernel
* | |<--request-available-or-not-await-request--+ | |
* | |<--announce-request----------------------------| |
* | |<--receive-reply-------------------------------| |
* | |<--cancel-waiting------------------------------| |
* +--------------+ +----------------+
*/
class Ipc_node
@@ -592,9 +597,9 @@ namespace Kernel
Fifo<Message_buf> _request_queue; /* requests that waits to be
* received by us */
Message_buf _inbuf; /* buffers message we have received lastly */
Message_buf _inbuf; /* buffers message we have received lastly */
Message_buf _outbuf; /* buffers the message we aim to send */
State _state; /* current node state */
State _state; /* current node state */
/**
* Buffer next request from request queue in 'r' to handle it
@@ -689,6 +694,11 @@ namespace Kernel
void send_note(Ipc_node * const dest,
void * const note_base,
size_t const note_size);
/**
* Stop waiting for a receipt if in a waiting state
*/
void cancel_waiting();
};
/**
@@ -753,6 +763,11 @@ namespace Kernel
*/
void await_irq();
/**
* Stop waiting for an IRQ if in a waiting state
*/
void cancel_waiting();
/**
* Denote occurence of an IRQ if we own it and awaited it
*/
@@ -774,8 +789,16 @@ namespace Kernel
public Ipc_node,
public Irq_owner
{
enum State { STOPPED, ACTIVE, AWAIT_IPC, AWAIT_RESUMPTION,
AWAIT_IRQ, AWAIT_SIGNAL, KILL_SIGNAL_CONTEXT_BLOCKS };
enum State
{
SCHEDULED,
AWAIT_START,
AWAIT_IPC,
AWAIT_RESUMPTION,
AWAIT_IRQ,
AWAIT_SIGNAL,
AWAIT_SIGNAL_CONTEXT_DESTRUCT,
};
Platform_thread * const _platform_thread; /* userland object wich
* addresses this thread */
@@ -785,11 +808,13 @@ namespace Kernel
unsigned _pd_id; /* ID of the PD this thread runs on */
Native_utcb * _phys_utcb; /* physical UTCB base */
Native_utcb * _virt_utcb; /* virtual UTCB base */
Signal_receiver * _signal_receiver; /* receiver we are currently
* listen to */
/**
* Resume execution
*/
void _activate();
void _schedule();
/**************
@@ -805,7 +830,7 @@ namespace Kernel
** Irq_owner **
***************/
void _received_irq() { _activate(); }
void _received_irq();
void _awaits_irq();
@@ -818,23 +843,43 @@ namespace Kernel
*/
Thread(Platform_thread * const platform_thread) :
_platform_thread(platform_thread),
_state(STOPPED), _pager(0), _pd_id(0),
_phys_utcb(0), _virt_utcb(0)
_state(AWAIT_START), _pager(0), _pd_id(0),
_phys_utcb(0), _virt_utcb(0), _signal_receiver(0)
{ }
/**
* Prepare thread to get scheduled the first time
*
* \param ip initial instruction pointer
* \param sp initial stack pointer
* \param cpu_id target cpu
* \param pd_id target protection-domain
* \param utcb_phys physical UTCB pointer
* \param utcb_virt virtual UTCB pointer
*/
void prepare_to_start(void * const ip,
void * const sp,
unsigned const cpu_id,
unsigned const pd_id,
Native_utcb * const utcb_phys,
Native_utcb * const utcb_virt);
/**
* Start this thread
*
* \param ip instruction pointer to start at
* \param sp stack pointer to use
* \param cpu_no target cpu
*
* \retval 0 successful
* \retval -1 thread could not be started
* \param ip initial instruction pointer
* \param sp initial stack pointer
* \param cpu_id target cpu
* \param pd_id target protection-domain
* \param utcb_phys physical UTCB pointer
* \param utcb_virt virtual UTCB pointer
*/
int start(void *ip, void *sp, unsigned cpu_no,
unsigned const pd_id, Native_utcb * const phys_utcb,
Native_utcb * const virt_utcb);
void start(void * const ip,
void * const sp,
unsigned const cpu_id,
unsigned const pd_id,
Native_utcb * const utcb_phys,
Native_utcb * const utcb_virt);
/**
* Pause this thread
@@ -866,16 +911,6 @@ namespace Kernel
*/
void reply(size_t const size, bool const await_request);
/**
* Initialize our execution context
*
* \param ip instruction pointer
* \param sp stack pointer
* \param pd_id identifies protection domain we're assigned to
*/
void init_context(void * const ip, void * const sp,
unsigned const pd_id);
/**
* Handle a pagefault that originates from this thread
*
@@ -890,9 +925,9 @@ namespace Kernel
unsigned id() const { return Object::id(); }
/**
* Gets called when we await a signal at a signal receiver
* Gets called when we await a signal at 'receiver'
*/
void await_signal();
void await_signal(Kernel::Signal_receiver * receiver);
/**
* Gets called when we have received a signal at a signal receiver

Some files were not shown because too many files have changed in this diff Show More