early-access version 2853

This commit is contained in:
pineappleEA
2022-07-23 03:01:36 +02:00
parent 1f2b5081b5
commit 1f111bb69c
8955 changed files with 418777 additions and 999 deletions

View File

@@ -0,0 +1,35 @@
diff --git a/include/llfio/v2.0/map_handle.hpp b/include/llfio/v2.0/map_handle.hpp
index 55cefa8f..3962be16 100644
--- a/include/llfio/v2.0/map_handle.hpp
+++ b/include/llfio/v2.0/map_handle.hpp
@@ -294,8 +294,8 @@ support this operation). You may find the `is_nvram()` observer of particular us
*/
inline io_handle::const_buffer_type nvram_barrier(io_handle::const_buffer_type req, bool evict = false) noexcept
{
- auto *tp = (io_handle::const_buffer_type::pointer)(((uintptr_t) req.data()) & ~63);
- io_handle::const_buffer_type ret{tp, (size_t)(req.data() + 63 + req.size() - tp) & ~63};
+ auto *tp = (io_handle::const_buffer_type::pointer) (((uintptr_t) req.data()) & ~63);
+ io_handle::const_buffer_type ret{tp, (size_t) (req.data() + 63 + req.size() - tp) & ~63};
if(memory_flush_none == mem_flush_stores(ret.data(), ret.size(), evict ? memory_flush_evict : memory_flush_retain))
{
ret = {tp, 0};
@@ -954,7 +954,8 @@ namespace detail
{
try
{
- auto make_shared = [](map_handle h) {
+ auto make_shared = [](map_handle h) -> io_handle::registered_buffer_type
+ {
struct registered_buffer_type_indirect : io_multiplexer::_registered_buffer_type
{
map_handle h;
@@ -964,8 +965,7 @@ namespace detail
{
}
};
- auto ptr = std::make_shared<registered_buffer_type_indirect>(std::move(h));
- return ptr;
+ return io_handle::registered_buffer_type(std::make_shared<registered_buffer_type_indirect>(std::move(h)));
};
const auto &page_sizes = utils::page_sizes(true);
size_t idx = 0;

90
externals/vcpkg/ports/llfio/portfile.cmake vendored Executable file
View File

@@ -0,0 +1,90 @@
if (NOT "cxx20" IN_LIST FEATURES)
message(WARNING [=[
LLFIO depends on Outcome which depends on QuickCppLib which uses the vcpkg versions of gsl-lite and byte-lite, rather than the versions tested by QuickCppLib's, Outcome's and LLFIO's CI. It is not guaranteed to work with other versions, with failures experienced in the past up-to-and-including runtime crashes. See the warning message from QuickCppLib for how you can pin the versions of those dependencies in your manifest file to those with which QuickCppLib was tested. Do not report issues to upstream without first pinning the versions as QuickCppLib was tested against.
]=])
endif()
vcpkg_from_github(
OUT_SOURCE_PATH SOURCE_PATH
REPO ned14/llfio
REF 4a117d683b82a2e3e456c2ecc47a99c8406280fa
SHA512 7880356dbff10664a146a09558ba15f95cf6883ebe8e0af3d392fbd6f86f3455b9b5c8b6c5c1281c8fca93c358fcafd3468ab575eee0b483ec5b136ca59eef04
HEAD_REF develop
PATCHES
# https://github.com/ned14/llfio/issues/83
# To be removed on next update
issue-83-fix-backport.patch
)
vcpkg_from_github(
OUT_SOURCE_PATH NTKEC_SOURCE_PATH
REPO ned14/ntkernel-error-category
REF bbd44623594142155d49bd3ce8820d3cf9da1e1e
SHA512 589d3bc7bca98ca8d05ce9f5cf009dd98b8884bdf3739582f2f6cbf5a324ce95007ea041450ed935baa4a401b4a0242c181fb6d2dcf7ad91587d75f05491f50e
HEAD_REF master
)
vcpkg_check_features(
OUT_FEATURE_OPTIONS LLFIO_FEATURE_OPTIONS
FEATURES
status-code LLFIO_USE_EXPERIMENTAL_SG14_STATUS_CODE
)
# LLFIO expects ntkernel-error-category to live inside its include directory
file(REMOVE_RECURSE "${SOURCE_PATH}/include/llfio/ntkernel-error-category")
file(RENAME "${NTKEC_SOURCE_PATH}" "${SOURCE_PATH}/include/llfio/ntkernel-error-category")
set(extra_config)
# cmake does not correctly set CMAKE_SYSTEM_PROCESSOR when targeting ARM on Windows
if(VCPKG_TARGET_IS_WINDOWS AND (VCPKG_TARGET_ARCHITECTURE STREQUAL "arm" OR VCPKG_TARGET_ARCHITECTURE STREQUAL "arm64"))
list(APPEND extra_config -DLLFIO_ASSUME_CROSS_COMPILING=On)
endif()
# setting CMAKE_CXX_STANDARD here to prevent llfio from messing with compiler flags
# the cmake package config requires said C++ standard target transitively via quickcpplib
if ("cxx20" IN_LIST FEATURES)
list(APPEND extra_config -DCMAKE_CXX_STANDARD=20)
elseif("cxx17" IN_LIST FEATURES)
list(APPEND extra_config -DCMAKE_CXX_STANDARD=17)
endif()
# quickcpplib parses CMAKE_MSVC_RUNTIME_LIBRARY and cannot support the default crt linkage generator expression from vcpkg
if(VCPKG_TARGET_IS_WINDOWS)
if(VCPKG_CRT_LINKAGE STREQUAL "dynamic")
list(APPEND extra_config -DCMAKE_MSVC_RUNTIME_LIBRARY=MultiThreaded$$<$$<CONFIG:Debug>:Debug>DLL)
else()
list(APPEND extra_config -DCMAKE_MSVC_RUNTIME_LIBRARY=MultiThreaded$$<$$<CONFIG:Debug>:Debug>)
endif()
endif()
vcpkg_cmake_configure(
SOURCE_PATH "${SOURCE_PATH}"
OPTIONS
-DPROJECT_IS_DEPENDENCY=On
-Dquickcpplib_DIR=${CURRENT_INSTALLED_DIR}/share/quickcpplib
${LLFIO_FEATURE_OPTIONS}
-DLLFIO_ENABLE_DEPENDENCY_SMOKE_TEST=ON # Leave this always on to test everything compiles
-DCMAKE_DISABLE_FIND_PACKAGE_Git=ON
${extra_config}
)
if(VCPKG_LIBRARY_LINKAGE STREQUAL "dynamic")
vcpkg_cmake_build(TARGET install.dl)
else(VCPKG_LIBRARY_LINKAGE STREQUAL "static")
vcpkg_cmake_build(TARGET install.sl)
endif()
if("run-tests" IN_LIST FEATURES)
vcpkg_cmake_build(TARGET test)
endif()
vcpkg_cmake_config_fixup(CONFIG_PATH lib/cmake/llfio)
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include" "${CURRENT_PACKAGES_DIR}/debug/share")
if("status-code" IN_LIST FEATURES)
file(INSTALL "${CURRENT_PORT_DIR}/usage-status-code-${VCPKG_LIBRARY_LINKAGE}" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}")
else()
file(INSTALL "${CURRENT_PORT_DIR}/usage-error-code-${VCPKG_LIBRARY_LINKAGE}" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}")
endif()
file(INSTALL "${SOURCE_PATH}/Licence.txt" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" RENAME copyright)

View File

@@ -0,0 +1,10 @@
The package llfio provides two CMake targets:
find_package(llfio CONFIG REQUIRED)
- If you want the header-only form of LLFIO:
find_package(Threads REQUIRED)
target_link_libraries(main PUBLIC llfio::hl)
- If you want the shared library form of LLFIO with shared NT kernel error code category:
target_link_libraries(main PUBLIC llfio::dl llfio::ntkernel-error-category::dl)

View File

@@ -0,0 +1,10 @@
The package llfio provides two CMake targets:
find_package(llfio CONFIG REQUIRED)
- If you want the header-only form of LLFIO:
find_package(Threads REQUIRED)
target_link_libraries(main PUBLIC llfio::hl)
- If you want the static library form of LLFIO with static NT kernel error code category:
target_link_libraries(main PUBLIC llfio::sl llfio::ntkernel-error-category::sl)

View File

@@ -0,0 +1,10 @@
The package llfio provides two CMake targets:
find_package(llfio CONFIG REQUIRED)
- If you want the header-only form of LLFIO:
find_package(Threads REQUIRED)
target_link_libraries(main PUBLIC llfio::hl)
- If you want the shared library form of LLFIO:
target_link_libraries(main PUBLIC llfio::dl)

View File

@@ -0,0 +1,10 @@
The package llfio provides two CMake targets:
find_package(llfio CONFIG REQUIRED)
- If you want the header-only form of LLFIO:
find_package(Threads REQUIRED)
target_link_libraries(main PUBLIC llfio::hl)
- If you want the static library form of LLFIO:
target_link_libraries(main PUBLIC llfio::sl)

59
externals/vcpkg/ports/llfio/vcpkg.json vendored Executable file
View File

@@ -0,0 +1,59 @@
{
"name": "llfio",
"version": "2.0-20220112",
"port-version": 1,
"description": "P1031 low level file i/o and filesystem library for the C++ standard",
"homepage": "https://github.com/ned14/llfio",
"license": "Apache-2.0 OR BSL-1.0",
"supports": "!uwp",
"dependencies": [
"outcome",
{
"name": "vcpkg-cmake",
"host": true
},
{
"name": "vcpkg-cmake-config",
"host": true
}
],
"features": {
"cxx17": {
"description": "Do not polyfill C++17 entities",
"dependencies": [
{
"name": "ned14-internal-quickcpplib",
"default-features": false,
"features": [
"cxx17"
]
}
]
},
"cxx20": {
"description": "Do not polyfill C++20 entities",
"dependencies": [
{
"name": "llfio",
"default-features": false,
"features": [
"cxx17"
]
},
{
"name": "ned14-internal-quickcpplib",
"default-features": false,
"features": [
"cxx20"
]
}
]
},
"run-tests": {
"description": "Build and run the dependency validation tests"
},
"status-code": {
"description": "Have LLFIO use SG14 `status_code` (proposed `std::error`) instead of `std::error_code`."
}
}
}