Commit Graph

1019 Commits

Author SHA1 Message Date
Alexander Boettcher 869fac8f76 pci: print irq/msi vector when a device gets used 2015-05-26 09:39:52 +02:00
Alexander Boettcher dd7ddae0e9 pci: add readme to pci_drv, adjust acpi_drv README 2015-05-26 09:39:52 +02:00
Alexander Boettcher 51b79d7da6 pci: support disabling msis 2015-05-26 09:39:52 +02:00
Christian Prochaska d9825cd708 codezero: move first container to higher address
Fixes #1525
2015-05-26 09:39:51 +02:00
Christian Helmuth 7d39304050 rpi: fix response initialization in platform_drv
GCC 4.9 legitimately whines that const members of responses must be
initialized on construction.
2015-05-26 09:39:51 +02:00
Christian Helmuth 4dad09203a input_merger: fix compiler warning 2015-05-26 09:39:51 +02:00
Alexander Boettcher 3e90542559 nova: use signals with irqs in core
Avoids the need to have per IRQ a thread that blocks synchronously for next
interrupt. Now a thread may wait for multiple IRQs as other signals
simultaneously.

In core no threads are required anymore for IRQs/MSI - the clients (either
the pci_drv or in case of MSI the driver) gets the IRQ delivered directly as
a ordinary Genode signal.

Useful since #1216 and #1487 is now available.
Commit applies feature of #1446 also to IRQ/MSIs.
2015-05-26 09:39:51 +02:00
Christian Prochaska d554200e5a x86emu: prevent warnings about uninitialized vars
Fixes #1522
2015-05-26 09:39:51 +02:00
Christian Prochaska 526d6eed1c libc: fix compiler warning
Fixes #1523
2015-05-26 09:39:51 +02:00
Norman Feske e2fe071871 Minor comment refinements for the manual 2015-05-26 09:39:50 +02:00
Reto Buerki 58178949ef hw_x86_64: Make AHCI driver work
The assumption that IRQs in the legacy ISA range are always
edge-triggered is wrong. For the free-for-use IRQs it depends on the
actual device which uses the specific IRQ. Therefore, treat IRQs 9, 10
and 11 as level-triggered.
2015-05-26 09:39:50 +02:00
Reto Buerki afec233f50 hw_x86_64: Use _edge_triggered() in _create_irt_entry() 2015-05-26 09:39:50 +02:00
Reto Buerki 5eed6de910 hw_x86_64: Let _edge_triggered() operate on IRQ
Use the base IRQ in the _edge_triggered() utility function, not the
remapped vector.
2015-05-26 09:39:50 +02:00
Reto Buerki 6af893123e hw_x86_64: Only block masking of legacy IRQs
Allow legacy IRQ unmasking. Initially, all IRQs are masked and must be
explicitly unmasked by a driver.
2015-05-26 09:39:50 +02:00
Reto Buerki e034846f32 hw_x86_64: Initially mask IRQs in _create_irt_entry 2015-05-26 09:39:50 +02:00
Christian Prochaska e0dbf67e1d tool_chain: enable x86_64 target support in GDB
Fixes #1521
2015-05-26 09:39:49 +02:00
Christian Prochaska 72e31090ee tool_chain: update GCC to version 4.9.2
Fixes #1520
2015-05-26 09:39:49 +02:00
Christian Prochaska 7709059245 tool_chain: update GCC to version 4.8.4
Fixes #1519
2015-05-26 09:39:49 +02:00
Christian Prochaska b704944d4d tool_chain: update binutils to version 2.25
Fixes #1518
2015-05-26 09:39:49 +02:00
Christian Prochaska 2706e4cd75 tool_chain: cleanup
Fixes #1517
2015-05-26 09:39:49 +02:00
Christian Prochaska ebcfc28a5b qt5: GCC 4.9 compile fix
Fixes #1515
2015-05-26 09:39:49 +02:00
Emery Hemingway ed4a821891 jitterentropy: update 20140411 to 1.2.0
Issue #1416
2015-05-26 09:39:48 +02:00
Alexander Boettcher 8fa802815d pci: fix wrong warning about multiple usage
Issue #1487
2015-05-26 09:39:48 +02:00
Alexander Boettcher ccc0f4c2ec usb: handle quota_exceed exception of pci_drv
Issue #755
2015-05-26 09:39:48 +02:00
Christian Prochaska 493bcc80df dde_rump: don't build non-Genode shared libraries
Fixes #1512
2015-05-26 09:39:48 +02:00
Christian Prochaska 5bf538de0c Noux: implement the 'F_GETFL' 'fcntl()' command for pipes
Fixes #1513
2015-05-26 09:39:48 +02:00
Christian Prochaska e7f869611c hw: static constexpr function when reinterpret cast is used
Issue #1511
2015-05-26 09:39:47 +02:00
Alexander Boettcher e84284c0cd base: remove shared irq from core
Cleanup commit after all relevant drivers got adapted to use the x86 platform
driver (pci_drv).

Issue #1471
2015-05-26 09:39:47 +02:00
Alexander Boettcher 3783db66e2 base: implement detach for core context_area
Required to destroy threads within in core. Used when IRQs get reused on
platforms where every IRQ needs a thread in core.

Issue #1471
2015-05-26 09:39:47 +02:00
Christian Prochaska 3a378bb970 libc_noux: remove dependency on 'platform_env.h'
Currently, libc_noux includes the 'base/src/base/env/platform_env.h' file
to be able to reinitialize the environment using the 'Platform_env'
interface. For base-linux, a special version of this file exists and the
inclusion of the generic version in libc_noux causes GCC 4.9 to make wrong
assumptions about the memory layout of the 'Env' object returned by
'Genode::env()'.

This commit moves the reinitialization functions to the 'Env' interface to
avoid the need to include the 'platform_env.h' file in libc_noux.

Fixes #1510
2015-05-26 09:39:47 +02:00
Christian Prochaska 1207a4cecd fiasco: remove 'const' GCC attribute from some functions
Some functions in the kernel, which create a static object and return its
address, are declared with a GCC 'const' attribute, which can cause GCC
4.9 to optimize the function call out and use the static object's address
without calling the constructor.

