tests: add auto-load safe-path init command to gdb

Signed-off-by: Elazar Leibovich <elazarl@gmail.com>
math: make math functions generic

We are using now C++ implementation. Since they seem to rely on C++ intrinsics
and not in any OS-provided symbol, I trust AARCH64's C++ compiler will provide us
with something as well. We can then make it generic.

Signed-off-by: Glauber Costa <glommer@cloudius-systems.com>
Tested-by: Claudio Fontana <claudio.fontana@huawei.com>
Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
pthread: implement pthread_exit

iperf client mode call this when connection fails, so this is needed to prevent
abort() on the condition.

Signed-off-by: Takuya ASADA <syuu@cloudius-systems.com>
Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
vfs: fix errno in futimesat()

If dirfd is invalid, fstat returns -1 and sets errno.
Return this errno instead of returning -1 as errno.

Found while writing a test for futimesat.

Signed-off-by: Jaspal Singh Dhillon <jaspal.iiith@gmail.com>
Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
tests: add test for futimesat()

Add tests for futimesat().

Signed-off-by: Jaspal Singh Dhillon <jaspal.iiith@gmail.com>
Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
tests: printf benchmark

Add a printf test for benchmarking serial console performance.

Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
aarch64: update to latest Mach-Virt addresses

until we have the ACPI ported, we have to follow mach-virt.
Its addresses for the GIC have been recently changed.

Signed-off-by: Claudio Fontana <claudio.fontana@huawei.com>
Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
Merge branch 'master' of github.com:elazarl/osv

Github pull request description:

  Running make check from a fresh Ubuntu gave the following error
  message

    TEST tracing_smoke_test

    warning: File "/home/elazar/dev/osv/scripts/loader.py" auto-loading
    has been declined by your `auto-load safe-path' set to
    "$debugdir:$datadir/auto-load".

  Signed-off-by: Elazar Leibovich <elazarl@gmail.com>
drivers: Rename ConsoleDriver to console_driver

We use snake case in OSv code.

Reviewed-by: Glauber Costa <glommer@cloudius-systems.com>
Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
drivers: Rename ConsoleMultiplexer to console_multiplexer

We use snake case in OSv code.

Reviewed-by: Glauber Costa <glommer@cloudius-systems.com>
Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
serial: Fix formatting

Fix mixed spaces and tabs formatting to only use spaces. Makes working
with the code less painful.

Reviewed-by: Glauber Costa <glommer@cloudius-systems.com>
Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
serial: Eliminate temporary variable

The 'lcr' class member variable is used as a temporary variable to hold
a constant value. Inline it...

Reviewed-by: Glauber Costa <glommer@cloudius-systems.com>
Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
serial: Drop unused <string.h> include

Reviewed-by: Glauber Costa <glommer@cloudius-systems.com>
Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
serial: Move register definitions to source file

Move register definitions to isa-serial.cc where they are used. This
makes looking up register values easier because you don't need to jump
between two files.

Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
serial: Split register definitions

Split register definitions in per-register enumerations.

Reviewed-by: Glauber Costa <glommer@cloudius-systems.com>
Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
serial: Rename writeByte to putchar

Fix camel case and rename 'letter' argument to more appropriate 'ch'.

Reviewed-by: Glauber Costa <glommer@cloudius-systems.com>
Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
drivers: Rename IsaSerialConsole to isa_serial_console

Switch to snake case.

Reviewed-by: Glauber Costa <glommer@cloudius-systems.com>
Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
scripts: Zero download GCE support

Generate a url file for GCE image type.

For example,

$ ls build/capstan/cloudius/osv-iperf
1) index.yaml
2) osv-iperf.gce.gz
3) osv-iperf.qemu.gz
4) osv-iperf.vbox.gz
5) osv-iperf.vmw.gz
6) osv-iperf.gce.tar.gz

Files 1) to 5) will be copied to s3 repo. File 6) will be uploaded to
Google Compute Engine.

$ zcat build/capstan/cloudius/osv-iperf/osv-iperf.gce.gz
gs://osv/v0.09-10-g140ac67/osv-iperf.gce.tar.gz

With this, the following cmd will create a GCE instance directly from
the gs://... url.

$ capstan run -p gce cloudius/osv-iperf

Signed-off-by: Asias He <asias@cloudius-systems.com>
Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
gdb: implement __bool__ which is required by python3

What was __nonzero__ on python2 is now __bool__ on python3. This
change fixes an issue with "osv info threads" which printed a line
starting with "timers:" even if there were no timers.

Reviewed-by: Nadav Har'El <nyh@cloudius-systems.com>
Signed-off-by: Tomasz Grabiec <tgrabiec@cloudius-systems.com>
Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
mmu: fix name of the function that reads pte in virt_to_pte_rcu

The name is incorrect, so default function is used instead.

Signed-off-by: Gleb Natapov <gleb@cloudius-systems.com>
Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>