diff --git a/.gitignore b/.gitignore index 07a379145f..a69a2455bf 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,4 @@ -* !/**/ -!*.* *~ *.a *.o @@ -41,9 +39,6 @@ CMakeFiles* CMakeCache* cmake_install.cmake -# Name of installation folder -IncludeOS_install - # Vim *.swp diff --git a/CMakeLists.txt b/CMakeLists.txt index 3f9fdf03e9..c82d31ac1b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -6,6 +6,7 @@ set(CMAKE_TRY_COMPILE_TARGET_TYPE STATIC_LIBRARY) project (includeos C CXX) option(SMP "Compile with SMP (multiprocessing)" OFF) +option(PROFILE "Compile with startup profilers" OFF) #Are we executing cmake from conan or locally #if locally then pull the deps from conanfile.py diff --git a/NOTICE b/NOTICE deleted file mode 100644 index 3946739da5..0000000000 --- a/NOTICE +++ /dev/null @@ -1,8 +0,0 @@ -IncludeOS - A Resource Efficient Unikernel for Cloud Services - -Copyright 2015 Oslo and Akershus University College of Applied Sciences -and Alfred Bratterud - -This product includes software developed at -IncludeOS (http://www.includeos.org/). - diff --git a/README.md b/README.md index fe9e04be70..b743129a90 100755 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ ![IncludeOS Logo](./etc/logo.png) ================================================ -**IncludeOS** is an includable, minimal [unikernel](https://en.wikipedia.org/wiki/Unikernel) operating system for C++ services running in the cloud and on real HW. Starting a program with `#include ` will literally include a tiny operating system into your service during link-time. +**IncludeOS** is a minimal [unikernel](https://en.wikipedia.org/wiki/Unikernel) operating system for C++ services running in the cloud and on real hardware. Starting a program with `#include ` will include a tiny operating system into your service during link-time. IncludeOS is free software, with "no warranties or restrictions of any kind". @@ -14,14 +14,13 @@ IncludeOS is free software, with "no warranties or restrictions of any kind". ## Key features -* **Extreme memory footprint**: A minimal bootable 64-bit web server, including operating system components and anything needed from the C/C++ standard libraries is currently 2.5 MB. +* **Extreme memory footprint**: A tiny bootable C++17 hello world is currently 900 KB and needs only 5 MB RAM on x86_64. * **KVM, VirtualBox and VMWare support** with full virtualization, using [x86 hardware virtualization](https://en.wikipedia.org/wiki/X86_virtualization), available on most modern x86 CPUs. IncludeOS will run on any x86 hardware platform, even on a physical x86 computer, given appropriate drivers. Officially, we develop for- and test on [Linux KVM](http://www.linux-kvm.org/page/Main_Page), and VMWare [ESXi](https://www.vmware.com/products/esxi-and-esx.html)/[Fusion](https://www.vmware.com/products/fusion.html) which means that you can run your IncludeOS service on Linux, Microsoft Windows and macOS, as well as on cloud providers such as [Google Compute Engine](http://www.includeos.org/blog/2017/includeos-on-google-compute-engine.html), [OpenStack](https://www.openstack.org/) and VMWare [vcloud](https://www.vmware.com/products/vcloud-suite.html). * **Instant boot:** IncludeOS on Qemu/kvm boots in about 300ms but IBM Research has also integrated IncludeOS with [Solo5/uKVM](https://github.com/Solo5/solo5), providing boot times as low as 10 milliseconds. * **Modern C++ support** - * Full C++11/14/17 language support with [clang](http://clang.llvm.org) 5 and later. + * Full C++11/14/17 language support with [clang](http://clang.llvm.org) 6 and later. * Standard C++ library (STL) [libc++](http://libcxx.llvm.org) from [LLVM](http://llvm.org/). * Exceptions and stack unwinding (currently using [libgcc](https://gcc.gnu.org/onlinedocs/gccint/Libgcc.html)). - * *Note:* Certain language features, such as threads and filestreams are currently missing backend support but is beeing worked on. * **Standard C library** using [musl libc](http://www.musl-libc.org/). * **Virtio and vmxnet3 Network drivers** with DMA. [Virtio](https://www.oasis-open.org/committees/tc_home.php?wg_abbrev=virtio) provides a highly efficient and widely supported I/O virtualization. vmxnet3 is the VMWare equivalent. * **A highly modular TCP/IP-stack**. @@ -61,7 +60,7 @@ The following command will configure conan to use our build profiles and remote $ conan config install https://github.com/includeos/conan_config.git ``` -**Note:** If you prefer to set up conan manually the full configuration can be found in the [conan_config](https://github.com/includeos/conan_config.git) repository. You can browse our prebuilt conan packages in [bintray.com/includeos](https://bintray.com/includeos). +**Note:** If you prefer to set up conan manually the full configuration can be found in the [conan_config](https://github.com/includeos/conan_config.git) repository. You can browse our prebuilt conan packages in [bintray.com/includeos](https://bintray.com/includeos). diff --git a/api/arch.hpp b/api/arch.hpp index c5b72b49e1..f683a94056 100644 --- a/api/arch.hpp +++ b/api/arch.hpp @@ -1,20 +1,4 @@ // -*-C++-*- -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2017 Oslo and Akershus University College of Applied Sciences -// and Alfred Bratterud -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. #pragma once #ifndef INCLUDEOS_ARCH_HEADER diff --git a/api/arch/aarch64.hpp b/api/arch/aarch64.hpp index b7553a3143..49a331623b 100644 --- a/api/arch/aarch64.hpp +++ b/api/arch/aarch64.hpp @@ -1,20 +1,4 @@ // -*-C++-*- -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2017 Oslo and Akershus University College of Applied Sciences -// and Alfred Bratterud -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. #ifndef AARCH64_ARCH_HPP #define AARCH64_ARCH_HPP diff --git a/api/arch/i686.hpp b/api/arch/i686.hpp index 58043b9aee..d0ee27f11c 100644 --- a/api/arch/i686.hpp +++ b/api/arch/i686.hpp @@ -1,20 +1,4 @@ // -*-C++-*- -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2017 Oslo and Akershus University College of Applied Sciences -// and Alfred Bratterud -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. #ifndef i686_ARCH_HPP #define i686_ARCH_HPP diff --git a/api/arch/x86/cpu.hpp b/api/arch/x86/cpu.hpp index 53f53d494b..1471c09d2d 100644 --- a/api/arch/x86/cpu.hpp +++ b/api/arch/x86/cpu.hpp @@ -1,19 +1,3 @@ -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2015 Oslo and Akershus University College of Applied Sciences -// and Alfred Bratterud -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. #pragma once #ifndef X86_CPU_HPP diff --git a/api/arch/x86/gdt.hpp b/api/arch/x86/gdt.hpp index 56d15d1662..a48a90a763 100644 --- a/api/arch/x86/gdt.hpp +++ b/api/arch/x86/gdt.hpp @@ -1,19 +1,3 @@ -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2015 Oslo and Akershus University College of Applied Sciences -// and Alfred Bratterud -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. #pragma once #ifndef X86_GDT_HPP diff --git a/api/arch/x86/paging.hpp b/api/arch/x86/paging.hpp index ef001a311e..0d5aa549d4 100644 --- a/api/arch/x86/paging.hpp +++ b/api/arch/x86/paging.hpp @@ -1,19 +1,4 @@ // -*-C++-*- -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2017 IncludeOS AS, Oslo, Norway -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. #ifndef X86_PAGING_HPP #define X86_PAGING_HPP @@ -823,18 +808,14 @@ class Page_table { }; -// // Page table types for 4-level x86 paging -// using Pml1 = Page_table<4_KiB, void, x86_64, Flags::all & ~(Flags::huge | Flags::pdir)>; using Pml2 = Page_table; using Pml3 = Page_table; using Pml4 = Page_table; -// // Specializations for lowest level 4k page tables (e.g. leaf nodes) -// template <> inline bool Pml1::is_page_dir(uintptr_t) noexcept diff --git a/api/arch/x86/paging_utils.hpp b/api/arch/x86/paging_utils.hpp index c9e683b78a..2fbdc78207 100644 --- a/api/arch/x86/paging_utils.hpp +++ b/api/arch/x86/paging_utils.hpp @@ -1,20 +1,4 @@ // -*-C++-*- -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2017 Oslo and Akershus University College of Applied Sciences -// and Alfred Bratterud -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. #ifndef X86_PAGING_UTILS #define X86_PAGING_UTILS diff --git a/api/arch/x86_64.hpp b/api/arch/x86_64.hpp index 14ba3f5778..0c2e82d605 100644 --- a/api/arch/x86_64.hpp +++ b/api/arch/x86_64.hpp @@ -1,20 +1,4 @@ // -*-C++-*- -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2017 Oslo and Akershus University College of Applied Sciences -// and Alfred Bratterud -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. #ifndef X86_64_ARCH_HPP #define X86_64_ARCH_HPP diff --git a/api/common b/api/common index 0bc86a5e11..e5183bdb2f 100644 --- a/api/common +++ b/api/common @@ -1,20 +1,4 @@ // -*- C++ -*- -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2015 Oslo and Akershus University College of Applied Sciences -// and Alfred Bratterud -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. #pragma once #ifndef INCLUDEOS_COMMON_HEADER @@ -52,23 +36,7 @@ static_assert(sizeof(void*) == 8, "Pointer must match arch"); #undef Expects #undef Ensures - -#ifdef INCLUDEOS_SMP_ENABLE -#include -#endif - -#include -inline void __expect_fail(const char *expr, const char *file, int line, const char *func){ -#ifdef INCLUDEOS_SMP_ENABLE - SMP::global_lock(); -#endif - fprintf(stderr, "%s:%i:%s %s \n",file, line, func, expr); - fflush(NULL); -#ifdef INCLUDEOS_SMP_ENABLE - SMP::global_unlock(); -#endif - os::panic(expr); -} +extern void __expect_fail(const char*, const char*, int line, const char*); #define Expects(x) ((void)((x) || (__expect_fail("Expects failed: "#x, __FILE__, __LINE__, __func__),0))) #define Ensures(x) ((void)((x) || (__expect_fail("Ensures failed: "#x, __FILE__, __LINE__, __func__),0))) diff --git a/api/debug b/api/debug index 32940bdf33..2321bc5491 100644 --- a/api/debug +++ b/api/debug @@ -1,20 +1,4 @@ // -*-C++-*- -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2015 Oslo and Akershus University College of Applied Sciences -// and Alfred Bratterud -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. #pragma once #ifndef API_DEBUG_HEADER diff --git a/api/delegate b/api/delegate index 69669bcb7b..5d6d8cb736 100644 --- a/api/delegate +++ b/api/delegate @@ -1,20 +1,6 @@ // -*-C++-*- -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2015 Oslo and Akershus University College of Applied Sciences -// and Alfred Bratterud -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at // -// http://www.apache.org/licenses/LICENSE-2.0 // -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. #pragma once #ifndef API_DELEGATE_HEADER diff --git a/api/detail/os.hpp b/api/detail/os.hpp index ed8ca8d3cd..8103fc9fad 100644 --- a/api/detail/os.hpp +++ b/api/detail/os.hpp @@ -1,5 +1,3 @@ - -#include #include #include @@ -9,5 +7,5 @@ inline uint64_t os::cycles_since_boot() noexcept } inline uint64_t os::nanos_since_boot() noexcept { - return (cycles_since_boot() * 1e6) / os::cpu_freq().count(); + return cycles_since_boot() / util::GHz(os::cpu_freq()).count(); } diff --git a/api/fiber b/api/fiber index ebefa192ff..b3abb1610f 100644 --- a/api/fiber +++ b/api/fiber @@ -1,20 +1,4 @@ // -*- C++ -*- -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2017 Oslo and Akershus University College of Applied Sciences -// and Alfred Bratterud -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. #ifndef __API_FIBER__ #define __API_FIBER__ diff --git a/api/fs/common.hpp b/api/fs/common.hpp index a6c8cd4616..0d696ddf15 100644 --- a/api/fs/common.hpp +++ b/api/fs/common.hpp @@ -1,19 +1,3 @@ -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2015 Oslo and Akershus University College of Applied Sciences -// and Alfred Bratterud -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. #pragma once #ifndef FS_COMMON_HPP diff --git a/api/fs/dirent.hpp b/api/fs/dirent.hpp index d633890fab..b1ed8e728e 100644 --- a/api/fs/dirent.hpp +++ b/api/fs/dirent.hpp @@ -1,19 +1,3 @@ -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2015-2016 Oslo and Akershus University College of Applied Sciences -// and Alfred Bratterud -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. #pragma once #ifndef FS_DIRENT_HPP diff --git a/api/fs/disk.hpp b/api/fs/disk.hpp index 71fa5ea110..4ae058e78b 100644 --- a/api/fs/disk.hpp +++ b/api/fs/disk.hpp @@ -1,19 +1,3 @@ -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2015 Oslo and Akershus University College of Applied Sciences -// and Alfred Bratterud -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. #pragma once #ifndef FS_DISK_HPP diff --git a/api/fs/fat.hpp b/api/fs/fat.hpp index 08b89b8c01..45ade8e8da 100644 --- a/api/fs/fat.hpp +++ b/api/fs/fat.hpp @@ -1,19 +1,3 @@ -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2015 Oslo and Akershus University College of Applied Sciences -// and Alfred Bratterud -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. #pragma once #ifndef FS_FAT_HPP diff --git a/api/fs/fat_internal.hpp b/api/fs/fat_internal.hpp index 8633611010..67e10efa92 100644 --- a/api/fs/fat_internal.hpp +++ b/api/fs/fat_internal.hpp @@ -1,19 +1,3 @@ -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2015 Oslo and Akershus University College of Applied Sciences -// and Alfred Bratterud -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. #pragma once #ifndef FS_FAT_INTERNAL_HPP diff --git a/api/fs/fd_compatible.hpp b/api/fs/fd_compatible.hpp index 248c591b95..5d76338c6e 100644 --- a/api/fs/fd_compatible.hpp +++ b/api/fs/fd_compatible.hpp @@ -1,19 +1,3 @@ -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2018 Oslo and Akershus University College of Applied Sciences -// and Alfred Bratterud -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. #pragma once #ifndef INCLUDE_FD_COMPATIBLE_HPP diff --git a/api/fs/filesystem.hpp b/api/fs/filesystem.hpp index 24ea4ac46b..ffb0ddca82 100644 --- a/api/fs/filesystem.hpp +++ b/api/fs/filesystem.hpp @@ -1,19 +1,3 @@ -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2015 Oslo and Akershus University College of Applied Sciences -// and Alfred Bratterud -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. #ifndef FS_FILESYSTEM_HPP #define FS_FILESYSTEM_HPP diff --git a/api/fs/mbr.hpp b/api/fs/mbr.hpp index 9f860ffd7d..fd037d264b 100644 --- a/api/fs/mbr.hpp +++ b/api/fs/mbr.hpp @@ -1,19 +1,5 @@ -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2015 Oslo and Akershus University College of Applied Sciences -// and Alfred Bratterud -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at // -// http://www.apache.org/licenses/LICENSE-2.0 // -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. #pragma once #ifndef FS_MBR_HPP diff --git a/api/fs/memdisk.hpp b/api/fs/memdisk.hpp index bba3b46ee9..31be90121b 100644 --- a/api/fs/memdisk.hpp +++ b/api/fs/memdisk.hpp @@ -1,19 +1,3 @@ -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2015 Oslo and Akershus University College of Applied Sciences -// and Alfred Bratterud -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. #pragma once #ifndef FS_MEMDISK_HPP diff --git a/api/fs/partition.hpp b/api/fs/partition.hpp index 3f2dcff692..8ebd511e9c 100644 --- a/api/fs/partition.hpp +++ b/api/fs/partition.hpp @@ -1,19 +1,3 @@ -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2015 Oslo and Akershus University College of Applied Sciences -// and Alfred Bratterud -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. #pragma once #ifndef FS_PARTITION_HPP diff --git a/api/fs/path.hpp b/api/fs/path.hpp index 3088efc545..2289b400b0 100644 --- a/api/fs/path.hpp +++ b/api/fs/path.hpp @@ -1,19 +1,3 @@ -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2015 Oslo and Akershus University College of Applied Sciences -// and Alfred Bratterud -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. #pragma once #ifndef FS_PATH_HPP diff --git a/api/fs/vfs.hpp b/api/fs/vfs.hpp index f9cefb9479..63375560bf 100644 --- a/api/fs/vfs.hpp +++ b/api/fs/vfs.hpp @@ -1,19 +1,3 @@ -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2015 Oslo and Akershus University College of Applied Sciences -// and Alfred Bratterud -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. #ifndef FS_VFS_HPP #define FS_VFS_HPP diff --git a/api/fuzz/fuzzy_http.hpp b/api/fuzz/fuzzy_http.hpp index e668bde29b..4b63023065 100644 --- a/api/fuzz/fuzzy_http.hpp +++ b/api/fuzz/fuzzy_http.hpp @@ -1,20 +1,4 @@ #pragma once -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2016-2017 Oslo and Akershus University College of Applied Sciences -// and Alfred Bratterud -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. #pragma once #ifndef FUZZY_HTTP_SERVER_HPP diff --git a/api/fuzz/fuzzy_stream.hpp b/api/fuzz/fuzzy_stream.hpp index 82983cc0e9..8138a6e529 100644 --- a/api/fuzz/fuzzy_stream.hpp +++ b/api/fuzz/fuzzy_stream.hpp @@ -1,19 +1,3 @@ -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2016-2017 Oslo and Akershus University College of Applied Sciences -// and Alfred Bratterud -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. #pragma once #include diff --git a/api/hal/detail/machine.hpp b/api/hal/detail/machine.hpp index ffa20ea8f5..b88fb58d41 100644 --- a/api/hal/detail/machine.hpp +++ b/api/hal/detail/machine.hpp @@ -1,18 +1,3 @@ -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2018 IncludeOS AS, Oslo, Norway -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. #ifndef OS_DETAIL_MACHINE_HPP #define OS_DETAIL_MACHINE_HPP diff --git a/api/hal/machine.hpp b/api/hal/machine.hpp index 3f9a920991..e8ca4c2f06 100644 --- a/api/hal/machine.hpp +++ b/api/hal/machine.hpp @@ -1,18 +1,3 @@ -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2018 IncludeOS AS, Oslo, Norway -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. #ifndef OS_MACHINE_HPP #define OS_MACHINE_HPP diff --git a/api/hal/machine_memory.hpp b/api/hal/machine_memory.hpp index 951b9567d5..d2070fd719 100644 --- a/api/hal/machine_memory.hpp +++ b/api/hal/machine_memory.hpp @@ -1,18 +1,3 @@ -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2018 IncludeOS AS, Oslo, Norway -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. #include #include diff --git a/api/http b/api/http index 8e10ffb0df..71fa69b6ba 100644 --- a/api/http +++ b/api/http @@ -1,20 +1,4 @@ // -*- C++ -*- -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2015-2016 Oslo and Akershus University College of Applied Sciences -// and Alfred Bratterud -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. #pragma once #ifndef INCLUDEOS_HTTP_API_HPP diff --git a/api/https b/api/https index de066c0af9..a48c537ef2 100644 --- a/api/https +++ b/api/https @@ -1,20 +1,4 @@ // -*- C++ -*- -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2015-2016 Oslo and Akershus University College of Applied Sciences -// and Alfred Bratterud -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. #pragma once #ifndef API_HTTPS_HEADER diff --git a/api/hw/async_device.hpp b/api/hw/async_device.hpp index 7a016edfeb..be02459832 100644 --- a/api/hw/async_device.hpp +++ b/api/hw/async_device.hpp @@ -1,19 +1,3 @@ -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2015 Oslo and Akershus University College of Applied Sciences -// and Alfred Bratterud -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. #pragma once #include diff --git a/api/hw/block_device.hpp b/api/hw/block_device.hpp index ce0bab6052..30560a28ed 100644 --- a/api/hw/block_device.hpp +++ b/api/hw/block_device.hpp @@ -1,19 +1,3 @@ -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2015-2017 Oslo and Akershus University College of Applied Sciences -// and Alfred Bratterud -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. #pragma once #ifndef HW_BLOCK_DEVICE_HPP diff --git a/api/hw/cpu.hpp b/api/hw/cpu.hpp index e50b5c06e5..df8b952d95 100644 --- a/api/hw/cpu.hpp +++ b/api/hw/cpu.hpp @@ -1,18 +1,3 @@ -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2018 IncludeOS AS, Oslo, Norway -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. #ifndef OS_HW_CPU #define OS_HW_CPU diff --git a/api/hw/device.hpp b/api/hw/device.hpp index cae671bce0..8bf30ce527 100644 --- a/api/hw/device.hpp +++ b/api/hw/device.hpp @@ -1,21 +1,4 @@ -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2019 IncludeOS AS, Oslo, Norway -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - #pragma once - #include namespace hw { diff --git a/api/hw/ioport.hpp b/api/hw/ioport.hpp index 7cc09eb7c4..4ff5f8e500 100644 --- a/api/hw/ioport.hpp +++ b/api/hw/ioport.hpp @@ -1,19 +1,3 @@ -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2015 Oslo and Akershus University College of Applied Sciences -// and Alfred Bratterud -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. #ifndef HW_IOPORT_HPP #define HW_IOPORT_HPP diff --git a/api/hw/mac_addr.hpp b/api/hw/mac_addr.hpp index 160f2cc8cb..c3c1c69c34 100644 --- a/api/hw/mac_addr.hpp +++ b/api/hw/mac_addr.hpp @@ -1,19 +1,3 @@ -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2015-2017 Oslo and Akershus University College of Applied Sciences -// and Alfred Bratterud -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. #pragma once #ifndef HW_MAC_ADDR_HPP diff --git a/api/hw/msi.hpp b/api/hw/msi.hpp index 884e6d688a..f0a403d91b 100644 --- a/api/hw/msi.hpp +++ b/api/hw/msi.hpp @@ -1,19 +1,3 @@ -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2015 Oslo and Akershus University College of Applied Sciences -// and Alfred Bratterud -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. #pragma once #ifndef HW_MSI_HPP diff --git a/api/hw/nic.hpp b/api/hw/nic.hpp index ae8196c381..812718f004 100644 --- a/api/hw/nic.hpp +++ b/api/hw/nic.hpp @@ -1,19 +1,3 @@ -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2015 Oslo and Akershus University College of Applied Sciences -// and Alfred Bratterud -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. #ifndef HW_NIC_HPP #define HW_NIC_HPP diff --git a/api/hw/pci.hpp b/api/hw/pci.hpp index c90716f1fa..86ad4aa91a 100644 --- a/api/hw/pci.hpp +++ b/api/hw/pci.hpp @@ -1,19 +1,3 @@ -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2015 Oslo and Akershus University College of Applied Sciences -// and Alfred Bratterud -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. #pragma once #ifndef HW_PCI_HPP diff --git a/api/hw/pci_device.hpp b/api/hw/pci_device.hpp index 33820f60c7..83a893e7d2 100644 --- a/api/hw/pci_device.hpp +++ b/api/hw/pci_device.hpp @@ -1,19 +1,3 @@ -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2015 Oslo and Akershus University College of Applied Sciences -// and Alfred Bratterud -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. #ifndef HW_PCI_DEVICE_HPP #define HW_PCI_DEVICE_HPP diff --git a/api/hw/pci_manager.hpp b/api/hw/pci_manager.hpp index 74238799e2..a63af59aab 100644 --- a/api/hw/pci_manager.hpp +++ b/api/hw/pci_manager.hpp @@ -1,19 +1,3 @@ -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2015 Oslo and Akershus University College of Applied Sciences -// and Alfred Bratterud -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. #ifndef KERNEL_PCI_MANAGER_HPP #define KERNEL_PCI_MANAGER_HPP diff --git a/api/hw/ps2.hpp b/api/hw/ps2.hpp index 2383f36ddc..43f4e74d73 100644 --- a/api/hw/ps2.hpp +++ b/api/hw/ps2.hpp @@ -1,19 +1,3 @@ -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2015 Oslo and Akershus University College of Applied Sciences -// and Alfred Bratterud -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. #pragma once #ifndef HW_PS2_HPP diff --git a/api/hw/serial.hpp b/api/hw/serial.hpp index f9abaf5c81..2a3512cc2d 100644 --- a/api/hw/serial.hpp +++ b/api/hw/serial.hpp @@ -1,19 +1,3 @@ -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2015 Oslo and Akershus University College of Applied Sciences -// and Alfred Bratterud -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. #ifndef HW_SERIAL_HPP #define HW_SERIAL_HPP diff --git a/api/hw/usernet.hpp b/api/hw/usernet.hpp index c4c60e2ea7..5fbf6ef2d8 100644 --- a/api/hw/usernet.hpp +++ b/api/hw/usernet.hpp @@ -1,19 +1,3 @@ -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2015 Oslo and Akershus University College of Applied Sciences -// and Alfred Bratterud -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. #pragma once diff --git a/api/hw/writable_blkdev.hpp b/api/hw/writable_blkdev.hpp index 01c094a865..08bbbdf910 100644 --- a/api/hw/writable_blkdev.hpp +++ b/api/hw/writable_blkdev.hpp @@ -1,19 +1,3 @@ -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2015-2017 Oslo and Akershus University College of Applied Sciences -// and Alfred Bratterud -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. #pragma once #ifndef HW_WRITABLE_BLOCK_DEVICE_HPP diff --git a/api/info b/api/info index bf31157a19..d1dab3f62b 100644 --- a/api/info +++ b/api/info @@ -1,20 +1,4 @@ // -*-C++-*- -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2015 Oslo and Akershus University College of Applied Sciences -// and Alfred Bratterud -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. #ifndef API_INFO_HEADER #define API_INFO_HEADER diff --git a/api/isotime b/api/isotime index 0007217189..09fbc11b4e 100644 --- a/api/isotime +++ b/api/isotime @@ -1,20 +1,4 @@ // -*-C++-*- -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2017 Oslo and Akershus University College of Applied Sciences -// and Alfred Bratterud -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. #pragma once #ifndef API_ISOTIME_HEADER diff --git a/api/kernel/botan_rng.hpp b/api/kernel/botan_rng.hpp index 42dce9cc2d..303dc29384 100644 --- a/api/kernel/botan_rng.hpp +++ b/api/kernel/botan_rng.hpp @@ -1,19 +1,3 @@ -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2015-2017 Oslo and Akershus University College of Applied Sciences -// and Alfred Bratterud -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. #pragma once #ifndef KERNEL_BOTAN_RNG_HPP diff --git a/api/kernel/context.hpp b/api/kernel/context.hpp index 19b286771c..1d98244098 100644 --- a/api/kernel/context.hpp +++ b/api/kernel/context.hpp @@ -1,19 +1,3 @@ -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2015 Oslo and Akershus University College of Applied Sciences -// and Alfred Bratterud -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. #pragma once #ifndef KERNEL_CONTEXT_HPP diff --git a/api/kernel/cpuid.hpp b/api/kernel/cpuid.hpp index 6c5616b7b2..acbfc58eb0 100644 --- a/api/kernel/cpuid.hpp +++ b/api/kernel/cpuid.hpp @@ -1,19 +1,3 @@ -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2015 Oslo and Akershus University College of Applied Sciences -// and Alfred Bratterud -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. #pragma once #ifndef KERNEL_CPUID_HPP diff --git a/api/kernel/crash_context.hpp b/api/kernel/crash_context.hpp index 89de67d569..6734c84bd2 100644 --- a/api/kernel/crash_context.hpp +++ b/api/kernel/crash_context.hpp @@ -1,19 +1,3 @@ -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2015 Oslo and Akershus University College of Applied Sciences -// and Alfred Bratterud -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. #ifndef KERNEL_CRASH_CONTEXT_HPP #define KERNEL_CRASH_CONTEXT_HPP diff --git a/api/kernel/elf.hpp b/api/kernel/elf.hpp index bfff58eeb6..c029580d13 100644 --- a/api/kernel/elf.hpp +++ b/api/kernel/elf.hpp @@ -1,19 +1,3 @@ -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2015 Oslo and Akershus University College of Applied Sciences -// and Alfred Bratterud -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. #pragma once #ifndef KERNEL_ELF_HPP @@ -36,7 +20,7 @@ struct Elf // doesn't use heap static safe_func_offset - safe_resolve_symbol(void* addr, char* buffer, size_t length); + safe_resolve_symbol(const void* addr, char* buffer, size_t length); //returns the address of a symbol, or 0 static uintptr_t diff --git a/api/kernel/events.hpp b/api/kernel/events.hpp index e0f3ce3bbd..167e3e39e0 100644 --- a/api/kernel/events.hpp +++ b/api/kernel/events.hpp @@ -1,19 +1,3 @@ -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2015 Oslo and Akershus University College of Applied Sciences -// and Alfred Bratterud -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. #ifndef KERNEL_EVENTS_HPP #define KERNEL_EVENTS_HPP @@ -65,17 +49,12 @@ class alignas(SMP_ALIGN) Events { Events() = default; private: - Events(Events&) = delete; - Events(Events&&) = delete; - Events& operator=(Events&&) = delete; - Events& operator=(Events&) = delete; - event_callback callbacks[NUM_EVENTS]; std::array received_array; std::array handled_array; - std::array event_subs; - std::array event_pend; + std::array event_subs {}; + std::array event_pend {}; // using deque because vector resize causes invalidation of ranged for // when something subscribes during processing of events std::deque sublist; diff --git a/api/kernel/fiber.hpp b/api/kernel/fiber.hpp index 5f13d5071a..dd0df9ad1c 100644 --- a/api/kernel/fiber.hpp +++ b/api/kernel/fiber.hpp @@ -1,19 +1,3 @@ -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2015 Oslo and Akershus University College of Applied Sciences -// and Alfred Bratterud -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. #pragma once #ifndef KERNEL_CONTEXT_HPP @@ -221,8 +205,8 @@ class Fiber { #else static int next_id_; #endif - static SMP::Array main_; - static SMP::Array current_; + static std::vector main_; + static std::vector current_; // Uniquely identify return target (yield / exit) // first stack frame and yield will use this to identify next stack diff --git a/api/kernel/memmap.hpp b/api/kernel/memmap.hpp index 4838b7fd91..db65716548 100644 --- a/api/kernel/memmap.hpp +++ b/api/kernel/memmap.hpp @@ -1,19 +1,3 @@ -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2015-2017 Oslo and Akershus University College of Applied Sciences -// and Alfred Bratterud -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. #pragma once #ifndef KERNEL_MEMMAP_HPP diff --git a/api/kernel/memory.hpp b/api/kernel/memory.hpp index 836f63ef76..810a35666d 100644 --- a/api/kernel/memory.hpp +++ b/api/kernel/memory.hpp @@ -1,20 +1,4 @@ // -*- C++ -*- -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2017 Oslo and Akershus University College of Applied Sciences -// and Alfred Bratterud -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. #ifndef KERNEL_MEMORY_HPP #define KERNEL_MEMORY_HPP diff --git a/api/kernel/mrspinny.hpp b/api/kernel/mrspinny.hpp new file mode 100644 index 0000000000..7ad3d639ba --- /dev/null +++ b/api/kernel/mrspinny.hpp @@ -0,0 +1,7 @@ +#pragma once +#include + +struct struct_spinny { + smp_spinlock memory; +}; +extern struct_spinny mr_spinny; diff --git a/api/kernel/rng.hpp b/api/kernel/rng.hpp index e93e7254a3..768ca1abf9 100644 --- a/api/kernel/rng.hpp +++ b/api/kernel/rng.hpp @@ -1,25 +1,11 @@ // -*-C++-*- -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2016-2018 Oslo and Akershus University College of Applied Sciences -// and Alfred Bratterud -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. #pragma once #ifndef KERNEL_RNG_HPP #define KERNEL_RNG_HPP +#define INCLUDEOS_RNG_IS_SHARED + #include #include #include diff --git a/api/kernel/rtc.hpp b/api/kernel/rtc.hpp index a304891899..7df2336ea6 100644 --- a/api/kernel/rtc.hpp +++ b/api/kernel/rtc.hpp @@ -1,20 +1,4 @@ // -*-C++-*- -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2015 Oslo and Akershus University College of Applied Sciences -// and Alfred Bratterud -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. #pragma once #ifndef KERNEL_RTC_HPP diff --git a/api/kernel/service.hpp b/api/kernel/service.hpp index d2836aa0ac..d7b0f34c1c 100644 --- a/api/kernel/service.hpp +++ b/api/kernel/service.hpp @@ -1,19 +1,3 @@ -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2015 Oslo and Akershus University College of Applied Sciences -// and Alfred Bratterud -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. #ifndef KERNEL_SERVICE_HPP #define KERNEL_SERVICE_HPP diff --git a/api/kernel/smp_common.hpp b/api/kernel/smp_common.hpp new file mode 100644 index 0000000000..cdd18dd3ed --- /dev/null +++ b/api/kernel/smp_common.hpp @@ -0,0 +1,45 @@ +#pragma once +#include +#include +#include +#include +#include + +namespace smp +{ + struct task { + task(SMP::task_func a, + SMP::done_func b) + : func(a), done(b) {} + + SMP::task_func func; + SMP::done_func done; + }; + + void task_done_handler(); + void smp_task_handler(); + + struct smp_main_system + { + uintptr_t stack_base; + uintptr_t stack_size; + smp_barrier boot_barrier; + std::vector initialized_cpus {0}; + // used to determine which worker has posted done-tasks + std::array bmp_storage = {0}; + MemBitmap bitmap{bmp_storage.data(), bmp_storage.size()}; + }; + extern smp_main_system main_system; + + struct smp_worker_system + { + smp_spinlock tlock; + smp_spinlock flock; + std::deque tasks; + std::vector completed; + bool work_done = false; + // main thread on this vCPU + long main_thread_id = 0; + }; + extern std::vector systems; +} diff --git a/api/kernel/solo5_manager.hpp b/api/kernel/solo5_manager.hpp index f8b3eca1f7..20c6e84d39 100644 --- a/api/kernel/solo5_manager.hpp +++ b/api/kernel/solo5_manager.hpp @@ -1,19 +1,3 @@ -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2015 Oslo and Akershus University College of Applied Sciences -// and Alfred Bratterud -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. #ifndef KERNEL_SOLO5_MANAGER_HPP #define KERNEL_SOLO5_MANAGER_HPP diff --git a/api/kernel/terminal.hpp b/api/kernel/terminal.hpp index b5b0b6f7a4..2adc9b7cf0 100644 --- a/api/kernel/terminal.hpp +++ b/api/kernel/terminal.hpp @@ -1,19 +1,3 @@ -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2015 Oslo and Akershus University College of Applied Sciences -// and Alfred Bratterud -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. #pragma once #ifndef API_KERNEL_TERMINAL_HPP diff --git a/api/kernel/threads.hpp b/api/kernel/threads.hpp new file mode 100644 index 0000000000..9c6bb62b27 --- /dev/null +++ b/api/kernel/threads.hpp @@ -0,0 +1,101 @@ +#pragma once +#include +#include +#include +#include +#include + +//#define THREADS_DEBUG 1 +#ifdef THREADS_DEBUG +#define THPRINT(fmt, ...) { SMP::global_lock(); kprintf(fmt, ##__VA_ARGS__); SMP::global_unlock(); } +#else +#define THPRINT(fmt, ...) /* fmt */ +#endif + +namespace kernel +{ + struct Thread { + long tid; + Thread* parent; + void* my_tls; + void* my_stack; + // for returning to this Thread + void* stored_stack = nullptr; + bool yielded = false; + // address zeroed when exiting + void* clear_tid = nullptr; + // children, detached when exited + std::vector children; + + void init(long tid, Thread* parent, void* stack); + void exit(); + void suspend(bool yielded, void* ret_stack); + void set_tls(void* newtls); + void resume(); + void detach(); + void attach(Thread* parent); + void stack_push(uintptr_t value); + private: + void libc_store_this(); + }; + + struct ThreadManager + { + std::map threads; + std::deque suspended; + Thread* main_thread = nullptr; + Thread* next_migration_thread = nullptr; + + delegate on_new_thread = nullptr; + + static ThreadManager& get() noexcept; + static ThreadManager& get(int cpu); + + Thread* detach(long tid); + void attach(Thread* thread); + + bool has_thread(long tid) const noexcept { return threads.find(tid) != threads.end(); } + void insert_thread(Thread* thread); + void erase_thread_safely(Thread* thread); + + void erase_suspension(Thread* t); + void suspend(Thread* t) { suspended.push_back(t); } + void finish_migration_to(Thread* next); + Thread* wakeup_next(); + }; + + inline Thread* get_thread() + { + Thread* thread; + # ifdef ARCH_x86_64 + asm("movq %%fs:(0x10), %0" : "=r" (thread)); + # elif defined(ARCH_i686) + asm("movq %%gs:(0x08), %0" : "=r" (thread)); + # else + #error "Implement me?" + # endif + return thread; + } + + Thread* get_thread(long tid); /* or nullptr */ + + inline long get_tid() { + return get_thread()->tid; + } + + long get_last_thread_id() noexcept; + + void* get_thread_area(); + void set_thread_area(void*); + + Thread* thread_create(Thread* parent, int flags, void* ctid, void* stack) noexcept; + + void resume(long tid); + + Thread* setup_main_thread(long tid = 0); + void setup_automatic_thread_multiprocessing(); +} + +extern "C" { + void __thread_yield(); +} diff --git a/api/kernel/timers.hpp b/api/kernel/timers.hpp index 73c0a12cc4..955887d8bc 100644 --- a/api/kernel/timers.hpp +++ b/api/kernel/timers.hpp @@ -1,20 +1,4 @@ // -*-C++-*- -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2015 Oslo and Akershus University College of Applied Sciences -// and Alfred Bratterud -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. #pragma once #ifndef KERNEL_TIMERS_HPP diff --git a/api/kernel/vga.hpp b/api/kernel/vga.hpp index 63a09f5ca9..673f096618 100644 --- a/api/kernel/vga.hpp +++ b/api/kernel/vga.hpp @@ -1,19 +1,3 @@ -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2015 Oslo and Akershus University College of Applied Sciences -// and Alfred Bratterud -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. #ifndef KERNEL_VGA_HPP #define KERNEL_VGA_HPP diff --git a/api/membitmap b/api/membitmap index a523d79f99..d602f7aa30 100644 --- a/api/membitmap +++ b/api/membitmap @@ -1,20 +1,6 @@ // -*-C++-*- -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2015 Oslo and Akershus University College of Applied Sciences -// and Alfred Bratterud -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at // -// http://www.apache.org/licenses/LICENSE-2.0 // -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. #ifndef ___API_MEMBITMAP___ #define ___API_MEMBITMAP___ diff --git a/api/memdisk b/api/memdisk index 0ce087d005..2270fb4a82 100644 --- a/api/memdisk +++ b/api/memdisk @@ -1,20 +1,4 @@ // -*-C++-*- -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2015 Oslo and Akershus University College of Applied Sciences -// and Alfred Bratterud -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. #pragma once #ifndef MEMDISK_HEADER diff --git a/api/memstream b/api/memstream index bb836585bc..f946bfc206 100644 --- a/api/memstream +++ b/api/memstream @@ -1,20 +1,6 @@ // -*-C++-*- -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2015 Oslo and Akershus University College of Applied Sciences -// and Alfred Bratterud -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at // -// http://www.apache.org/licenses/LICENSE-2.0 // -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. #ifndef ___API_MEMSTREAM___ #define ___API_MEMSTREAM___ diff --git a/api/net/addr.hpp b/api/net/addr.hpp index 9c5aa1cab5..c12e580f86 100644 --- a/api/net/addr.hpp +++ b/api/net/addr.hpp @@ -1,18 +1,3 @@ -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2018 IncludeOS AS, Oslo, Norway -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. #pragma once #include diff --git a/api/net/botan/credman.hpp b/api/net/botan/credman.hpp index 7ffb229872..ca67a684bc 100644 --- a/api/net/botan/credman.hpp +++ b/api/net/botan/credman.hpp @@ -1,19 +1,3 @@ -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2015-2017 Oslo and Akershus University College of Applied Sciences -// and Alfred Bratterud -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. #pragma once #ifndef NET_TLS_CREDMAN_HPP diff --git a/api/net/botan/tls_server.hpp b/api/net/botan/tls_server.hpp index a2101fa8de..56cb7d61fd 100644 --- a/api/net/botan/tls_server.hpp +++ b/api/net/botan/tls_server.hpp @@ -1,19 +1,3 @@ -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2015-2017 Oslo and Akershus University College of Applied Sciences -// and Alfred Bratterud -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. #pragma once #ifndef NET_TLS_SERVER_STREAM_HPP diff --git a/api/net/buffer_store.hpp b/api/net/buffer_store.hpp index 5bcbd8d838..a67ae6dad9 100644 --- a/api/net/buffer_store.hpp +++ b/api/net/buffer_store.hpp @@ -1,19 +1,3 @@ -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2015-2016 Oslo and Akershus University College of Applied Sciences -// and Alfred Bratterud -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. #pragma once #ifndef NET_BUFFER_STORE_HPP @@ -84,10 +68,8 @@ namespace net int index = -1; std::vector available_; std::vector pools_; -#ifdef INCLUDEOS_SMP_ENABLE // has strict alignment reqs, so put at end - spinlock_t plock = 0; -#endif + smp_spinlock plock; BufferStore(BufferStore&) = delete; BufferStore(BufferStore&&) = delete; BufferStore& operator=(BufferStore&) = delete; @@ -98,10 +80,9 @@ namespace net { auto* buff = (uint8_t*) addr; if (LIKELY(this->is_valid(buff))) { -#ifdef INCLUDEOS_SMP_ENABLE - scoped_spinlock spinlock(this->plock); -#endif + plock.lock(); this->available_.push_back(buff); + plock.unlock(); return; } throw std::runtime_error("Buffer did not belong"); diff --git a/api/net/checksum.hpp b/api/net/checksum.hpp index 3faddf4e06..4d2aafcd89 100644 --- a/api/net/checksum.hpp +++ b/api/net/checksum.hpp @@ -1,19 +1,3 @@ -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2017 Oslo and Akershus University College of Applied Sciences -// and Alfred Bratterud -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. #pragma once #ifndef NET_CHECKSUM_HPP diff --git a/api/net/configure.hpp b/api/net/configure.hpp index ab22ec605a..aeb4b16d75 100644 --- a/api/net/configure.hpp +++ b/api/net/configure.hpp @@ -1,19 +1,3 @@ -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2017 Oslo and Akershus University College of Applied Sciences -// and Alfred Bratterud -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. #pragma once #ifndef NET_AUTOCONF_HPP diff --git a/api/net/conntrack.hpp b/api/net/conntrack.hpp index 9fedb3c9da..18feea57db 100644 --- a/api/net/conntrack.hpp +++ b/api/net/conntrack.hpp @@ -1,19 +1,3 @@ -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2017 Oslo and Akershus University College of Applied Sciences -// and Alfred Bratterud -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. #pragma once #ifndef NET_CONNTRACK_HPP diff --git a/api/net/dhcp/dh4client.hpp b/api/net/dhcp/dh4client.hpp index d6a217b19e..7d054d3a79 100644 --- a/api/net/dhcp/dh4client.hpp +++ b/api/net/dhcp/dh4client.hpp @@ -1,19 +1,3 @@ -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2015-2017 Oslo and Akershus University College of Applied Sciences -// and Alfred Bratterud -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. #pragma once #ifndef NET_DHCP_DH4CLIENT_HPP diff --git a/api/net/dhcp/dhcp4.hpp b/api/net/dhcp/dhcp4.hpp index d3072eb8c5..ac80c06f7c 100644 --- a/api/net/dhcp/dhcp4.hpp +++ b/api/net/dhcp/dhcp4.hpp @@ -1,19 +1,3 @@ -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2015-2017 Oslo and Akershus University College of Applied Sciences -// and Alfred Bratterud -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. #pragma once #ifndef NET_DHCP_DHCP4_HPP diff --git a/api/net/dhcp/dhcpd.hpp b/api/net/dhcp/dhcpd.hpp index e2ab36724b..79e5cbbfac 100644 --- a/api/net/dhcp/dhcpd.hpp +++ b/api/net/dhcp/dhcpd.hpp @@ -1,19 +1,3 @@ -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2016-2017 Oslo and Akershus University College of Applied Sciences -// and Alfred Bratterud -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. #pragma once #ifndef NET_DHCP_DHCPD_HPP diff --git a/api/net/dhcp/message.hpp b/api/net/dhcp/message.hpp index 9177254087..ef1f9d1bff 100644 --- a/api/net/dhcp/message.hpp +++ b/api/net/dhcp/message.hpp @@ -1,19 +1,3 @@ -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2017 Oslo and Akershus University College of Applied Sciences -// and Alfred Bratterud -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. #pragma once #ifndef NET_DHCP_MESSAGE_HPP diff --git a/api/net/dhcp/options.hpp b/api/net/dhcp/options.hpp index 1264f8d37a..17ff387ada 100644 --- a/api/net/dhcp/options.hpp +++ b/api/net/dhcp/options.hpp @@ -1,19 +1,3 @@ -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2017 Oslo and Akershus University College of Applied Sciences -// and Alfred Bratterud -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. #pragma once #ifndef NET_DHCP_OPTIONS_HPP diff --git a/api/net/dhcp/record.hpp b/api/net/dhcp/record.hpp index 3f210ce023..ebe1af1df4 100644 --- a/api/net/dhcp/record.hpp +++ b/api/net/dhcp/record.hpp @@ -1,19 +1,3 @@ -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2016-2017 Oslo and Akershus University College of Applied Sciences -// and Alfred Bratterud -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. #pragma once #ifndef NET_DHCP_RECORD_HPP diff --git a/api/net/dns/client.hpp b/api/net/dns/client.hpp index e2eb499d40..013021b68a 100644 --- a/api/net/dns/client.hpp +++ b/api/net/dns/client.hpp @@ -1,19 +1,3 @@ -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2015-2018 Oslo and Akershus University College of Applied Sciences -// and Alfred Bratterud -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. #ifndef NET_DNS_CLIENT_HPP #define NET_DNS_CLIENT_HPP diff --git a/api/net/dns/dns.hpp b/api/net/dns/dns.hpp index cd4f77367c..2b6ed2636b 100644 --- a/api/net/dns/dns.hpp +++ b/api/net/dns/dns.hpp @@ -1,19 +1,3 @@ -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2015-2018 Oslo and Akershus University College of Applied Sciences -// and Alfred Bratterud -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. #ifndef NET_DNS_DNS_HPP #define NET_DNS_DNS_HPP diff --git a/api/net/dns/query.hpp b/api/net/dns/query.hpp index 035a94d829..552bec7cb7 100644 --- a/api/net/dns/query.hpp +++ b/api/net/dns/query.hpp @@ -1,18 +1,3 @@ -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2018 IncludeOS AS, Oslo, Norway -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. #pragma once diff --git a/api/net/dns/record.hpp b/api/net/dns/record.hpp index d73152bac1..f4675a89b3 100644 --- a/api/net/dns/record.hpp +++ b/api/net/dns/record.hpp @@ -1,18 +1,3 @@ -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2018 IncludeOS AS, Oslo, Norway -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. #pragma once diff --git a/api/net/dns/response.hpp b/api/net/dns/response.hpp index 20c9556a25..c4adff80f5 100644 --- a/api/net/dns/response.hpp +++ b/api/net/dns/response.hpp @@ -1,18 +1,3 @@ -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2018 IncludeOS AS, Oslo, Norway -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. #pragma once diff --git a/api/net/error.hpp b/api/net/error.hpp index 00b1a468e6..697c4d99b1 100644 --- a/api/net/error.hpp +++ b/api/net/error.hpp @@ -1,19 +1,3 @@ -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2017 Oslo and Akershus University College of Applied Sciences -// and Alfred Bratterud -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. #ifndef NET_ERROR_HPP #define NET_ERROR_HPP diff --git a/api/net/ethernet/ethernet.hpp b/api/net/ethernet/ethernet.hpp index 0044d46988..d3dc8d8a0e 100644 --- a/api/net/ethernet/ethernet.hpp +++ b/api/net/ethernet/ethernet.hpp @@ -1,19 +1,3 @@ -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2015 Oslo and Akershus University College of Applied Sciences -// and Alfred Bratterud -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. #pragma once #ifndef NET_ETHERNET_HPP diff --git a/api/net/ethernet/ethernet_8021q.hpp b/api/net/ethernet/ethernet_8021q.hpp index d1082e683f..1f9cb41362 100644 --- a/api/net/ethernet/ethernet_8021q.hpp +++ b/api/net/ethernet/ethernet_8021q.hpp @@ -1,19 +1,3 @@ -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2017 Oslo and Akershus University College of Applied Sciences -// and Alfred Bratterud -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. #pragma once #ifndef NET_ETHERNET_8021Q_HPP diff --git a/api/net/ethernet/ethertype.hpp b/api/net/ethernet/ethertype.hpp index e8940fdd83..c86880ea4c 100644 --- a/api/net/ethernet/ethertype.hpp +++ b/api/net/ethernet/ethertype.hpp @@ -1,19 +1,3 @@ -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2015 Oslo and Akershus University College of Applied Sciences -// and Alfred Bratterud -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. #pragma once #ifndef NET_ETHERTYPE_HPP diff --git a/api/net/ethernet/header.hpp b/api/net/ethernet/header.hpp index 51622454b7..de04dbbb63 100644 --- a/api/net/ethernet/header.hpp +++ b/api/net/ethernet/header.hpp @@ -1,19 +1,3 @@ -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2015-2016 Oslo and Akershus University College of Applied Sciences -// and Alfred Bratterud -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. #pragma once #ifndef NET_ETHERNET_HEADER_HPP diff --git a/api/net/http/basic_client.hpp b/api/net/http/basic_client.hpp index 67099b198f..290b26d71b 100644 --- a/api/net/http/basic_client.hpp +++ b/api/net/http/basic_client.hpp @@ -1,19 +1,3 @@ -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2016-2017 Oslo and Akershus University College of Applied Sciences -// and Alfred Bratterud -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. #pragma once #ifndef HTTP_BASIC_CLIENT_HPP diff --git a/api/net/http/client.hpp b/api/net/http/client.hpp index 03de404e17..aa86b2fd41 100644 --- a/api/net/http/client.hpp +++ b/api/net/http/client.hpp @@ -1,18 +1,3 @@ -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2018 IncludeOS AS, Oslo, Norway -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. #pragma once #ifndef NET_HTTP_CLIENT_HPP diff --git a/api/net/http/client_connection.hpp b/api/net/http/client_connection.hpp index c71f5499f2..a14b7a7f15 100644 --- a/api/net/http/client_connection.hpp +++ b/api/net/http/client_connection.hpp @@ -1,19 +1,3 @@ -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2016-2017 Oslo and Akershus University College of Applied Sciences -// and Alfred Bratterud -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. #pragma once #ifndef HTTP_CLIENT_CONNECTION_HPP diff --git a/api/net/http/common.hpp b/api/net/http/common.hpp index 5c8fb6da4b..3894e8018f 100644 --- a/api/net/http/common.hpp +++ b/api/net/http/common.hpp @@ -1,19 +1,3 @@ -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2015-2016 Oslo and Akershus University College of Applied Sciences -// and Alfred Bratterud -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. #ifndef HTTP_COMMON_HPP #define HTTP_COMMON_HPP diff --git a/api/net/http/connection.hpp b/api/net/http/connection.hpp index dc206eabc8..6d6b3caef9 100644 --- a/api/net/http/connection.hpp +++ b/api/net/http/connection.hpp @@ -1,19 +1,3 @@ -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2016-2017 Oslo and Akershus University College of Applied Sciences -// and Alfred Bratterud -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. #pragma once #ifndef HTTP_CONNECTION_HPP diff --git a/api/net/http/cookie.hpp b/api/net/http/cookie.hpp index 6827eaa712..41322ad947 100644 --- a/api/net/http/cookie.hpp +++ b/api/net/http/cookie.hpp @@ -1,19 +1,3 @@ -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2015-2016 Oslo and Akershus University College of Applied Sciences -// and Alfred Bratterud -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. #ifndef HTTP_COOKIE_HPP #define HTTP_COOKIE_HPP diff --git a/api/net/http/error.hpp b/api/net/http/error.hpp index 43c1d8be45..e40955385b 100644 --- a/api/net/http/error.hpp +++ b/api/net/http/error.hpp @@ -1,19 +1,3 @@ -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2016 Oslo and Akershus University College of Applied Sciences -// and Alfred Bratterud -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. #pragma once #ifndef HTTP_ERROR_HPP diff --git a/api/net/http/header.hpp b/api/net/http/header.hpp index 0e41b6e92c..6f562eeda9 100644 --- a/api/net/http/header.hpp +++ b/api/net/http/header.hpp @@ -1,19 +1,3 @@ -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2015-2016 Oslo and Akershus University College of Applied Sciences -// and Alfred Bratterud -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. #ifndef HTTP_HEADER_HPP #define HTTP_HEADER_HPP diff --git a/api/net/http/header_fields.hpp b/api/net/http/header_fields.hpp index 224b101502..62dd0ae314 100644 --- a/api/net/http/header_fields.hpp +++ b/api/net/http/header_fields.hpp @@ -1,19 +1,3 @@ -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2015-2016 Oslo and Akershus University College of Applied Sciences -// and Alfred Bratterud -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. #ifndef HTTP_HEADER_FIELDS_HPP #define HTTP_HEADER_FIELDS_HPP diff --git a/api/net/http/message.hpp b/api/net/http/message.hpp index 0c50b4b1ac..05d387f025 100644 --- a/api/net/http/message.hpp +++ b/api/net/http/message.hpp @@ -1,19 +1,3 @@ -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2015-2016 Oslo and Akershus University College of Applied Sciences -// and Alfred Bratterud -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. #ifndef HTTP_MESSAGE_HPP #define HTTP_MESSAGE_HPP diff --git a/api/net/http/methods.hpp b/api/net/http/methods.hpp index be586925c3..0c5a537de2 100644 --- a/api/net/http/methods.hpp +++ b/api/net/http/methods.hpp @@ -1,19 +1,3 @@ -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2015-2016 Oslo and Akershus University College of Applied Sciences -// and Alfred Bratterud -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. #ifndef HTTP_METHODS_HPP #define HTTP_METHODS_HPP diff --git a/api/net/http/mime_types.hpp b/api/net/http/mime_types.hpp index 0b7469fc4f..5bf40d3130 100644 --- a/api/net/http/mime_types.hpp +++ b/api/net/http/mime_types.hpp @@ -1,19 +1,3 @@ -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2015-2016 Oslo and Akershus University College of Applied Sciences -// and Alfred Bratterud -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. #ifndef HTTP_MIME_TYPES_HPP #define HTTP_MIME_TYPES_HPP diff --git a/api/net/http/request.hpp b/api/net/http/request.hpp index d07a1dde7b..b460a98eac 100644 --- a/api/net/http/request.hpp +++ b/api/net/http/request.hpp @@ -1,19 +1,3 @@ -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2015-2016 Oslo and Akershus University College of Applied Sciences -// and Alfred Bratterud -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. #ifndef HTTP_REQUEST_HPP #define HTTP_REQUEST_HPP diff --git a/api/net/http/response.hpp b/api/net/http/response.hpp index 7263435143..5a0086f8ff 100644 --- a/api/net/http/response.hpp +++ b/api/net/http/response.hpp @@ -1,19 +1,3 @@ -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2015-2016 Oslo and Akershus University College of Applied Sciences -// and Alfred Bratterud -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. #ifndef HTTP_RESPONSE_HPP #define HTTP_RESPONSE_HPP diff --git a/api/net/http/response_writer.hpp b/api/net/http/response_writer.hpp index 21bd2912ff..66450ef969 100644 --- a/api/net/http/response_writer.hpp +++ b/api/net/http/response_writer.hpp @@ -1,19 +1,3 @@ -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2017 Oslo and Akershus University College of Applied Sciences -// and Alfred Bratterud -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. #pragma once #ifndef HTTP_RESPONSE_WRITER_HPP diff --git a/api/net/http/server.hpp b/api/net/http/server.hpp index a966e1802c..e19e4cd28a 100644 --- a/api/net/http/server.hpp +++ b/api/net/http/server.hpp @@ -1,19 +1,3 @@ -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2016-2017 Oslo and Akershus University College of Applied Sciences -// and Alfred Bratterud -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. #pragma once #ifndef HTTP_SERVER_HPP diff --git a/api/net/http/server_connection.hpp b/api/net/http/server_connection.hpp index 2be0d59ae1..05f7c9cda1 100644 --- a/api/net/http/server_connection.hpp +++ b/api/net/http/server_connection.hpp @@ -1,19 +1,3 @@ -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2016 Oslo and Akershus University College of Applied Sciences -// and Alfred Bratterud -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. #pragma once #ifndef HTTP_SERVER_CONNECTION_HPP diff --git a/api/net/http/status_code_constants.hpp b/api/net/http/status_code_constants.hpp index 48df65f400..bd3a5ed025 100644 --- a/api/net/http/status_code_constants.hpp +++ b/api/net/http/status_code_constants.hpp @@ -1,19 +1,6 @@ -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2015-2016 Oslo and Akershus University College of Applied Sciences -// and Alfred Bratterud -// // Licensed under the Apache License, Version 2.0 (the "License"), -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at // -// http://www.apache.org/licenses/LICENSE-2.0 // -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. #ifndef HTTP_STATUS_CODE_CONSTANTS_HPP #define HTTP_STATUS_CODE_CONSTANTS_HPP diff --git a/api/net/http/status_codes.hpp b/api/net/http/status_codes.hpp index 38b3c93cd1..e02caaa623 100644 --- a/api/net/http/status_codes.hpp +++ b/api/net/http/status_codes.hpp @@ -1,19 +1,3 @@ -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2015-2016 Oslo and Akershus University College of Applied Sciences -// and Alfred Bratterud -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. #ifndef HTTP_STATUS_CODES_HPP #define HTTP_STATUS_CODES_HPP diff --git a/api/net/http/time.hpp b/api/net/http/time.hpp index 1ecf0ff9d0..b55faa8c57 100644 --- a/api/net/http/time.hpp +++ b/api/net/http/time.hpp @@ -1,19 +1,3 @@ -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2015-2016 Oslo and Akershus University College of Applied Sciences -// and Alfred Bratterud -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. #ifndef HTTP_TIME_HPP #define HTTP_TIME_HPP diff --git a/api/net/http/version.hpp b/api/net/http/version.hpp index 980b04292a..e4b65c4616 100644 --- a/api/net/http/version.hpp +++ b/api/net/http/version.hpp @@ -1,19 +1,3 @@ -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2015-2016 Oslo and Akershus University College of Applied Sciences -// and Alfred Bratterud -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. #ifndef HTTP_VERSION_HPP #define HTTP_VERSION_HPP diff --git a/api/net/https/botan_server.hpp b/api/net/https/botan_server.hpp index 455d314128..7ebe20d01b 100644 --- a/api/net/https/botan_server.hpp +++ b/api/net/https/botan_server.hpp @@ -1,19 +1,3 @@ -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2016-2017 Oslo and Akershus University College of Applied Sciences -// and Alfred Bratterud -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. #pragma once #ifndef NET_BOTAN_HTTP_SERVER_HPP diff --git a/api/net/https/openssl_server.hpp b/api/net/https/openssl_server.hpp index e33672f914..b0ca1bc47d 100644 --- a/api/net/https/openssl_server.hpp +++ b/api/net/https/openssl_server.hpp @@ -1,19 +1,3 @@ -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2016-2017 Oslo and Akershus University College of Applied Sciences -// and Alfred Bratterud -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. #pragma once #ifndef NET_HTTP_OPENSSL_SERVER_HPP diff --git a/api/net/https/s2n_server.hpp b/api/net/https/s2n_server.hpp index 22ebb31219..f0291e4160 100644 --- a/api/net/https/s2n_server.hpp +++ b/api/net/https/s2n_server.hpp @@ -1,19 +1,3 @@ -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2016-2017 Oslo and Akershus University College of Applied Sciences -// and Alfred Bratterud -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. #pragma once #ifndef NET_HTTP_S2N_SERVER_HPP diff --git a/api/net/iana.hpp b/api/net/iana.hpp index 8f0f18773e..a3de16dba7 100644 --- a/api/net/iana.hpp +++ b/api/net/iana.hpp @@ -1,18 +1,3 @@ -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2018 IncludeOS AS, Oslo, Norway -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. #pragma once diff --git a/api/net/inet.hpp b/api/net/inet.hpp index a4ff4b9c22..e5336776b5 100644 --- a/api/net/inet.hpp +++ b/api/net/inet.hpp @@ -1,19 +1,3 @@ -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2015-2017 Oslo and Akershus University College of Applied Sciences -// and Alfred Bratterud -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. #ifndef NET_INET_HPP #define NET_INET_HPP diff --git a/api/net/inet_common.hpp b/api/net/inet_common.hpp index 9ba9a8a4f2..d330355f3b 100644 --- a/api/net/inet_common.hpp +++ b/api/net/inet_common.hpp @@ -1,19 +1,3 @@ -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2015 Oslo and Akershus University College of Applied Sciences -// and Alfred Bratterud -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. /** Common utilities for internetworking */ diff --git a/api/net/interfaces b/api/net/interfaces index 93070952cc..37eecd18f6 100644 --- a/api/net/interfaces +++ b/api/net/interfaces @@ -1,20 +1,4 @@ //-*- C++ -*- -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2018 Oslo and Akershus University College of Applied Sciences -// and Alfred Bratterud -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. #pragma once #include diff --git a/api/net/interfaces.hpp b/api/net/interfaces.hpp index 292dfa1e2b..f4c6ff1e5f 100644 --- a/api/net/interfaces.hpp +++ b/api/net/interfaces.hpp @@ -1,19 +1,3 @@ -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2016 Oslo and Akershus University College of Applied Sciences -// and Alfred Bratterud -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. #pragma once #ifndef NET_SUPER_STACK_HPP diff --git a/api/net/ip4/addr.hpp b/api/net/ip4/addr.hpp index d26ed00abb..40fdba3547 100644 --- a/api/net/ip4/addr.hpp +++ b/api/net/ip4/addr.hpp @@ -1,19 +1,3 @@ -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2015-2017 Oslo and Akershus University College of Applied Sciences -// and Alfred Bratterud -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. #pragma once #ifndef NET_IP4_ADDR_HPP diff --git a/api/net/ip4/arp.hpp b/api/net/ip4/arp.hpp index 2aecea4c94..c290643360 100644 --- a/api/net/ip4/arp.hpp +++ b/api/net/ip4/arp.hpp @@ -1,19 +1,3 @@ -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2015 Oslo and Akershus University College of Applied Sciences -// and Alfred Bratterud -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. #pragma once #ifndef NET_IP4_ARP_HPP diff --git a/api/net/ip4/cidr.hpp b/api/net/ip4/cidr.hpp index ef44364a5e..17695e1722 100644 --- a/api/net/ip4/cidr.hpp +++ b/api/net/ip4/cidr.hpp @@ -1,19 +1,3 @@ -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2018 Oslo and Akershus University College of Applied Sciences -// and Alfred Bratterud -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. #ifndef NET_IP4_CIDR_HPP #define NET_IP4_CIDR_HPP diff --git a/api/net/ip4/header.hpp b/api/net/ip4/header.hpp index ac1f41d5fd..612c78a43a 100644 --- a/api/net/ip4/header.hpp +++ b/api/net/ip4/header.hpp @@ -1,19 +1,3 @@ -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2015-2017 Oslo and Akershus University College of Applied Sciences -// and Alfred Bratterud -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. #pragma once #ifndef NET_IP4_HEADER_HPP diff --git a/api/net/ip4/icmp4.hpp b/api/net/ip4/icmp4.hpp index f3faaf5fa5..f2d2509220 100644 --- a/api/net/ip4/icmp4.hpp +++ b/api/net/ip4/icmp4.hpp @@ -1,19 +1,3 @@ -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2015-2017 Oslo and Akershus University College of Applied Sciences -// and Alfred Bratterud -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. #ifndef NET_IP4_ICMPv4_HPP #define NET_IP4_ICMPv4_HPP diff --git a/api/net/ip4/icmp4_common.hpp b/api/net/ip4/icmp4_common.hpp index 7489939322..140a90378a 100644 --- a/api/net/ip4/icmp4_common.hpp +++ b/api/net/ip4/icmp4_common.hpp @@ -1,19 +1,3 @@ -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2017 Oslo and Akershus University College of Applied Sciences -// and Alfred Bratterud -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. #pragma once #ifndef NET_IP4_ICMP4_COMMON_HPP diff --git a/api/net/ip4/icmp_error.hpp b/api/net/ip4/icmp_error.hpp index 69bc8bb0dc..79a9904f28 100644 --- a/api/net/ip4/icmp_error.hpp +++ b/api/net/ip4/icmp_error.hpp @@ -1,19 +1,3 @@ -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2017 Oslo and Akershus University College of Applied Sciences -// and Alfred Bratterud -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. #ifndef NET_IP4_ICMP_ERROR_HPP #define NET_IP4_ICMP_ERROR_HPP diff --git a/api/net/ip4/ip4.hpp b/api/net/ip4/ip4.hpp index 20fcb17037..4ab39461a3 100644 --- a/api/net/ip4/ip4.hpp +++ b/api/net/ip4/ip4.hpp @@ -1,19 +1,3 @@ -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2015-2016 Oslo and Akershus University College of Applied Sciences -// and Alfred Bratterud -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. #ifndef NET_IP4_IP4_HPP #define NET_IP4_IP4_HPP diff --git a/api/net/ip4/packet_arp.hpp b/api/net/ip4/packet_arp.hpp index 3f8f90b844..1454d2d525 100644 --- a/api/net/ip4/packet_arp.hpp +++ b/api/net/ip4/packet_arp.hpp @@ -1,19 +1,3 @@ -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2015 Oslo and Akershus University College of Applied Sciences -// and Alfred Bratterud -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. #pragma once #ifndef NET_IP4_PACKET_ARP diff --git a/api/net/ip4/packet_icmp4.hpp b/api/net/ip4/packet_icmp4.hpp index 437b33c369..98454cbe4d 100644 --- a/api/net/ip4/packet_icmp4.hpp +++ b/api/net/ip4/packet_icmp4.hpp @@ -1,19 +1,3 @@ -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2015-2017 Oslo and Akershus University College of Applied Sciences -// and Alfred Bratterud -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. #include #include diff --git a/api/net/ip4/packet_ip4.hpp b/api/net/ip4/packet_ip4.hpp index 95a18f9720..2288ebbd20 100644 --- a/api/net/ip4/packet_ip4.hpp +++ b/api/net/ip4/packet_ip4.hpp @@ -1,19 +1,3 @@ -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2015 Oslo and Akershus University College of Applied Sciences -// and Alfred Bratterud -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. #ifndef IP4_PACKET_IP4_HPP #define IP4_PACKET_IP4_HPP diff --git a/api/net/ip6/addr.hpp b/api/net/ip6/addr.hpp index e7266b6e23..bea3627661 100644 --- a/api/net/ip6/addr.hpp +++ b/api/net/ip6/addr.hpp @@ -1,19 +1,3 @@ -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2015-2017 Oslo and Akershus University College of Applied Sciences -// and Alfred Bratterud -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. #pragma once #ifndef NET_IP6_ADDR_HPP diff --git a/api/net/ip6/addr_list.hpp b/api/net/ip6/addr_list.hpp index ed8bdd7157..da406a418e 100644 --- a/api/net/ip6/addr_list.hpp +++ b/api/net/ip6/addr_list.hpp @@ -1,19 +1,3 @@ -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2018-2019 Oslo and Akershus University College of Applied Sciences -// and Alfred Bratterud -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. #pragma once #include diff --git a/api/net/ip6/detail/stateful_addr.hpp b/api/net/ip6/detail/stateful_addr.hpp index 2b52dc0291..39a8530879 100644 --- a/api/net/ip6/detail/stateful_addr.hpp +++ b/api/net/ip6/detail/stateful_addr.hpp @@ -1,21 +1,4 @@ -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2019 Oslo and Akershus University College of Applied Sciences -// and Alfred Bratterud -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. #pragma once - #include namespace net::ip6::detail diff --git a/api/net/ip6/dhcp6.hpp b/api/net/ip6/dhcp6.hpp index 743edd8347..23ad7b1197 100644 --- a/api/net/ip6/dhcp6.hpp +++ b/api/net/ip6/dhcp6.hpp @@ -1,19 +1,5 @@ -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2015 Oslo and Akershus University College of Applied Sciences -// and Alfred Bratterud -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at // -// http://www.apache.org/licenses/LICENSE-2.0 // -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. #pragma once diff --git a/api/net/ip6/extension_header.hpp b/api/net/ip6/extension_header.hpp index 8055016744..bb6f506cd7 100644 --- a/api/net/ip6/extension_header.hpp +++ b/api/net/ip6/extension_header.hpp @@ -1,18 +1,3 @@ -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2018 IncludeOS AS, Oslo, Norway -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. #pragma once diff --git a/api/net/ip6/header.hpp b/api/net/ip6/header.hpp index c305c12ae1..8dd7bf5d93 100644 --- a/api/net/ip6/header.hpp +++ b/api/net/ip6/header.hpp @@ -1,19 +1,3 @@ -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2015-2017 Oslo and Akershus University College of Applied Sciences -// and Alfred Bratterud -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. #pragma once #ifndef NET_IP6_HEADER_HPP diff --git a/api/net/ip6/icmp6.hpp b/api/net/ip6/icmp6.hpp index 3c96dcd8e8..bcce515f3d 100644 --- a/api/net/ip6/icmp6.hpp +++ b/api/net/ip6/icmp6.hpp @@ -1,19 +1,3 @@ -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2015 Oslo and Akershus University College of Applied Sciences -// and Alfred Bratterud -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. #pragma once diff --git a/api/net/ip6/icmp6_common.hpp b/api/net/ip6/icmp6_common.hpp index 500ba52aa6..cf35ab6aa7 100644 --- a/api/net/ip6/icmp6_common.hpp +++ b/api/net/ip6/icmp6_common.hpp @@ -1,20 +1,3 @@ -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2017 Oslo and Akershus University College of Applied Sciences -// and Alfred Bratterud -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// #pragma once #ifndef NET_IP6_ICMP6_COMMON_HPP #define NET_IP6_ICMP6_COMMON_HPP diff --git a/api/net/ip6/icmp6_error.hpp b/api/net/ip6/icmp6_error.hpp index 05e34e0398..1bbadc122a 100644 --- a/api/net/ip6/icmp6_error.hpp +++ b/api/net/ip6/icmp6_error.hpp @@ -1,20 +1,4 @@ -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2017 Oslo and Akershus University College of Applied Sciences -// and Alfred Bratterud -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. #ifndef NET_IP6_ICMP_ERROR_HPP #define NET_IP6_ICMP_ERROR_HPP diff --git a/api/net/ip6/ip6.hpp b/api/net/ip6/ip6.hpp index ae4794e118..3e5101e24e 100644 --- a/api/net/ip6/ip6.hpp +++ b/api/net/ip6/ip6.hpp @@ -1,19 +1,3 @@ -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2015 Oslo and Akershus University College of Applied Sciences -// and Alfred Bratterud -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. #ifndef NET_IP6_IP6_HPP #define NET_IP6_IP6_HPP diff --git a/api/net/ip6/mld.hpp b/api/net/ip6/mld.hpp index f6bd3d2d5a..08f3ec90a9 100644 --- a/api/net/ip6/mld.hpp +++ b/api/net/ip6/mld.hpp @@ -1,19 +1,3 @@ -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2015 Oslo and Akershus University College of Applied Sciences -// and Alfred Bratterud -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. #pragma once #ifndef NET_IP6_MLD_HPP diff --git a/api/net/ip6/mld/message.hpp b/api/net/ip6/mld/message.hpp index 34be2ab16e..8fb24f3c7a 100644 --- a/api/net/ip6/mld/message.hpp +++ b/api/net/ip6/mld/message.hpp @@ -1,19 +1,3 @@ -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2018 Oslo and Akershus University College of Applied Sciences -// and Alfred Bratterud -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. #pragma once #include diff --git a/api/net/ip6/ndp.hpp b/api/net/ip6/ndp.hpp index 426f9de293..19826d1aa7 100644 --- a/api/net/ip6/ndp.hpp +++ b/api/net/ip6/ndp.hpp @@ -1,19 +1,3 @@ -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2015 Oslo and Akershus University College of Applied Sciences -// and Alfred Bratterud -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. #pragma once #ifndef NET_IP6_NDP_HPP diff --git a/api/net/ip6/ndp/host_params.hpp b/api/net/ip6/ndp/host_params.hpp index fde69394ea..0d952ca077 100644 --- a/api/net/ip6/ndp/host_params.hpp +++ b/api/net/ip6/ndp/host_params.hpp @@ -1,19 +1,3 @@ -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2018 Oslo and Akershus University College of Applied Sciences -// and Alfred Bratterud -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. #pragma once #include diff --git a/api/net/ip6/ndp/message.hpp b/api/net/ip6/ndp/message.hpp index 366cad3b94..bac9a4c4ad 100644 --- a/api/net/ip6/ndp/message.hpp +++ b/api/net/ip6/ndp/message.hpp @@ -1,19 +1,3 @@ -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2018 Oslo and Akershus University College of Applied Sciences -// and Alfred Bratterud -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. #pragma once #include "options.hpp" diff --git a/api/net/ip6/ndp/options.hpp b/api/net/ip6/ndp/options.hpp index 55be350fcf..7f40e8aafb 100644 --- a/api/net/ip6/ndp/options.hpp +++ b/api/net/ip6/ndp/options.hpp @@ -1,19 +1,3 @@ -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2018 Oslo and Akershus University College of Applied Sciences -// and Alfred Bratterud -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. #pragma once #include diff --git a/api/net/ip6/ndp/router_entry.hpp b/api/net/ip6/ndp/router_entry.hpp index 68f0660ca2..0f791c235b 100644 --- a/api/net/ip6/ndp/router_entry.hpp +++ b/api/net/ip6/ndp/router_entry.hpp @@ -1,19 +1,3 @@ -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2018 Oslo and Akershus University College of Applied Sciences -// and Alfred Bratterud -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. #pragma once #include diff --git a/api/net/ip6/ndp/router_params.hpp b/api/net/ip6/ndp/router_params.hpp index cbb3e27810..45601ddf6c 100644 --- a/api/net/ip6/ndp/router_params.hpp +++ b/api/net/ip6/ndp/router_params.hpp @@ -1,19 +1,3 @@ -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2018 Oslo and Akershus University College of Applied Sciences -// and Alfred Bratterud -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. #pragma once #include diff --git a/api/net/ip6/packet_icmp6.hpp b/api/net/ip6/packet_icmp6.hpp index 1449be3dc9..05b687add5 100644 --- a/api/net/ip6/packet_icmp6.hpp +++ b/api/net/ip6/packet_icmp6.hpp @@ -1,20 +1,4 @@ -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2015-2017 Oslo and Akershus University College of Applied Sciences -// and Alfred Bratterud -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. #pragma once #ifndef PACKET_ICMP6_HPP diff --git a/api/net/ip6/packet_ip6.hpp b/api/net/ip6/packet_ip6.hpp index e870e83e91..2d9a47cecf 100644 --- a/api/net/ip6/packet_ip6.hpp +++ b/api/net/ip6/packet_ip6.hpp @@ -1,19 +1,3 @@ -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2015 Oslo and Akershus University College of Applied Sciences -// and Alfred Bratterud -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. #pragma once #ifndef IP6_PACKET_IP6_HPP diff --git a/api/net/ip6/packet_mld.hpp b/api/net/ip6/packet_mld.hpp index 29ec255215..8fe87f1727 100644 --- a/api/net/ip6/packet_mld.hpp +++ b/api/net/ip6/packet_mld.hpp @@ -1,19 +1,3 @@ -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2015-2017 Oslo and Akershus University College of Applied Sciences -// and Alfred Bratterud -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. #pragma once #ifndef PACKET_MLD_HPP diff --git a/api/net/ip6/packet_ndp.hpp b/api/net/ip6/packet_ndp.hpp index bee58e337f..9df780166a 100644 --- a/api/net/ip6/packet_ndp.hpp +++ b/api/net/ip6/packet_ndp.hpp @@ -1,19 +1,3 @@ -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2015-2017 Oslo and Akershus University College of Applied Sciences -// and Alfred Bratterud -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. #pragma once #ifndef PACKET_NDP_HPP diff --git a/api/net/ip6/slaac.hpp b/api/net/ip6/slaac.hpp index 7934cd3dba..1ddcaf4831 100644 --- a/api/net/ip6/slaac.hpp +++ b/api/net/ip6/slaac.hpp @@ -1,19 +1,3 @@ -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2015-2017 Oslo and Akershus University College of Applied Sciences -// and Alfred Bratterud -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. #pragma once #ifndef NET_SLAAC_HPP diff --git a/api/net/ip6/stateful_addr.hpp b/api/net/ip6/stateful_addr.hpp index 578a6fd50f..e2b6b042be 100644 --- a/api/net/ip6/stateful_addr.hpp +++ b/api/net/ip6/stateful_addr.hpp @@ -1,19 +1,3 @@ -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2018 Oslo and Akershus University College of Applied Sciences -// and Alfred Bratterud -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. #pragma once #include "detail/stateful_addr.hpp" diff --git a/api/net/ip6/tcp6.hpp b/api/net/ip6/tcp6.hpp index 96cd732076..e69de29bb2 100644 --- a/api/net/ip6/tcp6.hpp +++ b/api/net/ip6/tcp6.hpp @@ -1,16 +0,0 @@ -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2015 Oslo and Akershus University College of Applied Sciences -// and Alfred Bratterud -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. diff --git a/api/net/ip6/udp6.hpp b/api/net/ip6/udp6.hpp index c5f7b5e904..34ac5c0ac8 100644 --- a/api/net/ip6/udp6.hpp +++ b/api/net/ip6/udp6.hpp @@ -1,19 +1,3 @@ -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2015 Oslo and Akershus University College of Applied Sciences -// and Alfred Bratterud -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. #ifndef NET_IP6_UDP_HPP #define NET_IP6_UDP_HPP diff --git a/api/net/link_layer.hpp b/api/net/link_layer.hpp index 37106a0bd6..171409da17 100644 --- a/api/net/link_layer.hpp +++ b/api/net/link_layer.hpp @@ -1,19 +1,3 @@ -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2017 Oslo and Akershus University College of Applied Sciences -// and Alfred Bratterud -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. #pragma once #ifndef NET_LINK_LAYER_HPP diff --git a/api/net/nat/napt.hpp b/api/net/nat/napt.hpp index 00074e7ce1..a64048fd0c 100644 --- a/api/net/nat/napt.hpp +++ b/api/net/nat/napt.hpp @@ -1,19 +1,3 @@ -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2017 Oslo and Akershus University College of Applied Sciences -// and Alfred Bratterud -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. #pragma once #ifndef NET_NAT_NAPT_HPP diff --git a/api/net/nat/nat.hpp b/api/net/nat/nat.hpp index c58a329fd1..682c0a3b39 100644 --- a/api/net/nat/nat.hpp +++ b/api/net/nat/nat.hpp @@ -1,19 +1,3 @@ -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2017 Oslo and Akershus University College of Applied Sciences -// and Alfred Bratterud -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. #pragma once #ifndef NET_NAT_NAT_HPP diff --git a/api/net/netfilter.hpp b/api/net/netfilter.hpp index 7a849db4d6..40c43b32a3 100644 --- a/api/net/netfilter.hpp +++ b/api/net/netfilter.hpp @@ -1,19 +1,3 @@ -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2017 Oslo and Akershus University College of Applied Sciences -// and Alfred Bratterud -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. #pragma once #ifndef NET_NETFILTER_HPP diff --git a/api/net/packet.hpp b/api/net/packet.hpp index b8f23858a3..b04ea0e57f 100644 --- a/api/net/packet.hpp +++ b/api/net/packet.hpp @@ -1,19 +1,3 @@ -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2015 Oslo and Akershus University College of Applied Sciences -// and Alfred Bratterud -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. #ifndef NET_PACKET_HPP #define NET_PACKET_HPP diff --git a/api/net/port_util.hpp b/api/net/port_util.hpp index 9e002fc7e6..56e6941fbe 100644 --- a/api/net/port_util.hpp +++ b/api/net/port_util.hpp @@ -1,19 +1,3 @@ -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2017 Oslo and Akershus University College of Applied Sciences -// and Alfred Bratterud -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. #pragma once #ifndef NET_PORT_UTIL_HPP @@ -44,7 +28,7 @@ class Port_util { : ports(), eph_view{ // set the ephemeral view to be between 49152-65535 ports.data() + port_ranges::DYNAMIC_START / 8, - static_cast (size() / sizeof(MemBitmap::word)) + size() / sizeof(MemBitmap::word) }, ephemeral_(net::new_ephemeral_port()), eph_count(0) diff --git a/api/net/router.hpp b/api/net/router.hpp index 584f2165e2..39ae96afb0 100644 --- a/api/net/router.hpp +++ b/api/net/router.hpp @@ -1,19 +1,3 @@ -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2016 Oslo and Akershus University College of Applied Sciences -// and Alfred Bratterud -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. #ifndef NET_ROUTER_HPP #define NET_ROUTER_HPP diff --git a/api/net/s2n/stream.hpp b/api/net/s2n/stream.hpp index 3fb6d68837..2be6b05b42 100644 --- a/api/net/s2n/stream.hpp +++ b/api/net/s2n/stream.hpp @@ -1,19 +1,3 @@ -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2016-2017 Oslo and Akershus University College of Applied Sciences -// and Alfred Bratterud -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. #pragma once #include diff --git a/api/net/socket.hpp b/api/net/socket.hpp index 3246ab5bd4..166e0f4301 100644 --- a/api/net/socket.hpp +++ b/api/net/socket.hpp @@ -1,19 +1,3 @@ -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2015-2017 Oslo and Akershus University College of Applied Sciences -// and Alfred Bratterud -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. #pragma once #ifndef NET_SOCKET_HPP diff --git a/api/net/stream.hpp b/api/net/stream.hpp index ea35b8f1e7..9b98b118ab 100644 --- a/api/net/stream.hpp +++ b/api/net/stream.hpp @@ -1,19 +1,3 @@ -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2015-2017 Oslo and Akershus University College of Applied Sciences -// and Alfred Bratterud -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. #pragma once #ifndef NET_STREAM_HPP diff --git a/api/net/stream_buffer.hpp b/api/net/stream_buffer.hpp index bc1a0c56a4..52d10c06d4 100644 --- a/api/net/stream_buffer.hpp +++ b/api/net/stream_buffer.hpp @@ -1,19 +1,3 @@ -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2016-2017 Oslo and Akershus University College of Applied Sciences -// and Alfred Bratterud -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. #pragma once #ifndef STREAMBUFFERR_HPP diff --git a/api/net/tcp/common.hpp b/api/net/tcp/common.hpp index 597152cc50..9c98a51f1d 100644 --- a/api/net/tcp/common.hpp +++ b/api/net/tcp/common.hpp @@ -1,19 +1,3 @@ -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2015-2016 Oslo and Akershus University College of Applied Sciences -// and Alfred Bratterud -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. #pragma once #ifndef NET_TCP_COMMON_HPP diff --git a/api/net/tcp/connection.hpp b/api/net/tcp/connection.hpp index a6c35cfeaa..0db202e32a 100644 --- a/api/net/tcp/connection.hpp +++ b/api/net/tcp/connection.hpp @@ -1,19 +1,3 @@ -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2015-2017 Oslo and Akershus University College of Applied Sciences -// and Alfred Bratterud -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. #pragma once #ifndef NET_TCP_CONNECTION_HPP diff --git a/api/net/tcp/connection_states.hpp b/api/net/tcp/connection_states.hpp index ca95f9acb2..e91768816f 100644 --- a/api/net/tcp/connection_states.hpp +++ b/api/net/tcp/connection_states.hpp @@ -1,19 +1,3 @@ -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2015-2016 Oslo and Akershus University College of Applied Sciences -// and Alfred Bratterud -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. #pragma once #ifndef NET_TCP_CONNECTION_STATES_HPP diff --git a/api/net/tcp/headers.hpp b/api/net/tcp/headers.hpp index 73d1d63126..2cd436db9b 100644 --- a/api/net/tcp/headers.hpp +++ b/api/net/tcp/headers.hpp @@ -1,19 +1,3 @@ -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2015-2016 Oslo and Akershus University College of Applied Sciences -// and Alfred Bratterud -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. #pragma once #ifndef NET_TCP_HEADERS_HPP diff --git a/api/net/tcp/listener.hpp b/api/net/tcp/listener.hpp index 9a2202b56b..d438bb2385 100644 --- a/api/net/tcp/listener.hpp +++ b/api/net/tcp/listener.hpp @@ -1,19 +1,3 @@ -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2015-2016 Oslo and Akershus University College of Applied Sciences -// and Alfred Bratterud -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. #pragma once #ifndef NET_TCP_LISTENER_HPP diff --git a/api/net/tcp/options.hpp b/api/net/tcp/options.hpp index 4ffbb3e5e6..f0b68ea985 100644 --- a/api/net/tcp/options.hpp +++ b/api/net/tcp/options.hpp @@ -1,19 +1,3 @@ -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2015-2016 Oslo and Akershus University College of Applied Sciences -// and Alfred Bratterud -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. #pragma once #ifndef NET_TCP_OPTION_HPP diff --git a/api/net/tcp/packet.hpp b/api/net/tcp/packet.hpp index dc80751ad4..1abc1f2007 100644 --- a/api/net/tcp/packet.hpp +++ b/api/net/tcp/packet.hpp @@ -1,19 +1,3 @@ -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2015-2016 Oslo and Akershus University College of Applied Sciences -// and Alfred Bratterud -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. #pragma once #ifndef NET_TCP_PACKET_HPP diff --git a/api/net/tcp/packet4_view.hpp b/api/net/tcp/packet4_view.hpp index 49cdb9688e..7b663da441 100644 --- a/api/net/tcp/packet4_view.hpp +++ b/api/net/tcp/packet4_view.hpp @@ -1,18 +1,3 @@ -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2018 IncludeOS AS, Oslo, Norway -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. #pragma once diff --git a/api/net/tcp/packet6_view.hpp b/api/net/tcp/packet6_view.hpp index 2db7733958..fd48cbda12 100644 --- a/api/net/tcp/packet6_view.hpp +++ b/api/net/tcp/packet6_view.hpp @@ -1,18 +1,3 @@ -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2018 IncludeOS AS, Oslo, Norway -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. #pragma once diff --git a/api/net/tcp/packet_view.hpp b/api/net/tcp/packet_view.hpp index 695a9b3547..f7e7ff73b5 100644 --- a/api/net/tcp/packet_view.hpp +++ b/api/net/tcp/packet_view.hpp @@ -1,18 +1,3 @@ -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2018 IncludeOS AS, Oslo, Norway -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. #pragma once diff --git a/api/net/tcp/read_buffer.hpp b/api/net/tcp/read_buffer.hpp index a7539ebd57..b08f923285 100644 --- a/api/net/tcp/read_buffer.hpp +++ b/api/net/tcp/read_buffer.hpp @@ -1,19 +1,3 @@ -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2015-2017 Oslo and Akershus University College of Applied Sciences -// and Alfred Bratterud -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. #pragma once #ifndef NET_TCP_READ_BUFFER_HPP diff --git a/api/net/tcp/read_request.hpp b/api/net/tcp/read_request.hpp index 203dc329e3..3246cdc6dd 100644 --- a/api/net/tcp/read_request.hpp +++ b/api/net/tcp/read_request.hpp @@ -1,19 +1,3 @@ -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2015-2018 Oslo and Akershus University College of Applied Sciences -// and Alfred Bratterud -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. #pragma once #ifndef NET_TCP_READ_REQUEST_HPP diff --git a/api/net/tcp/rttm.hpp b/api/net/tcp/rttm.hpp index a3e7c7f983..24e86e2add 100644 --- a/api/net/tcp/rttm.hpp +++ b/api/net/tcp/rttm.hpp @@ -1,19 +1,3 @@ -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2015-2016 Oslo and Akershus University College of Applied Sciences -// and Alfred Bratterud -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. #pragma once #ifndef NET_TCP_RTTM_HPP diff --git a/api/net/tcp/sack.hpp b/api/net/tcp/sack.hpp index e034a21615..31616eb7bf 100644 --- a/api/net/tcp/sack.hpp +++ b/api/net/tcp/sack.hpp @@ -1,19 +1,3 @@ -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2017 Oslo and Akershus University College of Applied Sciences -// and Alfred Bratterud -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. #pragma once #ifndef NET_TCP_SACK_HPP #define NET_TCP_SACK_HPP diff --git a/api/net/tcp/tcp.hpp b/api/net/tcp/tcp.hpp index a3072857a3..6572df5cfd 100644 --- a/api/net/tcp/tcp.hpp +++ b/api/net/tcp/tcp.hpp @@ -1,19 +1,3 @@ -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2015-2017 Oslo and Akershus University College of Applied Sciences -// and Alfred Bratterud -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. #pragma once #ifndef NET_TCP_HPP diff --git a/api/net/tcp/tcp_conntrack.hpp b/api/net/tcp/tcp_conntrack.hpp index fc53d877dd..43eb8b89d9 100644 --- a/api/net/tcp/tcp_conntrack.hpp +++ b/api/net/tcp/tcp_conntrack.hpp @@ -1,18 +1,3 @@ -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2018 IncludeOS AS, Oslo, Norway -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. #pragma once diff --git a/api/net/tcp/tcp_errors.hpp b/api/net/tcp/tcp_errors.hpp index a7f9af9509..e9643f17b4 100644 --- a/api/net/tcp/tcp_errors.hpp +++ b/api/net/tcp/tcp_errors.hpp @@ -1,19 +1,3 @@ -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2015-2016 Oslo and Akershus University College of Applied Sciences -// and Alfred Bratterud -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. #pragma once #ifndef NET_TCP_TCP_ERRORS_HPP diff --git a/api/net/tcp/write_queue.hpp b/api/net/tcp/write_queue.hpp index 479a6be3be..b6cac59e75 100644 --- a/api/net/tcp/write_queue.hpp +++ b/api/net/tcp/write_queue.hpp @@ -1,19 +1,3 @@ -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2015-2017 Oslo and Akershus University College of Applied Sciences -// and Alfred Bratterud -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. #pragma once #ifndef NET_TCP_WRITE_QUEUE_HPP diff --git a/api/net/udp/common.hpp b/api/net/udp/common.hpp index 8022870698..683a8900d0 100644 --- a/api/net/udp/common.hpp +++ b/api/net/udp/common.hpp @@ -1,18 +1,3 @@ -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2018 IncludeOS AS, Oslo, Norway -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. #pragma once diff --git a/api/net/udp/header.hpp b/api/net/udp/header.hpp index a139d7f0ef..bd8d33e8e9 100644 --- a/api/net/udp/header.hpp +++ b/api/net/udp/header.hpp @@ -1,18 +1,3 @@ -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2018 IncludeOS AS, Oslo, Norway -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. #pragma once diff --git a/api/net/udp/packet4_view.hpp b/api/net/udp/packet4_view.hpp index dac42f6f15..772e0a503b 100644 --- a/api/net/udp/packet4_view.hpp +++ b/api/net/udp/packet4_view.hpp @@ -1,18 +1,3 @@ -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2018 IncludeOS AS, Oslo, Norway -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. #pragma once diff --git a/api/net/udp/packet6_view.hpp b/api/net/udp/packet6_view.hpp index 74638698dd..aecbf32c54 100644 --- a/api/net/udp/packet6_view.hpp +++ b/api/net/udp/packet6_view.hpp @@ -1,18 +1,3 @@ -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2018 IncludeOS AS, Oslo, Norway -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. #pragma once diff --git a/api/net/udp/packet_udp.hpp b/api/net/udp/packet_udp.hpp index 103922bdca..8b2e135611 100644 --- a/api/net/udp/packet_udp.hpp +++ b/api/net/udp/packet_udp.hpp @@ -1,19 +1,3 @@ -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2015 Oslo and Akershus University College of Applied Sciences -// and Alfred Bratterud -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. #pragma once diff --git a/api/net/udp/packet_view.hpp b/api/net/udp/packet_view.hpp index 9ce07ab018..042ac29e94 100644 --- a/api/net/udp/packet_view.hpp +++ b/api/net/udp/packet_view.hpp @@ -1,18 +1,3 @@ -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2018 IncludeOS AS, Oslo, Norway -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. #pragma once diff --git a/api/net/udp/socket.hpp b/api/net/udp/socket.hpp index 24a92f9739..d962d758b1 100644 --- a/api/net/udp/socket.hpp +++ b/api/net/udp/socket.hpp @@ -1,19 +1,3 @@ -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2015 Oslo and Akershus University College of Applied Sciences -// and Alfred Bratterud -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. #pragma once #ifndef NET_IP4_UDP_SOCKET_HPP diff --git a/api/net/udp/udp.hpp b/api/net/udp/udp.hpp index c4edeb49ff..2d434f4cdd 100644 --- a/api/net/udp/udp.hpp +++ b/api/net/udp/udp.hpp @@ -1,19 +1,3 @@ -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2015 Oslo and Akershus University College of Applied Sciences -// and Alfred Bratterud -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. #pragma once #ifndef NET_UDP_UDP_HPP diff --git a/api/net/util.hpp b/api/net/util.hpp index 8dc2bcff46..6ed730b32a 100644 --- a/api/net/util.hpp +++ b/api/net/util.hpp @@ -1,19 +1,3 @@ -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2015-2017 Oslo and Akershus University College of Applied Sciences -// and Alfred Bratterud -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. #ifndef NET_UTIL_HPP #define NET_UTIL_HPP diff --git a/api/net/vif.hpp b/api/net/vif.hpp index cb3ddada47..f5459a4d22 100644 --- a/api/net/vif.hpp +++ b/api/net/vif.hpp @@ -1,19 +1,3 @@ -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2017 Oslo and Akershus University College of Applied Sciences -// and Alfred Bratterud -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. #pragma once #ifndef NET_VIF_HPP diff --git a/api/net/vlan b/api/net/vlan index 6854e4ad9e..29b39055a5 100644 --- a/api/net/vlan +++ b/api/net/vlan @@ -1,20 +1,4 @@ //-*- C++ -*- -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2017 Oslo and Akershus University College of Applied Sciences -// and Alfred Bratterud -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. #pragma once #ifndef NET_VLAN_API #define NET_VLAN_API diff --git a/api/net/vlan_manager.hpp b/api/net/vlan_manager.hpp index 32c593608f..f2583645f2 100644 --- a/api/net/vlan_manager.hpp +++ b/api/net/vlan_manager.hpp @@ -1,19 +1,3 @@ -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2017 Oslo and Akershus University College of Applied Sciences -// and Alfred Bratterud -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. #pragma once #ifndef NET_VLAN_MANAGER_HPP diff --git a/api/net/ws/connector.hpp b/api/net/ws/connector.hpp index 82ee2731a9..3459d6878a 100644 --- a/api/net/ws/connector.hpp +++ b/api/net/ws/connector.hpp @@ -1,19 +1,3 @@ -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2017 Oslo and Akershus University College of Applied Sciences -// and Alfred Bratterud -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. #pragma once #ifndef NET_HTTP_WS_CONNECTOR_HPP diff --git a/api/net/ws/header.hpp b/api/net/ws/header.hpp index d2740938fe..0b17007870 100644 --- a/api/net/ws/header.hpp +++ b/api/net/ws/header.hpp @@ -1,19 +1,3 @@ -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2016-2017 Oslo and Akershus University College of Applied Sciences -// and Alfred Bratterud -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. #pragma once #ifndef NET_WS_HEADER_HPP diff --git a/api/net/ws/websocket.hpp b/api/net/ws/websocket.hpp index 82196d2c3b..6e433ab884 100644 --- a/api/net/ws/websocket.hpp +++ b/api/net/ws/websocket.hpp @@ -1,19 +1,3 @@ -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2016-2017 Oslo and Akershus University College of Applied Sciences -// and Alfred Bratterud -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. #pragma once #ifndef NET_WS_WEBSOCKET_HPP diff --git a/api/os b/api/os index b562048477..edd8f08b05 100644 --- a/api/os +++ b/api/os @@ -1,20 +1,4 @@ // -*- C++ -*- -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2015-2017 Oslo and Akershus University College of Applied Sciences -// and Alfred Bratterud -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. #ifndef ___API_OS_INCLUDEOS___ #define ___API_OS_INCLUDEOS___ diff --git a/api/os.hpp b/api/os.hpp index 1bfa3ddd32..31be0e84c3 100644 --- a/api/os.hpp +++ b/api/os.hpp @@ -1,18 +1,3 @@ -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2018 IncludeOS AS, Oslo, Norway -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. #ifndef OS_HPP #define OS_HPP diff --git a/api/plugins/unik.hpp b/api/plugins/unik.hpp index 66196d7a5e..a73568e58d 100644 --- a/api/plugins/unik.hpp +++ b/api/plugins/unik.hpp @@ -1,19 +1,3 @@ -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2015 Oslo and Akershus University College of Applied Sciences -// and Alfred Bratterud -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. #ifndef PLUGINS_UNIK_HPP #define PLUGINS_UNIK_HPP diff --git a/api/posix/fd.hpp b/api/posix/fd.hpp index 454151c797..2e1675428e 100644 --- a/api/posix/fd.hpp +++ b/api/posix/fd.hpp @@ -1,19 +1,3 @@ -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2015-2016 Oslo and Akershus University College of Applied Sciences -// and Alfred Bratterud -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. #pragma once #ifndef INCLUDE_FD_HPP diff --git a/api/posix/fd_map.hpp b/api/posix/fd_map.hpp index dcf51de04c..855f3f8976 100644 --- a/api/posix/fd_map.hpp +++ b/api/posix/fd_map.hpp @@ -1,19 +1,3 @@ -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2015-2016 Oslo and Akershus University College of Applied Sciences -// and Alfred Bratterud -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. #pragma once #ifndef INCLUDE_FD_MAP_HPP diff --git a/api/posix/file_fd.hpp b/api/posix/file_fd.hpp index 6703276c99..f9d19aa149 100644 --- a/api/posix/file_fd.hpp +++ b/api/posix/file_fd.hpp @@ -1,19 +1,3 @@ -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2015-2016 Oslo and Akershus University College of Applied Sciences -// and Alfred Bratterud -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. #ifndef FILE_FD_HPP #define FILE_FD_HPP diff --git a/api/posix/rng_fd.hpp b/api/posix/rng_fd.hpp index 369b7f2459..30b96b6090 100644 --- a/api/posix/rng_fd.hpp +++ b/api/posix/rng_fd.hpp @@ -1,19 +1,3 @@ -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2018 Oslo and Akershus University College of Applied Sciences -// and Alfred Bratterud -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. #pragma once #ifndef INCLUDE_RNG_FD_HPP diff --git a/api/posix/sockfd.hpp b/api/posix/sockfd.hpp index 00c20cb457..4ab91ae4b0 100644 --- a/api/posix/sockfd.hpp +++ b/api/posix/sockfd.hpp @@ -1,19 +1,3 @@ -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2015-2016 Oslo and Akershus University College of Applied Sciences -// and Alfred Bratterud -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. #pragma once #ifndef INCLUDE_SOCKFD_HPP diff --git a/api/posix/syslog_print_socket.hpp b/api/posix/syslog_print_socket.hpp index 7cbe1c6f84..4d60019cb3 100644 --- a/api/posix/syslog_print_socket.hpp +++ b/api/posix/syslog_print_socket.hpp @@ -1,18 +1,3 @@ -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2018 IncludeOS AS, Oslo, Norway -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. #pragma once #ifndef POSIX_SYSLOG_PRINT_SOCKET_HPP diff --git a/api/posix/syslog_udp_socket.hpp b/api/posix/syslog_udp_socket.hpp index 105207000c..f3e18a486c 100644 --- a/api/posix/syslog_udp_socket.hpp +++ b/api/posix/syslog_udp_socket.hpp @@ -1,18 +1,3 @@ -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2018 IncludeOS AS, Oslo, Norway -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. #pragma once #ifndef POSIX_SYSLOG_UDP_SOCKET_HPP diff --git a/api/posix/tcp_fd.hpp b/api/posix/tcp_fd.hpp index fad3db4180..0eeca8f08c 100644 --- a/api/posix/tcp_fd.hpp +++ b/api/posix/tcp_fd.hpp @@ -1,19 +1,3 @@ -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2015-2016 Oslo and Akershus University College of Applied Sciences -// and Alfred Bratterud -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. #pragma once #ifndef INCLUDE_TCP_FD_HPP diff --git a/api/posix/udp_fd.hpp b/api/posix/udp_fd.hpp index 296ef681d8..ceac5911a1 100644 --- a/api/posix/udp_fd.hpp +++ b/api/posix/udp_fd.hpp @@ -1,19 +1,3 @@ -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2015-2016 Oslo and Akershus University College of Applied Sciences -// and Alfred Bratterud -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. #pragma once #ifndef INCLUDE_UDP_FD_HPP diff --git a/api/posix/unix_fd.hpp b/api/posix/unix_fd.hpp index 9e99e654a2..d913e30ea9 100644 --- a/api/posix/unix_fd.hpp +++ b/api/posix/unix_fd.hpp @@ -1,18 +1,3 @@ -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2018 IncludeOS AS, Oslo, Norway -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. #pragma once #ifndef POSIX_UNIX_FD_HPP diff --git a/api/posix/unix_fd_impl.hpp b/api/posix/unix_fd_impl.hpp index 0f0bec3995..de16179c35 100644 --- a/api/posix/unix_fd_impl.hpp +++ b/api/posix/unix_fd_impl.hpp @@ -1,18 +1,3 @@ -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2018 IncludeOS AS, Oslo, Norway -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. #pragma once #ifndef POSIX_UNIX_FD_IMPL_HPP diff --git a/api/profile b/api/profile index d731643894..df7bb2b749 100644 --- a/api/profile +++ b/api/profile @@ -1,20 +1,4 @@ // -*-C++-*- -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2015 Oslo and Akershus University College of Applied Sciences -// and Alfred Bratterud -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. #pragma once #ifndef API_PROFILE_HEADER @@ -26,6 +10,14 @@ #include #include +#ifdef ENABLE_PROFILERS +#define __PCONCAT(x,y) x ## y +#define PCONCAT(x,y) __PCONCAT(x, y) +#define PROFILE(name) ScopedProfiler PCONCAT(sp, __COUNTER__){name}; +#else +#define PROFILE(name) /* name */ +#endif + struct Sample { uint32_t samp; // samples void* addr; // function address @@ -131,8 +123,12 @@ class ScopedProfiler const char* name; std::string function_name; unsigned num_samples; - uint64_t cycles_average; - uint64_t nanos_start; + uint64_t cycles_total; + uint64_t ticks_start; + + uint64_t cycles_average() const noexcept { + return this->cycles_total / this->num_samples; + } }; @@ -147,7 +143,7 @@ class ScopedProfiler // Use plain array for performance (cache locality) // Increase size if there is a need to profile more than 64 scopes - static std::array entries; + static std::array entries; }; struct HeapDiag diff --git a/api/ringbuffer b/api/ringbuffer index be903cf7a3..436dfbdee2 100644 --- a/api/ringbuffer +++ b/api/ringbuffer @@ -1,20 +1,6 @@ // -*-C++-*- -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2015 Oslo and Akershus University College of Applied Sciences -// and Alfred Bratterud -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at // -// http://www.apache.org/licenses/LICENSE-2.0 // -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. #pragma once #ifndef API_RINGBUFFER_HEADER diff --git a/api/rtc b/api/rtc index 795ae32b97..9f6a8478de 100644 --- a/api/rtc +++ b/api/rtc @@ -1,20 +1,4 @@ // -*-C++-*- -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2015 Oslo and Akershus University College of Applied Sciences -// and Alfred Bratterud -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. #pragma once #ifndef API_RTC_HEADER diff --git a/api/serial b/api/serial index 3edbaa54dc..ea0a7b5fb2 100644 --- a/api/serial +++ b/api/serial @@ -1,19 +1,5 @@ -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2015 Oslo and Akershus University College of Applied Sciences -// and Alfred Bratterud -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at // -// http://www.apache.org/licenses/LICENSE-2.0 // -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. #ifndef SERIAL_HEADER #define SERIAL_HEADER diff --git a/api/service b/api/service index 5ee584f5eb..981c73fafe 100644 --- a/api/service +++ b/api/service @@ -1,20 +1,6 @@ // -*-C++-*- -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2015 Oslo and Akershus University College of Applied Sciences -// and Alfred Bratterud -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at // -// http://www.apache.org/licenses/LICENSE-2.0 // -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. #ifndef ___API_SERVICE___ #define ___API_SERVICE___ diff --git a/api/signal b/api/signal index ef0d9d73c2..defd5fbb6f 100644 --- a/api/signal +++ b/api/signal @@ -1,20 +1,6 @@ // -*-C++-*- -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2015 Oslo and Akershus University College of Applied Sciences -// and Alfred Bratterud -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at // -// http://www.apache.org/licenses/LICENSE-2.0 // -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. #ifndef ___API_SIGNAL___ #define ___API_SIGNAL___ diff --git a/api/smp b/api/smp index 7fb3f2b836..ea53b1faa6 100644 --- a/api/smp +++ b/api/smp @@ -1,20 +1,4 @@ // -*-C++-*- -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2015 Oslo and Akershus University College of Applied Sciences -// and Alfred Bratterud -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. #pragma once #ifndef API_SMP_HEADER @@ -24,27 +8,15 @@ #include #include -#ifndef SMP_MAX_CORES -# ifdef INCLUDEOS_SMP_ENABLE -# define SMP_MAX_CORES 32 -# else -# define SMP_MAX_CORES 1 -# endif -#endif - -#define SMP_ALIGN 64 +// access a container of T by current CPU id +#define PER_CPU(x) x.at(SMP::cpu_id()) -// access a std::array of T by current CPU id -#define PER_CPU(x) (per_cpu_help(x)) class SMP { public: using task_func = delegate; using done_func = delegate; - template - using Array = std::array; - // return the current CPU id static int cpu_id() noexcept; @@ -54,74 +26,72 @@ public: // Return the indices of all initialized CPU cores static const std::vector& active_cpus(); - static int active_cpus(int index){ - return active_cpus().at(index); - } - - // implement this function to execute something on all APs at init static void init_task(); - // execute @func on another CPU core - // call @done back on main CPU when task returns - // use signal() to broadcast work should begin - static void add_task(task_func func, done_func done, int cpu = 0); - static void add_task(task_func func, int cpu = 0); + // execute @task on another CPU core + // call @done back on main CPU after running task + // use signal() to broadcast when work should begin + static void add_task(task_func task, done_func done, int cpu = 0); + static void add_task(task_func task, int cpu = 0); // execute a function on the main cpu - static void add_bsp_task(done_func func); + static void add_bsp_task(done_func done); // call this to signal that tasks are queued up - // if cpu == 0, broadcast signal to all + // if cpu == 0, broadcast signal to all CPUs static void signal(int cpu = 0); static void signal_bsp(); - // trigger interrupt on specified CPU + // trigger single interrupt on specified CPU static void unicast(int cpu, uint8_t intr); - // broadcast-trigger interrupt on all waiting APs + // broadcast-trigger interrupt on all CPUs static void broadcast(uint8_t intr); - // a global spinlock to synchronize text output (and other things) + // a global spinlock to synchronize text output (primarily) static void global_lock() noexcept; static void global_unlock() noexcept; -}; - -//#define SMP_DEBUG 1 -// SMP serialized print helpers -#define SMP_ALWAYS_PRINT(fmt, ...) \ - SMP::global_lock(); \ - printf(fmt, ##__VA_ARGS__); \ - SMP::global_unlock(); + // during startup we can use this function to size up dynamic arrays + static size_t early_cpu_total() noexcept; +}; -#ifdef SMP_DEBUG -#define SMP_PRINT(fmt, ...) SMP_ALWAYS_PRINT(fmt, ##__VA_ARGS__) -#define CPULOG(X,...) SMP_PRINT("[C%i]" X,SMP::cpu_id(),##__VA_ARGS__) +inline int SMP::cpu_id() noexcept +{ + int cpuid; +#ifdef ARCH_x86_64 + asm("movl %%gs:(0x0), %0" : "=r" (cpuid)); +#elif defined(ARCH_i686) + asm("movl %%fs:(0x0), %0" : "=r" (cpuid)); #else -#define SMP_PRINT(fmt, ...) /** fmt **/ -#define CPULOG(X,...) ; + #error "Implement me?" #endif + return cpuid; +} #include -#ifdef INCLUDEOS_SMP_ENABLE - template - inline T& per_cpu_help(std::array& array) - { - unsigned cpuid; -# ifdef ARCH_x86_64 - asm("movl %%gs:(0x0), %0" : "=r" (cpuid)); -# elif defined(ARCH_i686) - asm("movl %%fs:(0x0), %0" : "=r" (cpuid)); -# else - #error "Implement me?" -# endif - return array.at(cpuid); - } -#else - template - inline T& per_cpu_help(std::array& array) - { - return array[0]; - } -#endif +template +inline T& per_cpu_help(std::array& array) +{ + return array.at(SMP::cpu_id()); +} + +#include +namespace kernel { + extern Fixed_vector, 64> smp_global_init; +} +#define SMP_RESIZE_GCTOR(x) \ + static struct smp_gctor_##x { \ + smp_gctor_##x() { \ + kernel::smp_global_init.push_back( \ + [] () { \ + x.resize(SMP::early_cpu_total()); \ + }); \ + } \ + } smp_gctor_##x_instance; + + +#define SMP_ALIGN 64 +#define SMP_MAX_CORES 256 + #endif diff --git a/api/smp_utils b/api/smp_utils index 65d489b3c1..b27a5a442e 100644 --- a/api/smp_utils +++ b/api/smp_utils @@ -1,77 +1,33 @@ // -*-C++-*- -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2015 Oslo and Akershus University College of Applied Sciences -// and Alfred Bratterud -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. #pragma once #ifndef API_SMP_UTILS_HEADER #define API_SMP_UTILS_HEADER -#include - -/// x86-related locking stuff /// -#if defined(ARCH_x86) // Intel 3a 8.10.6.7: 128-byte boundary typedef unsigned int spinlock_t __attribute__((aligned(128))); -#ifdef INCLUDEOS_SMP_ENABLE -inline void lock(spinlock_t& lock) { - while (!__sync_bool_compare_and_swap(&lock, 0, 1)) { - while (lock) asm("pause"); - } -} -inline void unlock(spinlock_t& lock) { - __sync_lock_release(&lock, 0); // barrier -} -#else -inline void lock(spinlock_t&) {} -inline void unlock(spinlock_t&) {} -#endif - -struct scoped_spinlock +struct smp_spinlock { - scoped_spinlock(spinlock_t& ref) noexcept : spinlock(ref) { - //asm("" : : : "memory"); - lock(this->spinlock); - } - ~scoped_spinlock() noexcept { - unlock(spinlock); // barrier - } + void lock(); + void unlock(); + private: - spinlock_t& spinlock; + volatile spinlock_t m_value = 0; }; -struct minimal_barrier_t +struct smp_barrier { - void inc() + void increment() noexcept { __sync_fetch_and_add(&val, 1); } - void spin_wait(int max) - { - asm("mfence"); - while (this->val < max) { - asm("pause; nop;"); - } - } + void spin_wait(int max) noexcept; - void reset(int val) + void reset(int val = 0) noexcept { - asm volatile("mfence"); + __sync_synchronize(); this->val = val; } @@ -79,6 +35,4 @@ private: volatile int val = 0; }; -#endif // arch - #endif // hdr diff --git a/api/statman b/api/statman index 3c9b7dfbe8..04c07dcaff 100644 --- a/api/statman +++ b/api/statman @@ -1,20 +1,4 @@ // -*-C++-*- -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2015 Oslo and Akershus University College of Applied Sciences -// and Alfred Bratterud -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. #ifndef ___API_STATMAN___ #define ___API_STATMAN___ diff --git a/api/syslogd b/api/syslogd index a47335095e..9706e7d563 100644 --- a/api/syslogd +++ b/api/syslogd @@ -1,20 +1,4 @@ // -*-C++-*- -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2015 Oslo and Akershus University College of Applied Sciences -// and Alfred Bratterud -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. #ifndef ___API_SYSLOGD___ #define ___API_SYSLOGD___ diff --git a/api/system_log b/api/system_log index 340177b160..32770e1ad4 100644 --- a/api/system_log +++ b/api/system_log @@ -1,19 +1,4 @@ // -*- C++ -*- -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2018 IncludeOS AS, Oslo, Norway -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. #pragma once diff --git a/api/tar b/api/tar index 85dce43370..d896b192b9 100644 --- a/api/tar +++ b/api/tar @@ -1,20 +1,4 @@ // -*-C++-*- -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2015 Oslo and Akershus University College of Applied Sciences -// and Alfred Bratterud -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. #ifndef ___API_TAR___ #define ___API_TAR___ diff --git a/api/terminal b/api/terminal index cd34882c11..f1f059146d 100644 --- a/api/terminal +++ b/api/terminal @@ -1,20 +1,4 @@ // -*-C++-*- -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2015 Oslo and Akershus University College of Applied Sciences -// and Alfred Bratterud -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. #pragma once #ifndef API_TERMINAL_HEADER diff --git a/api/timers b/api/timers index bf75948141..a3c62b693e 100644 --- a/api/timers +++ b/api/timers @@ -1,20 +1,6 @@ // -*-C++-*- -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2015 Oslo and Akershus University College of Applied Sciences -// and Alfred Bratterud -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at // -// http://www.apache.org/licenses/LICENSE-2.0 // -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. #pragma once #ifndef API_TIMERS_HEADER diff --git a/api/uri b/api/uri index d69f880540..63928d3c7b 100644 --- a/api/uri +++ b/api/uri @@ -1,20 +1,4 @@ // -*- C++ -*- -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2015-2016 Oslo and Akershus University College of Applied Sciences -// and Alfred Bratterud -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. #pragma once #ifndef ___URI_API___ diff --git a/api/util/alloc_buddy.hpp b/api/util/alloc_buddy.hpp index 509c6b4c97..5a46afb4b4 100644 --- a/api/util/alloc_buddy.hpp +++ b/api/util/alloc_buddy.hpp @@ -1,19 +1,4 @@ -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2018 IncludeOS AS, Oslo, Norway -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. #ifndef UTIL_ALLOC_BUDDY_HPP #define UTIL_ALLOC_BUDDY_HPP @@ -28,9 +13,7 @@ #include #include -// // Tree node flags -// namespace os::mem::buddy { enum class Flags : uint8_t { diff --git a/api/util/alloc_lstack.hpp b/api/util/alloc_lstack.hpp index 828acdf58f..8e84d1ae3e 100644 --- a/api/util/alloc_lstack.hpp +++ b/api/util/alloc_lstack.hpp @@ -1,18 +1,3 @@ -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2018 IncludeOS AS, Oslo, Norway -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. #ifndef UTIL_MINIALLOC_HPP #define UTIL_MINIALLOC_HPP diff --git a/api/util/alloc_pmr.hpp b/api/util/alloc_pmr.hpp index ac0da1ce2a..0afa49db94 100644 --- a/api/util/alloc_pmr.hpp +++ b/api/util/alloc_pmr.hpp @@ -1,18 +1,3 @@ -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2018 IncludeOS AS, Oslo, Norway -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. #ifndef UTIL_ALLOC_PMR #define UTIL_ALLOC_PMR diff --git a/api/util/allocator.hpp b/api/util/allocator.hpp index 043079f8e8..17674dfe24 100644 --- a/api/util/allocator.hpp +++ b/api/util/allocator.hpp @@ -1,19 +1,4 @@ // -*- C++ -*- -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2018 IncludeOS AS, Oslo, Norway -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. #ifndef OS_ALLOCATOR_HPP #define OS_ALLOCATOR_HPP diff --git a/api/util/async.hpp b/api/util/async.hpp index 46c1b8e52e..71d35297d5 100644 --- a/api/util/async.hpp +++ b/api/util/async.hpp @@ -1,19 +1,3 @@ -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2015 Oslo and Akershus University College of Applied Sciences -// and Alfred Bratterud -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. #pragma once #ifndef UTIL_ASYNC_HPP diff --git a/api/util/autoconf.hpp b/api/util/autoconf.hpp index 21234c2842..fa2533114c 100644 --- a/api/util/autoconf.hpp +++ b/api/util/autoconf.hpp @@ -1,19 +1,3 @@ -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2017 Oslo and Akershus University College of Applied Sciences -// and Alfred Bratterud -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. #pragma once #ifndef UTIL_AUTOCONF_HPP diff --git a/api/util/base64.hpp b/api/util/base64.hpp index d7db141896..62a3fb0dd1 100644 --- a/api/util/base64.hpp +++ b/api/util/base64.hpp @@ -1,19 +1,3 @@ -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2017 Oslo and Akershus University College of Applied Sciences -// and Alfred Bratterud -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. #pragma once #ifndef UTIL_BASE64_HPP @@ -26,14 +10,10 @@ #include #include -// // This module consist of functions for the Base64 encoding scheme -// // The implementation supports the RFC specified at: // http://www.ietf.org/rfc/rfc4648.txt -// // NOTE: Currently the codec don't support MIME's -// namespace base64 { /** diff --git a/api/util/bitops.hpp b/api/util/bitops.hpp index 59e51a716c..a9a62a9c2c 100644 --- a/api/util/bitops.hpp +++ b/api/util/bitops.hpp @@ -1,20 +1,4 @@ // -*- C++ -*- -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2017 Oslo and Akershus University College of Applied Sciences -// and Alfred Bratterud -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. #ifndef UTIL_BITOPS_HPP #define UTIL_BITOPS_HPP @@ -25,9 +9,7 @@ namespace util { inline namespace bitops { -// // Enabling bitmask ops for enum class etc. -// template struct enable_bitmask_ops{ @@ -110,9 +92,7 @@ struct enable_bitmask_ops { namespace bits { -// // Various bit operations -// // Number of bits per word constexpr int bitcnt() { return sizeof(uintptr_t) * 8; } diff --git a/api/util/config.hpp b/api/util/config.hpp index 16989a095b..f1a3bd660a 100644 --- a/api/util/config.hpp +++ b/api/util/config.hpp @@ -1,19 +1,3 @@ -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2017 Oslo and Akershus University College of Applied Sciences -// and Alfred Bratterud -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. #pragma once #ifndef UTIL_CONFIG_HPP diff --git a/api/util/crc32.hpp b/api/util/crc32.hpp index 6fbb30cdef..34246e2f0d 100644 --- a/api/util/crc32.hpp +++ b/api/util/crc32.hpp @@ -1,19 +1,3 @@ -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2015 Oslo and Akershus University College of Applied Sciences -// and Alfred Bratterud -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. #pragma once #ifndef UTIL_CRC32_HPP diff --git a/api/util/crc64.hpp b/api/util/crc64.hpp index af19778f9b..bb24888744 100644 --- a/api/util/crc64.hpp +++ b/api/util/crc64.hpp @@ -1,19 +1,4 @@ -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2017 Oslo and Akershus University College of Applied Sciences -// and Alfred Bratterud -// // Licensed under the Apache License, Version 2.0 the "License"; -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. #pragma once #ifndef UTIL_CRC64_HPP diff --git a/api/util/delegate.hpp b/api/util/delegate.hpp index 4dc1795f86..610d7fbca9 100644 --- a/api/util/delegate.hpp +++ b/api/util/delegate.hpp @@ -1,19 +1,3 @@ -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2015-2016 Oslo and Akershus University College of Applied Sciences -// and Alfred Bratterud -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. #ifndef DELEGATE_HPP_INCLUDED #define DELEGATE_HPP_INCLUDED diff --git a/api/util/detail/alloc_pmr.hpp b/api/util/detail/alloc_pmr.hpp index 5489eaa844..b8ca303226 100644 --- a/api/util/detail/alloc_pmr.hpp +++ b/api/util/detail/alloc_pmr.hpp @@ -1,18 +1,3 @@ -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2018 IncludeOS AS, Oslo, Norway -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. #ifndef UTIL_DETAIL_ALLOC_PMR #define UTIL_DETAIL_ALLOC_PMR diff --git a/api/util/detail/string_view b/api/util/detail/string_view index 2659d24cf1..6efbbaf0fd 100644 --- a/api/util/detail/string_view +++ b/api/util/detail/string_view @@ -1,20 +1,4 @@ // -*- C++ -*- -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2017 Oslo and Akershus University College of Applied Sciences -// and Alfred Bratterud -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. #pragma once #ifndef UTIL_STRING_VIEW_HPP diff --git a/api/util/elf_binary.hpp b/api/util/elf_binary.hpp index 7f452a5d00..fedee4444b 100644 --- a/api/util/elf_binary.hpp +++ b/api/util/elf_binary.hpp @@ -1,19 +1,3 @@ -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2015 Oslo and Akershus University College of Applied Sciences -// and Alfred Bratterud -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. #ifndef ELF_BINARY_HPP #define ELF_BINARY_HPP diff --git a/api/util/elf_binary.inc b/api/util/elf_binary.inc index 079ed1e664..038514cad5 100644 --- a/api/util/elf_binary.inc +++ b/api/util/elf_binary.inc @@ -1,20 +1,4 @@ // -*-C++-*- -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2015-2017 Oslo and Akershus University College of Applied Sciences -// and Alfred Bratterud -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. #include diff --git a/api/util/fixed_bitmap.hpp b/api/util/fixed_bitmap.hpp index 4e7cc7b199..6af978d5fd 100644 --- a/api/util/fixed_bitmap.hpp +++ b/api/util/fixed_bitmap.hpp @@ -1,19 +1,3 @@ -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2017 Oslo and Akershus University College of Applied Sciences -// and Alfred Bratterud -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. #pragma once #ifndef UTIL_FIXED_BITMAP_HPP diff --git a/api/util/fixed_list_alloc.hpp b/api/util/fixed_list_alloc.hpp index 6be4eb3b22..abdafc1364 100644 --- a/api/util/fixed_list_alloc.hpp +++ b/api/util/fixed_list_alloc.hpp @@ -1,19 +1,3 @@ -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2017 Oslo and Akershus University College of Applied Sciences -// and Alfred Bratterud -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. #pragma once #ifndef UTIL_FIXED_LIST_ALLOC_HPP diff --git a/api/util/fixed_queue.hpp b/api/util/fixed_queue.hpp index 28cfc3d819..717083dbf1 100644 --- a/api/util/fixed_queue.hpp +++ b/api/util/fixed_queue.hpp @@ -1,19 +1,3 @@ -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2015 Oslo and Akershus University College of Applied Sciences -// and Alfred Bratterud -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. #ifndef FIXEDQUEUE_H_INCLUDED #define FIXEDQUEUE_H_INCLUDED diff --git a/api/util/fixed_storage.hpp b/api/util/fixed_storage.hpp index 2524cc6e18..deb038029e 100644 --- a/api/util/fixed_storage.hpp +++ b/api/util/fixed_storage.hpp @@ -1,19 +1,3 @@ -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2017 Oslo and Akershus University College of Applied Sciences -// and Alfred Bratterud -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. #pragma once #ifndef UTIL_FIXED_STORAGE_HPP diff --git a/api/util/fixed_vector.hpp b/api/util/fixed_vector.hpp index 3508ac70e6..7285424551 100644 --- a/api/util/fixed_vector.hpp +++ b/api/util/fixed_vector.hpp @@ -1,19 +1,3 @@ -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2015 Oslo and Akershus University College of Applied Sciences -// and Alfred Bratterud -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. #pragma once #ifndef UTIL_FIXED_VECTOR_HPP diff --git a/api/util/isotime.hpp b/api/util/isotime.hpp index cd88c6e251..88c09c1d58 100644 --- a/api/util/isotime.hpp +++ b/api/util/isotime.hpp @@ -1,19 +1,3 @@ -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2017 Oslo and Akershus University College of Applied Sciences -// and Alfred Bratterud -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. #pragma once #ifndef UTIL_ISOTIME_HPP diff --git a/api/util/logger.hpp b/api/util/logger.hpp index b774845189..2bb7bffb9a 100644 --- a/api/util/logger.hpp +++ b/api/util/logger.hpp @@ -1,19 +1,3 @@ -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2015-2016 Oslo and Akershus University College of Applied Sciences -// and Alfred Bratterud -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. #pragma once #ifndef UTIL_LOGGER_HPP diff --git a/api/util/membitmap.hpp b/api/util/membitmap.hpp index a7ed71970f..325cfc5d12 100644 --- a/api/util/membitmap.hpp +++ b/api/util/membitmap.hpp @@ -1,19 +1,3 @@ -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2015 Oslo and Akershus University College of Applied Sciences -// and Alfred Bratterud -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. #pragma once #include @@ -35,7 +19,7 @@ class MemBitmap static const int CHUNK_SIZE = sizeof(word) * 8; MemBitmap() = default; - MemBitmap(void* location, index_t chunks) + MemBitmap(void* location, size_t chunks) : _chunks(chunks) { _data = (word*) location; diff --git a/api/util/memstream.h b/api/util/memstream.h index 28dad56352..4dfe53c46e 100644 --- a/api/util/memstream.h +++ b/api/util/memstream.h @@ -1,19 +1,5 @@ -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2015 Oslo and Akershus University College of Applied Sciences -// and Alfred Bratterud -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at // -// http://www.apache.org/licenses/LICENSE-2.0 // -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. #ifndef UTIL_MEMSTREAM_H #define UTIL_MEMSTREAM_H diff --git a/api/util/path_to_regex.hpp b/api/util/path_to_regex.hpp index 3b83e20d16..d1911ef726 100644 --- a/api/util/path_to_regex.hpp +++ b/api/util/path_to_regex.hpp @@ -1,19 +1,3 @@ -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2015-2016 Oslo and Akershus University College of Applied Sciences -// and Alfred Bratterud -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. // https://github.com/pillarjs/path-to-regexp/blob/master/index.js diff --git a/api/util/percent_encoding.hpp b/api/util/percent_encoding.hpp index b620659a34..858a04fc7e 100644 --- a/api/util/percent_encoding.hpp +++ b/api/util/percent_encoding.hpp @@ -1,19 +1,3 @@ -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2015-2016 Oslo and Akershus University College of Applied Sciences -// and Alfred Bratterud -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. /// diff --git a/api/util/ringbuffer.hpp b/api/util/ringbuffer.hpp index 27d1a47524..4724010fc3 100644 --- a/api/util/ringbuffer.hpp +++ b/api/util/ringbuffer.hpp @@ -1,19 +1,3 @@ -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2015 Oslo and Akershus University College of Applied Sciences -// and Alfred Bratterud -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. #ifndef UTIL_RINGBUFFER_HPP #define UTIL_RINGBUFFER_HPP diff --git a/api/util/signal.hpp b/api/util/signal.hpp index 05ff22ca50..3869ad27e3 100644 --- a/api/util/signal.hpp +++ b/api/util/signal.hpp @@ -1,19 +1,3 @@ -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2015 Oslo and Akershus University College of Applied Sciences -// and Alfred Bratterud -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. #ifndef UTIL_SIGNAL_HPP #define UTIL_SIGNAL_HPP diff --git a/api/util/statman.hpp b/api/util/statman.hpp index 5458a63722..a8e0af521d 100644 --- a/api/util/statman.hpp +++ b/api/util/statman.hpp @@ -1,19 +1,3 @@ -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2015-2017 Oslo and Akershus University College of Applied Sciences -// and Alfred Bratterud -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. #pragma once #ifndef UTIL_STATMAN_HPP @@ -154,9 +138,7 @@ class Statman { Statman(); private: std::deque m_stats; -#ifdef INCLUDEOS_SMP_ENABLE - mutable spinlock_t stlock = 0; -#endif + mutable smp_spinlock stlock; ssize_t find_free_stat() const noexcept; uint32_t& unused_stats(); diff --git a/api/util/syslog_facility.hpp b/api/util/syslog_facility.hpp index 8ba3ee758c..99120ed838 100644 --- a/api/util/syslog_facility.hpp +++ b/api/util/syslog_facility.hpp @@ -1,19 +1,3 @@ -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2015-2017 IncludeOS AS, Oslo, Norway -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - #pragma once #ifndef UTIL_SYSLOG_FACILITY_HPP #define UTIL_SYSLOG_FACILITY_HPP diff --git a/api/util/syslogd.hpp b/api/util/syslogd.hpp index fd3445bcad..fcc7ef8382 100644 --- a/api/util/syslogd.hpp +++ b/api/util/syslogd.hpp @@ -1,19 +1,3 @@ -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2015-2017 IncludeOS AS, Oslo, Norway -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - #pragma once #ifndef UTIL_SYSLOGD_HPP #define UTIL_SYSLOGD_HPP diff --git a/api/util/tar.hpp b/api/util/tar.hpp index 6a7adf48a6..cf29edc020 100644 --- a/api/util/tar.hpp +++ b/api/util/tar.hpp @@ -1,19 +1,3 @@ -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2015 Oslo and Akershus University College of Applied Sciences -// and Alfred Bratterud -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. #pragma once #ifndef TAR_HPP diff --git a/api/util/timer.hpp b/api/util/timer.hpp index 901d839e4b..d84977c2a3 100644 --- a/api/util/timer.hpp +++ b/api/util/timer.hpp @@ -1,19 +1,3 @@ -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2015-2016 Oslo and Akershus University College of Applied Sciences -// and Alfred Bratterud -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. #pragma once #ifndef UTIL_TIMER_HPP diff --git a/api/util/typename.hpp b/api/util/typename.hpp index 676f48ac76..b931ba50dd 100644 --- a/api/util/typename.hpp +++ b/api/util/typename.hpp @@ -1,19 +1,3 @@ -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2015 Oslo and Akershus University College of Applied Sciences -// and Alfred Bratterud -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. #include #include diff --git a/api/util/units.hpp b/api/util/units.hpp index d80a0405bc..f4f63f71c6 100644 --- a/api/util/units.hpp +++ b/api/util/units.hpp @@ -1,19 +1,4 @@ // -*-C++-*- -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2017 IncludeOS AS, Oslo, Norway -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. #pragma once #ifndef UTIL_UNITS_HPP diff --git a/api/util/uri.hpp b/api/util/uri.hpp index 1b0b7969f6..b9ee4aa83c 100644 --- a/api/util/uri.hpp +++ b/api/util/uri.hpp @@ -1,19 +1,3 @@ -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2015-2017 Oslo and Akershus University College of Applied Sciences -// and Alfred Bratterud -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. #pragma once #ifndef UTIL_URI_HPP diff --git a/api/vga b/api/vga index a73eea80d8..9c0901a6b0 100644 --- a/api/vga +++ b/api/vga @@ -1,20 +1,4 @@ // -*-C++-*- -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2015 Oslo and Akershus University College of Applied Sciences -// and Alfred Bratterud -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. #pragma once #ifndef VGA_HEADER diff --git a/api/virtio/virtio.hpp b/api/virtio/virtio.hpp index bfabed7a10..6eb382e876 100644 --- a/api/virtio/virtio.hpp +++ b/api/virtio/virtio.hpp @@ -1,19 +1,3 @@ -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2015 Oslo and Akershus University College of Applied Sciences -// and Alfred Bratterud -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. /** @note This virtio implementation was very much inspired by diff --git a/cmake/includeos.cmake b/cmake/includeos.cmake index 024fb479a9..7e2f2b0a9c 100644 --- a/cmake/includeos.cmake +++ b/cmake/includeos.cmake @@ -32,7 +32,7 @@ set(CMAKE_C_COMPILER_TARGET ${TRIPLE}) message(STATUS "Target triple ${TRIPLE}") -set(CAPABS "${CAPABS} -g -fstack-protector-strong") +set(CAPABS "${CAPABS} -g -fstack-protector-strong -ffunction-sections -fdata-sections") # Various global defines # * NO_DEBUG disables output from the debug macro diff --git a/cmake/os.cmake b/cmake/os.cmake index 597c99522a..a254b3cfde 100644 --- a/cmake/os.cmake +++ b/cmake/os.cmake @@ -5,6 +5,17 @@ endif() set (CMAKE_CXX_STANDARD 17) set (CMAKE_CXX_STANDARD_REQUIRED ON) +option(MINIMAL "Minimal build" OFF) +if (MINIMAL) + set(STRIP_CMD strip --strip-all) +else() + set(STRIP_CMD true) +endif() +option(ELF_SYMBOLS "Enable full backtrace" ON) +option(PROFILE "Compile with startup profilers" OFF) + +set(LIVEUPDATE_MB 0 CACHE STRING "Liveupdate size in MB") + find_program(PYTHON3_EXECUTABLE python3) if (PYTHON3_EXECUTABLE-NOTFOUND) message(FATAL_ERROR "python3 not found") @@ -37,8 +48,6 @@ endif() set(NAME_STUB "${CONAN_INCLUDEOS_ROOT}/src/service_name.cpp") -set(CRTN ${CONAN_LIB_DIRS_MUSL}/crtn.o) -set(CRTI ${CONAN_LIB_DIRS_MUSL}/crti.o) set(TRIPLE "${ARCH}-pc-linux-elf") @@ -100,16 +109,16 @@ endif() # linker stuff set(CMAKE_SHARED_LIBRARY_LINK_CXX_FLAGS) # this removed -rdynamic from linker output if (CMAKE_BUILD_TYPE STREQUAL "Debug") - set(CMAKE_CXX_LINK_EXECUTABLE " -o ${CRTI} --start-group --end-group ${CRTN}") + set(CMAKE_CXX_LINK_EXECUTABLE " -o --start-group --end-group") else() - set(CMAKE_CXX_LINK_EXECUTABLE " -S -o ${CRTI} --start-group --end-group ${CRTN}") + set(CMAKE_CXX_LINK_EXECUTABLE " -S -o --start-group --end-group") endif() set(CMAKE_SKIP_RPATH ON) set(BUILD_SHARED_LIBRARIES OFF) set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -static") -option(FOR_PRODUCTION "Stop the OS when conditions not suitable for production" ON) +option(FOR_PRODUCTION "Stop the OS when conditions not suitable for production" OFF) if (FOR_PRODUCTION) set(PROD_USE "--defsym __for_production_use=0x2000") else() @@ -117,10 +126,12 @@ else() endif() # TODO: find a more proper way to get the linker.ld script ? +set(LD_COMMON "-nostdlib --eh-frame-hdr ${LD_STRIP} --script=${LINK_SCRIPT} ${PROD_USE}") +set(LD_COMMON "${LD_COMMON} --gc-sections") if("${ARCH}" STREQUAL "aarch64") - set(LDFLAGS "-nostdlib -m${ELF}elf --eh-frame-hdr ${LD_STRIP} --script=${LINK_SCRIPT} ${PROD_USE} ${PRE_BSS_SIZE}") + set(LDFLAGS "-m${ELF}elf ${LD_COMMON}") else() - set(LDFLAGS "-nostdlib -melf_${ELF} --eh-frame-hdr ${LD_STRIP} --script=${LINK_SCRIPT} ${PROD_USE} ${PRE_BSS_SIZE}") + set(LDFLAGS "-melf_${ELF} ${LD_COMMON} ${PRE_BSS_SIZE}") endif() set(ELF_POSTFIX .elf.bin) @@ -139,7 +150,21 @@ endfunction() function(os_add_executable TARGET NAME) set(ELF_TARGET ${TARGET}${ELF_POSTFIX}) add_executable(${ELF_TARGET} ${ARGN} ${NAME_STUB}) - set_property(SOURCE ${NAME_STUB} PROPERTY COMPILE_DEFINITIONS SERVICE="${TARGET}" SERVICE_NAME="${NAME}") + set_property(SOURCE ${NAME_STUB} PROPERTY COMPILE_DEFINITIONS + SERVICE="${TARGET}" SERVICE_NAME="${NAME}" + _LIVEUPDATE_MEMSIZE_=${LIVEUPDATE_MB}) + + target_compile_options(${ELF_TARGET} PRIVATE -Wall -Wextra -fstack-protector) + target_compile_options(${ELF_TARGET} PRIVATE -ffunction-sections -fdata-sections) + if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang") + target_compile_options(${ELF_TARGET} PRIVATE $<$:-nostdlib -nostdlibinc>) + else() + target_compile_options(${ELF_TARGET} PRIVATE $<$:-nostdlib -nostdinc>) + endif() + + if (PROFILE) + target_compile_definitions(${ELF_TARGET} PRIVATE ENABLE_PROFILERS=1) + endif() set_target_properties(${ELF_TARGET} PROPERTIES LINK_FLAGS ${LDFLAGS}) conan_find_libraries_abs_path("${CONAN_LIBS}" "${CONAN_LIB_DIRS}" LIBRARIES) @@ -156,22 +181,31 @@ function(os_add_executable TARGET NAME) # TODO: if not debug strip if (CMAKE_BUILD_TYPE STREQUAL "Debug") - set(STRIP_LV ) + set(LD_STRIP ) else() - set(STRIP_LV ${CMAKE_STRIP} --strip-all ${CMAKE_CURRENT_BINARY_DIR}/${TARGET}) + set(LD_STRIP --strip-debug) endif() FILE(WRITE ${CMAKE_CURRENT_BINARY_DIR}/binary.txt "${TARGET}" ) - add_custom_target( - ${TARGET} ALL - COMMENT "elf.syms" - COMMAND ${ELF_SYMS} $ - COMMAND ${CMAKE_OBJCOPY} --update-section .elf_symbols=_elf_symbols.bin $ ${CMAKE_CURRENT_BINARY_DIR}/${TARGET} - COMMAND ${STRIP_LV} - COMMAND mv bin/${ELF_TARGET} bin/${ELF_TARGET}.copy - DEPENDS ${ELF_TARGET} - ) + if (ELF_SYMBOLS) + add_custom_target( + ${TARGET} ALL + COMMENT "elf.syms" + COMMAND ${ELF_SYMS} $ + COMMAND ${CMAKE_OBJCOPY} --update-section .elf_symbols=_elf_symbols.bin $ ${CMAKE_CURRENT_BINARY_DIR}/${TARGET} + COMMAND ${STRIP_CMD} ${CMAKE_CURRENT_BINARY_DIR}/${TARGET} + COMMAND mv bin/${ELF_TARGET} bin/${ELF_TARGET}.copy + DEPENDS ${ELF_TARGET} + ) + else() + add_custom_target( + ${TARGET} ALL + COMMAND cp bin/${ELF_TARGET} ${CMAKE_CURRENT_BINARY_DIR}/${TARGET} + COMMAND ${STRIP_CMD} ${CMAKE_CURRENT_BINARY_DIR}/${TARGET} + DEPENDS ${ELF_TARGET} + ) + endif() if (DEFINED JSON_CONFIG_FILE_${ELF_TARGET}) message(STATUS "using set config file ${JSON_CONFIG_FILE_${ELF_TARGET}}") diff --git a/lib/LiveUpdate/CMakeLists.txt b/lib/LiveUpdate/CMakeLists.txt index 7ae600dde3..15d14e5c26 100644 --- a/lib/LiveUpdate/CMakeLists.txt +++ b/lib/LiveUpdate/CMakeLists.txt @@ -1,13 +1,20 @@ cmake_minimum_required(VERSION 2.8.9) - set(CMAKE_TRY_COMPILE_TARGET_TYPE STATIC_LIBRARY) - project(includeos C CXX) set(CMAKE_CXX_STANDARD 17) set(CMAKE_CXX_STANDARD_REQUIRED ON) set(CMAKE_CXX_EXTENSIONS OFF) +option(PROFILE "Compile with startup profilers" OFF) +if (PROFILE) + add_definitions(-DENABLE_PROFILERS) +endif() + +if (NOT ARCH) + set(ARCH ${CMAKE_SYSTEM_PROCESSOR}) +endif() + if (NOT CMAKE_TESTING_ENABLED) if (EXISTS ${CMAKE_CURRENT_BINARY_DIR}/conanbuildinfo.cmake) include(${CMAKE_CURRENT_BINARY_DIR}/conanbuildinfo.cmake) @@ -41,12 +48,6 @@ include_directories( ../../src/include ) - - -if (NOT ARCH) - set(ARCH CMAKE_SYSTEM_PROCESSOR) -endif() - #do we need all of this*? add_definitions(-DARCH_${ARCH}) add_definitions(-DARCH="${ARCH}") @@ -92,6 +93,9 @@ if (NOT CMAKE_TESTING_ENABLED) add_dependencies(liveupdate hotswap64) endif() set_target_properties(liveupdate PROPERTIES PUBLIC_HEADER "include/liveupdate;include/liveupdate.hpp") +target_compile_options(liveupdate PRIVATE $<$:-nostdlib -nostdlibinc>) +target_compile_options(liveupdate PRIVATE $<$:-Wall -Wextra -fstack-protector>) +target_compile_options(liveupdate PRIVATE $<$:-ffunction-sections -fdata-sections>) INSTALL(TARGETS liveupdate ARCHIVE DESTINATION lib diff --git a/lib/LiveUpdate/include/hotswap.hpp b/lib/LiveUpdate/include/hotswap.hpp new file mode 100644 index 0000000000..7a5dc6d223 --- /dev/null +++ b/lib/LiveUpdate/include/hotswap.hpp @@ -0,0 +1,15 @@ +/** + * Master thesis + * by Alf-Andre Walla 2016-2017 + * +**/ +#ifdef PLATFORM_x86_solo5 +extern "C" void solo5_exec(const char*, size_t); +#else +static void* HOTSWAP_AREA = (void*) 0x8000; +extern "C" void hotswap(char*, const uint8_t*, int, void*, void*); +extern "C" char __hotswap_length; +extern "C" void hotswap64(char*, const uint8_t*, int, uint32_t, void*, void*); +extern uint32_t hotswap64_len; +extern void __x86_init_paging(void*); +#endif diff --git a/lib/LiveUpdate/include/liveupdate b/lib/LiveUpdate/include/liveupdate index f2064ad7f1..bf24af5046 100644 --- a/lib/LiveUpdate/include/liveupdate +++ b/lib/LiveUpdate/include/liveupdate @@ -1,19 +1,4 @@ //-*- C++ -*- -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2017 IncludeOS AS, Oslo, Norway -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. /** * Master thesis * by Alf-Andre Walla 2016-2017 diff --git a/lib/LiveUpdate/include/liveupdate.hpp b/lib/LiveUpdate/include/liveupdate.hpp index b3d5bb971e..3cca32b6af 100644 --- a/lib/LiveUpdate/include/liveupdate.hpp +++ b/lib/LiveUpdate/include/liveupdate.hpp @@ -1,18 +1,3 @@ -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2017 IncludeOS AS, Oslo, Norway -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. /** * Master thesis * by Alf-Andre Walla 2016-2017 @@ -34,11 +19,12 @@ namespace liu { struct Storage; struct Restore; -typedef std::vector buffer_t; +using buffer_t = std::vector; +using location_t = std::pair; /** * The beginning and the end of the LiveUpdate process is the exec() and resume() functions. - * exec() is called with a provided fixed memory location for where to store all serialized data, + * exec() is called with a provided binary blob that is the new executable code to live update to, * and after an update is_resumable, with the same fixed memory location, will return true. * resume() can then be called with this same location, and it will call handlers for each @id it finds, * unless no such handler is registered, in which case it just calls the default handler which is passed @@ -46,9 +32,8 @@ typedef std::vector buffer_t; **/ struct LiveUpdate { - // The buffer_t parameter is the update blob (the new kernel) and can be null. - // If the parameter is null, you can assume that it's currently not a live update. - typedef delegate storage_func; + static constexpr location_t default_location { nullptr, 0 }; + typedef delegate storage_func; typedef delegate resume_func; // Register a function to be called when serialization phase begins @@ -58,10 +43,12 @@ struct LiveUpdate // Start a live update process, storing all user-defined data // If no storage functions are registered no state will be saved - // If @storage_area is nullptr (default) it will be retrieved from OS - static void exec(const buffer_t& blob, void* storage_area = nullptr); + // The default storage area is managed by the OS and is recommended + static void exec(const uint8_t* blob, size_t size, location_t = default_location); // Same as above, but including the partition [@key, func] - static void exec(const buffer_t& blob, std::string key, storage_func func); + static void exec(const uint8_t* blob, size_t size, std::string key, storage_func func, location_t = default_location); + // Same as above, but using buffer_t& instead of pointer, length + static void exec(const buffer_t& blob, std::string key, storage_func func, location_t = default_location); // In the event that LiveUpdate::exec() fails, // call this function in the C++ exception catch scope: @@ -69,30 +56,33 @@ struct LiveUpdate // Only store user data, as if there was a live update process // Throws exception if process or sanity checks fail - static buffer_t store(); + static size_t store(location_t = default_location); + + // Returns the location and size of the executable during exec() + // To be used from inside the store callbacks to optionally save the binary + static std::pair binary_blob() noexcept; // Returns true if there is stored data from before. // It performs an extensive validation process to make sure the data is // complete and consistent - static bool is_resumable(); - static bool is_resumable(const void* location); + static bool is_resumable(const location_t = default_location); // Restore existing state for a partition named @key. // Returns false if there was no such partition // Can throw lots of standard exceptions - static bool resume(std::string key, resume_func handler); + static bool resume(std::string key, resume_func handler, location_t = default_location); + + // When explicitly resuming from heap, heap overrun checks are disabled + static void resume_from_heap(std::string key, resume_func, location_t); // Check whether a partition named @key exists at default update location. // When @storage_area is nullptr (default) the area is retrieved from OS - static bool partition_exists(const std::string& key, const void* storage_area = nullptr) noexcept; - - // When explicitly resuming from heap, heap overrun checks are disabled - static void resume_from_heap(void* location, std::string key, resume_func); + static bool partition_exists(const std::string& key, location_t = default_location) noexcept; // Retrieve the recorded length, in bytes, of a valid storage area // Throws std::runtime_error when something bad happens // Never returns zero - static size_t stored_data_length(const void* storage_area = nullptr); + static size_t stored_data_length(location_t); // Set location of known good blob to rollback to if something happens static void set_rollback_blob(const void*, size_t) noexcept; @@ -104,6 +94,10 @@ struct LiveUpdate static void rollback_now(const char* reason); // Returns if the state in the OS has been set to being "liveupdated" static bool os_is_liveupdated() noexcept; + + // Enable/disable extra checksumming + // Note that internal headers are always checked + void enable_extra_checks(bool en) noexcept; }; //////////////////////////////////////////////////////////////////////////////// @@ -275,6 +269,14 @@ class liveupdate_exec_success : public std::exception } }; +class liveupdate_end_reached : public std::exception +{ +public: + const char* what() const throw() { + return "LiveUpdate: end of storage area reached"; + } +}; + } // liu #endif diff --git a/lib/LiveUpdate/include/storage.hpp b/lib/LiveUpdate/include/storage.hpp index f88c69ca95..73ae7e9ce6 100644 --- a/lib/LiveUpdate/include/storage.hpp +++ b/lib/LiveUpdate/include/storage.hpp @@ -1,18 +1,3 @@ -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2017 IncludeOS AS, Oslo, Norway -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. /** * Master thesis * by Alf-Andre Walla 2016-2017 @@ -113,8 +98,11 @@ struct storage_header uint32_t get_entries() const noexcept { return this->entries; } + uint32_t end_bytes() const noexcept { + return max_length - sizeof(storage_entry); + } - storage_header(); + storage_header(const size_t); int create_partition(std::string key); int find_partition(const char*) const; void finish_partition(int); @@ -123,7 +111,7 @@ struct storage_header void add_marker(uint16_t id); void add_int (uint16_t id, int value); void add_string(uint16_t id, const std::string& data); - void add_buffer(uint16_t id, const char*, int); + void add_buffer(uint16_t id, const void*, int); storage_entry& add_struct(int16_t type, uint16_t id, int length); storage_entry& add_struct(int16_t type, uint16_t id, construct_func); void add_vector(uint16_t, const void*, size_t cnt, size_t esize); @@ -139,6 +127,7 @@ struct storage_header inline storage_entry& var_entry(int16_t type, uint16_t id, construct_func func); + void end_reached(); void append_eof() noexcept { ((storage_entry*) &vla[length])->type = TYPE_END; } @@ -156,6 +145,7 @@ struct storage_header mutable uint32_t crc = 0; uint32_t entries = 0; uint32_t length = 0; + const uint32_t max_length; std::array ptable; uint32_t partitions = 0; char vla[0]; @@ -168,6 +158,10 @@ storage_header::create_entry(Args&&... args) // create entry auto* entry = (storage_entry*) &vla[length]; new (entry) storage_entry(args...); + // check that we dont start writing into nowhere-land + if (this->length + entry->size() > end_bytes()) { + this->end_reached(); + } // next storage_entry will be this much further out: this->length += entry->size(); this->entries++; @@ -184,6 +178,9 @@ storage_header::var_entry(int16_t type, uint16_t id, construct_func func) new (entry) storage_entry(type, id, 0); // determine and set size of entry entry->len = func(entry->vla); + if (this->length + entry->size() > end_bytes()) { + this->end_reached(); + } // next storage_entry will be this much further out: this->length += entry->size(); this->entries++; diff --git a/lib/LiveUpdate/src/elfscan.cpp b/lib/LiveUpdate/src/elfscan.cpp index b2f776501f..168c9e6362 100644 --- a/lib/LiveUpdate/src/elfscan.cpp +++ b/lib/LiveUpdate/src/elfscan.cpp @@ -1,18 +1,3 @@ -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2017 IncludeOS AS, Oslo, Norway -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. /** * Master thesis * by Alf-Andre Walla 2016-2017 diff --git a/lib/LiveUpdate/src/hotswap.cpp b/lib/LiveUpdate/src/hotswap.cpp index f42f14f0a1..7ea6e321c4 100644 --- a/lib/LiveUpdate/src/hotswap.cpp +++ b/lib/LiveUpdate/src/hotswap.cpp @@ -1,18 +1,3 @@ -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2017 IncludeOS AS, Oslo, Norway -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. /** * Master thesis * by Alf-Andre Walla 2016-2017 diff --git a/lib/LiveUpdate/src/hotswap64.asm b/lib/LiveUpdate/src/hotswap64.asm index c5174deea7..202c30a3ef 100644 --- a/lib/LiveUpdate/src/hotswap64.asm +++ b/lib/LiveUpdate/src/hotswap64.asm @@ -1,23 +1,5 @@ -;; This file is a part of the IncludeOS unikernel - www.includeos.org -;; -;; Copyright 2017 IncludeOS AS, Oslo, Norway -;; -;; Licensed under the Apache License, Version 2.0 (the "License"); -;; you may not use this file except in compliance with the License. -;; You may obtain a copy of the License at -;; -;; http:;;www.apache.org/licenses/LICENSE-2.0 -;; -;; Unless required by applicable law or agreed to in writing, software -;; distributed under the License is distributed on an "AS IS" BASIS, -;; WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -;; See the License for the specific language governing permissions and -;; limitations under the License. -; ; Master thesis ; by Alf-Andre Walla 2016-2017 -; -; ORG 0x8000 %define code32_segment 0x08 diff --git a/lib/LiveUpdate/src/hotswap64_blob.asm b/lib/LiveUpdate/src/hotswap64_blob.asm index c8ea656ad9..cd7a461469 100644 --- a/lib/LiveUpdate/src/hotswap64_blob.asm +++ b/lib/LiveUpdate/src/hotswap64_blob.asm @@ -1,18 +1,5 @@ -;; This file is a part of the IncludeOS unikernel - www.includeos.org -;; -;; Copyright 2017 IncludeOS AS, Oslo, Norway -;; -;; Licensed under the Apache License, Version 2.0 (the "License"); -;; you may not use this file except in compliance with the License. -;; You may obtain a copy of the License at -;; -;; http:;;www.apache.org/licenses/LICENSE-2.0 -;; -;; Unless required by applicable law or agreed to in writing, software -;; distributed under the License is distributed on an "AS IS" BASIS, -;; WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -;; See the License for the specific language governing permissions and -;; limitations under the License. +; Master thesis +; by Alf-Andre Walla 2016-2017 global hotswap64 global hotswap64_len diff --git a/lib/LiveUpdate/src/partition.cpp b/lib/LiveUpdate/src/partition.cpp index dd01ef57b9..78afa1f93d 100644 --- a/lib/LiveUpdate/src/partition.cpp +++ b/lib/LiveUpdate/src/partition.cpp @@ -1,18 +1,3 @@ -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2017 IncludeOS AS, Oslo, Norway -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. /** * Master thesis * by Alf-Andre Walla 2016-2017 @@ -22,7 +7,7 @@ #include #include #include -extern bool LIVEUPDATE_USE_CHEKSUMS; +extern bool LIVEUPDATE_EXTRA_CHECKS; inline uint32_t liu_crc32(const void* buf, size_t len) { @@ -54,7 +39,7 @@ int storage_header::find_partition(const char* key) const // the partition must have a valid name assert(part.name[0] != 0); // the partition should be fully consistent - if (LIVEUPDATE_USE_CHEKSUMS) { + if (LIVEUPDATE_EXTRA_CHECKS) { uint32_t chsum = part.generate_checksum(this->vla); if (part.crc != chsum) throw std::runtime_error("Invalid CRC in partition '" + std::string(key) + "'"); @@ -71,7 +56,7 @@ void storage_header::finish_partition(int p) // write length and crc auto& part = ptable.at(p); part.length = this->length - part.offset; - if (LIVEUPDATE_USE_CHEKSUMS) { + if (LIVEUPDATE_EXTRA_CHECKS) { part.crc = part.generate_checksum(this->vla); } else part.crc = 0; @@ -81,7 +66,7 @@ void storage_header::zero_partition(int p) auto& part = ptable.at(p); memset(&this->vla[part.offset], 0, part.length); part = {}; - if (LIVEUPDATE_USE_CHEKSUMS) { + if (LIVEUPDATE_EXTRA_CHECKS) { // NOTE: generate **NEW** checksum for header this->crc = generate_checksum(); } diff --git a/lib/LiveUpdate/src/resume.cpp b/lib/LiveUpdate/src/resume.cpp index b776fe6171..4b44cb85dd 100644 --- a/lib/LiveUpdate/src/resume.cpp +++ b/lib/LiveUpdate/src/resume.cpp @@ -1,18 +1,3 @@ -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2017 IncludeOS AS, Oslo, Norway -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. /** * Master thesis * by Alf-Andre Walla 2016-2017 @@ -22,6 +7,7 @@ #include #include +#include #include "storage.hpp" #include "serialize_tcp.hpp" #include @@ -33,20 +19,24 @@ namespace liu { static bool resume_begin(storage_header&, std::string, LiveUpdate::resume_func); -bool LiveUpdate::is_resumable() +static inline location_t resolve_default(location_t other) { - return is_resumable(kernel::liveupdate_storage_area()); + if (other.first == nullptr || other.second == 0) + return { kernel::liveupdate_storage_area(), kernel::liveupdate_storage_size() }; + return other; } -bool LiveUpdate::is_resumable(const void* location) + +bool LiveUpdate::is_resumable(const location_t provided) { - return ((const storage_header*) location)->validate(); + const auto location = resolve_default(provided); + return ((const storage_header*) location.first)->validate(); } bool LiveUpdate::os_is_liveupdated() noexcept { return kernel::state().is_live_updated; } -static bool resume_helper(void* location, std::string key, LiveUpdate::resume_func func) +static bool resume_helper(location_t location, std::string key, LiveUpdate::resume_func func) { // check if an update has occurred if (!LiveUpdate::is_resumable(location)) @@ -54,37 +44,38 @@ static bool resume_helper(void* location, std::string key, LiveUpdate::resume_fu LPRINT("* Restoring data...\n"); // restore connections etc. - return resume_begin(*(storage_header*) location, key.c_str(), func); + return resume_begin(*(storage_header*) location.first, key.c_str(), func); } -bool LiveUpdate::resume(std::string key, resume_func func) +bool LiveUpdate::resume(std::string key, resume_func func, location_t provided) { - void* location = kernel::liveupdate_storage_area(); + const auto location = resolve_default(provided); /// memory sanity check - if (kernel::heap_end() >= (uintptr_t) location) { + if (kernel::heap_end() >= (uintptr_t) location.first) { fprintf(stderr, "WARNING: LiveUpdate storage area inside heap (margin: %ld)\n", - (long int) (kernel::heap_end() - (uintptr_t) location)); + (long int) (kernel::heap_end() - (uintptr_t) location.first)); throw std::runtime_error("LiveUpdate::resume(): Storage area inside heap"); } return resume_helper(location, std::move(key), func); } -bool LiveUpdate::partition_exists(const std::string& key, const void* area) noexcept +void LiveUpdate::resume_from_heap(std::string key, LiveUpdate::resume_func func, location_t location) { - if (area == nullptr) area = kernel::liveupdate_storage_area(); + resume_helper(location, std::move(key), func); +} +bool LiveUpdate::partition_exists(const std::string& key, const location_t provided) noexcept +{ + const auto location = resolve_default(provided); - if (!LiveUpdate::is_resumable(area)) + if (!LiveUpdate::is_resumable(location)) return false; - auto& storage = *(const storage_header*) area; + auto& storage = *(const storage_header*) location.first; return (storage.find_partition(key.c_str()) != -1); } -void LiveUpdate::resume_from_heap(void* location, std::string key, LiveUpdate::resume_func func) -{ - resume_helper(location, std::move(key), func); -} bool resume_begin(storage_header& storage, std::string key, LiveUpdate::resume_func func) { + PROFILE("LiveUpdate: Resume partition"); if (key.empty()) throw std::length_error("LiveUpdate partition key cannot be an empty string"); @@ -96,7 +87,10 @@ bool resume_begin(storage_header& storage, std::string key, LiveUpdate::resume_f // resume wrapper Restore wrapper(storage.begin(p)); // use registered functions when we can, otherwise, use normal - func(wrapper); + { + PROFILE("LiveUpdate: Resume callback"); + func(wrapper); + } // wake all the slumbering IP stacks serialized_tcp::wakeup_ip_networks(); @@ -157,10 +151,9 @@ std::string Restore::as_string() const } buffer_t Restore::as_buffer() const { + PROFILE("LiveUpdate: Restore::as_buffer"); if (ent->type == TYPE_BUFFER) { - buffer_t buffer; - buffer.assign(ent->data(), ent->data() + ent->len); - return buffer; + return buffer_t{ent->data(), ent->data() + ent->len}; } throw std::runtime_error("LiveUpdate: Restore::as_buffer() encountered incorrect type " + std::to_string(ent->type)); } diff --git a/lib/LiveUpdate/src/rollback.cpp b/lib/LiveUpdate/src/rollback.cpp index a689b2fbff..855d5f77fb 100644 --- a/lib/LiveUpdate/src/rollback.cpp +++ b/lib/LiveUpdate/src/rollback.cpp @@ -1,18 +1,3 @@ -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2017 IncludeOS AS, Oslo, Norway -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. /** * Master thesis * by Alf-Andre Walla 2016-2017 @@ -25,8 +10,8 @@ extern uintptr_t heap_end; namespace liu { - static const char* rollback_data; - static size_t rollback_len; + static const uint8_t* rollback_data; + static size_t rollback_len; void LiveUpdate::rollback_now(const char* reason) { @@ -36,9 +21,8 @@ void LiveUpdate::rollback_now(const char* reason) rollback_data, (uint32_t) rollback_len, reason); try { - buffer_t vec(rollback_data, rollback_data + rollback_len); // run live update process - LiveUpdate::exec(vec); + LiveUpdate::exec(rollback_data, rollback_len); } catch (std::exception& err) { @@ -54,14 +38,14 @@ void LiveUpdate::rollback_now(const char* reason) __builtin_unreachable(); } -const std::pair get_rollback_location() +const std::pair get_rollback_location() { return {rollback_data, rollback_len}; } void LiveUpdate::set_rollback_blob(const void* buffer, size_t len) noexcept { - rollback_data = (const char*) buffer; + rollback_data = (const uint8_t*) buffer; rollback_len = len; os::on_panic(LiveUpdate::rollback_now); } @@ -75,7 +59,7 @@ bool LiveUpdate::has_rollback_blob() noexcept void softreset_service_handler(const void* opaque, size_t length) { // make deep copy? - auto* data = new char[length]; + auto* data = new uint8_t[length]; memcpy(data, opaque, length); liu::rollback_data = data; liu::rollback_len = length; diff --git a/lib/LiveUpdate/src/serialize_tcp.cpp b/lib/LiveUpdate/src/serialize_tcp.cpp index 47ab82692d..422c9426e9 100644 --- a/lib/LiveUpdate/src/serialize_tcp.cpp +++ b/lib/LiveUpdate/src/serialize_tcp.cpp @@ -1,18 +1,3 @@ -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2017 IncludeOS AS, Oslo, Norway -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. /** * Master thesis * by Alf-Andre Walla 2016-2017 diff --git a/lib/LiveUpdate/src/serialize_tcp.hpp b/lib/LiveUpdate/src/serialize_tcp.hpp index c7ce4b33fb..0ef348a616 100644 --- a/lib/LiveUpdate/src/serialize_tcp.hpp +++ b/lib/LiveUpdate/src/serialize_tcp.hpp @@ -1,18 +1,3 @@ -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2017 IncludeOS AS, Oslo, Norway -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. /** * Master thesis * by Alf-Andre Walla 2016-2017 diff --git a/lib/LiveUpdate/src/storage.cpp b/lib/LiveUpdate/src/storage.cpp index abb7fed443..f49247e7ba 100644 --- a/lib/LiveUpdate/src/storage.cpp +++ b/lib/LiveUpdate/src/storage.cpp @@ -1,31 +1,16 @@ -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2017 IncludeOS AS, Oslo, Norway -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. /** * Master thesis * by Alf-Andre Walla 2016-2017 * **/ #include "storage.hpp" +#include "liveupdate.hpp" #include #include #include #include #include //#define VERIFY_MEMORY -extern bool LIVEUPDATE_USE_CHEKSUMS; inline uint32_t liu_crc32(const void* buf, size_t len) { @@ -34,8 +19,8 @@ inline uint32_t liu_crc32(const void* buf, size_t len) const uint64_t storage_header::LIVEUPD_MAGIC = 0xbaadb33fdeadc0de; -storage_header::storage_header() - : magic(LIVEUPD_MAGIC) +storage_header::storage_header(const size_t maxlen) + : magic(LIVEUPD_MAGIC), max_length(maxlen) { //printf("%p --> %#llx\n", this, value); } @@ -59,13 +44,13 @@ void storage_header::add_string(uint16_t id, const std::string& data) assert(entry.checksum() == csum); #endif } -void storage_header::add_buffer(uint16_t id, const char* buffer, int length) +void storage_header::add_buffer(uint16_t id, const void* buffer, int length) { auto& entry = create_entry(TYPE_BUFFER, id, length); - memcpy(entry.vla, buffer, length); + memcpy(entry.vla, (const char*) buffer, length); #ifdef VERIFY_MEMORY /// verify memory - uint32_t csum = liu_crc32(buffer, length); + const uint32_t csum = liu_crc32(buffer, length); assert(entry.checksum() == csum); #endif } @@ -140,21 +125,21 @@ void storage_header::finalize() throw std::runtime_error("Magic field invalidated during store process"); // add end if missing if (this->length == 0) this->add_end(); - if (LIVEUPDATE_USE_CHEKSUMS) - // generate checksum for header - this->crc = generate_checksum(); - else - this->crc = 0; + // generate checksum for header + this->crc = generate_checksum(); } bool storage_header::validate() const noexcept { if (this->magic != LIVEUPD_MAGIC) return false; - if (LIVEUPDATE_USE_CHEKSUMS == false) return true; uint32_t chsum = generate_checksum(); if (this->crc != chsum) return false; return true; } +void storage_header::end_reached() +{ + throw liu::liveupdate_end_reached(); +} uint32_t storage_header::generate_checksum() const noexcept { @@ -180,8 +165,8 @@ void storage_header::try_zero() noexcept } void storage_header::zero() { - memset(this->vla, 0, this->length); - *this = {}; + //memset(this->vla, 0, this->length); + new (this) storage_header(0); this->magic = 0; } diff --git a/lib/LiveUpdate/src/update.cpp b/lib/LiveUpdate/src/update.cpp index 9407fb8654..ef5c992360 100644 --- a/lib/LiveUpdate/src/update.cpp +++ b/lib/LiveUpdate/src/update.cpp @@ -1,18 +1,3 @@ -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2017 IncludeOS AS, Oslo, Norway -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. /** * Master thesis * by Alf-Andre Walla 2016-2017 @@ -29,37 +14,34 @@ #include "storage.hpp" #include #include -#include #include // for flushing +#include -#define LPRINT(x, ...) printf(x, ##__VA_ARGS__); -//#define LPRINT(x, ...) /** x **/ +//#define LPRINT(x, ...) printf(x, ##__VA_ARGS__); +#define LPRINT(x, ...) /** x **/ static const int SECT_SIZE = 512; static const int ELF_MINIMUM = 164; // hotswapping functions -extern "C" void solo5_exec(const char*, size_t); -static void* HOTSWAP_AREA = (void*) 0x8000; -extern "C" void hotswap(char*, const char*, int, void*, void*); -extern "C" char __hotswap_length; -extern "C" void hotswap64(char*, const char*, int, uint32_t, void*, void*); -extern uint32_t hotswap64_len; -extern void __x86_init_paging(void*); +#include "hotswap.hpp" extern "C" void* __os_store_soft_reset(const void*, size_t); // kernel area -extern char _ELF_START_; -extern char _end; -// turn this off to reduce liveupdate times at the cost of extra checks -bool LIVEUPDATE_USE_CHEKSUMS = true; +extern uint8_t _ELF_START_; +extern uint8_t _end; +// the internal checksums cover the main storage header and all partition headers +// turning this on will checksum partition user data, which scales poorly +bool LIVEUPDATE_EXTRA_CHECKS = false; // turn this om to zero-initialize all memory between new kernel and heap end bool LIVEUPDATE_ZERO_OLD_MEMORY = false; using namespace liu; -static size_t update_store_data(void* location, const buffer_t*); +static size_t update_store_data(location_t location); // serialization callbacks static std::unordered_map storage_callbacks; +static const uint8_t* liveupdate_blob_data = nullptr; +static size_t liveupdate_blob_size = 0; void LiveUpdate::register_partition(std::string key, storage_func callback) { @@ -89,17 +71,29 @@ inline bool validate_header(const Class* hdr) hdr->e_ident[3] == 'F'; } -void LiveUpdate::exec(const buffer_t& blob, std::string key, storage_func func) +static inline location_t resolve_default(location_t other) +{ + if (other.first == nullptr || other.second == 0) + return { kernel::liveupdate_storage_area(), kernel::liveupdate_storage_size() }; + return other; +} + +void LiveUpdate::exec(const buffer_t& blob, std::string key, storage_func func, location_t location) +{ + if (func != nullptr) LiveUpdate::register_partition(key, func); + LiveUpdate::exec(blob.data(), blob.size(), location); +} +void LiveUpdate::exec(const uint8_t* blob, size_t size, std::string key, storage_func func, location_t location) { if (func != nullptr) LiveUpdate::register_partition(key, func); - LiveUpdate::exec(blob); + LiveUpdate::exec(blob, size, location); } -void LiveUpdate::exec(const buffer_t& blob, void* location) +void LiveUpdate::exec(const uint8_t* blob_data, size_t blob_size, location_t provided_location) { - if (location == nullptr) location = kernel::liveupdate_storage_area(); - LPRINT("LiveUpdate::begin(%p, %p:%d, ...)\n", location, blob.data(), (int) blob.size()); -#if defined(__includeos__) + auto location = resolve_default(provided_location); + LPRINT("LiveUpdate::begin(%p:%zu, %p:%zu, ...)\n", location.first, location.second, blob_data, blob_size); +#if defined(__includeos__) && defined(ARCH_x86) // 1. turn off interrupts asm volatile("cli"); #endif @@ -111,13 +105,13 @@ void LiveUpdate::exec(const buffer_t& blob, void* location) // blobs are separated by at least one old kernel size and // some early heap allocations, which is at least 1mb, while // the copy mechanism just copies single bytes. - if (blob.size() < ELF_MINIMUM) + if (blob_size < ELF_MINIMUM) throw std::runtime_error("Buffer too small to be valid ELF"); - const char* update_area = blob.data(); - char* storage_area = (char*) location; + const uint8_t* update_area = blob_data; + uint8_t* storage_area = (uint8_t*) location.first; // validate not overwriting heap, kernel area and other things - if (storage_area < (char*) 0x200) { + if (storage_area < (uint8_t*) 0x200) { throw std::runtime_error("LiveUpdate storage area is (probably) a null pointer"); } #if !defined(PLATFORM_UNITTEST) && !defined(USERSPACE_KERNEL) @@ -127,14 +121,14 @@ void LiveUpdate::exec(const buffer_t& blob, void* location) if (storage_area >= &_ELF_START_ && storage_area < &_end) { throw std::runtime_error("LiveUpdate storage area is inside kernel area"); } - if (storage_area >= (char*) kernel::heap_begin() && storage_area < (char*) kernel::heap_end()) { + if (storage_area >= (uint8_t*) kernel::heap_begin() && storage_area < (uint8_t*) kernel::heap_end()) { throw std::runtime_error("LiveUpdate storage area is inside the heap area"); } #endif // search for ELF header LPRINT("* Looking for ELF header at %p\n", update_area); - const char* binary = &update_area[0]; + const auto* binary = &update_area[0]; const auto* hdr = (const Elf32_Ehdr*) binary; if (!validate_header(hdr)) { @@ -157,12 +151,13 @@ void LiveUpdate::exec(const buffer_t& blob, void* location) extern void* find_kernel_start32(const Elf32_Ehdr* hdr); extern void* find_kernel_start64(const Elf64_Ehdr* hdr); - const char* bin_data = nullptr; + const uint8_t* bin_data = nullptr; int bin_len = 0; char* phys_base = nullptr; if (hdr->e_ident[EI_CLASS] == ELFCLASS32) { + PROFILE("LiveUpdate: Scan ELF32"); /// note: this assumes section headers are at the end expected_total = hdr->e_shnum * hdr->e_shentsize + @@ -175,10 +170,11 @@ void LiveUpdate::exec(const buffer_t& blob, void* location) // get offsets for the new service from program header auto* phdr = (Elf32_Phdr*) &binary[hdr->e_phoff]; bin_data = &binary[phdr->p_offset]; - bin_len = phdr->p_filesz; + bin_len = expected_total; phys_base = (char*) (uintptr_t) phdr->p_paddr; } else { + PROFILE("LiveUpdate: Scan ELF64"); auto* ehdr = (Elf64_Ehdr*) hdr; /// note: this assumes section headers are at the end expected_total = @@ -191,18 +187,18 @@ void LiveUpdate::exec(const buffer_t& blob, void* location) // get offsets for the new service from program header auto* phdr = (Elf64_Phdr*) &binary[ehdr->e_phoff]; bin_data = &binary[phdr->p_offset]; - bin_len = phdr->p_filesz; + bin_len = expected_total; phys_base = (char*) phdr->p_paddr; } - if (blob.size() < expected_total || expected_total < ELF_MINIMUM) + if (blob_size < expected_total || expected_total < ELF_MINIMUM) { fprintf(stderr, "*** There was a mismatch between blob length and expected ELF file size:\n"); fprintf(stderr, - "EXPECTED: %u byte\n", (uint32_t) expected_total); + "EXPECTED: %zu byte\n", expected_total); fprintf(stderr, - "ACTUAL: %u bytes\n", (uint32_t) blob.size()); + "ACTUAL: %zu bytes\n", blob_size); throw std::runtime_error("ELF file was incomplete"); } LPRINT("* Validated ELF header\n"); @@ -210,9 +206,16 @@ void LiveUpdate::exec(const buffer_t& blob, void* location) // _start() entry point LPRINT("* Kernel entry is located at %#x\n", start_offset); - // save ourselves if function passed - update_store_data(storage_area, &blob); + liveupdate_blob_data = blob_data; + liveupdate_blob_size = blob_size; + { + PROFILE("LiveUpdate: Store user data"); + // save ourselves if function passed + update_store_data(location); + } +{ + PROFILE("LiveUpdate: Deactivate devices"); #if !defined(PLATFORM_UNITTEST) && !defined(USERSPACE_KERNEL) // 2. flush all NICs for(auto& nic : os::machine().get()) @@ -223,18 +226,28 @@ void LiveUpdate::exec(const buffer_t& blob, void* location) #endif // turn off devices that affect memory __arch_system_deactivate(); +} // store soft-resetting stuff #if defined(__includeos__) + void* sr_data = nullptr; +{ + PROFILE("Soft-reset store") extern const std::pair get_rollback_location(); const auto rollback = get_rollback_location(); // we should store physical address of update location auto rb_phys = os::mem::virt_to_phys((uintptr_t) rollback.first); - void* sr_data = __os_store_soft_reset((void*) rb_phys, rollback.second); + sr_data = __os_store_soft_reset((void*) rb_phys, rollback.second); +} #else void* sr_data = nullptr; #endif +#ifdef ENABLE_PROFILERS + auto prof = ScopedProfiler::get_statistics(false); + printf("%s\n", prof.c_str()); +#endif + // get offsets for the new service from program header if (bin_data == nullptr || phys_base == nullptr || bin_len <= 64) { @@ -246,7 +259,7 @@ void LiveUpdate::exec(const buffer_t& blob, void* location) LPRINT("* Replacing self with %d bytes and jumping to %#x\n", bin_len, start_offset); #ifdef PLATFORM_x86_solo5 - solo5_exec(blob.data(), blob.size()); + solo5_exec(blob_data, blob_size); throw std::runtime_error("solo5_exec returned"); # elif defined(PLATFORM_UNITTEST) throw liveupdate_exec_success(); @@ -274,7 +287,7 @@ void LiveUpdate::exec(const buffer_t& blob, void* location) // copy hotswapping function to sweet spot memcpy(HOTSWAP_AREA, (void*) &hotswap, &__hotswap_length - (char*) &hotswap); /// the end - ((decltype(&hotswap)) HOTSWAP_AREA)(phys_base, bin_data, bin_len, (void*) start_offset, sr_data); + ((decltype(&hotswap)) HOTSWAP_AREA)(phys_base, bin_data, bin_len, (void*) (uintptr_t) start_offset, sr_data); } void LiveUpdate::restore_environment() { @@ -283,30 +296,41 @@ void LiveUpdate::restore_environment() asm volatile("sti"); #endif } -buffer_t LiveUpdate::store() +size_t LiveUpdate::store(location_t provided) { - char* location = (char*) kernel::liveupdate_storage_area(); - size_t size = update_store_data(location, nullptr); - return buffer_t(location, location + size); + auto location = resolve_default(provided); + const size_t size = update_store_data(location); + return size; } -size_t LiveUpdate::stored_data_length(const void* location) +size_t LiveUpdate::stored_data_length(location_t provided) { - if (location == nullptr) location = kernel::liveupdate_storage_area(); - auto* storage = (storage_header*) location; + auto location = resolve_default(provided); + const auto* storage = (storage_header*) location.first; if (storage->validate() == false) - throw std::runtime_error("Failed sanity check on LiveUpdate storage area"); + throw std::runtime_error("Failed validation of LiveUpdate storage area"); /// return length of the whole area return storage->total_bytes(); } -size_t update_store_data(void* location, const buffer_t* blob) +std::pair LiveUpdate::binary_blob() noexcept +{ + return {liveupdate_blob_data, liveupdate_blob_size}; +} + +void LiveUpdate::enable_extra_checks(bool en) noexcept +{ + LIVEUPDATE_EXTRA_CHECKS = en; + // TODO: also enable destination zeroing? +} + +size_t update_store_data(location_t location) { // create storage header in the fixed location - new (location) storage_header(); - auto* storage = (storage_header*) location; + new (location.first) storage_header(location.second); + auto* storage = (storage_header*) location.first; Storage wrapper(*storage); /// callback for storing stuff, if provided @@ -315,7 +339,7 @@ size_t update_store_data(void* location, const buffer_t* blob) // create partition int p = storage->create_partition(pair.first); // run serialization process - pair.second(wrapper, blob); + pair.second(wrapper); // add end for partition storage->finish_partition(p); } @@ -347,7 +371,7 @@ void Storage::add_buffer(uid id, const buffer_t& blob) } void Storage::add_buffer(uid id, const void* buf, size_t len) { - hdr.add_buffer(id, (const char*) buf, len); + hdr.add_buffer(id, buf, len); } void Storage::add_vector(uid id, const void* buf, size_t count, size_t esize) { diff --git a/remove.txt b/remove.txt new file mode 100644 index 0000000000..70130713fa --- /dev/null +++ b/remove.txt @@ -0,0 +1,61 @@ +// This file is a part of the IncludeOS unikernel - www.includeos.org +// +// Copyright 2015-2016 Oslo and Akershus University College of Applied Sciences +// Copyright 2015-2017 Oslo and Akershus University College of Applied Sciences +// Copyright 2015-2018 Oslo and Akershus University College of Applied Sciences +// Copyright 2016-2017 Oslo and Akershus University College of Applied Sciences +// Copyright 2016-2018 Oslo and Akershus University College of Applied Sciences +// Copyright 2018-2019 Oslo and Akershus University College of Applied Sciences +// Copyright 2015 Oslo and Akershus University College of Applied Sciences +// Copyright 2016 Oslo and Akershus University College of Applied Sciences +// Copyright 2017 Oslo and Akershus University College of Applied Sciences +// Copyright 2018 Oslo and Akershus University College of Applied Sciences +// and Alfred Bratterud +// Copyright 2017 IncludeOS AS, Oslo, Norway +// Copyright 2018 IncludeOS AS, Oslo, Norway +// Copyright 2015-2018 IncludeOS AS, Oslo, Norway +// Copyright 2017-2018 IncludeOS AS, Oslo, Norway +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +;; This file is a part of the IncludeOS unikernel - www.includeos.org +;; +;; Copyright 2015-2016 Oslo and Akershus University College of Applied Sciences +;; and Alfred Bratterud +;; +;; Licensed under the Apache License, Version 2.0 (the "License"); +;; you may not use this file except in compliance with the License. +;; You may obtain a copy of the License at +;; +;; http:;;www.apache.org/licenses/LICENSE-2.0 +;; +;; Unless required by applicable law or agreed to in writing, software +;; distributed under the License is distributed on an "AS IS" BASIS, +;; WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +;; See the License for the specific language governing permissions and +;; limitations under the License. +; This file is a part of the IncludeOS unikernel - www.includeos.org +; +; Copyright 2015 Oslo and Akershus University College of Applied Sciences +; and Alfred Bratterud +; +; Licensed under the Apache License, Version 2.0 (the "License"); +; you may not use this file except in compliance with the License. +; You may obtain a copy of the License at +; +; http://www.apache.org/licenses/LICENSE-2.0 +; +; Unless required by applicable law or agreed to in writing, software +; distributed under the License is distributed on an "AS IS" BASIS, +; WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +; See the License for the specific language governing permissions and +; limitations under the License. diff --git a/remove_licence.py b/remove_licence.py new file mode 100755 index 0000000000..d362b2e0bf --- /dev/null +++ b/remove_licence.py @@ -0,0 +1,17 @@ +#!/usr/bin/python +import sys +outfile = sys.argv[1] +print(outfile + " is being processed...") + +list = () +with open("remove.txt", "r") as f: + list = f.readlines() + + +with open(outfile, "r+") as f: + d = f.readlines() + f.seek(0) + for i in d: + if i not in list: + f.write(i) + f.truncate() diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 4d04b199c3..7e5a20601d 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -9,6 +9,9 @@ add_definitions(-DARCH="${ARCH}") if (SMP) add_definitions(-DINCLUDEOS_SMP_ENABLE) endif() +if (PROFILE) + add_definitions(-DENABLE_PROFILERS) +endif() include_directories( ${CMAKE_CURRENT_SOURCE_DIR}/../api diff --git a/src/arch/aarch64/CMakeLists.txt b/src/arch/aarch64/CMakeLists.txt index 4df69bf8b2..0ee1bb2cd1 100644 --- a/src/arch/aarch64/CMakeLists.txt +++ b/src/arch/aarch64/CMakeLists.txt @@ -3,13 +3,9 @@ ### aarch64 arch specific ### set(ARCH_OBJECTS -# gdt_asm.asm -# profile_intr.asm -# apic_asm.asm - arch_start.asm - exceptions.asm -# interrupts.asm -# fiber.asm + arch_start.asm + exceptions.asm + threads.asm ) set(ARCH_SOURCES paging.cpp diff --git a/src/arch/aarch64/arch_start.asm b/src/arch/aarch64/arch_start.asm index f585ff9161..2329775c8a 100644 --- a/src/arch/aarch64/arch_start.asm +++ b/src/arch/aarch64/arch_start.asm @@ -1,20 +1,4 @@ /* -; This file is a part of the IncludeOS unikernel - www.includeos.org -; -; Copyright 2015 Oslo and Akershus University College of Applied Sciences -; and Alfred Bratterud -; -; Licensed under the Apache License, Version 2.0 (the "License"); -; you may not use this file except in compliance with the License. -; You may obtain a copy of the License at -; -; http://www.apache.org/licenses/LICENSE-2.0 -; -; Unless required by applicable law or agreed to in writing, software -; distributed under the License is distributed on an "AS IS" BASIS, -; WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -; See the License for the specific language governing permissions and -; limitations under the License. */ .text .global __arch_start diff --git a/src/arch/aarch64/exceptions.asm b/src/arch/aarch64/exceptions.asm index dfdb975e5a..c9014e2c22 100644 --- a/src/arch/aarch64/exceptions.asm +++ b/src/arch/aarch64/exceptions.asm @@ -1,20 +1,4 @@ /* -; This file is a part of the IncludeOS unikernel - www.includeos.org -; -; Copyright 2015 Oslo and Akershus University College of Applied Sciences -; and Alfred Bratterud -; -; Licensed under the Apache License, Version 2.0 (the "License"); -; you may not use this file except in compliance with the License. -; You may obtain a copy of the License at -; -; http://www.apache.org/licenses/LICENSE-2.0 -; -; Unless required by applicable law or agreed to in writing, software -; distributed under the License is distributed on an "AS IS" BASIS, -; WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -; See the License for the specific language governing permissions and -; limitations under the License. */ #include "macros.h" diff --git a/src/arch/aarch64/linker.ld b/src/arch/aarch64/linker.ld index 12b9869e82..47b9c422e7 100644 --- a/src/arch/aarch64/linker.ld +++ b/src/arch/aarch64/linker.ld @@ -1,21 +1,3 @@ -/** - * This file is a part of the IncludeOS unikernel - www.includeos.org - * - * Copyright 2015 Oslo and Akershus University College of Applied Sciences - * and Alfred Bratterud - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http: *www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. -**/ ENTRY(_start) /* @@ -183,10 +165,7 @@ SECTIONS LONG (0); } - /** Optional memory hole between memdisk and bss **/ - . += PRE_BSS_AREA; - - .bss ALIGN(0x1000) : + .bss ALIGN(0x100) : { _BSS_START_ = .; *(.bss .bss.* .gnu.linkonce.b.*) diff --git a/src/arch/aarch64/paging.cpp b/src/arch/aarch64/paging.cpp index eda50ca68e..ea79a879b6 100644 --- a/src/arch/aarch64/paging.cpp +++ b/src/arch/aarch64/paging.cpp @@ -1,19 +1,4 @@ // -*-C++-*- -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2017 IncludeOS AS, Oslo, Norway -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. #include #include diff --git a/src/arch/aarch64/syscall_entry.cpp b/src/arch/aarch64/syscall_entry.cpp index ecc773ca55..6d38480729 100644 --- a/src/arch/aarch64/syscall_entry.cpp +++ b/src/arch/aarch64/syscall_entry.cpp @@ -1,18 +1,30 @@ - - #include "cpu.h" +#include + +extern "C" +pthread_t syscall_clone( + unsigned long flags, + void *stack, + int *ptid, + unsigned long newtls, + int *ctid, + // needed to suspend this thread + void* next_instr, + void* old_stack) +{ + auto* parent = kernel::get_thread(); + auto* thread = kernel::thread_create(parent, flags, ctid, stack); + // suspend parent thread + parent->suspend(next_instr, old_stack); + // activate new TLS location + thread->activate(newtls); + return thread->tid; +} extern "C" long syscall_SYS_set_thread_area(struct user_desc *u_info) { set_tpidr(u_info); - /* - if (UNLIKELY(!u_info)) return -EINVAL; -#ifdef __x86_64__ - x86::CPU::set_fs(u_info); -#else - x86::CPU::set_gs(u_info); -#endif*/ return 0; } diff --git a/src/arch/aarch64/threads.asm b/src/arch/aarch64/threads.asm new file mode 100644 index 0000000000..3019299d2a --- /dev/null +++ b/src/arch/aarch64/threads.asm @@ -0,0 +1,9 @@ +global __clone_return:function +global __thread_yield:function +global __thread_restore:function +extern __thread_suspend_and_yield + +SECTION .text +__clone_return: +__thread_yield: +__thread_restore: diff --git a/src/arch/i686/apic_asm.asm b/src/arch/i686/apic_asm.asm index bc65fe7e5d..a01437a776 100644 --- a/src/arch/i686/apic_asm.asm +++ b/src/arch/i686/apic_asm.asm @@ -1,19 +1,3 @@ -; This file is a part of the IncludeOS unikernel - www.includeos.org -; -; Copyright 2015 Oslo and Akershus University College of Applied Sciences -; and Alfred Bratterud -; -; Licensed under the Apache License, Version 2.0 (the "License"); -; you may not use this file except in compliance with the License. -; You may obtain a copy of the License at -; -; http://www.apache.org/licenses/LICENSE-2.0 -; -; Unless required by applicable law or agreed to in writing, software -; distributed under the License is distributed on an "AS IS" BASIS, -; WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -; See the License for the specific language governing permissions and -; limitations under the License. USE32 global spurious_intr:function global lapic_send_eoi:function diff --git a/src/arch/i686/arch_start.asm b/src/arch/i686/arch_start.asm index 97a6fd8c01..c2e0841df8 100644 --- a/src/arch/i686/arch_start.asm +++ b/src/arch/i686/arch_start.asm @@ -1,19 +1,3 @@ -; This file is a part of the IncludeOS unikernel - www.includeos.org -; -; Copyright 2015 Oslo and Akershus University College of Applied Sciences -; and Alfred Bratterud -; -; Licensed under the Apache License, Version 2.0 (the "License"); -; you may not use this file except in compliance with the License. -; You may obtain a copy of the License at -; -; http://www.apache.org/licenses/LICENSE-2.0 -; -; Unless required by applicable law or agreed to in writing, software -; distributed under the License is distributed on an "AS IS" BASIS, -; WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -; See the License for the specific language governing permissions and -; limitations under the License. global __arch_start:function global fast_kernel_start:function diff --git a/src/arch/i686/exceptions.asm b/src/arch/i686/exceptions.asm index 04313d5dd0..73757185a2 100644 --- a/src/arch/i686/exceptions.asm +++ b/src/arch/i686/exceptions.asm @@ -1,19 +1,3 @@ -; This file is a part of the IncludeOS unikernel - www.includeos.org -; -; Copyright 2015 Oslo and Akershus University College of Applied Sciences -; and Alfred Bratterud -; -; Licensed under the Apache License, Version 2.0 (the "License"); -; you may not use this file except in compliance with the License. -; You may obtain a copy of the License at -; -; http://www.apache.org/licenses/LICENSE-2.0 -; -; Unless required by applicable law or agreed to in writing, software -; distributed under the License is distributed on an "AS IS" BASIS, -; WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -; See the License for the specific language governing permissions and -; limitations under the License. [BITS 32] extern __cpu_exception diff --git a/src/arch/i686/fiber.asm b/src/arch/i686/fiber.asm index 517d7cf2a5..256690df8a 100644 --- a/src/arch/i686/fiber.asm +++ b/src/arch/i686/fiber.asm @@ -1,19 +1,3 @@ -; This file is a part of the IncludeOS unikernel - www.includeos.org -; -; Copyright 2017 Oslo and Akershus University College of Applied Sciences -; and Alfred Bratterud -; -; Licensed under the Apache License, Version 2.0 (the "License"); -; you may not use this file except in compliance with the License. -; You may obtain a copy of the License at -; -; http://www.apache.org/licenses/LICENSE-2.0 -; -; Unless required by applicable law or agreed to in writing, software -; distributed under the License is distributed on an "AS IS" BASIS, -; WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -; See the License for the specific language governing permissions and -; limitations under the License. USE32 global __fiber_jumpstart diff --git a/src/arch/i686/gdt_asm.asm b/src/arch/i686/gdt_asm.asm index f8bfebda60..cb9e08735c 100644 --- a/src/arch/i686/gdt_asm.asm +++ b/src/arch/i686/gdt_asm.asm @@ -1,19 +1,3 @@ -; This file is a part of the IncludeOS unikernel - www.includeos.org -; -; Copyright 2015 Oslo and Akershus University College of Applied Sciences -; and Alfred Bratterud -; -; Licensed under the Apache License, Version 2.0 (the "License"); -; you may not use this file except in compliance with the License. -; You may obtain a copy of the License at -; -; http://www.apache.org/licenses/LICENSE-2.0 -; -; Unless required by applicable law or agreed to in writing, software -; distributed under the License is distributed on an "AS IS" BASIS, -; WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -; See the License for the specific language governing permissions and -; limitations under the License. USE32 global __load_gdt:function diff --git a/src/arch/i686/interrupts.asm b/src/arch/i686/interrupts.asm index bf3ba00983..48ccd2100b 100644 --- a/src/arch/i686/interrupts.asm +++ b/src/arch/i686/interrupts.asm @@ -1,19 +1,3 @@ -; This file is a part of the IncludeOS unikernel - www.includeos.org -; -; Copyright 2015 Oslo and Akershus University College of Applied Sciences -; and Alfred Bratterud -; -; Licensed under the Apache License, Version 2.0 (the "License"); -; you may not use this file except in compliance with the License. -; You may obtain a copy of the License at -; -; http://www.apache.org/licenses/LICENSE-2.0 -; -; Unless required by applicable law or agreed to in writing, software -; distributed under the License is distributed on an "AS IS" BASIS, -; WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -; See the License for the specific language governing permissions and -; limitations under the License. USE32 global unused_interrupt_handler:function global modern_interrupt_handler:function diff --git a/src/arch/i686/linker.ld b/src/arch/i686/linker.ld index 70550b9ad5..59df3122c9 100644 --- a/src/arch/i686/linker.ld +++ b/src/arch/i686/linker.ld @@ -1,21 +1,3 @@ -/** - * This file is a part of the IncludeOS unikernel - www.includeos.org - * - * Copyright 2015 Oslo and Akershus University College of Applied Sciences - * and Alfred Bratterud - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http: *www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. -**/ ENTRY(_start) SECTIONS @@ -27,7 +9,7 @@ SECTIONS .multiboot : { PROVIDE(_MULTIBOOT_START_ = .); - *(.multiboot) + KEEP(*(.multiboot)) } .text ALIGN(0x1000): @@ -45,9 +27,11 @@ SECTIONS } /** - * .preinit_array, .init_array, .fini_array - * from GNU LD default linker script - */ + * Global constructors + * Constructors are split into groups allowing the OS to use global ctors + * before the OS itself is initialized, while delaying the calls to service constructors + * until as much of the OS / C++ runtime as possible is ready. + */ .preinit_array : { @@ -56,13 +40,6 @@ SECTIONS PROVIDE_HIDDEN (__preinit_array_end = .); } -/** - * Global constructors - * Constructors are split into groups allowing the OS to use global ctors - * before the OS itself is initialized, while delaying the calls to service constructors - * until as much of the OS / C++ runtime as possible is ready. - */ - /* OS / stdlib constructors */ .init_array : { @@ -113,8 +90,8 @@ SECTIONS KEEP (*(.fini_array EXCLUDE_FILE (*crtbegin.o *crtbegin?.o *crtend.o *crtend?.o ) .dtors)) PROVIDE_HIDDEN (__fini_array_end = .); } - _EXEC_END_ = .; + _READONLY_START_ = .; .config ALIGN(0x1000) : { _CONFIG_JSON_START_ = .; @@ -149,7 +126,7 @@ SECTIONS .memdisk : { _DISK_START_ = .; - *(.diskdata) + KEEP(*(.diskdata)) _DISK_END_ = .; } @@ -164,12 +141,8 @@ SECTIONS KEEP(*(.eh_frame)) LONG (0); } - - .gcc_except_table : - { - *(.gcc_except_table) - } _READONLY_END_ = .; + .data : { _DATA_START_ = .; diff --git a/src/arch/i686/paging.cpp b/src/arch/i686/paging.cpp index 433a7e5c27..4de036fdea 100644 --- a/src/arch/i686/paging.cpp +++ b/src/arch/i686/paging.cpp @@ -1,19 +1,4 @@ // -*-C++-*- -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2017 IncludeOS AS, Oslo, Norway -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. #include #include diff --git a/src/arch/i686/profile_intr.asm b/src/arch/i686/profile_intr.asm index 9141a5b19d..6dea14f0af 100644 --- a/src/arch/i686/profile_intr.asm +++ b/src/arch/i686/profile_intr.asm @@ -1,19 +1,3 @@ -; This file is a part of the IncludeOS unikernel - www.includeos.org -; -; Copyright 2015 Oslo and Akershus University College of Applied Sciences -; and Alfred Bratterud -; -; Licensed under the Apache License, Version 2.0 (the "License"); -; you may not use this file except in compliance with the License. -; You may obtain a copy of the License at -; -; http://www.apache.org/licenses/LICENSE-2.0 -; -; Unless required by applicable law or agreed to in writing, software -; distributed under the License is distributed on an "AS IS" BASIS, -; WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -; See the License for the specific language governing permissions and -; limitations under the License. USE32 extern current_intr_handler diff --git a/src/arch/x86_64/CMakeLists.txt b/src/arch/x86_64/CMakeLists.txt index de8d27d461..1d38d8a3ef 100644 --- a/src/arch/x86_64/CMakeLists.txt +++ b/src/arch/x86_64/CMakeLists.txt @@ -8,6 +8,7 @@ set(ARCH_OBJECTS exceptions.asm interrupts.asm fiber_asm.asm + threads.asm __syscall_entry.asm syscall_entry.cpp ist.cpp diff --git a/src/arch/x86_64/__syscall_entry.asm b/src/arch/x86_64/__syscall_entry.asm index d1146d514b..2e14c75ede 100644 --- a/src/arch/x86_64/__syscall_entry.asm +++ b/src/arch/x86_64/__syscall_entry.asm @@ -1,23 +1,8 @@ -;; This file is a part of the IncludeOS unikernel - www.includeos.org -;; -;; Copyright 2018 IncludeOS AS, Oslo, Norway -;; -;; Licensed under the Apache License, Version 2.0 (the "License"); -;; you may not use this file except in compliance with the License. -;; You may obtain a copy of the License at -;; -;; http:;;www.apache.org/licenses/LICENSE-2.0 -;; -;; Unless required by applicable law or agreed to in writing, software -;; distributed under the License is distributed on an "AS IS" BASIS, -;; WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -;; See the License for the specific language governing permissions and -;; limitations under the License. - global __syscall_entry:function -global __test_syscall:function +global __clone_helper:function +global __clone_return:function +global __migrate_resume:function extern syscall_entry -extern kprintf ;; x86_64 / System V ABI calling convention %define arg1 rdi @@ -27,9 +12,8 @@ extern kprintf %define arg5 r8 %define arg6 r9 -;; Preserve caller-saved registers %macro PUSHAQ 0 - push rax + ;;push rax push rcx push rdx push rdi @@ -38,13 +22,8 @@ extern kprintf push r9 push r10 push r11 - ; Preserve extended state - ;fxsave [__xsave_storage_area] %endmacro %macro POPAQ 0 - ; Restore extended state - ;fxrstor [__xsave_storage_area] - pop r11 pop r10 pop r9 @@ -53,28 +32,18 @@ extern kprintf pop rdi pop rdx pop rcx - pop rax + ;;pop rax %endmacro -%define stack_size 32768 - -section .bss -temp_stack: - resb stack_size -temp_old_stack: - resq 1 -temp_rcx: - resq 1 -section .text +SECTION .text __syscall_entry: - ;; mov [temp_rcx], rcx - ;; mov [temp_old_stack], rsp - ;; mov rsp, temp_stack + stack_size - 16 + ;; clone syscall + cmp rax, 56 + je __clone_helper + ;; store return address push rcx - ;; sub rsp, 8 - ;; Convert back from syscall conventions ;; Last param on stack movq 8(rsp),r9 mov r9, r8 @@ -83,51 +52,67 @@ __syscall_entry: mov rdx, rsi mov rsi, rdi mov rdi, rax - call syscall_entry - ;; add rsp, 8 + ;; return to rcx pop rcx + jmp QWORD rcx - ;; mov rsp, [temp_old_stack] - jmp QWORD rcx ;[temp_rcx] - - -__test_syscall: - mov [kparam.stack], rsp - mov arg1, kparam.rsp - mov arg2, [kparam.stack] - mov arg3, 0 +__clone_helper: + PUSHAQ + sub rsp, 0x8 ;; alignment + ;; R13: thread callback + push r9 + ;; R12: old stack push rsp - and rsp, ~15 - call kprintf - pop rsp - - mov rsi, rdi ; shift for syscall - mov edi, 0x1002 ;/* SET_FS register */ - mov eax, 158 ;/* set fs segment to */ - - - syscall ;/* arch_prctl(SET_FS, arg)*/ - - mov [kparam.stack], rsp - mov arg1, kparam.rsp - mov arg2, [kparam.stack] - mov arg3, 0 - - push rsp - and rsp, ~15 - call kprintf - pop rsp - ret - -;; Make thread local -kparam: - .rsp: - db `__test_syscall: Stack: 0x%lx\n`,0 - .fmt_rcx: - db `__test_syscall: rcx: 0x%lx\n`,0 - .stack: - dq 0 - .rcx: - dq 0 + ;; r11: temp nexti + mov r11, rcx + ;; R9: TLS data + mov r9, r8 + ;; R8: void* ctid + mov r8, r10 + ;; RCX: void* ptid + mov rcx, rdx + ;; RDX: void* stack + mov rdx, rsi + ;; RSI: unsigned long flags + mov rsi, rdi + ;; RDI: next instruction + mov rdi, r11 + + ;; call clone so that kernel can create the thread data + extern syscall_clone + call syscall_clone + ;; remove old rsp + add rsp, 0x18 +__clone_resume: + ;; return value preserved + POPAQ + PUSHAQ + push rbp + push rax ;; store thread id + + ;; switch stack + mov rsp, rsi + ;; zero return value + xor rax, rax + ;; return back + jmp QWORD rcx + +__clone_return: + mov rsp, rdi + + pop rax ;; restore thread id + pop rbp + POPAQ + ;; + jmp QWORD rcx + +__migrate_resume: + mov rsp, rdi + + ;; restore saved registers + POPAQ + ;; rax zero (child thread) + xor rax, rax + jmp QWORD rcx diff --git a/src/arch/x86_64/apic_asm.asm b/src/arch/x86_64/apic_asm.asm index 56f4d9655e..7c126ff90f 100644 --- a/src/arch/x86_64/apic_asm.asm +++ b/src/arch/x86_64/apic_asm.asm @@ -1,19 +1,3 @@ -; This file is a part of the IncludeOS unikernel - www.includeos.org -; -; Copyright 2015 Oslo and Akershus University College of Applied Sciences -; and Alfred Bratterud -; -; Licensed under the Apache License, Version 2.0 (the "License"); -; you may not use this file except in compliance with the License. -; You may obtain a copy of the License at -; -; http://www.apache.org/licenses/LICENSE-2.0 -; -; Unless required by applicable law or agreed to in writing, software -; distributed under the License is distributed on an "AS IS" BASIS, -; WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -; See the License for the specific language governing permissions and -; limitations under the License. [BITS 64] global spurious_intr:function global lapic_send_eoi:function diff --git a/src/arch/x86_64/apic_longmode.asm b/src/arch/x86_64/apic_longmode.asm index 87345ed02d..41f7ad723c 100644 --- a/src/arch/x86_64/apic_longmode.asm +++ b/src/arch/x86_64/apic_longmode.asm @@ -1,29 +1,35 @@ -; This file is a part of the IncludeOS unikernel - www.includeos.org -; -; Copyright 2015 Oslo and Akershus University College of Applied Sciences -; and Alfred Bratterud -; -; Licensed under the Apache License, Version 2.0 (the "License"); -; you may not use this file except in compliance with the License. -; You may obtain a copy of the License at -; -; http://www.apache.org/licenses/LICENSE-2.0 -; -; Unless required by applicable law or agreed to in writing, software -; distributed under the License is distributed on an "AS IS" BASIS, -; WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -; See the License for the specific language governing permissions and -; limitations under the License. -; global __apic_trampoline:function extern __gdt64_base_pointer extern revenant_main +;; we will be calling these from AP initialization +extern x86_enable_sse +extern x86_enable_fpu_native +extern x86_enable_xsave +extern x86_enable_avx + %define P4_TAB 0x1000 +;; Extended Feature Enable Register (MSR) +%define IA32_EFER_MSR 0xC0000080 +;; EFER Longmode bit +%define LONGMODE_ENABLE 0x100 +;; EFER Execute Disable bit +%define NX_ENABLE 0x800 +;; EFER Syscall enable bit +%define SYSCALL_ENABLE 0x1 [BITS 32] __apic_trampoline: - pop edi ;; cpuid + ;; enable SSE before we enter C/C++ land + call x86_enable_sse + ;; Enable modern x87 FPU exception handling + call x86_enable_fpu_native + ;; try to enable XSAVE before checking AVX + call x86_enable_xsave + ;; enable AVX if xsave and avx supported on CPU + call x86_enable_avx + + pop edi ;; cpuid ;; use same pagetable as CPU 0 mov eax, P4_TAB @@ -34,10 +40,10 @@ __apic_trampoline: or eax, 1 << 5 mov cr4, eax - ;; enable long mode - mov ecx, 0xC0000080 ; EFER MSR + ;; enable long mode + mov ecx, IA32_EFER_MSR rdmsr - or eax, 1 << 8 ; Long Mode bit + or eax, (LONGMODE_ENABLE | NX_ENABLE | SYSCALL_ENABLE) wrmsr ;; enable paging @@ -45,6 +51,12 @@ __apic_trampoline: or eax, 1 << 31 mov cr0, eax ; Set control register 0 to the A-register. + ;; retrieve CPU id -> rbx + mov eax, 1 + cpuid + shr ebx, 24 + ;; TODO: load a proper GDT here instead of a shared one + ;; load 64-bit GDT lgdt [__gdt64_base_pointer] jmp 0x8:long_mode ;; 0x8 = code seg @@ -61,10 +73,6 @@ long_mode: ;; align stack and rsp, -16 - ;; retrieve CPU id - mov rax, 1 - cpuid - shr rbx, 24 ;; geronimo! mov rdi, rbx call revenant_main diff --git a/src/arch/x86_64/arch_start.asm b/src/arch/x86_64/arch_start.asm index 983f2599e1..0579597d22 100644 --- a/src/arch/x86_64/arch_start.asm +++ b/src/arch/x86_64/arch_start.asm @@ -1,21 +1,6 @@ -; This file is a part of the IncludeOS unikernel - www.includeos.org -; -; Copyright 2015 Oslo and Akershus University College of Applied Sciences -; and Alfred Bratterud -; Licensed under the Apache License, Version 2.0 (the "License"); -; you may not use this file except in compliance with the License. -; You may obtain a copy of the License at -; -; -; http://www.apache.org/licenses/LICENSE-2.0 -; -; Unless required by applicable law or agreed to in writing, software -; distributed under the License is distributed on an "AS IS" BASIS, -; WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -; See the License for the specific language governing permissions and -; limitations under the License. global __arch_start:function global __gdt64_base_pointer +global __startup_was_fast global fast_kernel_start:function extern kernel_start extern __multiboot_magic @@ -135,12 +120,11 @@ long_mode: mov gs, cx mov ss, cx +resume_startup: ;; set up new stack for 64-bit extern _ELF_START_ push rsp mov rsp, _ELF_START_ - push 0 - push 0 mov rbp, rsp mov ecx, IA32_STAR @@ -168,12 +152,10 @@ long_mode: ;; this function can be jumped to directly from hotswap fast_kernel_start: - and rsp, -16 - mov edi, eax - mov esi, ebx - call kernel_start - cli - hlt + mov DWORD[__multiboot_magic], eax + mov DWORD[__multiboot_addr], ebx + mov WORD [__startup_was_fast], 1 + jmp resume_startup SECTION .data GDT64: @@ -194,16 +176,18 @@ GDT64: db 00000000b ; Granularity. db 0 ; Base (high). .Task: equ $ - GDT64 ; TSS descriptor. - dq 0 - dq 0 + resq 2*256 ; make room for 256 CPUs dw 0x0 ;; alignment padding __gdt64_base_pointer: dw $ - GDT64 - 1 ; Limit. dq GDT64 ; Base. -SECTION .bss +SECTION .rodata tls_table: dq tls_table +__startup_was_fast: + dw 0 +SECTION .bss smp_table: resw 8 diff --git a/src/arch/x86_64/arch_start_broken.asm b/src/arch/x86_64/arch_start_broken.asm deleted file mode 100644 index cec61dfd91..0000000000 --- a/src/arch/x86_64/arch_start_broken.asm +++ /dev/null @@ -1,158 +0,0 @@ -; This file is a part of the IncludeOS unikernel - www.includeos.org -; -; Copyright 2015 Oslo and Akershus University College of Applied Sciences -; and Alfred Bratterud -; -; Licensed under the Apache License, Version 2.0 (the "License"); -; you may not use this file except in compliance with the License. -; You may obtain a copy of the License at -; -; http://www.apache.org/licenses/LICENSE-2.0 -; -; Unless required by applicable law or agreed to in writing, software -; distributed under the License is distributed on an "AS IS" BASIS, -; WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -; See the License for the specific language governing permissions and -; limitations under the License. -global __arch_start:function -global __gdt64_base_pointer -extern kernel_start -extern __multiboot_magic -extern __multiboot_addr - -%define PAGE_SIZE 0x1000 -%define P4_TAB 0x1000 -%define P3_TAB 0x2000 ;; - 0x5fff -%define P2_TAB 0x100000 -%define STACK_LOCATION 0x9ffff0 - -[BITS 32] -__arch_start: - ;; disable old paging - mov eax, cr0 - and eax, 0x7fffffff ;; clear PG (bit 31) - mov cr0, eax - - ;; address for Page Map Level 4 - mov edi, P4_TAB - mov cr3, edi - mov ecx, 0x3000 / 0x4 - xor eax, eax ; Nullify the A-register. - rep stosd - - ;; create page map entry - mov edi, P4_TAB - mov DWORD [edi], P3_TAB | 0x3 ;; present+write - - ;; create 4x page directory pointer table entries - mov edi, P3_TAB - mov ebx, P2_TAB | 0x3 ;; present + write - mov DWORD [edi], ebx - add edi, 8 - add ebx, 0x1000 - mov DWORD [edi], ebx - add edi, 8 - add ebx, 0x1000 - mov DWORD [edi], ebx - add edi, 8 - add ebx, 0x1000 - mov DWORD [edi], ebx - - ;; create page directory entries - mov ecx, 512*4 ;; num entries - mov edi, P2_TAB - - ;; start at address 0x0 - mov ebx, 0x0 | 0x3 | 1 << 7 ;; present+write + huge -.ptd_loop: - mov DWORD [edi], ebx ;; Assign the physical adress to lower 32-bits - mov DWORD [edi+4], 0x0 ;; Zero out the rest of the 64-bit word - add ebx, 1 << 21 ;; 2MB increments - add edi, 8 - loop .ptd_loop - - ;; enable PAE - mov eax, cr4 - or eax, 1 << 5 - mov cr4, eax - - ;; enable long mode - mov ecx, 0xC0000080 ; EFER MSR - rdmsr - or eax, 1 << 8 ; Long Mode bit - wrmsr - - ;; enable paging - mov eax, cr0 ; Set the A-register to control register 0. - or eax, 1 << 31 - mov cr0, eax ; Set control register 0 to the A-register. - - ;; load 64-bit GDT - lgdt [__gdt64_base_pointer] - jmp GDT64.Code:long_mode - - -[BITS 64] -long_mode: - cli - - ;; segment regs - mov cx, GDT64.Data - mov ds, cx - mov es, cx - mov fs, cx - mov gs, cx - mov ss, cx - - ;; set up new stack for 64-bit - push rsp - mov rsp, STACK_LOCATION - mov rbp, rsp - - ;; setup temporary smp table - mov rax, sentinel_table - mov rdx, 0 - mov rcx, 0xC0000100 ;; FS BASE - wrmsr - - ;; geronimo! - mov edi, DWORD[__multiboot_magic] - mov esi, DWORD[__multiboot_addr] - call kernel_start - pop rsp - ret - -sentinel_table: - dq sentinel_table ;; 0x0 - dq 0 ;; 0x8 - dq 0 ;; 0x10 - dq 0 ;; 0x18 - dq 0 ;; 0x20 - dq 0x123456789ABCDEF - -SECTION .data -GDT64: - .Null: equ $ - GDT64 ; The null descriptor. - dq 0 - .Code: equ $ - GDT64 ; The code descriptor. - dw 0 ; Limit (low). - dw 0 ; Base (low). - db 0 ; Base (middle) - db 10011010b ; Access (exec/read). - db 00100000b ; Granularity. - db 0 ; Base (high). - .Data: equ $ - GDT64 ; The data descriptor. - dw 0 ; Limit (low). - dw 0 ; Base (low). - db 0 ; Base (middle) - db 10010010b ; Access (read/write). - db 00000000b ; Granularity. - db 0 ; Base (high). - .Task: equ $ - GDT64 ; TSS descriptor. - dq 0 - dq 0 - - dw 0x0 ;; alignment padding -__gdt64_base_pointer: - dw $ - GDT64 - 1 ; Limit. - dq GDT64 ; Base. diff --git a/src/arch/x86_64/arch_start_broken1.asm b/src/arch/x86_64/arch_start_broken1.asm deleted file mode 100644 index 177b8dc499..0000000000 --- a/src/arch/x86_64/arch_start_broken1.asm +++ /dev/null @@ -1,143 +0,0 @@ -; This file is a part of the IncludeOS unikernel - www.includeos.org -; -; Copyright 2015 Oslo and Akershus University College of Applied Sciences -; and Alfred Bratterud -; -; Licensed under the Apache License, Version 2.0 (the "License"); -; you may not use this file except in compliance with the License. -; You may obtain a copy of the License at -; -; http://www.apache.org/licenses/LICENSE-2.0 -; -; Unless required by applicable law or agreed to in writing, software -; distributed under the License is distributed on an "AS IS" BASIS, -; WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -; See the License for the specific language governing permissions and -; limitations under the License. -global __arch_start:function -global __gdt64_base_pointer -extern kernel_start -extern __multiboot_magic -extern __multiboot_addr - -%define P4_TAB 0x1000 -%define P3_TAB 0x2000 -%define NUM_ENTRIES 4 -%define STACK_LOCATION 0x1ffff0 - -[BITS 32] -__arch_start: - ;; disable old paging - mov eax, cr0 - and eax, 0x7fffffff ;; clear PG (bit 31) - mov cr0, eax - - ;; address for Page Map Level 4 - mov edi, P4_TAB - mov cr3, edi - ;; clear out P4 and P3 - mov ecx, 0x2000 / 0x4 - xor eax, eax ; Nullify the A-register. - rep stosd - - ;; create page map entry - mov edi, P4_TAB - mov DWORD [edi], P3_TAB | 0x3 ;; present+write - - ;; create 4x 1GB mappings - mov ecx, NUM_ENTRIES - mov edi, P3_TAB - mov ebx, 0x0 | 0x3 | 1 << 7 ;; present + write + huge - -.ptd_loop: - mov DWORD [edi], ebx ;; Assign the physical adress to lower 32-bits - mov DWORD [edi+4], 0x0 ;; Zero out the rest of the 64-bit word - add ebx, 1 << 30 ;; 1GB increments - add edi, 8 - loop .ptd_loop - - ;; enable PAE - mov eax, cr4 - or eax, 1 << 5 - mov cr4, eax - - ;; enable long mode - mov ecx, 0xC0000080 ; EFER MSR - rdmsr - or eax, 1 << 8 ; Long Mode bit - wrmsr - - ;; enable paging - mov eax, cr0 ; Set the A-register to control register 0. - or eax, 1 << 31 - mov cr0, eax ; Set control register 0 to the A-register. - - ;; load 64-bit GDT - lgdt [__gdt64_base_pointer] - jmp GDT64.Code:long_mode - - -[BITS 64] -long_mode: - cli - - ;; segment regs - mov cx, GDT64.Data - mov ds, cx - mov es, cx - mov fs, cx - mov gs, cx - mov ss, cx - - ;; set up new stack for 64-bit - push rsp - mov rsp, STACK_LOCATION - mov rbp, rsp - - ;; setup temporary smp table - mov rax, sentinel_table - mov rdx, 0 - mov rcx, 0xC0000100 ;; FS BASE - wrmsr - - ;; geronimo! - mov edi, DWORD[__multiboot_magic] - mov esi, DWORD[__multiboot_addr] - call kernel_start - pop rsp - ret - -sentinel_table: - dq sentinel_table ;; 0x0 - dq 0 ;; 0x8 - dq 0 ;; 0x10 - dq 0 ;; 0x18 - dq 0 ;; 0x20 - dq 0x123456789ABCDEF - -SECTION .data -GDT64: - .Null: equ $ - GDT64 ; The null descriptor. - dq 0 - .Code: equ $ - GDT64 ; The code descriptor. - dw 0 ; Limit (low). - dw 0 ; Base (low). - db 0 ; Base (middle) - db 10011010b ; Access (exec/read). - db 00100000b ; Granularity. - db 0 ; Base (high). - .Data: equ $ - GDT64 ; The data descriptor. - dw 0 ; Limit (low). - dw 0 ; Base (low). - db 0 ; Base (middle) - db 10010010b ; Access (read/write). - db 00000000b ; Granularity. - db 0 ; Base (high). - .Task: equ $ - GDT64 ; TSS descriptor. - dq 0 - dq 0 - - dw 0x0 ;; alignment padding -__gdt64_base_pointer: - dw $ - GDT64 - 1 ; Limit. - dq GDT64 ; Base. diff --git a/src/arch/x86_64/arch_start_new.asm b/src/arch/x86_64/arch_start_new.asm deleted file mode 100644 index effafb528f..0000000000 --- a/src/arch/x86_64/arch_start_new.asm +++ /dev/null @@ -1,160 +0,0 @@ -; This file is a part of the IncludeOS unikernel - www.includeos.org -; -; Copyright 2015 Oslo and Akershus University College of Applied Sciences -; and Alfred Bratterud -; -; Licensed under the Apache License, Version 2.0 (the "License"); -; you may not use this file except in compliance with the License. -; You may obtain a copy of the License at -; -; http://www.apache.org/licenses/LICENSE-2.0 -; -; Unless required by applicable law or agreed to in writing, software -; distributed under the License is distributed on an "AS IS" BASIS, -; WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -; See the License for the specific language governing permissions and -; limitations under the License. -global __arch_start:function -global __gdt64_base_pointer -extern kernel_start -extern __multiboot_magic -extern __multiboot_addr - -%define P4_TAB 0x1000 -%define P3_TAB 0x2000 -%define NUM_ENTRIES 512 -%define STACK_LOCATION 0x900000 - -;; CR0 paging enable bit -%define PAGING_ENABLE 0x80000000 -;; CR0 Supervisor write-protect enable -%define SUPER_WP_ENABLE 0x10000 - -;; Extended Feature Enable Register (MSR) -%define IA32_EFER_MSR 0xC0000080 -;; EFER Longmode bit -%define LONGMODE_ENABLE 0x100 -;; EFER Execute Disable bit -%define NX_ENABLE 0x800 - - -[BITS 32] -__arch_start: - ;; disable old paging - mov eax, cr0 - and eax, ~PAGING_ENABLE ;; clear PG (bit 31) - mov cr0, eax - - ;; address for Page Map Level 4 - mov edi, P4_TAB - mov cr3, edi - - ;; clear out P4 and P3 - mov ecx, 0x2000 / 0x4 - xor eax, eax ; Nullify the A-register. - rep stosd - - ;; create page map entry - mov edi, P4_TAB - mov DWORD [edi], P3_TAB | 0x3 ;; present+write - - ;; create 512x 1GB mappings - mov ecx, NUM_ENTRIES - mov edi, P3_TAB - mov eax, 0x0 | 0x3 | 1 << 7 ;; present + write + huge - mov ebx, 0x0 - -.ptd_loop: - mov DWORD [edi], eax ;; Low word - mov DWORD [edi+4], ebx ;; High word - add eax, 1 << 30 ;; 1GB increments - adc ebx, 0 ;; increment high word when CF set - add edi, 8 - loop .ptd_loop - - ;; enable PAE - mov eax, cr4 - or eax, 1 << 5 - mov cr4, eax - - ;; enable long mode - mov ecx, IA32_EFER_MSR - rdmsr - or eax, (LONGMODE_ENABLE | NX_ENABLE) - - wrmsr - - ;; enable paging - mov eax, cr0 ; Set the A-register to control register 0. - or eax, (PAGING_ENABLE | SUPER_WP_ENABLE) - mov cr0, eax ; Set control register 0 to the A-register. - - ;; load 64-bit GDT - lgdt [__gdt64_base_pointer] - jmp GDT64.Code:long_mode - - -[BITS 64] -long_mode: - cli - - ;; segment regs - mov cx, GDT64.Data - mov ds, cx - mov es, cx - mov fs, cx - mov gs, cx - mov ss, cx - - ;; set up new stack for 64-bit - push rsp - mov rsp, STACK_LOCATION - mov rbp, rsp - - ;; setup temporary smp table - mov rax, sentinel_table - mov rdx, 0 - mov rcx, 0xC0000100 ;; FS BASE - wrmsr - - ;; geronimo! - mov edi, DWORD[__multiboot_magic] - mov esi, DWORD[__multiboot_addr] - call kernel_start - pop rsp - ret - -sentinel_table: - dq sentinel_table ;; 0x0 - dq 0 ;; 0x8 - dq 0 ;; 0x10 - dq 0 ;; 0x18 - dq 0 ;; 0x20 - dq 0x123456789ABCDEF - -SECTION .data -GDT64: - .Null: equ $ - GDT64 ; The null descriptor. - dq 0 - .Code: equ $ - GDT64 ; The code descriptor. - dw 0 ; Limit (low). - dw 0 ; Base (low). - db 0 ; Base (middle) - db 10011010b ; Access (exec/read). - db 00100000b ; Granularity. - db 0 ; Base (high). - .Data: equ $ - GDT64 ; The data descriptor. - dw 0 ; Limit (low). - dw 0 ; Base (low). - db 0 ; Base (middle) - db 10010010b ; Access (read/write). - db 00000000b ; Granularity. - db 0 ; Base (high). - .Task: equ $ - GDT64 ; TSS descriptor. - dq 0 - dq 0 - - dw 0x0 ;; alignment padding -__gdt64_base_pointer: - dw $ - GDT64 - 1 ; Limit. - dq GDT64 ; Base. diff --git a/src/arch/x86_64/exceptions.asm b/src/arch/x86_64/exceptions.asm index 0a843b6282..85a676a458 100644 --- a/src/arch/x86_64/exceptions.asm +++ b/src/arch/x86_64/exceptions.asm @@ -1,19 +1,3 @@ -; This file is a part of the IncludeOS unikernel - www.includeos.org -; -; Copyright 2015 Oslo and Akershus University College of Applied Sciences -; and Alfred Bratterud -; -; Licensed under the Apache License, Version 2.0 (the "License"); -; you may not use this file except in compliance with the License. -; You may obtain a copy of the License at -; -; http://www.apache.org/licenses/LICENSE-2.0 -; -; Unless required by applicable law or agreed to in writing, software -; distributed under the License is distributed on an "AS IS" BASIS, -; WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -; See the License for the specific language governing permissions and -; limitations under the License. [BITS 64] extern __cpu_exception @@ -98,7 +82,7 @@ SECTION .text ;; We don't have the previous stack pointer on stack ;; Make a best guess -%define RSP_OFFS SZ_CALL_FRAME * 2 + ERRCODE_OFFS +%define RSP_OFFS SZ_CALL_FRAME + 0x20 save_cpu_regs: mov regs(RAX), rax @@ -116,8 +100,7 @@ save_cpu_regs: mov regs(R14), r14 mov regs(R15), r15 - mov rax, rsp - add rax, RSP_OFFS + mov rax, QWORD [rsp + RSP_OFFS] mov regs(RSP), rax mov regs(RSI), rsi mov regs(RDI), rdi diff --git a/src/arch/x86_64/fiber_asm.asm b/src/arch/x86_64/fiber_asm.asm index 5c2c812484..d0b46e945d 100644 --- a/src/arch/x86_64/fiber_asm.asm +++ b/src/arch/x86_64/fiber_asm.asm @@ -1,21 +1,4 @@ -; This file is a part of the IncludeOS unikernel - www.includeos.org -; -; Copyright 2017 Oslo and Akershus University College of Applied Sciences -; and Alfred Bratterud -; -; Licensed under the Apache License, Version 2.0 (the "License"); -; you may not use this file except in compliance with the License. -; You may obtain a copy of the License at -; -; http://www.apache.org/licenses/LICENSE-2.0 -; -; Unless required by applicable law or agreed to in writing, software -; distributed under the License is distributed on an "AS IS" BASIS, -; WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -; See the License for the specific language governing permissions and -; limitations under the License. USE64 - global __fiber_jumpstart global __fiber_yield diff --git a/src/arch/x86_64/init_paging.cpp b/src/arch/x86_64/init_paging.cpp index c2b68bc4d0..24e8395dd3 100644 --- a/src/arch/x86_64/init_paging.cpp +++ b/src/arch/x86_64/init_paging.cpp @@ -1,19 +1,4 @@ // -*-C++-*- -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2017 IncludeOS AS, Oslo, Norway -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. __attribute__((weak)) extern void __x86_init_paging(void* pdir) { diff --git a/src/arch/x86_64/interrupts.asm b/src/arch/x86_64/interrupts.asm index cbdf09830e..a2379af641 100644 --- a/src/arch/x86_64/interrupts.asm +++ b/src/arch/x86_64/interrupts.asm @@ -1,19 +1,3 @@ -; This file is a part of the IncludeOS unikernel - www.includeos.org -; -; Copyright 2015 Oslo and Akershus University College of Applied Sciences -; and Alfred Bratterud -; -; Licensed under the Apache License, Version 2.0 (the "License"); -; you may not use this file except in compliance with the License. -; You may obtain a copy of the License at -; -; http://www.apache.org/licenses/LICENSE-2.0 -; -; Unless required by applicable law or agreed to in writing, software -; distributed under the License is distributed on an "AS IS" BASIS, -; WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -; See the License for the specific language governing permissions and -; limitations under the License. [BITS 64] global unused_interrupt_handler:function global modern_interrupt_handler:function diff --git a/src/arch/x86_64/ist.cpp b/src/arch/x86_64/ist.cpp index 1d047d4473..1d70553682 100644 --- a/src/arch/x86_64/ist.cpp +++ b/src/arch/x86_64/ist.cpp @@ -12,6 +12,7 @@ #endif extern "C" void __amd64_load_tr(uint16_t); +extern "C" void* kalloc(size_t size); struct gdtr64 { uint16_t limit; @@ -45,7 +46,7 @@ static stack create_stack_virt(size_t size, const char* name) static uintptr_t stacks_begin = stack_area + GUARD_SIZE; // Allocate physical memory - auto* phys = (char*)memalign(4096, size); + auto* phys = (char*) kalloc(size); IST_PRINT("* Creating stack '%s' @ %p (%p phys) \n", name, (void*)stacks_begin, phys); @@ -60,19 +61,17 @@ static stack create_stack_virt(size_t size, const char* name) stacks_begin += util::bits::roundto<4096>(size) + GUARD_SIZE; // Align stack pointer to bottom of stack minus a pop - auto sp = map.lin + size - 8; - sp &= ~uintptr_t(0xf); + auto sp = map.lin + size; // Force page fault if mapped area isn't writable - ((char*)sp)[0] = '!'; + ((char*)sp)[-1] = '!'; return {(void*) sp, phys}; } static stack create_stack_simple(size_t size, const char* /*name*/) { - auto* phys = (char*)memalign(4096, size); - uintptr_t sp = (uintptr_t) phys + size - 8; - sp &= ~uintptr_t(0xf); + auto* phys = (char*) kalloc(size); + uintptr_t sp = (uintptr_t) phys + size; return {(void*) sp, phys}; } @@ -86,16 +85,19 @@ namespace x86 AMD64_TSS tss; }; - static std::array lm_ist; + static std::vector lm_ist; + SMP_RESIZE_GCTOR(lm_ist); void ist_initialize_for_cpu(int cpu, uintptr_t stack) { typedef struct stack (*create_stack_func_t) (size_t, const char*); create_stack_func_t create_stack = create_stack_virt; - if (cpu > 0) create_stack = create_stack_simple; + if (cpu > 0) { + create_stack = create_stack_simple; + } auto& ist = lm_ist.at(cpu); - memset(&ist.tss, 0, sizeof(AMD64_TSS)); + std::memset(&ist.tss, 0, sizeof(AMD64_TSS)); auto st = create_stack(INTR_SIZE, "Intr stack"); ist.tss.ist1 = (uintptr_t) st.sp; @@ -116,7 +118,8 @@ namespace x86 auto tss_addr = (uintptr_t) &ist.tss; // entry #3 in the GDT is the Task selector - auto* tgd = (AMD64_TS*) &__gdt64_base_pointer.location[8 * 3]; + const int task_offset = 8 * (3 + cpu); + auto* tgd = (AMD64_TS*) &__gdt64_base_pointer.location[task_offset]; memset(tgd, 0, sizeof(AMD64_TS)); tgd->td_type = 0x9; tgd->td_present = 1; @@ -125,6 +128,6 @@ namespace x86 tgd->td_lobase = tss_addr & 0xFFFFFF; tgd->td_hibase = tss_addr >> 24; - __amd64_load_tr(8 * 3); + __amd64_load_tr(task_offset); } } diff --git a/src/arch/x86_64/linker.ld b/src/arch/x86_64/linker.ld index 32b7e518b2..091a1b3b4f 100644 --- a/src/arch/x86_64/linker.ld +++ b/src/arch/x86_64/linker.ld @@ -1,21 +1,3 @@ -/** - * This file is a part of the IncludeOS unikernel - www.includeos.org - * - * Copyright 2015 Oslo and Akershus University College of Applied Sciences - * and Alfred Bratterud - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http: *www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. -**/ ENTRY(_start) SECTIONS @@ -27,7 +9,7 @@ SECTIONS .multiboot : { PROVIDE(_MULTIBOOT_START_ = .); - *(.multiboot) + KEEP(*(.multiboot)) } .text ALIGN(0x1000): @@ -43,15 +25,12 @@ SECTIONS } PROVIDE( _TEXT_END_ = . ); - /* Global offset-table. For dynamic linking */ - .got ALIGN(0x10) : { - *(.got*) - } - /** - * .preinit_array, .init_array, .fini_array - * from GNU LD default linker script - */ + * Global constructors + * Constructors are split into groups allowing the OS to use global ctors + * before the OS itself is initialized, while delaying the calls to service constructors + * until as much of the OS / C++ runtime as possible is ready. + */ .preinit_array : { @@ -60,13 +39,6 @@ SECTIONS PROVIDE_HIDDEN (__preinit_array_end = .); } -/** - * Global constructors - * Constructors are split into groups allowing the OS to use global ctors - * before the OS itself is initialized, while delaying the calls to service constructors - * until as much of the OS / C++ runtime as possible is ready. - */ - /* OS / stdlib constructors */ .init_array : { @@ -139,7 +111,7 @@ SECTIONS .memdisk : { _DISK_START_ = .; - *(.diskdata) + KEEP(*(.diskdata)) _DISK_END_ = .; } @@ -154,12 +126,12 @@ SECTIONS KEEP(*(.eh_frame)) LONG (0); } - - .gcc_except_table : - { - *(.gcc_except_table) + .gcc_except_table : { + *(.gcc_except_table*) } + _READONLY_END_ = .; + .data : { _DATA_START_ = .; diff --git a/src/arch/x86_64/linker_extended.ld b/src/arch/x86_64/linker_extended.ld deleted file mode 100644 index bfe125b6bd..0000000000 --- a/src/arch/x86_64/linker_extended.ld +++ /dev/null @@ -1,228 +0,0 @@ -/** - * This file is a part of the IncludeOS unikernel - www.includeos.org - * - * Copyright 2015 Oslo and Akershus University College of Applied Sciences - * and Alfred Bratterud - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http: *www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. -**/ -OUTPUT_FORMAT("elf64-x86-64", "elf64-x86-64", "elf64-x86-64") -OUTPUT_ARCH(i386:x86-64) - -ENTRY(_start) - -SECTIONS -{ - - PROVIDE (__executable_start = SEGMENT_START("text-segment", 0xa00000)); - . = SEGMENT_START("text-segment", 0xa00000) + SIZEOF_HEADERS; - . = _ELF_START_ + SIZEOF_HEADERS; - - /* For convenience w. multiboot */ - PROVIDE ( _ELF_START_ = __executable_start); - PROVIDE ( _LOAD_START_ = _ELF_START_ ); - - .multiboot : { - PROVIDE(_MULTIBOOT_START_ = . ); - *(.multiboot) - } - - .text ALIGN(0x1000): - { - PROVIDE( _TEXT_START_ = . ); - /* For solo5, although it's just used to print the mem layout. */ - _stext = .; - *(.text) - *(.text.*) - *(.gnu.linkonce.t*) - /* For solo5, although it's just used to print the mem layout. */ - _etext = .; - } - - PROVIDE( _TEXT_END_ = . ); - . = SEGMENT_START("data-segment", .); - . = DATA_SEGMENT_ALIGN (CONSTANT (MAXPAGESIZE), CONSTANT (COMMONPAGESIZE)); - .init ALIGN(0x10) : { - _INIT_START_ = .; - *(.init) - _INIT_END_ = .; - } - - .fini ALIGN(0x10) : { - _FINI_START_ = .; - *(.fini) - _FINI_END_ = .; - } - - /* Global offset-table. For dynamic linking */ - .got ALIGN(0x10) : { - *(.got*) - } - -/** - * .ctors, .dtors, .preinit_array, .init_array, .fini_array - * from GNU LD default linker script - */ - -.ctors : - { - _GCONSTR_START_ = .; - /* gcc uses crtbegin.o to find the start of - the constructors, so we make sure it is - first. Because this is a wildcard, it - doesn't matter if the user does not - actually link against crtbegin.o; the - linker won't look for a file to match a - wildcard. The wildcard also means that it - doesn't matter which directory crtbegin.o - is in. */ - KEEP (*crtbegin.o(.ctors)) - KEEP (*crtbegin?.o(.ctors)) - /* We don't want to include the .ctor section from - the crtend.o file until after the sorted ctors. - The .ctor section from the crtend file contains the - end of ctors marker and it must be last */ - KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o ) .ctors)) - KEEP (*(SORT(.ctors.*))) - KEEP (*(.ctors)) - _GCONSTR_END_ = .; - } - - .dtors : - { - KEEP (*crtbegin.o(.dtors)) - KEEP (*crtbegin?.o(.dtors)) - KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o ) .dtors)) - KEEP (*(SORT(.dtors.*))) - KEEP (*(.dtors)) - } - - .preinit_array : - { - PROVIDE_HIDDEN (__preinit_array_start = .); - KEEP (*(.preinit_array)) - PROVIDE_HIDDEN (__preinit_array_end = .); - } - - .init_array : - { - PROVIDE_HIDDEN (__init_array_start = .); - KEEP (*(SORT_BY_INIT_PRIORITY(.init_array.*) SORT_BY_INIT_PRIORITY(.ctors.*))) - KEEP (*(.init_array EXCLUDE_FILE (*crtbegin.o *crtbegin?.o *crtend.o *crtend?.o ) .ctors)) - PROVIDE_HIDDEN (__init_array_end = .); - } - - .fini_array : - { - PROVIDE_HIDDEN (__fini_array_start = .); - KEEP (*(SORT_BY_INIT_PRIORITY(.fini_array.*) SORT_BY_INIT_PRIORITY(.dtors.*))) - KEEP (*(.fini_array EXCLUDE_FILE (*crtbegin.o *crtbegin?.o *crtend.o *crtend?.o ) .dtors)) - PROVIDE_HIDDEN (__fini_array_end = .); - } - - .rodata ALIGN(0x1000): - { - _RODATA_START_ = .; - *(.rodata*) - *(.gnu.linkonce.r*) - _RODATA_END_ = .; - /* For solo5, although it's just used to print the mem layout. */ - _erodata = .; - } - - .config ALIGN(0x8) : { - _CONFIG_JSON_START_ = .; - KEEP(*(.config)) - _CONFIG_JSON_END_ = .; - BYTE(0); - } - - - /* For stack unwinding (exception handling) - Taken from https://github.com/llvm-mirror/libunwind/blob/master/src/AddressSpace.hpp - Linker script reference in the comments*/ - - .eh_frame : - { - PROVIDE (__eh_frame_start = .); - KEEP(*(.eh_frame)) - PROVIDE (__eh_frame_end = .); - } - - .eh_frame_hdr : - { - KEEP(*(.eh_frame_hdr)) - } - - .gcc_except_table : - { - *(.gcc_except_table) - } - - .data : - { - _DATA_START_ = .; - *(.data) - *(.data.*) - *(.gnu.linkonce.d*) - _DATA_END_ = .; - } - - .tdata ALIGN(0x10) : - { - _TDATA_START_ = .; - *(.tdata .tdata.*) - _TDATA_END_ = .; - . = ALIGN(0x10); - } - - .tbss : - { - _TBSS_START_ = .; - *(.tbss .tbss.*) - _TBSS_END_ = .; - . = ALIGN(0x10); - } - - .memdisk : - { - _DISK_START_ = .; - *(.diskdata) - _DISK_END_ = .; - } - - .elf_symbols : { - _ELF_SYM_START_ = .; - LONG (0); - } - - /** Optional memory hole between memdisk and bss **/ - . += PRE_BSS_AREA; - - .bss ALIGN(0x1000) : - { - - _BSS_START_ = .; - *(.bss .bss.* .gnu.linkonce.b.*) - *(COMMON) - _BSS_END_ = .; - } - . = ALIGN(0x8); - - _end = .; - . = DATA_SEGMENT_END (.); - - PROVIDE (end = .); - PROVIDE (_ELF_END_ = .); - PROVIDE (_LOAD_END_ = .); -} diff --git a/src/arch/x86_64/linker_new_section_ok.txt b/src/arch/x86_64/linker_new_section_ok.txt deleted file mode 100644 index 389e6322f7..0000000000 --- a/src/arch/x86_64/linker_new_section_ok.txt +++ /dev/null @@ -1,228 +0,0 @@ -/** - * This file is a part of the IncludeOS unikernel - www.includeos.org - * - * Copyright 2015 Oslo and Akershus University College of Applied Sciences - * and Alfred Bratterud - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http: *www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. -**/ -ENTRY(_start) -PHDRS -{ - headers PT_LOAD FILEHDR PHDRS ; - text PT_LOAD; - data PT_LOAD ; - -} - -SECTIONS -{ - - PROVIDE ( _ELF_START_ = . + 0xA00000); - PROVIDE ( _LOAD_START_ = _ELF_START_ ); /* For convenience w. multiboot */ - - . = _ELF_START_ + SIZEOF_HEADERS; - - .multiboot : { - PROVIDE(_MULTIBOOT_START_ = . ); - *(.multiboot) - } :headers - - - .text ALIGN(0x1000): - { - PROVIDE( _TEXT_START_ = . ); - /* For solo5, although it's just used to print the mem layout. */ - _stext = .; - *(.text) - *(.text.*) - *(.gnu.linkonce.t*) - /* For solo5, although it's just used to print the mem layout. */ - _etext = .; - }:text - - PROVIDE( _TEXT_END_ = . ); - - .init ALIGN(0x10) : { - _INIT_START_ = .; - *(.init) - _INIT_END_ = .; - }:text - - .fini ALIGN(0x10) : { - _FINI_START_ = .; - *(.fini) - _FINI_END_ = .; - }:text - - /* Global offset-table. For dynamic linking */ - .got ALIGN(0x10) : { - *(.got*) - }:text - -/** - * .ctors, .dtors, .preinit_array, .init_array, .fini_array - * from GNU LD default linker script - */ - -.ctors : - { - _GCONSTR_START_ = .; - /* gcc uses crtbegin.o to find the start of - the constructors, so we make sure it is - first. Because this is a wildcard, it - doesn't matter if the user does not - actually link against crtbegin.o; the - linker won't look for a file to match a - wildcard. The wildcard also means that it - doesn't matter which directory crtbegin.o - is in. */ - KEEP (*crtbegin.o(.ctors)) - KEEP (*crtbegin?.o(.ctors)) - /* We don't want to include the .ctor section from - the crtend.o file until after the sorted ctors. - The .ctor section from the crtend file contains the - end of ctors marker and it must be last */ - KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o ) .ctors)) - KEEP (*(SORT(.ctors.*))) - KEEP (*(.ctors)) - _GCONSTR_END_ = .; - }:text - - .dtors : - { - KEEP (*crtbegin.o(.dtors)) - KEEP (*crtbegin?.o(.dtors)) - KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o ) .dtors)) - KEEP (*(SORT(.dtors.*))) - KEEP (*(.dtors)) - }:text - - .preinit_array : - { - PROVIDE_HIDDEN (__preinit_array_start = .); - KEEP (*(.preinit_array)) - PROVIDE_HIDDEN (__preinit_array_end = .); - }:text - - .init_array : - { - PROVIDE_HIDDEN (__init_array_start = .); - KEEP (*(SORT_BY_INIT_PRIORITY(.init_array.*) SORT_BY_INIT_PRIORITY(.ctors.*))) - KEEP (*(.init_array EXCLUDE_FILE (*crtbegin.o *crtbegin?.o *crtend.o *crtend?.o ) .ctors)) - PROVIDE_HIDDEN (__init_array_end = .); - }:text - - .fini_array : - { - PROVIDE_HIDDEN (__fini_array_start = .); - KEEP (*(SORT_BY_INIT_PRIORITY(.fini_array.*) SORT_BY_INIT_PRIORITY(.dtors.*))) - KEEP (*(.fini_array EXCLUDE_FILE (*crtbegin.o *crtbegin?.o *crtend.o *crtend?.o ) .dtors)) - PROVIDE_HIDDEN (__fini_array_end = .); - } - - .config ALIGN(0x8) : { - _CONFIG_JSON_START_ = .; - KEEP(*(.config)) - _CONFIG_JSON_END_ = .; - BYTE(0); - } - - .rodata : - { - _RODATA_START_ = .; - *(.rodata*) - *(.gnu.linkonce.r*) - _RODATA_END_ = .; - /* For solo5, although it's just used to print the mem layout. */ - _erodata = .; - } - - /* For stack unwinding (exception handling) - Taken from https://github.com/llvm-mirror/libunwind/blob/master/src/AddressSpace.hpp - Linker script reference in the comments - */ - .eh_frame : - { - PROVIDE (__eh_frame_start = .); - KEEP(*(.eh_frame)) - PROVIDE (__eh_frame_end = .); - } - - .eh_frame_hdr : - { - KEEP(*(.eh_frame_hdr)) - } - - __eh_frame_hdr_start = SIZEOF(.eh_frame_hdr) > 0 ? ADDR(.eh_frame_hdr) : 0; - __eh_frame_hdr_end = SIZEOF(.eh_frame_hdr) > 0 ? . : 0; - - .gcc_except_table : - { - *(.gcc_except_table) - } - - .data : - { - _DATA_START_ = .; - *(.data) - *(.data.*) - *(.gnu.linkonce.d*) - _DATA_END_ = .; - } - - .tdata ALIGN(0x10) : - { - _TDATA_START_ = .; - *(.tdata .tdata.*) - _TDATA_END_ = .; - . = ALIGN(0x10); - } - .tbss : - { - _TBSS_START_ = .; - *(.tbss .tbss.*) - _TBSS_END_ = .; - . = ALIGN(0x10); - } - - .memdisk : - { - _DISK_START_ = .; - *(.diskdata) - _DISK_END_ = .; - } - - .elf_symbols : { - _ELF_SYM_START_ = .; - LONG (0); - } - - /** Optional memory hole between memdisk and bss **/ - . += PRE_BSS_AREA; - - .bss ALIGN(0x1000) : - { - _BSS_START_ = .; - *(.bss .bss.* .gnu.linkonce.b.*) - *(COMMON) - _BSS_END_ = .; - } - . = ALIGN(0x8); - - _end = .; - - PROVIDE (end = .); - PROVIDE (_ELF_END_ = .); - PROVIDE (_LOAD_END_ = .); -} diff --git a/src/arch/x86_64/paging.cpp b/src/arch/x86_64/paging.cpp index 6fdf71391e..da710ae92a 100644 --- a/src/arch/x86_64/paging.cpp +++ b/src/arch/x86_64/paging.cpp @@ -1,19 +1,4 @@ // -*-C++-*- -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2017 IncludeOS AS, Oslo, Norway -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. #include #include #include diff --git a/src/arch/x86_64/profile_intr.asm b/src/arch/x86_64/profile_intr.asm index 443783a293..14d5e61b62 100644 --- a/src/arch/x86_64/profile_intr.asm +++ b/src/arch/x86_64/profile_intr.asm @@ -1,19 +1,3 @@ -; This file is a part of the IncludeOS unikernel - www.includeos.org -; -; Copyright 2015 Oslo and Akershus University College of Applied Sciences -; and Alfred Bratterud -; -; Licensed under the Apache License, Version 2.0 (the "License"); -; you may not use this file except in compliance with the License. -; You may obtain a copy of the License at -; -; http://www.apache.org/licenses/LICENSE-2.0 -; -; Unless required by applicable law or agreed to in writing, software -; distributed under the License is distributed on an "AS IS" BASIS, -; WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -; See the License for the specific language governing permissions and -; limitations under the License. [BITS 64] extern current_intr_handler diff --git a/src/arch/x86_64/syscall_entry.cpp b/src/arch/x86_64/syscall_entry.cpp index ae5bb46afd..7dca7b6a31 100644 --- a/src/arch/x86_64/syscall_entry.cpp +++ b/src/arch/x86_64/syscall_entry.cpp @@ -1,25 +1,16 @@ -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2018 IncludeOS AS, Oslo, Norway -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. #include +#include #include #include #include #include +extern "C" { + long syscall_SYS_set_thread_area(void* u_info); + void __clone_return(void* stack); +} + #define ARCH_SET_GS 0x1001 #define ARCH_SET_FS 0x1002 #define ARCH_GET_FS 0x1003 @@ -28,6 +19,7 @@ #ifdef __x86_64__ static long sys_prctl(int code, uintptr_t ptr) { + return -ENOSYS; switch(code){ case ARCH_SET_GS: //kprintf(" set_gs to %#lx\n", ptr); @@ -48,11 +40,74 @@ static long sys_prctl(int code, uintptr_t ptr) } #endif +#include +static void print_symbol(const void* addr) +{ + char buffer[8192]; + auto symb = Elf::safe_resolve_symbol(addr, buffer, sizeof(buffer)); + kprintf("0x%lx + 0x%.3x: %s\n", + symb.addr, symb.offset, symb.name); +} + +extern "C" +pthread_t syscall_clone(void* next_instr, + unsigned long flags, void* stack, + void* ptid, void* ctid, void* newtls, + void* old_stack, void* callback) +{ + auto* parent = kernel::get_thread(); + + auto* thread = kernel::thread_create(parent, flags, ctid, stack); +#ifdef VERBOSE_CLONE_SYSCALL + kprintf("clone syscall creating thread %ld\n", thread->tid); + kprintf("-> nexti: "); print_symbol(next_instr); + kprintf("-> flags: %#lx\n", flags); + kprintf("-> stack: %p\n", stack); + kprintf("-> parent: %p\n", ptid); + kprintf("-> child: %p\n", ctid); + kprintf("-> tls: %p\n", newtls); + kprintf("-> old stack: %p\n", old_stack); + kprintf("-> old tls: %p\n", kernel::get_thread_area()); + kprintf("-> callback: "); print_symbol(callback); +#endif + + // set TLS location (and set self) + thread->set_tls(newtls); + + auto& tman = kernel::ThreadManager::get(); + if (tman.on_new_thread != nullptr) { + // push 8 values onto new stack, as the old stack will get + // used immediately by the returning thread + constexpr int STV = 8; + for (int i = 0; i < STV; i++) { + thread->stack_push(*((uintptr_t*) old_stack + STV + 1 - i)); + } + // potentially get child stolen by migration callback + thread = tman.on_new_thread(tman, thread); + } + + if (thread) { + // suspend parent thread (not yielded) + parent->suspend(false, old_stack); + // continue on child + kernel::set_thread_area(thread->my_tls); + return thread->tid; + } + // continue with parent + __clone_return(old_stack); + __builtin_unreachable(); +} + extern "C" -uintptr_t syscall_entry(uint64_t n, uint64_t a1, uint64_t a2, uint64_t a3, - uint64_t a4, uint64_t a5) +uintptr_t syscall_entry(long n, long a1, long a2, long a3, long a4, long a5) { switch(n) { + case 56: // clone + assert(0 && "Clone needs to be implemented in assembly"); + case 57: // fork + return -ENOSYS; + case 58: // vfork + return -ENOSYS; case 158: // arch_prctl sys_prctl(a1, a2); break; @@ -64,11 +119,16 @@ uintptr_t syscall_entry(uint64_t n, uint64_t a1, uint64_t a2, uint64_t a3, } extern "C" -long syscall_SYS_set_thread_area(struct user_desc *u_info) +long syscall_SYS_set_thread_area(void* u_info) { + //kprintf(" set to %p\n", u_info); if (UNLIKELY(!u_info)) return -EINVAL; #ifdef __x86_64__ - x86::CPU::set_fs(u_info); +# ifdef PLATFORM_x86_solo5 + solo5_set_tls_base((uintptr_t) u_info); +# else + x86::CPU::set_fs(u_info); +# endif #else x86::CPU::set_gs(u_info); #endif diff --git a/src/arch/x86_64/threads.asm b/src/arch/x86_64/threads.asm new file mode 100644 index 0000000000..c2808a6f46 --- /dev/null +++ b/src/arch/x86_64/threads.asm @@ -0,0 +1,45 @@ +global __thread_yield:function +global __thread_restore:function +extern __thread_suspend_and_yield + +;; x86_64 / System V ABI calling convention +%define arg0 rax +%define arg1 rdi +%define arg2 rsi +%define arg3 rdx +%define arg4 rcx +%define arg5 r8 +%define arg6 r9 + +SECTION .text +__thread_yield: + ;; a normal function call + ;; preserve callee-saved regs + ;; RBX, RBP, and R12–R15 + ;; as well as some thread-specific values + push rbx + push rbp + push r12 + push r13 + push r14 + push r15 + ;; now save this thread + mov rdi, rsp ;; my stack + ;; align stack + sub rsp, 8 + call __thread_suspend_and_yield + ;; restore early (no yield happened) + add rsp, 8 + jmp __thread_restore2 + +__thread_restore: + mov rsp, rdi +__thread_restore2: + ;; restore saved registers + pop r15 + pop r14 + pop r13 + pop r12 + pop rbp + pop rbx + ret diff --git a/src/arch/x86_64/tss.hpp b/src/arch/x86_64/tss.hpp index b70c87d20c..e196bbab86 100644 --- a/src/arch/x86_64/tss.hpp +++ b/src/arch/x86_64/tss.hpp @@ -1,19 +1,3 @@ -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2015 Oslo and Akershus University College of Applied Sciences -// and Alfred Bratterud -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. #pragma once #ifndef X86_TSS_HPP diff --git a/src/chainload/hotswap.cpp b/src/chainload/hotswap.cpp index 7968bdd767..0855375a6b 100644 --- a/src/chainload/hotswap.cpp +++ b/src/chainload/hotswap.cpp @@ -1,19 +1,3 @@ -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2017 Oslo and Akershus University College of Applied Sciences -// and Alfred Bratterud -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. /* * Self sufficient Utility function that will copy a binary to a certain diff --git a/src/chainload/service.cpp b/src/chainload/service.cpp index eb70bff985..3383ca5329 100644 --- a/src/chainload/service.cpp +++ b/src/chainload/service.cpp @@ -1,19 +1,3 @@ -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2017 Oslo and Akershus University College of Applied Sciences -// and Alfred Bratterud -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. #include #include diff --git a/src/crt/c_abi.c b/src/crt/c_abi.c index 1edf8495a6..34ef9b34f7 100644 --- a/src/crt/c_abi.c +++ b/src/crt/c_abi.c @@ -1,19 +1,3 @@ -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2015 Oslo and Akershus University College of Applied Sciences -// and Alfred Bratterud -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. #include #include diff --git a/src/crt/cxx_abi.cpp b/src/crt/cxx_abi.cpp index f62d18abc9..26217e8972 100644 --- a/src/crt/cxx_abi.cpp +++ b/src/crt/cxx_abi.cpp @@ -1,19 +1,3 @@ -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2015 Oslo and Akershus University College of Applied Sciences -// and Alfred Bratterud -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. #include #include diff --git a/src/crt/pthread.c b/src/crt/pthread.c deleted file mode 100644 index bd9a35ebb7..0000000000 --- a/src/crt/pthread.c +++ /dev/null @@ -1,60 +0,0 @@ -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2015 Oslo and Akershus University College of Applied Sciences -// and Alfred Bratterud -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -#include -#define UNLOCKED 0 -#define LOCKED 1 - -extern void panic(const char* why); -typedef int spinlock_t; - -void yield() -{ - printf("yield() called, but not implemented yet!"); -} - -static int compare_and_swap(volatile spinlock_t* addr) -{ - const int expected = UNLOCKED; - const int newval = LOCKED; - return __sync_val_compare_and_swap(addr, expected, newval); -} - - -int pthread_mutex_init(volatile spinlock_t* lock) -{ - *lock = UNLOCKED; - return 0; -} -int pthread_mutex_destroy(volatile spinlock_t* lock) -{ - (void) lock; - return 0; -} - -int pthread_mutex_lock(volatile spinlock_t* lock) -{ - while (!compare_and_swap(lock)) - yield(); - return 0; -} - -int pthread_mutex_unlock(volatile spinlock_t* lock) -{ - *lock = UNLOCKED; - return 0; -} diff --git a/src/crt/quick_exit.cpp b/src/crt/quick_exit.cpp index d7ac0a8c5c..ff4ca5140b 100644 --- a/src/crt/quick_exit.cpp +++ b/src/crt/quick_exit.cpp @@ -1,19 +1,3 @@ -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2015 Oslo and Akershus University College of Applied Sciences -// and Alfred Bratterud -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. #include #include diff --git a/src/crt/string.c b/src/crt/string.c index 0570abfdfc..be192ac5cd 100644 --- a/src/crt/string.c +++ b/src/crt/string.c @@ -1,20 +1,3 @@ -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2015 Oslo and Akershus University College of Applied Sciences -// and Alfred Bratterud -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - #include "string.h" #include diff --git a/src/crt/string.h b/src/crt/string.h index ce24514ae8..3fe0f8698c 100644 --- a/src/crt/string.h +++ b/src/crt/string.h @@ -1,20 +1,3 @@ -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2015 Oslo and Akershus University College of Applied Sciences -// and Alfred Bratterud -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - #ifndef _CABI_STRING_H #define _CABI_STRING_H diff --git a/src/drivers/disk_logger.cpp b/src/drivers/disk_logger.cpp index e6f8b06acb..386bd612db 100644 --- a/src/drivers/disk_logger.cpp +++ b/src/drivers/disk_logger.cpp @@ -1,19 +1,3 @@ -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2015 Oslo and Akershus University College of Applied Sciences -// and Alfred Bratterud -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. #include #include diff --git a/src/drivers/e1000.cpp b/src/drivers/e1000.cpp index a6b5255cf8..c6fd6ed67d 100644 --- a/src/drivers/e1000.cpp +++ b/src/drivers/e1000.cpp @@ -1,19 +1,3 @@ -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2015 Oslo and Akershus University College of Applied Sciences -// and Alfred Bratterud -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. #include "e1000.hpp" #include "e1000_defs.hpp" diff --git a/src/drivers/e1000.hpp b/src/drivers/e1000.hpp index 403d316501..55c1dbdbc9 100644 --- a/src/drivers/e1000.hpp +++ b/src/drivers/e1000.hpp @@ -1,19 +1,3 @@ -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2015 Oslo and Akershus University College of Applied Sciences -// and Alfred Bratterud -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. #include #include diff --git a/src/drivers/e1000_defs.hpp b/src/drivers/e1000_defs.hpp index 3da25ab8fa..2fa4c6bdec 100644 --- a/src/drivers/e1000_defs.hpp +++ b/src/drivers/e1000_defs.hpp @@ -1,19 +1,3 @@ -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2015 Oslo and Akershus University College of Applied Sciences -// and Alfred Bratterud -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. #pragma once // see: http://wiki.osdev.org/Intel_Ethernet_i217 diff --git a/src/drivers/heap_debugging.cpp b/src/drivers/heap_debugging.cpp index 3f14ce12ae..b9e440653c 100644 --- a/src/drivers/heap_debugging.cpp +++ b/src/drivers/heap_debugging.cpp @@ -1,19 +1,3 @@ -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2015 Oslo and Akershus University College of Applied Sciences -// and Alfred Bratterud -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. //#define DEBUG // Enable debugging //#define DEBUG2 diff --git a/src/drivers/ide.cpp b/src/drivers/ide.cpp index d048c750a0..6cc3d0b8c1 100644 --- a/src/drivers/ide.cpp +++ b/src/drivers/ide.cpp @@ -1,19 +1,3 @@ -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2015 Oslo and Akershus University College of Applied Sciences -// and Alfred Bratterud -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. /** * Intel IDE Controller datasheet at : diff --git a/src/drivers/ide.hpp b/src/drivers/ide.hpp index 620324e19d..104f8b18cd 100644 --- a/src/drivers/ide.hpp +++ b/src/drivers/ide.hpp @@ -1,19 +1,3 @@ -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2015 Oslo and Akershus University College of Applied Sciences -// and Alfred Bratterud -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. #ifndef DRIVERS_IDE_HPP #define DRIVERS_IDE_HPP diff --git a/src/drivers/solo5blk.hpp b/src/drivers/solo5blk.hpp index 20378e05a7..229bf7169f 100644 --- a/src/drivers/solo5blk.hpp +++ b/src/drivers/solo5blk.hpp @@ -1,19 +1,3 @@ -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2015 Oslo and Akershus University College of Applied Sciences -// and Alfred Bratterud -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. #pragma once #ifndef SOLO5_BLOCK_HPP diff --git a/src/drivers/solo5net.cpp b/src/drivers/solo5net.cpp index c74651bcaa..6098bfb0b3 100644 --- a/src/drivers/solo5net.cpp +++ b/src/drivers/solo5net.cpp @@ -1,19 +1,3 @@ -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2015 Oslo and Akershus University College of Applied Sciences -// and Alfred Bratterud -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. #include "solo5net.hpp" #include diff --git a/src/drivers/solo5net.hpp b/src/drivers/solo5net.hpp index 077eddebd9..593d25b8d0 100644 --- a/src/drivers/solo5net.hpp +++ b/src/drivers/solo5net.hpp @@ -1,19 +1,3 @@ -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2015 Oslo and Akershus University College of Applied Sciences -// and Alfred Bratterud -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. #ifndef VIRTIO_SOLO5NET_HPP #define VIRTIO_SOLO5NET_HPP diff --git a/src/drivers/stdout/bootlog.cpp b/src/drivers/stdout/bootlog.cpp index 7cf9d9bca6..3afa01f48f 100644 --- a/src/drivers/stdout/bootlog.cpp +++ b/src/drivers/stdout/bootlog.cpp @@ -1,19 +1,3 @@ -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2015 Oslo and Akershus University College of Applied Sciences -// and Alfred Bratterud -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. // enable logging during boot bool os_enable_boot_logging = true; diff --git a/src/drivers/stdout/default_stdout.cpp b/src/drivers/stdout/default_stdout.cpp index 8635760d83..4a42d9ddbd 100644 --- a/src/drivers/stdout/default_stdout.cpp +++ b/src/drivers/stdout/default_stdout.cpp @@ -1,19 +1,3 @@ -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2015 Oslo and Akershus University College of Applied Sciences -// and Alfred Bratterud -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. // add OS default stdout handler bool os_default_stdout = true; diff --git a/src/drivers/stdout/timestamps.cpp b/src/drivers/stdout/timestamps.cpp index becaf3600d..061be1ca22 100644 --- a/src/drivers/stdout/timestamps.cpp +++ b/src/drivers/stdout/timestamps.cpp @@ -1,19 +1,3 @@ -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2015 Oslo and Akershus University College of Applied Sciences -// and Alfred Bratterud -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. #include diff --git a/src/drivers/stdout/vgaout.cpp b/src/drivers/stdout/vgaout.cpp index ae1b7c7d09..f37d2e05b4 100644 --- a/src/drivers/stdout/vgaout.cpp +++ b/src/drivers/stdout/vgaout.cpp @@ -1,19 +1,3 @@ -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2015 Oslo and Akershus University College of Applied Sciences -// and Alfred Bratterud -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. #include diff --git a/src/drivers/virtioblk.hpp b/src/drivers/virtioblk.hpp index 0e6d0c73a2..e1807b8db9 100644 --- a/src/drivers/virtioblk.hpp +++ b/src/drivers/virtioblk.hpp @@ -1,19 +1,3 @@ -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2015 Oslo and Akershus University College of Applied Sciences -// and Alfred Bratterud -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. #pragma once #ifndef VIRTIO_BLOCK_HPP diff --git a/src/drivers/virtiocon.hpp b/src/drivers/virtiocon.hpp index 7ce845abc5..44dbe9f0f5 100644 --- a/src/drivers/virtiocon.hpp +++ b/src/drivers/virtiocon.hpp @@ -1,19 +1,3 @@ -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2015 Oslo and Akershus University College of Applied Sciences -// and Alfred Bratterud -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. #pragma once #ifndef VIRTIO_CONSOLE_HPP diff --git a/src/drivers/virtionet.cpp b/src/drivers/virtionet.cpp index e86657cee0..423a4db25c 100644 --- a/src/drivers/virtionet.cpp +++ b/src/drivers/virtionet.cpp @@ -1,19 +1,3 @@ -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2015 Oslo and Akershus University College of Applied Sciences -// and Alfred Bratterud -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. //#define VNET_DEBUG //#define VNET_DEBUG_RX @@ -50,7 +34,8 @@ struct alignas(SMP_ALIGN) smp_deferred_kick std::vector devs; uint8_t irq; }; -static std::array deferred_devs; +static std::vector deferred_devs; +SMP_RESIZE_GCTOR(deferred_devs); #endif using namespace net; diff --git a/src/drivers/virtionet.hpp b/src/drivers/virtionet.hpp index cdded90431..6256af9110 100644 --- a/src/drivers/virtionet.hpp +++ b/src/drivers/virtionet.hpp @@ -1,19 +1,3 @@ -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2015 Oslo and Akershus University College of Applied Sciences -// and Alfred Bratterud -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. /** @note This virtionet implementation was very much inspired by diff --git a/src/drivers/vmxnet3.cpp b/src/drivers/vmxnet3.cpp index e739420174..984248b51a 100644 --- a/src/drivers/vmxnet3.cpp +++ b/src/drivers/vmxnet3.cpp @@ -1,25 +1,10 @@ -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2015 Oslo and Akershus University College of Applied Sciences -// and Alfred Bratterud -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. // loosely based on iPXE driver as well as from Linux driver by VMware #include "vmxnet3.hpp" #include "vmxnet3_queues.hpp" #include +#include #include #include #include diff --git a/src/drivers/vmxnet3.hpp b/src/drivers/vmxnet3.hpp index 353dbff0a9..29e8e6db68 100644 --- a/src/drivers/vmxnet3.hpp +++ b/src/drivers/vmxnet3.hpp @@ -1,19 +1,3 @@ -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2015 Oslo and Akershus University College of Applied Sciences -// and Alfred Bratterud -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. #include #include diff --git a/src/drivers/vmxnet3_queues.hpp b/src/drivers/vmxnet3_queues.hpp index 9b4c75ffca..ba3345e275 100644 --- a/src/drivers/vmxnet3_queues.hpp +++ b/src/drivers/vmxnet3_queues.hpp @@ -1,19 +1,3 @@ -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2015 Oslo and Akershus University College of Applied Sciences -// and Alfred Bratterud -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. #pragma once #include diff --git a/src/fs/dirent.cpp b/src/fs/dirent.cpp index 47653d7b7d..dff666c23d 100644 --- a/src/fs/dirent.cpp +++ b/src/fs/dirent.cpp @@ -1,19 +1,3 @@ -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2015 Oslo and Akershus University College of Applied Sciences -// and Alfred Bratterud -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. #include diff --git a/src/fs/disk.cpp b/src/fs/disk.cpp index afd2cfbe84..7bbf427e92 100644 --- a/src/fs/disk.cpp +++ b/src/fs/disk.cpp @@ -1,19 +1,3 @@ -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2015 Oslo and Akershus University College of Applied Sciences -// and Alfred Bratterud -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. #include #include diff --git a/src/fs/fat.cpp b/src/fs/fat.cpp index 9aeae7a15d..09b42ee1f4 100644 --- a/src/fs/fat.cpp +++ b/src/fs/fat.cpp @@ -1,19 +1,3 @@ -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2015 Oslo and Akershus University College of Applied Sciences -// and Alfred Bratterud -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. #include #include diff --git a/src/fs/fat_async.cpp b/src/fs/fat_async.cpp index 31c75aa187..d2bd1a1b52 100644 --- a/src/fs/fat_async.cpp +++ b/src/fs/fat_async.cpp @@ -1,19 +1,3 @@ -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2015-2016 Oslo and Akershus University College of Applied Sciences -// and Alfred Bratterud -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. #include diff --git a/src/fs/fat_sync.cpp b/src/fs/fat_sync.cpp index 55b738fac8..01dca4f286 100644 --- a/src/fs/fat_sync.cpp +++ b/src/fs/fat_sync.cpp @@ -1,19 +1,3 @@ -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2015 Oslo and Akershus University College of Applied Sciences -// and Alfred Bratterud -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. #include diff --git a/src/fs/filesystem.cpp b/src/fs/filesystem.cpp index e62d9ad989..b2acbeab77 100644 --- a/src/fs/filesystem.cpp +++ b/src/fs/filesystem.cpp @@ -1,19 +1,3 @@ -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2015 Oslo and Akershus University College of Applied Sciences -// and Alfred Bratterud -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. #include #include diff --git a/src/fs/memdisk.cpp b/src/fs/memdisk.cpp index 75f0d5a016..1aa4d218b7 100644 --- a/src/fs/memdisk.cpp +++ b/src/fs/memdisk.cpp @@ -1,19 +1,3 @@ -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2015 Oslo and Akershus University College of Applied Sciences -// and Alfred Bratterud -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. #include #include diff --git a/src/fs/path.cpp b/src/fs/path.cpp index 3a7470e9c2..8dcfb123c3 100644 --- a/src/fs/path.cpp +++ b/src/fs/path.cpp @@ -1,19 +1,3 @@ -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2015 Oslo and Akershus University College of Applied Sciences -// and Alfred Bratterud -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. #include diff --git a/src/hal/machine.cpp b/src/hal/machine.cpp index cf070aecdf..7e1daaec30 100644 --- a/src/hal/machine.cpp +++ b/src/hal/machine.cpp @@ -1,43 +1,33 @@ -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2018 IncludeOS AS, Oslo, Norway -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. #include #include #include #include -#ifndef INFO_MACHINE +//#define INFO_MACHINE +#ifdef INFO_MACHINE #ifndef USERSPACE_KERNEL #define MINFO(fmt, ...) kprintf("[ Machine ] " fmt, ##__VA_ARGS__) #else #define MINFO(fmt, ...) printf("[ Machine ] " fmt, ##__VA_ARGS__) #endif +#else +#define MINFO(...) /* */ #endif using namespace util; // Reserve some machine memory for e.g. devices // (can still be used by heap as fallback). -static constexpr size_t reserve_mem = 1_MiB; +static constexpr size_t reserve_mem = 1_KiB; // Max percent of memory reserved by machine static constexpr int reserve_pct_max = 10; static_assert(reserve_pct_max > 0 and reserve_pct_max < 90); namespace os { + __attribute__((weak)) + uintptr_t liveupdate_memory_size_mb = 0; Machine::Memory& Machine::memory() noexcept { return impl->memory(); @@ -78,12 +68,9 @@ namespace os::detail { (void*) bits::align(Memory::align, (uintptr_t)raw_mem), size - (bits::align(Memory::align, (uintptr_t)raw_mem) - (uintptr_t)raw_mem) }, - ptr_alloc_(mem_), parts_(ptr_alloc_), device_types_(mem_) - { -#ifndef USERSPACE_KERNEL - kprintf("[%s %s] constructor \n", arch(), name()); -#endif - } + ptr_alloc_(mem_), parts_(ptr_alloc_), device_types_(mem_) { + + } void Machine::init() { MINFO("Initializing heap\n"); @@ -93,7 +80,7 @@ namespace os::detail { #ifndef PLATFORM_x86_solo5 static const size_t SYSTEMLOG_SIZE = 65536; - const size_t LIU_SIZE = (main_mem.size / (100 / 25)) & ~0xfff; + const size_t LIU_SIZE = os::liveupdate_memory_size_mb * 1024 * 1024; auto liu_mem = memory().allocate_back(LIU_SIZE + SYSTEMLOG_SIZE); kernel::state().liveupdate_phys = (uintptr_t) liu_mem.ptr + SYSTEMLOG_SIZE; kernel::state().liveupdate_size = liu_mem.size - SYSTEMLOG_SIZE; @@ -102,14 +89,13 @@ namespace os::detail { // reallocate main memory from remainder main_mem = memory().allocate_largest(); - const auto percent = main_mem.size / (100 / reserve_pct_max); - const auto reserve = std::min(reserve_mem, percent); - main_mem.size -= reserve; - auto back = (uintptr_t)main_mem.ptr + main_mem.size - reserve; + MINFO("Reserving %zu b for machine use\n", reserve_mem); + main_mem.size -= reserve_mem; + auto back = (uintptr_t)main_mem.ptr + main_mem.size - reserve_mem; + MINFO("Deallocating %zu b from back of machine\n", reserve_mem); memory().deallocate((void*)back, reserve_mem); - MINFO("Reserving %zu b for machine use \n", reserve); - kernel::init_heap((uintptr_t)main_mem.ptr,(uintptr_t)((char *)main_mem.ptr + main_mem.size)); + kernel::init_heap((uintptr_t) main_mem.ptr, (uintptr_t) main_mem.ptr + main_mem.size); } const char* Machine::arch() { return Arch::name; } diff --git a/src/hw/nic.cpp b/src/hw/nic.cpp index 52f93dee9a..51fc22f358 100644 --- a/src/hw/nic.cpp +++ b/src/hw/nic.cpp @@ -1,19 +1,3 @@ -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2015 Oslo and Akershus University College of Applied Sciences -// and Alfred Bratterud -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. #include diff --git a/src/hw/pci_device.cpp b/src/hw/pci_device.cpp index 8bc2c56091..54587e7aa4 100644 --- a/src/hw/pci_device.cpp +++ b/src/hw/pci_device.cpp @@ -1,19 +1,3 @@ -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2015 Oslo and Akershus University College of Applied Sciences -// and Alfred Bratterud -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. #include diff --git a/src/hw/pci_manager.cpp b/src/hw/pci_manager.cpp index 9ea9940736..cbb64c2089 100644 --- a/src/hw/pci_manager.cpp +++ b/src/hw/pci_manager.cpp @@ -1,19 +1,3 @@ -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2015 Oslo and Akershus University College of Applied Sciences -// and Alfred Bratterud -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. #include #include diff --git a/src/hw/ps2.cpp b/src/hw/ps2.cpp index 3929cdb0a7..67cf307e68 100644 --- a/src/hw/ps2.cpp +++ b/src/hw/ps2.cpp @@ -1,19 +1,3 @@ -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2015 Oslo and Akershus University College of Applied Sciences -// and Alfred Bratterud -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. #include #include diff --git a/src/hw/serial.cpp b/src/hw/serial.cpp index d703dc032d..dec8ee8ca8 100644 --- a/src/hw/serial.cpp +++ b/src/hw/serial.cpp @@ -1,19 +1,3 @@ -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2015 Oslo and Akershus University College of Applied Sciences -// and Alfred Bratterud -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. #include #include diff --git a/src/include/kernel.hpp b/src/include/kernel.hpp index ad313db534..52d2d19c86 100644 --- a/src/include/kernel.hpp +++ b/src/include/kernel.hpp @@ -1,18 +1,3 @@ -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2018 IncludeOS AS, Oslo, Norway -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. #ifndef KERNEL_HPP #define KERNEL_HPP @@ -45,7 +30,9 @@ namespace kernel { int panics = 0; os::Panic_action panic_action {}; util::KHz cpu_khz {-1}; - //const uintptr_t elf_binary_size = 0; + // Memory Mapping buffer (stored for live updates) + void* mmap_addr = nullptr; + uint32_t mmap_size = 0; }; State& state() noexcept; @@ -78,16 +65,16 @@ namespace kernel { return state().is_live_updated; } - inline const char* cmdline() { + inline const char* cmdline() noexcept { return state().cmdline; } - inline bool is_panicking() noexcept { - return state().panics > 0; + inline int panics() noexcept { + return state().panics; } - inline int panics() { - return state().panics; + inline bool is_panicking() noexcept { + return panics() > 0; } inline os::Panic_action panic_action() noexcept { @@ -128,16 +115,13 @@ namespace kernel { /** Process multiboot info. Called by 'start' if multibooted **/ void multiboot(uint32_t boot_addr); + void multiboot_mmap(void* addr, size_t); multiboot_info_t* bootinfo(); /** Boot with no multiboot params */ void legacy_boot(); - //static constexpr int PAGE_SHIFT = 12; - //static - - void default_stdout(const char*, size_t); /** Resume stuff from a soft reset **/ @@ -146,10 +130,10 @@ namespace kernel { void resume_softreset(intptr_t boot_addr); inline void* liveupdate_storage_area() noexcept { - return (void*)state().liveupdate_loc; + return (void*) state().liveupdate_loc; } - inline void* liveupdate_storage_end() noexcept { - return (void*) (state().liveupdate_loc + state().liveupdate_size); + inline size_t liveupdate_storage_size() noexcept { + return state().liveupdate_size; } void setup_liveupdate(); diff --git a/src/include/kprint b/src/include/kprint index 6d2b304ca3..c32bf70e21 100644 --- a/src/include/kprint +++ b/src/include/kprint @@ -1,21 +1,4 @@ // -*-C-*- -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2015 Oslo and Akershus University College of Applied Sciences -// and Alfred Bratterud -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - #ifndef INCLUDE_KPRINT #define INCLUDE_KPRINT diff --git a/src/kernel/CMakeLists.txt b/src/kernel/CMakeLists.txt index 3cc5d5348b..b3d6d735bf 100644 --- a/src/kernel/CMakeLists.txt +++ b/src/kernel/CMakeLists.txt @@ -7,17 +7,20 @@ set(SRCS memmap.cpp multiboot.cpp os.cpp + panic.cpp profile.cpp - syscalls.cpp service_stub.cpp #scoped_profiler.cpp + smp_common.cpp + smp_utils.cpp # elf.cpp # fiber.cpp # profile.cpp terminal.cpp timers.cpp + threads.cpp + #tls.cpp rng.cpp - tls.cpp vga.cpp context.cpp #context_asm.asm diff --git a/src/kernel/block.cpp b/src/kernel/block.cpp index 61d37aa06b..93497ac817 100644 --- a/src/kernel/block.cpp +++ b/src/kernel/block.cpp @@ -1,19 +1,3 @@ -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2016 Oslo and Akershus University College of Applied Sciences -// and Alfred Bratterud -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. #include #include diff --git a/src/kernel/context.cpp b/src/kernel/context.cpp index b25f769070..557ded2818 100644 --- a/src/kernel/context.cpp +++ b/src/kernel/context.cpp @@ -1,19 +1,3 @@ -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2015 Oslo and Akershus University College of Applied Sciences -// and Alfred Bratterud -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. #include #include diff --git a/src/kernel/context_asm.asm b/src/kernel/context_asm.asm index bdaa5a0387..082ccb0f35 100644 --- a/src/kernel/context_asm.asm +++ b/src/kernel/context_asm.asm @@ -1,19 +1,3 @@ -; This file is a part of the IncludeOS unikernel - www.includeos.org -; -; Copyright 2015 Oslo and Akershus University College of Applied Sciences -; and Alfred Bratterud -; -; Licensed under the Apache License, Version 2.0 (the "License"); -; you may not use this file except in compliance with the License. -; You may obtain a copy of the License at -; -; http://www.apache.org/licenses/LICENSE-2.0 -; -; Unless required by applicable law or agreed to in writing, software -; distributed under the License is distributed on an "AS IS" BASIS, -; WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -; See the License for the specific language governing permissions and -; limitations under the License. USE32 global __context_switch extern __context_switch_delegate diff --git a/src/kernel/cpuid.cpp b/src/kernel/cpuid.cpp index 5ac4f2cbad..74036424db 100644 --- a/src/kernel/cpuid.cpp +++ b/src/kernel/cpuid.cpp @@ -1,19 +1,3 @@ -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2015 Oslo and Akershus University College of Applied Sciences -// and Alfred Bratterud -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. #include #include diff --git a/src/kernel/elf.cpp b/src/kernel/elf.cpp index 696cd6019c..a92e50c283 100644 --- a/src/kernel/elf.cpp +++ b/src/kernel/elf.cpp @@ -1,19 +1,3 @@ -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2015 Oslo and Akershus University College of Applied Sciences -// and Alfred Bratterud -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. #include #include @@ -235,7 +219,7 @@ uintptr_t Elf::resolve_addr(void* addr) return (uintptr_t) addr; } -safe_func_offset Elf::safe_resolve_symbol(void* addr, char* buffer, size_t length) +safe_func_offset Elf::safe_resolve_symbol(const void* addr, char* buffer, size_t length) { return get_parser().getsym_safe((ElfAddr) addr, buffer, length); } @@ -378,6 +362,7 @@ void _move_elf_syms_location(const void* location, void* new_location) } // incoming header auto* hdr = (elfsyms_header*) location; +#ifdef TRUST_BUT_VERIFY // verify CRC sanity check const uint32_t temp_hdr = hdr->sanity_check; hdr->sanity_check = 0; @@ -411,6 +396,7 @@ void _move_elf_syms_location(const void* location, void* new_location) relocs.strsize = 0; return; } +#endif // update header relocs.syms = (ElfSym*) new_location; relocs.entries = hdr->symtab_entries; @@ -478,12 +464,14 @@ void elf_protect_symbol_areas() char* src = (char*) parser.symtab.base; ptrdiff_t size = &parser.strtab.base[parser.strtab.size] - src; if (size % os::mem::min_psize()) size += os::mem::min_psize() - (size & (os::mem::min_psize()-1)); + + INFO2("* Protecting syms %p to %p (size %#zx)\n", src, &src[size], size); if (size == 0) return; + // create the ELF symbols & strings area os::mem::vmmap().assign_range( {(uintptr_t) src, (uintptr_t) src + size-1, "Symbols & strings"}); - INFO2("* Protecting syms %p to %p (size %#zx)", src, &src[size], size); os::mem::protect((uintptr_t) src, size, os::mem::Access::read); } #endif diff --git a/src/kernel/events.cpp b/src/kernel/events.cpp index e6d15beb57..010c0d25da 100644 --- a/src/kernel/events.cpp +++ b/src/kernel/events.cpp @@ -1,37 +1,18 @@ -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2015 Oslo and Akershus University College of Applied Sciences -// and Alfred Bratterud -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. #include +#include #include #include #include #include //#define DEBUG_SMP -static SMP::Array managers; +static std::vector managers; +SMP_RESIZE_GCTOR(managers); Events& Events::get(int cpuid) { -#ifdef INCLUDEOS_SMP_ENABLE return managers.at(cpuid); -#else - (void) cpuid; - return managers[0]; -#endif } Events& Events::get() { @@ -40,9 +21,6 @@ Events& Events::get() void Events::init_local() { - std::memset(event_subs.data(), 0, sizeof(event_subs)); - std::memset(event_pend.data(), 0, sizeof(event_pend)); - if (SMP::cpu_id() == 0) { // prevent legacy IRQs from being free for taking diff --git a/src/kernel/fiber.cpp b/src/kernel/fiber.cpp index bae0b77049..cc633da3c3 100644 --- a/src/kernel/fiber.cpp +++ b/src/kernel/fiber.cpp @@ -1,19 +1,4 @@ // This file is a part of the IntcludeOS unikernel - www.includeos.org -// -// Copyright 2017 Oslo and Akershus University College of Applied Sciences -// and Alfred Bratterud -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. //#define SMP_DEBUG 1 #include @@ -29,8 +14,8 @@ std::atomic Fiber::next_id_{0}; int Fiber::next_id_{0}; #endif -SMP::Array Fiber::main_ = {{nullptr}}; -SMP::Array Fiber::current_ {{nullptr}}; +std::vector Fiber::main_ = {{nullptr}}; +std::vector Fiber::current_ {{nullptr}}; extern "C" { void __fiber_jumpstart(volatile void* th_stack, volatile Fiber* f, volatile void* parent_stack); diff --git a/src/kernel/heap.cpp b/src/kernel/heap.cpp index 2e9a45a6fc..a06b9556f3 100644 --- a/src/kernel/heap.cpp +++ b/src/kernel/heap.cpp @@ -1,19 +1,3 @@ -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2016 Oslo and Akershus University College of Applied Sciences -// and Alfred Bratterud -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. #include #include diff --git a/src/kernel/kernel.cpp b/src/kernel/kernel.cpp index bb04d12b05..ec1e31877d 100644 --- a/src/kernel/kernel.cpp +++ b/src/kernel/kernel.cpp @@ -1,20 +1,3 @@ -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2015-2017 Oslo and Akershus University College of Applied Sciences -// and Alfred Bratterud -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - #include #include #include @@ -25,14 +8,8 @@ #include #include #define MYINFO(X,...) INFO("Kernel", X, ##__VA_ARGS__) - //#define ENABLE_PROFILERS -#ifdef ENABLE_PROFILERS #include -#define PROFILE(name) ScopedProfiler __CONCAT(sp, __COUNTER__){name}; -#else -#define PROFILE(name) /* name */ -#endif using namespace util; @@ -48,9 +25,9 @@ inline static bool is_for_production_use() { return &__for_production_use == (char*) 0x2000; } -kernel::State __kern_state; kernel::State& kernel::state() noexcept { - return __kern_state; + static kernel::State state; + return state; } util::KHz os::cpu_freq() { @@ -58,8 +35,7 @@ util::KHz os::cpu_freq() { } // stdout redirection -using Print_vec = Fixed_vector; -static Print_vec os_print_handlers(Fixedvector_Init::UNINIT); +static Fixed_vector os_print_handlers; // Plugins struct Plugin_desc { @@ -68,7 +44,7 @@ struct Plugin_desc { os::Plugin func; const char* name; }; -static Fixed_vector plugins(Fixedvector_Init::UNINIT); +static Fixed_vector plugins; const char* os::cmdline_args() noexcept { return kernel::cmdline(); @@ -99,44 +75,43 @@ void kernel::post_start() // Enable timestamps (if present) kernel::state().timestamps_ready = true; - // LiveUpdate needs some initialization, although only if present - kernel::setup_liveupdate(); - - // Initialize the system log if plugin is present. - // Dependent on the liveupdate location being set - SystemLog::initialize(); + { + PROFILE("LiveUpdate and SystemLog"); + // LiveUpdate needs some initialization, although only if present + kernel::setup_liveupdate(); - MYINFO("Initializing RNG"); - PROFILE("RNG init"); - RNG::get().init(); + // Initialize the system log if plugin is present. + // Dependent on the liveupdate location being set + SystemLog::initialize(); + } // Seed rand with 32 bits from RNG srand(rng_extract_uint32()); -#ifndef __MACH__ // Custom initialization functions MYINFO("Initializing plugins"); - kernel::run_ctors(&__plugin_ctors_start, &__plugin_ctors_end); -#endif + { + PROFILE("Plugin constructors"); + kernel::run_ctors(&__plugin_ctors_start, &__plugin_ctors_end); - // Run plugins - PROFILE("Plugins init"); - for (auto plugin : plugins) { - INFO2("* Initializing %s", plugin.name); - plugin.func(); + // Run plugins + for (auto plugin : plugins) { + INFO2("* Initializing %s", plugin.name); + plugin.func(); + } } MYINFO("Running service constructors"); FILLINE('-'); - // the boot sequence is over when we get to plugins/Service::start - kernel::state().boot_sequence_passed = true; + { + PROFILE("Service constructors"); + // the boot sequence is over when we get to plugins/Service::start + kernel::state().boot_sequence_passed = true; -#ifndef __MACH__ // Run service constructors - kernel::run_ctors(&__service_ctors_start, &__service_ctors_end); -#endif + kernel::run_ctors(&__service_ctors_start, &__service_ctors_end); + } - PROFILE("Service::start"); // begin service start FILLINE('='); printf(" IncludeOS %s (%s / %u-bit)\n", @@ -165,7 +140,10 @@ void kernel::post_start() } // service program start - Service::start(); + { + PROFILE("Service::start"); + Service::start(); + } } void os::add_stdout(os::print_func func) @@ -225,3 +203,6 @@ void os::print_timestamps(const bool enabled) { kernel::state().timestamps = enabled; } + +#include +struct struct_spinny mr_spinny {}; diff --git a/src/kernel/liveupdate.cpp b/src/kernel/liveupdate.cpp index 03d4695dfb..789df601a8 100644 --- a/src/kernel/liveupdate.cpp +++ b/src/kernel/liveupdate.cpp @@ -21,6 +21,7 @@ void kernel::setup_liveupdate() #endif const size_t size = kernel::state().liveupdate_size; + if (size == 0) return; PRATTLE("Setting up LiveUpdate from %p to %p, %zx\n", (void*) kernel::state().liveupdate_phys, (void*) kernel::state().liveupdate_loc, size); diff --git a/src/kernel/memmap.cpp b/src/kernel/memmap.cpp index d57650b95d..d2bf2a4d47 100644 --- a/src/kernel/memmap.cpp +++ b/src/kernel/memmap.cpp @@ -1,19 +1,3 @@ -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2015-2017 Oslo and Akershus University College of Applied Sciences -// and Alfred Bratterud -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. #include #include diff --git a/src/kernel/multiboot.cpp b/src/kernel/multiboot.cpp index b9b34d0d30..a56037fbec 100644 --- a/src/kernel/multiboot.cpp +++ b/src/kernel/multiboot.cpp @@ -1,19 +1,3 @@ -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2017 Oslo and Akershus University College of Applied Sciences -// and Alfred Bratterud -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. #include @@ -22,8 +6,8 @@ #include #include -#define DEBUG_MULTIBOOT -#if defined(DEBUG_MULTIBOOT) +//#define DEBUG_MULTIBOOT +#ifdef DEBUG_MULTIBOOT #undef debug #define debug(X,...) kprintf(X,##__VA_ARGS__); #define MYINFO(X,...) kprintf("" X "\n", ##__VA_ARGS__) @@ -34,18 +18,9 @@ #define MYINFO(X,...) INFO("Kernel", X, ##__VA_ARGS__) #endif - -extern uintptr_t _end; - - using namespace util::bitops; using namespace util::literals; - -static inline multiboot_info_t* bootinfo(uint32_t addr) -{ - // NOTE: the address is 32-bit and not a pointer - return (multiboot_info_t*) (uintptr_t) addr; -} +extern uintptr_t _end; #if defined(ARCH_aarch64) uint32_t dummy[24]; uintptr_t __multiboot_addr=(uintptr_t)&dummy[0]; @@ -53,6 +28,12 @@ static inline multiboot_info_t* bootinfo(uint32_t addr) extern uint32_t __multiboot_addr; #endif +static inline multiboot_info_t* bootinfo(uint32_t addr) +{ + // NOTE: the address is 32-bit and not a pointer + return (multiboot_info_t*) (uintptr_t) addr; +} + multiboot_info_t* kernel::bootinfo() { return (multiboot_info_t*) (uintptr_t) __multiboot_addr; @@ -70,7 +51,7 @@ uintptr_t _multiboot_memory_end(uintptr_t boot_addr) { // (e.g. multiboot's data area as offset to the _end symbol) uintptr_t _multiboot_free_begin(uintptr_t boot_addr) { - auto* info = bootinfo(boot_addr); + const auto* info = bootinfo(boot_addr); uintptr_t multi_end = reinterpret_cast(&_end); debug("* Multiboot begin: 0x%x \n", info); @@ -84,35 +65,67 @@ uintptr_t _multiboot_free_begin(uintptr_t boot_addr) if (info->cmdline > multi_end) { auto* cmdline_ptr = (const char*) (uintptr_t) info->cmdline; - // Set free begin to after the cmdline string - multi_end = info->cmdline + strlen(cmdline_ptr) + 1; + // Set free begin to after the cmdline string, + // but only if the cmdline is placed after image end + const uintptr_t cmdline_end = info->cmdline + strlen(cmdline_ptr) + 1; + if (cmdline_end > multi_end) multi_end = cmdline_end; } } debug("* Multiboot end: 0x%x \n", multi_end); - if (info->mods_count == 0) + if (info->mods_count == 0) { return multi_end; + } auto* mods_list = (multiboot_module_t*) (uintptr_t) info->mods_addr; debug("* Module list @ %p \n",mods_list); - for (multiboot_module_t* mod = mods_list; - mod < mods_list + info->mods_count; - mod ++) { - + for (auto* mod = mods_list; mod < mods_list + info->mods_count; mod ++) + { debug("\t * Module @ %#x \n", mod->mod_start); debug("\t * Args: %s \n ", (char*) (uintptr_t) mod->cmdline); debug("\t * End: %#x \n ", mod->mod_end); if (mod->mod_end > multi_end) multi_end = mod->mod_end; - } debug("* Multiboot end: 0x%x \n", multi_end); return multi_end; } +void kernel::multiboot_mmap(void* start, size_t size) +{ + const gsl::span mmap { + (multiboot_memory_map_t*) start, + (int) (size / sizeof(multiboot_memory_map_t)) + }; + + for (const auto& map : mmap) + { + const char* str_type = map.type & MULTIBOOT_MEMORY_AVAILABLE ? "FREE" : "RESERVED"; + const uintptr_t addr = map.addr; + const uintptr_t size = map.len; + INFO2(" 0x%010zx - 0x%010zx %s (%zu Kb.)", + map.addr, map.addr + map.len - 1, str_type, map.len / 1024 ); + + if ((map.type & MULTIBOOT_MEMORY_AVAILABLE) == 0) + { + if (util::bits::is_aligned<4_KiB>(map.addr)) { + os::mem::map({addr, addr, os::mem::Access::read | os::mem::Access::write, size}, + "Reserved (Multiboot)"); + continue; + } + // For non-aligned addresses, assign + os::mem::vmmap().assign_range({map.addr, map.addr + map.len-1, "Reserved (Multiboot)"}); + } + else + { + // Map as free memory + } + } +} + void kernel::multiboot(uint32_t boot_addr) { MYINFO("Booted with multiboot"); @@ -148,36 +161,9 @@ void kernel::multiboot(uint32_t boot_addr) INFO2("* Multiboot provided memory map (%zu entries @ %p)", info->mmap_length / sizeof(multiboot_memory_map_t), (void*) (uintptr_t) info->mmap_addr); - gsl::span mmap { - reinterpret_cast(info->mmap_addr), - (int)(info->mmap_length / sizeof(multiboot_memory_map_t)) - }; - - for (auto map : mmap) - { - const char* str_type = map.type & MULTIBOOT_MEMORY_AVAILABLE ? "FREE" : "RESERVED"; - const uintptr_t addr = map.addr; - const uintptr_t size = map.len; - INFO2(" 0x%010zx - 0x%010zx %s (%zu Kb.)", - addr, addr + size - 1, str_type, size / 1024 ); - - if (not (map.type & MULTIBOOT_MEMORY_AVAILABLE)) { - - if (util::bits::is_aligned<4_KiB>(map.addr)) { - os::mem::map({addr, addr, os::mem::Access::read | os::mem::Access::write, size}, - "Reserved (Multiboot)"); - continue; - } - - // For non-aligned addresses, assign - os::mem::vmmap().assign_range({addr, addr + size - 1, "Reserved (Multiboot)"}); - } - else - { - // Map as free memory - //os::mem::map_avail({map.addr, map.addr, {os::mem::Access::read | os::mem::Access::write}, map.len}, "Reserved (Multiboot)"); - } - } + kernel::state().mmap_addr = (void*) (uintptr_t) info->mmap_addr; + kernel::state().mmap_size = info->mmap_length; + multiboot_mmap(kernel::state().mmap_addr, kernel::state().mmap_size); printf("\n"); } diff --git a/src/kernel/os.cpp b/src/kernel/os.cpp index 0ae45b159d..0b6db64f0e 100644 --- a/src/kernel/os.cpp +++ b/src/kernel/os.cpp @@ -1,18 +1,3 @@ -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2018 IncludeOS AS, Oslo, Norway -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. #include #include diff --git a/src/kernel/syscalls.cpp b/src/kernel/panic.cpp similarity index 73% rename from src/kernel/syscalls.cpp rename to src/kernel/panic.cpp index 5bc23e6db4..177847c2f7 100644 --- a/src/kernel/syscalls.cpp +++ b/src/kernel/panic.cpp @@ -1,31 +1,11 @@ -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2015 Oslo and Akershus University College of Applied Sciences -// and Alfred Bratterud -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. #include #include -#include #include #include #include #include -#include #include -#include -#include #if defined (UNITTESTS) && !defined(__MACH__) #define THROW throw() @@ -33,45 +13,18 @@ #define THROW #endif -// We can't use the usual "info", as printf isn't available after call to exit -#define SYSINFO(TEXT, ...) kprintf("%13s ] " TEXT "\n", "[ Kernel", ##__VA_ARGS__) - // Emitted if and only if panic (unrecoverable system wide error) happens static const char* panic_signature = "\x15\x07\t**** PANIC ****"; extern uintptr_t heap_begin; extern uintptr_t heap_end; -/* -extern "C" __attribute__((noreturn)) -void abort_message(const char* format, ...) -{ - static char abort_buf[2048]; - va_list list; - va_start(list, format); - vsnprintf(abort_buf, sizeof(abort_buf), format, list); - va_end(list); - panic(abort_buf); -}*/ - -void _exit(int status) { - SYSINFO("Service exiting with status %d", status); - kernel::default_exit(); - __builtin_unreachable(); -} - -extern "C" -void syscall_SYS_exit_group(int status) -{ - SYSINFO("Service exiting with status %d", status); - kernel::default_exit(); - __builtin_unreachable(); -} - struct alignas(SMP_ALIGN) context_buffer { std::array buffer; }; -static SMP::Array contexts; +static std::vector contexts; +SMP_RESIZE_GCTOR(contexts); + // NOTE: panics cannot be per-cpu because it might not be ready yet // NOTE: it's also used by OS::is_panicking(), used by OS::print(...) @@ -98,9 +51,7 @@ void os::on_panic(on_panic_func func) } extern "C" void double_fault(const char* why); -extern "C" __attribute__((noreturn)) void panic_epilogue(const char*); -extern "C" __attribute__ ((weak)) -void panic_perform_inspection_procedure() {} +__attribute__((noreturn)) static void panic_epilogue(const char*); namespace net { __attribute__((weak)) void print_last_packet() {} @@ -174,10 +125,6 @@ void os::panic(const char* why) noexcept fflush(stderr); SMP::global_unlock(); - // action that restores some system functionality intended for inspection - // NB: Don't call this from double faults - panic_perform_inspection_procedure(); - panic_epilogue(why); } @@ -229,6 +176,15 @@ void panic_epilogue(const char* why) __builtin_unreachable(); } +void __expect_fail(const char *expr, const char *file, int line, const char *func) +{ + SMP::global_lock(); + fprintf(stderr, "%s:%i:%s\n>>> %s\n",file, line, func, expr); + fflush(NULL); + SMP::global_unlock(); + os::panic(expr); +} + // Shutdown the machine when one of the exit functions are called void kernel::default_exit() { __arch_poweroff(); diff --git a/src/kernel/profile.cpp b/src/kernel/profile.cpp index 36ed20b933..ad19bb5b15 100644 --- a/src/kernel/profile.cpp +++ b/src/kernel/profile.cpp @@ -1,19 +1,3 @@ -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2015 Oslo and Akershus University College of Applied Sciences -// and Alfred Bratterud -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. #include #include diff --git a/src/kernel/rng.cpp b/src/kernel/rng.cpp index 9b4c4af3a1..ed4813a9c5 100644 --- a/src/kernel/rng.cpp +++ b/src/kernel/rng.cpp @@ -1,19 +1,3 @@ -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2016 Oslo and Akershus University College of Applied Sciences -// and Alfred Bratterud -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. #include #include @@ -31,7 +15,21 @@ struct alignas(SMP_ALIGN) rng_state int32_t reseed_rounds = 0; delegate reseed_callback = nullptr; }; -static SMP::Array rng; +#ifdef INCLUDEOS_RNG_IS_SHARED +static rng_state shared_rng; +#else +static std::array rng; // DO NOT EDIT +#endif + +inline rng_state& local_rng() noexcept +{ +#ifdef INCLUDEOS_RNG_IS_SHARED + return shared_rng; +#else + return PER_CPU(rng); +#endif +} + // every RESEED_RATE bytes entropy is refilled static const int RESEED_RATE = 4096; @@ -135,20 +133,20 @@ void rng_absorb(const void* input, size_t bytes) size_t absorbing = std::min(bytes - absorbed, SHAKE_128_RATE); xor_bytes(static_cast(input) + absorbed, - reinterpret_cast(PER_CPU(rng).state), + reinterpret_cast(local_rng().state), absorbing); - keccak_1600_p(PER_CPU(rng).state); + keccak_1600_p(local_rng().state); absorbed += absorbing; } - PER_CPU(rng).reseed_counter += RESEED_RATE * bytes; + local_rng().reseed_counter += RESEED_RATE * bytes; } static void reseed_now() { uint64_t value; - for (int i = 0; i < PER_CPU(rng).reseed_rounds; i++) { - PER_CPU(rng).reseed_callback(&value); + for (int i = 0; i < local_rng().reseed_rounds; i++) { + local_rng().reseed_callback(&value); rng_absorb(&value, sizeof(value)); } } @@ -160,23 +158,24 @@ void rng_extract(void* output, size_t bytes) while(copied < bytes) { size_t copying = std::min(bytes - copied, SHAKE_128_RATE); - memcpy(static_cast(output) + copied, PER_CPU(rng).state, copying); - keccak_1600_p(PER_CPU(rng).state); + memcpy(static_cast(output) + copied, local_rng().state, copying); + keccak_1600_p(local_rng().state); copied += copying; } // don't reseed if no callback to do so - if (PER_CPU(rng).reseed_callback == nullptr) return; - PER_CPU(rng).reseed_counter -= bytes; + if (local_rng().reseed_callback == nullptr) return; + local_rng().reseed_counter -= bytes; // reseed when below certain entropy - if (PER_CPU(rng).reseed_counter < 0) { - PER_CPU(rng).reseed_counter = 0; + if (local_rng().reseed_counter < 0) { + local_rng().reseed_counter = 0; reseed_now(); } } +#include void rng_reseed_init(delegate func, int rounds) { - PER_CPU(rng).reseed_callback = func; - PER_CPU(rng).reseed_rounds = rounds; + local_rng().reseed_callback = func; + local_rng().reseed_rounds = rounds; reseed_now(); } diff --git a/src/kernel/scoped_profiler.cpp b/src/kernel/scoped_profiler.cpp index 63bfd76b59..fbf1fe0e59 100644 --- a/src/kernel/scoped_profiler.cpp +++ b/src/kernel/scoped_profiler.cpp @@ -1,34 +1,19 @@ -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2015 Oslo and Akershus University College of Applied Sciences -// and Alfred Bratterud -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. #include #include #include #include -//#include #include #include +#include #include #include #include #include decltype(ScopedProfiler::guard) ScopedProfiler::guard = Guard::NOT_SELECTED; -decltype(ScopedProfiler::entries) ScopedProfiler::entries = {}; +decltype(ScopedProfiler::entries) ScopedProfiler::entries; +static uint64_t base_ticks = 0; void ScopedProfiler::record() { @@ -68,6 +53,7 @@ void ScopedProfiler::record() "rdtsc\n\t" : "=A" (tick_start)); } + if (base_ticks == 0) base_ticks = tick_start; } ScopedProfiler::~ScopedProfiler() @@ -91,13 +77,7 @@ ScopedProfiler::~ScopedProfiler() : "=A" (tick)); } - uint64_t nanos_start = RTC::nanos_now(); - - static uint64_t base_nanos = 0; - if (base_nanos == 0) base_nanos = nanos_start; - nanos_start -= base_nanos; - - uint64_t cycles = tick - tick_start; + const uint64_t cycles = tick - this->tick_start; auto function_address = __builtin_return_address(0); // Find an entry that matches this function_address @@ -106,7 +86,7 @@ ScopedProfiler::~ScopedProfiler() if (entry.function_address == function_address) { // Update the entry - entry.cycles_average = ((entry.cycles_average * entry.num_samples) + cycles) / (entry.num_samples + 1); + entry.cycles_total += cycles; entry.num_samples += 1; return; } @@ -117,16 +97,16 @@ ScopedProfiler::~ScopedProfiler() if (entry.function_address == 0) { // Use this unused entry - char symbol_buffer[4096]; + char symbol_buffer[8192]; const auto symbols = Elf::safe_resolve_symbol(function_address, symbol_buffer, sizeof(symbol_buffer)); entry.name = this->name; entry.function_address = function_address; entry.function_name = symbols.name; - entry.cycles_average = cycles; - entry.nanos_start = nanos_start; - entry.num_samples = 1; + entry.num_samples = 1; + entry.cycles_total = cycles; + entry.ticks_start = this->tick_start; return; } } @@ -163,23 +143,25 @@ std::string ScopedProfiler::get_statistics(bool sorted) // Make sure to keep unused entries last (only sort used entries) std::sort(entries.begin(), entries.begin() + num_entries, [](const Entry& a, const Entry& b) { - return a.cycles_average > b.cycles_average; + return a.cycles_average() < b.cycles_average(); }); } // Add each entry ss.setf(std::ios_base::fixed); - for (auto i = 0u; i < num_entries; i++) + for (unsigned i = 0; i < num_entries; i++) { + using namespace util; const auto& entry = entries[i]; - double timst = entry.nanos_start / 1.0e6; + const uint64_t tickdiff = entry.ticks_start - base_ticks; + double timst = ((double) tickdiff / KHz(os::cpu_freq()).count()); ss.width(10); ss << timst << " ms | "; - double micros = entry.cycles_average / os::cpu_freq().count(); + double micros = (double) entry.cycles_average() / KHz(os::cpu_freq()).count(); ss.width(10); - ss << micros / 1000.0 << " ms | "; + ss << micros << " ms | "; ss.width(7); ss << entry.num_samples << " | "; diff --git a/src/kernel/service_stub.cpp b/src/kernel/service_stub.cpp index b870b6f6bf..47e4624e2a 100644 --- a/src/kernel/service_stub.cpp +++ b/src/kernel/service_stub.cpp @@ -1,19 +1,3 @@ -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2015 Oslo and Akershus University College of Applied Sciences -// and Alfred Bratterud -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. #include diff --git a/src/kernel/smp_common.cpp b/src/kernel/smp_common.cpp new file mode 100644 index 0000000000..738fb129f7 --- /dev/null +++ b/src/kernel/smp_common.cpp @@ -0,0 +1,83 @@ +#include + +namespace smp +{ +smp_main_system main_system; +std::vector systems; + +void task_done_handler() +{ + int next = smp::main_system.bitmap.first_set(); + while (next != -1) + { + // remove bit + smp::main_system.bitmap.atomic_reset(next); + // get jobs from other CPU + std::vector done; + auto& system = smp::systems[next]; + system.flock.lock(); + system.completed.swap(done); + system.flock.unlock(); + + // execute all tasks + for (auto& func : done) func(); + + // get next set bit + next = smp::main_system.bitmap.first_set(); + } +} + +static bool smp_task_doer(smp_worker_system& system) +{ + // early return check, as there is no point in locking when its empty + if (system.tasks.empty()) return false; + + // grab hold on task list + system.tlock.lock(); + + if (system.tasks.empty()) { + system.tlock.unlock(); + // don't try again + return false; + } + + // pick up a task + smp::task task = std::move(system.tasks.front()); + system.tasks.pop_front(); + + system.tlock.unlock(); + + // execute actual task + task.func(); + + // add done function to completed list (only if its callable) + if (task.done != nullptr) + { + // NOTE: specifically pushing to this cpu here, and not main system + auto& system = PER_CPU(smp::systems); + system.flock.lock(); + system.completed.push_back(std::move(task.done)); + system.flock.unlock(); + // signal home + system.work_done = true; + } + return true; +} +void smp_task_handler() +{ + auto& system = PER_CPU(smp::systems); + system.work_done = false; + // cpu-specific tasks + while (smp_task_doer(system)); + // global tasks (by taking from index 0) + while (smp_task_doer(systems[0])); + // if we did any work with done functions, signal back + if (system.work_done) { + // set bit for this CPU + smp::main_system.bitmap.atomic_set(SMP::cpu_id()); + // signal main CPU + SMP::signal_bsp(); + } +} + +} diff --git a/src/kernel/smp_utils.cpp b/src/kernel/smp_utils.cpp new file mode 100644 index 0000000000..c8a0c79c98 --- /dev/null +++ b/src/kernel/smp_utils.cpp @@ -0,0 +1,21 @@ +#include +#include + +void smp_spinlock::lock() +{ + while (!__sync_bool_compare_and_swap(&m_value, 0, 1)) { + while (m_value) _mm_pause(); + } +} +void smp_spinlock::unlock() +{ + __sync_lock_release(&m_value, 0); +} + +void smp_barrier::spin_wait(int max) noexcept +{ + __sync_synchronize(); + while (this->val < max) { + _mm_pause(); + } +} diff --git a/src/kernel/system_log.cpp b/src/kernel/system_log.cpp index 336a691213..bf02fb4248 100644 --- a/src/kernel/system_log.cpp +++ b/src/kernel/system_log.cpp @@ -3,7 +3,7 @@ #include #include #include -#include +#include struct Log_buffer { uint64_t magic; @@ -18,9 +18,10 @@ struct Log_buffer { }; static FixedRingBuffer<16384> temp_mrb; +static smp_spinlock syslog_lock; #define MRB_AREA_SIZE (65536) // 64kb #define MRB_LOG_SIZE (MRB_AREA_SIZE - sizeof(MemoryRingBuffer) - sizeof(Log_buffer)) -#define VIRTUAL_MOVE +//#define VIRTUAL_MOVE static MemoryRingBuffer* mrb = nullptr; static inline RingBuffer* get_mrb() { @@ -33,7 +34,7 @@ inline static char* get_system_log_loc() #if defined(ARCH_x86_64) && defined(VIRTUAL_MOVE) return (char*) ((1ull << 45) - MRB_AREA_SIZE); #else - return (char*) kernel::liveupdate_storage_area() - MRB_AREA_SIZE; + return (char*) kernel::state().liveupdate_phys - MRB_AREA_SIZE; #endif } inline static auto* get_ringbuffer_data() @@ -62,17 +63,22 @@ void SystemLog::clear_flags() void SystemLog::write(const char* buffer, size_t length) { + syslog_lock.lock(); size_t free = get_mrb()->free_space(); if (free < length) { get_mrb()->discard(length - free); } get_mrb()->write(buffer, length); + syslog_lock.unlock(); } std::vector SystemLog::copy() { + syslog_lock.lock(); const auto* buffer = get_mrb()->sequentialize(); - return {buffer, buffer + get_mrb()->size()}; + std::vector copy {buffer, buffer + get_mrb()->size()}; + syslog_lock.unlock(); + return copy; } void SystemLog::initialize() diff --git a/src/kernel/terminal.cpp b/src/kernel/terminal.cpp index d4d4118b53..5e4e2440b1 100644 --- a/src/kernel/terminal.cpp +++ b/src/kernel/terminal.cpp @@ -1,19 +1,3 @@ -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2015 Oslo and Akershus University College of Applied Sciences -// and Alfred Bratterud -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. #include #include diff --git a/src/kernel/threads.cpp b/src/kernel/threads.cpp new file mode 100644 index 0000000000..c78fe12b68 --- /dev/null +++ b/src/kernel/threads.cpp @@ -0,0 +1,358 @@ +#include +#include +#include +#include +#include +#include + +extern "C" { + void __thread_yield(); + void __thread_restore(void* stack); + void __clone_return(void* stack); + long __migrate_resume(void* stack); + long syscall_SYS_set_thread_area(void* u_info); +} +static constexpr bool PRIORITIZE_PARENT = true; + +struct libc_internal { + void* self; + void* dtv; + kernel::Thread* kthread; +}; + +namespace kernel +{ + static long thread_counter = 1; + static Thread core0_main_thread; + + inline long generate_new_thread_id() noexcept { + return __sync_fetch_and_add(&thread_counter, 1); + } + long get_last_thread_id() noexcept { + return thread_counter-1; + } + + std::vector thread_managers; + SMP_RESIZE_GCTOR(thread_managers); + ThreadManager& ThreadManager::get() noexcept { + return PER_CPU(thread_managers); + } + ThreadManager& ThreadManager::get(int cpu) { + return thread_managers.at(cpu); + } + + void Thread::init(long tid, Thread* parent, void* stack) + { + this->tid = tid; + this->parent = parent; + this->my_stack = stack; + if (this->parent) { + this->parent->children.push_back(this); + } + } + void Thread::stack_push(uintptr_t value) + { + this->my_stack = (void*) ((uintptr_t) this->my_stack - sizeof(uintptr_t)); + *((uintptr_t*) this->my_stack) = value; + } + void Thread::libc_store_this() + { + auto* s = (libc_internal*) this->my_tls; + s->kthread = this; + } + void Thread::set_tls(void* newtls) + { + this->my_tls = newtls; + // store ourselves in the guarded libc structure + this->libc_store_this(); + } + + void Thread::suspend(bool yielded, void* ret_stack) + { + THPRINT("Thread %ld suspended, yielded=%d stack=%p\n", + this->tid, yielded, ret_stack); + this->yielded = yielded; + this->stored_stack = ret_stack; + // add to suspended (NB: can throw) + ThreadManager::get().suspend(this); + } + + void Thread::exit() + { + const bool exiting_myself = (get_thread() == this); + auto& tman = ThreadManager::get(); + assert(this->parent != nullptr); + // detach children + for (auto* child : this->children) { + child->parent = tman.main_thread; + } + // temporary copy of parent thread pointer + auto* next = this->parent; + // remove myself from parent + this->detach(); + // CLONE_CHILD_CLEARTID: set userspace TID value to zero + if (this->clear_tid) { + THPRINT("Clearing child value at %p\n", this->clear_tid); + *(pid_t*) this->clear_tid = 0; + } + // delete this thread + tman.erase_thread_safely(this); + // free thread resources + delete this; + // NOTE: cannot deref this after this + if (exiting_myself) + { + if constexpr (PRIORITIZE_PARENT) { + // only resume this thread if its on this CPU + if (tman.has_thread(next->tid)) { + tman.erase_suspension(next); + next->resume(); + } + } + next = tman.wakeup_next(); + next->resume(); + } + } + void Thread::detach() + { + assert(this->parent != nullptr); + auto& pcvec = this->parent->children; + for (auto it = pcvec.begin(); it != pcvec.end(); ++it) { + if (*it == this) { + pcvec.erase(it); + break; + } + } + this->parent = nullptr; + } + void Thread::attach(Thread* parent) + { + this->parent = parent; + parent->children.push_back(this); + } + + void Thread::resume() + { + set_thread_area(this->my_tls); + THPRINT("Returning to tid=%ld tls=%p stack=%p thread=%p\n", + this->tid, this->my_tls, this->stored_stack, get_thread()); + // NOTE: the RAX return value here is CHILD thread id, not this + if (this->yielded == false) { + __clone_return(this->stored_stack); + } + else { + this->yielded = false; + __thread_restore(this->stored_stack); + } + __builtin_unreachable(); + } + + Thread* thread_create(Thread* parent, int flags, + void* ctid, void* stack) noexcept + { + const long tid = generate_new_thread_id(); + try { + auto* thread = new struct Thread; + thread->init(tid, parent, stack); + + // flag for write child TID + if (flags & CLONE_CHILD_SETTID) { + *(pid_t*) ctid = thread->tid; + } + if (flags & CLONE_CHILD_CLEARTID) { + thread->clear_tid = ctid; + } + + ThreadManager::get().insert_thread(thread); + return thread; + } + catch (...) { + return nullptr; + } + } + + Thread* setup_main_thread(long tid) + { + int stack_value; + if (tid == 0) + { + core0_main_thread.init(0, nullptr, (void*) &stack_value); + ThreadManager::get(0).insert_thread(&core0_main_thread); + // allow exiting in main thread + core0_main_thread.set_tls(get_thread_area()); + // make threadmanager0 use this main thread + // NOTE: don't use SMP-aware function here + ThreadManager::get(0).main_thread = &core0_main_thread; + return &core0_main_thread; + } + else + { + auto* main_thread = get_thread(tid); + assert(main_thread->parent == nullptr && "Must be a detached thread"); + ThreadManager::get().main_thread = main_thread; + return main_thread; + } + } + void setup_automatic_thread_multiprocessing() + { + ThreadManager::get().on_new_thread = + [] (ThreadManager& man, Thread* thread) -> Thread* { + auto* kthread = man.detach(thread->tid); + SMP::add_task( + [kthread] () { +#ifdef THREADS_DEBUG + SMP::global_lock(); + THPRINT("CPU %d resuming migrated thread %ld (stack=%p)\n", + SMP::cpu_id(), kthread->tid, + (void*) kthread->my_stack); + SMP::global_unlock(); +#endif + // attach this thread on this core + ThreadManager::get().attach(kthread); + // resume kthread after yielding this thread + ThreadManager::get().finish_migration_to(kthread); + // NOTE: returns here!! + }, nullptr); + // signal that work exists in the global queue + SMP::signal(); + // indicate that the thread has been detached + return nullptr; + }; + } + + void* get_thread_area() + { +# ifdef ARCH_x86_64 + return (void*) x86::CPU::read_msr(IA32_FS_BASE); +# else + #error "Implement me" +# endif + } + + void set_thread_area(void* new_area) { + syscall_SYS_set_thread_area(new_area); + } + + Thread* get_thread(long tid) { + auto& threads = ThreadManager::get().threads; + auto it = threads.find(tid); + if (it != threads.end()) return it->second; + return nullptr; + } + + void resume(long tid) + { + auto* thread = get_thread(tid); + if (thread != nullptr) { + thread->resume(); + __builtin_unreachable(); + } + THPRINT("Could not resume thread, missing: %ld\n", tid); + assert(thread && "Could not find thread id"); + } + + Thread* ThreadManager::detach(long tid) + { + auto* thread = get_thread(tid); + // can't migrate missing thread + assert(thread != nullptr && "Could not find given thread id"); + // can't migrate the main thread + assert(thread != ThreadManager::get().main_thread); + // can't migrate the thread you are in + auto* current = get_thread(); + assert(current != thread && "Can't migrate current thread"); + // remove from old thread manager + if (thread->parent != nullptr) { + thread->detach(); + } + this->erase_thread_safely(thread); + this->erase_suspension(thread); + // return the free, detached thread + return thread; + } + void ThreadManager::attach(Thread* thread) + { + // insert into new thread manager + this->insert_thread(thread); + // attach this thread to the managers main thread + if (this->main_thread) { + thread->attach(this->main_thread); + } + } + void ThreadManager::insert_thread(Thread* thread) + { + threads.emplace( + std::piecewise_construct, + std::forward_as_tuple(thread->tid), + std::forward_as_tuple(thread)); + } + void ThreadManager::erase_thread_safely(Thread* thread) + { + assert(thread != nullptr); + auto it = threads.find(thread->tid); + assert(it != threads.end()); + assert(it->second == thread); + threads.erase(it); + } + Thread* ThreadManager::wakeup_next() + { + assert(!suspended.empty()); + auto* next = suspended.front(); + suspended.pop_front(); + return next; + } + void ThreadManager::erase_suspension(Thread* t) + { + for (auto it = suspended.begin(); it != suspended.end();) + { + if (*it == t) { + it = suspended.erase(it); + } + else { + ++it; + } + } + } + void ThreadManager::finish_migration_to(Thread* thread) + { + // special migration-yield to next thread + this->next_migration_thread = thread; + __thread_yield(); // NOTE: function returns!! + } +} + +// called from __thread_yield assembly, cannot return +extern "C" +void __thread_suspend_and_yield(void* stack) +{ + auto& man = kernel::ThreadManager::get(); + // don't go through the ardous yielding process when alone + if (man.suspended.empty() && man.next_migration_thread == nullptr) { + THPRINT("Nothing to yield to. Returning... thread=%p stack=%p\n", + kernel::get_thread(), stack); + return; + } + // suspend current thread (yielded) + auto* thread = kernel::get_thread(); + thread->suspend(true, stack); + + if (man.next_migration_thread == nullptr) + { + // resume some other thread + auto* next = man.wakeup_next(); + // resume next thread + next->resume(); + } + else + { + // resume migrated thread + auto* kthread = man.next_migration_thread; + man.next_migration_thread = nullptr; + // resume the thread on this core + kernel::set_thread_area(kthread->my_tls); + assert(kernel::get_thread() == kthread); + + __migrate_resume(kthread->my_stack); + } + __builtin_unreachable(); +} diff --git a/src/kernel/timers.cpp b/src/kernel/timers.cpp index 7ea917ad68..15ee6f8abf 100644 --- a/src/kernel/timers.cpp +++ b/src/kernel/timers.cpp @@ -64,6 +64,8 @@ static bool signal_ready = false; struct alignas(SMP_ALIGN) timer_system { + timer_system() = default; + timer_system(timer_system&&) = default; void free_timer(Timers::id_t); void sched_timer(duration_t when, Timers::id_t); @@ -76,16 +78,14 @@ struct alignas(SMP_ALIGN) timer_system // timers sorted by timestamp std::multimap scheduled; /** Stats */ - union { - int64_t i64 = 0; - uint32_t u32; - } dummy; - int64_t* oneshot_started = &dummy.i64; - int64_t* oneshot_stopped = &dummy.i64; - uint32_t* periodic_started = &dummy.u32; - uint32_t* periodic_stopped = &dummy.u32; + int64_t stat64 = 0; + int64_t* oneshot_started = &stat64; + int64_t* oneshot_stopped = &stat64; + uint32_t* periodic_started = (uint32_t*) &stat64; + uint32_t* periodic_stopped = (uint32_t*) &stat64; }; -static SMP::Array systems; +static std::vector systems; +SMP_RESIZE_GCTOR(systems); void timer_system::free_timer(Timers::id_t id) { diff --git a/src/kernel/tls.cpp b/src/kernel/tls.cpp deleted file mode 100644 index 6bd5486915..0000000000 --- a/src/kernel/tls.cpp +++ /dev/null @@ -1,41 +0,0 @@ -#include -#include -#include - -extern char _TDATA_START_; -extern char _TDATA_END_; -extern char _TBSS_START_; -extern char _TBSS_END_; - -namespace tls -{ - static size_t align_value(size_t size) - { - if (size & 15) size += 16 - (size & 15); - return size; - } - - size_t get_tls_size() - { - const auto TDATA_SIZE = &_TDATA_END_ - &_TDATA_START_; - const auto TBSS_SIZE = &_TBSS_END_ - &_TBSS_START_; - return align_value(TDATA_SIZE) + align_value(TBSS_SIZE); - } - - void fill_tls_data(char* data) - { - const auto TDATA_SIZE = &_TDATA_END_ - &_TDATA_START_; - const auto TBSS_SIZE = &_TBSS_END_ - &_TBSS_START_; - - // copy over APs .tdata - char* tdata = data; - memcpy(tdata, &_TDATA_START_, TDATA_SIZE); - // clear APs .tbss - char* tbss = data + align_value(TDATA_SIZE); - memset(tbss, 0, TBSS_SIZE); - - //printf("TLS at %p is %lu -> %lu bytes\n", data, TDATA_SIZE + TBSS_SIZE, align_value(TDATA_SIZE) + align_value(TBSS_SIZE)); - //printf("DATA at %p is %lu -> %lu bytes\n", tdata, TDATA_SIZE, align_value(TDATA_SIZE)); - //printf("TBSS at %p is %lu -> %lu bytes\n", tbss, TBSS_SIZE, align_value(TBSS_SIZE)); - } -} diff --git a/src/kernel/vga.cpp b/src/kernel/vga.cpp index e0b62a1bc7..2c23a832a4 100644 --- a/src/kernel/vga.cpp +++ b/src/kernel/vga.cpp @@ -1,19 +1,3 @@ -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2015 Oslo and Akershus University College of Applied Sciences -// and Alfred Bratterud -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. #include #include diff --git a/src/musl/brk.cpp b/src/musl/brk.cpp index 75f5bddf6b..02ebe79545 100644 --- a/src/musl/brk.cpp +++ b/src/musl/brk.cpp @@ -2,7 +2,7 @@ #include #include #include -#include +#include static uintptr_t brk_begin = 0; static uintptr_t brk_current_end = 0; @@ -30,10 +30,13 @@ size_t brk_bytes_free() { static uintptr_t sys_brk(void* addr) { + mr_spinny.memory.lock(); if (addr == nullptr or (uintptr_t)addr > brk_begin + brk_max or (uintptr_t)addr < brk_begin) { - return brk_current_end; + uintptr_t retval = brk_current_end; + mr_spinny.memory.unlock(); + return retval; } brk_current_end = (uintptr_t)addr; @@ -43,7 +46,9 @@ static uintptr_t sys_brk(void* addr) brk_initialized = brk_current_end; } - return brk_current_end; + uintptr_t retval = brk_current_end; + mr_spinny.memory.unlock(); + return retval; } extern "C" diff --git a/src/musl/exit.cpp b/src/musl/exit.cpp index 00cb83a0a3..71f90c5e2b 100644 --- a/src/musl/exit.cpp +++ b/src/musl/exit.cpp @@ -2,13 +2,39 @@ #include #include #include +#include + +// We can't use the usual "info", as printf isn't available after call to exit +#define SYSINFO(TEXT, ...) kprintf("%13s ] " TEXT "\n", "[ Kernel", ##__VA_ARGS__) __attribute__((noreturn)) static long sys_exit(int status) { - const std::string msg = "Service exited with status " + std::to_string(status) + "\n"; - os::print(msg.data(), msg.size()); - __arch_poweroff(); + auto* t = kernel::get_thread(); + if (t->tid == 0) { + const std::string msg = "Service exited with status " + std::to_string(status) + "\n"; + os::print(msg.data(), msg.size()); + __arch_poweroff(); + } + else { + // exit from a thread +#ifdef THREADS_DEBUG + int64_t ptid = -1; + if (t->parent != nullptr) ptid = t->parent->tid; + THPRINT("thread_exit tid=%ld parent=%p ptid: %ld\n", + t->tid, t->parent, ptid); +#endif + t->exit(); + } + __builtin_unreachable(); +} + +extern "C" +void syscall_SYS_exit_group(int status) +{ + auto* t = kernel::get_thread(); + SYSINFO("Service exiting with status %d (thread %ld)\n", status, t->tid); + kernel::default_exit(); __builtin_unreachable(); } diff --git a/src/musl/futex.cpp b/src/musl/futex.cpp index 1b7c46559f..ed049a3eac 100644 --- a/src/musl/futex.cpp +++ b/src/musl/futex.cpp @@ -1,6 +1,6 @@ #include "stub.hpp" #include -#include +#include #define FUTEX_WAIT 0 #define FUTEX_WAKE 1 @@ -15,22 +15,16 @@ #define FUTEX_PRIVATE 128 #define FUTEX_CLOCK_REALTIME 256 -extern void print_backtrace(); - -static int sys_futex(int *uaddr, int /*futex_op*/, int val, +static int sys_futex(int *uaddr, int futex_op, int val, const struct timespec *timeout, int /*val3*/) { - - if (*uaddr != val){ - return EAGAIN; - } else { - *uaddr = 0; + if ((futex_op & 0xF) == FUTEX_WAIT) + { + if (*uaddr != val) return -EAGAIN; + // we have to yield here because of cooperative threads + // TODO: potential for sleeping here + while (*uaddr == val) __thread_yield(); } - - if (timeout == nullptr){ - kprintf("No timeout\n"); - } - return 0; } diff --git a/src/musl/gettid.cpp b/src/musl/gettid.cpp index 525c957a0a..779cccc391 100644 --- a/src/musl/gettid.cpp +++ b/src/musl/gettid.cpp @@ -1,13 +1,11 @@ -#include "stub.hpp" +#include "common.hpp" +#include static long sys_gettid() { -#ifndef INCLUDEOS_SINGLE_THREADED -#warning "gettid not implemented for threaded IncludeOS" -#endif - return 1; + return kernel::get_tid(); } extern "C" long syscall_SYS_gettid() { - return stubtrace(sys_gettid, "gettid"); + return strace(sys_gettid, "gettid"); } diff --git a/src/musl/kill.cpp b/src/musl/kill.cpp index 3db3f7825b..95dfcc26bb 100644 --- a/src/musl/kill.cpp +++ b/src/musl/kill.cpp @@ -1,19 +1,28 @@ #include "common.hpp" #include +#include -int sys_kill(pid_t /*pid*/, int /*sig*/) { +long sys_kill(pid_t /*pid*/, int /*sig*/) { os::panic("KILL called"); } -int sys_tkill(int /*tid*/, int /*sig*/) { -#ifndef INCLUDEOS_SINGLE_THREADED -# warning "tkill not implemented for threaded IncludeOS" -#endif - os::panic("TKILL called"); +long sys_tkill(int tid, int /*sig*/) +{ + if (tid == 0) { + os::panic("TKILL on main thread"); + } + + auto* thread = kernel::get_thread(tid); + THPRINT("TKILL on tid=%d where thread=%p\n", tid, thread); + if (thread != nullptr) { + thread->exit(); + return 0; + } + return -EINVAL; } -int sys_tgkill(int /*tgid*/, int /*tid*/, int /*sig*/) { - os::panic("TGKILL called"); +long sys_tgkill(int /*tgid*/, int tid, int sig) { + return sys_tkill(tid, sig); } extern "C" diff --git a/src/musl/mmap.cpp b/src/musl/mmap.cpp index f30aefc53b..f4cda3f3a4 100644 --- a/src/musl/mmap.cpp +++ b/src/musl/mmap.cpp @@ -6,7 +6,7 @@ #include #include #include -#include +#include using Alloc = os::mem::Raw_allocator; static Alloc* alloc; @@ -28,12 +28,17 @@ uintptr_t __init_mmap(uintptr_t addr_begin, size_t size) extern "C" __attribute__((weak)) void* kalloc(size_t size) { Expects(kernel::heap_ready()); - return alloc->allocate(size); + mr_spinny.memory.lock(); + auto* data = alloc->allocate(size); + mr_spinny.memory.unlock(); + return data; } extern "C" __attribute__((weak)) void kfree (void* ptr, size_t size) { + mr_spinny.memory.lock(); alloc->deallocate(ptr, size); + mr_spinny.memory.unlock(); } size_t mmap_bytes_used() { diff --git a/src/musl/mprotect.cpp b/src/musl/mprotect.cpp index 5be2bc6cbc..00007e30e7 100644 --- a/src/musl/mprotect.cpp +++ b/src/musl/mprotect.cpp @@ -1,13 +1,25 @@ -#include "common.hpp" +#include "stub.hpp" #include -static long sys_mprotect(void* /*addr*/, size_t /*len*/, int /*prot*/) +static long sys_mprotect(void* addr, size_t len, int prot) { - return -ENOSYS; + if ((uintptr_t) addr & 0xFFF) { + return -EINVAL; + } + if (len & 0xFFF) { + return -EINVAL; + } + // TODO: mprotect(0x900000, 86016, 3) = -38 Function not implemented + if (prot == 0x3) // read & write + { + // all the heap is already read/write + return 0; + } + return -EINVAL; } extern "C" long syscall_SYS_mprotect(void *addr, size_t len, int prot) { - return strace(sys_mprotect, "mprotect", addr, len, prot); + return stubtrace(sys_mprotect, "mprotect", addr, len, prot); } diff --git a/src/musl/nanosleep.cpp b/src/musl/nanosleep.cpp index 06b2a67e29..17be07fb91 100644 --- a/src/musl/nanosleep.cpp +++ b/src/musl/nanosleep.cpp @@ -1,9 +1,28 @@ #include "common.hpp" #include +#include +using namespace std::chrono; -static long sys_nanosleep(const struct timespec */*req*/, struct timespec */*rem*/) +static void nanosleep(nanoseconds nanos) { - return -ENOSYS; + bool ticked = false; + + Timers::oneshot(nanos, + [&ticked] (int) { + ticked = true; + }); + + while (ticked == false) { + os::block(); + } +} + +static long sys_nanosleep(const struct timespec* req, struct timespec */*rem*/) +{ + if (req == nullptr) return -EINVAL; + auto nanos = nanoseconds(req->tv_sec * 1'000'000'000ull + req->tv_nsec); + nanosleep(nanos); + return 0; } extern "C" diff --git a/src/musl/sched_yield.cpp b/src/musl/sched_yield.cpp index 3cf320312c..63772f0e31 100644 --- a/src/musl/sched_yield.cpp +++ b/src/musl/sched_yield.cpp @@ -1,11 +1,21 @@ #include "stub.hpp" +#include static long sys_sched_yield() { - return 0; + THPRINT("sched_yield() called on thread %ld\n", kernel::get_tid()); + __thread_yield(); + return 0; } extern "C" long syscall_SYS_sched_yield() { - return stubtrace(sys_sched_yield, "sched_yield"); + return strace(sys_sched_yield, "sched_yield"); +} + +extern "C" +long syscall_SYS_sched_setscheduler(pid_t /*pid*/, int /*policy*/, + const struct sched_param* /*param*/) +{ + return 0; } diff --git a/src/musl/set_tid_address.cpp b/src/musl/set_tid_address.cpp index 9f83daa68f..76975a6591 100644 --- a/src/musl/set_tid_address.cpp +++ b/src/musl/set_tid_address.cpp @@ -1,17 +1,11 @@ -#include "stub.hpp" +#include "common.hpp" +#include -static struct { - int tid = 1; - int* set_child_tid = nullptr; - int* clear_child_tid = nullptr; -} __main_thread__; - -static long sys_set_tid_address(int* tidptr) { - __main_thread__.clear_child_tid = tidptr; - return __main_thread__.tid; +static long sys_set_tid_address(int* /*tidptr*/) { + return kernel::get_tid(); } extern "C" long syscall_SYS_set_tid_address(int* tidptr) { - return stubtrace(sys_set_tid_address, "set_tid_address", tidptr); + return strace(sys_set_tid_address, "set_tid_address", tidptr); } diff --git a/src/net/buffer_store.cpp b/src/net/buffer_store.cpp index 50592b0acb..be74b84795 100644 --- a/src/net/buffer_store.cpp +++ b/src/net/buffer_store.cpp @@ -1,19 +1,3 @@ -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2015-2016 Oslo and Akershus University College of Applied Sciences -// and Alfred Bratterud -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. #include #include @@ -59,21 +43,22 @@ namespace net { uint8_t* BufferStore::get_buffer() { -#ifdef INCLUDEOS_SMP_ENABLE - scoped_spinlock spinlock(this->plock); -#endif + plock.lock(); if (UNLIKELY(available_.empty())) { if (this->growth_enabled()) this->create_new_pool(); - else + else { + plock.unlock(); throw std::runtime_error("This BufferStore has run out of buffers"); + } } auto* addr = available_.back(); available_.pop_back(); BSD_PRINT("%d: Gave away %p, %zu buffers remain\n", this->index, addr, available()); + plock.unlock(); return addr; } diff --git a/src/net/checksum.cpp b/src/net/checksum.cpp index a45198f2de..11572590a5 100644 --- a/src/net/checksum.cpp +++ b/src/net/checksum.cpp @@ -1,19 +1,3 @@ -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2015-2017 Oslo and Akershus University College of Applied Sciences -// and Alfred Bratterud -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. #include #include diff --git a/src/net/configure.cpp b/src/net/configure.cpp index c983d1ccc7..f10ed3ac80 100644 --- a/src/net/configure.cpp +++ b/src/net/configure.cpp @@ -1,19 +1,3 @@ -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2017 Oslo and Akershus University College of Applied Sciences -// and Alfred Bratterud -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. #include diff --git a/src/net/conntrack.cpp b/src/net/conntrack.cpp index 8f9de6a758..89aabfb014 100644 --- a/src/net/conntrack.cpp +++ b/src/net/conntrack.cpp @@ -1,19 +1,3 @@ -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2017 Oslo and Akershus University College of Applied Sciences -// and Alfred Bratterud -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. #include #include diff --git a/src/net/dhcp/dh4client.cpp b/src/net/dhcp/dh4client.cpp index 8694656e3c..253c6a0b3b 100644 --- a/src/net/dhcp/dh4client.cpp +++ b/src/net/dhcp/dh4client.cpp @@ -1,19 +1,3 @@ -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2015-2017 Oslo and Akershus University College of Applied Sciences -// and Alfred Bratterud -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. //#define DHCP_DEBUG 1 #ifdef DHCP_DEBUG diff --git a/src/net/dhcp/dhcpd.cpp b/src/net/dhcp/dhcpd.cpp index 69a64c0ac1..15dd0a020f 100644 --- a/src/net/dhcp/dhcpd.cpp +++ b/src/net/dhcp/dhcpd.cpp @@ -1,19 +1,3 @@ -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2016-2017 Oslo and Akershus University College of Applied Sciences -// and Alfred Bratterud -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. #include #include #include diff --git a/src/net/dns/client.cpp b/src/net/dns/client.cpp index 7dc16236ff..229b827ce6 100644 --- a/src/net/dns/client.cpp +++ b/src/net/dns/client.cpp @@ -1,19 +1,3 @@ -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2015-2018 Oslo and Akershus University College of Applied Sciences -// and Alfred Bratterud -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. #include #include diff --git a/src/net/dns/dns.cpp b/src/net/dns/dns.cpp index 1af614057c..ed508104f9 100644 --- a/src/net/dns/dns.cpp +++ b/src/net/dns/dns.cpp @@ -1,19 +1,3 @@ -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2015 Oslo and Akershus University College of Applied Sciences -// and Alfred Bratterud -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. //#define DNS_DEBUG 1 #ifdef DNS_DEBUG diff --git a/src/net/dns/query.cpp b/src/net/dns/query.cpp index 323a6ad38c..fc4e8d25c8 100644 --- a/src/net/dns/query.cpp +++ b/src/net/dns/query.cpp @@ -1,18 +1,3 @@ -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2018 IncludeOS AS, Oslo, Norway -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. #include diff --git a/src/net/dns/record.cpp b/src/net/dns/record.cpp index dde246543f..6f10f46e67 100644 --- a/src/net/dns/record.cpp +++ b/src/net/dns/record.cpp @@ -1,18 +1,3 @@ -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2018 IncludeOS AS, Oslo, Norway -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. #include diff --git a/src/net/dns/response.cpp b/src/net/dns/response.cpp index 537b501408..5188e741f8 100644 --- a/src/net/dns/response.cpp +++ b/src/net/dns/response.cpp @@ -1,18 +1,3 @@ -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2018 IncludeOS AS, Oslo, Norway -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. #include diff --git a/src/net/ethernet/ethernet.cpp b/src/net/ethernet/ethernet.cpp index bae993ca13..8e18b43be3 100644 --- a/src/net/ethernet/ethernet.cpp +++ b/src/net/ethernet/ethernet.cpp @@ -1,19 +1,3 @@ -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2015-2017 Oslo and Akershus University College of Applied Sciences -// and Alfred Bratterud -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. //#define ETH_DEBUG 1 #ifdef ETH_DEBUG diff --git a/src/net/ethernet/ethernet_8021q.cpp b/src/net/ethernet/ethernet_8021q.cpp index 5ba3e86151..677afb091b 100644 --- a/src/net/ethernet/ethernet_8021q.cpp +++ b/src/net/ethernet/ethernet_8021q.cpp @@ -1,19 +1,3 @@ -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2017 Oslo and Akershus University College of Applied Sciences -// and Alfred Bratterud -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. //#define VLAN_DEBUG 1 #ifdef VLAN_DEBUG diff --git a/src/net/http/basic_client.cpp b/src/net/http/basic_client.cpp index 793866af0e..f09f207a00 100644 --- a/src/net/http/basic_client.cpp +++ b/src/net/http/basic_client.cpp @@ -1,19 +1,3 @@ -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2016-2017 Oslo and Akershus University College of Applied Sciences -// and Alfred Bratterud -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. #include diff --git a/src/net/http/client.cpp b/src/net/http/client.cpp index 4a5a925e91..ecccd63b5c 100644 --- a/src/net/http/client.cpp +++ b/src/net/http/client.cpp @@ -1,18 +1,3 @@ -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2018 IncludeOS AS, Oslo, Norway -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. #include diff --git a/src/net/http/client_connection.cpp b/src/net/http/client_connection.cpp index 6bf807f720..52a1f1d058 100644 --- a/src/net/http/client_connection.cpp +++ b/src/net/http/client_connection.cpp @@ -1,19 +1,3 @@ -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2017 Oslo and Akershus University College of Applied Sciences -// and Alfred Bratterud -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. #include #include diff --git a/src/net/http/cookie.cpp b/src/net/http/cookie.cpp index c87b4fdcb2..5e726a387e 100644 --- a/src/net/http/cookie.cpp +++ b/src/net/http/cookie.cpp @@ -1,19 +1,3 @@ -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2015-2016 Oslo and Akershus University College of Applied Sciences -// and Alfred Bratterud -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. #include diff --git a/src/net/http/header.cpp b/src/net/http/header.cpp index 2fdac97214..7f7a09d614 100644 --- a/src/net/http/header.cpp +++ b/src/net/http/header.cpp @@ -1,19 +1,3 @@ -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2015-2016 Oslo and Akershus University College of Applied Sciences -// and Alfred Bratterud -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. #include diff --git a/src/net/http/header_fields.cpp b/src/net/http/header_fields.cpp index 967168d96c..be22ddc6dc 100644 --- a/src/net/http/header_fields.cpp +++ b/src/net/http/header_fields.cpp @@ -1,19 +1,3 @@ -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2015-2016 Oslo and Akershus University College of Applied Sciences -// and Alfred Bratterud -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. namespace http { namespace header { diff --git a/src/net/http/message.cpp b/src/net/http/message.cpp index 4c643b9bfc..4f819bbdc8 100644 --- a/src/net/http/message.cpp +++ b/src/net/http/message.cpp @@ -1,19 +1,3 @@ -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2015-2016 Oslo and Akershus University College of Applied Sciences -// and Alfred Bratterud -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. #include diff --git a/src/net/http/mime_types.cpp b/src/net/http/mime_types.cpp index d10594e4b2..8d761dc91a 100644 --- a/src/net/http/mime_types.cpp +++ b/src/net/http/mime_types.cpp @@ -1,19 +1,3 @@ -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2015-2016 Oslo and Akershus University College of Applied Sciences -// and Alfred Bratterud -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. #include diff --git a/src/net/http/request.cpp b/src/net/http/request.cpp index ee2ea204d7..f02dfa86db 100644 --- a/src/net/http/request.cpp +++ b/src/net/http/request.cpp @@ -1,19 +1,3 @@ -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2015-2017 Oslo and Akershus University College of Applied Sciences -// and Alfred Bratterud -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. #include #include diff --git a/src/net/http/response.cpp b/src/net/http/response.cpp index e6bd5b8338..421e7c51bf 100644 --- a/src/net/http/response.cpp +++ b/src/net/http/response.cpp @@ -1,19 +1,3 @@ -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2015-2016 Oslo and Akershus University College of Applied Sciences -// and Alfred Bratterud -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. #include #include diff --git a/src/net/http/response_writer.cpp b/src/net/http/response_writer.cpp index 4a9631659f..d53aaf2881 100644 --- a/src/net/http/response_writer.cpp +++ b/src/net/http/response_writer.cpp @@ -1,19 +1,3 @@ -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2017 Oslo and Akershus University College of Applied Sciences -// and Alfred Bratterud -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. #include diff --git a/src/net/http/server.cpp b/src/net/http/server.cpp index d70ea62c2b..3ac7f49c7b 100644 --- a/src/net/http/server.cpp +++ b/src/net/http/server.cpp @@ -1,19 +1,3 @@ -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2016-2017 Oslo and Akershus University College of Applied Sciences -// and Alfred Bratterud -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. #include #include diff --git a/src/net/http/server_connection.cpp b/src/net/http/server_connection.cpp index 3849b7c7cd..6d2d0ae4e2 100644 --- a/src/net/http/server_connection.cpp +++ b/src/net/http/server_connection.cpp @@ -1,19 +1,3 @@ -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2017 Oslo and Akershus University College of Applied Sciences -// and Alfred Bratterud -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. #include #include diff --git a/src/net/http/status_codes.cpp b/src/net/http/status_codes.cpp index e68b55be99..62848095b8 100644 --- a/src/net/http/status_codes.cpp +++ b/src/net/http/status_codes.cpp @@ -1,19 +1,3 @@ -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2015-2016 Oslo and Akershus University College of Applied Sciences -// and Alfred Bratterud -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. #include diff --git a/src/net/http/time.cpp b/src/net/http/time.cpp index dcf178fa28..2bfc7c71ff 100644 --- a/src/net/http/time.cpp +++ b/src/net/http/time.cpp @@ -1,19 +1,3 @@ -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2015-2016 Oslo and Akershus University College of Applied Sciences -// and Alfred Bratterud -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. #include diff --git a/src/net/http/version.cpp b/src/net/http/version.cpp index f92cb24b17..11f614766d 100644 --- a/src/net/http/version.cpp +++ b/src/net/http/version.cpp @@ -1,19 +1,3 @@ -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2015-2017 Oslo and Akershus University College of Applied Sciences -// and Alfred Bratterud -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. #include #include diff --git a/src/net/https/botan_server.cpp b/src/net/https/botan_server.cpp index d620e05314..6effb9a536 100644 --- a/src/net/https/botan_server.cpp +++ b/src/net/https/botan_server.cpp @@ -1,19 +1,3 @@ -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2017 Oslo and Akershus University College of Applied Sciences -// and Alfred Bratterud -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. #include diff --git a/src/net/https/s2n_server.cpp b/src/net/https/s2n_server.cpp index 96ac479a71..47243e5892 100644 --- a/src/net/https/s2n_server.cpp +++ b/src/net/https/s2n_server.cpp @@ -1,19 +1,3 @@ -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2016-2017 Oslo and Akershus University College of Applied Sciences -// and Alfred Bratterud -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. #include #include diff --git a/src/net/inet.cpp b/src/net/inet.cpp index e7f96f296d..4ef3751205 100644 --- a/src/net/inet.cpp +++ b/src/net/inet.cpp @@ -1,19 +1,3 @@ -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2015-2017 Oslo and Akershus University College of Applied Sciences -// and Alfred Bratterud -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. #include #include diff --git a/src/net/interfaces.cpp b/src/net/interfaces.cpp index 73dd56591f..1c73af360e 100644 --- a/src/net/interfaces.cpp +++ b/src/net/interfaces.cpp @@ -1,19 +1,3 @@ -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2016 Oslo and Akershus University College of Applied Sciences -// and Alfred Bratterud -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. #include #include diff --git a/src/net/ip4/arp.cpp b/src/net/ip4/arp.cpp index bc3323c0d3..e55b2b3c9e 100644 --- a/src/net/ip4/arp.cpp +++ b/src/net/ip4/arp.cpp @@ -1,19 +1,3 @@ -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2015 Oslo and Akershus University College of Applied Sciences -// and Alfred Bratterud -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. //#define ARP_DEBUG 1 #ifdef ARP_DEBUG diff --git a/src/net/ip4/icmp4.cpp b/src/net/ip4/icmp4.cpp index 84af1c5775..a67de39ff7 100644 --- a/src/net/ip4/icmp4.cpp +++ b/src/net/ip4/icmp4.cpp @@ -1,19 +1,3 @@ -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2015-2017 Oslo and Akershus University College of Applied Sciences -// and Alfred Bratterud -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. // #define DEBUG #include diff --git a/src/net/ip4/ip4.cpp b/src/net/ip4/ip4.cpp index 416c01eeab..955d448f13 100644 --- a/src/net/ip4/ip4.cpp +++ b/src/net/ip4/ip4.cpp @@ -1,19 +1,3 @@ -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2015 Oslo and Akershus University College of Applied Sciences -// and Alfred Bratterud -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. //#define IP_DEBUG 1 #ifdef IP_DEBUG diff --git a/src/net/ip6/addr.cpp b/src/net/ip6/addr.cpp index e7003fb253..ae3c98c897 100644 --- a/src/net/ip6/addr.cpp +++ b/src/net/ip6/addr.cpp @@ -1,18 +1,3 @@ -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2018 IncludeOS AS, Oslo, Norway -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. #include diff --git a/src/net/ip6/addr_list.cpp b/src/net/ip6/addr_list.cpp index 74c0eccee8..679ec00509 100644 --- a/src/net/ip6/addr_list.cpp +++ b/src/net/ip6/addr_list.cpp @@ -1,19 +1,3 @@ -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2018-2019 Oslo and Akershus University College of Applied Sciences -// and Alfred Bratterud -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. #include diff --git a/src/net/ip6/extension_header.cpp b/src/net/ip6/extension_header.cpp index f0b8dac089..2f727afe75 100644 --- a/src/net/ip6/extension_header.cpp +++ b/src/net/ip6/extension_header.cpp @@ -1,18 +1,3 @@ -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2018 IncludeOS AS, Oslo, Norway -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. #include #include diff --git a/src/net/ip6/icmp6.cpp b/src/net/ip6/icmp6.cpp index 97747a820a..b5e6b1fe0b 100644 --- a/src/net/ip6/icmp6.cpp +++ b/src/net/ip6/icmp6.cpp @@ -1,19 +1,3 @@ -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2015 Oslo and Akershus University College of Applied Sciences -// and Alfred Bratterud -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. //#define ICMP6_DEBUG 1 #ifdef ICMP6_DEBUG diff --git a/src/net/ip6/ip6.cpp b/src/net/ip6/ip6.cpp index 79e4f3ade4..251d7925a6 100644 --- a/src/net/ip6/ip6.cpp +++ b/src/net/ip6/ip6.cpp @@ -1,19 +1,3 @@ -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2015 Oslo and Akershus University College of Applied Sciences -// and Alfred Bratterud -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. //#define IP6_DEBUG 1 #ifdef IP6_DEBUG diff --git a/src/net/ip6/mld.cpp b/src/net/ip6/mld.cpp index c4c6189c10..18961e2fcc 100644 --- a/src/net/ip6/mld.cpp +++ b/src/net/ip6/mld.cpp @@ -1,19 +1,3 @@ -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2015 Oslo and Akershus University College of Applied Sciences -// and Alfred Bratterud -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. //#define MLD_DEBUG 1 #ifdef MLD_DEBUG diff --git a/src/net/ip6/ndp.cpp b/src/net/ip6/ndp.cpp index a36cded004..87f6359bb0 100644 --- a/src/net/ip6/ndp.cpp +++ b/src/net/ip6/ndp.cpp @@ -1,19 +1,3 @@ -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2015 Oslo and Akershus University College of Applied Sciences -// and Alfred Bratterud -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. //#define NDP_DEBUG 1 #ifdef NDP_DEBUG diff --git a/src/net/ip6/slaac.cpp b/src/net/ip6/slaac.cpp index 702e775de3..4dec8bf53b 100644 --- a/src/net/ip6/slaac.cpp +++ b/src/net/ip6/slaac.cpp @@ -1,19 +1,3 @@ -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2015 Oslo and Akershus University College of Applied Sciences -// and Alfred Bratterud -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. //#define SLAAC_DEBUG 1 #ifdef SLAAC_DEBUG diff --git a/src/net/ip6/udp6.cpp b/src/net/ip6/udp6.cpp index efe24fbea4..52432d0a5a 100644 --- a/src/net/ip6/udp6.cpp +++ b/src/net/ip6/udp6.cpp @@ -1,19 +1,5 @@ -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2015 Oslo and Akershus University College of Applied Sciences -// and Alfred Bratterud -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at // -// http://www.apache.org/licenses/LICENSE-2.0 // -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. //#define DEBUG #include diff --git a/src/net/nat/napt.cpp b/src/net/nat/napt.cpp index a88668b45b..01da5a51d5 100644 --- a/src/net/nat/napt.cpp +++ b/src/net/nat/napt.cpp @@ -1,19 +1,3 @@ -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2017 Oslo and Akershus University College of Applied Sciences -// and Alfred Bratterud -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. #include #include diff --git a/src/net/nat/nat.cpp b/src/net/nat/nat.cpp index b41caffa58..7211c8f044 100644 --- a/src/net/nat/nat.cpp +++ b/src/net/nat/nat.cpp @@ -1,19 +1,3 @@ -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2017 Oslo and Akershus University College of Applied Sciences -// and Alfred Bratterud -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. #include #include diff --git a/src/net/packet_debug.cpp b/src/net/packet_debug.cpp index 50209c7d9d..30324765c0 100644 --- a/src/net/packet_debug.cpp +++ b/src/net/packet_debug.cpp @@ -1,18 +1,3 @@ -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2018 IncludeOS AS, Oslo, Norway -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. #include #include diff --git a/src/net/tcp/connection.cpp b/src/net/tcp/connection.cpp index 1ceaf0dc50..726eb265fd 100644 --- a/src/net/tcp/connection.cpp +++ b/src/net/tcp/connection.cpp @@ -1,19 +1,3 @@ -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2015-2016 Oslo and Akershus University College of Applied Sciences -// and Alfred Bratterud -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. // #define DEBUG // #define DEBUG2 @@ -884,7 +868,6 @@ void Connection::recv_data(const Packet_view& in) // * Data cannot be duplicate (already S-acked) // * Read buffer needs to have room for the data // * SACK list needs to have room for the entry (either connects or new) -// // For now, only full segments are allowed (not partial), // meaning the data will get thrown away if the read buffer not fully fits it. // This makes everything much easier. diff --git a/src/net/tcp/connection_states.cpp b/src/net/tcp/connection_states.cpp index 0b6d055df1..dd90f2789a 100644 --- a/src/net/tcp/connection_states.cpp +++ b/src/net/tcp/connection_states.cpp @@ -1,19 +1,3 @@ -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2015-2016 Oslo and Akershus University College of Applied Sciences -// and Alfred Bratterud -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. #include diff --git a/src/net/tcp/listener.cpp b/src/net/tcp/listener.cpp index 77b32532d8..29c4d3cdbf 100644 --- a/src/net/tcp/listener.cpp +++ b/src/net/tcp/listener.cpp @@ -1,19 +1,3 @@ -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2015-2016 Oslo and Akershus University College of Applied Sciences -// and Alfred Bratterud -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. #include #include diff --git a/src/net/tcp/read_buffer.cpp b/src/net/tcp/read_buffer.cpp index 5745c969d1..cd688a6d05 100644 --- a/src/net/tcp/read_buffer.cpp +++ b/src/net/tcp/read_buffer.cpp @@ -1,19 +1,3 @@ -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2015-2017 Oslo and Akershus University College of Applied Sciences -// and Alfred Bratterud -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. #include #include diff --git a/src/net/tcp/read_request.cpp b/src/net/tcp/read_request.cpp index d4fb300257..baac39f4d6 100644 --- a/src/net/tcp/read_request.cpp +++ b/src/net/tcp/read_request.cpp @@ -1,19 +1,3 @@ -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2018 Oslo and Akershus University College of Applied Sciences -// and Alfred Bratterud -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. #include diff --git a/src/net/tcp/rttm.cpp b/src/net/tcp/rttm.cpp index 0d32a2638a..38811fd142 100644 --- a/src/net/tcp/rttm.cpp +++ b/src/net/tcp/rttm.cpp @@ -1,19 +1,3 @@ -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2015-2016 Oslo and Akershus University College of Applied Sciences -// and Alfred Bratterud -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. #include diff --git a/src/net/tcp/tcp.cpp b/src/net/tcp/tcp.cpp index f9cadcdf24..bc730c7d50 100644 --- a/src/net/tcp/tcp.cpp +++ b/src/net/tcp/tcp.cpp @@ -1,19 +1,3 @@ -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2015-2016 Oslo and Akershus University College of Applied Sciences -// and Alfred Bratterud -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. //#define TCP_DEBUG 1 #ifdef TCP_DEBUG diff --git a/src/net/tcp/tcp_conntrack.cpp b/src/net/tcp/tcp_conntrack.cpp index 789a158149..ef39b5a599 100644 --- a/src/net/tcp/tcp_conntrack.cpp +++ b/src/net/tcp/tcp_conntrack.cpp @@ -1,18 +1,3 @@ -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2018 IncludeOS AS, Oslo, Norway -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. //#define CT_DEBUG 1 #ifdef CT_DEBUG diff --git a/src/net/tcp/write_queue.cpp b/src/net/tcp/write_queue.cpp index 0c866de7f4..2223154b79 100644 --- a/src/net/tcp/write_queue.cpp +++ b/src/net/tcp/write_queue.cpp @@ -1,19 +1,3 @@ -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2015-2017 Oslo and Akershus University College of Applied Sciences -// and Alfred Bratterud -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. #include diff --git a/src/net/udp/socket.cpp b/src/net/udp/socket.cpp index 8be3c59e76..bf86b33152 100644 --- a/src/net/udp/socket.cpp +++ b/src/net/udp/socket.cpp @@ -1,19 +1,3 @@ -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2015 Oslo and Akershus University College of Applied Sciences -// and Alfred Bratterud -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. #include #include diff --git a/src/net/udp/udp.cpp b/src/net/udp/udp.cpp index bb6cd6a8ab..7bd7a98767 100644 --- a/src/net/udp/udp.cpp +++ b/src/net/udp/udp.cpp @@ -1,19 +1,3 @@ -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2015 Oslo and Akershus University College of Applied Sciences -// and Alfred Bratterud -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. //#define UDP_DEBUG 1 #ifdef UDP_DEBUG diff --git a/src/net/vlan_manager.cpp b/src/net/vlan_manager.cpp index 4ba50196a9..5b6ddee680 100644 --- a/src/net/vlan_manager.cpp +++ b/src/net/vlan_manager.cpp @@ -1,19 +1,3 @@ -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2017 Oslo and Akershus University College of Applied Sciences -// and Alfred Bratterud -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. //#define VLAN_DEBUG 1 #ifdef VLAN_DEBUG diff --git a/src/net/ws/websocket.cpp b/src/net/ws/websocket.cpp index 9989c94b1f..a3308e8d75 100644 --- a/src/net/ws/websocket.cpp +++ b/src/net/ws/websocket.cpp @@ -1,19 +1,3 @@ -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2016-2017 Oslo and Akershus University College of Applied Sciences -// and Alfred Bratterud -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. #include #include diff --git a/src/platform/aarch64_vm/kernel_start.cpp b/src/platform/aarch64_vm/kernel_start.cpp index 164390e4a0..2806793d34 100644 --- a/src/platform/aarch64_vm/kernel_start.cpp +++ b/src/platform/aarch64_vm/kernel_start.cpp @@ -1,19 +1,3 @@ -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2017 Oslo and Akershus University College of Applied Sciences -// and Alfred Bratterud -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. #include diff --git a/src/platform/aarch64_vm/sanity_checks.cpp b/src/platform/aarch64_vm/sanity_checks.cpp index b9d381615a..7efa42d928 100644 --- a/src/platform/aarch64_vm/sanity_checks.cpp +++ b/src/platform/aarch64_vm/sanity_checks.cpp @@ -1,19 +1,3 @@ -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2015 Oslo and Akershus University College of Applied Sciences -// and Alfred Bratterud -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. #include #include diff --git a/src/platform/aarch64_vm/start.asm b/src/platform/aarch64_vm/start.asm index 3a13774c85..ff71971de6 100644 --- a/src/platform/aarch64_vm/start.asm +++ b/src/platform/aarch64_vm/start.asm @@ -1,21 +1,3 @@ -/*;; This file is a part of the IncludeOS unikernel - www.includeos.org -;; -;; Copyright 2015-2016 Oslo and Akershus University College of Applied Sciences -;; and Alfred Bratterud -;; -;; Licensed under the Apache License, Version 2.0 (the "License"); -;; you may not use this file except in compliance with the License. -;; You may obtain a copy of the License at -;; -;; http:;;www.apache.org/licenses/LICENSE-2.0 -;; -;; Unless required by applicable law or agreed to in writing, software -;; distributed under the License is distributed on an "AS IS" BASIS, -;; WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -;; See the License for the specific language governing permissions and -;; limitations under the License. -*/ - //USE32 .extern __arch_start .extern __serial_print1 diff --git a/src/platform/kvm/kvmclock.cpp b/src/platform/kvm/kvmclock.cpp index a2410001e3..ddde69b679 100644 --- a/src/platform/kvm/kvmclock.cpp +++ b/src/platform/kvm/kvmclock.cpp @@ -20,7 +20,8 @@ struct alignas(4096) pvclock_vcpu_time_info { unsigned char flags; unsigned char pad[2]; }__attribute__((packed)); -static SMP::Array vcpu_time; +static std::vector vcpu_time; +SMP_RESIZE_GCTOR(vcpu_time); struct alignas(4096) pvclock_wall_clock { uint32_t version; diff --git a/src/platform/kvm/pv_eoi.cpp b/src/platform/kvm/pv_eoi.cpp index ae32190416..201dbb36f5 100644 --- a/src/platform/kvm/pv_eoi.cpp +++ b/src/platform/kvm/pv_eoi.cpp @@ -24,7 +24,7 @@ struct alignas(SMP_ALIGN) pv_eoi { uint32_t eoi_word = 0; }; -static SMP::Array exitless_eoi; +static std::array exitless_eoi; extern "C" void kvm_pv_eoi() diff --git a/src/platform/x86_nano/kernel_start.cpp b/src/platform/x86_nano/kernel_start.cpp index e18db56512..93e4fca90f 100644 --- a/src/platform/x86_nano/kernel_start.cpp +++ b/src/platform/x86_nano/kernel_start.cpp @@ -1,19 +1,3 @@ -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2017 Oslo and Akershus University College of Applied Sciences -// and Alfred Bratterud -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. #include #include diff --git a/src/platform/x86_pc/acpi.cpp b/src/platform/x86_pc/acpi.cpp index c5bbce7e8c..30e418a588 100644 --- a/src/platform/x86_pc/acpi.cpp +++ b/src/platform/x86_pc/acpi.cpp @@ -1,19 +1,3 @@ -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2015 Oslo and Akershus University College of Applied Sciences -// and Alfred Bratterud -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. #include "acpi.hpp" #include diff --git a/src/platform/x86_pc/acpi.hpp b/src/platform/x86_pc/acpi.hpp index 118b371094..687e1a7c9e 100644 --- a/src/platform/x86_pc/acpi.hpp +++ b/src/platform/x86_pc/acpi.hpp @@ -1,19 +1,3 @@ -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2015 Oslo and Akershus University College of Applied Sciences -// and Alfred Bratterud -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. #pragma once #ifndef X86_ACPI_HPP diff --git a/src/platform/x86_pc/apic.cpp b/src/platform/x86_pc/apic.cpp index c838883991..4d27252d8b 100644 --- a/src/platform/x86_pc/apic.cpp +++ b/src/platform/x86_pc/apic.cpp @@ -1,19 +1,3 @@ -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2015 Oslo and Akershus University College of Applied Sciences -// and Alfred Bratterud -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. #include "apic.hpp" #include "ioapic.hpp" diff --git a/src/platform/x86_pc/apic.hpp b/src/platform/x86_pc/apic.hpp index 78f08991ad..487f9947b6 100644 --- a/src/platform/x86_pc/apic.hpp +++ b/src/platform/x86_pc/apic.hpp @@ -1,19 +1,3 @@ -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2015 Oslo and Akershus University College of Applied Sciences -// and Alfred Bratterud -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. #pragma once #ifndef HW_APIC_HPP diff --git a/src/platform/x86_pc/apic_boot.asm b/src/platform/x86_pc/apic_boot.asm index 4be93f3bde..44bef9f8da 100644 --- a/src/platform/x86_pc/apic_boot.asm +++ b/src/platform/x86_pc/apic_boot.asm @@ -1,23 +1,5 @@ -; This file is a part of the IncludeOS unikernel - www.includeos.org -; -; Copyright 2015 Oslo and Akershus University College of Applied Sciences -; and Alfred Bratterud -; -; Licensed under the Apache License, Version 2.0 (the "License"); -; you may not use this file except in compliance with the License. -; You may obtain a copy of the License at -; -; http://www.apache.org/licenses/LICENSE-2.0 -; -; Unless required by applicable law or agreed to in writing, software -; distributed under the License is distributed on an "AS IS" BASIS, -; WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -; See the License for the specific language governing permissions and -; limitations under the License. -; ; Thanks to Maghsoud for paving the way to SMP! ; We are still calling them Revenants -; org 0x10000 BITS 16 ; 2-bytes of jmp instruction, but aligned to 4-bytes (!) @@ -93,21 +75,8 @@ protected_mode: mov ebp, eax mov esp, ebp - ; enable SSE - call enable_sse - push ebx call [revenant_main] ; stop execution cli hlt - -enable_sse: - mov eax, cr0 - and ax, 0xFFFB ;clear coprocessor emulation CR0.EM - or ax, 0x2 ;set coprocessor monitoring CR0.MP - mov cr0, eax - mov eax, cr4 - or ax, 3 << 9 ;set CR4.OSFXSR and CR4.OSXMMEXCPT at the same time - mov cr4, eax - ret diff --git a/src/platform/x86_pc/apic_iface.hpp b/src/platform/x86_pc/apic_iface.hpp index ef3d3c5a19..21ae0825eb 100644 --- a/src/platform/x86_pc/apic_iface.hpp +++ b/src/platform/x86_pc/apic_iface.hpp @@ -1,19 +1,3 @@ -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2015 Oslo and Akershus University College of Applied Sciences -// and Alfred Bratterud -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. #pragma once #ifndef X86_APIC_IFACE_HPP diff --git a/src/platform/x86_pc/apic_regs.hpp b/src/platform/x86_pc/apic_regs.hpp index fe21d95a17..22a2848bbd 100644 --- a/src/platform/x86_pc/apic_regs.hpp +++ b/src/platform/x86_pc/apic_regs.hpp @@ -1,19 +1,3 @@ -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2015 Oslo and Akershus University College of Applied Sciences -// and Alfred Bratterud -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. #pragma once #ifndef HW_APIC_REGS_HPP diff --git a/src/platform/x86_pc/apic_revenant.cpp b/src/platform/x86_pc/apic_revenant.cpp index bbc564f2d2..8be2cf0dd3 100644 --- a/src/platform/x86_pc/apic_revenant.cpp +++ b/src/platform/x86_pc/apic_revenant.cpp @@ -3,126 +3,90 @@ #include "apic_timer.hpp" #include "clocks.hpp" #include "idt.hpp" +#include "init_libc.hpp" #include -//#include -#include #include -#include +#include +#include +#include namespace x86 { extern void initialize_cpu_tables_for_cpu(int); - smp_stuff smp_main; - SMP::Array smp_system; } - -extern "C" void* get_cpu_esp(); -extern "C" void lapic_exception_handler(); #define INFO(FROM, TEXT, ...) printf("%13s ] " TEXT "\n", "[ " FROM, ##__VA_ARGS__) -using namespace x86; - -static bool revenant_task_doer(smp_system_stuff& system) +void revenant_thread_main(int cpu) { - // grab hold on task list - lock(system.tlock); + sched_yield(); + uintptr_t this_stack = smp::main_system.stack_base + cpu * smp::main_system.stack_size; - if (system.tasks.empty()) { - unlock(system.tlock); - // try again - return false; - } + // show we are online, and verify CPU ID is correct + SMP::global_lock(); + INFO2("AP %d started at %p", SMP::cpu_id(), (void*) this_stack); + SMP::global_unlock(); + Expects(cpu == SMP::cpu_id()); - // create local vector which holds tasks - std::vector tasks; - system.tasks.swap(tasks); + auto& ev = Events::get(cpu); + ev.init_local(); + // subscribe to task and timer interrupts + ev.subscribe(0, smp::smp_task_handler); + ev.subscribe(1, x86::APIC_Timer::start_timers); + // enable interrupts + asm volatile("sti"); + // init timer system + x86::APIC_Timer::init(); + // initialize clocks + x86::Clocks::init(); +#ifndef INCLUDEOS_RNG_IS_SHARED + // NOTE: its faster if we can steal RNG from main CPU, but not scaleable + // perhaps its just better to do it like this, or even share RNG + RNG::get().init(); +#endif - unlock(system.tlock); + // allow programmers to do stuff on each core at init + SMP::init_task(); - for (auto& task : tasks) - { - // execute actual task - task.func(); + // signal that the revenant has started + smp::main_system.boot_barrier.increment(); - // add done function to completed list (only if its callable) - if (task.done) + SMP::global_lock(); + smp::main_system.initialized_cpus.push_back(cpu); + SMP::global_unlock(); + while (true) { - // NOTE: specifically pushing to 'smp' here, and not 'system' - lock(PER_CPU(smp_system).flock); - PER_CPU(smp_system).completed.push_back(std::move(task.done)); - unlock(PER_CPU(smp_system).flock); - // signal home - PER_CPU(smp_system).work_done = true; + Events::get().process_events(); + os::halt(); } - } - return true; -} -static void revenant_task_handler() -{ - auto& system = PER_CPU(smp_system); - system.work_done = false; - // cpu-specific tasks - while(revenant_task_doer(PER_CPU(smp_system))); - // global tasks (by taking from index 0) - while (revenant_task_doer(smp_system[0])); - // if we did any work with done functions, signal back - if (system.work_done) { - // set bit for this CPU - smp_main.bitmap.atomic_set(SMP::cpu_id()); - // signal main CPU - x86::APIC::get().send_bsp_intr(); - } + __builtin_unreachable(); } +extern "C" void revenant_main(int cpu) { - uintptr_t this_stack = smp_main.stack_base + cpu * smp_main.stack_size; - uintptr_t this_stack_end = this_stack - smp_main.stack_size; // enable Local APIC x86::APIC::get().smp_enable(); // setup GDT & per-cpu feature x86::initialize_cpu_tables_for_cpu(cpu); - // show we are online, and verify CPU ID is correct - SMP::global_lock(); - auto stack = (uintptr_t) get_cpu_esp(); - INFO2("AP %d started at %p", SMP::cpu_id(), (void*) this_stack); - SMP::global_unlock(); // initialize exceptions before asserts x86::idt_initialize_for_cpu(cpu); - assert(cpu == SMP::cpu_id()); - assert(stack >= this_stack_end && stack < this_stack); #ifdef ARCH_x86_64 // interrupt stack tables - ist_initialize_for_cpu(cpu, this_stack); -#endif - - auto& ev = Events::get(cpu); - ev.init_local(); - // subscribe to task and timer interrupts - ev.subscribe(0, revenant_task_handler); - ev.subscribe(1, APIC_Timer::start_timers); - // enable interrupts - asm volatile("sti"); - // init timer system - APIC_Timer::init(); - // initialize clocks - Clocks::init(); - // seed RNG - RNG::get().init(); + uintptr_t this_stack = + smp::main_system.stack_base + cpu * smp::main_system.stack_size; + x86::ist_initialize_for_cpu(cpu, this_stack); - // allow programmers to do stuff on each core at init - SMP::init_task(); - - // signal that the revenant has started - smp_main.boot_barrier.inc(); + const uint64_t star_kernel_cs = 8ull << 32; + const uint64_t star_user_cs = 8ull << 48; + const uint64_t star = star_kernel_cs | star_user_cs; + x86::CPU::write_msr(IA32_STAR, star); + x86::CPU::write_msr(IA32_LSTAR, (uintptr_t)&__syscall_entry); +#endif - SMP::global_lock(); - x86::smp_main.initialized_cpus.push_back(cpu); - SMP::global_unlock(); - while (true) - { - Events::get().process_events(); - os::halt(); - } + auto& system = PER_CPU(smp::systems); + // setup main thread + auto* kthread = kernel::setup_main_thread(system.main_thread_id); + // resume APs main thread + kthread->resume(); __builtin_unreachable(); } diff --git a/src/platform/x86_pc/apic_revenant.hpp b/src/platform/x86_pc/apic_revenant.hpp index bee479ee41..301253c76f 100644 --- a/src/platform/x86_pc/apic_revenant.hpp +++ b/src/platform/x86_pc/apic_revenant.hpp @@ -1,64 +1,7 @@ -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2015 Oslo and Akershus University College of Applied Sciences -// and Alfred Bratterud -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - #pragma once #ifndef X86_APIC_REVENANT_HPP #define X86_APIC_REVENANT_HPP -#include "smp.hpp" -#include -#include -#include -#include - -extern "C" void revenant_main(int); - -namespace x86 { -struct smp_task { - smp_task(SMP::task_func a, - SMP::done_func b) - : func(a), done(b) {} - - SMP::task_func func; - SMP::done_func done; -}; - -struct smp_stuff -{ - uintptr_t stack_base; - uintptr_t stack_size; - minimal_barrier_t boot_barrier; - uint32_t bmp_storage[1] = {0}; - std::vector initialized_cpus {0}; - MemBitmap bitmap{&bmp_storage[0], 1}; -}; - - -extern smp_stuff smp_main; - -struct smp_system_stuff -{ - spinlock_t tlock = 0; - spinlock_t flock = 0; - std::vector tasks; - std::vector completed; - bool work_done; -}; - extern SMP::Array smp_system; -} +extern void revenant_thread_main(int cpu); #endif diff --git a/src/platform/x86_pc/apic_timer.cpp b/src/platform/x86_pc/apic_timer.cpp index c905ac7c55..740aaf7a1b 100644 --- a/src/platform/x86_pc/apic_timer.cpp +++ b/src/platform/x86_pc/apic_timer.cpp @@ -1,19 +1,3 @@ -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2015 Oslo and Akershus University College of Applied Sciences -// and Alfred Bratterud -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. #include "apic_timer.hpp" #include "apic.hpp" @@ -45,7 +29,8 @@ namespace x86 int intr; bool intr_enabled = false; }; - static SMP::Array timerdata; + static std::vector timerdata; + SMP_RESIZE_GCTOR(timerdata); #define GET_TIMER() PER_CPU(timerdata) diff --git a/src/platform/x86_pc/apic_timer.hpp b/src/platform/x86_pc/apic_timer.hpp index d0c2d6d572..8a2b9adc24 100644 --- a/src/platform/x86_pc/apic_timer.hpp +++ b/src/platform/x86_pc/apic_timer.hpp @@ -1,20 +1,4 @@ -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2015 Oslo and Akershus University College of Applied Sciences -// and Alfred Bratterud -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. #pragma once #ifndef X86_APIC_TIMER_HPP diff --git a/src/platform/x86_pc/boot/bootloader.asm b/src/platform/x86_pc/boot/bootloader.asm index 9024f94626..bed0b45d7d 100644 --- a/src/platform/x86_pc/boot/bootloader.asm +++ b/src/platform/x86_pc/boot/bootloader.asm @@ -1,20 +1,3 @@ -;; This file is a part of the IncludeOS unikernel - www.includeos.org -;; -;; Copyright 2015 Oslo and Akershus University College of Applied Sciences -;; and Alfred Bratterud -;; -;; Licensed under the Apache License, Version 2.0 (the "License"); -;; you may not use this file except in compliance with the License. -;; You may obtain a copy of the License at -;; -;; http:;;www.apache.org/licenses/LICENSE-2.0 -;; -;; Unless required by applicable law or agreed to in writing, software -;; distributed under the License is distributed on an "AS IS" BASIS, -;; WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -;; See the License for the specific language governing permissions and -;; limitations under the License. - USE16 ;; Memory layout, 16-bit %define _boot_segment 0x07c0 diff --git a/src/platform/x86_pc/boot/disk_read_lba.asm b/src/platform/x86_pc/boot/disk_read_lba.asm index 493e322b5d..cf19ca17cb 100644 --- a/src/platform/x86_pc/boot/disk_read_lba.asm +++ b/src/platform/x86_pc/boot/disk_read_lba.asm @@ -3,13 +3,10 @@ ;; ;; Modification/rewrite of code found at osdev: ;; http://wiki.osdev.org/ATA_read/write_sectors#Read_in_LBA_mode -;; ;; Licence: ...assumed to be in public domain -;; ;; @param EAX Logical Block Address of sector ;; @param CL Number of sectors to read ;; @param EDI The address of buffer to put data obtained from disk -;; ;; @return None ;; ============================================================================= ata_lba_read: diff --git a/src/platform/x86_pc/clocks.cpp b/src/platform/x86_pc/clocks.cpp index 1200a717a3..f9590034e1 100644 --- a/src/platform/x86_pc/clocks.cpp +++ b/src/platform/x86_pc/clocks.cpp @@ -1,19 +1,3 @@ -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2015 Oslo and Akershus University College of Applied Sciences -// and Alfred Bratterud -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. #include "clocks.hpp" #include "../kvm/kvmclock.hpp" @@ -43,7 +27,7 @@ namespace x86 { void Clocks::init() { - if (CPUID::kvm_feature(KVM_FEATURE_CLOCKSOURCE + if (0 && CPUID::kvm_feature(KVM_FEATURE_CLOCKSOURCE | KVM_FEATURE_CLOCKSOURCE2)) { KVM_clock::init(); diff --git a/src/platform/x86_pc/clocks.hpp b/src/platform/x86_pc/clocks.hpp index b6dd34d8bf..2927fbc1ca 100644 --- a/src/platform/x86_pc/clocks.hpp +++ b/src/platform/x86_pc/clocks.hpp @@ -1,19 +1,3 @@ -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2015 Oslo and Akershus University College of Applied Sciences -// and Alfred Bratterud -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. #pragma once #include diff --git a/src/platform/x86_pc/cmos.hpp b/src/platform/x86_pc/cmos.hpp index 7a1196326e..b75c516208 100644 --- a/src/platform/x86_pc/cmos.hpp +++ b/src/platform/x86_pc/cmos.hpp @@ -1,19 +1,3 @@ -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2015-2016 Oslo and Akershus University College of Applied Sciences -// and Alfred Bratterud -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. #ifndef HW_CMOS_HPP #define HW_CMOS_HPP diff --git a/src/platform/x86_pc/cmos_clock.cpp b/src/platform/x86_pc/cmos_clock.cpp index eb99ecd88e..19db95d1b2 100644 --- a/src/platform/x86_pc/cmos_clock.cpp +++ b/src/platform/x86_pc/cmos_clock.cpp @@ -1,19 +1,3 @@ -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2015 Oslo and Akershus University College of Applied Sciences -// and Alfred Bratterud -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. #include "cmos_clock.hpp" #include "cmos.hpp" diff --git a/src/platform/x86_pc/cmos_clock.hpp b/src/platform/x86_pc/cmos_clock.hpp index fed06c5a64..76ab18a517 100644 --- a/src/platform/x86_pc/cmos_clock.hpp +++ b/src/platform/x86_pc/cmos_clock.hpp @@ -1,19 +1,3 @@ -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2015 Oslo and Akershus University College of Applied Sciences -// and Alfred Bratterud -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. #pragma once #include "clocks.hpp" diff --git a/src/platform/x86_pc/cpu_freq_sampling.cpp b/src/platform/x86_pc/cpu_freq_sampling.cpp index 4c671d75bf..5cbbf9296d 100644 --- a/src/platform/x86_pc/cpu_freq_sampling.cpp +++ b/src/platform/x86_pc/cpu_freq_sampling.cpp @@ -1,19 +1,3 @@ -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2015 Oslo and Akershus University College of Applied Sciences -// and Alfred Bratterud -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. //#define DEBUG #include "cpu_freq_sampling.hpp" diff --git a/src/platform/x86_pc/cpu_freq_sampling.hpp b/src/platform/x86_pc/cpu_freq_sampling.hpp index 0eada9adee..7a412041c5 100644 --- a/src/platform/x86_pc/cpu_freq_sampling.hpp +++ b/src/platform/x86_pc/cpu_freq_sampling.hpp @@ -1,19 +1,5 @@ -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2015 Oslo and Akershus University College of Applied Sciences -// and Alfred Bratterud -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at // -// http://www.apache.org/licenses/LICENSE-2.0 // -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. #pragma once #ifndef X86_CPU_FREQ_SAMPLING_HPP diff --git a/src/platform/x86_pc/idt.cpp b/src/platform/x86_pc/idt.cpp index 9344199ea6..7bca3fce79 100644 --- a/src/platform/x86_pc/idt.cpp +++ b/src/platform/x86_pc/idt.cpp @@ -1,9 +1,9 @@ #include "idt.hpp" #include #include -#include #include #include +#include #include #define RING0_CODE_SEG 0x8 diff --git a/src/platform/x86_pc/idt.hpp b/src/platform/x86_pc/idt.hpp index 9ce3680f6a..a40389643b 100644 --- a/src/platform/x86_pc/idt.hpp +++ b/src/platform/x86_pc/idt.hpp @@ -1,19 +1,3 @@ -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2015 Oslo and Akershus University College of Applied Sciences -// and Alfred Bratterud -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. #ifndef KERNEL_IDT_HPP #define KERNEL_IDT_HPP diff --git a/src/platform/x86_pc/init_libc.cpp b/src/platform/x86_pc/init_libc.cpp index 0c1ad65a4d..3f327b0bda 100644 --- a/src/platform/x86_pc/init_libc.cpp +++ b/src/platform/x86_pc/init_libc.cpp @@ -9,6 +9,11 @@ #include #include #include +//#define ENABLE_PROFILERS +#include +#ifdef ENABLE_PROFILERS +static ScopedProfiler* pinit = nullptr; +#endif //#define KERN_DEBUG 1 #ifdef KERN_DEBUG @@ -34,14 +39,19 @@ static void global_ctor_test(){ extern "C" int kernel_main(int, char * *, char * *) { - PRATTLE(" libc initialization complete \n"); +#ifdef ENABLE_PROFILERS + delete pinit; +#endif + { + PROFILE("Kernel main"); + PRATTLE(" libc initialization complete\n"); LL_ASSERT(global_ctors_ok == 42); kernel::state().libc_initialized = true; Elf_binary elf{{(char*)&_ELF_START_, &_ELF_END_ - &_ELF_START_}}; LL_ASSERT(elf.is_ELF() && "ELF header intact"); - PRATTLE(" OS start \n"); + PRATTLE(" OS start\n"); // Initialize early OS, platform and devices #if defined(PLATFORM_x86_pc) @@ -57,9 +67,10 @@ int kernel_main(int, char * *, char * *) // NOTE: because of page protection we can choose to stop checking here kernel_sanity_checks(); - PRATTLE(" post start \n"); + PRATTLE(" post start\n"); // Initialize common subsystems and call Service::start kernel::post_start(); + } // Starting event loop from here allows us to profile OS::start os::event_loop(); @@ -91,7 +102,7 @@ namespace x86 PRATTLE("\tElf size: %zu \n", size); for (int i = 0; i < ehdr->e_phnum; i++) { - PRATTLE("\tPhdr %i @ %p, va_addr: 0x%lx \n", i, &phdr[i], phdr[i].p_vaddr); + PRATTLE("\tPhdr %i @ %p, va_addr: 0x%lx\n", i, &phdr[i], phdr[i].p_vaddr); } #endif @@ -161,6 +172,9 @@ namespace x86 // GDB_ENTRY; PRATTLE("* Starting libc initialization\n"); +#ifdef ENABLE_PROFILERS + pinit = new ScopedProfiler("Init libc + gconstr"); +#endif __libc_start_main(kernel_main, argc, argv.data()); } } diff --git a/src/platform/x86_pc/ioapic.cpp b/src/platform/x86_pc/ioapic.cpp index 8dd09b5aa0..e1ff2ab895 100644 --- a/src/platform/x86_pc/ioapic.cpp +++ b/src/platform/x86_pc/ioapic.cpp @@ -1,19 +1,3 @@ -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2015 Oslo and Akershus University College of Applied Sciences -// and Alfred Bratterud -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. #include "ioapic.hpp" #include diff --git a/src/platform/x86_pc/ioapic.hpp b/src/platform/x86_pc/ioapic.hpp index 77841b81ec..adc3008f2b 100644 --- a/src/platform/x86_pc/ioapic.hpp +++ b/src/platform/x86_pc/ioapic.hpp @@ -1,19 +1,3 @@ -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2015 Oslo and Akershus University College of Applied Sciences -// and Alfred Bratterud -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. #pragma once #ifndef X86_IOAPIC_HPP diff --git a/src/platform/x86_pc/kernel_start.cpp b/src/platform/x86_pc/kernel_start.cpp index 7c3da9cbb3..7a5ac77eea 100644 --- a/src/platform/x86_pc/kernel_start.cpp +++ b/src/platform/x86_pc/kernel_start.cpp @@ -1,18 +1,3 @@ -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2015-2018 IncludeOS AS, Oslo, Norway -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. #include #include @@ -23,6 +8,8 @@ #include "idt.hpp" #include "init_libc.hpp" +//#define ENABLE_PROFILERS +#include //#define KERN_DEBUG 1 #ifdef KERN_DEBUG @@ -32,7 +19,6 @@ #endif extern "C" { - void __init_sanity_checks(); void kernel_sanity_checks(); void _init_bss(); uintptr_t _move_symbols(uintptr_t loc); @@ -62,18 +48,15 @@ extern "C" __attribute__((no_sanitize("all"))) void kernel_start(uint32_t magic, uint32_t addr) { - PRATTLE("\n////////////////// IncludeOS kernel start ////////////////// \n"); - PRATTLE("* Booted with magic 0x%x, grub @ 0x%x \n", + PRATTLE("\n////////////////// IncludeOS kernel start //////////////////\n"); + PRATTLE("* Booted with magic 0x%x, grub @ 0x%x\n", magic, addr); - // generate checksums of read-only areas etc. - __init_sanity_checks(); - PRATTLE("* Grub magic: 0x%x, grub info @ 0x%x\n", magic, addr); // Determine where free memory starts extern char _end; uintptr_t free_mem_begin = reinterpret_cast(&_end); - uintptr_t memory_end = kernel::memory_end(); + uintptr_t memory_end = 0; if (magic == MULTIBOOT_BOOTLOADER_MAGIC) { free_mem_begin = _multiboot_free_begin(addr); @@ -83,13 +66,13 @@ void kernel_start(uint32_t magic, uint32_t addr) { memory_end = kernel::softreset_memory_end(addr); } - PRATTLE("* Free mem begin: 0x%zx, memory end: 0x%zx \n", + PRATTLE("* Free mem begin: 0x%zx, memory end: 0x%zx\n", free_mem_begin, memory_end); - PRATTLE("* Moving symbols. \n"); + PRATTLE("* Moving symbols\n"); // Preserve symbols from the ELF binary free_mem_begin += _move_symbols(free_mem_begin); - PRATTLE("* Free mem moved to: %p \n", (void*) free_mem_begin); + PRATTLE("* Free mem moved to: %p\n", (void*) free_mem_begin); PRATTLE("* Init .bss\n"); _init_bss(); @@ -104,8 +87,12 @@ void kernel_start(uint32_t magic, uint32_t addr) // Begin portable HAL initialization __machine->init(); - // TODO: Move more stuff into Machine::init - RNG::init(); + PRATTLE("* Early RNG init\n"); + { + PROFILE("RNG init") + // TODO: Move more stuff into Machine::init + RNG::init(); + } PRATTLE("* Init syscalls\n"); _init_syscalls(); @@ -113,5 +100,6 @@ void kernel_start(uint32_t magic, uint32_t addr) PRATTLE("* Init CPU exceptions\n"); x86::idt_initialize_for_cpu(0); + PRATTLE("* Init libc\n"); x86::init_libc(magic, addr); } diff --git a/src/platform/x86_pc/os.cpp b/src/platform/x86_pc/os.cpp index 9b2097889c..d6fed60e08 100644 --- a/src/platform/x86_pc/os.cpp +++ b/src/platform/x86_pc/os.cpp @@ -1,19 +1,3 @@ -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2015-2017 Oslo and Akershus University College of Applied Sciences -// and Alfred Bratterud -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. #define DEBUG #define MYINFO(X,...) INFO("Kernel", X, ##__VA_ARGS__) @@ -27,31 +11,18 @@ #include #include #include -#include #include "cmos.hpp" - //#define ENABLE_PROFILERS -#ifdef ENABLE_PROFILERS #include -#define PROFILE(name) ScopedProfiler __CONCAT(sp, __COUNTER__){name}; -#else -#define PROFILE(name) /* name */ -#endif -extern "C" void* get_cpu_esp(); -extern uintptr_t _start; -extern uintptr_t _end; -extern uintptr_t _ELF_START_; -extern uintptr_t _TEXT_START_; -extern uintptr_t _LOAD_START_; -extern uintptr_t _ELF_END_; // in kernel/os.cpp extern bool os_default_stdout; struct alignas(SMP_ALIGN) OS_CPU { uint64_t cycles_hlt = 0; }; -static SMP::Array os_per_cpu; +static std::vector os_per_cpu; +SMP_RESIZE_GCTOR(os_per_cpu); uint64_t os::cycles_asleep() noexcept { return PER_CPU(os_per_cpu).cycles_hlt; @@ -93,7 +64,7 @@ void kernel::start(uint32_t boot_magic, uint32_t boot_addr) kernel::state().cmdline = Service::binary_name(); // Initialize stdout handlers - if(os_default_stdout) { + if (os_default_stdout) { os::add_stdout(&kernel::default_stdout); } @@ -102,14 +73,18 @@ void kernel::start(uint32_t boot_magic, uint32_t boot_addr) // Print a fancy header CAPTION("#include // Literally"); - MYINFO("Stack: %p", get_cpu_esp()); + int stack; + MYINFO("Stack: %p", &stack); MYINFO("Boot magic: 0x%x, addr: 0x%x", boot_magic, boot_addr); // PAGING // - PROFILE("Enable paging"); - __arch_init_paging(); + { + PROFILE("Enable paging"); + __arch_init_paging(); + } // BOOT METHOD // + { PROFILE("Multiboot / legacy"); // Detect memory limits etc. depending on boot type if (boot_magic == MULTIBOOT_BOOTLOADER_MAGIC) { @@ -122,6 +97,7 @@ void kernel::start(uint32_t boot_magic, uint32_t boot_addr) kernel::legacy_boot(); } assert(kernel::memory_end() != 0); + } MYINFO("Total memory detected as %s ", util::Byte_r(kernel::memory_end()).to_string().c_str()); @@ -129,12 +105,15 @@ void kernel::start(uint32_t boot_magic, uint32_t boot_addr) kernel::state().heap_max = kernel::memory_end() - 1; assert(kernel::heap_begin() != 0x0 and kernel::heap_max() != 0x0); - PROFILE("Memory map"); // Assign memory ranges used by the kernel auto& memmap = os::mem::vmmap(); INFO2("Assigning fixed memory ranges (Memory map)"); + // protect symbols early on (the calculation is complex so not doing it here) - elf_protect_symbol_areas(); + { + PROFILE("Protect symbols"); + elf_protect_symbol_areas(); + } #if defined(ARCH_x86_64) // protect the basic pagetable used by LiveUpdate and any other @@ -154,15 +133,22 @@ void kernel::start(uint32_t boot_magic, uint32_t boot_addr) "Dynamic memory", kernel::heap_usage }); MYINFO("Virtual memory map"); - for (const auto& entry : memmap) - INFO2("%s", entry.second.to_string().c_str()); + { + PROFILE("Print memory map"); + for (const auto& entry : memmap) + INFO2("%s", entry.second.to_string().c_str()); + } - PROFILE("Platform init"); - __platform_init(); + { + PROFILE("Platform init"); + __platform_init(); + } - PROFILE("RTC init"); // Realtime/monotonic clock - RTC::init(); + { + PROFILE("RTC init"); + RTC::init(); + } } extern void __arch_poweroff(); @@ -182,7 +168,6 @@ void os::event_loop() __arch_poweroff(); } - void kernel::legacy_boot() { // Fetch CMOS memory info (unfortunately this is maximally 10^16 kb) @@ -196,12 +181,9 @@ void kernel::legacy_boot() INFO2("* High memory (from cmos): %i Kib", mem.extended.total); kernel::state().memory_end = 0x100000 + high_memory_size - 1; } - - auto& memmap = os::mem::vmmap(); - // No guarantees without multiboot, but we assume standard memory layout - memmap.assign_range({0x0009FC00, 0x0009FFFF, - "EBDA"}); - memmap.assign_range({0x000A0000, 0x000FFFFF, - "VGA/ROM"}); - + // this can be set by softreset during live update + if (kernel::state().mmap_addr != nullptr) + { + multiboot_mmap(kernel::state().mmap_addr, kernel::state().mmap_size); + } } diff --git a/src/platform/x86_pc/pic.cpp b/src/platform/x86_pc/pic.cpp index 481bd6e0c9..c15c4b8250 100644 --- a/src/platform/x86_pc/pic.cpp +++ b/src/platform/x86_pc/pic.cpp @@ -1,19 +1,3 @@ -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2015 Oslo and Akershus University College of Applied Sciences -// and Alfred Bratterud -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. #include #include "pic.hpp" diff --git a/src/platform/x86_pc/pic.hpp b/src/platform/x86_pc/pic.hpp index 3e6af8b112..1892c573fd 100644 --- a/src/platform/x86_pc/pic.hpp +++ b/src/platform/x86_pc/pic.hpp @@ -1,19 +1,3 @@ -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2015 Oslo and Akershus University College of Applied Sciences -// and Alfred Bratterud -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. #ifndef X86_PIC_HPP #define X86_PIC_HPP diff --git a/src/platform/x86_pc/pit.cpp b/src/platform/x86_pc/pit.cpp index 5f9f78a558..b50d18e4df 100644 --- a/src/platform/x86_pc/pit.cpp +++ b/src/platform/x86_pc/pit.cpp @@ -1,19 +1,3 @@ -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2015 Oslo and Akershus University College of Applied Sciences -// and Alfred Bratterud -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. #include "pit.hpp" #include "cpu_freq_sampling.hpp" diff --git a/src/platform/x86_pc/pit.hpp b/src/platform/x86_pc/pit.hpp index 8acf590036..d85bd5dd4e 100644 --- a/src/platform/x86_pc/pit.hpp +++ b/src/platform/x86_pc/pit.hpp @@ -1,19 +1,3 @@ -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2015 Oslo and Akershus University College of Applied Sciences -// and Alfred Bratterud -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. #pragma once #ifndef X86_PIT_HPP diff --git a/src/platform/x86_pc/platform.cpp b/src/platform/x86_pc/platform.cpp index f440663fe0..dc7fd2137a 100644 --- a/src/platform/x86_pc/platform.cpp +++ b/src/platform/x86_pc/platform.cpp @@ -1,19 +1,3 @@ -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2015 Oslo and Akershus University College of Applied Sciences -// and Alfred Bratterud -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. #include "acpi.hpp" #include "apic.hpp" @@ -24,10 +8,13 @@ #include "smp.hpp" #include #include +#include #include #include #include #include +//#define ENABLE_PROFILERS +#include #define MYINFO(X,...) INFO("x86", X, ##__VA_ARGS__) extern "C" char* get_cpu_esp(); @@ -39,51 +26,83 @@ struct alignas(64) smp_table int cpuid; /** put more here **/ }; -static SMP::Array cpu_tables; - -static util::KHz cpu_freq_{}; +static std::vector cpu_tables; namespace x86 { void initialize_cpu_tables_for_cpu(int cpu); void register_deactivation_function(delegate); } - +namespace kernel { + Fixed_vector, 64> smp_global_init(Fixedvector_Init::UNINIT); +} void __platform_init() { // read ACPI tables - x86::ACPI::init(); + { + PROFILE("ACPI init"); + x86::ACPI::init(); + } + + // resize up all PER-CPU structures + for (auto lambda : kernel::smp_global_init) { lambda(); } + + // setup main thread after PER-CPU ctors + kernel::setup_main_thread(0); // read SMBIOS tables - x86::SMBIOS::init(); + { + PROFILE("SMBIOS init"); + x86::SMBIOS::init(); + } // enable fs/gs for local APIC INFO("x86", "Setting up GDT, TLS, IST"); //initialize_gdt_for_cpu(0); #ifdef ARCH_x86_64 // setup Interrupt Stack Table - x86::ist_initialize_for_cpu(0, 0x9D3F0); + { + PROFILE("IST amd64"); + x86::ist_initialize_for_cpu(0, 0x9D3F0); + } #endif INFO("x86", "Initializing CPU 0"); - x86::initialize_cpu_tables_for_cpu(0); - Events::get(0).init_local(); + { + PROFILE("CPU tables x86"); + x86::initialize_cpu_tables_for_cpu(0); + } + + { + PROFILE("Events init"); + Events::get(0).init_local(); + } // setup APIC, APIC timer, SMP etc. - x86::APIC::init(); + { + PROFILE("APIC init"); + x86::APIC::init(); + } // enable interrupts MYINFO("Enabling interrupts"); - asm volatile("sti"); + { + PROFILE("Enable interrupts"); + asm volatile("sti"); + } // initialize and start registered APs found in ACPI-tables -#ifdef INCLUDEOS_SMP_ENABLE - x86::init_SMP(); -#endif + { + PROFILE("SMP init"); + x86::init_SMP(); + } // Setup kernel clocks MYINFO("Setting up kernel clock sources"); - x86::Clocks::init(); + { + PROFILE("Clocks init (x86)"); + x86::Clocks::init(); + } if (os::cpu_freq().count() <= 0.0) { kernel::state().cpu_khz = x86::Clocks::get_khz(); @@ -93,20 +112,33 @@ void __platform_init() // Note: CPU freq must be known before we can start timer system // Initialize APIC timers and timer systems // Deferred call to Service::ready() when calibration is complete - x86::APIC_Timer::calibrate(); + { + PROFILE("APIC timer calibrate"); + x86::APIC_Timer::calibrate(); + } INFO2("Initializing drivers"); - extern kernel::ctor_t __driver_ctors_start; - extern kernel::ctor_t __driver_ctors_end; - kernel::run_ctors(&__driver_ctors_start, &__driver_ctors_end); + { + PROFILE("Initialize drivers"); + extern kernel::ctor_t __driver_ctors_start; + extern kernel::ctor_t __driver_ctors_end; + kernel::run_ctors(&__driver_ctors_start, &__driver_ctors_end); + } // Scan PCI buses - hw::PCI_manager::init(); - // Initialize storage devices - hw::PCI_manager::init_devices(PCI::STORAGE); - kernel::state().block_drivers_ready = true; - // Initialize network devices - hw::PCI_manager::init_devices(PCI::NIC); + { + PROFILE("PCI bus scan"); + hw::PCI_manager::init(); + } + { + PROFILE("PCI device init") + // Initialize storage devices + hw::PCI_manager::init_devices(PCI::STORAGE); + kernel::state().block_drivers_ready = true; + // Initialize network devices + hw::PCI_manager::init_devices(PCI::NIC); + } + // Print registered devices os::machine().print_devices(); } @@ -117,6 +149,9 @@ static x86::GDT gdt; void x86::initialize_cpu_tables_for_cpu(int cpu) { + if (cpu == 0) { + cpu_tables.resize(SMP::early_cpu_total()); + } cpu_tables[cpu].cpuid = cpu; #ifdef ARCH_x86_64 diff --git a/src/platform/x86_pc/platform.hpp b/src/platform/x86_pc/platform.hpp index 6a462b53a8..2506b629a4 100644 --- a/src/platform/x86_pc/platform.hpp +++ b/src/platform/x86_pc/platform.hpp @@ -1,19 +1,3 @@ -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2015 Oslo and Akershus University College of Applied Sciences -// and Alfred Bratterud -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. #pragma once #include diff --git a/src/platform/x86_pc/rand.cpp b/src/platform/x86_pc/rand.cpp index f24d32e116..05ed9854b2 100644 --- a/src/platform/x86_pc/rand.cpp +++ b/src/platform/x86_pc/rand.cpp @@ -31,7 +31,7 @@ void RNG::init() return; } #ifndef PLATFORM_x86_solo5 - rng_reseed_init(fallback_entropy, 64*16); + rng_reseed_init(fallback_entropy, 10); return; #endif assert(0 && "No randomness fallback"); diff --git a/src/platform/x86_pc/sanity_checks.cpp b/src/platform/x86_pc/sanity_checks.cpp index b9d381615a..7e19c99705 100644 --- a/src/platform/x86_pc/sanity_checks.cpp +++ b/src/platform/x86_pc/sanity_checks.cpp @@ -1,28 +1,8 @@ -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2015 Oslo and Akershus University College of Applied Sciences -// and Alfred Bratterud -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -#include -#include -#include -#include #include +#include #include - -//#define ENABLE_CRC_RO +//#define TRUST_BUT_VERIFY // Global constructors static int gconstr_value = 0; @@ -31,49 +11,19 @@ static void self_test_gconstr() { gconstr_value = 1; } -#ifdef ENABLE_CRC_RO -// NOTE: crc_ro MUST NOT be initialized to zero -static uint32_t crc_ro = CRC32_BEGIN(); - -static uint32_t generate_ro_crc() noexcept -{ - extern char _TEXT_START_; - extern char _RODATA_END_; - return crc32_fast(&_TEXT_START_, &_RODATA_END_ - &_TEXT_START_); -} -#endif - -extern "C" -void __init_sanity_checks() noexcept -{ -#ifdef ENABLE_CRC_RO - // generate checksum for read-only portions of kernel - crc_ro = generate_ro_crc(); -#endif -} - extern "C" void kernel_sanity_checks() { -#ifdef ENABLE_CRC_RO - // verify checksum of read-only portions of kernel - uint32_t new_ro = generate_ro_crc(); - - if (crc_ro != new_ro) { - kprintf("CRC mismatch %#x vs %#x\n", crc_ro, new_ro); - os::panic("Sanity checks: CRC of kernel read-only area failed"); - } -#endif - +#ifdef TRUST_BUT_VERIFY // verify that Elf symbols were not overwritten bool symbols_verified = Elf::verify_symbols(); if (!symbols_verified) os::panic("Sanity checks: Consistency of Elf symbols and string areas"); +#endif // global constructor self-test if (gconstr_value != 1) { kprintf("Sanity checks: Global constructors not working (or modified during run-time)!\n"); os::panic("Sanity checks: Global constructors verification failed"); } - } diff --git a/src/platform/x86_pc/smbios.cpp b/src/platform/x86_pc/smbios.cpp index 498dcdec54..05a49dafbc 100644 --- a/src/platform/x86_pc/smbios.cpp +++ b/src/platform/x86_pc/smbios.cpp @@ -1,19 +1,3 @@ -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2015 Oslo and Akershus University College of Applied Sciences -// and Alfred Bratterud -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. #include "smbios.hpp" #include diff --git a/src/platform/x86_pc/smbios.hpp b/src/platform/x86_pc/smbios.hpp index 710b0267b4..5775517b30 100644 --- a/src/platform/x86_pc/smbios.hpp +++ b/src/platform/x86_pc/smbios.hpp @@ -1,19 +1,3 @@ -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2015 Oslo and Akershus University College of Applied Sciences -// and Alfred Bratterud -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. #pragma once #include diff --git a/src/platform/x86_pc/smp.cpp b/src/platform/x86_pc/smp.cpp index 622a1a2f79..ced57b5d47 100644 --- a/src/platform/x86_pc/smp.cpp +++ b/src/platform/x86_pc/smp.cpp @@ -1,19 +1,3 @@ -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2015 Oslo and Akershus University College of Applied Sciences -// and Alfred Bratterud -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. #include "smp.hpp" #include "acpi.hpp" @@ -22,9 +6,12 @@ #include "pit.hpp" #include #include +#include +#include #include #include #include +#include extern "C" { extern char _binary_apic_boot_bin_start; @@ -33,7 +20,7 @@ extern "C" { } static const uintptr_t BOOTLOADER_LOCATION = 0x10000; -static const uint32_t REV_STACK_SIZE = 1 << 19; // 512kb +static const uint32_t REV_STACK_SIZE = 1 << 14; // 16kb static_assert((BOOTLOADER_LOCATION & 0xfff) == 0, "Must be page-aligned"); struct apic_boot { @@ -45,36 +32,16 @@ struct apic_boot { uint32_t stack_size; }; -struct __libc { - int can_do_threads; - int threaded; - int secure; - volatile int threads_minus_1; - size_t* auxv; -}; -extern struct __libc __libc; -//extern "C" struct __libc *__libc_loc(void) __attribute__((const)); -//#define __libc (*__libc_loc()) - -static inline void musl_override_glob_locks() -{ - printf("__libc.can_do_threads: %d __libc.threaded: %d\n", - __libc.can_do_threads, __libc.threaded); - printf("__libc.threads_minus_1: %d -> %d\n", - __libc.threads_minus_1, 1); - __libc.threads_minus_1 = 1; -} - namespace x86 { void init_SMP() { const uint32_t CPUcount = ACPI::get_cpus().size(); - if (CPUcount <= 1) return; - assert(CPUcount <= SMP_MAX_CORES); // avoid heap usage during AP init - x86::smp_main.initialized_cpus.reserve(CPUcount); + smp::main_system.initialized_cpus.reserve(CPUcount); + smp::systems.resize(CPUcount); + if (CPUcount <= 1) return; // copy our bootloader to APIC init location const char* start = &_binary_apic_boot_bin_start; @@ -83,8 +50,8 @@ void init_SMP() // allocate revenant main stacks void* stack = memalign(4096, CPUcount * REV_STACK_SIZE); - smp_main.stack_base = (uintptr_t) stack; - smp_main.stack_size = REV_STACK_SIZE; + smp::main_system.stack_base = (uintptr_t) stack; + smp::main_system.stack_size = REV_STACK_SIZE; // modify bootloader to support our cause auto* boot = (apic_boot*) BOOTLOADER_LOCATION; @@ -96,26 +63,40 @@ void init_SMP() #else #error "Unimplemented arch" #endif - boot->stack_base = (uint32_t) smp_main.stack_base; + boot->stack_base = (uint32_t) smp::main_system.stack_base; // add to start at top of each stack, remove to offset cpu 1 to idx 0 boot->stack_base -= 16; - boot->stack_size = smp_main.stack_size; + boot->stack_size = smp::main_system.stack_size; debug("APIC stack base: %#x size: %u main size: %u\n", boot->stack_base, boot->stack_size, sizeof(boot->worker_addr)); assert((boot->stack_base & 15) == 0); // reset barrier - smp_main.boot_barrier.reset(1); - - // enable global locks on musl - musl_override_glob_locks(); + smp::main_system.boot_barrier.reset(1); auto& apic = x86::APIC::get(); + // massage musl to create a main thread for each AP + for (const auto& cpu : ACPI::get_cpus()) + { + if (cpu.id == apic.get_id() || cpu.id >= CPUcount) continue; + // this thread will immediately yield back here + new std::thread(&revenant_thread_main, cpu.id); + // the last thread id will be the above threads kernel id + // alternatively, we can extract this threads last-created childs id + const long tid = kernel::get_last_thread_id(); + // store thread info in SMP structure + auto& system = smp::systems.at(cpu.id); + system.main_thread_id = tid; + // migrate thread to its CPU + auto* kthread = kernel::ThreadManager::get().detach(tid); + kernel::ThreadManager::get(cpu.id).attach(kthread); + } + // turn on CPUs INFO("SMP", "Initializing APs"); for (const auto& cpu : ACPI::get_cpus()) { - if (cpu.id == apic.get_id()) continue; + if (cpu.id == apic.get_id() || cpu.id >= CPUcount) continue; debug("-> CPU %u ID %u fl 0x%x\n", cpu.cpu, cpu.id, cpu.flags); apic.ap_init(cpu.id); @@ -126,7 +107,7 @@ void init_SMP() INFO("SMP", "Starting APs"); for (const auto& cpu : ACPI::get_cpus()) { - if (cpu.id == apic.get_id()) continue; + if (cpu.id == apic.get_id() || cpu.id >= CPUcount) continue; // Send SIPI with start page at BOOTLOADER_LOCATION apic.ap_start(cpu.id, BOOTLOADER_LOCATION >> 12); apic.ap_start(cpu.id, BOOTLOADER_LOCATION >> 12); @@ -134,30 +115,11 @@ void init_SMP() //PIT::blocking_cycles(1); // wait for all APs to start - smp_main.boot_barrier.spin_wait(CPUcount); + smp::main_system.boot_barrier.spin_wait(CPUcount); INFO("SMP", "All %u APs are online now\n", CPUcount); // subscribe to IPIs - Events::get().subscribe(BSP_LAPIC_IPI_IRQ, - [] { - int next = smp_main.bitmap.first_set(); - while (next != -1) - { - // remove bit - smp_main.bitmap.atomic_reset(next); - // get jobs from other CPU - std::vector done; - lock(smp_system[next].flock); - smp_system[next].completed.swap(done); - unlock(smp_system[next].flock); - - // execute all tasks - for (auto& func : done) func(); - - // get next set bit - next = smp_main.bitmap.first_set(); - } - }); + Events::get().subscribe(BSP_LAPIC_IPI_IRQ, smp::task_done_handler); } } // x86 @@ -165,28 +127,14 @@ void init_SMP() using namespace x86; /// implementation of the SMP interface /// -int SMP::cpu_id() noexcept -{ -#ifdef INCLUDEOS_SMP_ENABLE - int cpuid; -#ifdef ARCH_x86_64 - asm("movl %%gs:(0x0), %0" : "=r" (cpuid)); -#elif defined(ARCH_i686) - asm("movl %%fs:(0x0), %0" : "=r" (cpuid)); -#else - #error "Implement me?" -#endif - return cpuid; -#else - return 0; -#endif -} - int SMP::cpu_count() noexcept { - return x86::smp_main.initialized_cpus.size(); + return smp::main_system.initialized_cpus.size(); } const std::vector& SMP::active_cpus() { - return x86::smp_main.initialized_cpus; + return smp::main_system.initialized_cpus; +} +size_t SMP::early_cpu_total() noexcept { + return ACPI::get_cpus().size(); } __attribute__((weak)) @@ -195,48 +143,35 @@ void SMP::init_task() /* do nothing */ } -void SMP::add_task(smp_task_func task, smp_done_func done, int cpu) +void SMP::add_task(SMP::task_func task, SMP::done_func done, int cpu) { -#ifdef INCLUDEOS_SMP_ENABLE - lock(smp_system[cpu].tlock); - smp_system[cpu].tasks.emplace_back(std::move(task), std::move(done)); - unlock(smp_system[cpu].tlock); -#else - assert(cpu == 0); - task(); done(); -#endif + auto& system = PER_CPU(smp::systems); + system.tlock.lock(); + system.tasks.emplace_back(std::move(task), std::move(done)); + system.tlock.unlock(); } -void SMP::add_task(smp_task_func task, int cpu) +void SMP::add_task(SMP::task_func task, int cpu) { -#ifdef INCLUDEOS_SMP_ENABLE - lock(smp_system[cpu].tlock); - smp_system[cpu].tasks.emplace_back(std::move(task), nullptr); - unlock(smp_system[cpu].tlock); -#else - assert(cpu == 0); - task(); -#endif + auto& system = PER_CPU(smp::systems); + system.tlock.lock(); + system.tasks.emplace_back(std::move(task), nullptr); + system.tlock.unlock(); } -void SMP::add_bsp_task(smp_done_func task) +void SMP::add_bsp_task(SMP::done_func task) { -#ifdef INCLUDEOS_SMP_ENABLE // queue job - auto& system = PER_CPU(smp_system); - lock(system.flock); + auto& system = PER_CPU(smp::systems); + system.flock.lock(); system.completed.push_back(std::move(task)); - unlock(system.flock); + system.flock.unlock(); // set this CPU bit - smp_main.bitmap.atomic_set(SMP::cpu_id()); + smp::main_system.bitmap.atomic_set(SMP::cpu_id()); // call home x86::APIC::get().send_bsp_intr(); -#else - task(); -#endif } void SMP::signal(int cpu) { -#ifdef INCLUDEOS_SMP_ENABLE // broadcast that there is work to do // 0: Broadcast to everyone except BSP if (cpu == 0) @@ -244,9 +179,6 @@ void SMP::signal(int cpu) // 1-xx: Unicast specific vCPU else x86::APIC::get().send_ipi(cpu, 0x20); -#else - (void) cpu; -#endif } void SMP::signal_bsp() { @@ -262,13 +194,13 @@ void SMP::unicast(int cpu, uint8_t irq) x86::APIC::get().send_ipi(cpu, IRQ_BASE + irq); } -static spinlock_t __global_lock = 0; +static smp_spinlock g_global_lock; void SMP::global_lock() noexcept { - lock(__global_lock); + g_global_lock.lock(); } void SMP::global_unlock() noexcept { - unlock(__global_lock); + g_global_lock.unlock(); } diff --git a/src/platform/x86_pc/smp.hpp b/src/platform/x86_pc/smp.hpp index e664525945..2ef5bf0dc8 100644 --- a/src/platform/x86_pc/smp.hpp +++ b/src/platform/x86_pc/smp.hpp @@ -1,19 +1,3 @@ -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2015 Oslo and Akershus University College of Applied Sciences -// and Alfred Bratterud -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. #pragma once #ifndef X86_SMP_HPP @@ -23,9 +7,6 @@ #include #include -typedef SMP::task_func smp_task_func; -typedef SMP::done_func smp_done_func; - namespace x86 { extern void init_SMP(); diff --git a/src/platform/x86_pc/softreset.cpp b/src/platform/x86_pc/softreset.cpp index aad752a7cd..e3b09e5fb1 100644 --- a/src/platform/x86_pc/softreset.cpp +++ b/src/platform/x86_pc/softreset.cpp @@ -22,8 +22,11 @@ struct softreset_t uint64_t high_mem; KHz cpu_freq; uint32_t apic_ticks; - uint64_t extra; uint32_t extra_len; + uint64_t extra; + // Memory map FMA + uint32_t mmap_size; + char mmap_buffer[0]; }; bool kernel::is_softreset_magic(uint32_t value) @@ -65,6 +68,9 @@ void kernel::resume_softreset(intptr_t addr) kernel::state().cpu_khz = data->cpu_freq; x86::apic_timer_set_ticks(data->apic_ticks); + kernel::state().mmap_size = data->mmap_size; + kernel::state().mmap_addr = data->mmap_buffer; + /// call service-specific softreset handler softreset_service_handler((void*) data->extra, data->extra_len); } @@ -81,8 +87,10 @@ void* __os_store_soft_reset(void* extra, size_t extra_len) data->high_mem = memory_end; data->cpu_freq = os::cpu_freq(); data->apic_ticks = x86::apic_timer_get_ticks(); - data->extra = (uint64_t) extra; data->extra_len = extra_len; + data->extra = (uint64_t) extra; + data->mmap_size = kernel::state().mmap_size; + std::memcpy(data->mmap_buffer, kernel::state().mmap_addr, data->mmap_size); uint32_t csum = crc32_fast(data, sizeof(softreset_t)); data->checksum = csum; diff --git a/src/platform/x86_pc/start.asm b/src/platform/x86_pc/start.asm index 6cd80657e2..f23886ae7c 100644 --- a/src/platform/x86_pc/start.asm +++ b/src/platform/x86_pc/start.asm @@ -1,19 +1,3 @@ -;; This file is a part of the IncludeOS unikernel - www.includeos.org -;; -;; Copyright 2015-2016 Oslo and Akershus University College of Applied Sciences -;; and Alfred Bratterud -;; -;; Licensed under the Apache License, Version 2.0 (the "License"); -;; you may not use this file except in compliance with the License. -;; You may obtain a copy of the License at -;; -;; http:;;www.apache.org/licenses/LICENSE-2.0 -;; -;; Unless required by applicable law or agreed to in writing, software -;; distributed under the License is distributed on an "AS IS" BASIS, -;; WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -;; See the License for the specific language governing permissions and -;; limitations under the License. USE32 extern __arch_start @@ -23,6 +7,12 @@ global __multiboot_addr global _start global __xsave_enabled global __avx_enabled +;; we will be calling these from AP initialization +global x86_enable_sse:function +global x86_enable_fpu_native:function +global x86_enable_xsave:function +global x86_enable_avx:function + %define MB_MAGIC 0x1BADB002 %define MB_FLAGS 0x3 ;; ALIGN + MEMINFO @@ -55,10 +45,6 @@ section .multiboot %define code_segment 0x08 section .data -__xsave_enabled: - dw 0x0 -__avx_enabled: - dw 0x0 __multiboot_magic: dd 0x0 __multiboot_addr: @@ -89,13 +75,13 @@ rock_bottom: mov ebp, esp ;; enable SSE before we enter C/C++ land - call enable_sse + call x86_enable_sse ;; Enable modern x87 FPU exception handling - call enable_fpu_native + call x86_enable_fpu_native ;; try to enable XSAVE before checking AVX - call enable_xsave + call x86_enable_xsave ;; enable AVX if xsave and avx supported on CPU - call enable_avx + call x86_enable_avx ;; Save multiboot params mov DWORD [__multiboot_magic], eax @@ -104,7 +90,7 @@ rock_bottom: call __arch_start jmp __start_panic -enable_fpu_native: +x86_enable_fpu_native: push eax mov eax, cr0 or eax, 0x20 @@ -112,7 +98,7 @@ enable_fpu_native: pop eax ret -enable_sse: +x86_enable_sse: push eax ;preserve eax for multiboot mov eax, cr0 and ax, 0xFFFB ;clear coprocessor emulation CR0.EM @@ -124,7 +110,7 @@ enable_sse: pop eax ret -enable_xsave: +x86_enable_xsave: push eax push ebx ; check for XSAVE support @@ -139,13 +125,12 @@ enable_xsave: mov eax, cr4 or eax, 0x40000 mov cr4, eax - mov WORD [__xsave_enabled], 0x1 xsave_not_supported: pop ebx pop eax ret -enable_avx: +x86_enable_avx: push eax push ebx ;; assuming cpuid with eax=1 supported @@ -161,7 +146,6 @@ enable_avx: xgetbv or eax, 0x7 xsetbv - mov WORD [__avx_enabled], 0x1 avx_not_supported: pop ebx pop eax diff --git a/src/platform/x86_pc/x2apic.hpp b/src/platform/x86_pc/x2apic.hpp index 164f3f4d40..916a66b4d7 100644 --- a/src/platform/x86_pc/x2apic.hpp +++ b/src/platform/x86_pc/x2apic.hpp @@ -1,19 +1,3 @@ -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2015 Oslo and Akershus University College of Applied Sciences -// and Alfred Bratterud -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. #pragma once #ifndef X86_X2APIC_HPP @@ -66,7 +50,7 @@ namespace x86 { CPU::write_msr(IA32_APIC_BASE_MSR, base_msr, 0); // verify that x2APIC is online uint64_t verify = CPU::read_msr(IA32_APIC_BASE_MSR); - assert(verify & MSR_ENABLE_X2APIC); + Expects(verify & MSR_ENABLE_X2APIC); INFO2("APIC id: %x ver: %x", get_id(), version()); } diff --git a/src/platform/x86_pc/xapic.hpp b/src/platform/x86_pc/xapic.hpp index a94a6e291c..c240c1dbeb 100644 --- a/src/platform/x86_pc/xapic.hpp +++ b/src/platform/x86_pc/xapic.hpp @@ -1,19 +1,3 @@ -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2015 Oslo and Akershus University College of Applied Sciences -// and Alfred Bratterud -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. #pragma once #ifndef X86_XAPIC_HPP @@ -74,7 +58,7 @@ namespace x86 { CPU::write_msr(IA32_APIC_BASE_MSR, this->base_msr); // verify that xAPIC is online uint64_t verify = CPU::read_msr(IA32_APIC_BASE_MSR); - assert(verify & MSR_ENABLE_XAPIC); + Expects(verify & MSR_ENABLE_XAPIC); INFO2("ID: %x Ver: %x", get_id(), version()); } diff --git a/src/platform/x86_solo5/sanity_checks.cpp b/src/platform/x86_solo5/sanity_checks.cpp index 11ce8abde6..5f6e5aaa46 100644 --- a/src/platform/x86_solo5/sanity_checks.cpp +++ b/src/platform/x86_solo5/sanity_checks.cpp @@ -1,19 +1,3 @@ -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2015 Oslo and Akershus University College of Applied Sciences -// and Alfred Bratterud -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. #include #include diff --git a/src/platform/x86_solo5/solo5_manager.cpp b/src/platform/x86_solo5/solo5_manager.cpp index 23df200926..a694000361 100644 --- a/src/platform/x86_solo5/solo5_manager.cpp +++ b/src/platform/x86_solo5/solo5_manager.cpp @@ -1,19 +1,3 @@ -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2015 Oslo and Akershus University College of Applied Sciences -// and Alfred Bratterud -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. #include #include diff --git a/src/platform/x86_solo5/start.asm b/src/platform/x86_solo5/start.asm index e30e594c4b..151aed72ab 100644 --- a/src/platform/x86_solo5/start.asm +++ b/src/platform/x86_solo5/start.asm @@ -1,19 +1,3 @@ -;; This file is a part of the IncludeOS unikernel - www.includeos.org -;; -;; Copyright 2015-2016 Oslo and Akershus University College of Applied Sciences -;; and Alfred Bratterud -;; -;; Licensed under the Apache License, Version 2.0 (the "License"); -;; you may not use this file except in compliance with the License. -;; You may obtain a copy of the License at -;; -;; http:;;www.apache.org/licenses/LICENSE-2.0 -;; -;; Unless required by applicable law or agreed to in writing, software -;; distributed under the License is distributed on an "AS IS" BASIS, -;; WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -;; See the License for the specific language governing permissions and -;; limitations under the License. global get_fs_sentinel_value:function global pre_initialize_tls:function diff --git a/src/plugins/autoconf.cpp b/src/plugins/autoconf.cpp index 7a95af3b42..0a3ff9060d 100644 --- a/src/plugins/autoconf.cpp +++ b/src/plugins/autoconf.cpp @@ -1,19 +1,3 @@ -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2017 Oslo and Akershus University College of Applied Sciences -// and Alfred Bratterud -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. #include #include diff --git a/src/plugins/example.cpp b/src/plugins/example.cpp index a34e187c55..40e40e2822 100644 --- a/src/plugins/example.cpp +++ b/src/plugins/example.cpp @@ -1,19 +1,3 @@ -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2017 Oslo and Akershus University College of Applied Sciences -// and Alfred Bratterud -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. /** * Example plugin. Also used for testing. diff --git a/src/plugins/field_medic/diag.cpp b/src/plugins/field_medic/diag.cpp index b12022bff9..f1c32ec4cd 100644 --- a/src/plugins/field_medic/diag.cpp +++ b/src/plugins/field_medic/diag.cpp @@ -1,18 +1,3 @@ -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2018 IncludeOS AS, Oslo, Norway -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. #include #include diff --git a/src/plugins/field_medic/fieldmedic.cpp b/src/plugins/field_medic/fieldmedic.cpp index 985db52726..706318d4fe 100644 --- a/src/plugins/field_medic/fieldmedic.cpp +++ b/src/plugins/field_medic/fieldmedic.cpp @@ -1,18 +1,3 @@ -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2018 IncludeOS AS, Oslo, Norway -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. #include "fieldmedic.hpp" diff --git a/src/plugins/field_medic/fieldmedic.hpp b/src/plugins/field_medic/fieldmedic.hpp index 11d1152412..7c025b3a9a 100644 --- a/src/plugins/field_medic/fieldmedic.hpp +++ b/src/plugins/field_medic/fieldmedic.hpp @@ -1,18 +1,3 @@ -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2018 IncludeOS AS, Oslo, Norway -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. /** Field medic - OS diagnostic plugins diff --git a/src/plugins/madness/madness.cpp b/src/plugins/madness/madness.cpp index 5de88928fa..825d6c7490 100644 --- a/src/plugins/madness/madness.cpp +++ b/src/plugins/madness/madness.cpp @@ -1,18 +1,3 @@ -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2018 IncludeOS AS, Oslo, Norway -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. #include #include diff --git a/src/plugins/madness/madness.hpp b/src/plugins/madness/madness.hpp index 8f52f83ea1..a91fe7be1c 100644 --- a/src/plugins/madness/madness.hpp +++ b/src/plugins/madness/madness.hpp @@ -1,18 +1,3 @@ -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2018 IncludeOS AS, Oslo, Norway -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. #ifndef PLUGINS_MADNESS_HPP #define PLUGINS_MADNESS_HPP diff --git a/src/plugins/nacl.cpp b/src/plugins/nacl.cpp index e6679e4d59..a5c6fee0ab 100644 --- a/src/plugins/nacl.cpp +++ b/src/plugins/nacl.cpp @@ -1,19 +1,3 @@ -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2017 Oslo and Akershus University College of Applied Sciences -// and Alfred Bratterud -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. #include diff --git a/src/plugins/syslog.cpp b/src/plugins/syslog.cpp index 484e8d16b3..bb31982729 100644 --- a/src/plugins/syslog.cpp +++ b/src/plugins/syslog.cpp @@ -1,19 +1,3 @@ -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2018 Oslo and Akershus University College of Applied Sciences -// and Alfred Bratterud -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. // This file contains a plugin for automatically mounting // a given syslog implementation to the virtual filesystem (VFS) diff --git a/src/plugins/syslogd.cpp b/src/plugins/syslogd.cpp index 330f76a10a..426a61f841 100644 --- a/src/plugins/syslogd.cpp +++ b/src/plugins/syslogd.cpp @@ -1,21 +1,4 @@ -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2015-2017 IncludeOS AS, Oslo, Norway -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - // Syslog plugin (UDP) - #include #include diff --git a/src/plugins/terminal.cpp b/src/plugins/terminal.cpp index 4684118609..a7b3a369b2 100644 --- a/src/plugins/terminal.cpp +++ b/src/plugins/terminal.cpp @@ -1,19 +1,3 @@ -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2015 Oslo and Akershus University College of Applied Sciences -// and Alfred Bratterud -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. #include #include @@ -40,7 +24,7 @@ static auto& create_connection_from(net::tcp::Connection_ptr conn) #ifdef USE_LIVEUPDATE #include "liveupdate.hpp" -void store_terminal(liu::Storage& store, const liu::buffer_t*) +void store_terminal(liu::Storage& store) { for (auto& kv : terms) { diff --git a/src/plugins/unik.cpp b/src/plugins/unik.cpp index aa676d9ff3..6246d28858 100644 --- a/src/plugins/unik.cpp +++ b/src/plugins/unik.cpp @@ -1,19 +1,3 @@ -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2015-2016 Oslo and Akershus University College of Applied Sciences -// and Alfred Bratterud -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. #include diff --git a/src/plugins/vfs.cpp b/src/plugins/vfs.cpp index a5774ea8c8..95529bde37 100644 --- a/src/plugins/vfs.cpp +++ b/src/plugins/vfs.cpp @@ -1,19 +1,3 @@ -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2018 Oslo and Akershus University College of Applied Sciences -// and Alfred Bratterud -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. // This file contains a plugin for automatically mounting // resources to the virtual filesystem (VFS) diff --git a/src/posix/fd.cpp b/src/posix/fd.cpp index 8a9bac7ce2..12cda1165d 100644 --- a/src/posix/fd.cpp +++ b/src/posix/fd.cpp @@ -1,19 +1,3 @@ -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2015-2016 Oslo and Akershus University College of Applied Sciences -// and Alfred Bratterud -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. #include #include diff --git a/src/posix/file_fd.cpp b/src/posix/file_fd.cpp index 37e156a42d..eb00dc4ae5 100644 --- a/src/posix/file_fd.cpp +++ b/src/posix/file_fd.cpp @@ -1,19 +1,3 @@ -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2015-2016 Oslo and Akershus University College of Applied Sciences -// and Alfred Bratterud -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. #include #include diff --git a/src/posix/memalign.cpp b/src/posix/memalign.cpp index 9281f5598a..ee8c940a34 100644 --- a/src/posix/memalign.cpp +++ b/src/posix/memalign.cpp @@ -1,19 +1,4 @@ // -*-C++-*- -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2017 IncludeOS AS, Oslo, Norway -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. #include #include diff --git a/src/posix/pthread.cpp b/src/posix/pthread.cpp index 6be16326ed..78c8b35e8d 100644 --- a/src/posix/pthread.cpp +++ b/src/posix/pthread.cpp @@ -1,19 +1,3 @@ -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2017 Oslo and Akershus University College of Applied Sciences -// and Alfred Bratterud -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. #include #include diff --git a/src/posix/stdlib.cpp b/src/posix/stdlib.cpp index 1264de1bda..399ee9d3e4 100644 --- a/src/posix/stdlib.cpp +++ b/src/posix/stdlib.cpp @@ -1,19 +1,3 @@ -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2017 Oslo and Akershus University College of Applied Sciences -// and Alfred Bratterud -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. #include #include diff --git a/src/posix/sys/socket.cpp b/src/posix/sys/socket.cpp index 1cc28aa1e5..936483107b 100644 --- a/src/posix/sys/socket.cpp +++ b/src/posix/sys/socket.cpp @@ -1,19 +1,3 @@ -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2015 Oslo and Akershus University College of Applied Sciences -// and Alfred Bratterud -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. #include #include diff --git a/src/posix/sys/stat.cpp b/src/posix/sys/stat.cpp index 5891150254..521239801c 100644 --- a/src/posix/sys/stat.cpp +++ b/src/posix/sys/stat.cpp @@ -1,19 +1,3 @@ -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2015-2016 Oslo and Akershus University College of Applied Sciences -// and Alfred Bratterud -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. #include #include diff --git a/src/posix/tcp_fd.cpp b/src/posix/tcp_fd.cpp index 481dd3be85..957c872c65 100644 --- a/src/posix/tcp_fd.cpp +++ b/src/posix/tcp_fd.cpp @@ -1,18 +1,3 @@ -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2017-2018 IncludeOS AS, Oslo, Norway -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. #include #include diff --git a/src/posix/udp_fd.cpp b/src/posix/udp_fd.cpp index 6d63b606cc..163ad973f3 100644 --- a/src/posix/udp_fd.cpp +++ b/src/posix/udp_fd.cpp @@ -1,18 +1,3 @@ -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2017-2018 IncludeOS AS, Oslo, Norway -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. #include #include // os::block() diff --git a/src/posix/unistd.cpp b/src/posix/unistd.cpp index 8e0c4dfa13..a14f96d2e1 100644 --- a/src/posix/unistd.cpp +++ b/src/posix/unistd.cpp @@ -1,19 +1,3 @@ -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2015 Oslo and Akershus University College of Applied Sciences -// and Alfred Bratterud -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. #include #include diff --git a/src/posix/unix_fd.cpp b/src/posix/unix_fd.cpp index 1a50c4fd88..edc3c69289 100644 --- a/src/posix/unix_fd.cpp +++ b/src/posix/unix_fd.cpp @@ -1,18 +1,3 @@ -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2018 IncludeOS AS, Oslo, Norway -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. #include #include diff --git a/src/service_name.cpp b/src/service_name.cpp index 436010f4d3..4e2ed7adcd 100644 --- a/src/service_name.cpp +++ b/src/service_name.cpp @@ -1,31 +1,20 @@ -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2015 Oslo and Akershus University College of Applied Sciences -// and Alfred Bratterud -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. #include - -extern "C" __attribute__((noreturn)) -void panic(const char* reason); +extern "C" { + __attribute__((noreturn)) void panic(const char* reason); +} #ifndef __linux__ extern "C" __attribute__((noreturn)) void abort(){ - panic("Abort called"); + panic("Abort called"); + __builtin_unreachable(); } #endif const char* service_name__ = SERVICE_NAME; const char* service_binary_name__ = SERVICE; + +namespace os { + uintptr_t liveupdate_memory_size_mb = _LIVEUPDATE_MEMSIZE_; +} diff --git a/src/util/async.cpp b/src/util/async.cpp index f83efa443e..2763610087 100644 --- a/src/util/async.cpp +++ b/src/util/async.cpp @@ -1,19 +1,3 @@ -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2015 Oslo and Akershus University College of Applied Sciences -// and Alfred Bratterud -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. #include #include diff --git a/src/util/autoconf.cpp b/src/util/autoconf.cpp index b793d8d490..955d189bed 100644 --- a/src/util/autoconf.cpp +++ b/src/util/autoconf.cpp @@ -1,19 +1,3 @@ -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2017 Oslo and Akershus University College of Applied Sciences -// and Alfred Bratterud -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. #include #include diff --git a/src/util/config.cpp b/src/util/config.cpp index a7adedec36..902f10701c 100644 --- a/src/util/config.cpp +++ b/src/util/config.cpp @@ -1,19 +1,3 @@ -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2017 Oslo and Akershus University College of Applied Sciences -// and Alfred Bratterud -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. #include #include diff --git a/src/util/crc32.cpp b/src/util/crc32.cpp index 632c3897fe..4e7c8cbd09 100644 --- a/src/util/crc32.cpp +++ b/src/util/crc32.cpp @@ -1,19 +1,3 @@ -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2015 Oslo and Akershus University College of Applied Sciences -// and Alfred Bratterud -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. #include #include diff --git a/src/util/logger.cpp b/src/util/logger.cpp index b6c53e9592..3b86b93d37 100644 --- a/src/util/logger.cpp +++ b/src/util/logger.cpp @@ -1,19 +1,3 @@ -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2015-2016 Oslo and Akershus University College of Applied Sciences -// and Alfred Bratterud -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. #include #include diff --git a/src/util/memstream.c b/src/util/memstream.c index 4f3bf743ad..adc6e879f8 100644 --- a/src/util/memstream.c +++ b/src/util/memstream.c @@ -1,20 +1,3 @@ -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2015 Oslo and Akershus University College of Applied Sciences -// and Alfred Bratterud -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - #include #include diff --git a/src/util/path_to_regex.cpp b/src/util/path_to_regex.cpp index 955cfdd856..4bac7c5990 100644 --- a/src/util/path_to_regex.cpp +++ b/src/util/path_to_regex.cpp @@ -1,19 +1,3 @@ -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2015-2016 Oslo and Akershus University College of Applied Sciences -// and Alfred Bratterud -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. // https://github.com/pillarjs/path-to-regexp/blob/master/index.js diff --git a/src/util/percent_encoding.cpp b/src/util/percent_encoding.cpp index 1509cc597f..68bd7f3b87 100644 --- a/src/util/percent_encoding.cpp +++ b/src/util/percent_encoding.cpp @@ -1,19 +1,3 @@ -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2015-2016 Oslo and Akershus University College of Applied Sciences -// and Alfred Bratterud -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. #include #include diff --git a/src/util/statman.cpp b/src/util/statman.cpp index 6ef2364679..ebc15922cd 100644 --- a/src/util/statman.cpp +++ b/src/util/statman.cpp @@ -1,19 +1,3 @@ -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2015-2017 Oslo and Akershus University College of Applied Sciences -// and Alfred Bratterud -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. #include #include @@ -74,51 +58,54 @@ Statman::Statman() { Stat& Statman::create(const Stat::Stat_type type, const std::string& name) { -#ifdef INCLUDEOS_SMP_ENABLE - volatile scoped_spinlock lock(this->stlock); -#endif + stlock.lock(); if (name.empty()) throw Stats_exception("Cannot create Stat with no name"); const ssize_t idx = this->find_free_stat(); if (idx < 0) { m_stats.emplace_back(type, name); - return m_stats.back(); + auto& retval = m_stats.back(); + stlock.unlock(); + return retval; } // note: we have to create this early in case it throws auto& stat = *new (&m_stats[idx]) Stat(type, name); unused_stats()--; // decrease unused stats + stlock.unlock(); return stat; } Stat& Statman::get(const Stat* st) { -#ifdef INCLUDEOS_SMP_ENABLE - volatile scoped_spinlock lock(this->stlock); -#endif + stlock.lock(); for (auto& stat : this->m_stats) { if (&stat == st) { - if (stat.unused() == false) + if (stat.unused() == false) { + stlock.unlock(); return stat; + } + stlock.unlock(); throw Stats_exception("Accessing deleted stat"); } } + stlock.unlock(); throw std::out_of_range("Not a valid stat in this statman instance"); } Stat& Statman::get_by_name(const char* name) { -#ifdef INCLUDEOS_SMP_ENABLE - volatile scoped_spinlock lock(this->stlock); -#endif + stlock.lock(); for (auto& stat : this->m_stats) { if (stat.unused() == false) { if (strncmp(stat.name(), name, Stat::MAX_NAME_LEN) == 0) + stlock.unlock(); return stat; } } + stlock.unlock(); throw std::out_of_range("No stat found with exact given name"); } @@ -139,12 +126,11 @@ Stat& Statman::get_or_create(const Stat::Stat_type type, const std::string& name void Statman::free(void* addr) { auto& stat = this->get((Stat*) addr); -#ifdef INCLUDEOS_SMP_ENABLE - volatile scoped_spinlock lock(this->stlock); -#endif + stlock.lock(); // delete entry new (&stat) Stat(Stat::FLOAT, ""); unused_stats()++; // increase unused stats + stlock.unlock(); } ssize_t Statman::find_free_stat() const noexcept diff --git a/src/util/syslog_facility.cpp b/src/util/syslog_facility.cpp index 43cd1aed0f..0a873ae3e1 100644 --- a/src/util/syslog_facility.cpp +++ b/src/util/syslog_facility.cpp @@ -1,19 +1,3 @@ -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2015-2017 IncludeOS AS, Oslo, Norway -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - #include #include #include // getpid diff --git a/src/util/syslogd.cpp b/src/util/syslogd.cpp index 91379a9830..d2df178555 100644 --- a/src/util/syslogd.cpp +++ b/src/util/syslogd.cpp @@ -1,19 +1,3 @@ -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2015-2017 IncludeOS AS, Oslo, Norway -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - #include #include #include // errno diff --git a/src/util/tar.cpp b/src/util/tar.cpp index 63a9e99371..41782080b3 100644 --- a/src/util/tar.cpp +++ b/src/util/tar.cpp @@ -1,19 +1,3 @@ -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2015 Oslo and Akershus University College of Applied Sciences -// and Alfred Bratterud -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. #include #include diff --git a/src/util/uri.cpp b/src/util/uri.cpp index 3902c82623..18d5401c96 100644 --- a/src/util/uri.cpp +++ b/src/util/uri.cpp @@ -1,19 +1,3 @@ -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2015-2017 Oslo and Akershus University College of Applied Sciences -// and Alfred Bratterud -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. #include #include diff --git a/src/version.cpp b/src/version.cpp index fdff088ea5..67523d2333 100644 --- a/src/version.cpp +++ b/src/version.cpp @@ -1,18 +1,3 @@ -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2018 IncludeOS AS, Oslo, Norway -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. #include #ifndef USERSPACE_KERNEL diff --git a/src/virtio/virtio.cpp b/src/virtio/virtio.cpp index 30da49379b..42165df346 100644 --- a/src/virtio/virtio.cpp +++ b/src/virtio/virtio.cpp @@ -1,19 +1,3 @@ -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2015 Oslo and Akershus University College of Applied Sciences -// and Alfred Bratterud -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. #include #include diff --git a/src/virtio/virtio_queue.cpp b/src/virtio/virtio_queue.cpp index 86a17ddf17..40b31cb573 100644 --- a/src/virtio/virtio_queue.cpp +++ b/src/virtio/virtio_queue.cpp @@ -1,19 +1,3 @@ -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2015 Oslo and Akershus University College of Applied Sciences -// and Alfred Bratterud -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. //#undef NO_DEBUG #define DEBUG // Allow debug diff --git a/test/fs/integration/fat16/fat16.cpp b/test/fs/integration/fat16/fat16.cpp index 36c9757e71..a37133ca8e 100644 --- a/test/fs/integration/fat16/fat16.cpp +++ b/test/fs/integration/fat16/fat16.cpp @@ -1,19 +1,3 @@ -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2015-2016 Oslo and Akershus University College of Applied Sciences -// and Alfred Bratterud -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. #include #include diff --git a/test/fs/integration/fat32/fat32.cpp b/test/fs/integration/fat32/fat32.cpp index 33b3fb52c1..254bf8c7fa 100644 --- a/test/fs/integration/fat32/fat32.cpp +++ b/test/fs/integration/fat32/fat32.cpp @@ -1,19 +1,3 @@ -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2015-2016 Oslo and Akershus University College of Applied Sciences -// and Alfred Bratterud -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. #include #include diff --git a/test/fs/integration/ide/service.cpp b/test/fs/integration/ide/service.cpp index 51482f3b94..82cdfa4d0d 100644 --- a/test/fs/integration/ide/service.cpp +++ b/test/fs/integration/ide/service.cpp @@ -1,19 +1,3 @@ -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2015-2016 Oslo and Akershus University College of Applied Sciences -// and Alfred Bratterud -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. #include #include diff --git a/test/fs/integration/ide_write/service.cpp b/test/fs/integration/ide_write/service.cpp index bff5704fe8..e66e5a5147 100644 --- a/test/fs/integration/ide_write/service.cpp +++ b/test/fs/integration/ide_write/service.cpp @@ -1,19 +1,3 @@ -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2015-2016 Oslo and Akershus University College of Applied Sciences -// and Alfred Bratterud -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. #include #include diff --git a/test/fs/integration/memdisk/bigdisk.cpp b/test/fs/integration/memdisk/bigdisk.cpp index e3d08d1c38..2830a5976c 100644 --- a/test/fs/integration/memdisk/bigdisk.cpp +++ b/test/fs/integration/memdisk/bigdisk.cpp @@ -1,19 +1,3 @@ -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2015-2016 Oslo and Akershus University College of Applied Sciences -// and Alfred Bratterud -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. #include #include diff --git a/test/fs/integration/memdisk/nosector.cpp b/test/fs/integration/memdisk/nosector.cpp index 1223c5dd3c..5bffc156b1 100644 --- a/test/fs/integration/memdisk/nosector.cpp +++ b/test/fs/integration/memdisk/nosector.cpp @@ -1,19 +1,3 @@ -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2015-2016 Oslo and Akershus University College of Applied Sciences -// and Alfred Bratterud -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. #include #include diff --git a/test/fs/integration/memdisk/twosector.cpp b/test/fs/integration/memdisk/twosector.cpp index 4a76abef6c..e3507ebf65 100644 --- a/test/fs/integration/memdisk/twosector.cpp +++ b/test/fs/integration/memdisk/twosector.cpp @@ -1,19 +1,3 @@ -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2015-2016 Oslo and Akershus University College of Applied Sciences -// and Alfred Bratterud -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. #include #include diff --git a/test/fs/integration/vfs/service.cpp b/test/fs/integration/vfs/service.cpp index 886500515c..2b5a4abe58 100644 --- a/test/fs/integration/vfs/service.cpp +++ b/test/fs/integration/vfs/service.cpp @@ -1,19 +1,4 @@ -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2015 Oslo and Akershus University College of Applied Sciences -// and Alfred Bratterud -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, //1 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. #define OS_TERMINATE_ON_CONTRACT_VIOLATION diff --git a/test/fs/integration/virtio_block/service.cpp b/test/fs/integration/virtio_block/service.cpp index bccfc0bed4..baaf1431be 100644 --- a/test/fs/integration/virtio_block/service.cpp +++ b/test/fs/integration/virtio_block/service.cpp @@ -1,19 +1,4 @@ -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2015 Oslo and Akershus University College of Applied Sciences -// and Alfred Bratterud -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, //1 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. #define OS_TERMINATE_ON_CONTRACT_VIOLATION #include diff --git a/test/fs/unit/memdisk_test.cpp b/test/fs/unit/memdisk_test.cpp index a7440c62bb..ae86f788a7 100644 --- a/test/fs/unit/memdisk_test.cpp +++ b/test/fs/unit/memdisk_test.cpp @@ -1,19 +1,3 @@ -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2016-2017 Oslo and Akershus University College of Applied Sciences -// and Alfred Bratterud -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. #include #include diff --git a/test/fs/unit/path_test.cpp b/test/fs/unit/path_test.cpp index bf1f4dd893..f4e5d30ed4 100644 --- a/test/fs/unit/path_test.cpp +++ b/test/fs/unit/path_test.cpp @@ -1,19 +1,3 @@ -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2015-2016 Oslo and Akershus University College of Applied Sciences -// and Alfred Bratterud -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. #include #include diff --git a/test/fs/unit/vfs_test.cpp b/test/fs/unit/vfs_test.cpp index 292aa1cd27..f7341214c3 100644 --- a/test/fs/unit/vfs_test.cpp +++ b/test/fs/unit/vfs_test.cpp @@ -1,19 +1,3 @@ -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2015-2016 Oslo and Akershus University College of Applied Sciences -// and Alfred Bratterud -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. #include #include diff --git a/test/hw/integration/serial/service.cpp b/test/hw/integration/serial/service.cpp index 3ad0811db6..07e56faedf 100644 --- a/test/hw/integration/serial/service.cpp +++ b/test/hw/integration/serial/service.cpp @@ -1,19 +1,3 @@ -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2015 Oslo and Akershus University College of Applied Sciences -// and Alfred Bratterud -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. #include #include diff --git a/test/hw/integration/vga/vga.cpp b/test/hw/integration/vga/vga.cpp index c098599bff..345e55dd1b 100644 --- a/test/hw/integration/vga/vga.cpp +++ b/test/hw/integration/vga/vga.cpp @@ -1,19 +1,5 @@ -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2015 Oslo and Akershus University College of Applied Sciences -// and Alfred Bratterud -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at // -// http://www.apache.org/licenses/LICENSE-2.0 // -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. #include #include diff --git a/test/hw/integration/virtio_queue/service.cpp b/test/hw/integration/virtio_queue/service.cpp index 73dbc8812c..24492eacb3 100644 --- a/test/hw/integration/virtio_queue/service.cpp +++ b/test/hw/integration/virtio_queue/service.cpp @@ -1,19 +1,3 @@ -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2015 Oslo and Akershus University College of Applied Sciences -// and Alfred Bratterud -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. /** A very superficial test to verify that basic STL is working diff --git a/test/hw/unit/cpu_test.cpp b/test/hw/unit/cpu_test.cpp index 355a5a68cc..64e079d9c0 100644 --- a/test/hw/unit/cpu_test.cpp +++ b/test/hw/unit/cpu_test.cpp @@ -1,19 +1,3 @@ -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2015-2016 Oslo and Akershus University College of Applied Sciences -// and Alfred Bratterud -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. #include diff --git a/test/hw/unit/mac_addr_test.cpp b/test/hw/unit/mac_addr_test.cpp index 902aede3f9..8960837ac8 100644 --- a/test/hw/unit/mac_addr_test.cpp +++ b/test/hw/unit/mac_addr_test.cpp @@ -1,19 +1,3 @@ -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2015-2016 Oslo and Akershus University College of Applied Sciences -// and Alfred Bratterud -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. #include #include diff --git a/test/hw/unit/usernet.cpp b/test/hw/unit/usernet.cpp index ce0afb3535..61878a9995 100644 --- a/test/hw/unit/usernet.cpp +++ b/test/hw/unit/usernet.cpp @@ -1,19 +1,3 @@ -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2016-2017 Oslo and Akershus University College of Applied Sciences -// and Alfred Bratterud -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. #include #include diff --git a/test/hw/unit/virtio_queue.cpp b/test/hw/unit/virtio_queue.cpp index 6594b1d0ea..413bd9430c 100644 --- a/test/hw/unit/virtio_queue.cpp +++ b/test/hw/unit/virtio_queue.cpp @@ -1,19 +1,3 @@ -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2016-2017 Oslo and Akershus University College of Applied Sciences -// and Alfred Bratterud -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. #include #include diff --git a/test/kernel/integration/LiveUpdate/CMakeLists.txt b/test/kernel/integration/LiveUpdate/CMakeLists.txt index f125329fce..60752e5f0e 100644 --- a/test/kernel/integration/LiveUpdate/CMakeLists.txt +++ b/test/kernel/integration/LiveUpdate/CMakeLists.txt @@ -7,6 +7,8 @@ if (NOT HAS_CONAN) endif() conan_basic_setup() +set(LIVEUPDATE_MB 32 CACHE STRING "") +option(MINIMAL "" ON) include(os) option(benchmark_mode "Optimizations for benchmarking" OFF) @@ -22,7 +24,7 @@ set(SOURCES os_add_executable(kernel_LiveUpdate "LiveUpdate integration test" ${SOURCES}) os_add_drivers(kernel_LiveUpdate - virtionet + vmxnet3 boot_logger ) diff --git a/test/kernel/integration/LiveUpdate/liu.hpp b/test/kernel/integration/LiveUpdate/liu.hpp index 4519ce39be..614baf8830 100644 --- a/test/kernel/integration/LiveUpdate/liu.hpp +++ b/test/kernel/integration/LiveUpdate/liu.hpp @@ -1,19 +1,3 @@ -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2015 Oslo and Akershus University College of Applied Sciences -// and Alfred Bratterud -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. #pragma once #include diff --git a/test/kernel/integration/LiveUpdate/manual.sh b/test/kernel/integration/LiveUpdate/manual.sh index e662bd2a10..32ebc74578 100755 --- a/test/kernel/integration/LiveUpdate/manual.sh +++ b/test/kernel/integration/LiveUpdate/manual.sh @@ -1,2 +1,2 @@ #!/bin/bash -cat > /dev/tcp/10.0.0.59/666 < build/kernel_LiveUpdate +cat > /dev/tcp/10.0.1.59/666 < build/kernel_LiveUpdate diff --git a/test/kernel/integration/LiveUpdate/service.cpp b/test/kernel/integration/LiveUpdate/service.cpp index 95dce1259d..f91841af21 100644 --- a/test/kernel/integration/LiveUpdate/service.cpp +++ b/test/kernel/integration/LiveUpdate/service.cpp @@ -1,22 +1,7 @@ -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2015 Oslo and Akershus University College of Applied Sciences -// and Alfred Bratterud -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. #include #include +#include #include #include "liu.hpp" @@ -25,6 +10,8 @@ extern storage_func_t begin_test_boot(); void Service::start() { +// auto prof = ScopedProfiler::get_statistics(false); +// printf("%s\n", prof.c_str()); #ifdef BENCHMARK_MODE extern bool LIVEUPDATE_USE_CHEKSUMS; LIVEUPDATE_USE_CHEKSUMS = false; @@ -36,7 +23,7 @@ void Service::start() if (liu::LiveUpdate::os_is_liveupdated() == false) { auto& inet = net::Interfaces::get(0); - inet.network_config({10,0,0,59}, {255,255,255,0}, {10,0,0,1}); + inet.network_config({10,0,1,59}, {255,255,255,0}, {10,0,1,1}); setup_liveupdate_server(inet, 666, func); // signal test.py that the server is up diff --git a/test/kernel/integration/LiveUpdate/test_boot.cpp b/test/kernel/integration/LiveUpdate/test_boot.cpp index fe2953b1cc..d9f976b9dc 100644 --- a/test/kernel/integration/LiveUpdate/test_boot.cpp +++ b/test/kernel/integration/LiveUpdate/test_boot.cpp @@ -3,31 +3,22 @@ #include #include #include +#include using namespace liu; static std::vector timestamps; -static buffer_t bloberino; +static uint8_t blob_data[1024*1024*16]; +static size_t blob_size = 0; -//#define DRIFTING_BINARY -#ifdef DRIFTING_BINARY -static char* blob_location = nullptr; -#endif - -static void boot_save(Storage& storage, const buffer_t* blob) +static void boot_save(Storage& storage) { timestamps.push_back(os::nanos_since_boot()); storage.add_vector(0, timestamps); assert(blob != nullptr); // store binary blob for later -#ifdef DRIFTING_BINARY - blob_location = (char*) os::liveupdate_storage_area() - 0x200000 - blob->size(); - std::copy(blob->begin(), blob->end(), blob_location); + auto blob = LiveUpdate::binary_blob(); + storage.add_buffer(2, blob.first, blob.second); - storage.add(2, blob_location); - storage.add(2, blob->size()); -#else - storage.add_buffer(2, *blob); -#endif auto& stm = Statman::get(); // increment number of updates performed try { @@ -48,14 +39,12 @@ static void boot_resume_all(Restore& thing) // set final time timestamps.back() = t2 - t1; // retrieve binary blob -#ifdef DRIFTING_BINARY - blob_location = thing.as_type(); thing.go_next(); - size_t len = thing.as_type (); thing.go_next(); - - bloberino = buffer_t{blob_location, blob_location + len}; -#else - bloberino = thing.as_buffer(); thing.go_next(); -#endif +{ + PROFILE("Retrieve ELF binary"); + memcpy(blob_data, thing.data(), thing.length()); + blob_size = thing.length(); + thing.go_next(); +} // statman auto& stm = Statman::get(); stm.restore(thing); thing.go_next(); @@ -79,6 +68,8 @@ LiveUpdate::storage_func begin_test_boot() // show information printf("Median boot time over %lu samples: %.2f millis\n", timestamps.size(), median / 1000000.0); + printf("Best time: %.2f millis Worst time: %.2f millis\n", + timestamps.front() / 1000000.0, timestamps.back() / 1000000.0); /* for (auto& stamp : timestamps) { printf("%lld\n", stamp); @@ -92,6 +83,8 @@ LiveUpdate::storage_func begin_test_boot() using namespace std::chrono; Timers::oneshot(5ms,[] (int) { + extern int16_t __startup_was_fast; + printf("Startup was fast: %d\n", __startup_was_fast); printf("SUCCESS\n"); SystemLog::print_to(os::default_stdout); }); @@ -99,7 +92,7 @@ LiveUpdate::storage_func begin_test_boot() } else { // immediately liveupdate - LiveUpdate::exec(bloberino, "test", boot_save); + LiveUpdate::exec(blob_data, blob_size, "test", boot_save); } } // wait for update diff --git a/test/kernel/integration/LiveUpdate/vm.json b/test/kernel/integration/LiveUpdate/vm.json index 05c8586b61..3b205c7324 100644 --- a/test/kernel/integration/LiveUpdate/vm.json +++ b/test/kernel/integration/LiveUpdate/vm.json @@ -1,7 +1,7 @@ { "description" : "VM with interface for testing LiveUpdate", "net" : [ - {"device" : "virtio"} + {"device" : "vmxnet3"} ], - "mem" : 1024 + "mem" : 128 } diff --git a/test/kernel/integration/block/service.cpp b/test/kernel/integration/block/service.cpp index ed07ebea68..3ac6f7ea94 100644 --- a/test/kernel/integration/block/service.cpp +++ b/test/kernel/integration/block/service.cpp @@ -1,19 +1,3 @@ -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2015 Oslo and Akershus University College of Applied Sciences -// and Alfred Bratterud -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. #include #include diff --git a/test/kernel/integration/context/service.cpp b/test/kernel/integration/context/service.cpp index 71582250c3..ccb06c2eb2 100644 --- a/test/kernel/integration/context/service.cpp +++ b/test/kernel/integration/context/service.cpp @@ -1,19 +1,3 @@ -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2015 Oslo and Akershus University College of Applied Sciences -// and Alfred Bratterud -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. #include #include diff --git a/test/kernel/integration/exception/service.cpp b/test/kernel/integration/exception/service.cpp index 75e4fe1d60..d9484593a6 100644 --- a/test/kernel/integration/exception/service.cpp +++ b/test/kernel/integration/exception/service.cpp @@ -1,19 +1,3 @@ -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2015 Oslo and Akershus University College of Applied Sciences -// and Alfred Bratterud -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. #include diff --git a/test/kernel/integration/fiber/service.cpp b/test/kernel/integration/fiber/service.cpp index 3f76439b08..ebd5d02d1d 100644 --- a/test/kernel/integration/fiber/service.cpp +++ b/test/kernel/integration/fiber/service.cpp @@ -1,19 +1,3 @@ -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2017 Oslo and Akershus University College of Applied Sciences -// and Alfred Bratterud -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. #include #include diff --git a/test/kernel/integration/grub/service.cpp b/test/kernel/integration/grub/service.cpp index 58def2d702..435b7f527e 100644 --- a/test/kernel/integration/grub/service.cpp +++ b/test/kernel/integration/grub/service.cpp @@ -1,19 +1,3 @@ -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2015 Oslo and Akershus University College of Applied Sciences -// and Alfred Bratterud -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. #include diff --git a/test/kernel/integration/kprint/service.cpp b/test/kernel/integration/kprint/service.cpp index 66cae54cfb..26101ea31e 100644 --- a/test/kernel/integration/kprint/service.cpp +++ b/test/kernel/integration/kprint/service.cpp @@ -1,19 +1,3 @@ -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2015 Oslo and Akershus University College of Applied Sciences -// and Alfred Bratterud -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. #include #include "../../../../src/include/kprint" diff --git a/test/kernel/integration/memmap/service.cpp b/test/kernel/integration/memmap/service.cpp index 017838fef9..bf3eb6cb25 100644 --- a/test/kernel/integration/memmap/service.cpp +++ b/test/kernel/integration/memmap/service.cpp @@ -1,19 +1,3 @@ -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2015 Oslo and Akershus University College of Applied Sciences -// and Alfred Bratterud -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. #include #include diff --git a/test/kernel/integration/modules/service.cpp b/test/kernel/integration/modules/service.cpp index 9145e276e6..c0b20902e8 100644 --- a/test/kernel/integration/modules/service.cpp +++ b/test/kernel/integration/modules/service.cpp @@ -1,19 +1,3 @@ -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2017 Oslo and Akershus University College of Applied Sciences -// and Alfred Bratterud -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. #include #include diff --git a/test/kernel/integration/paging/service.cpp b/test/kernel/integration/paging/service.cpp index d7963f89ee..dd30048ec6 100644 --- a/test/kernel/integration/paging/service.cpp +++ b/test/kernel/integration/paging/service.cpp @@ -1,20 +1,4 @@ // -*- C++ -*- -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2017 Oslo and Akershus University College of Applied Sciences -// and Alfred Bratterud -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. #include //#include diff --git a/test/kernel/integration/plugin_init/service.cpp b/test/kernel/integration/plugin_init/service.cpp index fbbca3e291..274fd8f0a4 100644 --- a/test/kernel/integration/plugin_init/service.cpp +++ b/test/kernel/integration/plugin_init/service.cpp @@ -1,19 +1,3 @@ -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2015 Oslo and Akershus University College of Applied Sciences -// and Alfred Bratterud -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. #include diff --git a/test/kernel/integration/rng/service.cpp b/test/kernel/integration/rng/service.cpp index 4791cabfbd..8110bb0730 100644 --- a/test/kernel/integration/rng/service.cpp +++ b/test/kernel/integration/rng/service.cpp @@ -1,19 +1,3 @@ -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2016 Oslo and Akershus University College of Applied Sciences -// and Alfred Bratterud -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. #include #include // std::random_device diff --git a/test/kernel/integration/smp/service.cpp b/test/kernel/integration/smp/service.cpp index e2e6f1dac7..994bd5c4a8 100644 --- a/test/kernel/integration/smp/service.cpp +++ b/test/kernel/integration/smp/service.cpp @@ -1,19 +1,3 @@ -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2015 Oslo and Akershus University College of Applied Sciences -// and Alfred Bratterud -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. #include #include @@ -28,7 +12,7 @@ struct alignas(SMP_ALIGN) per_cpu_test int value; }; -static SMP::Array testing; +static std::array testing; #include void smp_advanced_test() @@ -50,7 +34,7 @@ void smp_advanced_test() if (PER_CPU(testing).value == SMP::cpu_id()) __sync_fetch_and_or(&job, 1 << i); }, - [i] { + [] { // job completion completed++; @@ -60,9 +44,8 @@ void smp_advanced_test() printf("bits = %#x\n", job); SMP::global_unlock(); assert(job = 0xffffffff && "All 32 bits must be set"); - if (SMP::cpu_count() == 1) - printf("SUCCESS\n"); } + SMP::global_lock(); volatile void* test = calloc(4, 128u); assert(test); __sw_barrier(); @@ -70,6 +53,7 @@ void smp_advanced_test() assert(test); __sw_barrier(); free((void*) test); + SMP::global_unlock(); }); // have one CPU enter an event loop @@ -86,6 +70,7 @@ void smp_advanced_test() if (times == SMP::cpu_count()-1 && irq_times == SMP::cpu_count()-1) { printf("SUCCESS!\n"); + SMP::add_bsp_task(os::shutdown); } SMP::global_unlock(); }); @@ -94,18 +79,21 @@ void smp_advanced_test() SMP::signal(); } +#include +static struct { + smp_barrier barry; +} messages; + static void random_irq_handler() { SMP::global_lock(); irq_times++; bool done = (irq_times == SMP::cpu_count()-1); - SMP::global_unlock(); if (done) { - SMP::global_lock(); printf("Random IRQ handler called %d times\n", irq_times); - SMP::global_unlock(); } + SMP::global_unlock(); } static const uint8_t IRQ = 110; @@ -114,26 +102,95 @@ void SMP::init_task() Events::get().subscribe(IRQ, random_irq_handler); } +#include +#include +__attribute__((noinline)) +static void task_main(int cpu) +{ + SMP::global_lock(); + printf("CPU %d (%d) TID %ld running task\n", + SMP::cpu_id(), cpu, kernel::get_tid()); + SMP::global_unlock(); +} +static void multiprocess_task(int task) +{ + SMP::global_lock(); + printf("CPU %d TASK %d TID %ld running automatic multi-processing task\n", + SMP::cpu_id(), task, kernel::get_tid()); + SMP::global_unlock(); + messages.barry.increment(); +} + void Service::start() { + if (SMP::active_cpus().size() < 2) { + throw std::runtime_error("Need at least 2 CPUs to run this test!"); + } - for (const auto& i : SMP::active_cpus()) + for (const int i : SMP::active_cpus()) { - SMP::global_lock(); - printf("CPU %i active \n", i); - SMP::global_unlock(); - - SMP::add_task([i]{ - SMP::global_lock(); - printf("CPU %i, id %i running task \n", i, SMP::cpu_id()); - SMP::global_unlock(); - }, i); + // adding work and signalling CPU=0 is the same as broadcasting to + // all active CPUs, and giving work to the first free CPU + if (i == 0) continue; // we don't want to do that here, for this test + + SMP::add_task( + [cpu = i] { + auto* t = new std::thread(&task_main, cpu); + t->join(); + + const char TC = kernel::get_tid() & 0xFF; + volatile void* test = calloc(4, 128u); + assert(test); + __sw_barrier(); + for (int i = 0; i < 128; i++) { + ((char*)test)[i] = TC; + } + __sw_barrier(); + test = realloc((void*) test, 128u); + assert(test); + __sw_barrier(); + for (int i = 0; i < 128; i++) { + assert(((char*)test)[i] == TC); + } + free((void*) test); + + messages.barry.increment(); + }, i); SMP::signal(i); } + + // wait for idiots to finish + SMP::global_lock(); + printf("Waiting for %zu tasks from TID=%ld\n", + SMP::cpu_count()-1, kernel::get_tid()); + SMP::global_unlock(); + messages.barry.spin_wait(SMP::cpu_count()-1); + messages.barry.reset(); + + // threads will now be migrated to free CPUs + kernel::setup_automatic_thread_multiprocessing(); + + std::vector mpthreads; + for (unsigned i = 0; i < SMP::active_cpus().size() - 1; i++) + { + mpthreads.push_back( + new std::thread(&multiprocess_task, i) + ); + } + + SMP::global_lock(); + printf("Joining %zu threads\n", mpthreads.size()); + SMP::global_unlock(); + + for (auto* t : mpthreads) { + t->join(); + } + // the dead threads should have already made this barrier complete! + messages.barry.spin_wait(SMP::cpu_count()-1); + // trigger interrupt SMP::broadcast(IRQ); - // the rest smp_advanced_test(); } diff --git a/test/kernel/integration/smp/vm.json b/test/kernel/integration/smp/vm.json index 96bc16da35..10e810413e 100644 --- a/test/kernel/integration/smp/vm.json +++ b/test/kernel/integration/smp/vm.json @@ -1,4 +1,5 @@ { "image" : "service.img", - "smp" : 16 + "smp" : 32, + "mem" : 256 } diff --git a/test/kernel/integration/term/service.cpp b/test/kernel/integration/term/service.cpp index 99389f96ae..cb6ceae852 100644 --- a/test/kernel/integration/term/service.cpp +++ b/test/kernel/integration/term/service.cpp @@ -1,19 +1,3 @@ -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2015 Oslo and Akershus University College of Applied Sciences -// and Alfred Bratterud -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. #include #include diff --git a/test/kernel/integration/threads/CMakeLists.txt b/test/kernel/integration/threads/CMakeLists.txt new file mode 100644 index 0000000000..0f5854a854 --- /dev/null +++ b/test/kernel/integration/threads/CMakeLists.txt @@ -0,0 +1,23 @@ +cmake_minimum_required(VERSION 3.0) + +# Service +project (smp_test) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake OPTIONAL RESULT_VARIABLE HAS_CONAN) +if (NOT HAS_CONAN) + message(FATAL_ERROR "missing conanbuildinfo.cmake did you forget to run conan install ?") +endif() +conan_basic_setup() + +include(os) + +set(SOURCES + service.cpp # ...add more here +) + +os_add_executable(kernel_threads "Threads test" ${SOURCES}) +os_add_stdout(kernel_threads default_stdout) +os_add_drivers(kernel_threads boot_logger) +#os_add_plugins(service vfs) + +configure_file(test.py ${CMAKE_CURRENT_BINARY_DIR}) diff --git a/test/kernel/integration/threads/README.md b/test/kernel/integration/threads/README.md new file mode 100644 index 0000000000..225488f17f --- /dev/null +++ b/test/kernel/integration/threads/README.md @@ -0,0 +1,9 @@ +### SMP + +``` +mkdir build +cd build +cmake .. +make +../run.sh smp_example +``` diff --git a/test/kernel/integration/threads/service.cpp b/test/kernel/integration/threads/service.cpp new file mode 100644 index 0000000000..9310fdd19e --- /dev/null +++ b/test/kernel/integration/threads/service.cpp @@ -0,0 +1,120 @@ + +#include +#include +#include +#include +#include + +struct testdata +{ + int depth = 0; + const int max_depth = 20; +}; + +extern "C" { + static void* thread_function1(void* data) + { + printf("Inside thread function1, x = %d\n", *(int*) data); + thread_local int test = 2019; + printf("test @ %p, test = %d\n", &test, test); + assert(test == 2019); + // this will cause a TKILL on this thread + throw std::runtime_error("Test"); + } + static void* thread_function2(void* data) + { + printf("Inside thread function2, x = %d\n", *(int*) data); + thread_local int test = 2020; + + printf("Locking already locked mutex now\n"); + auto* mtx = (pthread_mutex_t*) data; + const int res = pthread_mutex_lock(mtx); + printf("Locking returned %d\n", res); + + printf("Yielding from thread2, expecting to be returned to main thread\n"); + sched_yield(); + printf("Returned to thread2, expecting to exit to after main thread yield\n"); + + pthread_exit(NULL); + } + static void* recursive_function(void* tdata) + { + auto* data = (testdata*) tdata; + data->depth++; + printf("%ld: Thread depth %d / %d\n", + kernel::get_thread()->tid, data->depth, data->max_depth); + + if (data->depth < data->max_depth) + { + pthread_t t; + int res = pthread_create(&t, NULL, recursive_function, data); + if (res < 0) { + printf("Failed to create thread!\n"); + return NULL; + } + } + printf("%ld: Thread yielding %d / %d\n", + kernel::get_thread()->tid, data->depth, data->max_depth); + sched_yield(); + + printf("%ld: Thread exiting %d / %d\n", + kernel::get_thread()->tid, data->depth, data->max_depth); + data->depth--; + return NULL; + } +} + +void Service::start() +{ + int x = 666; + pthread_mutex_t mtx = PTHREAD_MUTEX_INITIALIZER; + pthread_t t; + int res; + + printf("*** Testing yielding from single-threaded...\n"); + sched_yield(); // should return immediately + + printf("*** Testing pthread_create and sched_yield...\n"); + res = pthread_create(&t, NULL, thread_function1, &x); + if (res < 0) { + printf("Failed to create thread!\n"); + return; + } + + pthread_mutex_lock(&mtx); + res = pthread_create(&t, NULL, thread_function2, &mtx); + if (res < 0) { + printf("Failed to create thread!\n"); + return; + } + pthread_mutex_unlock(&mtx); + + printf("Yielding from main thread, expecting to return to thread2\n"); + // return back to finish thread2 + sched_yield(); + printf("After yielding from main thread, looking good!\n"); + + printf("*** Now testing recursive threads...\n"); + static testdata rdata; + recursive_function(&rdata); + // now we have to yield until all the detached children also exit + printf("*** Yielding until all children are dead!\n"); + while (rdata.depth > 0) sched_yield(); + + auto* cpp_thread = new std::thread( + [] (int a, long long b, std::string c) -> void { + printf("Hello from a C++ thread\n"); + assert(a == 1); + assert(b == 2LL); + assert(c == std::string("test")); + printf("C++ thread arguments are OK, returning...\n"); + }, + 1, 2L, std::string("test") + ); + printf("Returned. Deleting the C++ thread\n"); + cpp_thread->join(); + delete cpp_thread; + + printf("SUCCESS\n"); + os::shutdown(); +} diff --git a/test/kernel/integration/threads/test.py b/test/kernel/integration/threads/test.py new file mode 100755 index 0000000000..952f0f6367 --- /dev/null +++ b/test/kernel/integration/threads/test.py @@ -0,0 +1,13 @@ +#! /usr/bin/env python + +from builtins import str +import sys +import os + +from vmrunner import vmrunner + +if len(sys.argv) > 1: + vmrunner.vms[0].boot(image_name=str(sys.argv[1])) +else: + vmrunner.vms[0].cmake().boot(20,image_name='kernel_smp').clean() +#vm.cmake(["-Dsingle_threaded=OFF"]).boot(20).clean() diff --git a/test/kernel/integration/threads/vm.json b/test/kernel/integration/threads/vm.json new file mode 100644 index 0000000000..38a80d9209 --- /dev/null +++ b/test/kernel/integration/threads/vm.json @@ -0,0 +1,4 @@ +{ + "image" : "service.img", + "smp" : 1 +} diff --git a/test/kernel/integration/timers/service.cpp b/test/kernel/integration/timers/service.cpp index 7db283fd1f..7a1ede494c 100644 --- a/test/kernel/integration/timers/service.cpp +++ b/test/kernel/integration/timers/service.cpp @@ -1,19 +1,3 @@ -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2015 Oslo and Akershus University College of Applied Sciences -// and Alfred Bratterud -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. #include #include diff --git a/test/kernel/integration/timers/timers.cpp b/test/kernel/integration/timers/timers.cpp index 6afc2aeb79..d783c37fd7 100644 --- a/test/kernel/integration/timers/timers.cpp +++ b/test/kernel/integration/timers/timers.cpp @@ -1,19 +1,3 @@ -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2015 Oslo and Akershus University College of Applied Sciences -// and Alfred Bratterud -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. #include #include diff --git a/test/kernel/integration/tls/service.cpp b/test/kernel/integration/tls/service.cpp index a0e1dd4eb5..3006050724 100644 --- a/test/kernel/integration/tls/service.cpp +++ b/test/kernel/integration/tls/service.cpp @@ -1,19 +1,3 @@ -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2015 Oslo and Akershus University College of Applied Sciences -// and Alfred Bratterud -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. #include #include diff --git a/test/kernel/unit/memmap_test.cpp b/test/kernel/unit/memmap_test.cpp index 9cc256c2d0..09e0987727 100644 --- a/test/kernel/unit/memmap_test.cpp +++ b/test/kernel/unit/memmap_test.cpp @@ -1,19 +1,3 @@ -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2015-2016 Oslo and Akershus University College of Applied Sciences -// and Alfred Bratterud -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. #include #include diff --git a/test/kernel/unit/memory.cpp b/test/kernel/unit/memory.cpp index 3be60dccb8..d7109c22c3 100644 --- a/test/kernel/unit/memory.cpp +++ b/test/kernel/unit/memory.cpp @@ -1,18 +1,3 @@ -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2017 IncludeOS AS, Oslo, Norway -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. // #define DEBUG_UNIT #ifdef DEBUG_UNIT diff --git a/test/kernel/unit/os_test.cpp b/test/kernel/unit/os_test.cpp index 82f6e8e9b0..8f06a3b881 100644 --- a/test/kernel/unit/os_test.cpp +++ b/test/kernel/unit/os_test.cpp @@ -1,19 +1,3 @@ -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2016-2017 Oslo and Akershus University College of Applied Sciences -// and Alfred Bratterud -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. #include #include diff --git a/test/kernel/unit/rng.cpp b/test/kernel/unit/rng.cpp index 7c4e622eae..95f15c6daa 100644 --- a/test/kernel/unit/rng.cpp +++ b/test/kernel/unit/rng.cpp @@ -1,19 +1,3 @@ -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2016-2017 Oslo and Akershus University College of Applied Sciences -// and Alfred Bratterud -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. #include #include diff --git a/test/kernel/unit/service_stub_test.cpp b/test/kernel/unit/service_stub_test.cpp index 7f7210af1c..30b4e7a506 100644 --- a/test/kernel/unit/service_stub_test.cpp +++ b/test/kernel/unit/service_stub_test.cpp @@ -1,19 +1,3 @@ -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2015-2017 Oslo and Akershus University College of Applied Sciences -// and Alfred Bratterud -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. #include #include diff --git a/test/kernel/unit/test_hal.cpp b/test/kernel/unit/test_hal.cpp index 2720785014..2dcc1b75f9 100644 --- a/test/kernel/unit/test_hal.cpp +++ b/test/kernel/unit/test_hal.cpp @@ -1,19 +1,4 @@ // -*-C++-*- -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2018 IncludeOS AS, Oslo, Norway -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. #define DEBUG_UNIT diff --git a/test/kernel/unit/unit_events.cpp b/test/kernel/unit/unit_events.cpp index 3903175697..91f7692f06 100644 --- a/test/kernel/unit/unit_events.cpp +++ b/test/kernel/unit/unit_events.cpp @@ -1,19 +1,3 @@ -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2016-2017 Oslo and Akershus University College of Applied Sciences -// and Alfred Bratterud -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. #include #include diff --git a/test/kernel/unit/unit_timers.cpp b/test/kernel/unit/unit_timers.cpp index 395aae72b6..ff5d8cc580 100644 --- a/test/kernel/unit/unit_timers.cpp +++ b/test/kernel/unit/unit_timers.cpp @@ -1,19 +1,3 @@ -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2016-2017 Oslo and Akershus University College of Applied Sciences -// and Alfred Bratterud -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. #include #include diff --git a/test/kernel/unit/x86_paging.cpp b/test/kernel/unit/x86_paging.cpp index 214e376bb6..a664958fd6 100644 --- a/test/kernel/unit/x86_paging.cpp +++ b/test/kernel/unit/x86_paging.cpp @@ -1,19 +1,4 @@ // -*-C++-*- -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2017 IncludeOS AS, Oslo, Norway -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. //#define DEBUG_UNIT diff --git a/test/lest_util/nic_mock.hpp b/test/lest_util/nic_mock.hpp index ef385abc07..0faa10bc73 100644 --- a/test/lest_util/nic_mock.hpp +++ b/test/lest_util/nic_mock.hpp @@ -1,19 +1,3 @@ -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2015-2017 Oslo and Akershus University College of Applied Sciences -// and Alfred Bratterud -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. #include diff --git a/test/lest_util/os_mock.cpp b/test/lest_util/os_mock.cpp index 68e4239d21..b5fae771e6 100644 --- a/test/lest_util/os_mock.cpp +++ b/test/lest_util/os_mock.cpp @@ -1,19 +1,3 @@ -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2015-2017 Oslo and Akershus University College of Applied Sciences -// and Alfred Bratterud -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. #include #include diff --git a/test/lest_util/packet_factory.hpp b/test/lest_util/packet_factory.hpp index 9d8886c4ec..d762b0c84c 100644 --- a/test/lest_util/packet_factory.hpp +++ b/test/lest_util/packet_factory.hpp @@ -1,19 +1,3 @@ -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2017 Oslo and Akershus University College of Applied Sciences -// and Alfred Bratterud -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. #pragma once #ifndef TEST_PACKET_FACTORY_HPP diff --git a/test/lib/unit/mana/cookie_jar_test.cpp b/test/lib/unit/mana/cookie_jar_test.cpp index 8e02ee5e7d..7c6d94f13e 100644 --- a/test/lib/unit/mana/cookie_jar_test.cpp +++ b/test/lib/unit/mana/cookie_jar_test.cpp @@ -1,19 +1,3 @@ -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2015-2016 Oslo and Akershus University College of Applied Sciences -// and Alfred Bratterud -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. #include "../cookie_jar.hpp" #include diff --git a/test/mod/integration/gsl/service.cpp b/test/mod/integration/gsl/service.cpp index 23428e97f7..c117dbe60f 100644 --- a/test/mod/integration/gsl/service.cpp +++ b/test/mod/integration/gsl/service.cpp @@ -1,19 +1,3 @@ -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2015 Oslo and Akershus University College of Applied Sciences -// and Alfred Bratterud -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. /** A very superficial test to verify that basic STL is working diff --git a/test/net/integration/bufstore/service.cpp b/test/net/integration/bufstore/service.cpp index 1db42fb59a..609e3fc2d4 100644 --- a/test/net/integration/bufstore/service.cpp +++ b/test/net/integration/bufstore/service.cpp @@ -1,19 +1,3 @@ -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2015 Oslo and Akershus University College of Applied Sciences -// and Alfred Bratterud -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. //#define DEBUG // Debug supression diff --git a/test/net/integration/configure/service.cpp b/test/net/integration/configure/service.cpp index 5f0e915b88..6b195233e8 100644 --- a/test/net/integration/configure/service.cpp +++ b/test/net/integration/configure/service.cpp @@ -1,19 +1,3 @@ -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2017 Oslo and Akershus University College of Applied Sciences -// and Alfred Bratterud -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. #include #include diff --git a/test/net/integration/dhclient/service.cpp b/test/net/integration/dhclient/service.cpp index 352aac1db7..c20539a423 100644 --- a/test/net/integration/dhclient/service.cpp +++ b/test/net/integration/dhclient/service.cpp @@ -1,19 +1,3 @@ -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2015 Oslo and Akershus University College of Applied Sciences -// and Alfred Bratterud -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. //#define DEBUG // Debug supression diff --git a/test/net/integration/dhcpd/service.cpp b/test/net/integration/dhcpd/service.cpp index c8e23af0b6..8e8a54b827 100644 --- a/test/net/integration/dhcpd/service.cpp +++ b/test/net/integration/dhcpd/service.cpp @@ -1,19 +1,3 @@ -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2016-2017 Oslo and Akershus University College of Applied Sciences -// and Alfred Bratterud -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. #include #include diff --git a/test/net/integration/dhcpd_dhclient_linux/service.cpp b/test/net/integration/dhcpd_dhclient_linux/service.cpp index 9f218b5d7b..e83287dae5 100644 --- a/test/net/integration/dhcpd_dhclient_linux/service.cpp +++ b/test/net/integration/dhcpd_dhclient_linux/service.cpp @@ -1,19 +1,3 @@ -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2016-2017 Oslo and Akershus University College of Applied Sciences -// and Alfred Bratterud -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. #include #include diff --git a/test/net/integration/dns/service.cpp b/test/net/integration/dns/service.cpp index 3d67e5abed..77dae70684 100644 --- a/test/net/integration/dns/service.cpp +++ b/test/net/integration/dns/service.cpp @@ -1,19 +1,3 @@ -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2017 Oslo and Akershus University College of Applied Sciences -// and Alfred Bratterud -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. #include #include diff --git a/test/net/integration/gateway/service.cpp b/test/net/integration/gateway/service.cpp index 97af15eec0..5410c66838 100644 --- a/test/net/integration/gateway/service.cpp +++ b/test/net/integration/gateway/service.cpp @@ -1,19 +1,3 @@ -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2016-2017 Oslo and Akershus University College of Applied Sciences -// and Alfred Bratterud -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. #include #include diff --git a/test/net/integration/http/service.cpp b/test/net/integration/http/service.cpp index 009b08b40c..25ce59ca76 100644 --- a/test/net/integration/http/service.cpp +++ b/test/net/integration/http/service.cpp @@ -1,19 +1,3 @@ -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2016 Oslo and Akershus University College of Applied Sciences -// and Alfred Bratterud -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. #include #include diff --git a/test/net/integration/icmp/service.cpp b/test/net/integration/icmp/service.cpp index 982a89cfd7..f20404bb21 100644 --- a/test/net/integration/icmp/service.cpp +++ b/test/net/integration/icmp/service.cpp @@ -1,19 +1,3 @@ -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2015 Oslo and Akershus University College of Applied Sciences -// and Alfred Bratterud -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. #include #include diff --git a/test/net/integration/icmp6/service.cpp b/test/net/integration/icmp6/service.cpp index 950cee4a1f..97f3512219 100644 --- a/test/net/integration/icmp6/service.cpp +++ b/test/net/integration/icmp6/service.cpp @@ -1,19 +1,3 @@ -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2015 Oslo and Akershus University College of Applied Sciences -// and Alfred Bratterud -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. #include #include diff --git a/test/net/integration/microLB/service.cpp b/test/net/integration/microLB/service.cpp index f757203cd5..46c11baef5 100644 --- a/test/net/integration/microLB/service.cpp +++ b/test/net/integration/microLB/service.cpp @@ -1,19 +1,3 @@ -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2015 Oslo and Akershus University College of Applied Sciences -// and Alfred Bratterud -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. #include #include diff --git a/test/net/integration/nat/service.cpp b/test/net/integration/nat/service.cpp index dd5de2c99d..46ec9a73bf 100644 --- a/test/net/integration/nat/service.cpp +++ b/test/net/integration/nat/service.cpp @@ -1,19 +1,3 @@ -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2016-2017 Oslo and Akershus University College of Applied Sciences -// and Alfred Bratterud -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. #include #include diff --git a/test/net/integration/router/service.cpp b/test/net/integration/router/service.cpp index bbd65fe9d2..6fd78e8b2e 100644 --- a/test/net/integration/router/service.cpp +++ b/test/net/integration/router/service.cpp @@ -1,19 +1,3 @@ -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2015 Oslo and Akershus University College of Applied Sciences -// and Alfred Bratterud -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. #include #include diff --git a/test/net/integration/router6/service.cpp b/test/net/integration/router6/service.cpp index b9ed9d536c..d650acc036 100644 --- a/test/net/integration/router6/service.cpp +++ b/test/net/integration/router6/service.cpp @@ -1,19 +1,3 @@ -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2015 Oslo and Akershus University College of Applied Sciences -// and Alfred Bratterud -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. #include #include diff --git a/test/net/integration/slaac/service.cpp b/test/net/integration/slaac/service.cpp index a018572bc2..130abe64a2 100644 --- a/test/net/integration/slaac/service.cpp +++ b/test/net/integration/slaac/service.cpp @@ -1,19 +1,3 @@ -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2015 Oslo and Akershus University College of Applied Sciences -// and Alfred Bratterud -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. //#define DEBUG // Debug supression diff --git a/test/net/integration/tcp/service.cpp b/test/net/integration/tcp/service.cpp index 95f2e1828d..126866dc45 100644 --- a/test/net/integration/tcp/service.cpp +++ b/test/net/integration/tcp/service.cpp @@ -1,19 +1,3 @@ -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2015 Oslo and Akershus University College of Applied Sciences -// and Alfred Bratterud -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. #include #include diff --git a/test/net/integration/udp/service.cpp b/test/net/integration/udp/service.cpp index 9d5ecffc60..c6edce14f8 100644 --- a/test/net/integration/udp/service.cpp +++ b/test/net/integration/udp/service.cpp @@ -1,19 +1,3 @@ -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2015 Oslo and Akershus University College of Applied Sciences -// and Alfred Bratterud -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. #include #include diff --git a/test/net/integration/vlan/service.cpp b/test/net/integration/vlan/service.cpp index c0b3623e1d..bbdcdf23b2 100644 --- a/test/net/integration/vlan/service.cpp +++ b/test/net/integration/vlan/service.cpp @@ -1,19 +1,3 @@ -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2016-2017 Oslo and Akershus University College of Applied Sciences -// and Alfred Bratterud -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. #include #include diff --git a/test/net/unit/addr_test.cpp b/test/net/unit/addr_test.cpp index 5aa371ab04..561799c981 100644 --- a/test/net/unit/addr_test.cpp +++ b/test/net/unit/addr_test.cpp @@ -1,19 +1,3 @@ -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2015-2016 Oslo and Akershus University College of Applied Sciences -// and Alfred Bratterud -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. #include #include diff --git a/test/net/unit/bufstore.cpp b/test/net/unit/bufstore.cpp index cb3979a25d..7dffd75936 100644 --- a/test/net/unit/bufstore.cpp +++ b/test/net/unit/bufstore.cpp @@ -1,19 +1,3 @@ -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2015-2017 Oslo and Akershus University College of Applied Sciences -// and Alfred Bratterud -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. #include #include diff --git a/test/net/unit/checksum.cpp b/test/net/unit/checksum.cpp index 2493b6ffa6..5b6c39ee63 100644 --- a/test/net/unit/checksum.cpp +++ b/test/net/unit/checksum.cpp @@ -1,19 +1,3 @@ -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2015-2017 Oslo and Akershus University College of Applied Sciences -// and Alfred Bratterud -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. #include #include diff --git a/test/net/unit/cidr.cpp b/test/net/unit/cidr.cpp index 643e7600b0..3a5159ecdc 100644 --- a/test/net/unit/cidr.cpp +++ b/test/net/unit/cidr.cpp @@ -1,19 +1,3 @@ -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2017 Oslo and Akershus University College of Applied Sciences -// and Alfred Bratterud -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. #include #include diff --git a/test/net/unit/conntrack_test.cpp b/test/net/unit/conntrack_test.cpp index 2814720ffb..ecf8d78f08 100644 --- a/test/net/unit/conntrack_test.cpp +++ b/test/net/unit/conntrack_test.cpp @@ -1,19 +1,3 @@ -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2017 Oslo and Akershus University College of Applied Sciences -// and Alfred Bratterud -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. #include #include diff --git a/test/net/unit/cookie_test.cpp b/test/net/unit/cookie_test.cpp index fe94f76f43..a53b24f9c0 100644 --- a/test/net/unit/cookie_test.cpp +++ b/test/net/unit/cookie_test.cpp @@ -1,19 +1,3 @@ -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2015-2016 Oslo and Akershus University College of Applied Sciences -// and Alfred Bratterud -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. #include #include diff --git a/test/net/unit/dhcp.cpp b/test/net/unit/dhcp.cpp index 6627c01a72..b523d0183d 100644 --- a/test/net/unit/dhcp.cpp +++ b/test/net/unit/dhcp.cpp @@ -1,19 +1,3 @@ -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2015-2017 Oslo and Akershus University College of Applied Sciences -// and Alfred Bratterud -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. #include #include diff --git a/test/net/unit/dhcp_message_test.cpp b/test/net/unit/dhcp_message_test.cpp index 75896b5128..c0ec8384ae 100644 --- a/test/net/unit/dhcp_message_test.cpp +++ b/test/net/unit/dhcp_message_test.cpp @@ -1,19 +1,3 @@ -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2017 Oslo and Akershus University College of Applied Sciences -// and Alfred Bratterud -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. #include #include diff --git a/test/net/unit/error.cpp b/test/net/unit/error.cpp index 9444cbf91e..a6e7cdca26 100644 --- a/test/net/unit/error.cpp +++ b/test/net/unit/error.cpp @@ -1,19 +1,3 @@ -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2017 Oslo and Akershus University College of Applied Sciences -// and Alfred Bratterud -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. #include #include diff --git a/test/net/unit/http_header_test.cpp b/test/net/unit/http_header_test.cpp index c00d668ba5..15bd2adfa2 100644 --- a/test/net/unit/http_header_test.cpp +++ b/test/net/unit/http_header_test.cpp @@ -1,19 +1,3 @@ -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2015-2017 Oslo and Akershus University College of Applied Sciences -// and Alfred Bratterud -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. #include #include diff --git a/test/net/unit/http_method_test.cpp b/test/net/unit/http_method_test.cpp index 8244a5b314..0d00c2665e 100644 --- a/test/net/unit/http_method_test.cpp +++ b/test/net/unit/http_method_test.cpp @@ -1,19 +1,3 @@ -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2016-2017 Oslo and Akershus University College of Applied Sciences -// and Alfred Bratterud -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. #include #include diff --git a/test/net/unit/http_mime_types_test.cpp b/test/net/unit/http_mime_types_test.cpp index 99694b51cd..1e59f76287 100644 --- a/test/net/unit/http_mime_types_test.cpp +++ b/test/net/unit/http_mime_types_test.cpp @@ -1,19 +1,3 @@ -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2015-2017 Oslo and Akershus University College of Applied Sciences -// and Alfred Bratterud -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. #include #include diff --git a/test/net/unit/http_request_test.cpp b/test/net/unit/http_request_test.cpp index 97b1cf3126..d70e04b5e5 100644 --- a/test/net/unit/http_request_test.cpp +++ b/test/net/unit/http_request_test.cpp @@ -1,19 +1,3 @@ -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2016-2017 Oslo and Akershus University College of Applied Sciences -// and Alfred Bratterud -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. #include #include diff --git a/test/net/unit/http_response_test.cpp b/test/net/unit/http_response_test.cpp index 6e7ff43f19..832080e2d4 100644 --- a/test/net/unit/http_response_test.cpp +++ b/test/net/unit/http_response_test.cpp @@ -1,19 +1,3 @@ -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2016-2017 Oslo and Akershus University College of Applied Sciences -// and Alfred Bratterud -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. #include #include diff --git a/test/net/unit/http_status_codes_test.cpp b/test/net/unit/http_status_codes_test.cpp index 6ce1ec6119..ab75597262 100644 --- a/test/net/unit/http_status_codes_test.cpp +++ b/test/net/unit/http_status_codes_test.cpp @@ -1,19 +1,3 @@ -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2015-2017 Oslo and Akershus University College of Applied Sciences -// and Alfred Bratterud -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. #include #include diff --git a/test/net/unit/http_time_test.cpp b/test/net/unit/http_time_test.cpp index e10c6eb692..afa55271c0 100644 --- a/test/net/unit/http_time_test.cpp +++ b/test/net/unit/http_time_test.cpp @@ -1,19 +1,3 @@ -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2015-2017 Oslo and Akershus University College of Applied Sciences -// and Alfred Bratterud -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. #include #include diff --git a/test/net/unit/http_version_test.cpp b/test/net/unit/http_version_test.cpp index 34b3801a00..6baff0a199 100644 --- a/test/net/unit/http_version_test.cpp +++ b/test/net/unit/http_version_test.cpp @@ -1,19 +1,3 @@ -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2015-2017 Oslo and Akershus University College of Applied Sciences -// and Alfred Bratterud -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. #include #include diff --git a/test/net/unit/interfaces_test.cpp b/test/net/unit/interfaces_test.cpp index e764dd7f09..aa51a6be6d 100644 --- a/test/net/unit/interfaces_test.cpp +++ b/test/net/unit/interfaces_test.cpp @@ -1,19 +1,3 @@ -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2018 Oslo and Akershus University College of Applied Sciences -// and Alfred Bratterud -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. #include diff --git a/test/net/unit/ip4.cpp b/test/net/unit/ip4.cpp index afdef6deab..1183b26294 100644 --- a/test/net/unit/ip4.cpp +++ b/test/net/unit/ip4.cpp @@ -1,19 +1,3 @@ -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2015-2017 Oslo and Akershus University College of Applied Sciences -// and Alfred Bratterud -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. #include #include diff --git a/test/net/unit/ip4_addr.cpp b/test/net/unit/ip4_addr.cpp index 51baf84b18..ebdd5f2a20 100644 --- a/test/net/unit/ip4_addr.cpp +++ b/test/net/unit/ip4_addr.cpp @@ -1,19 +1,3 @@ -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2015-2016 Oslo and Akershus University College of Applied Sciences -// and Alfred Bratterud -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. #include #include diff --git a/test/net/unit/ip4_packet_test.cpp b/test/net/unit/ip4_packet_test.cpp index e715eba5ac..f4f52544a8 100644 --- a/test/net/unit/ip4_packet_test.cpp +++ b/test/net/unit/ip4_packet_test.cpp @@ -1,19 +1,3 @@ -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2017 Oslo and Akershus University College of Applied Sciences -// and Alfred Bratterud -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. #include #include diff --git a/test/net/unit/ip6.cpp b/test/net/unit/ip6.cpp index de480c0a89..9499c6156b 100644 --- a/test/net/unit/ip6.cpp +++ b/test/net/unit/ip6.cpp @@ -1,19 +1,3 @@ -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2015-2017 Oslo and Akershus University College of Applied Sciences -// and Alfred Bratterud -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. #include #include diff --git a/test/net/unit/ip6_addr.cpp b/test/net/unit/ip6_addr.cpp index 57ddd3f48c..1e84c5bf71 100644 --- a/test/net/unit/ip6_addr.cpp +++ b/test/net/unit/ip6_addr.cpp @@ -1,19 +1,3 @@ -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2015-2016 Oslo and Akershus University College of Applied Sciences -// and Alfred Bratterud -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. #include #include diff --git a/test/net/unit/ip6_addr_list_test.cpp b/test/net/unit/ip6_addr_list_test.cpp index 9bd7b8296a..63e56c7683 100644 --- a/test/net/unit/ip6_addr_list_test.cpp +++ b/test/net/unit/ip6_addr_list_test.cpp @@ -1,20 +1,3 @@ -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2019 Oslo and Akershus University College of Applied Sciences -// and Alfred Bratterud -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - #include #include diff --git a/test/net/unit/ip6_packet_test.cpp b/test/net/unit/ip6_packet_test.cpp index 786b735594..6f9e1e0841 100644 --- a/test/net/unit/ip6_packet_test.cpp +++ b/test/net/unit/ip6_packet_test.cpp @@ -1,19 +1,3 @@ -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2017 Oslo and Akershus University College of Applied Sciences -// and Alfred Bratterud -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. #include #include diff --git a/test/net/unit/napt_test.cpp b/test/net/unit/napt_test.cpp index b985731b9c..536d87639f 100644 --- a/test/net/unit/napt_test.cpp +++ b/test/net/unit/napt_test.cpp @@ -1,19 +1,3 @@ -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2017 Oslo and Akershus University College of Applied Sciences -// and Alfred Bratterud -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. #include #include diff --git a/test/net/unit/nat_test.cpp b/test/net/unit/nat_test.cpp index 11796471d8..54f05d9df7 100644 --- a/test/net/unit/nat_test.cpp +++ b/test/net/unit/nat_test.cpp @@ -1,19 +1,3 @@ -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2017 Oslo and Akershus University College of Applied Sciences -// and Alfred Bratterud -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. #include #include diff --git a/test/net/unit/packets.cpp b/test/net/unit/packets.cpp index 3eb2b17ac2..a65d719f11 100644 --- a/test/net/unit/packets.cpp +++ b/test/net/unit/packets.cpp @@ -1,19 +1,3 @@ -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2015-2017 Oslo and Akershus University College of Applied Sciences -// and Alfred Bratterud -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. #include #include diff --git a/test/net/unit/path_mtu_discovery.cpp b/test/net/unit/path_mtu_discovery.cpp index d3946f9423..7bfd827a69 100644 --- a/test/net/unit/path_mtu_discovery.cpp +++ b/test/net/unit/path_mtu_discovery.cpp @@ -1,19 +1,3 @@ -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2017 Oslo and Akershus University College of Applied Sciences -// and Alfred Bratterud -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. #include #include @@ -21,9 +5,7 @@ using namespace net; -// // Unit tests for when Path MTU Discovery is disabled by default: -// CASE("Path MTU Discovery is disabled by default and can be enabled") { Nic_mock nic; diff --git a/test/net/unit/port_util_test.cpp b/test/net/unit/port_util_test.cpp index 4c670b3e0d..0d6e34ea1e 100644 --- a/test/net/unit/port_util_test.cpp +++ b/test/net/unit/port_util_test.cpp @@ -1,19 +1,3 @@ -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2017 Oslo and Akershus University College of Applied Sciences -// and Alfred Bratterud -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. #include #include diff --git a/test/net/unit/router_test.cpp b/test/net/unit/router_test.cpp index 4d64656351..39f6ca4ad5 100644 --- a/test/net/unit/router_test.cpp +++ b/test/net/unit/router_test.cpp @@ -1,19 +1,3 @@ -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2015-2017 Oslo and Akershus University College of Applied Sciences -// and Alfred Bratterud -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. #include #include diff --git a/test/net/unit/socket.cpp b/test/net/unit/socket.cpp index 7c1215e97f..a4a44349f1 100644 --- a/test/net/unit/socket.cpp +++ b/test/net/unit/socket.cpp @@ -1,19 +1,3 @@ -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2015-2016 Oslo and Akershus University College of Applied Sciences -// and Alfred Bratterud -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. #include #include diff --git a/test/net/unit/stateful_addr_test.cpp b/test/net/unit/stateful_addr_test.cpp index 869db3f403..419e656464 100644 --- a/test/net/unit/stateful_addr_test.cpp +++ b/test/net/unit/stateful_addr_test.cpp @@ -1,20 +1,3 @@ -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2019 Oslo and Akershus University College of Applied Sciences -// and Alfred Bratterud -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - #include #include diff --git a/test/net/unit/tcp_packet_test.cpp b/test/net/unit/tcp_packet_test.cpp index fbabbffbb3..59fd4efc2c 100644 --- a/test/net/unit/tcp_packet_test.cpp +++ b/test/net/unit/tcp_packet_test.cpp @@ -1,19 +1,3 @@ -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2015-2016 Oslo and Akershus University College of Applied Sciences -// and Alfred Bratterud -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. #include #include diff --git a/test/net/unit/tcp_read_buffer_test.cpp b/test/net/unit/tcp_read_buffer_test.cpp index f618288f96..d28e726673 100644 --- a/test/net/unit/tcp_read_buffer_test.cpp +++ b/test/net/unit/tcp_read_buffer_test.cpp @@ -1,19 +1,3 @@ -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2015-2016 Oslo and Akershus University College of Applied Sciences -// and Alfred Bratterud -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. #include #include diff --git a/test/net/unit/tcp_read_request_test.cpp b/test/net/unit/tcp_read_request_test.cpp index a157c024ad..9c03e854c1 100644 --- a/test/net/unit/tcp_read_request_test.cpp +++ b/test/net/unit/tcp_read_request_test.cpp @@ -1,19 +1,3 @@ -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2017 Oslo and Akershus University College of Applied Sciences -// and Alfred Bratterud -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. #include #include diff --git a/test/net/unit/tcp_sack_test.cpp b/test/net/unit/tcp_sack_test.cpp index e168faf6a5..503fb84290 100644 --- a/test/net/unit/tcp_sack_test.cpp +++ b/test/net/unit/tcp_sack_test.cpp @@ -1,19 +1,3 @@ -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2017 Oslo and Akershus University College of Applied Sciences -// and Alfred Bratterud -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. #include #include diff --git a/test/net/unit/tcp_write_queue.cpp b/test/net/unit/tcp_write_queue.cpp index a83b008e67..6d292283b1 100644 --- a/test/net/unit/tcp_write_queue.cpp +++ b/test/net/unit/tcp_write_queue.cpp @@ -1,19 +1,3 @@ -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2015-2016 Oslo and Akershus University College of Applied Sciences -// and Alfred Bratterud -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. #include #include diff --git a/test/plugin/integration/unik/service.cpp b/test/plugin/integration/unik/service.cpp index ea377b5365..35b048f4dd 100644 --- a/test/plugin/integration/unik/service.cpp +++ b/test/plugin/integration/unik/service.cpp @@ -1,19 +1,3 @@ -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2015 Oslo and Akershus University College of Applied Sciences -// and Alfred Bratterud -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. #include #include diff --git a/test/posix/integration/conf/service.cpp b/test/posix/integration/conf/service.cpp index abc4a9cfc1..d33869604f 100644 --- a/test/posix/integration/conf/service.cpp +++ b/test/posix/integration/conf/service.cpp @@ -1,19 +1,3 @@ -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2015-2017 Oslo and Akershus University College of Applied Sciences -// and Alfred Bratterud -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. #include #include diff --git a/test/posix/integration/conf/test_pathconf.c b/test/posix/integration/conf/test_pathconf.c index d7d0d77153..37eb4c9a82 100644 --- a/test/posix/integration/conf/test_pathconf.c +++ b/test/posix/integration/conf/test_pathconf.c @@ -1,19 +1,3 @@ -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2015-2017 Oslo and Akershus University College of Applied Sciences -// and Alfred Bratterud -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. #include #include diff --git a/test/posix/integration/conf/test_pwd.c b/test/posix/integration/conf/test_pwd.c index 6d913febc8..c14328a5e7 100644 --- a/test/posix/integration/conf/test_pwd.c +++ b/test/posix/integration/conf/test_pwd.c @@ -1,19 +1,3 @@ -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2015-2017 Oslo and Akershus University College of Applied Sciences -// and Alfred Bratterud -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. #include #include diff --git a/test/posix/integration/conf/test_sysconf.c b/test/posix/integration/conf/test_sysconf.c index 5612f7313a..ab18c7c799 100644 --- a/test/posix/integration/conf/test_sysconf.c +++ b/test/posix/integration/conf/test_sysconf.c @@ -1,19 +1,3 @@ -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2015-2017 Oslo and Akershus University College of Applied Sciences -// and Alfred Bratterud -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. #include #include diff --git a/test/posix/integration/file_fd/test_file_fd.cpp b/test/posix/integration/file_fd/test_file_fd.cpp index 51bdb87253..038efa67da 100644 --- a/test/posix/integration/file_fd/test_file_fd.cpp +++ b/test/posix/integration/file_fd/test_file_fd.cpp @@ -1,19 +1,3 @@ -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2015-2016 Oslo and Akershus University College of Applied Sciences -// and Alfred Bratterud -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. #include #include diff --git a/test/posix/integration/main/service.cpp b/test/posix/integration/main/service.cpp index cf0f72b7fe..dea0d32a06 100644 --- a/test/posix/integration/main/service.cpp +++ b/test/posix/integration/main/service.cpp @@ -1,19 +1,3 @@ -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2015 Oslo and Akershus University College of Applied Sciences -// and Alfred Bratterud -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. #include #include diff --git a/test/posix/integration/pthread/service.cpp b/test/posix/integration/pthread/service.cpp index 93e096421e..3f184e1055 100644 --- a/test/posix/integration/pthread/service.cpp +++ b/test/posix/integration/pthread/service.cpp @@ -1,19 +1,3 @@ -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2017 Oslo and Akershus University College of Applied Sciences -// and Alfred Bratterud -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. /** * Example from http://www.yolinux.com/TUTORIALS/LinuxTutorialPosixThreads.html diff --git a/test/posix/integration/stat/test_stat_ftw.cpp b/test/posix/integration/stat/test_stat_ftw.cpp index d037162e2b..1434ff23da 100644 --- a/test/posix/integration/stat/test_stat_ftw.cpp +++ b/test/posix/integration/stat/test_stat_ftw.cpp @@ -1,19 +1,3 @@ -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2015-2016 Oslo and Akershus University College of Applied Sciences -// and Alfred Bratterud -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. #include #include diff --git a/test/posix/integration/syslog_default/service.cpp b/test/posix/integration/syslog_default/service.cpp index e2cf350460..f4af50d685 100644 --- a/test/posix/integration/syslog_default/service.cpp +++ b/test/posix/integration/syslog_default/service.cpp @@ -1,19 +1,3 @@ -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2015-2016 Oslo and Akershus University College of Applied Sciences -// and Alfred Bratterud -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. #include diff --git a/test/posix/integration/syslog_plugin/service.cpp b/test/posix/integration/syslog_plugin/service.cpp index 04d40b92b6..387343d6c2 100644 --- a/test/posix/integration/syslog_plugin/service.cpp +++ b/test/posix/integration/syslog_plugin/service.cpp @@ -1,19 +1,3 @@ -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2015-2016 Oslo and Akershus University College of Applied Sciences -// and Alfred Bratterud -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. #include diff --git a/test/posix/integration/tcp/service.cpp b/test/posix/integration/tcp/service.cpp index 6da2c7b2ff..834f276f0f 100644 --- a/test/posix/integration/tcp/service.cpp +++ b/test/posix/integration/tcp/service.cpp @@ -1,19 +1,3 @@ -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2015-2016 Oslo and Akershus University College of Applied Sciences -// and Alfred Bratterud -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. #include #include diff --git a/test/posix/integration/udp/service.cpp b/test/posix/integration/udp/service.cpp index e777981733..4a13b6c0a1 100644 --- a/test/posix/integration/udp/service.cpp +++ b/test/posix/integration/udp/service.cpp @@ -1,19 +1,3 @@ -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2015-2016 Oslo and Akershus University College of Applied Sciences -// and Alfred Bratterud -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. #include #include diff --git a/test/posix/integration/utsname/service.cpp b/test/posix/integration/utsname/service.cpp index bc22fad9be..ffabf9e70b 100644 --- a/test/posix/integration/utsname/service.cpp +++ b/test/posix/integration/utsname/service.cpp @@ -1,19 +1,3 @@ -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2015-2018 Oslo and Akershus University College of Applied Sciences -// and Alfred Bratterud -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. #include #include diff --git a/test/posix/unit/fd_map_test.cpp b/test/posix/unit/fd_map_test.cpp index c7fd0216ab..7a41c6a528 100644 --- a/test/posix/unit/fd_map_test.cpp +++ b/test/posix/unit/fd_map_test.cpp @@ -1,19 +1,3 @@ -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2015-2016 Oslo and Akershus University College of Applied Sciences -// and Alfred Bratterud -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. #include #include diff --git a/test/posix/unit/inet_test.cpp b/test/posix/unit/inet_test.cpp index 7ef24df778..66ce6b3b26 100644 --- a/test/posix/unit/inet_test.cpp +++ b/test/posix/unit/inet_test.cpp @@ -1,19 +1,3 @@ -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2015-2016 Oslo and Akershus University College of Applied Sciences -// and Alfred Bratterud -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. #include #include diff --git a/test/stl/integration/coroutines/service.cpp b/test/stl/integration/coroutines/service.cpp index 0185a56781..ca8e458cfc 100644 --- a/test/stl/integration/coroutines/service.cpp +++ b/test/stl/integration/coroutines/service.cpp @@ -1,19 +1,3 @@ -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2015-2016 Oslo and Akershus University College of Applied Sciences -// and Alfred Bratterud -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. /** A very superficial test to verify that basic STL is working diff --git a/test/stl/integration/crt/service.cpp b/test/stl/integration/crt/service.cpp index 69b275ac7c..8e74f730fa 100644 --- a/test/stl/integration/crt/service.cpp +++ b/test/stl/integration/crt/service.cpp @@ -1,19 +1,3 @@ -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2015 Oslo and Akershus University College of Applied Sciences -// and Alfred Bratterud -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. #include #include diff --git a/test/stl/integration/exceptions/service.cpp b/test/stl/integration/exceptions/service.cpp index dd65e4d620..22ea59f816 100644 --- a/test/stl/integration/exceptions/service.cpp +++ b/test/stl/integration/exceptions/service.cpp @@ -1,19 +1,3 @@ -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2015 Oslo and Akershus University College of Applied Sciences -// and Alfred Bratterud -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. #include #include diff --git a/test/stl/integration/stl/service.cpp b/test/stl/integration/stl/service.cpp index 302f04e034..edd1cdfb47 100644 --- a/test/stl/integration/stl/service.cpp +++ b/test/stl/integration/stl/service.cpp @@ -1,19 +1,3 @@ -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2015-2016 Oslo and Akershus University College of Applied Sciences -// and Alfred Bratterud -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. /** A very superficial test to verify that basic STL is working diff --git a/test/stress/service.cpp b/test/stress/service.cpp index 0087f312c1..b994be7b4b 100644 --- a/test/stress/service.cpp +++ b/test/stress/service.cpp @@ -1,19 +1,3 @@ -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2015 Oslo and Akershus University College of Applied Sciences -// and Alfred Bratterud -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. #include #include diff --git a/test/userspace/fuzz/fuzzy_http.hpp b/test/userspace/fuzz/fuzzy_http.hpp index e668bde29b..4b63023065 100644 --- a/test/userspace/fuzz/fuzzy_http.hpp +++ b/test/userspace/fuzz/fuzzy_http.hpp @@ -1,20 +1,4 @@ #pragma once -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2016-2017 Oslo and Akershus University College of Applied Sciences -// and Alfred Bratterud -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. #pragma once #ifndef FUZZY_HTTP_SERVER_HPP diff --git a/test/userspace/fuzz/fuzzy_stream.hpp b/test/userspace/fuzz/fuzzy_stream.hpp index a0d63c235a..e242b27524 100644 --- a/test/userspace/fuzz/fuzzy_stream.hpp +++ b/test/userspace/fuzz/fuzzy_stream.hpp @@ -1,19 +1,3 @@ -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2016-2017 Oslo and Akershus University College of Applied Sciences -// and Alfred Bratterud -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. #pragma once #include diff --git a/test/userspace/fuzz/service.cpp b/test/userspace/fuzz/service.cpp index 3a0a93199a..12de7e2c64 100644 --- a/test/userspace/fuzz/service.cpp +++ b/test/userspace/fuzz/service.cpp @@ -1,19 +1,3 @@ -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2015 Oslo and Akershus University College of Applied Sciences -// and Alfred Bratterud -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. #include #include diff --git a/test/userspace/liveupdate/service.cpp b/test/userspace/liveupdate/service.cpp index 6ceb820868..84ffcbefb1 100644 --- a/test/userspace/liveupdate/service.cpp +++ b/test/userspace/liveupdate/service.cpp @@ -1,19 +1,3 @@ -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2015 Oslo and Akershus University College of Applied Sciences -// and Alfred Bratterud -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. #include #include diff --git a/test/userspace/microlb/service.cpp b/test/userspace/microlb/service.cpp index 0f7ca48969..35653e66c9 100644 --- a/test/userspace/microlb/service.cpp +++ b/test/userspace/microlb/service.cpp @@ -1,19 +1,3 @@ -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2015 Oslo and Akershus University College of Applied Sciences -// and Alfred Bratterud -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. #include #include diff --git a/test/userspace/s2n/service.cpp b/test/userspace/s2n/service.cpp index 36e76674d2..0f2b7d11af 100644 --- a/test/userspace/s2n/service.cpp +++ b/test/userspace/s2n/service.cpp @@ -1,19 +1,3 @@ -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2015 Oslo and Akershus University College of Applied Sciences -// and Alfred Bratterud -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. #include #include diff --git a/test/userspace/tcp/service.cpp b/test/userspace/tcp/service.cpp index ee257383d1..95da6c1b19 100644 --- a/test/userspace/tcp/service.cpp +++ b/test/userspace/tcp/service.cpp @@ -1,19 +1,3 @@ -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2015 Oslo and Akershus University College of Applied Sciences -// and Alfred Bratterud -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. #include #include diff --git a/test/util/integration/tar/service.cpp b/test/util/integration/tar/service.cpp index 3c4f546154..252184289e 100644 --- a/test/util/integration/tar/service.cpp +++ b/test/util/integration/tar/service.cpp @@ -1,19 +1,3 @@ -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2015-2016 Oslo and Akershus University College of Applied Sciences -// and Alfred Bratterud -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. #include #include diff --git a/test/util/integration/tar/tar_example/l1_f1/l2/service.cpp b/test/util/integration/tar/tar_example/l1_f1/l2/service.cpp index 94f8d4dda8..ec4ade0742 100644 --- a/test/util/integration/tar/tar_example/l1_f1/l2/service.cpp +++ b/test/util/integration/tar/tar_example/l1_f1/l2/service.cpp @@ -1,19 +1,3 @@ -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2015 Oslo and Akershus University College of Applied Sciences -// and Alfred Bratterud -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. #include // rand() #include diff --git a/test/util/integration/tar/tar_example/l1_f1/service.cpp b/test/util/integration/tar/tar_example/l1_f1/service.cpp index 94f8d4dda8..ec4ade0742 100644 --- a/test/util/integration/tar/tar_example/l1_f1/service.cpp +++ b/test/util/integration/tar/tar_example/l1_f1/service.cpp @@ -1,19 +1,3 @@ -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2015 Oslo and Akershus University College of Applied Sciences -// and Alfred Bratterud -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. #include // rand() #include diff --git a/test/util/integration/tar/tar_example/l1_f2/virtio.hpp b/test/util/integration/tar/tar_example/l1_f2/virtio.hpp index 5fabf41548..49b89718a1 100644 --- a/test/util/integration/tar/tar_example/l1_f2/virtio.hpp +++ b/test/util/integration/tar/tar_example/l1_f2/virtio.hpp @@ -1,19 +1,3 @@ -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2015 Oslo and Akershus University College of Applied Sciences -// and Alfred Bratterud -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. /** @note This virtio implementation was very much inspired by diff --git a/test/util/integration/tar_gz/service.cpp b/test/util/integration/tar_gz/service.cpp index b30aa4d50e..ad4944b27e 100644 --- a/test/util/integration/tar_gz/service.cpp +++ b/test/util/integration/tar_gz/service.cpp @@ -1,19 +1,3 @@ -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2015-2016 Oslo and Akershus University College of Applied Sciences -// and Alfred Bratterud -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. #include #include diff --git a/test/util/integration/tar_gz/tar_example/l1_f1/l2/service.cpp b/test/util/integration/tar_gz/tar_example/l1_f1/l2/service.cpp index 94f8d4dda8..ec4ade0742 100644 --- a/test/util/integration/tar_gz/tar_example/l1_f1/l2/service.cpp +++ b/test/util/integration/tar_gz/tar_example/l1_f1/l2/service.cpp @@ -1,19 +1,3 @@ -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2015 Oslo and Akershus University College of Applied Sciences -// and Alfred Bratterud -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. #include // rand() #include diff --git a/test/util/integration/tar_gz/tar_example/l1_f1/service.cpp b/test/util/integration/tar_gz/tar_example/l1_f1/service.cpp index 94f8d4dda8..ec4ade0742 100644 --- a/test/util/integration/tar_gz/tar_example/l1_f1/service.cpp +++ b/test/util/integration/tar_gz/tar_example/l1_f1/service.cpp @@ -1,19 +1,3 @@ -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2015 Oslo and Akershus University College of Applied Sciences -// and Alfred Bratterud -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. #include // rand() #include diff --git a/test/util/integration/tar_gz/tar_example/l1_f2/virtio.hpp b/test/util/integration/tar_gz/tar_example/l1_f2/virtio.hpp index 5fabf41548..49b89718a1 100644 --- a/test/util/integration/tar_gz/tar_example/l1_f2/virtio.hpp +++ b/test/util/integration/tar_gz/tar_example/l1_f2/virtio.hpp @@ -1,19 +1,3 @@ -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2015 Oslo and Akershus University College of Applied Sciences -// and Alfred Bratterud -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. /** @note This virtio implementation was very much inspired by diff --git a/test/util/unit/base64.cpp b/test/util/unit/base64.cpp index 3f89268078..224af52b86 100644 --- a/test/util/unit/base64.cpp +++ b/test/util/unit/base64.cpp @@ -1,19 +1,3 @@ -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2017 Oslo and Akershus University College of Applied Sciences -// and Alfred Bratterud -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. /// /// This file tests the base64 module by using the test vectors from: diff --git a/test/util/unit/bitops.cpp b/test/util/unit/bitops.cpp index 885eaada68..808eb35af6 100644 --- a/test/util/unit/bitops.cpp +++ b/test/util/unit/bitops.cpp @@ -1,19 +1,3 @@ -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2017 Oslo and Akershus University College of Applied Sciences -// and Alfred Bratterud -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. #include #include diff --git a/test/util/unit/buddy_alloc_test.cpp b/test/util/unit/buddy_alloc_test.cpp index 9a9934dc14..f6ec3a2e97 100644 --- a/test/util/unit/buddy_alloc_test.cpp +++ b/test/util/unit/buddy_alloc_test.cpp @@ -1,18 +1,3 @@ -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2018 IncludeOS AS, Oslo, Norway -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. // #define DEBUG_UNIT diff --git a/test/util/unit/crc32.cpp b/test/util/unit/crc32.cpp index a075fea944..4bc1b5c23b 100644 --- a/test/util/unit/crc32.cpp +++ b/test/util/unit/crc32.cpp @@ -1,19 +1,3 @@ -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2015-2016 Oslo and Akershus University College of Applied Sciences -// and Alfred Bratterud -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. #include #include diff --git a/test/util/unit/delegate.cpp b/test/util/unit/delegate.cpp index 1b309ad7e6..d72bba9713 100644 --- a/test/util/unit/delegate.cpp +++ b/test/util/unit/delegate.cpp @@ -1,19 +1,3 @@ -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2015-2016 Oslo and Akershus University College of Applied Sciences -// and Alfred Bratterud -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. #include #include diff --git a/test/util/unit/fixed_list_alloc_test.cpp b/test/util/unit/fixed_list_alloc_test.cpp index e538dbf7bf..55026f2671 100644 --- a/test/util/unit/fixed_list_alloc_test.cpp +++ b/test/util/unit/fixed_list_alloc_test.cpp @@ -1,19 +1,3 @@ -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2017 Oslo and Akershus University College of Applied Sciences -// and Alfred Bratterud -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. #include #include diff --git a/test/util/unit/fixed_queue.cpp b/test/util/unit/fixed_queue.cpp index d0bd45574d..86b6502858 100644 --- a/test/util/unit/fixed_queue.cpp +++ b/test/util/unit/fixed_queue.cpp @@ -1,19 +1,3 @@ -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2015 Oslo and Akershus University College of Applied Sciences -// and Alfred Bratterud -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. #include #include diff --git a/test/util/unit/fixed_vector.cpp b/test/util/unit/fixed_vector.cpp index d174a9744f..b7ce7b3e81 100644 --- a/test/util/unit/fixed_vector.cpp +++ b/test/util/unit/fixed_vector.cpp @@ -1,19 +1,3 @@ -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2015-2016 Oslo and Akershus University College of Applied Sciences -// and Alfred Bratterud -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. #include #include diff --git a/test/util/unit/isotime.cpp b/test/util/unit/isotime.cpp index 4fe9e2d57e..fe4890aee9 100644 --- a/test/util/unit/isotime.cpp +++ b/test/util/unit/isotime.cpp @@ -1,19 +1,3 @@ -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2017 Oslo and Akershus University College of Applied Sciences -// and Alfred Bratterud -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. #include #include diff --git a/test/util/unit/logger_test.cpp b/test/util/unit/logger_test.cpp index 3c6dcdf9e1..f4f767bac8 100644 --- a/test/util/unit/logger_test.cpp +++ b/test/util/unit/logger_test.cpp @@ -1,19 +1,3 @@ -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2015-2016 Oslo and Akershus University College of Applied Sciences -// and Alfred Bratterud -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. #include #include diff --git a/test/util/unit/lstack/test_lstack.hpp b/test/util/unit/lstack/test_lstack.hpp index 8d5dd2f6f4..f960b6ae84 100644 --- a/test/util/unit/lstack/test_lstack.hpp +++ b/test/util/unit/lstack/test_lstack.hpp @@ -1,18 +1,3 @@ -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2018 IncludeOS AS, Oslo, Norway -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. #ifndef LSTACK_COMMON_HPP #define LSTACK_COMMON_HPP diff --git a/test/util/unit/lstack/test_lstack_common.cpp b/test/util/unit/lstack/test_lstack_common.cpp index 874003c18f..4c028c8980 100644 --- a/test/util/unit/lstack/test_lstack_common.cpp +++ b/test/util/unit/lstack/test_lstack_common.cpp @@ -1,18 +1,3 @@ -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2018 IncludeOS AS, Oslo, Norway -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. /* Separated test body to use with a couple of different lstack options set diff --git a/test/util/unit/lstack/test_lstack_merging.cpp b/test/util/unit/lstack/test_lstack_merging.cpp index f3e405729e..5b67ddb323 100644 --- a/test/util/unit/lstack/test_lstack_merging.cpp +++ b/test/util/unit/lstack/test_lstack_merging.cpp @@ -1,18 +1,3 @@ -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2018 IncludeOS AS, Oslo, Norway -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. #define LSTACK_OPT merge #include "test_lstack_common.cpp" diff --git a/test/util/unit/lstack/test_lstack_nodes.cpp b/test/util/unit/lstack/test_lstack_nodes.cpp index 6f24f91d67..c4387b4751 100644 --- a/test/util/unit/lstack/test_lstack_nodes.cpp +++ b/test/util/unit/lstack/test_lstack_nodes.cpp @@ -1,18 +1,3 @@ -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2018 IncludeOS AS, Oslo, Norway -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. #include "test_lstack.hpp" diff --git a/test/util/unit/lstack/test_lstack_nomerge.cpp b/test/util/unit/lstack/test_lstack_nomerge.cpp index cd7d5a8eac..b126b8347c 100644 --- a/test/util/unit/lstack/test_lstack_nomerge.cpp +++ b/test/util/unit/lstack/test_lstack_nomerge.cpp @@ -1,18 +1,3 @@ -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2018 IncludeOS AS, Oslo, Norway -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. #define LSTACK_OPT no_merge #include "test_lstack_common.cpp" diff --git a/test/util/unit/membitmap.cpp b/test/util/unit/membitmap.cpp index 2d84f5e7e8..d3c57e8bc0 100644 --- a/test/util/unit/membitmap.cpp +++ b/test/util/unit/membitmap.cpp @@ -1,19 +1,3 @@ -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2015-2016 Oslo and Akershus University College of Applied Sciences -// and Alfred Bratterud -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. #include #include diff --git a/test/util/unit/path_to_regex_no_options.cpp b/test/util/unit/path_to_regex_no_options.cpp index a0ebdd0cc9..ea09777cee 100644 --- a/test/util/unit/path_to_regex_no_options.cpp +++ b/test/util/unit/path_to_regex_no_options.cpp @@ -1,19 +1,3 @@ -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2015-2016 Oslo and Akershus University College of Applied Sciences -// and Alfred Bratterud -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. #include #include diff --git a/test/util/unit/path_to_regex_options.cpp b/test/util/unit/path_to_regex_options.cpp index db4d4eb2be..5b163760ff 100644 --- a/test/util/unit/path_to_regex_options.cpp +++ b/test/util/unit/path_to_regex_options.cpp @@ -1,19 +1,3 @@ -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2015-2016 Oslo and Akershus University College of Applied Sciences -// and Alfred Bratterud -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. #include #include diff --git a/test/util/unit/path_to_regex_parse.cpp b/test/util/unit/path_to_regex_parse.cpp index 4b2f9bc449..27554cca76 100644 --- a/test/util/unit/path_to_regex_parse.cpp +++ b/test/util/unit/path_to_regex_parse.cpp @@ -1,19 +1,3 @@ -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2015-2017 Oslo and Akershus University College of Applied Sciences -// and Alfred Bratterud -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. #include #include diff --git a/test/util/unit/percent_encoding_test.cpp b/test/util/unit/percent_encoding_test.cpp index 8e9deee2f9..344e08652b 100644 --- a/test/util/unit/percent_encoding_test.cpp +++ b/test/util/unit/percent_encoding_test.cpp @@ -1,19 +1,3 @@ -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2016-2017 Oslo and Akershus University College of Applied Sciences -// and Alfred Bratterud -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. #include #include diff --git a/test/util/unit/pmr_alloc_test.cpp b/test/util/unit/pmr_alloc_test.cpp index 1f537bc0b3..0975f50fea 100644 --- a/test/util/unit/pmr_alloc_test.cpp +++ b/test/util/unit/pmr_alloc_test.cpp @@ -1,18 +1,3 @@ -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2018 IncludeOS AS, Oslo, Norway -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. #define DEBUG_UNIT diff --git a/test/util/unit/ringbuffer.cpp b/test/util/unit/ringbuffer.cpp index ad3b08aa05..db4ae1bd5c 100644 --- a/test/util/unit/ringbuffer.cpp +++ b/test/util/unit/ringbuffer.cpp @@ -1,19 +1,3 @@ -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2015-2016 Oslo and Akershus University College of Applied Sciences -// and Alfred Bratterud -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. #include #include diff --git a/test/util/unit/sha1.cpp b/test/util/unit/sha1.cpp index 577d6b467d..ed7975e8a6 100644 --- a/test/util/unit/sha1.cpp +++ b/test/util/unit/sha1.cpp @@ -1,19 +1,3 @@ -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2017 Oslo and Akershus University College of Applied Sciences -// and Alfred Bratterud -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. #include #include diff --git a/test/util/unit/statman.cpp b/test/util/unit/statman.cpp index b792e48b18..b48ffa59e1 100644 --- a/test/util/unit/statman.cpp +++ b/test/util/unit/statman.cpp @@ -1,19 +1,3 @@ -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2015 Oslo and Akershus University College of Applied Sciences -// and Alfred Bratterud -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. #include #include diff --git a/test/util/unit/syslog_facility_test.cpp b/test/util/unit/syslog_facility_test.cpp index 81c8666fc6..9e84eee188 100644 --- a/test/util/unit/syslog_facility_test.cpp +++ b/test/util/unit/syslog_facility_test.cpp @@ -1,19 +1,3 @@ -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2015-2017 Oslo and Akershus University College of Applied Sciences -// and Alfred Bratterud -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. #include #include diff --git a/test/util/unit/syslogd_test.cpp b/test/util/unit/syslogd_test.cpp index b6455c240b..747b3979af 100644 --- a/test/util/unit/syslogd_test.cpp +++ b/test/util/unit/syslogd_test.cpp @@ -1,19 +1,3 @@ -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2015-2017 Oslo and Akershus University College of Applied Sciences -// and Alfred Bratterud -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. #include #include diff --git a/test/util/unit/tar_test.cpp b/test/util/unit/tar_test.cpp index cab8be1c40..04fc208cb6 100644 --- a/test/util/unit/tar_test.cpp +++ b/test/util/unit/tar_test.cpp @@ -1,19 +1,3 @@ -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2015-2017 Oslo and Akershus University College of Applied Sciences -// and Alfred Bratterud -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. #include #include diff --git a/test/util/unit/uri_test.cpp b/test/util/unit/uri_test.cpp index 41ec9f7045..d0005cbfad 100644 --- a/test/util/unit/uri_test.cpp +++ b/test/util/unit/uri_test.cpp @@ -1,19 +1,3 @@ -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2016 Oslo and Akershus University College of Applied Sciences -// and Alfred Bratterud -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. #include #include diff --git a/userspace/src/config.cpp b/userspace/src/config.cpp index 58b0b3cbe2..8ab7d6b73d 100644 --- a/userspace/src/config.cpp +++ b/userspace/src/config.cpp @@ -1,19 +1,3 @@ -// This file is a part of the IncludeOS unikernel - www.includeos.org -// -// Copyright 2017 Oslo and Akershus University College of Applied Sciences -// and Alfred Bratterud -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. #include #include