Fixes #1509
2015-05-26 09:39:47 +02:00
Norman Feske 57c9f2aa43 Fix comment 2015-05-26 09:39:47 +02:00
Sebastian Sumpf bd2e15aeb0 foc: update hash for gcc-4.9 support
see: https://github.com/ssumpf/foc/issues/10
2015-05-26 09:39:46 +02:00
Sebastian Sumpf 8eb2286f60 part_blk: propagate back end information
Propagate supported device operations and read/write errors from back end to
client.
2015-05-26 09:39:46 +02:00
Christian Prochaska 88034ef836 vbox: enable USB (OHCI) pass-through support
The information about connected devices is obtained from a ROM file named
'usb_devices', which is supposed to contain a device list as in the device
report generated by the USB driver (see issue #1506).

A policy for 'report_rom' would look like:

<policy label="vbox -> usb_devices" report="usb_drv -> devices"/>

If the 'usb_devices' ROM file is not available, a warning message gets
printed and VirtualBox continues without USB pass-through support.

The devices to be passed-through need to have a matching device filter in
the '.vbox' file. Example:

<USB>
    <DeviceFilters>
        <DeviceFilter name="USB Scanner" active="true" vendorId="04a9"
                      productId="2220" remote="0"/>
    </DeviceFilters>
</USB>

The feature was tested with HID devices (mouse, keyboard) and a flatbed
scanner. Mass storage devices didn't work correctly (they also didn't work
with VirtualBox on Linux without the closed-source extension pack).

It should be made sure that the USB driver does not try to control the
devices to be passed-through itself, for example, when passing-through
a HID device, the '<hid/>' config option should not be set.

Fixes #1507
2015-05-26 09:39:46 +02:00
Christian Prochaska 2d869dd15e usb_drv: generate a device list report
The report lists all connected devices and gets updated when devices are
added or removed.

Example report:

<devices>
    <device vendor_id="0x17ef" product_id="0x4816"/>
    <device vendor_id="0x0a5c" product_id="0x217f"/>
    <device vendor_id="0x8087" product_id="0x0020"/>
    <device vendor_id="0x8087" product_id="0x0020"/>
    <device vendor_id="0x1d6b" product_id="0x0002"/>
    <device vendor_id="0x1d6b" product_id="0x0002"/>
</devices>

There is no distinction yet for multiple devices of the same type.

The report is named "devices" and an example policy for 'report_rom' would
look like:

<policy label="vbox -> usb_devices" report="usb_drv -> devices"/>

The report only gets generated if enabled in the 'usb_drv' configuration:

<config>
    <raw>
        <report devices="yes"/>
    </raw>
</config>

Fixes #1506
2015-05-26 09:39:46 +02:00
Christian Prochaska e8f82a1da3 nova: delay UTCB revocation on thread destruction
On NOVA, a Genode thread currently cannot destroy itself by destroying its
own 'Thread' object, because in 'Thread_base::_deinit_platform_thread()'
it cannot call 'Cpu_session::kill_thread()' anymore after it has revoked
its own UTCB.

As solution, the revocation of the UTCB can be delayed until its location
in the context area is needed by a new thread.

Fixes #1505
2015-05-26 09:39:46 +02:00
Christian Prochaska 65d8d4461f vbox: adapt run scripts to new AHCI driver
Fixes #1503
2015-05-26 09:39:46 +02:00
Alexander Boettcher 24a4e486c4 nova: adjust phys and io_mem allocator
Add comments about the way the allocator are filled and make solely acpi
related memory as io_mem available to platform.
2015-05-26 09:39:45 +02:00
Martin Stein c6417051ce hw & x86: Use register framework for IRTEs
Ref #1494
2015-05-26 09:39:45 +02:00
Martin Stein 6ec39d8df5 hw & x86: Style fixes for cpu_support.h
Ref #1494
2015-05-26 09:39:45 +02:00
Adrian-Ken Rueegsegger f99fab544a hw_x86_64: Add x86-specific I/O mem allocator init
Enable a platform to specify how the MMIO memory allocator is to be
initialized. On ARM the existing behavior is kept while on x86 the I/O
memory is defined as the entire address space excluding the core only
RAM regions. This aligns the hw_x86_64 I/O memory allocator
initialization with how it is done for other x86 kernels such as NOVA or
Fiasco.
2015-05-26 09:39:45 +02:00
Adrian-Ken Rueegsegger 36b2cf932b hw_x86_64: Initialize complete I/O APIC IRT entries
Also set high 32 bits of I/O APIC redirection table entries.
2015-05-20 17:53:00 +02:00
Adrian-Ken Rueegsegger f2fe0eccb8 hw_x86_64: Explicitly initialize MXCSR
The assures that the MXCSR is initialized to the recommended value.
2015-05-20 17:52:59 +02:00
Adrian-Ken Rueegsegger ded302c61c hw_x86_64: Perform lazy FPU state initialization
Perform lazy-initialization of FPU state when it is enabled for the
first time. This assures that the FXSAVE area (including the stored
MXCSR) is always properly setup and initialized to the platform default
values.
2015-05-20 17:52:59 +02:00
Adrian-Ken Rueegsegger a0ec317753 hw_x86_64: Explicitly set all FPU-related CR flags
Perform all FPU-related setup in the Cpu class' init_fpu function instead of
the general system bring-up assembly code.

