From 99128b7e45f8b95d962da2e6ea584767f0c85455 Mon Sep 17 00:00:00 2001 From: joboet Date: Thu, 11 Jan 2024 20:10:25 +0100 Subject: [PATCH] std: begin moving platform support modules into `pal` --- library/std/src/sys/mod.rs | 130 +----------------- library/std/src/sys/{ => pal}/common/alloc.rs | 0 library/std/src/sys/{ => pal}/common/mod.rs | 0 .../sys/{ => pal}/common/small_c_string.rs | 0 library/std/src/sys/{ => pal}/common/tests.rs | 0 .../common/thread_local/fast_local.rs | 0 .../sys/{ => pal}/common/thread_local/mod.rs | 0 .../{ => pal}/common/thread_local/os_local.rs | 0 .../common/thread_local/static_local.rs | 0 library/std/src/sys/{ => pal}/hermit/alloc.rs | 0 library/std/src/sys/{ => pal}/hermit/args.rs | 0 library/std/src/sys/{ => pal}/hermit/env.rs | 0 library/std/src/sys/{ => pal}/hermit/fd.rs | 0 library/std/src/sys/{ => pal}/hermit/fs.rs | 0 library/std/src/sys/{ => pal}/hermit/futex.rs | 0 .../std/src/sys/{ => pal}/hermit/memchr.rs | 0 library/std/src/sys/{ => pal}/hermit/mod.rs | 0 library/std/src/sys/{ => pal}/hermit/net.rs | 0 library/std/src/sys/{ => pal}/hermit/os.rs | 0 library/std/src/sys/{ => pal}/hermit/stdio.rs | 0 .../std/src/sys/{ => pal}/hermit/thread.rs | 0 .../sys/{ => pal}/hermit/thread_local_dtor.rs | 0 library/std/src/sys/{ => pal}/hermit/time.rs | 0 library/std/src/sys/{ => pal}/itron/abi.rs | 0 .../std/src/sys/{ => pal}/itron/condvar.rs | 0 library/std/src/sys/{ => pal}/itron/error.rs | 0 library/std/src/sys/{ => pal}/itron/mutex.rs | 0 library/std/src/sys/{ => pal}/itron/spin.rs | 0 library/std/src/sys/{ => pal}/itron/task.rs | 0 library/std/src/sys/{ => pal}/itron/thread.rs | 0 .../src/sys/{ => pal}/itron/thread_parking.rs | 0 library/std/src/sys/{ => pal}/itron/time.rs | 0 .../std/src/sys/{ => pal}/itron/time/tests.rs | 0 library/std/src/sys/pal/mod.rs | 124 +++++++++++++++++ .../src/sys/{ => pal}/personality/dwarf/eh.rs | 0 .../sys/{ => pal}/personality/dwarf/mod.rs | 0 .../sys/{ => pal}/personality/dwarf/tests.rs | 0 .../std/src/sys/{ => pal}/personality/emcc.rs | 0 .../std/src/sys/{ => pal}/personality/gcc.rs | 0 .../std/src/sys/{ => pal}/personality/mod.rs | 0 library/std/src/sys/{ => pal}/sgx/abi/entry.S | 0 library/std/src/sys/{ => pal}/sgx/abi/mem.rs | 0 library/std/src/sys/{ => pal}/sgx/abi/mod.rs | 0 .../std/src/sys/{ => pal}/sgx/abi/panic.rs | 0 .../std/src/sys/{ => pal}/sgx/abi/reloc.rs | 0 .../std/src/sys/{ => pal}/sgx/abi/thread.rs | 0 .../std/src/sys/{ => pal}/sgx/abi/tls/mod.rs | 0 .../sys/{ => pal}/sgx/abi/tls/sync_bitset.rs | 0 .../sgx/abi/tls/sync_bitset/tests.rs | 0 .../sys/{ => pal}/sgx/abi/usercalls/alloc.rs | 0 .../sys/{ => pal}/sgx/abi/usercalls/mod.rs | 0 .../sys/{ => pal}/sgx/abi/usercalls/raw.rs | 0 .../sys/{ => pal}/sgx/abi/usercalls/tests.rs | 0 library/std/src/sys/{ => pal}/sgx/alloc.rs | 0 library/std/src/sys/{ => pal}/sgx/args.rs | 0 library/std/src/sys/{ => pal}/sgx/condvar.rs | 0 library/std/src/sys/{ => pal}/sgx/env.rs | 0 library/std/src/sys/{ => pal}/sgx/fd.rs | 0 library/std/src/sys/{ => pal}/sgx/memchr.rs | 0 library/std/src/sys/{ => pal}/sgx/mod.rs | 0 library/std/src/sys/{ => pal}/sgx/mutex.rs | 0 library/std/src/sys/{ => pal}/sgx/net.rs | 0 library/std/src/sys/{ => pal}/sgx/os.rs | 0 library/std/src/sys/{ => pal}/sgx/path.rs | 0 library/std/src/sys/{ => pal}/sgx/rwlock.rs | 0 .../std/src/sys/{ => pal}/sgx/rwlock/tests.rs | 0 library/std/src/sys/{ => pal}/sgx/stdio.rs | 0 library/std/src/sys/{ => pal}/sgx/thread.rs | 0 .../src/sys/{ => pal}/sgx/thread_local_key.rs | 0 .../src/sys/{ => pal}/sgx/thread_parking.rs | 0 library/std/src/sys/{ => pal}/sgx/time.rs | 0 .../src/sys/{ => pal}/sgx/waitqueue/mod.rs | 0 .../sys/{ => pal}/sgx/waitqueue/spin_mutex.rs | 0 .../sgx/waitqueue/spin_mutex/tests.rs | 0 .../src/sys/{ => pal}/sgx/waitqueue/tests.rs | 0 .../{ => pal}/sgx/waitqueue/unsafe_list.rs | 0 .../sgx/waitqueue/unsafe_list/tests.rs | 0 library/std/src/sys/{ => pal}/solid/abi/fs.rs | 0 .../std/src/sys/{ => pal}/solid/abi/mod.rs | 0 .../src/sys/{ => pal}/solid/abi/sockets.rs | 0 library/std/src/sys/{ => pal}/solid/alloc.rs | 0 library/std/src/sys/{ => pal}/solid/env.rs | 0 library/std/src/sys/{ => pal}/solid/error.rs | 0 library/std/src/sys/{ => pal}/solid/fs.rs | 0 library/std/src/sys/{ => pal}/solid/io.rs | 0 library/std/src/sys/{ => pal}/solid/memchr.rs | 0 library/std/src/sys/{ => pal}/solid/mod.rs | 0 library/std/src/sys/{ => pal}/solid/net.rs | 0 library/std/src/sys/{ => pal}/solid/os.rs | 0 library/std/src/sys/{ => pal}/solid/path.rs | 0 library/std/src/sys/{ => pal}/solid/rwlock.rs | 0 library/std/src/sys/{ => pal}/solid/stdio.rs | 0 .../sys/{ => pal}/solid/thread_local_dtor.rs | 0 .../sys/{ => pal}/solid/thread_local_key.rs | 0 library/std/src/sys/{ => pal}/solid/time.rs | 0 library/std/src/sys/{ => pal}/teeos/alloc.rs | 0 .../src/sys/{ => pal}/teeos/locks/condvar.rs | 0 .../std/src/sys/{ => pal}/teeos/locks/mod.rs | 0 .../src/sys/{ => pal}/teeos/locks/rwlock.rs | 0 library/std/src/sys/{ => pal}/teeos/mod.rs | 0 library/std/src/sys/{ => pal}/teeos/net.rs | 0 library/std/src/sys/{ => pal}/teeos/os.rs | 0 library/std/src/sys/{ => pal}/teeos/rand.rs | 0 library/std/src/sys/{ => pal}/teeos/stdio.rs | 0 library/std/src/sys/{ => pal}/teeos/thread.rs | 0 .../sys/{ => pal}/teeos/thread_local_dtor.rs | 0 library/std/src/sys/{ => pal}/uefi/alloc.rs | 0 library/std/src/sys/{ => pal}/uefi/args.rs | 0 library/std/src/sys/{ => pal}/uefi/env.rs | 0 library/std/src/sys/{ => pal}/uefi/helpers.rs | 0 library/std/src/sys/{ => pal}/uefi/mod.rs | 0 library/std/src/sys/{ => pal}/uefi/os.rs | 0 library/std/src/sys/{ => pal}/uefi/path.rs | 0 library/std/src/sys/{ => pal}/uefi/stdio.rs | 0 library/std/src/sys/{ => pal}/uefi/tests.rs | 0 library/std/src/sys/{ => pal}/unix/alloc.rs | 0 library/std/src/sys/{ => pal}/unix/android.rs | 0 library/std/src/sys/{ => pal}/unix/args.rs | 0 library/std/src/sys/{ => pal}/unix/cmath.rs | 0 library/std/src/sys/{ => pal}/unix/env.rs | 0 library/std/src/sys/{ => pal}/unix/fd.rs | 0 .../std/src/sys/{ => pal}/unix/fd/tests.rs | 0 library/std/src/sys/{ => pal}/unix/fs.rs | 0 library/std/src/sys/{ => pal}/unix/futex.rs | 0 library/std/src/sys/{ => pal}/unix/io.rs | 0 .../std/src/sys/{ => pal}/unix/kernel_copy.rs | 0 .../sys/{ => pal}/unix/kernel_copy/tests.rs | 0 library/std/src/sys/{ => pal}/unix/l4re.rs | 0 .../sys/{ => pal}/unix/locks/fuchsia_mutex.rs | 0 .../sys/{ => pal}/unix/locks/futex_condvar.rs | 0 .../sys/{ => pal}/unix/locks/futex_mutex.rs | 0 .../sys/{ => pal}/unix/locks/futex_rwlock.rs | 0 .../std/src/sys/{ => pal}/unix/locks/mod.rs | 0 .../{ => pal}/unix/locks/pthread_condvar.rs | 0 .../sys/{ => pal}/unix/locks/pthread_mutex.rs | 0 .../{ => pal}/unix/locks/pthread_rwlock.rs | 0 library/std/src/sys/{ => pal}/unix/memchr.rs | 0 library/std/src/sys/{ => pal}/unix/mod.rs | 0 library/std/src/sys/{ => pal}/unix/net.rs | 0 library/std/src/sys/{ => pal}/unix/os.rs | 0 .../std/src/sys/{ => pal}/unix/os/tests.rs | 0 library/std/src/sys/{ => pal}/unix/os_str.rs | 0 .../src/sys/{ => pal}/unix/os_str/tests.rs | 0 library/std/src/sys/{ => pal}/unix/path.rs | 0 library/std/src/sys/{ => pal}/unix/pipe.rs | 0 .../std/src/sys/{ => pal}/unix/process/mod.rs | 0 .../{ => pal}/unix/process/process_common.rs | 0 .../unix/process/process_common/tests.rs | 0 .../{ => pal}/unix/process/process_fuchsia.rs | 0 .../{ => pal}/unix/process/process_unix.rs | 0 .../unix/process/process_unix/tests.rs | 0 .../unix/process/process_unsupported.rs | 0 .../process_unsupported/wait_status.rs | 0 .../process_unsupported/wait_status/tests.rs | 0 .../{ => pal}/unix/process/process_vxworks.rs | 0 .../src/sys/{ => pal}/unix/process/zircon.rs | 0 library/std/src/sys/{ => pal}/unix/rand.rs | 0 .../src/sys/{ => pal}/unix/stack_overflow.rs | 0 library/std/src/sys/{ => pal}/unix/stdio.rs | 0 library/std/src/sys/{ => pal}/unix/thread.rs | 0 .../sys/{ => pal}/unix/thread_local_dtor.rs | 0 .../sys/{ => pal}/unix/thread_local_key.rs | 0 .../{ => pal}/unix/thread_parking/darwin.rs | 0 .../sys/{ => pal}/unix/thread_parking/mod.rs | 0 .../{ => pal}/unix/thread_parking/netbsd.rs | 0 .../{ => pal}/unix/thread_parking/pthread.rs | 0 library/std/src/sys/{ => pal}/unix/time.rs | 0 library/std/src/sys/{ => pal}/unix/weak.rs | 0 .../src/sys/{ => pal}/unsupported/alloc.rs | 0 .../std/src/sys/{ => pal}/unsupported/args.rs | 0 .../src/sys/{ => pal}/unsupported/common.rs | 0 .../std/src/sys/{ => pal}/unsupported/env.rs | 0 .../std/src/sys/{ => pal}/unsupported/fs.rs | 0 .../std/src/sys/{ => pal}/unsupported/io.rs | 0 .../{ => pal}/unsupported/locks/condvar.rs | 0 .../sys/{ => pal}/unsupported/locks/mod.rs | 0 .../sys/{ => pal}/unsupported/locks/mutex.rs | 0 .../sys/{ => pal}/unsupported/locks/rwlock.rs | 0 .../std/src/sys/{ => pal}/unsupported/mod.rs | 0 .../std/src/sys/{ => pal}/unsupported/net.rs | 0 .../std/src/sys/{ => pal}/unsupported/once.rs | 0 .../std/src/sys/{ => pal}/unsupported/os.rs | 0 .../std/src/sys/{ => pal}/unsupported/pipe.rs | 0 .../src/sys/{ => pal}/unsupported/process.rs | 0 .../src/sys/{ => pal}/unsupported/stdio.rs | 0 .../src/sys/{ => pal}/unsupported/thread.rs | 0 .../unsupported/thread_local_dtor.rs | 0 .../{ => pal}/unsupported/thread_local_key.rs | 0 .../{ => pal}/unsupported/thread_parking.rs | 0 .../std/src/sys/{ => pal}/unsupported/time.rs | 0 library/std/src/sys/{ => pal}/wasi/args.rs | 0 library/std/src/sys/{ => pal}/wasi/env.rs | 0 library/std/src/sys/{ => pal}/wasi/fd.rs | 0 library/std/src/sys/{ => pal}/wasi/fs.rs | 0 library/std/src/sys/{ => pal}/wasi/io.rs | 0 library/std/src/sys/{ => pal}/wasi/mod.rs | 0 library/std/src/sys/{ => pal}/wasi/net.rs | 0 library/std/src/sys/{ => pal}/wasi/os.rs | 0 library/std/src/sys/{ => pal}/wasi/stdio.rs | 0 library/std/src/sys/{ => pal}/wasi/thread.rs | 0 library/std/src/sys/{ => pal}/wasi/time.rs | 0 library/std/src/sys/{ => pal}/wasm/alloc.rs | 0 .../src/sys/{ => pal}/wasm/atomics/futex.rs | 0 .../src/sys/{ => pal}/wasm/atomics/thread.rs | 0 library/std/src/sys/{ => pal}/wasm/env.rs | 0 library/std/src/sys/{ => pal}/wasm/mod.rs | 0 .../std/src/sys/{ => pal}/windows/alloc.rs | 0 .../src/sys/{ => pal}/windows/alloc/tests.rs | 0 library/std/src/sys/{ => pal}/windows/api.rs | 0 library/std/src/sys/{ => pal}/windows/args.rs | 0 .../src/sys/{ => pal}/windows/args/tests.rs | 0 library/std/src/sys/{ => pal}/windows/c.rs | 0 .../sys/{ => pal}/windows/c/windows_sys.lst | 0 .../sys/{ => pal}/windows/c/windows_sys.rs | 0 .../std/src/sys/{ => pal}/windows/cmath.rs | 0 .../std/src/sys/{ => pal}/windows/compat.rs | 0 library/std/src/sys/{ => pal}/windows/env.rs | 0 library/std/src/sys/{ => pal}/windows/fs.rs | 0 .../std/src/sys/{ => pal}/windows/handle.rs | 0 .../src/sys/{ => pal}/windows/handle/tests.rs | 0 library/std/src/sys/{ => pal}/windows/io.rs | 0 .../sys/{ => pal}/windows/locks/condvar.rs | 0 .../src/sys/{ => pal}/windows/locks/mod.rs | 0 .../src/sys/{ => pal}/windows/locks/mutex.rs | 0 .../src/sys/{ => pal}/windows/locks/rwlock.rs | 0 .../std/src/sys/{ => pal}/windows/memchr.rs | 0 library/std/src/sys/{ => pal}/windows/mod.rs | 0 library/std/src/sys/{ => pal}/windows/net.rs | 0 library/std/src/sys/{ => pal}/windows/os.rs | 0 .../std/src/sys/{ => pal}/windows/os/tests.rs | 0 .../std/src/sys/{ => pal}/windows/os_str.rs | 0 library/std/src/sys/{ => pal}/windows/path.rs | 0 .../src/sys/{ => pal}/windows/path/tests.rs | 0 library/std/src/sys/{ => pal}/windows/pipe.rs | 0 .../std/src/sys/{ => pal}/windows/process.rs | 0 .../sys/{ => pal}/windows/process/tests.rs | 0 library/std/src/sys/{ => pal}/windows/rand.rs | 0 .../sys/{ => pal}/windows/stack_overflow.rs | 0 .../{ => pal}/windows/stack_overflow_uwp.rs | 0 .../std/src/sys/{ => pal}/windows/stdio.rs | 0 .../src/sys/{ => pal}/windows/stdio/tests.rs | 0 .../std/src/sys/{ => pal}/windows/thread.rs | 0 .../{ => pal}/windows/thread_local_dtor.rs | 0 .../sys/{ => pal}/windows/thread_local_key.rs | 0 .../windows/thread_local_key/tests.rs | 0 .../sys/{ => pal}/windows/thread_parking.rs | 0 library/std/src/sys/{ => pal}/windows/time.rs | 0 library/std/src/sys/{ => pal}/xous/alloc.rs | 0 .../src/sys/{ => pal}/xous/locks/condvar.rs | 0 .../std/src/sys/{ => pal}/xous/locks/mod.rs | 0 .../std/src/sys/{ => pal}/xous/locks/mutex.rs | 0 .../src/sys/{ => pal}/xous/locks/rwlock.rs | 0 library/std/src/sys/{ => pal}/xous/mod.rs | 0 library/std/src/sys/{ => pal}/xous/os.rs | 0 library/std/src/sys/{ => pal}/xous/stdio.rs | 0 library/std/src/sys/{ => pal}/xous/thread.rs | 0 .../sys/{ => pal}/xous/thread_local_key.rs | 0 .../src/sys/{ => pal}/xous/thread_parking.rs | 0 library/std/src/sys/{ => pal}/xous/time.rs | 0 259 files changed, 131 insertions(+), 123 deletions(-) rename library/std/src/sys/{ => pal}/common/alloc.rs (100%) rename library/std/src/sys/{ => pal}/common/mod.rs (100%) rename library/std/src/sys/{ => pal}/common/small_c_string.rs (100%) rename library/std/src/sys/{ => pal}/common/tests.rs (100%) rename library/std/src/sys/{ => pal}/common/thread_local/fast_local.rs (100%) rename library/std/src/sys/{ => pal}/common/thread_local/mod.rs (100%) rename library/std/src/sys/{ => pal}/common/thread_local/os_local.rs (100%) rename library/std/src/sys/{ => pal}/common/thread_local/static_local.rs (100%) rename library/std/src/sys/{ => pal}/hermit/alloc.rs (100%) rename library/std/src/sys/{ => pal}/hermit/args.rs (100%) rename library/std/src/sys/{ => pal}/hermit/env.rs (100%) rename library/std/src/sys/{ => pal}/hermit/fd.rs (100%) rename library/std/src/sys/{ => pal}/hermit/fs.rs (100%) rename library/std/src/sys/{ => pal}/hermit/futex.rs (100%) rename library/std/src/sys/{ => pal}/hermit/memchr.rs (100%) rename library/std/src/sys/{ => pal}/hermit/mod.rs (100%) rename library/std/src/sys/{ => pal}/hermit/net.rs (100%) rename library/std/src/sys/{ => pal}/hermit/os.rs (100%) rename library/std/src/sys/{ => pal}/hermit/stdio.rs (100%) rename library/std/src/sys/{ => pal}/hermit/thread.rs (100%) rename library/std/src/sys/{ => pal}/hermit/thread_local_dtor.rs (100%) rename library/std/src/sys/{ => pal}/hermit/time.rs (100%) rename library/std/src/sys/{ => pal}/itron/abi.rs (100%) rename library/std/src/sys/{ => pal}/itron/condvar.rs (100%) rename library/std/src/sys/{ => pal}/itron/error.rs (100%) rename library/std/src/sys/{ => pal}/itron/mutex.rs (100%) rename library/std/src/sys/{ => pal}/itron/spin.rs (100%) rename library/std/src/sys/{ => pal}/itron/task.rs (100%) rename library/std/src/sys/{ => pal}/itron/thread.rs (100%) rename library/std/src/sys/{ => pal}/itron/thread_parking.rs (100%) rename library/std/src/sys/{ => pal}/itron/time.rs (100%) rename library/std/src/sys/{ => pal}/itron/time/tests.rs (100%) create mode 100644 library/std/src/sys/pal/mod.rs rename library/std/src/sys/{ => pal}/personality/dwarf/eh.rs (100%) rename library/std/src/sys/{ => pal}/personality/dwarf/mod.rs (100%) rename library/std/src/sys/{ => pal}/personality/dwarf/tests.rs (100%) rename library/std/src/sys/{ => pal}/personality/emcc.rs (100%) rename library/std/src/sys/{ => pal}/personality/gcc.rs (100%) rename library/std/src/sys/{ => pal}/personality/mod.rs (100%) rename library/std/src/sys/{ => pal}/sgx/abi/entry.S (100%) rename library/std/src/sys/{ => pal}/sgx/abi/mem.rs (100%) rename library/std/src/sys/{ => pal}/sgx/abi/mod.rs (100%) rename library/std/src/sys/{ => pal}/sgx/abi/panic.rs (100%) rename library/std/src/sys/{ => pal}/sgx/abi/reloc.rs (100%) rename library/std/src/sys/{ => pal}/sgx/abi/thread.rs (100%) rename library/std/src/sys/{ => pal}/sgx/abi/tls/mod.rs (100%) rename library/std/src/sys/{ => pal}/sgx/abi/tls/sync_bitset.rs (100%) rename library/std/src/sys/{ => pal}/sgx/abi/tls/sync_bitset/tests.rs (100%) rename library/std/src/sys/{ => pal}/sgx/abi/usercalls/alloc.rs (100%) rename library/std/src/sys/{ => pal}/sgx/abi/usercalls/mod.rs (100%) rename library/std/src/sys/{ => pal}/sgx/abi/usercalls/raw.rs (100%) rename library/std/src/sys/{ => pal}/sgx/abi/usercalls/tests.rs (100%) rename library/std/src/sys/{ => pal}/sgx/alloc.rs (100%) rename library/std/src/sys/{ => pal}/sgx/args.rs (100%) rename library/std/src/sys/{ => pal}/sgx/condvar.rs (100%) rename library/std/src/sys/{ => pal}/sgx/env.rs (100%) rename library/std/src/sys/{ => pal}/sgx/fd.rs (100%) rename library/std/src/sys/{ => pal}/sgx/memchr.rs (100%) rename library/std/src/sys/{ => pal}/sgx/mod.rs (100%) rename library/std/src/sys/{ => pal}/sgx/mutex.rs (100%) rename library/std/src/sys/{ => pal}/sgx/net.rs (100%) rename library/std/src/sys/{ => pal}/sgx/os.rs (100%) rename library/std/src/sys/{ => pal}/sgx/path.rs (100%) rename library/std/src/sys/{ => pal}/sgx/rwlock.rs (100%) rename library/std/src/sys/{ => pal}/sgx/rwlock/tests.rs (100%) rename library/std/src/sys/{ => pal}/sgx/stdio.rs (100%) rename library/std/src/sys/{ => pal}/sgx/thread.rs (100%) rename library/std/src/sys/{ => pal}/sgx/thread_local_key.rs (100%) rename library/std/src/sys/{ => pal}/sgx/thread_parking.rs (100%) rename library/std/src/sys/{ => pal}/sgx/time.rs (100%) rename library/std/src/sys/{ => pal}/sgx/waitqueue/mod.rs (100%) rename library/std/src/sys/{ => pal}/sgx/waitqueue/spin_mutex.rs (100%) rename library/std/src/sys/{ => pal}/sgx/waitqueue/spin_mutex/tests.rs (100%) rename library/std/src/sys/{ => pal}/sgx/waitqueue/tests.rs (100%) rename library/std/src/sys/{ => pal}/sgx/waitqueue/unsafe_list.rs (100%) rename library/std/src/sys/{ => pal}/sgx/waitqueue/unsafe_list/tests.rs (100%) rename library/std/src/sys/{ => pal}/solid/abi/fs.rs (100%) rename library/std/src/sys/{ => pal}/solid/abi/mod.rs (100%) rename library/std/src/sys/{ => pal}/solid/abi/sockets.rs (100%) rename library/std/src/sys/{ => pal}/solid/alloc.rs (100%) rename library/std/src/sys/{ => pal}/solid/env.rs (100%) rename library/std/src/sys/{ => pal}/solid/error.rs (100%) rename library/std/src/sys/{ => pal}/solid/fs.rs (100%) rename library/std/src/sys/{ => pal}/solid/io.rs (100%) rename library/std/src/sys/{ => pal}/solid/memchr.rs (100%) rename library/std/src/sys/{ => pal}/solid/mod.rs (100%) rename library/std/src/sys/{ => pal}/solid/net.rs (100%) rename library/std/src/sys/{ => pal}/solid/os.rs (100%) rename library/std/src/sys/{ => pal}/solid/path.rs (100%) rename library/std/src/sys/{ => pal}/solid/rwlock.rs (100%) rename library/std/src/sys/{ => pal}/solid/stdio.rs (100%) rename library/std/src/sys/{ => pal}/solid/thread_local_dtor.rs (100%) rename library/std/src/sys/{ => pal}/solid/thread_local_key.rs (100%) rename library/std/src/sys/{ => pal}/solid/time.rs (100%) rename library/std/src/sys/{ => pal}/teeos/alloc.rs (100%) rename library/std/src/sys/{ => pal}/teeos/locks/condvar.rs (100%) rename library/std/src/sys/{ => pal}/teeos/locks/mod.rs (100%) rename library/std/src/sys/{ => pal}/teeos/locks/rwlock.rs (100%) rename library/std/src/sys/{ => pal}/teeos/mod.rs (100%) rename library/std/src/sys/{ => pal}/teeos/net.rs (100%) rename library/std/src/sys/{ => pal}/teeos/os.rs (100%) rename library/std/src/sys/{ => pal}/teeos/rand.rs (100%) rename library/std/src/sys/{ => pal}/teeos/stdio.rs (100%) rename library/std/src/sys/{ => pal}/teeos/thread.rs (100%) rename library/std/src/sys/{ => pal}/teeos/thread_local_dtor.rs (100%) rename library/std/src/sys/{ => pal}/uefi/alloc.rs (100%) rename library/std/src/sys/{ => pal}/uefi/args.rs (100%) rename library/std/src/sys/{ => pal}/uefi/env.rs (100%) rename library/std/src/sys/{ => pal}/uefi/helpers.rs (100%) rename library/std/src/sys/{ => pal}/uefi/mod.rs (100%) rename library/std/src/sys/{ => pal}/uefi/os.rs (100%) rename library/std/src/sys/{ => pal}/uefi/path.rs (100%) rename library/std/src/sys/{ => pal}/uefi/stdio.rs (100%) rename library/std/src/sys/{ => pal}/uefi/tests.rs (100%) rename library/std/src/sys/{ => pal}/unix/alloc.rs (100%) rename library/std/src/sys/{ => pal}/unix/android.rs (100%) rename library/std/src/sys/{ => pal}/unix/args.rs (100%) rename library/std/src/sys/{ => pal}/unix/cmath.rs (100%) rename library/std/src/sys/{ => pal}/unix/env.rs (100%) rename library/std/src/sys/{ => pal}/unix/fd.rs (100%) rename library/std/src/sys/{ => pal}/unix/fd/tests.rs (100%) rename library/std/src/sys/{ => pal}/unix/fs.rs (100%) rename library/std/src/sys/{ => pal}/unix/futex.rs (100%) rename library/std/src/sys/{ => pal}/unix/io.rs (100%) rename library/std/src/sys/{ => pal}/unix/kernel_copy.rs (100%) rename library/std/src/sys/{ => pal}/unix/kernel_copy/tests.rs (100%) rename library/std/src/sys/{ => pal}/unix/l4re.rs (100%) rename library/std/src/sys/{ => pal}/unix/locks/fuchsia_mutex.rs (100%) rename library/std/src/sys/{ => pal}/unix/locks/futex_condvar.rs (100%) rename library/std/src/sys/{ => pal}/unix/locks/futex_mutex.rs (100%) rename library/std/src/sys/{ => pal}/unix/locks/futex_rwlock.rs (100%) rename library/std/src/sys/{ => pal}/unix/locks/mod.rs (100%) rename library/std/src/sys/{ => pal}/unix/locks/pthread_condvar.rs (100%) rename library/std/src/sys/{ => pal}/unix/locks/pthread_mutex.rs (100%) rename library/std/src/sys/{ => pal}/unix/locks/pthread_rwlock.rs (100%) rename library/std/src/sys/{ => pal}/unix/memchr.rs (100%) rename library/std/src/sys/{ => pal}/unix/mod.rs (100%) rename library/std/src/sys/{ => pal}/unix/net.rs (100%) rename library/std/src/sys/{ => pal}/unix/os.rs (100%) rename library/std/src/sys/{ => pal}/unix/os/tests.rs (100%) rename library/std/src/sys/{ => pal}/unix/os_str.rs (100%) rename library/std/src/sys/{ => pal}/unix/os_str/tests.rs (100%) rename library/std/src/sys/{ => pal}/unix/path.rs (100%) rename library/std/src/sys/{ => pal}/unix/pipe.rs (100%) rename library/std/src/sys/{ => pal}/unix/process/mod.rs (100%) rename library/std/src/sys/{ => pal}/unix/process/process_common.rs (100%) rename library/std/src/sys/{ => pal}/unix/process/process_common/tests.rs (100%) rename library/std/src/sys/{ => pal}/unix/process/process_fuchsia.rs (100%) rename library/std/src/sys/{ => pal}/unix/process/process_unix.rs (100%) rename library/std/src/sys/{ => pal}/unix/process/process_unix/tests.rs (100%) rename library/std/src/sys/{ => pal}/unix/process/process_unsupported.rs (100%) rename library/std/src/sys/{ => pal}/unix/process/process_unsupported/wait_status.rs (100%) rename library/std/src/sys/{ => pal}/unix/process/process_unsupported/wait_status/tests.rs (100%) rename library/std/src/sys/{ => pal}/unix/process/process_vxworks.rs (100%) rename library/std/src/sys/{ => pal}/unix/process/zircon.rs (100%) rename library/std/src/sys/{ => pal}/unix/rand.rs (100%) rename library/std/src/sys/{ => pal}/unix/stack_overflow.rs (100%) rename library/std/src/sys/{ => pal}/unix/stdio.rs (100%) rename library/std/src/sys/{ => pal}/unix/thread.rs (100%) rename library/std/src/sys/{ => pal}/unix/thread_local_dtor.rs (100%) rename library/std/src/sys/{ => pal}/unix/thread_local_key.rs (100%) rename library/std/src/sys/{ => pal}/unix/thread_parking/darwin.rs (100%) rename library/std/src/sys/{ => pal}/unix/thread_parking/mod.rs (100%) rename library/std/src/sys/{ => pal}/unix/thread_parking/netbsd.rs (100%) rename library/std/src/sys/{ => pal}/unix/thread_parking/pthread.rs (100%) rename library/std/src/sys/{ => pal}/unix/time.rs (100%) rename library/std/src/sys/{ => pal}/unix/weak.rs (100%) rename library/std/src/sys/{ => pal}/unsupported/alloc.rs (100%) rename library/std/src/sys/{ => pal}/unsupported/args.rs (100%) rename library/std/src/sys/{ => pal}/unsupported/common.rs (100%) rename library/std/src/sys/{ => pal}/unsupported/env.rs (100%) rename library/std/src/sys/{ => pal}/unsupported/fs.rs (100%) rename library/std/src/sys/{ => pal}/unsupported/io.rs (100%) rename library/std/src/sys/{ => pal}/unsupported/locks/condvar.rs (100%) rename library/std/src/sys/{ => pal}/unsupported/locks/mod.rs (100%) rename library/std/src/sys/{ => pal}/unsupported/locks/mutex.rs (100%) rename library/std/src/sys/{ => pal}/unsupported/locks/rwlock.rs (100%) rename library/std/src/sys/{ => pal}/unsupported/mod.rs (100%) rename library/std/src/sys/{ => pal}/unsupported/net.rs (100%) rename library/std/src/sys/{ => pal}/unsupported/once.rs (100%) rename library/std/src/sys/{ => pal}/unsupported/os.rs (100%) rename library/std/src/sys/{ => pal}/unsupported/pipe.rs (100%) rename library/std/src/sys/{ => pal}/unsupported/process.rs (100%) rename library/std/src/sys/{ => pal}/unsupported/stdio.rs (100%) rename library/std/src/sys/{ => pal}/unsupported/thread.rs (100%) rename library/std/src/sys/{ => pal}/unsupported/thread_local_dtor.rs (100%) rename library/std/src/sys/{ => pal}/unsupported/thread_local_key.rs (100%) rename library/std/src/sys/{ => pal}/unsupported/thread_parking.rs (100%) rename library/std/src/sys/{ => pal}/unsupported/time.rs (100%) rename library/std/src/sys/{ => pal}/wasi/args.rs (100%) rename library/std/src/sys/{ => pal}/wasi/env.rs (100%) rename library/std/src/sys/{ => pal}/wasi/fd.rs (100%) rename library/std/src/sys/{ => pal}/wasi/fs.rs (100%) rename library/std/src/sys/{ => pal}/wasi/io.rs (100%) rename library/std/src/sys/{ => pal}/wasi/mod.rs (100%) rename library/std/src/sys/{ => pal}/wasi/net.rs (100%) rename library/std/src/sys/{ => pal}/wasi/os.rs (100%) rename library/std/src/sys/{ => pal}/wasi/stdio.rs (100%) rename library/std/src/sys/{ => pal}/wasi/thread.rs (100%) rename library/std/src/sys/{ => pal}/wasi/time.rs (100%) rename library/std/src/sys/{ => pal}/wasm/alloc.rs (100%) rename library/std/src/sys/{ => pal}/wasm/atomics/futex.rs (100%) rename library/std/src/sys/{ => pal}/wasm/atomics/thread.rs (100%) rename library/std/src/sys/{ => pal}/wasm/env.rs (100%) rename library/std/src/sys/{ => pal}/wasm/mod.rs (100%) rename library/std/src/sys/{ => pal}/windows/alloc.rs (100%) rename library/std/src/sys/{ => pal}/windows/alloc/tests.rs (100%) rename library/std/src/sys/{ => pal}/windows/api.rs (100%) rename library/std/src/sys/{ => pal}/windows/args.rs (100%) rename library/std/src/sys/{ => pal}/windows/args/tests.rs (100%) rename library/std/src/sys/{ => pal}/windows/c.rs (100%) rename library/std/src/sys/{ => pal}/windows/c/windows_sys.lst (100%) rename library/std/src/sys/{ => pal}/windows/c/windows_sys.rs (100%) rename library/std/src/sys/{ => pal}/windows/cmath.rs (100%) rename library/std/src/sys/{ => pal}/windows/compat.rs (100%) rename library/std/src/sys/{ => pal}/windows/env.rs (100%) rename library/std/src/sys/{ => pal}/windows/fs.rs (100%) rename library/std/src/sys/{ => pal}/windows/handle.rs (100%) rename library/std/src/sys/{ => pal}/windows/handle/tests.rs (100%) rename library/std/src/sys/{ => pal}/windows/io.rs (100%) rename library/std/src/sys/{ => pal}/windows/locks/condvar.rs (100%) rename library/std/src/sys/{ => pal}/windows/locks/mod.rs (100%) rename library/std/src/sys/{ => pal}/windows/locks/mutex.rs (100%) rename library/std/src/sys/{ => pal}/windows/locks/rwlock.rs (100%) rename library/std/src/sys/{ => pal}/windows/memchr.rs (100%) rename library/std/src/sys/{ => pal}/windows/mod.rs (100%) rename library/std/src/sys/{ => pal}/windows/net.rs (100%) rename library/std/src/sys/{ => pal}/windows/os.rs (100%) rename library/std/src/sys/{ => pal}/windows/os/tests.rs (100%) rename library/std/src/sys/{ => pal}/windows/os_str.rs (100%) rename library/std/src/sys/{ => pal}/windows/path.rs (100%) rename library/std/src/sys/{ => pal}/windows/path/tests.rs (100%) rename library/std/src/sys/{ => pal}/windows/pipe.rs (100%) rename library/std/src/sys/{ => pal}/windows/process.rs (100%) rename library/std/src/sys/{ => pal}/windows/process/tests.rs (100%) rename library/std/src/sys/{ => pal}/windows/rand.rs (100%) rename library/std/src/sys/{ => pal}/windows/stack_overflow.rs (100%) rename library/std/src/sys/{ => pal}/windows/stack_overflow_uwp.rs (100%) rename library/std/src/sys/{ => pal}/windows/stdio.rs (100%) rename library/std/src/sys/{ => pal}/windows/stdio/tests.rs (100%) rename library/std/src/sys/{ => pal}/windows/thread.rs (100%) rename library/std/src/sys/{ => pal}/windows/thread_local_dtor.rs (100%) rename library/std/src/sys/{ => pal}/windows/thread_local_key.rs (100%) rename library/std/src/sys/{ => pal}/windows/thread_local_key/tests.rs (100%) rename library/std/src/sys/{ => pal}/windows/thread_parking.rs (100%) rename library/std/src/sys/{ => pal}/windows/time.rs (100%) rename library/std/src/sys/{ => pal}/xous/alloc.rs (100%) rename library/std/src/sys/{ => pal}/xous/locks/condvar.rs (100%) rename library/std/src/sys/{ => pal}/xous/locks/mod.rs (100%) rename library/std/src/sys/{ => pal}/xous/locks/mutex.rs (100%) rename library/std/src/sys/{ => pal}/xous/locks/rwlock.rs (100%) rename library/std/src/sys/{ => pal}/xous/mod.rs (100%) rename library/std/src/sys/{ => pal}/xous/os.rs (100%) rename library/std/src/sys/{ => pal}/xous/stdio.rs (100%) rename library/std/src/sys/{ => pal}/xous/thread.rs (100%) rename library/std/src/sys/{ => pal}/xous/thread_local_key.rs (100%) rename library/std/src/sys/{ => pal}/xous/thread_parking.rs (100%) rename library/std/src/sys/{ => pal}/xous/time.rs (100%) diff --git a/library/std/src/sys/mod.rs b/library/std/src/sys/mod.rs index 88420bd3612..0cd4528b69e 100644 --- a/library/std/src/sys/mod.rs +++ b/library/std/src/sys/mod.rs @@ -1,124 +1,8 @@ -//! Platform-dependent platform abstraction. -//! -//! The `std::sys` module is the abstracted interface through which -//! `std` talks to the underlying operating system. It has different -//! implementations for different operating system families, today -//! just Unix and Windows, and initial support for Redox. -//! -//! The centralization of platform-specific code in this module is -//! enforced by the "platform abstraction layer" tidy script in -//! `tools/tidy/src/pal.rs`. -//! -//! This module is closely related to the platform-independent system -//! integration code in `std::sys_common`. See that module's -//! documentation for details. -//! -//! In the future it would be desirable for the independent -//! implementations of this module to be extracted to their own crates -//! that `std` can link to, thus enabling their implementation -//! out-of-tree via crate replacement. Though due to the complex -//! inter-dependencies within `std` that will be a challenging goal to -//! achieve. +/// The PAL (platform abstraction layer) contains platform-specific abstractions +/// for implementing the features in the other submodules, e.g. UNIX file +/// descriptors. +mod pal; -#![allow(missing_debug_implementations)] - -pub mod common; -mod personality; - -cfg_if::cfg_if! { - if #[cfg(unix)] { - mod unix; - pub use self::unix::*; - } else if #[cfg(windows)] { - mod windows; - pub use self::windows::*; - } else if #[cfg(target_os = "solid_asp3")] { - mod solid; - pub use self::solid::*; - } else if #[cfg(target_os = "hermit")] { - mod hermit; - pub use self::hermit::*; - } else if #[cfg(target_os = "wasi")] { - mod wasi; - pub use self::wasi::*; - } else if #[cfg(target_family = "wasm")] { - mod wasm; - pub use self::wasm::*; - } else if #[cfg(target_os = "xous")] { - mod xous; - pub use self::xous::*; - } else if #[cfg(target_os = "uefi")] { - mod uefi; - pub use self::uefi::*; - } else if #[cfg(all(target_vendor = "fortanix", target_env = "sgx"))] { - mod sgx; - pub use self::sgx::*; - } else if #[cfg(target_os = "teeos")] { - mod teeos; - pub use self::teeos::*; - } else { - mod unsupported; - pub use self::unsupported::*; - } -} - -cfg_if::cfg_if! { - // Fuchsia components default to full backtrace. - if #[cfg(target_os = "fuchsia")] { - pub const FULL_BACKTRACE_DEFAULT: bool = true; - } else { - pub const FULL_BACKTRACE_DEFAULT: bool = false; - } -} - -#[cfg(not(test))] -cfg_if::cfg_if! { - if #[cfg(target_os = "android")] { - pub use self::android::log2f32; - pub use self::android::log2f64; - } else { - #[inline] - pub fn log2f32(n: f32) -> f32 { - unsafe { crate::intrinsics::log2f32(n) } - } - - #[inline] - pub fn log2f64(n: f64) -> f64 { - unsafe { crate::intrinsics::log2f64(n) } - } - } -} - -// Solaris/Illumos requires a wrapper around log, log2, and log10 functions -// because of their non-standard behavior (e.g., log(-n) returns -Inf instead -// of expected NaN). -#[cfg(not(test))] -#[cfg(any(target_os = "solaris", target_os = "illumos"))] -#[inline] -pub fn log_wrapper f64>(n: f64, log_fn: F) -> f64 { - if n.is_finite() { - if n > 0.0 { - log_fn(n) - } else if n == 0.0 { - f64::NEG_INFINITY // log(0) = -Inf - } else { - f64::NAN // log(-n) = NaN - } - } else if n.is_nan() { - n // log(NaN) = NaN - } else if n > 0.0 { - n // log(Inf) = Inf - } else { - f64::NAN // log(-Inf) = NaN - } -} - -#[cfg(not(test))] -#[cfg(not(any(target_os = "solaris", target_os = "illumos")))] -#[inline] -pub fn log_wrapper f64>(n: f64, log_fn: F) -> f64 { - log_fn(n) -} - -#[cfg(not(target_os = "uefi"))] -pub type RawOsError = i32; +// FIXME(117276): remove this, move feature implementations into individual +// submodules. +pub use pal::*; diff --git a/library/std/src/sys/common/alloc.rs b/library/std/src/sys/pal/common/alloc.rs similarity index 100% rename from library/std/src/sys/common/alloc.rs rename to library/std/src/sys/pal/common/alloc.rs diff --git a/library/std/src/sys/common/mod.rs b/library/std/src/sys/pal/common/mod.rs similarity index 100% rename from library/std/src/sys/common/mod.rs rename to library/std/src/sys/pal/common/mod.rs diff --git a/library/std/src/sys/common/small_c_string.rs b/library/std/src/sys/pal/common/small_c_string.rs similarity index 100% rename from library/std/src/sys/common/small_c_string.rs rename to library/std/src/sys/pal/common/small_c_string.rs diff --git a/library/std/src/sys/common/tests.rs b/library/std/src/sys/pal/common/tests.rs similarity index 100% rename from library/std/src/sys/common/tests.rs rename to library/std/src/sys/pal/common/tests.rs diff --git a/library/std/src/sys/common/thread_local/fast_local.rs b/library/std/src/sys/pal/common/thread_local/fast_local.rs similarity index 100% rename from library/std/src/sys/common/thread_local/fast_local.rs rename to library/std/src/sys/pal/common/thread_local/fast_local.rs diff --git a/library/std/src/sys/common/thread_local/mod.rs b/library/std/src/sys/pal/common/thread_local/mod.rs similarity index 100% rename from library/std/src/sys/common/thread_local/mod.rs rename to library/std/src/sys/pal/common/thread_local/mod.rs diff --git a/library/std/src/sys/common/thread_local/os_local.rs b/library/std/src/sys/pal/common/thread_local/os_local.rs similarity index 100% rename from library/std/src/sys/common/thread_local/os_local.rs rename to library/std/src/sys/pal/common/thread_local/os_local.rs diff --git a/library/std/src/sys/common/thread_local/static_local.rs b/library/std/src/sys/pal/common/thread_local/static_local.rs similarity index 100% rename from library/std/src/sys/common/thread_local/static_local.rs rename to library/std/src/sys/pal/common/thread_local/static_local.rs diff --git a/library/std/src/sys/hermit/alloc.rs b/library/std/src/sys/pal/hermit/alloc.rs similarity index 100% rename from library/std/src/sys/hermit/alloc.rs rename to library/std/src/sys/pal/hermit/alloc.rs diff --git a/library/std/src/sys/hermit/args.rs b/library/std/src/sys/pal/hermit/args.rs similarity index 100% rename from library/std/src/sys/hermit/args.rs rename to library/std/src/sys/pal/hermit/args.rs diff --git a/library/std/src/sys/hermit/env.rs b/library/std/src/sys/pal/hermit/env.rs similarity index 100% rename from library/std/src/sys/hermit/env.rs rename to library/std/src/sys/pal/hermit/env.rs diff --git a/library/std/src/sys/hermit/fd.rs b/library/std/src/sys/pal/hermit/fd.rs similarity index 100% rename from library/std/src/sys/hermit/fd.rs rename to library/std/src/sys/pal/hermit/fd.rs diff --git a/library/std/src/sys/hermit/fs.rs b/library/std/src/sys/pal/hermit/fs.rs similarity index 100% rename from library/std/src/sys/hermit/fs.rs rename to library/std/src/sys/pal/hermit/fs.rs diff --git a/library/std/src/sys/hermit/futex.rs b/library/std/src/sys/pal/hermit/futex.rs similarity index 100% rename from library/std/src/sys/hermit/futex.rs rename to library/std/src/sys/pal/hermit/futex.rs diff --git a/library/std/src/sys/hermit/memchr.rs b/library/std/src/sys/pal/hermit/memchr.rs similarity index 100% rename from library/std/src/sys/hermit/memchr.rs rename to library/std/src/sys/pal/hermit/memchr.rs diff --git a/library/std/src/sys/hermit/mod.rs b/library/std/src/sys/pal/hermit/mod.rs similarity index 100% rename from library/std/src/sys/hermit/mod.rs rename to library/std/src/sys/pal/hermit/mod.rs diff --git a/library/std/src/sys/hermit/net.rs b/library/std/src/sys/pal/hermit/net.rs similarity index 100% rename from library/std/src/sys/hermit/net.rs rename to library/std/src/sys/pal/hermit/net.rs diff --git a/library/std/src/sys/hermit/os.rs b/library/std/src/sys/pal/hermit/os.rs similarity index 100% rename from library/std/src/sys/hermit/os.rs rename to library/std/src/sys/pal/hermit/os.rs diff --git a/library/std/src/sys/hermit/stdio.rs b/library/std/src/sys/pal/hermit/stdio.rs similarity index 100% rename from library/std/src/sys/hermit/stdio.rs rename to library/std/src/sys/pal/hermit/stdio.rs diff --git a/library/std/src/sys/hermit/thread.rs b/library/std/src/sys/pal/hermit/thread.rs similarity index 100% rename from library/std/src/sys/hermit/thread.rs rename to library/std/src/sys/pal/hermit/thread.rs diff --git a/library/std/src/sys/hermit/thread_local_dtor.rs b/library/std/src/sys/pal/hermit/thread_local_dtor.rs similarity index 100% rename from library/std/src/sys/hermit/thread_local_dtor.rs rename to library/std/src/sys/pal/hermit/thread_local_dtor.rs diff --git a/library/std/src/sys/hermit/time.rs b/library/std/src/sys/pal/hermit/time.rs similarity index 100% rename from library/std/src/sys/hermit/time.rs rename to library/std/src/sys/pal/hermit/time.rs diff --git a/library/std/src/sys/itron/abi.rs b/library/std/src/sys/pal/itron/abi.rs similarity index 100% rename from library/std/src/sys/itron/abi.rs rename to library/std/src/sys/pal/itron/abi.rs diff --git a/library/std/src/sys/itron/condvar.rs b/library/std/src/sys/pal/itron/condvar.rs similarity index 100% rename from library/std/src/sys/itron/condvar.rs rename to library/std/src/sys/pal/itron/condvar.rs diff --git a/library/std/src/sys/itron/error.rs b/library/std/src/sys/pal/itron/error.rs similarity index 100% rename from library/std/src/sys/itron/error.rs rename to library/std/src/sys/pal/itron/error.rs diff --git a/library/std/src/sys/itron/mutex.rs b/library/std/src/sys/pal/itron/mutex.rs similarity index 100% rename from library/std/src/sys/itron/mutex.rs rename to library/std/src/sys/pal/itron/mutex.rs diff --git a/library/std/src/sys/itron/spin.rs b/library/std/src/sys/pal/itron/spin.rs similarity index 100% rename from library/std/src/sys/itron/spin.rs rename to library/std/src/sys/pal/itron/spin.rs diff --git a/library/std/src/sys/itron/task.rs b/library/std/src/sys/pal/itron/task.rs similarity index 100% rename from library/std/src/sys/itron/task.rs rename to library/std/src/sys/pal/itron/task.rs diff --git a/library/std/src/sys/itron/thread.rs b/library/std/src/sys/pal/itron/thread.rs similarity index 100% rename from library/std/src/sys/itron/thread.rs rename to library/std/src/sys/pal/itron/thread.rs diff --git a/library/std/src/sys/itron/thread_parking.rs b/library/std/src/sys/pal/itron/thread_parking.rs similarity index 100% rename from library/std/src/sys/itron/thread_parking.rs rename to library/std/src/sys/pal/itron/thread_parking.rs diff --git a/library/std/src/sys/itron/time.rs b/library/std/src/sys/pal/itron/time.rs similarity index 100% rename from library/std/src/sys/itron/time.rs rename to library/std/src/sys/pal/itron/time.rs diff --git a/library/std/src/sys/itron/time/tests.rs b/library/std/src/sys/pal/itron/time/tests.rs similarity index 100% rename from library/std/src/sys/itron/time/tests.rs rename to library/std/src/sys/pal/itron/time/tests.rs diff --git a/library/std/src/sys/pal/mod.rs b/library/std/src/sys/pal/mod.rs new file mode 100644 index 00000000000..88420bd3612 --- /dev/null +++ b/library/std/src/sys/pal/mod.rs @@ -0,0 +1,124 @@ +//! Platform-dependent platform abstraction. +//! +//! The `std::sys` module is the abstracted interface through which +//! `std` talks to the underlying operating system. It has different +//! implementations for different operating system families, today +//! just Unix and Windows, and initial support for Redox. +//! +//! The centralization of platform-specific code in this module is +//! enforced by the "platform abstraction layer" tidy script in +//! `tools/tidy/src/pal.rs`. +//! +//! This module is closely related to the platform-independent system +//! integration code in `std::sys_common`. See that module's +//! documentation for details. +//! +//! In the future it would be desirable for the independent +//! implementations of this module to be extracted to their own crates +//! that `std` can link to, thus enabling their implementation +//! out-of-tree via crate replacement. Though due to the complex +//! inter-dependencies within `std` that will be a challenging goal to +//! achieve. + +#![allow(missing_debug_implementations)] + +pub mod common; +mod personality; + +cfg_if::cfg_if! { + if #[cfg(unix)] { + mod unix; + pub use self::unix::*; + } else if #[cfg(windows)] { + mod windows; + pub use self::windows::*; + } else if #[cfg(target_os = "solid_asp3")] { + mod solid; + pub use self::solid::*; + } else if #[cfg(target_os = "hermit")] { + mod hermit; + pub use self::hermit::*; + } else if #[cfg(target_os = "wasi")] { + mod wasi; + pub use self::wasi::*; + } else if #[cfg(target_family = "wasm")] { + mod wasm; + pub use self::wasm::*; + } else if #[cfg(target_os = "xous")] { + mod xous; + pub use self::xous::*; + } else if #[cfg(target_os = "uefi")] { + mod uefi; + pub use self::uefi::*; + } else if #[cfg(all(target_vendor = "fortanix", target_env = "sgx"))] { + mod sgx; + pub use self::sgx::*; + } else if #[cfg(target_os = "teeos")] { + mod teeos; + pub use self::teeos::*; + } else { + mod unsupported; + pub use self::unsupported::*; + } +} + +cfg_if::cfg_if! { + // Fuchsia components default to full backtrace. + if #[cfg(target_os = "fuchsia")] { + pub const FULL_BACKTRACE_DEFAULT: bool = true; + } else { + pub const FULL_BACKTRACE_DEFAULT: bool = false; + } +} + +#[cfg(not(test))] +cfg_if::cfg_if! { + if #[cfg(target_os = "android")] { + pub use self::android::log2f32; + pub use self::android::log2f64; + } else { + #[inline] + pub fn log2f32(n: f32) -> f32 { + unsafe { crate::intrinsics::log2f32(n) } + } + + #[inline] + pub fn log2f64(n: f64) -> f64 { + unsafe { crate::intrinsics::log2f64(n) } + } + } +} + +// Solaris/Illumos requires a wrapper around log, log2, and log10 functions +// because of their non-standard behavior (e.g., log(-n) returns -Inf instead +// of expected NaN). +#[cfg(not(test))] +#[cfg(any(target_os = "solaris", target_os = "illumos"))] +#[inline] +pub fn log_wrapper f64>(n: f64, log_fn: F) -> f64 { + if n.is_finite() { + if n > 0.0 { + log_fn(n) + } else if n == 0.0 { + f64::NEG_INFINITY // log(0) = -Inf + } else { + f64::NAN // log(-n) = NaN + } + } else if n.is_nan() { + n // log(NaN) = NaN + } else if n > 0.0 { + n // log(Inf) = Inf + } else { + f64::NAN // log(-Inf) = NaN + } +} + +#[cfg(not(test))] +#[cfg(not(any(target_os = "solaris", target_os = "illumos")))] +#[inline] +pub fn log_wrapper f64>(n: f64, log_fn: F) -> f64 { + log_fn(n) +} + +#[cfg(not(target_os = "uefi"))] +pub type RawOsError = i32; diff --git a/library/std/src/sys/personality/dwarf/eh.rs b/library/std/src/sys/pal/personality/dwarf/eh.rs similarity index 100% rename from library/std/src/sys/personality/dwarf/eh.rs rename to library/std/src/sys/pal/personality/dwarf/eh.rs diff --git a/library/std/src/sys/personality/dwarf/mod.rs b/library/std/src/sys/pal/personality/dwarf/mod.rs similarity index 100% rename from library/std/src/sys/personality/dwarf/mod.rs rename to library/std/src/sys/pal/personality/dwarf/mod.rs diff --git a/library/std/src/sys/personality/dwarf/tests.rs b/library/std/src/sys/pal/personality/dwarf/tests.rs similarity index 100% rename from library/std/src/sys/personality/dwarf/tests.rs rename to library/std/src/sys/pal/personality/dwarf/tests.rs diff --git a/library/std/src/sys/personality/emcc.rs b/library/std/src/sys/pal/personality/emcc.rs similarity index 100% rename from library/std/src/sys/personality/emcc.rs rename to library/std/src/sys/pal/personality/emcc.rs diff --git a/library/std/src/sys/personality/gcc.rs b/library/std/src/sys/pal/personality/gcc.rs similarity index 100% rename from library/std/src/sys/personality/gcc.rs rename to library/std/src/sys/pal/personality/gcc.rs diff --git a/library/std/src/sys/personality/mod.rs b/library/std/src/sys/pal/personality/mod.rs similarity index 100% rename from library/std/src/sys/personality/mod.rs rename to library/std/src/sys/pal/personality/mod.rs diff --git a/library/std/src/sys/sgx/abi/entry.S b/library/std/src/sys/pal/sgx/abi/entry.S similarity index 100% rename from library/std/src/sys/sgx/abi/entry.S rename to library/std/src/sys/pal/sgx/abi/entry.S diff --git a/library/std/src/sys/sgx/abi/mem.rs b/library/std/src/sys/pal/sgx/abi/mem.rs similarity index 100% rename from library/std/src/sys/sgx/abi/mem.rs rename to library/std/src/sys/pal/sgx/abi/mem.rs diff --git a/library/std/src/sys/sgx/abi/mod.rs b/library/std/src/sys/pal/sgx/abi/mod.rs similarity index 100% rename from library/std/src/sys/sgx/abi/mod.rs rename to library/std/src/sys/pal/sgx/abi/mod.rs diff --git a/library/std/src/sys/sgx/abi/panic.rs b/library/std/src/sys/pal/sgx/abi/panic.rs similarity index 100% rename from library/std/src/sys/sgx/abi/panic.rs rename to library/std/src/sys/pal/sgx/abi/panic.rs diff --git a/library/std/src/sys/sgx/abi/reloc.rs b/library/std/src/sys/pal/sgx/abi/reloc.rs similarity index 100% rename from library/std/src/sys/sgx/abi/reloc.rs rename to library/std/src/sys/pal/sgx/abi/reloc.rs diff --git a/library/std/src/sys/sgx/abi/thread.rs b/library/std/src/sys/pal/sgx/abi/thread.rs similarity index 100% rename from library/std/src/sys/sgx/abi/thread.rs rename to library/std/src/sys/pal/sgx/abi/thread.rs diff --git a/library/std/src/sys/sgx/abi/tls/mod.rs b/library/std/src/sys/pal/sgx/abi/tls/mod.rs similarity index 100% rename from library/std/src/sys/sgx/abi/tls/mod.rs rename to library/std/src/sys/pal/sgx/abi/tls/mod.rs diff --git a/library/std/src/sys/sgx/abi/tls/sync_bitset.rs b/library/std/src/sys/pal/sgx/abi/tls/sync_bitset.rs similarity index 100% rename from library/std/src/sys/sgx/abi/tls/sync_bitset.rs rename to library/std/src/sys/pal/sgx/abi/tls/sync_bitset.rs diff --git a/library/std/src/sys/sgx/abi/tls/sync_bitset/tests.rs b/library/std/src/sys/pal/sgx/abi/tls/sync_bitset/tests.rs similarity index 100% rename from library/std/src/sys/sgx/abi/tls/sync_bitset/tests.rs rename to library/std/src/sys/pal/sgx/abi/tls/sync_bitset/tests.rs diff --git a/library/std/src/sys/sgx/abi/usercalls/alloc.rs b/library/std/src/sys/pal/sgx/abi/usercalls/alloc.rs similarity index 100% rename from library/std/src/sys/sgx/abi/usercalls/alloc.rs rename to library/std/src/sys/pal/sgx/abi/usercalls/alloc.rs diff --git a/library/std/src/sys/sgx/abi/usercalls/mod.rs b/library/std/src/sys/pal/sgx/abi/usercalls/mod.rs similarity index 100% rename from library/std/src/sys/sgx/abi/usercalls/mod.rs rename to library/std/src/sys/pal/sgx/abi/usercalls/mod.rs diff --git a/library/std/src/sys/sgx/abi/usercalls/raw.rs b/library/std/src/sys/pal/sgx/abi/usercalls/raw.rs similarity index 100% rename from library/std/src/sys/sgx/abi/usercalls/raw.rs rename to library/std/src/sys/pal/sgx/abi/usercalls/raw.rs diff --git a/library/std/src/sys/sgx/abi/usercalls/tests.rs b/library/std/src/sys/pal/sgx/abi/usercalls/tests.rs similarity index 100% rename from library/std/src/sys/sgx/abi/usercalls/tests.rs rename to library/std/src/sys/pal/sgx/abi/usercalls/tests.rs diff --git a/library/std/src/sys/sgx/alloc.rs b/library/std/src/sys/pal/sgx/alloc.rs similarity index 100% rename from library/std/src/sys/sgx/alloc.rs rename to library/std/src/sys/pal/sgx/alloc.rs diff --git a/library/std/src/sys/sgx/args.rs b/library/std/src/sys/pal/sgx/args.rs similarity index 100% rename from library/std/src/sys/sgx/args.rs rename to library/std/src/sys/pal/sgx/args.rs diff --git a/library/std/src/sys/sgx/condvar.rs b/library/std/src/sys/pal/sgx/condvar.rs similarity index 100% rename from library/std/src/sys/sgx/condvar.rs rename to library/std/src/sys/pal/sgx/condvar.rs diff --git a/library/std/src/sys/sgx/env.rs b/library/std/src/sys/pal/sgx/env.rs similarity index 100% rename from library/std/src/sys/sgx/env.rs rename to library/std/src/sys/pal/sgx/env.rs diff --git a/library/std/src/sys/sgx/fd.rs b/library/std/src/sys/pal/sgx/fd.rs similarity index 100% rename from library/std/src/sys/sgx/fd.rs rename to library/std/src/sys/pal/sgx/fd.rs diff --git a/library/std/src/sys/sgx/memchr.rs b/library/std/src/sys/pal/sgx/memchr.rs similarity index 100% rename from library/std/src/sys/sgx/memchr.rs rename to library/std/src/sys/pal/sgx/memchr.rs diff --git a/library/std/src/sys/sgx/mod.rs b/library/std/src/sys/pal/sgx/mod.rs similarity index 100% rename from library/std/src/sys/sgx/mod.rs rename to library/std/src/sys/pal/sgx/mod.rs diff --git a/library/std/src/sys/sgx/mutex.rs b/library/std/src/sys/pal/sgx/mutex.rs similarity index 100% rename from library/std/src/sys/sgx/mutex.rs rename to library/std/src/sys/pal/sgx/mutex.rs diff --git a/library/std/src/sys/sgx/net.rs b/library/std/src/sys/pal/sgx/net.rs similarity index 100% rename from library/std/src/sys/sgx/net.rs rename to library/std/src/sys/pal/sgx/net.rs diff --git a/library/std/src/sys/sgx/os.rs b/library/std/src/sys/pal/sgx/os.rs similarity index 100% rename from library/std/src/sys/sgx/os.rs rename to library/std/src/sys/pal/sgx/os.rs diff --git a/library/std/src/sys/sgx/path.rs b/library/std/src/sys/pal/sgx/path.rs similarity index 100% rename from library/std/src/sys/sgx/path.rs rename to library/std/src/sys/pal/sgx/path.rs diff --git a/library/std/src/sys/sgx/rwlock.rs b/library/std/src/sys/pal/sgx/rwlock.rs similarity index 100% rename from library/std/src/sys/sgx/rwlock.rs rename to library/std/src/sys/pal/sgx/rwlock.rs diff --git a/library/std/src/sys/sgx/rwlock/tests.rs b/library/std/src/sys/pal/sgx/rwlock/tests.rs similarity index 100% rename from library/std/src/sys/sgx/rwlock/tests.rs rename to library/std/src/sys/pal/sgx/rwlock/tests.rs diff --git a/library/std/src/sys/sgx/stdio.rs b/library/std/src/sys/pal/sgx/stdio.rs similarity index 100% rename from library/std/src/sys/sgx/stdio.rs rename to library/std/src/sys/pal/sgx/stdio.rs diff --git a/library/std/src/sys/sgx/thread.rs b/library/std/src/sys/pal/sgx/thread.rs similarity index 100% rename from library/std/src/sys/sgx/thread.rs rename to library/std/src/sys/pal/sgx/thread.rs diff --git a/library/std/src/sys/sgx/thread_local_key.rs b/library/std/src/sys/pal/sgx/thread_local_key.rs similarity index 100% rename from library/std/src/sys/sgx/thread_local_key.rs rename to library/std/src/sys/pal/sgx/thread_local_key.rs diff --git a/library/std/src/sys/sgx/thread_parking.rs b/library/std/src/sys/pal/sgx/thread_parking.rs similarity index 100% rename from library/std/src/sys/sgx/thread_parking.rs rename to library/std/src/sys/pal/sgx/thread_parking.rs diff --git a/library/std/src/sys/sgx/time.rs b/library/std/src/sys/pal/sgx/time.rs similarity index 100% rename from library/std/src/sys/sgx/time.rs rename to library/std/src/sys/pal/sgx/time.rs diff --git a/library/std/src/sys/sgx/waitqueue/mod.rs b/library/std/src/sys/pal/sgx/waitqueue/mod.rs similarity index 100% rename from library/std/src/sys/sgx/waitqueue/mod.rs rename to library/std/src/sys/pal/sgx/waitqueue/mod.rs diff --git a/library/std/src/sys/sgx/waitqueue/spin_mutex.rs b/library/std/src/sys/pal/sgx/waitqueue/spin_mutex.rs similarity index 100% rename from library/std/src/sys/sgx/waitqueue/spin_mutex.rs rename to library/std/src/sys/pal/sgx/waitqueue/spin_mutex.rs diff --git a/library/std/src/sys/sgx/waitqueue/spin_mutex/tests.rs b/library/std/src/sys/pal/sgx/waitqueue/spin_mutex/tests.rs similarity index 100% rename from library/std/src/sys/sgx/waitqueue/spin_mutex/tests.rs rename to library/std/src/sys/pal/sgx/waitqueue/spin_mutex/tests.rs diff --git a/library/std/src/sys/sgx/waitqueue/tests.rs b/library/std/src/sys/pal/sgx/waitqueue/tests.rs similarity index 100% rename from library/std/src/sys/sgx/waitqueue/tests.rs rename to library/std/src/sys/pal/sgx/waitqueue/tests.rs diff --git a/library/std/src/sys/sgx/waitqueue/unsafe_list.rs b/library/std/src/sys/pal/sgx/waitqueue/unsafe_list.rs similarity index 100% rename from library/std/src/sys/sgx/waitqueue/unsafe_list.rs rename to library/std/src/sys/pal/sgx/waitqueue/unsafe_list.rs diff --git a/library/std/src/sys/sgx/waitqueue/unsafe_list/tests.rs b/library/std/src/sys/pal/sgx/waitqueue/unsafe_list/tests.rs similarity index 100% rename from library/std/src/sys/sgx/waitqueue/unsafe_list/tests.rs rename to library/std/src/sys/pal/sgx/waitqueue/unsafe_list/tests.rs diff --git a/library/std/src/sys/solid/abi/fs.rs b/library/std/src/sys/pal/solid/abi/fs.rs similarity index 100% rename from library/std/src/sys/solid/abi/fs.rs rename to library/std/src/sys/pal/solid/abi/fs.rs diff --git a/library/std/src/sys/solid/abi/mod.rs b/library/std/src/sys/pal/solid/abi/mod.rs similarity index 100% rename from library/std/src/sys/solid/abi/mod.rs rename to library/std/src/sys/pal/solid/abi/mod.rs diff --git a/library/std/src/sys/solid/abi/sockets.rs b/library/std/src/sys/pal/solid/abi/sockets.rs similarity index 100% rename from library/std/src/sys/solid/abi/sockets.rs rename to library/std/src/sys/pal/solid/abi/sockets.rs diff --git a/library/std/src/sys/solid/alloc.rs b/library/std/src/sys/pal/solid/alloc.rs similarity index 100% rename from library/std/src/sys/solid/alloc.rs rename to library/std/src/sys/pal/solid/alloc.rs diff --git a/library/std/src/sys/solid/env.rs b/library/std/src/sys/pal/solid/env.rs similarity index 100% rename from library/std/src/sys/solid/env.rs rename to library/std/src/sys/pal/solid/env.rs diff --git a/library/std/src/sys/solid/error.rs b/library/std/src/sys/pal/solid/error.rs similarity index 100% rename from library/std/src/sys/solid/error.rs rename to library/std/src/sys/pal/solid/error.rs diff --git a/library/std/src/sys/solid/fs.rs b/library/std/src/sys/pal/solid/fs.rs similarity index 100% rename from library/std/src/sys/solid/fs.rs rename to library/std/src/sys/pal/solid/fs.rs diff --git a/library/std/src/sys/solid/io.rs b/library/std/src/sys/pal/solid/io.rs similarity index 100% rename from library/std/src/sys/solid/io.rs rename to library/std/src/sys/pal/solid/io.rs diff --git a/library/std/src/sys/solid/memchr.rs b/library/std/src/sys/pal/solid/memchr.rs similarity index 100% rename from library/std/src/sys/solid/memchr.rs rename to library/std/src/sys/pal/solid/memchr.rs diff --git a/library/std/src/sys/solid/mod.rs b/library/std/src/sys/pal/solid/mod.rs similarity index 100% rename from library/std/src/sys/solid/mod.rs rename to library/std/src/sys/pal/solid/mod.rs diff --git a/library/std/src/sys/solid/net.rs b/library/std/src/sys/pal/solid/net.rs similarity index 100% rename from library/std/src/sys/solid/net.rs rename to library/std/src/sys/pal/solid/net.rs diff --git a/library/std/src/sys/solid/os.rs b/library/std/src/sys/pal/solid/os.rs similarity index 100% rename from library/std/src/sys/solid/os.rs rename to library/std/src/sys/pal/solid/os.rs diff --git a/library/std/src/sys/solid/path.rs b/library/std/src/sys/pal/solid/path.rs similarity index 100% rename from library/std/src/sys/solid/path.rs rename to library/std/src/sys/pal/solid/path.rs diff --git a/library/std/src/sys/solid/rwlock.rs b/library/std/src/sys/pal/solid/rwlock.rs similarity index 100% rename from library/std/src/sys/solid/rwlock.rs rename to library/std/src/sys/pal/solid/rwlock.rs diff --git a/library/std/src/sys/solid/stdio.rs b/library/std/src/sys/pal/solid/stdio.rs similarity index 100% rename from library/std/src/sys/solid/stdio.rs rename to library/std/src/sys/pal/solid/stdio.rs diff --git a/library/std/src/sys/solid/thread_local_dtor.rs b/library/std/src/sys/pal/solid/thread_local_dtor.rs similarity index 100% rename from library/std/src/sys/solid/thread_local_dtor.rs rename to library/std/src/sys/pal/solid/thread_local_dtor.rs diff --git a/library/std/src/sys/solid/thread_local_key.rs b/library/std/src/sys/pal/solid/thread_local_key.rs similarity index 100% rename from library/std/src/sys/solid/thread_local_key.rs rename to library/std/src/sys/pal/solid/thread_local_key.rs diff --git a/library/std/src/sys/solid/time.rs b/library/std/src/sys/pal/solid/time.rs similarity index 100% rename from library/std/src/sys/solid/time.rs rename to library/std/src/sys/pal/solid/time.rs diff --git a/library/std/src/sys/teeos/alloc.rs b/library/std/src/sys/pal/teeos/alloc.rs similarity index 100% rename from library/std/src/sys/teeos/alloc.rs rename to library/std/src/sys/pal/teeos/alloc.rs diff --git a/library/std/src/sys/teeos/locks/condvar.rs b/library/std/src/sys/pal/teeos/locks/condvar.rs similarity index 100% rename from library/std/src/sys/teeos/locks/condvar.rs rename to library/std/src/sys/pal/teeos/locks/condvar.rs diff --git a/library/std/src/sys/teeos/locks/mod.rs b/library/std/src/sys/pal/teeos/locks/mod.rs similarity index 100% rename from library/std/src/sys/teeos/locks/mod.rs rename to library/std/src/sys/pal/teeos/locks/mod.rs diff --git a/library/std/src/sys/teeos/locks/rwlock.rs b/library/std/src/sys/pal/teeos/locks/rwlock.rs similarity index 100% rename from library/std/src/sys/teeos/locks/rwlock.rs rename to library/std/src/sys/pal/teeos/locks/rwlock.rs diff --git a/library/std/src/sys/teeos/mod.rs b/library/std/src/sys/pal/teeos/mod.rs similarity index 100% rename from library/std/src/sys/teeos/mod.rs rename to library/std/src/sys/pal/teeos/mod.rs diff --git a/library/std/src/sys/teeos/net.rs b/library/std/src/sys/pal/teeos/net.rs similarity index 100% rename from library/std/src/sys/teeos/net.rs rename to library/std/src/sys/pal/teeos/net.rs diff --git a/library/std/src/sys/teeos/os.rs b/library/std/src/sys/pal/teeos/os.rs similarity index 100% rename from library/std/src/sys/teeos/os.rs rename to library/std/src/sys/pal/teeos/os.rs diff --git a/library/std/src/sys/teeos/rand.rs b/library/std/src/sys/pal/teeos/rand.rs similarity index 100% rename from library/std/src/sys/teeos/rand.rs rename to library/std/src/sys/pal/teeos/rand.rs diff --git a/library/std/src/sys/teeos/stdio.rs b/library/std/src/sys/pal/teeos/stdio.rs similarity index 100% rename from library/std/src/sys/teeos/stdio.rs rename to library/std/src/sys/pal/teeos/stdio.rs diff --git a/library/std/src/sys/teeos/thread.rs b/library/std/src/sys/pal/teeos/thread.rs similarity index 100% rename from library/std/src/sys/teeos/thread.rs rename to library/std/src/sys/pal/teeos/thread.rs diff --git a/library/std/src/sys/teeos/thread_local_dtor.rs b/library/std/src/sys/pal/teeos/thread_local_dtor.rs similarity index 100% rename from library/std/src/sys/teeos/thread_local_dtor.rs rename to library/std/src/sys/pal/teeos/thread_local_dtor.rs diff --git a/library/std/src/sys/uefi/alloc.rs b/library/std/src/sys/pal/uefi/alloc.rs similarity index 100% rename from library/std/src/sys/uefi/alloc.rs rename to library/std/src/sys/pal/uefi/alloc.rs diff --git a/library/std/src/sys/uefi/args.rs b/library/std/src/sys/pal/uefi/args.rs similarity index 100% rename from library/std/src/sys/uefi/args.rs rename to library/std/src/sys/pal/uefi/args.rs diff --git a/library/std/src/sys/uefi/env.rs b/library/std/src/sys/pal/uefi/env.rs similarity index 100% rename from library/std/src/sys/uefi/env.rs rename to library/std/src/sys/pal/uefi/env.rs diff --git a/library/std/src/sys/uefi/helpers.rs b/library/std/src/sys/pal/uefi/helpers.rs similarity index 100% rename from library/std/src/sys/uefi/helpers.rs rename to library/std/src/sys/pal/uefi/helpers.rs diff --git a/library/std/src/sys/uefi/mod.rs b/library/std/src/sys/pal/uefi/mod.rs similarity index 100% rename from library/std/src/sys/uefi/mod.rs rename to library/std/src/sys/pal/uefi/mod.rs diff --git a/library/std/src/sys/uefi/os.rs b/library/std/src/sys/pal/uefi/os.rs similarity index 100% rename from library/std/src/sys/uefi/os.rs rename to library/std/src/sys/pal/uefi/os.rs diff --git a/library/std/src/sys/uefi/path.rs b/library/std/src/sys/pal/uefi/path.rs similarity index 100% rename from library/std/src/sys/uefi/path.rs rename to library/std/src/sys/pal/uefi/path.rs diff --git a/library/std/src/sys/uefi/stdio.rs b/library/std/src/sys/pal/uefi/stdio.rs similarity index 100% rename from library/std/src/sys/uefi/stdio.rs rename to library/std/src/sys/pal/uefi/stdio.rs diff --git a/library/std/src/sys/uefi/tests.rs b/library/std/src/sys/pal/uefi/tests.rs similarity index 100% rename from library/std/src/sys/uefi/tests.rs rename to library/std/src/sys/pal/uefi/tests.rs diff --git a/library/std/src/sys/unix/alloc.rs b/library/std/src/sys/pal/unix/alloc.rs similarity index 100% rename from library/std/src/sys/unix/alloc.rs rename to library/std/src/sys/pal/unix/alloc.rs diff --git a/library/std/src/sys/unix/android.rs b/library/std/src/sys/pal/unix/android.rs similarity index 100% rename from library/std/src/sys/unix/android.rs rename to library/std/src/sys/pal/unix/android.rs diff --git a/library/std/src/sys/unix/args.rs b/library/std/src/sys/pal/unix/args.rs similarity index 100% rename from library/std/src/sys/unix/args.rs rename to library/std/src/sys/pal/unix/args.rs diff --git a/library/std/src/sys/unix/cmath.rs b/library/std/src/sys/pal/unix/cmath.rs similarity index 100% rename from library/std/src/sys/unix/cmath.rs rename to library/std/src/sys/pal/unix/cmath.rs diff --git a/library/std/src/sys/unix/env.rs b/library/std/src/sys/pal/unix/env.rs similarity index 100% rename from library/std/src/sys/unix/env.rs rename to library/std/src/sys/pal/unix/env.rs diff --git a/library/std/src/sys/unix/fd.rs b/library/std/src/sys/pal/unix/fd.rs similarity index 100% rename from library/std/src/sys/unix/fd.rs rename to library/std/src/sys/pal/unix/fd.rs diff --git a/library/std/src/sys/unix/fd/tests.rs b/library/std/src/sys/pal/unix/fd/tests.rs similarity index 100% rename from library/std/src/sys/unix/fd/tests.rs rename to library/std/src/sys/pal/unix/fd/tests.rs diff --git a/library/std/src/sys/unix/fs.rs b/library/std/src/sys/pal/unix/fs.rs similarity index 100% rename from library/std/src/sys/unix/fs.rs rename to library/std/src/sys/pal/unix/fs.rs diff --git a/library/std/src/sys/unix/futex.rs b/library/std/src/sys/pal/unix/futex.rs similarity index 100% rename from library/std/src/sys/unix/futex.rs rename to library/std/src/sys/pal/unix/futex.rs diff --git a/library/std/src/sys/unix/io.rs b/library/std/src/sys/pal/unix/io.rs similarity index 100% rename from library/std/src/sys/unix/io.rs rename to library/std/src/sys/pal/unix/io.rs diff --git a/library/std/src/sys/unix/kernel_copy.rs b/library/std/src/sys/pal/unix/kernel_copy.rs similarity index 100% rename from library/std/src/sys/unix/kernel_copy.rs rename to library/std/src/sys/pal/unix/kernel_copy.rs diff --git a/library/std/src/sys/unix/kernel_copy/tests.rs b/library/std/src/sys/pal/unix/kernel_copy/tests.rs similarity index 100% rename from library/std/src/sys/unix/kernel_copy/tests.rs rename to library/std/src/sys/pal/unix/kernel_copy/tests.rs diff --git a/library/std/src/sys/unix/l4re.rs b/library/std/src/sys/pal/unix/l4re.rs similarity index 100% rename from library/std/src/sys/unix/l4re.rs rename to library/std/src/sys/pal/unix/l4re.rs diff --git a/library/std/src/sys/unix/locks/fuchsia_mutex.rs b/library/std/src/sys/pal/unix/locks/fuchsia_mutex.rs similarity index 100% rename from library/std/src/sys/unix/locks/fuchsia_mutex.rs rename to library/std/src/sys/pal/unix/locks/fuchsia_mutex.rs diff --git a/library/std/src/sys/unix/locks/futex_condvar.rs b/library/std/src/sys/pal/unix/locks/futex_condvar.rs similarity index 100% rename from library/std/src/sys/unix/locks/futex_condvar.rs rename to library/std/src/sys/pal/unix/locks/futex_condvar.rs diff --git a/library/std/src/sys/unix/locks/futex_mutex.rs b/library/std/src/sys/pal/unix/locks/futex_mutex.rs similarity index 100% rename from library/std/src/sys/unix/locks/futex_mutex.rs rename to library/std/src/sys/pal/unix/locks/futex_mutex.rs diff --git a/library/std/src/sys/unix/locks/futex_rwlock.rs b/library/std/src/sys/pal/unix/locks/futex_rwlock.rs similarity index 100% rename from library/std/src/sys/unix/locks/futex_rwlock.rs rename to library/std/src/sys/pal/unix/locks/futex_rwlock.rs diff --git a/library/std/src/sys/unix/locks/mod.rs b/library/std/src/sys/pal/unix/locks/mod.rs similarity index 100% rename from library/std/src/sys/unix/locks/mod.rs rename to library/std/src/sys/pal/unix/locks/mod.rs diff --git a/library/std/src/sys/unix/locks/pthread_condvar.rs b/library/std/src/sys/pal/unix/locks/pthread_condvar.rs similarity index 100% rename from library/std/src/sys/unix/locks/pthread_condvar.rs rename to library/std/src/sys/pal/unix/locks/pthread_condvar.rs diff --git a/library/std/src/sys/unix/locks/pthread_mutex.rs b/library/std/src/sys/pal/unix/locks/pthread_mutex.rs similarity index 100% rename from library/std/src/sys/unix/locks/pthread_mutex.rs rename to library/std/src/sys/pal/unix/locks/pthread_mutex.rs diff --git a/library/std/src/sys/unix/locks/pthread_rwlock.rs b/library/std/src/sys/pal/unix/locks/pthread_rwlock.rs similarity index 100% rename from library/std/src/sys/unix/locks/pthread_rwlock.rs rename to library/std/src/sys/pal/unix/locks/pthread_rwlock.rs diff --git a/library/std/src/sys/unix/memchr.rs b/library/std/src/sys/pal/unix/memchr.rs similarity index 100% rename from library/std/src/sys/unix/memchr.rs rename to library/std/src/sys/pal/unix/memchr.rs diff --git a/library/std/src/sys/unix/mod.rs b/library/std/src/sys/pal/unix/mod.rs similarity index 100% rename from library/std/src/sys/unix/mod.rs rename to library/std/src/sys/pal/unix/mod.rs diff --git a/library/std/src/sys/unix/net.rs b/library/std/src/sys/pal/unix/net.rs similarity index 100% rename from library/std/src/sys/unix/net.rs rename to library/std/src/sys/pal/unix/net.rs diff --git a/library/std/src/sys/unix/os.rs b/library/std/src/sys/pal/unix/os.rs similarity index 100% rename from library/std/src/sys/unix/os.rs rename to library/std/src/sys/pal/unix/os.rs diff --git a/library/std/src/sys/unix/os/tests.rs b/library/std/src/sys/pal/unix/os/tests.rs similarity index 100% rename from library/std/src/sys/unix/os/tests.rs rename to library/std/src/sys/pal/unix/os/tests.rs diff --git a/library/std/src/sys/unix/os_str.rs b/library/std/src/sys/pal/unix/os_str.rs similarity index 100% rename from library/std/src/sys/unix/os_str.rs rename to library/std/src/sys/pal/unix/os_str.rs diff --git a/library/std/src/sys/unix/os_str/tests.rs b/library/std/src/sys/pal/unix/os_str/tests.rs similarity index 100% rename from library/std/src/sys/unix/os_str/tests.rs rename to library/std/src/sys/pal/unix/os_str/tests.rs diff --git a/library/std/src/sys/unix/path.rs b/library/std/src/sys/pal/unix/path.rs similarity index 100% rename from library/std/src/sys/unix/path.rs rename to library/std/src/sys/pal/unix/path.rs diff --git a/library/std/src/sys/unix/pipe.rs b/library/std/src/sys/pal/unix/pipe.rs similarity index 100% rename from library/std/src/sys/unix/pipe.rs rename to library/std/src/sys/pal/unix/pipe.rs diff --git a/library/std/src/sys/unix/process/mod.rs b/library/std/src/sys/pal/unix/process/mod.rs similarity index 100% rename from library/std/src/sys/unix/process/mod.rs rename to library/std/src/sys/pal/unix/process/mod.rs diff --git a/library/std/src/sys/unix/process/process_common.rs b/library/std/src/sys/pal/unix/process/process_common.rs similarity index 100% rename from library/std/src/sys/unix/process/process_common.rs rename to library/std/src/sys/pal/unix/process/process_common.rs diff --git a/library/std/src/sys/unix/process/process_common/tests.rs b/library/std/src/sys/pal/unix/process/process_common/tests.rs similarity index 100% rename from library/std/src/sys/unix/process/process_common/tests.rs rename to library/std/src/sys/pal/unix/process/process_common/tests.rs diff --git a/library/std/src/sys/unix/process/process_fuchsia.rs b/library/std/src/sys/pal/unix/process/process_fuchsia.rs similarity index 100% rename from library/std/src/sys/unix/process/process_fuchsia.rs rename to library/std/src/sys/pal/unix/process/process_fuchsia.rs diff --git a/library/std/src/sys/unix/process/process_unix.rs b/library/std/src/sys/pal/unix/process/process_unix.rs similarity index 100% rename from library/std/src/sys/unix/process/process_unix.rs rename to library/std/src/sys/pal/unix/process/process_unix.rs diff --git a/library/std/src/sys/unix/process/process_unix/tests.rs b/library/std/src/sys/pal/unix/process/process_unix/tests.rs similarity index 100% rename from library/std/src/sys/unix/process/process_unix/tests.rs rename to library/std/src/sys/pal/unix/process/process_unix/tests.rs diff --git a/library/std/src/sys/unix/process/process_unsupported.rs b/library/std/src/sys/pal/unix/process/process_unsupported.rs similarity index 100% rename from library/std/src/sys/unix/process/process_unsupported.rs rename to library/std/src/sys/pal/unix/process/process_unsupported.rs diff --git a/library/std/src/sys/unix/process/process_unsupported/wait_status.rs b/library/std/src/sys/pal/unix/process/process_unsupported/wait_status.rs similarity index 100% rename from library/std/src/sys/unix/process/process_unsupported/wait_status.rs rename to library/std/src/sys/pal/unix/process/process_unsupported/wait_status.rs diff --git a/library/std/src/sys/unix/process/process_unsupported/wait_status/tests.rs b/library/std/src/sys/pal/unix/process/process_unsupported/wait_status/tests.rs similarity index 100% rename from library/std/src/sys/unix/process/process_unsupported/wait_status/tests.rs rename to library/std/src/sys/pal/unix/process/process_unsupported/wait_status/tests.rs diff --git a/library/std/src/sys/unix/process/process_vxworks.rs b/library/std/src/sys/pal/unix/process/process_vxworks.rs similarity index 100% rename from library/std/src/sys/unix/process/process_vxworks.rs rename to library/std/src/sys/pal/unix/process/process_vxworks.rs diff --git a/library/std/src/sys/unix/process/zircon.rs b/library/std/src/sys/pal/unix/process/zircon.rs similarity index 100% rename from library/std/src/sys/unix/process/zircon.rs rename to library/std/src/sys/pal/unix/process/zircon.rs diff --git a/library/std/src/sys/unix/rand.rs b/library/std/src/sys/pal/unix/rand.rs similarity index 100% rename from library/std/src/sys/unix/rand.rs rename to library/std/src/sys/pal/unix/rand.rs diff --git a/library/std/src/sys/unix/stack_overflow.rs b/library/std/src/sys/pal/unix/stack_overflow.rs similarity index 100% rename from library/std/src/sys/unix/stack_overflow.rs rename to library/std/src/sys/pal/unix/stack_overflow.rs diff --git a/library/std/src/sys/unix/stdio.rs b/library/std/src/sys/pal/unix/stdio.rs similarity index 100% rename from library/std/src/sys/unix/stdio.rs rename to library/std/src/sys/pal/unix/stdio.rs diff --git a/library/std/src/sys/unix/thread.rs b/library/std/src/sys/pal/unix/thread.rs similarity index 100% rename from library/std/src/sys/unix/thread.rs rename to library/std/src/sys/pal/unix/thread.rs diff --git a/library/std/src/sys/unix/thread_local_dtor.rs b/library/std/src/sys/pal/unix/thread_local_dtor.rs similarity index 100% rename from library/std/src/sys/unix/thread_local_dtor.rs rename to library/std/src/sys/pal/unix/thread_local_dtor.rs diff --git a/library/std/src/sys/unix/thread_local_key.rs b/library/std/src/sys/pal/unix/thread_local_key.rs similarity index 100% rename from library/std/src/sys/unix/thread_local_key.rs rename to library/std/src/sys/pal/unix/thread_local_key.rs diff --git a/library/std/src/sys/unix/thread_parking/darwin.rs b/library/std/src/sys/pal/unix/thread_parking/darwin.rs similarity index 100% rename from library/std/src/sys/unix/thread_parking/darwin.rs rename to library/std/src/sys/pal/unix/thread_parking/darwin.rs diff --git a/library/std/src/sys/unix/thread_parking/mod.rs b/library/std/src/sys/pal/unix/thread_parking/mod.rs similarity index 100% rename from library/std/src/sys/unix/thread_parking/mod.rs rename to library/std/src/sys/pal/unix/thread_parking/mod.rs diff --git a/library/std/src/sys/unix/thread_parking/netbsd.rs b/library/std/src/sys/pal/unix/thread_parking/netbsd.rs similarity index 100% rename from library/std/src/sys/unix/thread_parking/netbsd.rs rename to library/std/src/sys/pal/unix/thread_parking/netbsd.rs diff --git a/library/std/src/sys/unix/thread_parking/pthread.rs b/library/std/src/sys/pal/unix/thread_parking/pthread.rs similarity index 100% rename from library/std/src/sys/unix/thread_parking/pthread.rs rename to library/std/src/sys/pal/unix/thread_parking/pthread.rs diff --git a/library/std/src/sys/unix/time.rs b/library/std/src/sys/pal/unix/time.rs similarity index 100% rename from library/std/src/sys/unix/time.rs rename to library/std/src/sys/pal/unix/time.rs diff --git a/library/std/src/sys/unix/weak.rs b/library/std/src/sys/pal/unix/weak.rs similarity index 100% rename from library/std/src/sys/unix/weak.rs rename to library/std/src/sys/pal/unix/weak.rs diff --git a/library/std/src/sys/unsupported/alloc.rs b/library/std/src/sys/pal/unsupported/alloc.rs similarity index 100% rename from library/std/src/sys/unsupported/alloc.rs rename to library/std/src/sys/pal/unsupported/alloc.rs diff --git a/library/std/src/sys/unsupported/args.rs b/library/std/src/sys/pal/unsupported/args.rs similarity index 100% rename from library/std/src/sys/unsupported/args.rs rename to library/std/src/sys/pal/unsupported/args.rs diff --git a/library/std/src/sys/unsupported/common.rs b/library/std/src/sys/pal/unsupported/common.rs similarity index 100% rename from library/std/src/sys/unsupported/common.rs rename to library/std/src/sys/pal/unsupported/common.rs diff --git a/library/std/src/sys/unsupported/env.rs b/library/std/src/sys/pal/unsupported/env.rs similarity index 100% rename from library/std/src/sys/unsupported/env.rs rename to library/std/src/sys/pal/unsupported/env.rs diff --git a/library/std/src/sys/unsupported/fs.rs b/library/std/src/sys/pal/unsupported/fs.rs similarity index 100% rename from library/std/src/sys/unsupported/fs.rs rename to library/std/src/sys/pal/unsupported/fs.rs diff --git a/library/std/src/sys/unsupported/io.rs b/library/std/src/sys/pal/unsupported/io.rs similarity index 100% rename from library/std/src/sys/unsupported/io.rs rename to library/std/src/sys/pal/unsupported/io.rs diff --git a/library/std/src/sys/unsupported/locks/condvar.rs b/library/std/src/sys/pal/unsupported/locks/condvar.rs similarity index 100% rename from library/std/src/sys/unsupported/locks/condvar.rs rename to library/std/src/sys/pal/unsupported/locks/condvar.rs diff --git a/library/std/src/sys/unsupported/locks/mod.rs b/library/std/src/sys/pal/unsupported/locks/mod.rs similarity index 100% rename from library/std/src/sys/unsupported/locks/mod.rs rename to library/std/src/sys/pal/unsupported/locks/mod.rs diff --git a/library/std/src/sys/unsupported/locks/mutex.rs b/library/std/src/sys/pal/unsupported/locks/mutex.rs similarity index 100% rename from library/std/src/sys/unsupported/locks/mutex.rs rename to library/std/src/sys/pal/unsupported/locks/mutex.rs diff --git a/library/std/src/sys/unsupported/locks/rwlock.rs b/library/std/src/sys/pal/unsupported/locks/rwlock.rs similarity index 100% rename from library/std/src/sys/unsupported/locks/rwlock.rs rename to library/std/src/sys/pal/unsupported/locks/rwlock.rs diff --git a/library/std/src/sys/unsupported/mod.rs b/library/std/src/sys/pal/unsupported/mod.rs similarity index 100% rename from library/std/src/sys/unsupported/mod.rs rename to library/std/src/sys/pal/unsupported/mod.rs diff --git a/library/std/src/sys/unsupported/net.rs b/library/std/src/sys/pal/unsupported/net.rs similarity index 100% rename from library/std/src/sys/unsupported/net.rs rename to library/std/src/sys/pal/unsupported/net.rs diff --git a/library/std/src/sys/unsupported/once.rs b/library/std/src/sys/pal/unsupported/once.rs similarity index 100% rename from library/std/src/sys/unsupported/once.rs rename to library/std/src/sys/pal/unsupported/once.rs diff --git a/library/std/src/sys/unsupported/os.rs b/library/std/src/sys/pal/unsupported/os.rs similarity index 100% rename from library/std/src/sys/unsupported/os.rs rename to library/std/src/sys/pal/unsupported/os.rs diff --git a/library/std/src/sys/unsupported/pipe.rs b/library/std/src/sys/pal/unsupported/pipe.rs similarity index 100% rename from library/std/src/sys/unsupported/pipe.rs rename to library/std/src/sys/pal/unsupported/pipe.rs diff --git a/library/std/src/sys/unsupported/process.rs b/library/std/src/sys/pal/unsupported/process.rs similarity index 100% rename from library/std/src/sys/unsupported/process.rs rename to library/std/src/sys/pal/unsupported/process.rs diff --git a/library/std/src/sys/unsupported/stdio.rs b/library/std/src/sys/pal/unsupported/stdio.rs similarity index 100% rename from library/std/src/sys/unsupported/stdio.rs rename to library/std/src/sys/pal/unsupported/stdio.rs diff --git a/library/std/src/sys/unsupported/thread.rs b/library/std/src/sys/pal/unsupported/thread.rs similarity index 100% rename from library/std/src/sys/unsupported/thread.rs rename to library/std/src/sys/pal/unsupported/thread.rs diff --git a/library/std/src/sys/unsupported/thread_local_dtor.rs b/library/std/src/sys/pal/unsupported/thread_local_dtor.rs similarity index 100% rename from library/std/src/sys/unsupported/thread_local_dtor.rs rename to library/std/src/sys/pal/unsupported/thread_local_dtor.rs diff --git a/library/std/src/sys/unsupported/thread_local_key.rs b/library/std/src/sys/pal/unsupported/thread_local_key.rs similarity index 100% rename from library/std/src/sys/unsupported/thread_local_key.rs rename to library/std/src/sys/pal/unsupported/thread_local_key.rs diff --git a/library/std/src/sys/unsupported/thread_parking.rs b/library/std/src/sys/pal/unsupported/thread_parking.rs similarity index 100% rename from library/std/src/sys/unsupported/thread_parking.rs rename to library/std/src/sys/pal/unsupported/thread_parking.rs diff --git a/library/std/src/sys/unsupported/time.rs b/library/std/src/sys/pal/unsupported/time.rs similarity index 100% rename from library/std/src/sys/unsupported/time.rs rename to library/std/src/sys/pal/unsupported/time.rs diff --git a/library/std/src/sys/wasi/args.rs b/library/std/src/sys/pal/wasi/args.rs similarity index 100% rename from library/std/src/sys/wasi/args.rs rename to library/std/src/sys/pal/wasi/args.rs diff --git a/library/std/src/sys/wasi/env.rs b/library/std/src/sys/pal/wasi/env.rs similarity index 100% rename from library/std/src/sys/wasi/env.rs rename to library/std/src/sys/pal/wasi/env.rs diff --git a/library/std/src/sys/wasi/fd.rs b/library/std/src/sys/pal/wasi/fd.rs similarity index 100% rename from library/std/src/sys/wasi/fd.rs rename to library/std/src/sys/pal/wasi/fd.rs diff --git a/library/std/src/sys/wasi/fs.rs b/library/std/src/sys/pal/wasi/fs.rs similarity index 100% rename from library/std/src/sys/wasi/fs.rs rename to library/std/src/sys/pal/wasi/fs.rs diff --git a/library/std/src/sys/wasi/io.rs b/library/std/src/sys/pal/wasi/io.rs similarity index 100% rename from library/std/src/sys/wasi/io.rs rename to library/std/src/sys/pal/wasi/io.rs diff --git a/library/std/src/sys/wasi/mod.rs b/library/std/src/sys/pal/wasi/mod.rs similarity index 100% rename from library/std/src/sys/wasi/mod.rs rename to library/std/src/sys/pal/wasi/mod.rs diff --git a/library/std/src/sys/wasi/net.rs b/library/std/src/sys/pal/wasi/net.rs similarity index 100% rename from library/std/src/sys/wasi/net.rs rename to library/std/src/sys/pal/wasi/net.rs diff --git a/library/std/src/sys/wasi/os.rs b/library/std/src/sys/pal/wasi/os.rs similarity index 100% rename from library/std/src/sys/wasi/os.rs rename to library/std/src/sys/pal/wasi/os.rs diff --git a/library/std/src/sys/wasi/stdio.rs b/library/std/src/sys/pal/wasi/stdio.rs similarity index 100% rename from library/std/src/sys/wasi/stdio.rs rename to library/std/src/sys/pal/wasi/stdio.rs diff --git a/library/std/src/sys/wasi/thread.rs b/library/std/src/sys/pal/wasi/thread.rs similarity index 100% rename from library/std/src/sys/wasi/thread.rs rename to library/std/src/sys/pal/wasi/thread.rs diff --git a/library/std/src/sys/wasi/time.rs b/library/std/src/sys/pal/wasi/time.rs similarity index 100% rename from library/std/src/sys/wasi/time.rs rename to library/std/src/sys/pal/wasi/time.rs diff --git a/library/std/src/sys/wasm/alloc.rs b/library/std/src/sys/pal/wasm/alloc.rs similarity index 100% rename from library/std/src/sys/wasm/alloc.rs rename to library/std/src/sys/pal/wasm/alloc.rs diff --git a/library/std/src/sys/wasm/atomics/futex.rs b/library/std/src/sys/pal/wasm/atomics/futex.rs similarity index 100% rename from library/std/src/sys/wasm/atomics/futex.rs rename to library/std/src/sys/pal/wasm/atomics/futex.rs diff --git a/library/std/src/sys/wasm/atomics/thread.rs b/library/std/src/sys/pal/wasm/atomics/thread.rs similarity index 100% rename from library/std/src/sys/wasm/atomics/thread.rs rename to library/std/src/sys/pal/wasm/atomics/thread.rs diff --git a/library/std/src/sys/wasm/env.rs b/library/std/src/sys/pal/wasm/env.rs similarity index 100% rename from library/std/src/sys/wasm/env.rs rename to library/std/src/sys/pal/wasm/env.rs diff --git a/library/std/src/sys/wasm/mod.rs b/library/std/src/sys/pal/wasm/mod.rs similarity index 100% rename from library/std/src/sys/wasm/mod.rs rename to library/std/src/sys/pal/wasm/mod.rs diff --git a/library/std/src/sys/windows/alloc.rs b/library/std/src/sys/pal/windows/alloc.rs similarity index 100% rename from library/std/src/sys/windows/alloc.rs rename to library/std/src/sys/pal/windows/alloc.rs diff --git a/library/std/src/sys/windows/alloc/tests.rs b/library/std/src/sys/pal/windows/alloc/tests.rs similarity index 100% rename from library/std/src/sys/windows/alloc/tests.rs rename to library/std/src/sys/pal/windows/alloc/tests.rs diff --git a/library/std/src/sys/windows/api.rs b/library/std/src/sys/pal/windows/api.rs similarity index 100% rename from library/std/src/sys/windows/api.rs rename to library/std/src/sys/pal/windows/api.rs diff --git a/library/std/src/sys/windows/args.rs b/library/std/src/sys/pal/windows/args.rs similarity index 100% rename from library/std/src/sys/windows/args.rs rename to library/std/src/sys/pal/windows/args.rs diff --git a/library/std/src/sys/windows/args/tests.rs b/library/std/src/sys/pal/windows/args/tests.rs similarity index 100% rename from library/std/src/sys/windows/args/tests.rs rename to library/std/src/sys/pal/windows/args/tests.rs diff --git a/library/std/src/sys/windows/c.rs b/library/std/src/sys/pal/windows/c.rs similarity index 100% rename from library/std/src/sys/windows/c.rs rename to library/std/src/sys/pal/windows/c.rs diff --git a/library/std/src/sys/windows/c/windows_sys.lst b/library/std/src/sys/pal/windows/c/windows_sys.lst similarity index 100% rename from library/std/src/sys/windows/c/windows_sys.lst rename to library/std/src/sys/pal/windows/c/windows_sys.lst diff --git a/library/std/src/sys/windows/c/windows_sys.rs b/library/std/src/sys/pal/windows/c/windows_sys.rs similarity index 100% rename from library/std/src/sys/windows/c/windows_sys.rs rename to library/std/src/sys/pal/windows/c/windows_sys.rs diff --git a/library/std/src/sys/windows/cmath.rs b/library/std/src/sys/pal/windows/cmath.rs similarity index 100% rename from library/std/src/sys/windows/cmath.rs rename to library/std/src/sys/pal/windows/cmath.rs diff --git a/library/std/src/sys/windows/compat.rs b/library/std/src/sys/pal/windows/compat.rs similarity index 100% rename from library/std/src/sys/windows/compat.rs rename to library/std/src/sys/pal/windows/compat.rs diff --git a/library/std/src/sys/windows/env.rs b/library/std/src/sys/pal/windows/env.rs similarity index 100% rename from library/std/src/sys/windows/env.rs rename to library/std/src/sys/pal/windows/env.rs diff --git a/library/std/src/sys/windows/fs.rs b/library/std/src/sys/pal/windows/fs.rs similarity index 100% rename from library/std/src/sys/windows/fs.rs rename to library/std/src/sys/pal/windows/fs.rs diff --git a/library/std/src/sys/windows/handle.rs b/library/std/src/sys/pal/windows/handle.rs similarity index 100% rename from library/std/src/sys/windows/handle.rs rename to library/std/src/sys/pal/windows/handle.rs diff --git a/library/std/src/sys/windows/handle/tests.rs b/library/std/src/sys/pal/windows/handle/tests.rs similarity index 100% rename from library/std/src/sys/windows/handle/tests.rs rename to library/std/src/sys/pal/windows/handle/tests.rs diff --git a/library/std/src/sys/windows/io.rs b/library/std/src/sys/pal/windows/io.rs similarity index 100% rename from library/std/src/sys/windows/io.rs rename to library/std/src/sys/pal/windows/io.rs diff --git a/library/std/src/sys/windows/locks/condvar.rs b/library/std/src/sys/pal/windows/locks/condvar.rs similarity index 100% rename from library/std/src/sys/windows/locks/condvar.rs rename to library/std/src/sys/pal/windows/locks/condvar.rs diff --git a/library/std/src/sys/windows/locks/mod.rs b/library/std/src/sys/pal/windows/locks/mod.rs similarity index 100% rename from library/std/src/sys/windows/locks/mod.rs rename to library/std/src/sys/pal/windows/locks/mod.rs diff --git a/library/std/src/sys/windows/locks/mutex.rs b/library/std/src/sys/pal/windows/locks/mutex.rs similarity index 100% rename from library/std/src/sys/windows/locks/mutex.rs rename to library/std/src/sys/pal/windows/locks/mutex.rs diff --git a/library/std/src/sys/windows/locks/rwlock.rs b/library/std/src/sys/pal/windows/locks/rwlock.rs similarity index 100% rename from library/std/src/sys/windows/locks/rwlock.rs rename to library/std/src/sys/pal/windows/locks/rwlock.rs diff --git a/library/std/src/sys/windows/memchr.rs b/library/std/src/sys/pal/windows/memchr.rs similarity index 100% rename from library/std/src/sys/windows/memchr.rs rename to library/std/src/sys/pal/windows/memchr.rs diff --git a/library/std/src/sys/windows/mod.rs b/library/std/src/sys/pal/windows/mod.rs similarity index 100% rename from library/std/src/sys/windows/mod.rs rename to library/std/src/sys/pal/windows/mod.rs diff --git a/library/std/src/sys/windows/net.rs b/library/std/src/sys/pal/windows/net.rs similarity index 100% rename from library/std/src/sys/windows/net.rs rename to library/std/src/sys/pal/windows/net.rs diff --git a/library/std/src/sys/windows/os.rs b/library/std/src/sys/pal/windows/os.rs similarity index 100% rename from library/std/src/sys/windows/os.rs rename to library/std/src/sys/pal/windows/os.rs diff --git a/library/std/src/sys/windows/os/tests.rs b/library/std/src/sys/pal/windows/os/tests.rs similarity index 100% rename from library/std/src/sys/windows/os/tests.rs rename to library/std/src/sys/pal/windows/os/tests.rs diff --git a/library/std/src/sys/windows/os_str.rs b/library/std/src/sys/pal/windows/os_str.rs similarity index 100% rename from library/std/src/sys/windows/os_str.rs rename to library/std/src/sys/pal/windows/os_str.rs diff --git a/library/std/src/sys/windows/path.rs b/library/std/src/sys/pal/windows/path.rs similarity index 100% rename from library/std/src/sys/windows/path.rs rename to library/std/src/sys/pal/windows/path.rs diff --git a/library/std/src/sys/windows/path/tests.rs b/library/std/src/sys/pal/windows/path/tests.rs similarity index 100% rename from library/std/src/sys/windows/path/tests.rs rename to library/std/src/sys/pal/windows/path/tests.rs diff --git a/library/std/src/sys/windows/pipe.rs b/library/std/src/sys/pal/windows/pipe.rs similarity index 100% rename from library/std/src/sys/windows/pipe.rs rename to library/std/src/sys/pal/windows/pipe.rs diff --git a/library/std/src/sys/windows/process.rs b/library/std/src/sys/pal/windows/process.rs similarity index 100% rename from library/std/src/sys/windows/process.rs rename to library/std/src/sys/pal/windows/process.rs diff --git a/library/std/src/sys/windows/process/tests.rs b/library/std/src/sys/pal/windows/process/tests.rs similarity index 100% rename from library/std/src/sys/windows/process/tests.rs rename to library/std/src/sys/pal/windows/process/tests.rs diff --git a/library/std/src/sys/windows/rand.rs b/library/std/src/sys/pal/windows/rand.rs similarity index 100% rename from library/std/src/sys/windows/rand.rs rename to library/std/src/sys/pal/windows/rand.rs diff --git a/library/std/src/sys/windows/stack_overflow.rs b/library/std/src/sys/pal/windows/stack_overflow.rs similarity index 100% rename from library/std/src/sys/windows/stack_overflow.rs rename to library/std/src/sys/pal/windows/stack_overflow.rs diff --git a/library/std/src/sys/windows/stack_overflow_uwp.rs b/library/std/src/sys/pal/windows/stack_overflow_uwp.rs similarity index 100% rename from library/std/src/sys/windows/stack_overflow_uwp.rs rename to library/std/src/sys/pal/windows/stack_overflow_uwp.rs diff --git a/library/std/src/sys/windows/stdio.rs b/library/std/src/sys/pal/windows/stdio.rs similarity index 100% rename from library/std/src/sys/windows/stdio.rs rename to library/std/src/sys/pal/windows/stdio.rs diff --git a/library/std/src/sys/windows/stdio/tests.rs b/library/std/src/sys/pal/windows/stdio/tests.rs similarity index 100% rename from library/std/src/sys/windows/stdio/tests.rs rename to library/std/src/sys/pal/windows/stdio/tests.rs diff --git a/library/std/src/sys/windows/thread.rs b/library/std/src/sys/pal/windows/thread.rs similarity index 100% rename from library/std/src/sys/windows/thread.rs rename to library/std/src/sys/pal/windows/thread.rs diff --git a/library/std/src/sys/windows/thread_local_dtor.rs b/library/std/src/sys/pal/windows/thread_local_dtor.rs similarity index 100% rename from library/std/src/sys/windows/thread_local_dtor.rs rename to library/std/src/sys/pal/windows/thread_local_dtor.rs diff --git a/library/std/src/sys/windows/thread_local_key.rs b/library/std/src/sys/pal/windows/thread_local_key.rs similarity index 100% rename from library/std/src/sys/windows/thread_local_key.rs rename to library/std/src/sys/pal/windows/thread_local_key.rs diff --git a/library/std/src/sys/windows/thread_local_key/tests.rs b/library/std/src/sys/pal/windows/thread_local_key/tests.rs similarity index 100% rename from library/std/src/sys/windows/thread_local_key/tests.rs rename to library/std/src/sys/pal/windows/thread_local_key/tests.rs diff --git a/library/std/src/sys/windows/thread_parking.rs b/library/std/src/sys/pal/windows/thread_parking.rs similarity index 100% rename from library/std/src/sys/windows/thread_parking.rs rename to library/std/src/sys/pal/windows/thread_parking.rs diff --git a/library/std/src/sys/windows/time.rs b/library/std/src/sys/pal/windows/time.rs similarity index 100% rename from library/std/src/sys/windows/time.rs rename to library/std/src/sys/pal/windows/time.rs diff --git a/library/std/src/sys/xous/alloc.rs b/library/std/src/sys/pal/xous/alloc.rs similarity index 100% rename from library/std/src/sys/xous/alloc.rs rename to library/std/src/sys/pal/xous/alloc.rs diff --git a/library/std/src/sys/xous/locks/condvar.rs b/library/std/src/sys/pal/xous/locks/condvar.rs similarity index 100% rename from library/std/src/sys/xous/locks/condvar.rs rename to library/std/src/sys/pal/xous/locks/condvar.rs diff --git a/library/std/src/sys/xous/locks/mod.rs b/library/std/src/sys/pal/xous/locks/mod.rs similarity index 100% rename from library/std/src/sys/xous/locks/mod.rs rename to library/std/src/sys/pal/xous/locks/mod.rs diff --git a/library/std/src/sys/xous/locks/mutex.rs b/library/std/src/sys/pal/xous/locks/mutex.rs similarity index 100% rename from library/std/src/sys/xous/locks/mutex.rs rename to library/std/src/sys/pal/xous/locks/mutex.rs diff --git a/library/std/src/sys/xous/locks/rwlock.rs b/library/std/src/sys/pal/xous/locks/rwlock.rs similarity index 100% rename from library/std/src/sys/xous/locks/rwlock.rs rename to library/std/src/sys/pal/xous/locks/rwlock.rs diff --git a/library/std/src/sys/xous/mod.rs b/library/std/src/sys/pal/xous/mod.rs similarity index 100% rename from library/std/src/sys/xous/mod.rs rename to library/std/src/sys/pal/xous/mod.rs diff --git a/library/std/src/sys/xous/os.rs b/library/std/src/sys/pal/xous/os.rs similarity index 100% rename from library/std/src/sys/xous/os.rs rename to library/std/src/sys/pal/xous/os.rs diff --git a/library/std/src/sys/xous/stdio.rs b/library/std/src/sys/pal/xous/stdio.rs similarity index 100% rename from library/std/src/sys/xous/stdio.rs rename to library/std/src/sys/pal/xous/stdio.rs diff --git a/library/std/src/sys/xous/thread.rs b/library/std/src/sys/pal/xous/thread.rs similarity index 100% rename from library/std/src/sys/xous/thread.rs rename to library/std/src/sys/pal/xous/thread.rs diff --git a/library/std/src/sys/xous/thread_local_key.rs b/library/std/src/sys/pal/xous/thread_local_key.rs similarity index 100% rename from library/std/src/sys/xous/thread_local_key.rs rename to library/std/src/sys/pal/xous/thread_local_key.rs diff --git a/library/std/src/sys/xous/thread_parking.rs b/library/std/src/sys/pal/xous/thread_parking.rs similarity index 100% rename from library/std/src/sys/xous/thread_parking.rs rename to library/std/src/sys/pal/xous/thread_parking.rs diff --git a/library/std/src/sys/xous/time.rs b/library/std/src/sys/pal/xous/time.rs similarity index 100% rename from library/std/src/sys/xous/time.rs rename to library/std/src/sys/pal/xous/time.rs