build: Use -O0 for debug build instead of -Og

One of the reasons for using the debug build is to be able to debug
symbols which can't be read in the release build because they are
optimized out:

 (gdb) p var
   $1 = <optimized out>

Unfortunatelly -Og does not prevent this, only -O0 does.

Signed-off-by: Tomasz Grabiec <tgrabiec@cloudius-systems.com>
Signed-off-by: Avi Kivity <avi@cloudius-systems.com>
libc: add function of pgid for porting CRuby

Signed-off-by: KANATSU Minoru <icc.pot.tyew272@gmail.com>
Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
libc: add getpgrp for porting CRuby

Signed-off-by: KANATSU Minoru <icc.pot.tyew272@gmail.com>
Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
libc: add getppid for porting CRuby

Signed-off-by: KANATSU Minoru <icc.pot.tyew272@gmail.com>
Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
libc: add getpwnam_r to porting CRuby

getpwnam_r and getpwuid_r is almost same function.
So, implement getpw_r for commonly function and
To change the two function to call getpw_r

Signed-off-by: KANATSU Minoru <icc.pot.tyew272@gmail.com>
Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
libc: add setegid for porting CRuby

Signed-off-by: KANATSU Minoru <icc.pot.tyew272@gmail.com>
Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
libc: add seteuid for porting CRuby

Signed-off-by: KANATSU Minoru <icc.pot.tyew272@gmail.com>
Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
libc: add setregid for porting CRuby

Signed-off-by: KANATSU Minoru <icc.pot.tyew272@gmail.com>
Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
libc: add setreuid for porting CRuby

Signed-off-by: KANATSU Minoru <icc.pot.tyew272@gmail.com>
Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
libc: add sid function for porting CRuby

Signed-off-by: KANATSU Minoru <icc.pot.tyew272@gmail.com>
Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
libc: add waitpid for porting CRuby

Signed-off-by: KANATSU Minoru <icc.pot.tyew272@gmail.com>
Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
stub __libc_start_main

We may have to implement it in the future if we support static PIEs, but for
sure not at the moment, where we handle all the initialization ourselves.
Still, objects without lazy linking will abort if the symbol is not present.

Reviewed-by: Nadav Har'El <nyh@cloudius-systems.com>
Signed-off-by: Glauber Costa <glommer@cloudius-systems.com>
Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
dhcp: Fix MTU logging

When OSv started, using dmesg command we will see a message such as:

  Configuring eth0: ip 192.168.122.15 subnet mask 255.255.255.0 gateway 192.168.122.1 MTU 0

We found that the dhcp packet doesn't carry a positive interface MTU. In
order to avoid misunderstanding, change the MTU value of displaying
message to ETHERMTU(1500) when dhcp packet's MTU is zero.

Signed-off-by: wangbicheng <wangbicheng@huawei.com>
Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
linux compat: define macros for syscalls

There is a lot of boilerplate we need to write whenever we want a syscall to be
reachable through the syscall function. This patch reduces that by only having
the implementer to specify the name and its arguments.

We can probably do slightly better than this, but I believe this is simple enough
already.

Signed-off-by: Glauber Costa <glommer@cloudius-systems.com>
Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
libc: add pthread_attr_getguardsize() for porting CRuby

Signed-off-by: KANATSU Minoru <icc.pot.tyew272@gmail.com>
Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
vfs: fix namei() and friends

Add 'const' to function prototype of namei() and friends
to allow passing of a C++ converted string using c_str() which
return a const char*

Signed-off-by: Jaspal Singh Dhillon <jaspal.iiith@gmail.com>
Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
build.mk: aarch64: add --nomount to cmdline

don't try to mount zfs in our first simplified loader image.

Signed-off-by: Claudio Fontana <claudio.fontana@huawei.com>
XXX add tests/tst-hello.so to the bootfs.manifest.skel

could find no way to do it better.

Signed-off-by: Claudio Fontana <claudio.fontana@huawei.com>
aarch64: exceptions: enable PPIs and SPIs separately

enable PPIs in batch on cpu init, but instead enable
single SPIs only later in the boot process when needed.

Signed-off-by: Claudio Fontana <claudio.fontana@huawei.com>
drivers: pl011: implement data input path

allows reading incoming data from the pl011 device.

Signed-off-by: Claudio Fontana <claudio.fontana@huawei.com>