Set all required control register 0 and 4 flags according to Intel SDM Vol. 3A,
sections 9.2 and 9.6 instead of only enabling FPU error reporting and OSFXSR.
2015-05-20 17:52:59 +02:00
Adrian-Ken Rueegsegger 5eb75e9e81 hw_x86_64: Add control register 4 to Cpu class 2015-05-20 17:52:59 +02:00
Adrian-Ken Rueegsegger fdbb073414 hw_x86_64: Log ip on unknown exception 2015-05-20 17:52:59 +02:00
Adrian-Ken Rueegsegger 4d700fe2ae hw_x86_64: Emit debug message on #UD
Print information when handling an undefined instruction exception.
2015-05-20 17:52:59 +02:00
Adrian-Ken Rueegsegger 96149db858 base: Add #UD exception to x86_64 Cpu_state 2015-05-20 17:52:59 +02:00
Adrian-Ken Rueegsegger 370271324e hw_x86_64: Simplify kernel physical init
Merge finish_init_phys_kernel into init_phys_kernel function.
2015-05-20 17:52:58 +02:00
Reto Buerki bb06826c95 hw_x86_64: Factor out initial PT to separate file
This allows the specification of different initial pagetables for a
platform based on x86_64 (e.g. Muen).
2015-05-20 17:52:58 +02:00
Sebastian Sumpf 9d4f410988 test: block benchmarking 2015-05-20 17:52:58 +02:00
Sebastian Sumpf ff12ea01d5 blk_cli: add support for test size
'test_size' can be set as parameter in <config> node.
2015-05-20 17:52:58 +02:00
Sebastian Sumpf 7910b5146f ahci: new AHCI driver implementation
Supports native command queueing and multiple ports.
2015-05-20 17:52:58 +02:00
Sebastian Sumpf 33bc63e7c3 os: rename 'bswap' to 'host_to_big_endian' 2015-05-20 17:52:58 +02:00
Josef Söntgen 6a89bd15fd dde_bsd: prefix audio library name
Issue #1498.
2015-05-20 17:52:58 +02:00
Josef Söntgen 11d5f07862 dde_bsd: remove disabling of MSIs
Issue #1498.
2015-05-20 17:52:57 +02:00
Norman Feske 4736488d99 core: change order of _export_ds and _clear_ds
On seL4, we need to convert untyped memory to page frames before being
able to use it as normal memory. There already exists the hook function
'_export_ds' that is principally suitable for such tasks. It is
currently solely used on Linux where we have to create a file for each
dataspace. To make the hook useful also for seL4, we need to call
_export_ds prior _clear_ds. Otherwise, we would try to clear memory that
is still untyped.
2015-05-20 17:52:57 +02:00
Alexander Boettcher a312d440c8 acpi: use local irq service for pci slave
Fixes base-foc issue on qemu caused by wrong set irq polarity and trigger mode.

Bug introduced in #1471

Issue #1216
2015-05-20 17:52:57 +02:00
Alexander Boettcher 2ceecd44f9 pci: assign device during pci config cmd write
Issue #1216
2015-05-20 17:52:57 +02:00
Alexander Boettcher 3eed3ad329 ahci: use MSIs on x86
- remove code for disabling MSIs

Issue #1216
2015-05-20 17:52:57 +02:00
Alexander Boettcher b3964f4af1 netperf: test usb30 also for x86
On our test machine the xhci controller has a usb3.0 network adapter attached
and the xhci controller is the only usb controller which has MSI support,
so let us use and test it.

Issue #1216
2015-05-20 17:52:57 +02:00
Alexander Boettcher ecc9007e84 pci: add msi support to platform driver
Fixes #1216
2015-05-20 17:52:56 +02:00
Alexander Boettcher d998df3b7f base: extend irq session to support MSIs
Works on base-nova and base-foc, the other kernels have no MSI support.

Issue #1216
2015-05-20 17:39:14 +02:00
Josef Söntgen b0f900b32b adapt run scripts to new audio_out_drv
Issue #1498.
2015-05-06 16:18:53 +02:00
Josef Söntgen 27e5d48fd0 dde_oss: remove repository
This repository is superseded by the 'dde_bsd' repository.  Though
OSSv4 served us well, its future is uncertain and having active
upstream development is preferable. In addition the ported Intel
HD Audio driver did not work on any Thinpad model newer than T60.

Issue #1498.
2015-05-06 16:18:42 +02:00
Josef Söntgen 49dd9242f7 dde_bsd: add audio drivers ported from OpenBSD
These audio drivers enable support for Intel HD Audio (Azalia) and
Ensoniq AudioPCI (ES1370) compatible soundcards. They are ported
from OpenBSD 5.7.

Fixes #1498.
2015-05-06 16:18:36 +02:00
Josef Söntgen df04b17594 os: show played times in Audio_out test
The message may be used by a run script to signal successfull testing.

Issue #1498.
2015-05-06 16:18:31 +02:00
Josef Söntgen 4b687f4b1a pci: add AUDIO to alias list
Strictly speaking we make AUDIO an alias for PCI_CLASS_MULTIMEDIA
and ignore any sub class.

Issue #1498.
2015-05-06 16:18:20 +02:00
Christian Helmuth dcd589d113 l4linux: platform_drv may provide platform session
This is especially true for i.MX53 but is not needed on Arndale
currently.

@skalk the test will still fail each night as we do not have a nic_drv
for imx53...
2015-05-06 12:46:25 +02:00
Christian Prochaska a4868f8d1d vbox: use interface declarations from 'VirtualBox_XPCOM.h'
Fixes #1499
2015-05-06 12:06:23 +02:00
Christian Prochaska 1001a04883 usb_drv improvements
- send a 'state_change' signal on session creation if the device is
  already attached
- evaluate the status code of a finished asynchronous operation
- return the number of actually transferred bytes for control transfers,
  too

Fixes #1490
2015-05-06 12:01:30 +02:00
Norman Feske c1cb3a6642 Increase initial block for cxx malloc
This patch avoids the attempt to extend the cxx-local heap during the
startup phase of an application. Originally, the static part of the cxx
was merely 100 bytes, which did not suffice to run the minimalistic test
roottask on seL4.
2015-05-06 11:32:06 +02:00
Norman Feske 89e987b22e base/x86_32: preserve EBX value in crt0 2015-05-06 11:32:06 +02:00
Christian Helmuth ec954a2278 base-foc: comply with thread limit in core
Fiasco.OC limits the UTCB area for roottask to 16K. Therefore, the
number of threads is limited to 16K / L4_UTCB_OFFSET. (see
kernel/fiasco/src/kern/kernel_thread-std.cpp:94)
2015-05-06 10:55:24 +02:00
Christian Helmuth 6b0723b3bb libc: provide C99 API functions
At least stdcxx needs some C99 functions and depends on _GLIBCXX_USE_C99
for C++11 compatibility.
2015-05-06 10:55:24 +02:00
Christian Helmuth c6857b3019 thread: remove weak implementation of myself() 2015-05-06 10:55:24 +02:00
Christian Helmuth 2f14f57735 stdcxx: add dependency to libm 2015-05-06 10:55:24 +02:00
Christian Helmuth 5d18e0f23b linux_drivers is obsolete 2015-05-06 10:55:23 +02:00
Martin Stein 7c133add52 hw: acknowledge IRQs via Kernel::ack_irq
In the past, when the user blocked for an IRQ signal, the last signal was
acknowledged automatically thereby unmasking the IRQ. Now, the signal session
got a dedicated RPC for acknowledging IRQs and the HW back-end of that RPC
acknowledged the IRQ signal too. This led to the situation that IRQs were
unmasked twice. However, drivers expect an interrupt to be unmasked only on
the Irq_session::ack_irq and thus IRQ unmasking was moved from
Kernel::ack_signal to a dedicated kernel call.

