- Oct 24, 2013
-
-
Pekka Enberg authored
Spotted by Clang. Signed-off-by:
Pekka Enberg <penberg@cloudius-systems.com>
-
Pekka Enberg authored
Spotted by Clang. Signed-off-by:
Pekka Enberg <penberg@cloudius-systems.com>
-
Pekka Enberg authored
Spotted by Clang: ../../include/sched.hh:278:12: error: class 'arch_cpu' was previously declared as a struct [-Werror,-Wmismatched-tags] friend class arch_cpu; ^ ../../arch/x64/arch-cpu.hh:39:8: note: previous use is here struct arch_cpu { ^ ../../include/sched.hh:278:12: note: did you mean struct here? friend class arch_cpu; ^~~~~ struct Signed-off-by:
Pekka Enberg <penberg@cloudius-systems.com>
-
Pekka Enberg authored
Spotted by Clang: ../../include/osv/trace.hh:58:1: error: 'assigner_type' defined as a struct template here but previously declared as a class template [-Werror,-Wmismatched-tags] struct assigner_type<storage_args<s_args...>, runtime_args<r_args...>> { ^ ../../include/osv/trace.hh:45:1: note: did you mean struct here? class assigner_type; ^~~~~ struct Signed-off-by:
Pekka Enberg <penberg@cloudius-systems.com>
-
- Oct 23, 2013
-
-
Tomasz Grabiec authored
Signed-off-by:
Tomasz Grabiec <tgrabiec@cloudius-systems.com>
-
Tomasz Grabiec authored
Needed to link with boost_filesystem. Signed-off-by:
Tomasz Grabiec <tgrabiec@cloudius-systems.com>
-
- Oct 22, 2013
-
-
Pekka Enberg authored
Needed to make dump_registers() safe to call from fault handler. Signed-off-by:
Pekka Enberg <penberg@cloudius-systems.com>
-
- Oct 16, 2013
-
-
Avi Kivity authored
Signed-off-by:
Avi Kivity <avi@cloudius-systems.com>
-
Avi Kivity authored
std::streambuf<char> is defined as an "extern template", which means it is instantiated in the library, not at the point-of-use, in order to reduce object size and compilation time. One of its member functions, std::basic_streambuf::seekpos(...) has a parameter whose type depends on mbstate_t; this embeds the type name into the mangled function name. On Linux, mbstate_t is a typedef for __mbstate_t, so the latter type name is embedded into the mangled function name. On osv, there is no such typedef, so mbstate_t is embedded. This causes lookup to fail when loading a shared object that uses streambufs. Fix by defining mbstate_t in the same way as glibc. Signed-off-by:
Avi Kivity <avi@cloudius-systems.com>
-
- Oct 15, 2013
-
-
Avi Kivity authored
Much easier than constructing a traditional argc/argv. Signed-off-by:
Avi Kivity <avi@cloudius-systems.com>
-
Avi Kivity authored
Unlike tls for the main module, which simply offsets fs:0, shared object use an indirection scheme since each module gets its own tls base address, which needs to be found (and initialized) via __get_tls_addr() Implement __get_tls_addr() and the associated relocation and storage management. Signed-off-by:
Avi Kivity <avi@cloudius-systems.com>
-
Avi Kivity authored
Currently we search the entire vma list while looking for a range. This is less than optimal. Define a vma::addr_compare function object that can be used as comparator with boost::rbtree::equal_range(), and use that to search for both bounds simultaneously. Signed-off-by:
Avi Kivity <avi@cloudius-systems.com>
-
- Oct 14, 2013
-
-
Nadav Har'El authored
Add a convenience function, osv::run(), to run an ELF executable. The patch includes extensive Doxygen documentation for the new function, also detailing the how osv::run() differs from the familiar Linux functions like exec(2). Signed-off-by:
Nadav Har'El <nyh@cloudius-systems.com>
-
Pekka Enberg authored
Fix mincore() to follow Linux ABI and return ENOMEM only if (part of the) memory range is unmapped even if it's not resident. This is needed for mincore() to work with demand paged mmaps. Signed-off-by:
Pekka Enberg <penberg@cloudius-systems.com>
-
Nadav Har'El authored
This is patch v2, incorporating most of the comments from the previous round. Solves issue #47: elf::program's API - add_object() and remove_object() was problematic in two respects: 1. It did not do reference-counting on the loaded object, so if add_object() was done 5 times, a single remove_object() would unmap the object and its 4 other users will crash. 2. It is un-C++-like. This patch replaces these two functions by a single function get_library(): std::shared_ptr<elf::object> get_library(std::string lib, std::vector<std::string> extra_path = {}); get_library() returns a shared_ptr, which is reference counting and does proper C++-style RAII. For example in the code: auto lib = elf::get_program()->get_library(path); auto main = lib->lookup<int (int, char**)>("main"); int rc = main(argc, argv); once lib out of scope, the reference count of the elf::object automatically goes down, and if nobody else holds another shared-pointer to the same library, the object is destroyed (causing the shared library to be unloaded). This patch also documents, with Doxygen, all the functions it touches. IMPORTANT NOTE: This reference count is completely unrelated to the issue of concurrent use of dlopen()/dlclose()/dl_iterate_phdr(), which is still buggy and we need to fix (I have a patch for that, but it's too long to fit in the margin). Signed-off-by:
Nadav Har'El <nyh@cloudius-systems.com>
-
- Oct 13, 2013
-
-
Nadav Har'El authored
The new scheduling algorithm is based on floating point runtimes, and I'd like to be able to tracepoints to debug it. Adding floats and doubles is trivial - we just need to tell the C++ tracing code to use the character "f" for floats and "d" for doubles, and Python (run in gdb when we use "osv trace") already knows how to unpack values with these designations. Signed-off-by:
Nadav Har'El <nyh@cloudius-systems.com>
-
Avi Kivity authored
Signed-off-by:
Avi Kivity <avi@cloudius-systems.com>
-
Avi Kivity authored
Needed by libzpool. Signed-off-by:
Avi Kivity <avi@cloudius-systems.com>
-
Avi Kivity authored
Needed by MNTTAB.
-
- Oct 10, 2013
-
-
Avi Kivity authored
Add some required solaris types. Signed-off-by:
Avi Kivity <avi@cloudius-systems.com>
-
Avi Kivity authored
We have _KERNEL defines scattered throughout the code, which makes understanding it difficult. Define it just once, and adjust the source to build. We define it in an overridable variable, so that non-kernel imported code can undo it.
-
Avi Kivity authored
In order to unmount, we need to drop all vnodes on a mount point, so we need to find all directory entries pointing to them. Signed-off-by:
Avi Kivity <avi@cloudius-systems.com>
-
Avi Kivity authored
Signed-off-by:
Avi Kivity <avi@cloudius-systems.com>
-
Avi Kivity authored
Similar to /etc/mnttab, but without going through the file system. Signed-off-by:
Avi Kivity <avi@cloudius-systems.com>
-
Avi Kivity authored
Needed by libzfs. Signed-off-by:
Avi Kivity <avi@cloudius-systems.com>
-
Avi Kivity authored
Make vget() accept a const char*, and adjust various other functions that it calls in the same way. This makes it easier to convert vfs_mount.c to C++. Signed-off-by:
Avi Kivity <avi@cloudius-systems.com>
-
Avi Kivity authored
For zfs. Signed-off-by:
Avi Kivity <avi@cloudius-systems.com>
-
Avi Kivity authored
The vfs converts the read/write flags from 0/1/2 (read-only/write-only/rw) to bit fields which are more easily testable. But in doing so it corrupts the other flags. Fix FFLAGS and OFLAGS to preserve those other flags. The test for a file that is not readable or writable is dropped, since it is impossible to fail. Signed-off-by:
Avi Kivity <avi@cloudius-systems.com>
-
- Oct 09, 2013
-
-
Pekka Enberg authored
Switch to size_t type for ->bio_bcount in struct bio and clean up virtio-blk signedness casts. Signed-off-by:
Pekka Enberg <penberg@cloudius-systems.com>
-
- Oct 08, 2013
-
-
Nadav Har'El authored
We had a different Linux version compiled into uname() (3.7.0) than we had compiled into other code (via <linux/version.h>). This patch makes them both pretend to be 3.7.0 - arbitrarily chosen as the current Linux version at the time OSv was created. The new code verifies with a static assertion that both files contain the same version, so if they diverge, uname.c will fail compilation. Signed-off-by:
Nadav Har'El <nyh@cloudius-systems.com>
-
- Oct 07, 2013
-
-
Nadav Har'El authored
This patch begins to document OSv's native (non-Linux-compatible) C++ APIs using Doxygen. With doxygen, functions, classes, and other APIs are documented using comments inside the source code, similarly to the way Javadoc is used in the Java world. After this patch, running "doxygen" generates the documentation in HTML form (and also ugly ones in LaTeX...) in the "doxyout" directory. After running "doxygen" in the OSv top-level directory, open your browser to file://.../doxyout/html/index.html to view this documentation. This patch adds a doxygen configuration file, "Doxyfile", and documents three functions in the osv namespace: osv::halt(), osv::poweroff(), osv::halt(). The format of the resulting documentation is not perfect, but it's not as bad as I feared, and also the documentation doesn't uglify the code too much (it mainly impacts the header files), so I now believe it will better for us than writing man pages (an avenue which I explored previously). Signed-off-by:
Nadav Har'El <nyh@cloudius-systems.com>
-
- Oct 05, 2013
-
-
Benoît Canet authored
Signed-off-by:
Benoit Canet <benoit@irqsave.net> Signed-off-by:
Avi Kivity <avi@cloudius-systems.com>
-
Benoît Canet authored
boost's asio.hpp module init() function was calling pthread_key_create which tried to manipulate some libc/pthread.cc unitialized objects. pthread_key_create then returned -ENOMEM so an exception was thrown by boost causing the loader's premain() function to fail and the boot to loop. This patch lower the priority of the initialization of the libc/pthread.cc objects so they are ready when premain is calling the boost module init() function. Signed-off-by:
Benoit Canet <benoit@irqsave.net> Signed-off-by:
Avi Kivity <avi@cloudius-systems.com>
-
- Oct 03, 2013
-
-
Benoît Canet authored
This patch uses boost::asio::ip::address* to cleanup the core dhcp code. Signed-off-by:
Benoit Canet <benoit@irqsave.net> Signed-off-by:
Avi Kivity <avi@cloudius-systems.com>
-
Benoît Canet authored
Signed-off-by:
Benoit Canet <benoit@irqsave.net> Signed-off-by:
Avi Kivity <avi@cloudius-systems.com>
-
Avi Kivity authored
bsd's ifconf conflicts with osv's; rename it. We use the bsd version in <osv/ioctl.h>, since we currently don't support the Linux-ABI variants of these ioctls. Signed-off-by:
Avi Kivity <avi@cloudius-systems.com> Tested-By:
Benoit Canet <benoit@irqsave.net>
-
Avi Kivity authored
Workaround a bytorder function conflict, and reconcile a declaration. Signed-off-by:
Avi Kivity <avi@cloudius-systems.com> Tested-By:
Benoit Canet <benoit@irqsave.net>
-
Avi Kivity authored
Some structures are duplicated; move the duplicates to a common header <netinet/__in.h>. Signed-off-by:
Avi Kivity <avi@cloudius-systems.com> Tested-By:
Benoit Canet <benoit@irqsave.net>
-
Avi Kivity authored
Some structures are duplicated; deduplicate them. A few are source-compatible but not binary-compatible; use the ones from <bits/socket.h>. Others are both source- and binary- compatible; put them in a new header <sys/__socket.h> which is included from both. Work around a problem with the byteorder functions/macros. Signed-off-by:
Avi Kivity <avi@cloudius-systems.com> Tested-By:
Benoit Canet <benoit@irqsave.net>
-
- Sep 30, 2013
-
-
Benoît Canet authored
Signed-off-by:
Benoit Canet <benoit@irqsave.net> Signed-off-by:
Avi Kivity <avi@cloudius-systems.com>
-