Fixes #1493
2015-05-06 10:55:23 +02:00
Stefan Kalkowski e61a3db30d hw: separate function declaration/implementation
Move kernel object functions from its headers to compilation units,
thereby reducing the kernel's text section, cache, and TLB footprint.

Fix #1492
2015-05-06 10:55:23 +02:00
Alexander Boettcher bc3ba380ae nova: fix check in irq_session destruction
Issue #1456
2015-05-06 10:55:22 +02:00
Alexander Boettcher b7f2b92dbc pci: restrict usage of pci config space
White list access to ports we actually need for our drivers so far and
deny everything else by default. The extend pci config space dataspace is
currently not used and exposes a potential risk (BAR rewrite) - so deny.

Related to #1487
2015-05-06 10:55:22 +02:00
Alexander Boettcher 729ae0a838 pci: track usage of pci devices by drivers
Warn about if more than one driver uses the same device.

Issue #1487
2015-05-06 10:55:22 +02:00
Alexander Boettcher 6c65e436bf usb: use io_mem on x86 via platform driver
Issue #1487
2015-05-06 10:55:22 +02:00
Alexander Boettcher a4d6be1b3d wifi: use io mem via device interface
Issue #1487
2015-05-06 10:55:22 +02:00
Alexander Boettcher b9379a10e7 dde_ipxe: use io mem via device interface
Issue #1487
2015-05-06 10:55:21 +02:00
Alexander Boettcher 65a3be856f pci: provide io mem via device interface
Fixes #1487
2015-05-06 10:55:21 +02:00
Alexander Boettcher f265b64d6d ps2: use io port via device interface
Issue #1487
2015-05-06 10:55:21 +02:00
Alexander Boettcher e8854cd998 dde_ipxe: use io ports via device interface
Issue #1487
2015-05-06 10:55:21 +02:00
Alexander Boettcher b7ca04ddde dde_kit: use io ports via device interface
Issue #1487
2015-05-06 10:55:21 +02:00
Alexander Boettcher c84817dd7b pci_device:: add convenience phys to virt bar method 2015-05-06 10:55:21 +02:00
Alexander Boettcher 1006571c85 pci: provide io_ports via device interface
Issue #1487
2015-05-06 10:55:20 +02:00
Alexander Boettcher 4e99925c7c vesa: upgrade memory for pci device iteration
Issue #755
2015-05-06 10:55:20 +02:00
Alexander Boettcher 6fa85dfd45 ahci: upgrade memory 2015-05-06 10:55:20 +02:00
Alexander Boettcher 4ead4484ec dde_linux: upgrade quota for wifi
Issue #755
2015-05-06 10:55:20 +02:00
Alexander Boettcher d37d2bd737 dde_linux: upgrade quota for usb_drv
Issue #755
2015-05-06 10:55:20 +02:00
Alexander Boettcher 828ae3800d dde_ipxe: upgrade quota for nic_drv
Issue #755
2015-05-06 10:55:20 +02:00
Alexander Boettcher 0cf8d75346 dde_kit: upgrade ram support for device iteration
Issue #755
2015-05-06 10:55:20 +02:00
Alexander Boettcher 06e7c947bc pci: use ram quota upgrade mechanism
Fixes #755
2015-05-06 10:55:19 +02:00
Alexander Boettcher df50d1b29d run: adjust autopilot run scripts to pci changes
Issue #1486
2015-05-06 10:55:19 +02:00
Alexander Boettcher 18b36fb339 acpi: provide pci policy to pci driver
Issue #1486
2015-05-06 10:55:19 +02:00
Alexander Boettcher e527f6e5ac ps2: use irqs via device interface
Issue #1486 and #1471
2015-05-06 10:55:19 +02:00
Alexander Boettcher 7770a0fbbe pci: enforce policy on device discovery
Fixes #1486
2015-05-06 10:55:19 +02:00
Alexander Boettcher 8743575dcf pci: support discovery of non pci devices
Issue #1486
2015-05-06 10:55:19 +02:00
Alexander Boettcher e4d663cf41 pci: remove device_cap from dma calls
Issue #1486
2015-05-06 10:55:18 +02:00
Alexander Boettcher 0ed45d92ff base: string length handling fix in Rpc_in_buffer
If a null-terminated string exactly of length MAX (0 byte included) is
provided, it will be handled as invalid because of wrong string size length
checks.

Commit fixes this.

Discovered during #1486 development.
2015-05-06 10:55:18 +02:00
Alexander Boettcher 3c5fb420ca dde_ipxe: use irq via device interface
Issue #1471
2015-05-06 10:55:18 +02:00
Alexander Boettcher 5c1504fd8f wifi: use irq via device interface
Issue #1471
2015-05-06 10:55:18 +02:00
Alexander Boettcher a58bc84d3e usb: use irq via platform driver or directly
Issue #1471
2015-05-06 10:55:18 +02:00
Alexander Boettcher 6dd9d349fc pci: support shared irqs (x86)
Step to move shared irq handling out of core in the long run. So, use
irq_proxy implementation from base in os and implement shared irq handling
in platform driver of x86 (pci_drv).

Fixes #1471
2015-05-06 10:55:18 +02:00
Alexander Boettcher 31faee3b5c pci: provide irq capability via device interface
Issue #1471
2015-05-06 10:55:17 +02:00
Christian Helmuth f20b6bdc88 Prevent overlap of stack and thread-context members
Now, Thread::Context provides the first word of the stack to prevent the
overlapping of stack top and the 'stack_base' member.

Fixes #1491
2015-05-06 10:55:17 +02:00
Christian Helmuth 98def2488a thread: move Thread_base::myself() to separate file
The thread library (thread.cc) in base-foc shared 95% of the code with
the generic implementation except myself(). Therefore, its
implementation is now separated from the other generic sources into
myself.cc, which allows base-foc to use a foc-specific primitive to
enable our base libraries in L4Linux.

Issue #1491
2015-05-06 10:55:17 +02:00
Emery Hemingway 55c0a947e4 Move generic fs helpers to os/include/file_system
Fixes #1488
2015-05-06 10:55:17 +02:00
Norman Feske eecb5cc300 Move OKL4 source code on genode.org
The original download location at wiki.ok-labs.com went down.

Fixes #1489
2015-05-06 10:55:16 +02:00
Alexander Boettcher 50d6d2e922 okl4: fix return value if IPC failed
Otherwise RPC calls to dead/invalid destinations are rated as successful,
which leads to wrong execution paths later on. Triggered by bomb.run where
rm_session.attach() returned as successful with local address set to 0, which
causes un-handled page-faults later on.

Fixes #1480
2015-05-06 10:55:16 +02:00
Christian Helmuth eee0bf5ab2 init: abort request on invalid route
Fixes #1423
2015-05-06 10:55:16 +02:00
Martin Stein c9272937e7 CPU session: apply quota via relative weightings
Physical CPU quota was previously given to a thread on construction only
by directly specifying a percentage of the quota of the according CPU
session. Now, a new thread is given a weighting that can be any value.
The physical counter-value of such a weighting depends on the weightings
of the other threads at the CPU session. Thus, the physical quota of all
threads of a CPU session must be updated when a weighting is added or
removed. This is each time the session creates or destroys a thread.

This commit also adapts the "cpu_quota" test in base-hw accordingly.

Ref #1464
2015-05-06 10:55:16 +02:00
Martin Stein 955977b516 hw: syscall for changing a threads physical quota
This commit also extends the "cpu_scheduler" test to test the back-end of the
new syscall.

Ref #1464
2015-04-23 16:51:33 +02:00
Martin Stein e4f560f39b hw: change round-robin scheduling slice to 10 ms
Previously, it was set to 100 ms which caused a remarkable disadvantage
in reactivity.

Ref #1464
2015-04-23 16:51:33 +02:00
Martin Stein de9d69a6d7 hw: re-enable kernel tests with the new run env
The new run env doesn't pass the "core_type" parameter at one point
which is why we have to pass it through a global HW-specific variable.

Ref #1464
2015-04-23 16:51:33 +02:00
Josef Söntgen 7a8c088fc6 gems: remove d3m
D3m is superseded by now. Altough there is no direct replacement
combining various other components is equal to its functionality.

Issue #1456.
2015-04-23 16:48:00 +02:00
Josef Söntgen 2c39c75e1c base: remove Irq_connection::wait_for_irq() 2015-04-23 16:48:00 +02:00
Josef Söntgen 0383c68bf6 os: use async IRQ interface in Irq_activation
Issue #1456.
2015-04-23 16:48:00 +02:00
Josef Söntgen 85599c072f os: use async IRQ and server lib in drivers
Use the new asynchronous IRQ interface in the mostly used drivers, e.g.:

* ahci_drv: x86/exynos5
* gpio_drv: imx53/omap4
* input_drv: imx53/dummy
* ps2_drv: x86/pl050
* timer_drv

Now, the Irq_session is requested from Gpio::Session:

From now on we use an asynchronous IRQ interface. To prevent triggering
another GPIO IRQ while currently handling the former one, IRQs must
now by acknowledged explicitly. While here, we also changed the GPIO
session interface regarding IRQ management. The generic GPIO component
now wraps the Irq_session managed by the backend instead of using the
GPIO backend methods directly. A client using the GPIO session may
request the Irq_session_capability by calling
'Gpio::Session::irq_session()' and can use this capability when using
a local Irq_session_client.

Issue #1456.
2015-04-23 16:47:59 +02:00
Josef Söntgen bfb47cfd4e wifi_drv: use asynchronous IRQ session interface
Issue #1456.
2015-04-23 16:47:59 +02:00
Josef Söntgen 9606abc146 dde_ipxe: remove dde_kit
A long long time ago, in a galaxy^W^W^W we used DDE kit to ease the
porting of purely C based drivers. By now it became clear, that we
do not gain that much by following this approach. DDE kit contains
much generic functionality, which is not used or rather not needed
by most ported drivers. Hence, we implement a slim C wrapper on top
of Genode's C++ APIs, that is especially tailored to the driver.

In addition to removing the dependency on DDE kit, the iPXE driver
now uses the server framework and the newly introduced signal based
IRQ handling.

Issue #1456.
2015-04-23 16:47:58 +02:00
Josef Söntgen 09e96dfdcd dde_kit: use async IRQ session interface
Up to now, dde_kit used the synchronous IRQ session interface. This
interface is going to get deprectated very soon.

Issue #1456.
2015-04-23 16:47:58 +02:00
Alexander Boettcher faa25e1df6 base: make irq_session asynchronous
second step

options: factor out common parts of irq_session_component.cc
options: use on foc arm no proxy threads

Fixes #1456
2015-04-23 16:47:58 +02:00
Alexander Boettcher e2cbc7c5b3 base: unify some irq_session headers
remove repos/base-*/include/irq_session headers and use only a unification
from   repos/base/include/irq_session

first step

Issue #1456
2015-04-23 16:47:57 +02:00
Josef Söntgen 2002e1ccba os: remove ATAPI driver
The driver will be superseeded soon by a new AHCI driver that supports
ATAPI devices. There is no IDE support in Gende anymore, however.

Issue #1456.
2015-04-23 16:47:57 +02:00
Norman Feske 97dc9664fe base: move flex_iterator.h to include/util
Fixes #1482
2015-04-17 16:13:22 +02:00
Norman Feske eaab23c012 base: const-correctness of Allocator interface
This patch adds const qualifiers to the functions Allocator::consumed,
Allocator::overhead, Allocator::avail, and Range_allocator::valid_addr.

Fixes #1481
2015-04-17 16:13:22 +02:00
Norman Feske 847ddbf72e os: Remove new operator from packet_stream.h 2015-04-17 16:13:22 +02:00
Norman Feske c4dea1057b Document empty Pd_session_client::assign_pci 2015-04-17 16:13:22 +02:00
Norman Feske e4906ef777 Remove unused GTA01 platform support
This platform (originally added to support the GP2X handheld console)
remains untouched since half a decade.
2015-04-17 16:13:21 +02:00
Norman Feske 270f1068cb os: Move Ring_buffer to Genode namespace
Fixes #1479
2015-04-17 16:13:21 +02:00
Stefan Kalkowski 146292dba9 base-host: remove platform template completely
Fix #1476
2015-04-17 16:13:21 +02:00
Stefan Kalkowski 0188b08f6a hw: construct kernel irq objects on demand
Ref #1443
2015-04-17 16:13:21 +02:00
Stefan Kalkowski b32af4e0a4 hw: directly reference kernel objects from core
Instead of handing over object ids to the kernel, which has to find them
in object pools then, core can simply use object pointers to reference
kernel objects.

Ref #1443
2015-04-17 16:13:20 +02:00
Stefan Kalkowski c850462f43 hw: replace kernel's object id allocators
Instead of having an ID allocator per object class use one global allocator for
all. Thereby artificial limitations for the different object types are
superfluent. Moreover, replace the base-hw specific id allocator implementation
with the generic Bit_allocator, which is also memory saving.

Ref #1443
2015-04-17 16:13:20 +02:00
Stefan Kalkowski 2df86cd34b hw: rename bin_* syscalls with delete_*
The verb "bin" in the context of destroying kernel objects seems pretty
unusual in contrast to "delete". When reading "bin" in the context of
systems software an association to something like "binary" is more likely.

Ref #1443
2015-04-17 16:13:20 +02:00
Stefan Kalkowski b949489641 base: remove local capability from generic base
* Instead of using local capabilities within core's context area implementation
  for stack allocation/attachment, simply do both operations while stack gets
  attached, thereby getting rid of the local capabilities in generic code
* In base-hw the UTCB of core's main thread gets mapped directly instead of
  constructing a dataspace component out of it and hand over its local
  capability
* Remove local capability implementation from all platforms except Linux

Ref #1443
2015-04-17 16:13:20 +02:00
Stefan Kalkowski a168c9d6ce core: remove global capability id counter
The global capability ID counter is not used by NOVA and Fiasco.OC
and in the future not needed by base-hw too. Thereby, remove the static
counter variable from the generic code base and add it where appropriated.

Ref #1443
2015-04-17 16:13:19 +02:00
Stefan Kalkowski 358380046c base: assign allocator and quota to platform pd
Enable platform specific allocations and ram quota accounting for
protection domains. Needed to allocate object identity references
in the base-hw kernel when delegating capabilities via IPC.
Moreover, it can be used to account translation table entries in the
future.

Ref #1443
2015-04-17 16:13:19 +02:00
Norman Feske d9d65aa86b base: use reference for ascii_to output argument
Issue #1477
2015-04-17 16:13:19 +02:00
Norman Feske d884cf1a9a base: unify ascii_to conversion functions
This patch addresses the first point of the issue #1477, namely
replacing the function-template magic by plain function overloads.

Issue #1477
2015-04-13 14:18:16 +02:00
Christian Prochaska 63ebebcfa4 nitpicker: update the 'pointed session' more often
Currently, the 'pointed session' gets updated only when an input event
occurs, but an update is also needed in other situations, for example
when the view under the current mouse position was moved.

With this commit, the 'pointed session' gets updated whenever the
timer-triggered 'handle_input()' function is called.

Fixes #1473
2015-04-13 14:18:15 +02:00
Christian Prochaska 0fd53c7fe4 Extract numeric string arguments with the correct signedness
There are lots of places where a numeric argument of an argument string
gets extraced as signed long value and then assigned to an unsigned long
variable. If the value in the string was negative, it would not be
detected as invalid (and replaced by the default value), but become a
positive bogus value.

With this patch, numeric values which are supposed to be unsigned get
extracted with the 'ulong_value()' function, which returns the default
value for negative numbers.

Fixes #1472
2015-04-13 14:18:15 +02:00
Christian Prochaska af2cd7175c vbox: enable video acceleration (VBVA)
This commit enables the VirtualBox graphics adapter, provides guest mouse
pointer integration with Nitpicker using the 'vbox_pointer' application
and enhances the VirtualBox run scripts with the configuration of
Nitpicker, input merger and network driver.

Fixes #1474
2015-04-13 14:18:15 +02:00
Christian Helmuth 0fb5ce0918 base: run mp_server on hw_x86_64 as single core 2015-04-09 16:04:47 +02:00
Norman Feske 8fd30b13ac Consider Raspberry Pi in sd_card.run
Issue #1475
2015-04-09 16:04:47 +02:00
Norman Feske 91e0a5d5dd SD-card driver for the Raspberry Pi
The driver operates in PIO mode only. Depending on the block size (512
bytes versus 128 KiB), it has a troughput of 2 MiB/sec - 10 MiB/sec for
reading and 173 KiB/sec - 8 MiB/sec for writing.

Fixes #1475
2015-04-09 16:04:47 +02:00
Norman Feske 87f13d77c0 Omit timer RPC calls for usleep(0) 2015-04-09 16:04:46 +02:00
Norman Feske 77cba65b7a os: detection of standard-capacity SD cards
This patch enhances the generic SD-card protocol implementation in
sd-card.h with the ability to handle the version 1.0 of the CSD register
(containing the capacity information of older SD cards).
2015-04-09 16:04:46 +02:00
Norman Feske 26442f782b os: add 'clock_rate' to Rpi platform driver 2015-04-09 16:04:46 +02:00
Norman Feske ea9c2199e8 base: extend emergency dataspace size
The emergency dataspace is used to accommodate the corner case where
a signal context capability is created while issuing the first
resource request. Normally, the attempt to upgrade the signal-session
quota under such a constrained situation would fail. By freeing the
emergency dataspace in this situation, we regain enough quota to
upgrade the signal session.

This is a follow up commit for "base: Raise RAM quota of signal session
to 16K" and fixes the resource_request test on 64-bit platforms.
2015-04-09 16:04:46 +02:00
Norman Feske eaac3cc1bd Revised API documentation
This patch curates the API documentation to become suitable for the
functional specificaton, which is partially generated from the header
files.
2015-04-09 16:04:46 +02:00
Norman Feske e1b4408090 os: turn Xml_node::Attribute to Xml_attribute
Moving the XML attribute class to the Genode namespace simplifies the
API.
2015-04-09 16:04:45 +02:00
Norman Feske 394fce110e base: coding style 2015-04-09 16:04:45 +02:00
Norman Feske 13a0c336d9 base: separate the API's 'Thread_base' constructor
The 'Thread_base' class is constructed differently in some special cases
like the main thread or a thread that use a distinct CPU session. The
official API, however, should be clean from such artifacts. Hence, I
separated the official constructor from the other cases.
2015-04-09 16:04:45 +02:00
Norman Feske 0d74435448 base: remove Genode::parent_cap from the API
Components interact with their environments using the Genode::Env class
instead of directly using the parent capability.
2015-04-09 16:04:45 +02:00
Norman Feske 695ac957f4 base: add missing override annotations 2015-04-09 16:04:44 +02:00
Norman Feske 6fc372bcf4 base: add const qualifiers 2015-04-09 16:04:44 +02:00
Christian Prochaska 0e344c9830 vbox: support more mouse event combinations
VirtualBox can receive absolute or relative mouse motion events from the
'Input' service and the VM can support either or both of them. With this
patch, more of the possible combinations are handled.

Fixes #1470
2015-04-09 16:04:44 +02:00
Martin Stein 70aa98d837 hw: fix bug in cancellation of 'await_signal'
There were two bugs. First, the caller of Kernel::await_signal wasn't
re-activated for scheduling. Second, the caller did not memorize that he
doesn't wait on a receiver anymore which had bad side effects on further
signal handling.

Fix #1459
2015-04-09 16:04:44 +02:00
Martin Stein 60e392f0c0 hw: support Wandboard Quad (i.MX6)
The port uses the Cortex-A9 private timer for the kernel and an EPIT as
user timer. It was successfully tested on the Wandboard Quad and the CuBox-i
with the signal test. It lacks L2-cache and Trustzone support by now.

Thanks to Praveen Srinivas (IIT Madras, India) and  Nikolay Golikov (Ksys Labs
LLC, Russia). This work is partially based on their contributions.

Fix #1467
2015-04-09 16:04:43 +02:00
Martin Stein 4f887448c3 hw & cortex_a9: clean-up board_support.h
Change class name according to our common naming scheme and remove unnecessary
'using' directive.

Ref #1467
2015-03-27 12:20:07 +01:00
Sebastian Sumpf 1b155dbaa6 libssh: git repo for source retrieval
We now use 'http://git.libssh.org/projects/libssh.git'

Fix #1428
2015-03-27 11:53:35 +01:00
Reto Buerki c82f5e9269 hw_x86_64: Do not mask edge-triggered interrupts
Do not mask edge-triggered interrupts to avoid losing them while masked,
see Intel 82093AA I/O Advanced Programmable Interrupt Controller
(IOAPIC) specification, section 3.4.2, "Interrupt Mask":

"When this bit is 1, the interrupt signal is masked. Edge-sensitive
interrupts signaled on a masked interrupt pin are ignored (i.e., not
delivered or held pending)"

Or to quote Linus Torvalds on the subject:

"Now, edge-triggered interrupts are a _lot_ harder to mask, because the
Intel APIC is an unbelievable piece of sh*t, and has the edge-detect
logic _before_ the mask logic, so if a edge happens _while_ the device
is masked, you'll never ever see the edge ever again (unmasking will not
cause a new edge, so you simply lost the interrupt)."

So when you "mask" an edge-triggered IRQ, you can't really mask it at
all, because if you did that, you'd lose it forever if the IRQ comes in
while you masked it. Instead, we're supposed to leave it active, and set
a flag, and IF the IRQ comes in, we just remember it, and mask it at
that point instead, and then on unmasking, we have to replay it by
sending a self-IPI." [1]

[1] - http://yarchive.net/comp/linux/edge_triggered_interrupts.html

Ref #1448
2015-03-27 11:53:34 +01:00
Martin Stein bfe1fac37c hw_x86_64: style fixes
Ref #1448
2015-03-27 11:53:34 +01:00
Stefan Kalkowski 49bffbfe7e os: enable PIT timer for hw_x86_64 platform 2015-03-27 11:53:34 +01:00
Adrian-Ken Rueegsegger f4cb9101a4 hw: Fix format string for 64 bit platforms
Use the format specifier of the largest possible type and cast the value
to the chosen type. This avoids compiler warnings on x86_64.
2015-03-27 11:53:33 +01:00
Reto Buerki 92efc13a17 hw_x86_64: Add x86-specific IRQ session component
In order to match the I/O APIC configuration, a request for user timer
IRQ 0 is remapped to vector 50 (Board::TIMER_VECTOR_USER), all other
requests are transposed by adding the vector offset 48
(Board::VECTOR_REMAP_BASE).
2015-03-27 11:53:33 +01:00
Adrian-Ken Rueegsegger f9f74d2930 hw_x86_64: Add VESA resources to x86 MMIO regions
The additional MMIO regions are necessary for emulated graphics devices
of QEMU and Bochs.
2015-03-27 11:53:33 +01:00
Adrian-Ken Rueegsegger 8b8e8c8270 hw_x86_64: Add various drivers to x86
Include PCI, PS2, VESA and Framebuffer drivers on x86_64 platform.
2015-03-27 11:53:33 +01:00
Adrian-Ken Rueegsegger e5f26fa8db base: Raise RAM quota of signal session to 16K
On base-hw/x86_64 the quota of the signal session is not sufficient due to
the large size of the Signal_session_component. Increasing the quota to
16K avoids signal-context resource exhaustion messages as emmitted by the
run/launcher scenario:

  ...
  Quota exceeded! amount=4096, size=4096, consumed=4096
  failed to allocate signal-context resources
  upgrading quota donation for signal session
  C++ runtime: Genode::Parent::Quota_exceeded
  void* abort(): abort called
  ...

Note: This change increases the quota for all kernels even though it is
      strictly only required for base-hw/x86_64.
2015-03-27 11:53:33 +01:00
Adrian-Ken Rueegsegger 96a3eabe16 hw_x86_64: Log additional information on unknown exception
Provide more information in the log message when an unknown exception
occurs.
2015-03-27 11:53:32 +01:00
Adrian-Ken Rueegsegger 544148bc24 hw_x86_64: Add I/O port allocator to platform
Add the entire I/O port range to the I/O port allocator on x86. Do nothing
on ARM platforms since there are no I/O port resources.
2015-03-27 11:53:32 +01:00
Reto Buerki 5765398741 hw_x86_64: Add x86 platform services to core
Use the x86-specific platform_services.cc file and register the I/O port
session component.
2015-03-27 11:53:32 +01:00
Reto Buerki 28b5e67a8c Update or add hw_x86_64 copyright headers 2015-03-27 11:53:32 +01:00
Adrian-Ken Rueegsegger ace61c54d6 hw_x86_64: Zero-fill BSS segment in x86_64 crt0.s
Make sure all content of the BSS segment is initialized to zero.
2015-03-27 11:53:32 +01:00
Reto Buerki 69a58c4bd5 hw_x86_64: Set EFLAGS IF, IOPL bits in Cpu::init_thread
Enable interrupts for all threads, set I/O privilege level (IOPL) to 3
for core threads to allow UART access.
2015-03-27 11:53:32 +01:00
Adrian-Ken Rueegsegger 7ce8464b3a hw_x86_64: Enable FPU support
* Enable the use of the FXSAVE and FXRSTOR instructions, see Intel SDM
  Vol. 3C, section 2.5.
* The state of the x87 floating point unit (FPU) is loaded and saved on
  demand.
* Make the cr0 control register accessible in the Cpu class. This is in
  preparation of the upcoming FPU management.
* Access to the FPU is disabled by setting the Task Switch flag in the cr0
  register.
* Access to the FPU is enabled by clearing the Task Switch flag in the cr0
  register.
* Implement FPU initialization
* Add is_fpu_enabled helper function
* Add pointer to CPU lazy state to CPU class
* Init FPU when finishing kernel initialization
* Add function to retry FPU instruction:
    Similar to the ARM mechanism to retry undefined instructions, implement a
    function for retrying an FPU instruction. If a floating-point instruction
    causes an #NM exception due to the FPU being disabled, it can be retried
    after the correct FPU state is restored, saving the current state and
    enabling the FPU in the process.
* Disable FPU when switching to different user context:
    This enables lazy save/restore of the FPU since trying to execute a
    floating point instruction when the FPU is disabled will cause a #NM
    exception.
* Declare constant for #NM exception
* Retry FPU instruction on #NM exception
* Assure alignment of FXSAVE area:
    The FXSAVE area is 512-byte memory region that must be 16-byte aligned. As
    it turns out the alignment attribute is not honored in all cases so add a
    workaround to assure the alignment constraint is met by manually rounding
    the start of the FXSAVE area to the next 16-byte boundary if necessary.
2015-03-27 11:53:31 +01:00
Reto Buerki c14898703d hw_x86_64: Implement Cpu_idle::exception function
Forward external interrupts during the CPU idle thread to the
_interrupt function.
2015-03-27 11:53:31 +01:00
Reto Buerki e443b859e6 base: Add x86 RESET pseudo-exception
Define RESET as exception 0xfe. The reset state is only used initially
in the CPU idle exception function.
2015-03-27 11:53:31 +01:00
Reto Buerki c9c84dd751 base: Move Cpu_exception enum to x86_64 cpu_state.h 2015-03-27 11:53:31 +01:00
Reto Buerki 4e259f7b1e hw_x86_64: Implement LAPIC-based kernel timer
The LAPIC timer is programmed in one-shot mode with vector 32
(Board::TIMER_VECTOR_KERNEL). The timer frequency is measured using PIT
channel 2 as reference (50ms delay).

Disable PIT timer channel 0 since BIOS programs it to fire periodically.
This avoids potential spurious timer interrupts.
2015-03-27 11:53:31 +01:00
Reto Buerki a21959fc26 hw_x86_64: Implement APIC-based PIC driver
The implementation initializes the Local APIC (LAPIC) of CPU 0 in xapic
mode (mmio register access) and uses the I/O APIC to remap, mask and
unmask hardware IRQs. The remapping offset of IRQs is 48.

Also initialize the legacy PIC and mask all interrupts in order to
disable it.

For more information about LAPIC and I/O APIC see Intel SDM Vol. 3A,
chapter 10 and the Intel 82093AA I/O Advanced Programmable Interrupt
Controller (IOAPIC) specification

Set bit 9 in the RFLAGS register of user CPU context to enable
interrupts on kernel- to usermode switch.
2015-03-27 11:53:31 +01:00
Reto Buerki 557c96a9cb hw_x86_64: Add APIC MMIO to native regions 2015-03-27 11:53:30 +01:00
Reto Buerki cf100f96af hw_x86_64: Add x86-specific board.h file
The file specifies constants for the LAPIC, I/O APIC MMIO regions plus
the interrupt remapping offset and timer vectors.
2015-03-27 11:53:30 +01:00
Adrian-Ken Rueegsegger 42987a7b2f hw_x86_64: Add mapping for I/O APIC MMIO to initial pt
Make the I/O APIC accessible via its MMIO region by adding a 2 MB large
page mapping at 0xfec00000 with memory type UC.
2015-03-27 11:53:30 +01:00
Adrian-Ken Rueegsegger c06c21e472 hw_x86_64: Add mapping for APIC MMIO to initial pt
Make the local APIC accessible via its MMIO region by adding a 2 MB
large page mapping at 0xfee00000 with memory type UC.

Note: The mapping is added to the initial page tables to make the APIC
      usable prior to the activation of core's page tables, e.g. in the
      constructor of the timer class.
2015-03-27 11:53:30 +01:00
Reto Buerki b75b1902f2 hw_x86_64: Provide inb and outb functions for port I/O
The port_io.h file provides the inb and outb functions to perform port
I/O operations.
2015-03-27 11:53:30 +01:00
Reto Buerki 1b3871a3f0 hw_x86_64: Move exception_entry to 0xffff0000
The location in memory is arbitrary but we use the same address as the
ARM architecture. Adjust references to virtual addresses in the mode
transition pages to cope with 64-bit values.
2015-03-27 11:53:30 +01:00
Reto Buerki 147b1ec2b1 hw_x86_64: Adjust parameter type of Message_tpl::prepare_send
Change the type of the local name parameter from unsigned to unsigned
long. Otherwise only 4 bytes are copied on x86_64, leaving 4 bytes of
garbage.
2015-03-27 11:53:29 +01:00
Reto Buerki 16a51b317a hw_x86_64: Implement Cpu_idle::Cpu_idle function
The function is a copy of the ARM version.
2015-03-27 11:53:29 +01:00
Reto Buerki 2ecdf4f729 hw_x86_64: Forward interrupts to _interrupt function
Extend the Thread::exception function to forward external interrupts to
the _interrupt function for processing.
2015-03-27 11:53:29 +01:00