about summary refs log tree commit diff
path: root/library/std/src/sys
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2024-01-13 14:10:56 +0000
committerbors <bors@rust-lang.org>2024-01-13 14:10:56 +0000
commit1d8d7b16cbcd048e98359cd0d42b03bc1710cca8 (patch)
tree22d82c53b09b63db2478960e44a97cbe830a917d /library/std/src/sys
parent284cb714d2bf54b1af41dbc18469b478bc6f6489 (diff)
parent0cfc995814601cbaca2542ffa8b9bc5c44ea4fed (diff)
downloadrust-1d8d7b16cbcd048e98359cd0d42b03bc1710cca8.tar.gz
rust-1d8d7b16cbcd048e98359cd0d42b03bc1710cca8.zip
Auto merge of #117285 - joboet:move_platforms_to_pal, r=ChrisDenton
Move platform modules into `sys::pal`

This is the initial step of #117276. `sys` just re-exports everything from the current `sys` for now, I'll move the implementations for the individual features one-by-one after this PR merges.
Diffstat (limited to 'library/std/src/sys')
-rw-r--r--library/std/src/sys/mod.rs132
-rw-r--r--library/std/src/sys/pal/common/alloc.rs (renamed from library/std/src/sys/common/alloc.rs)0
-rw-r--r--library/std/src/sys/pal/common/mod.rs (renamed from library/std/src/sys/common/mod.rs)0
-rw-r--r--library/std/src/sys/pal/common/small_c_string.rs (renamed from library/std/src/sys/common/small_c_string.rs)0
-rw-r--r--library/std/src/sys/pal/common/tests.rs (renamed from library/std/src/sys/common/tests.rs)0
-rw-r--r--library/std/src/sys/pal/common/thread_local/fast_local.rs (renamed from library/std/src/sys/common/thread_local/fast_local.rs)0
-rw-r--r--library/std/src/sys/pal/common/thread_local/mod.rs (renamed from library/std/src/sys/common/thread_local/mod.rs)0
-rw-r--r--library/std/src/sys/pal/common/thread_local/os_local.rs (renamed from library/std/src/sys/common/thread_local/os_local.rs)0
-rw-r--r--library/std/src/sys/pal/common/thread_local/static_local.rs (renamed from library/std/src/sys/common/thread_local/static_local.rs)0
-rw-r--r--library/std/src/sys/pal/hermit/alloc.rs (renamed from library/std/src/sys/hermit/alloc.rs)2
-rw-r--r--library/std/src/sys/pal/hermit/args.rs (renamed from library/std/src/sys/hermit/args.rs)0
-rw-r--r--library/std/src/sys/pal/hermit/env.rs (renamed from library/std/src/sys/hermit/env.rs)0
-rw-r--r--library/std/src/sys/pal/hermit/fd.rs (renamed from library/std/src/sys/hermit/fd.rs)2
-rw-r--r--library/std/src/sys/pal/hermit/fs.rs (renamed from library/std/src/sys/hermit/fs.rs)6
-rw-r--r--library/std/src/sys/pal/hermit/futex.rs (renamed from library/std/src/sys/hermit/futex.rs)0
-rw-r--r--library/std/src/sys/pal/hermit/memchr.rs (renamed from library/std/src/sys/hermit/memchr.rs)0
-rw-r--r--library/std/src/sys/pal/hermit/mod.rs (renamed from library/std/src/sys/hermit/mod.rs)2
-rw-r--r--library/std/src/sys/pal/hermit/net.rs (renamed from library/std/src/sys/hermit/net.rs)2
-rw-r--r--library/std/src/sys/pal/hermit/os.rs (renamed from library/std/src/sys/hermit/os.rs)2
-rw-r--r--library/std/src/sys/pal/hermit/stdio.rs (renamed from library/std/src/sys/hermit/stdio.rs)2
-rw-r--r--library/std/src/sys/pal/hermit/thread.rs (renamed from library/std/src/sys/hermit/thread.rs)4
-rw-r--r--library/std/src/sys/pal/hermit/thread_local_dtor.rs (renamed from library/std/src/sys/hermit/thread_local_dtor.rs)0
-rw-r--r--library/std/src/sys/pal/hermit/time.rs (renamed from library/std/src/sys/hermit/time.rs)6
-rw-r--r--library/std/src/sys/pal/itron/abi.rs (renamed from library/std/src/sys/itron/abi.rs)0
-rw-r--r--library/std/src/sys/pal/itron/condvar.rs (renamed from library/std/src/sys/itron/condvar.rs)0
-rw-r--r--library/std/src/sys/pal/itron/error.rs (renamed from library/std/src/sys/itron/error.rs)0
-rw-r--r--library/std/src/sys/pal/itron/mutex.rs (renamed from library/std/src/sys/itron/mutex.rs)0
-rw-r--r--library/std/src/sys/pal/itron/spin.rs (renamed from library/std/src/sys/itron/spin.rs)0
-rw-r--r--library/std/src/sys/pal/itron/task.rs (renamed from library/std/src/sys/itron/task.rs)0
-rw-r--r--library/std/src/sys/pal/itron/thread.rs (renamed from library/std/src/sys/itron/thread.rs)0
-rw-r--r--library/std/src/sys/pal/itron/thread_parking.rs (renamed from library/std/src/sys/itron/thread_parking.rs)0
-rw-r--r--library/std/src/sys/pal/itron/time.rs (renamed from library/std/src/sys/itron/time.rs)0
-rw-r--r--library/std/src/sys/pal/itron/time/tests.rs (renamed from library/std/src/sys/itron/time/tests.rs)0
-rw-r--r--library/std/src/sys/pal/mod.rs124
-rw-r--r--library/std/src/sys/pal/personality/dwarf/eh.rs (renamed from library/std/src/sys/personality/dwarf/eh.rs)0
-rw-r--r--library/std/src/sys/pal/personality/dwarf/mod.rs (renamed from library/std/src/sys/personality/dwarf/mod.rs)0
-rw-r--r--library/std/src/sys/pal/personality/dwarf/tests.rs (renamed from library/std/src/sys/personality/dwarf/tests.rs)0
-rw-r--r--library/std/src/sys/pal/personality/emcc.rs (renamed from library/std/src/sys/personality/emcc.rs)0
-rw-r--r--library/std/src/sys/pal/personality/gcc.rs (renamed from library/std/src/sys/personality/gcc.rs)0
-rw-r--r--library/std/src/sys/pal/personality/mod.rs (renamed from library/std/src/sys/personality/mod.rs)0
-rw-r--r--library/std/src/sys/pal/sgx/abi/entry.S (renamed from library/std/src/sys/sgx/abi/entry.S)0
-rw-r--r--library/std/src/sys/pal/sgx/abi/mem.rs (renamed from library/std/src/sys/sgx/abi/mem.rs)0
-rw-r--r--library/std/src/sys/pal/sgx/abi/mod.rs (renamed from library/std/src/sys/sgx/abi/mod.rs)0
-rw-r--r--library/std/src/sys/pal/sgx/abi/panic.rs (renamed from library/std/src/sys/sgx/abi/panic.rs)0
-rw-r--r--library/std/src/sys/pal/sgx/abi/reloc.rs (renamed from library/std/src/sys/sgx/abi/reloc.rs)0
-rw-r--r--library/std/src/sys/pal/sgx/abi/thread.rs (renamed from library/std/src/sys/sgx/abi/thread.rs)0
-rw-r--r--library/std/src/sys/pal/sgx/abi/tls/mod.rs (renamed from library/std/src/sys/sgx/abi/tls/mod.rs)0
-rw-r--r--library/std/src/sys/pal/sgx/abi/tls/sync_bitset.rs (renamed from library/std/src/sys/sgx/abi/tls/sync_bitset.rs)0
-rw-r--r--library/std/src/sys/pal/sgx/abi/tls/sync_bitset/tests.rs (renamed from library/std/src/sys/sgx/abi/tls/sync_bitset/tests.rs)0
-rw-r--r--library/std/src/sys/pal/sgx/abi/usercalls/alloc.rs (renamed from library/std/src/sys/sgx/abi/usercalls/alloc.rs)0
-rw-r--r--library/std/src/sys/pal/sgx/abi/usercalls/mod.rs (renamed from library/std/src/sys/sgx/abi/usercalls/mod.rs)0
-rw-r--r--library/std/src/sys/pal/sgx/abi/usercalls/raw.rs (renamed from library/std/src/sys/sgx/abi/usercalls/raw.rs)0
-rw-r--r--library/std/src/sys/pal/sgx/abi/usercalls/tests.rs (renamed from library/std/src/sys/sgx/abi/usercalls/tests.rs)0
-rw-r--r--library/std/src/sys/pal/sgx/alloc.rs (renamed from library/std/src/sys/sgx/alloc.rs)2
-rw-r--r--library/std/src/sys/pal/sgx/args.rs (renamed from library/std/src/sys/sgx/args.rs)0
-rw-r--r--library/std/src/sys/pal/sgx/condvar.rs (renamed from library/std/src/sys/sgx/condvar.rs)0
-rw-r--r--library/std/src/sys/pal/sgx/env.rs (renamed from library/std/src/sys/sgx/env.rs)0
-rw-r--r--library/std/src/sys/pal/sgx/fd.rs (renamed from library/std/src/sys/sgx/fd.rs)0
-rw-r--r--library/std/src/sys/pal/sgx/memchr.rs (renamed from library/std/src/sys/sgx/memchr.rs)0
-rw-r--r--library/std/src/sys/pal/sgx/mod.rs (renamed from library/std/src/sys/sgx/mod.rs)0
-rw-r--r--library/std/src/sys/pal/sgx/mutex.rs (renamed from library/std/src/sys/sgx/mutex.rs)0
-rw-r--r--library/std/src/sys/pal/sgx/net.rs (renamed from library/std/src/sys/sgx/net.rs)0
-rw-r--r--library/std/src/sys/pal/sgx/os.rs (renamed from library/std/src/sys/sgx/os.rs)0
-rw-r--r--library/std/src/sys/pal/sgx/path.rs (renamed from library/std/src/sys/sgx/path.rs)0
-rw-r--r--library/std/src/sys/pal/sgx/rwlock.rs (renamed from library/std/src/sys/sgx/rwlock.rs)0
-rw-r--r--library/std/src/sys/pal/sgx/rwlock/tests.rs (renamed from library/std/src/sys/sgx/rwlock/tests.rs)0
-rw-r--r--library/std/src/sys/pal/sgx/stdio.rs (renamed from library/std/src/sys/sgx/stdio.rs)0
-rw-r--r--library/std/src/sys/pal/sgx/thread.rs (renamed from library/std/src/sys/sgx/thread.rs)0
-rw-r--r--library/std/src/sys/pal/sgx/thread_local_key.rs (renamed from library/std/src/sys/sgx/thread_local_key.rs)0
-rw-r--r--library/std/src/sys/pal/sgx/thread_parking.rs (renamed from library/std/src/sys/sgx/thread_parking.rs)0
-rw-r--r--library/std/src/sys/pal/sgx/time.rs (renamed from library/std/src/sys/sgx/time.rs)0
-rw-r--r--library/std/src/sys/pal/sgx/waitqueue/mod.rs (renamed from library/std/src/sys/sgx/waitqueue/mod.rs)0
-rw-r--r--library/std/src/sys/pal/sgx/waitqueue/spin_mutex.rs (renamed from library/std/src/sys/sgx/waitqueue/spin_mutex.rs)0
-rw-r--r--library/std/src/sys/pal/sgx/waitqueue/spin_mutex/tests.rs (renamed from library/std/src/sys/sgx/waitqueue/spin_mutex/tests.rs)0
-rw-r--r--library/std/src/sys/pal/sgx/waitqueue/tests.rs (renamed from library/std/src/sys/sgx/waitqueue/tests.rs)0
-rw-r--r--library/std/src/sys/pal/sgx/waitqueue/unsafe_list.rs (renamed from library/std/src/sys/sgx/waitqueue/unsafe_list.rs)0
-rw-r--r--library/std/src/sys/pal/sgx/waitqueue/unsafe_list/tests.rs (renamed from library/std/src/sys/sgx/waitqueue/unsafe_list/tests.rs)0
-rw-r--r--library/std/src/sys/pal/solid/abi/fs.rs (renamed from library/std/src/sys/solid/abi/fs.rs)0
-rw-r--r--library/std/src/sys/pal/solid/abi/mod.rs (renamed from library/std/src/sys/solid/abi/mod.rs)0
-rw-r--r--library/std/src/sys/pal/solid/abi/sockets.rs (renamed from library/std/src/sys/solid/abi/sockets.rs)0
-rw-r--r--library/std/src/sys/pal/solid/alloc.rs (renamed from library/std/src/sys/solid/alloc.rs)0
-rw-r--r--library/std/src/sys/pal/solid/env.rs (renamed from library/std/src/sys/solid/env.rs)0
-rw-r--r--library/std/src/sys/pal/solid/error.rs (renamed from library/std/src/sys/solid/error.rs)0
-rw-r--r--library/std/src/sys/pal/solid/fs.rs (renamed from library/std/src/sys/solid/fs.rs)0
-rw-r--r--library/std/src/sys/pal/solid/io.rs (renamed from library/std/src/sys/solid/io.rs)0
-rw-r--r--library/std/src/sys/pal/solid/memchr.rs (renamed from library/std/src/sys/solid/memchr.rs)0
-rw-r--r--library/std/src/sys/pal/solid/mod.rs (renamed from library/std/src/sys/solid/mod.rs)0
-rw-r--r--library/std/src/sys/pal/solid/net.rs (renamed from library/std/src/sys/solid/net.rs)2
-rw-r--r--library/std/src/sys/pal/solid/os.rs (renamed from library/std/src/sys/solid/os.rs)0
-rw-r--r--library/std/src/sys/pal/solid/path.rs (renamed from library/std/src/sys/solid/path.rs)0
-rw-r--r--library/std/src/sys/pal/solid/rwlock.rs (renamed from library/std/src/sys/solid/rwlock.rs)0
-rw-r--r--library/std/src/sys/pal/solid/stdio.rs (renamed from library/std/src/sys/solid/stdio.rs)0
-rw-r--r--library/std/src/sys/pal/solid/thread_local_dtor.rs (renamed from library/std/src/sys/solid/thread_local_dtor.rs)0
-rw-r--r--library/std/src/sys/pal/solid/thread_local_key.rs (renamed from library/std/src/sys/solid/thread_local_key.rs)0
-rw-r--r--library/std/src/sys/pal/solid/time.rs (renamed from library/std/src/sys/solid/time.rs)0
-rw-r--r--library/std/src/sys/pal/teeos/alloc.rs (renamed from library/std/src/sys/teeos/alloc.rs)0
-rw-r--r--library/std/src/sys/pal/teeos/locks/condvar.rs (renamed from library/std/src/sys/teeos/locks/condvar.rs)0
-rw-r--r--library/std/src/sys/pal/teeos/locks/mod.rs (renamed from library/std/src/sys/teeos/locks/mod.rs)0
-rw-r--r--library/std/src/sys/pal/teeos/locks/rwlock.rs (renamed from library/std/src/sys/teeos/locks/rwlock.rs)0
-rw-r--r--library/std/src/sys/pal/teeos/mod.rs (renamed from library/std/src/sys/teeos/mod.rs)0
-rw-r--r--library/std/src/sys/pal/teeos/net.rs (renamed from library/std/src/sys/teeos/net.rs)0
-rw-r--r--library/std/src/sys/pal/teeos/os.rs (renamed from library/std/src/sys/teeos/os.rs)0
-rw-r--r--library/std/src/sys/pal/teeos/rand.rs (renamed from library/std/src/sys/teeos/rand.rs)0
-rw-r--r--library/std/src/sys/pal/teeos/stdio.rs (renamed from library/std/src/sys/teeos/stdio.rs)0
-rw-r--r--library/std/src/sys/pal/teeos/thread.rs (renamed from library/std/src/sys/teeos/thread.rs)0
-rw-r--r--library/std/src/sys/pal/teeos/thread_local_dtor.rs (renamed from library/std/src/sys/teeos/thread_local_dtor.rs)0
-rw-r--r--library/std/src/sys/pal/uefi/alloc.rs (renamed from library/std/src/sys/uefi/alloc.rs)2
-rw-r--r--library/std/src/sys/pal/uefi/args.rs (renamed from library/std/src/sys/uefi/args.rs)2
-rw-r--r--library/std/src/sys/pal/uefi/env.rs (renamed from library/std/src/sys/uefi/env.rs)0
-rw-r--r--library/std/src/sys/pal/uefi/helpers.rs (renamed from library/std/src/sys/uefi/helpers.rs)0
-rw-r--r--library/std/src/sys/pal/uefi/mod.rs (renamed from library/std/src/sys/uefi/mod.rs)0
-rw-r--r--library/std/src/sys/pal/uefi/os.rs (renamed from library/std/src/sys/uefi/os.rs)0
-rw-r--r--library/std/src/sys/pal/uefi/path.rs (renamed from library/std/src/sys/uefi/path.rs)0
-rw-r--r--library/std/src/sys/pal/uefi/stdio.rs (renamed from library/std/src/sys/uefi/stdio.rs)0
-rw-r--r--library/std/src/sys/pal/uefi/tests.rs (renamed from library/std/src/sys/uefi/tests.rs)0
-rw-r--r--library/std/src/sys/pal/unix/alloc.rs (renamed from library/std/src/sys/unix/alloc.rs)0
-rw-r--r--library/std/src/sys/pal/unix/android.rs (renamed from library/std/src/sys/unix/android.rs)0
-rw-r--r--library/std/src/sys/pal/unix/args.rs (renamed from library/std/src/sys/unix/args.rs)0
-rw-r--r--library/std/src/sys/pal/unix/cmath.rs (renamed from library/std/src/sys/unix/cmath.rs)0
-rw-r--r--library/std/src/sys/pal/unix/env.rs (renamed from library/std/src/sys/unix/env.rs)0
-rw-r--r--library/std/src/sys/pal/unix/fd.rs (renamed from library/std/src/sys/unix/fd.rs)0
-rw-r--r--library/std/src/sys/pal/unix/fd/tests.rs (renamed from library/std/src/sys/unix/fd/tests.rs)0
-rw-r--r--library/std/src/sys/pal/unix/fs.rs (renamed from library/std/src/sys/unix/fs.rs)6
-rw-r--r--library/std/src/sys/pal/unix/futex.rs (renamed from library/std/src/sys/unix/futex.rs)0
-rw-r--r--library/std/src/sys/pal/unix/io.rs (renamed from library/std/src/sys/unix/io.rs)0
-rw-r--r--library/std/src/sys/pal/unix/kernel_copy.rs (renamed from library/std/src/sys/unix/kernel_copy.rs)0
-rw-r--r--library/std/src/sys/pal/unix/kernel_copy/tests.rs (renamed from library/std/src/sys/unix/kernel_copy/tests.rs)0
-rw-r--r--library/std/src/sys/pal/unix/l4re.rs (renamed from library/std/src/sys/unix/l4re.rs)0
-rw-r--r--library/std/src/sys/pal/unix/locks/fuchsia_mutex.rs (renamed from library/std/src/sys/unix/locks/fuchsia_mutex.rs)0
-rw-r--r--library/std/src/sys/pal/unix/locks/futex_condvar.rs (renamed from library/std/src/sys/unix/locks/futex_condvar.rs)0
-rw-r--r--library/std/src/sys/pal/unix/locks/futex_mutex.rs (renamed from library/std/src/sys/unix/locks/futex_mutex.rs)0
-rw-r--r--library/std/src/sys/pal/unix/locks/futex_rwlock.rs (renamed from library/std/src/sys/unix/locks/futex_rwlock.rs)0
-rw-r--r--library/std/src/sys/pal/unix/locks/mod.rs (renamed from library/std/src/sys/unix/locks/mod.rs)0
-rw-r--r--library/std/src/sys/pal/unix/locks/pthread_condvar.rs (renamed from library/std/src/sys/unix/locks/pthread_condvar.rs)0
-rw-r--r--library/std/src/sys/pal/unix/locks/pthread_mutex.rs (renamed from library/std/src/sys/unix/locks/pthread_mutex.rs)0
-rw-r--r--library/std/src/sys/pal/unix/locks/pthread_rwlock.rs (renamed from library/std/src/sys/unix/locks/pthread_rwlock.rs)0
-rw-r--r--library/std/src/sys/pal/unix/memchr.rs (renamed from library/std/src/sys/unix/memchr.rs)0
-rw-r--r--library/std/src/sys/pal/unix/mod.rs (renamed from library/std/src/sys/unix/mod.rs)0
-rw-r--r--library/std/src/sys/pal/unix/net.rs (renamed from library/std/src/sys/unix/net.rs)2
-rw-r--r--library/std/src/sys/pal/unix/os.rs (renamed from library/std/src/sys/unix/os.rs)0
-rw-r--r--library/std/src/sys/pal/unix/os/tests.rs (renamed from library/std/src/sys/unix/os/tests.rs)0
-rw-r--r--library/std/src/sys/pal/unix/os_str.rs (renamed from library/std/src/sys/unix/os_str.rs)0
-rw-r--r--library/std/src/sys/pal/unix/os_str/tests.rs (renamed from library/std/src/sys/unix/os_str/tests.rs)0
-rw-r--r--library/std/src/sys/pal/unix/path.rs (renamed from library/std/src/sys/unix/path.rs)0
-rw-r--r--library/std/src/sys/pal/unix/pipe.rs (renamed from library/std/src/sys/unix/pipe.rs)0
-rw-r--r--library/std/src/sys/pal/unix/process/mod.rs (renamed from library/std/src/sys/unix/process/mod.rs)0
-rw-r--r--library/std/src/sys/pal/unix/process/process_common.rs (renamed from library/std/src/sys/unix/process/process_common.rs)2
-rw-r--r--library/std/src/sys/pal/unix/process/process_common/tests.rs (renamed from library/std/src/sys/unix/process/process_common/tests.rs)0
-rw-r--r--library/std/src/sys/pal/unix/process/process_fuchsia.rs (renamed from library/std/src/sys/unix/process/process_fuchsia.rs)0
-rw-r--r--library/std/src/sys/pal/unix/process/process_unix.rs (renamed from library/std/src/sys/unix/process/process_unix.rs)2
-rw-r--r--library/std/src/sys/pal/unix/process/process_unix/tests.rs (renamed from library/std/src/sys/unix/process/process_unix/tests.rs)0
-rw-r--r--library/std/src/sys/pal/unix/process/process_unsupported.rs (renamed from library/std/src/sys/unix/process/process_unsupported.rs)2
-rw-r--r--library/std/src/sys/pal/unix/process/process_unsupported/wait_status.rs (renamed from library/std/src/sys/unix/process/process_unsupported/wait_status.rs)0
-rw-r--r--library/std/src/sys/pal/unix/process/process_unsupported/wait_status/tests.rs (renamed from library/std/src/sys/unix/process/process_unsupported/wait_status/tests.rs)0
-rw-r--r--library/std/src/sys/pal/unix/process/process_vxworks.rs (renamed from library/std/src/sys/unix/process/process_vxworks.rs)0
-rw-r--r--library/std/src/sys/pal/unix/process/zircon.rs (renamed from library/std/src/sys/unix/process/zircon.rs)0
-rw-r--r--library/std/src/sys/pal/unix/rand.rs (renamed from library/std/src/sys/unix/rand.rs)0
-rw-r--r--library/std/src/sys/pal/unix/stack_overflow.rs (renamed from library/std/src/sys/unix/stack_overflow.rs)2
-rw-r--r--library/std/src/sys/pal/unix/stdio.rs (renamed from library/std/src/sys/unix/stdio.rs)0
-rw-r--r--library/std/src/sys/pal/unix/thread.rs (renamed from library/std/src/sys/unix/thread.rs)0
-rw-r--r--library/std/src/sys/pal/unix/thread_local_dtor.rs (renamed from library/std/src/sys/unix/thread_local_dtor.rs)0
-rw-r--r--library/std/src/sys/pal/unix/thread_local_key.rs (renamed from library/std/src/sys/unix/thread_local_key.rs)0
-rw-r--r--library/std/src/sys/pal/unix/thread_parking/darwin.rs (renamed from library/std/src/sys/unix/thread_parking/darwin.rs)0
-rw-r--r--library/std/src/sys/pal/unix/thread_parking/mod.rs (renamed from library/std/src/sys/unix/thread_parking/mod.rs)0
-rw-r--r--library/std/src/sys/pal/unix/thread_parking/netbsd.rs (renamed from library/std/src/sys/unix/thread_parking/netbsd.rs)0
-rw-r--r--library/std/src/sys/pal/unix/thread_parking/pthread.rs (renamed from library/std/src/sys/unix/thread_parking/pthread.rs)0
-rw-r--r--library/std/src/sys/pal/unix/time.rs (renamed from library/std/src/sys/unix/time.rs)0
-rw-r--r--library/std/src/sys/pal/unix/weak.rs (renamed from library/std/src/sys/unix/weak.rs)0
-rw-r--r--library/std/src/sys/pal/unsupported/alloc.rs (renamed from library/std/src/sys/unsupported/alloc.rs)0
-rw-r--r--library/std/src/sys/pal/unsupported/args.rs (renamed from library/std/src/sys/unsupported/args.rs)0
-rw-r--r--library/std/src/sys/pal/unsupported/common.rs (renamed from library/std/src/sys/unsupported/common.rs)0
-rw-r--r--library/std/src/sys/pal/unsupported/env.rs (renamed from library/std/src/sys/unsupported/env.rs)0
-rw-r--r--library/std/src/sys/pal/unsupported/fs.rs (renamed from library/std/src/sys/unsupported/fs.rs)0
-rw-r--r--library/std/src/sys/pal/unsupported/io.rs (renamed from library/std/src/sys/unsupported/io.rs)0
-rw-r--r--library/std/src/sys/pal/unsupported/locks/condvar.rs (renamed from library/std/src/sys/unsupported/locks/condvar.rs)0
-rw-r--r--library/std/src/sys/pal/unsupported/locks/mod.rs (renamed from library/std/src/sys/unsupported/locks/mod.rs)0
-rw-r--r--library/std/src/sys/pal/unsupported/locks/mutex.rs (renamed from library/std/src/sys/unsupported/locks/mutex.rs)0
-rw-r--r--library/std/src/sys/pal/unsupported/locks/rwlock.rs (renamed from library/std/src/sys/unsupported/locks/rwlock.rs)0
-rw-r--r--library/std/src/sys/pal/unsupported/mod.rs (renamed from library/std/src/sys/unsupported/mod.rs)0
-rw-r--r--library/std/src/sys/pal/unsupported/net.rs (renamed from library/std/src/sys/unsupported/net.rs)0
-rw-r--r--library/std/src/sys/pal/unsupported/once.rs (renamed from library/std/src/sys/unsupported/once.rs)0
-rw-r--r--library/std/src/sys/pal/unsupported/os.rs (renamed from library/std/src/sys/unsupported/os.rs)0
-rw-r--r--library/std/src/sys/pal/unsupported/pipe.rs (renamed from library/std/src/sys/unsupported/pipe.rs)0
-rw-r--r--library/std/src/sys/pal/unsupported/process.rs (renamed from library/std/src/sys/unsupported/process.rs)0
-rw-r--r--library/std/src/sys/pal/unsupported/stdio.rs (renamed from library/std/src/sys/unsupported/stdio.rs)0
-rw-r--r--library/std/src/sys/pal/unsupported/thread.rs (renamed from library/std/src/sys/unsupported/thread.rs)0
-rw-r--r--library/std/src/sys/pal/unsupported/thread_local_dtor.rs (renamed from library/std/src/sys/unsupported/thread_local_dtor.rs)0
-rw-r--r--library/std/src/sys/pal/unsupported/thread_local_key.rs (renamed from library/std/src/sys/unsupported/thread_local_key.rs)0
-rw-r--r--library/std/src/sys/pal/unsupported/thread_parking.rs (renamed from library/std/src/sys/unsupported/thread_parking.rs)0
-rw-r--r--library/std/src/sys/pal/unsupported/time.rs (renamed from library/std/src/sys/unsupported/time.rs)0
-rw-r--r--library/std/src/sys/pal/wasi/args.rs (renamed from library/std/src/sys/wasi/args.rs)0
-rw-r--r--library/std/src/sys/pal/wasi/env.rs (renamed from library/std/src/sys/wasi/env.rs)0
-rw-r--r--library/std/src/sys/pal/wasi/fd.rs (renamed from library/std/src/sys/wasi/fd.rs)0
-rw-r--r--library/std/src/sys/pal/wasi/fs.rs (renamed from library/std/src/sys/wasi/fs.rs)0
-rw-r--r--library/std/src/sys/pal/wasi/io.rs (renamed from library/std/src/sys/wasi/io.rs)0
-rw-r--r--library/std/src/sys/pal/wasi/mod.rs (renamed from library/std/src/sys/wasi/mod.rs)0
-rw-r--r--library/std/src/sys/pal/wasi/net.rs (renamed from library/std/src/sys/wasi/net.rs)0
-rw-r--r--library/std/src/sys/pal/wasi/os.rs (renamed from library/std/src/sys/wasi/os.rs)2
-rw-r--r--library/std/src/sys/pal/wasi/stdio.rs (renamed from library/std/src/sys/wasi/stdio.rs)0
-rw-r--r--library/std/src/sys/pal/wasi/thread.rs (renamed from library/std/src/sys/wasi/thread.rs)0
-rw-r--r--library/std/src/sys/pal/wasi/time.rs (renamed from library/std/src/sys/wasi/time.rs)0
-rw-r--r--library/std/src/sys/pal/wasm/alloc.rs (renamed from library/std/src/sys/wasm/alloc.rs)0
-rw-r--r--library/std/src/sys/pal/wasm/atomics/futex.rs (renamed from library/std/src/sys/wasm/atomics/futex.rs)0
-rw-r--r--library/std/src/sys/pal/wasm/atomics/thread.rs (renamed from library/std/src/sys/wasm/atomics/thread.rs)0
-rw-r--r--library/std/src/sys/pal/wasm/env.rs (renamed from library/std/src/sys/wasm/env.rs)0
-rw-r--r--library/std/src/sys/pal/wasm/mod.rs (renamed from library/std/src/sys/wasm/mod.rs)0
-rw-r--r--library/std/src/sys/pal/windows/alloc.rs (renamed from library/std/src/sys/windows/alloc.rs)0
-rw-r--r--library/std/src/sys/pal/windows/alloc/tests.rs (renamed from library/std/src/sys/windows/alloc/tests.rs)0
-rw-r--r--library/std/src/sys/pal/windows/api.rs (renamed from library/std/src/sys/windows/api.rs)2
-rw-r--r--library/std/src/sys/pal/windows/args.rs (renamed from library/std/src/sys/windows/args.rs)4
-rw-r--r--library/std/src/sys/pal/windows/args/tests.rs (renamed from library/std/src/sys/windows/args/tests.rs)2
-rw-r--r--library/std/src/sys/pal/windows/c.rs (renamed from library/std/src/sys/windows/c.rs)0
-rw-r--r--library/std/src/sys/pal/windows/c/windows_sys.lst (renamed from library/std/src/sys/windows/c/windows_sys.lst)0
-rw-r--r--library/std/src/sys/pal/windows/c/windows_sys.rs (renamed from library/std/src/sys/windows/c/windows_sys.rs)0
-rw-r--r--library/std/src/sys/pal/windows/cmath.rs (renamed from library/std/src/sys/windows/cmath.rs)0
-rw-r--r--library/std/src/sys/pal/windows/compat.rs (renamed from library/std/src/sys/windows/compat.rs)0
-rw-r--r--library/std/src/sys/pal/windows/env.rs (renamed from library/std/src/sys/windows/env.rs)0
-rw-r--r--library/std/src/sys/pal/windows/fs.rs (renamed from library/std/src/sys/windows/fs.rs)0
-rw-r--r--library/std/src/sys/pal/windows/handle.rs (renamed from library/std/src/sys/windows/handle.rs)0
-rw-r--r--library/std/src/sys/pal/windows/handle/tests.rs (renamed from library/std/src/sys/windows/handle/tests.rs)0
-rw-r--r--library/std/src/sys/pal/windows/io.rs (renamed from library/std/src/sys/windows/io.rs)0
-rw-r--r--library/std/src/sys/pal/windows/locks/condvar.rs (renamed from library/std/src/sys/windows/locks/condvar.rs)2
-rw-r--r--library/std/src/sys/pal/windows/locks/mod.rs (renamed from library/std/src/sys/windows/locks/mod.rs)0
-rw-r--r--library/std/src/sys/pal/windows/locks/mutex.rs (renamed from library/std/src/sys/windows/locks/mutex.rs)0
-rw-r--r--library/std/src/sys/pal/windows/locks/rwlock.rs (renamed from library/std/src/sys/windows/locks/rwlock.rs)0
-rw-r--r--library/std/src/sys/pal/windows/memchr.rs (renamed from library/std/src/sys/windows/memchr.rs)0
-rw-r--r--library/std/src/sys/pal/windows/mod.rs (renamed from library/std/src/sys/windows/mod.rs)0
-rw-r--r--library/std/src/sys/pal/windows/net.rs (renamed from library/std/src/sys/windows/net.rs)2
-rw-r--r--library/std/src/sys/pal/windows/os.rs (renamed from library/std/src/sys/windows/os.rs)0
-rw-r--r--library/std/src/sys/pal/windows/os/tests.rs (renamed from library/std/src/sys/windows/os/tests.rs)0
-rw-r--r--library/std/src/sys/pal/windows/os_str.rs (renamed from library/std/src/sys/windows/os_str.rs)0
-rw-r--r--library/std/src/sys/pal/windows/path.rs (renamed from library/std/src/sys/windows/path.rs)0
-rw-r--r--library/std/src/sys/pal/windows/path/tests.rs (renamed from library/std/src/sys/windows/path/tests.rs)0
-rw-r--r--library/std/src/sys/pal/windows/pipe.rs (renamed from library/std/src/sys/windows/pipe.rs)0
-rw-r--r--library/std/src/sys/pal/windows/process.rs (renamed from library/std/src/sys/windows/process.rs)0
-rw-r--r--library/std/src/sys/pal/windows/process/tests.rs (renamed from library/std/src/sys/windows/process/tests.rs)0
-rw-r--r--library/std/src/sys/pal/windows/rand.rs (renamed from library/std/src/sys/windows/rand.rs)0
-rw-r--r--library/std/src/sys/pal/windows/stack_overflow.rs (renamed from library/std/src/sys/windows/stack_overflow.rs)0
-rw-r--r--library/std/src/sys/pal/windows/stack_overflow_uwp.rs (renamed from library/std/src/sys/windows/stack_overflow_uwp.rs)0
-rw-r--r--library/std/src/sys/pal/windows/stdio.rs (renamed from library/std/src/sys/windows/stdio.rs)2
-rw-r--r--library/std/src/sys/pal/windows/stdio/tests.rs (renamed from library/std/src/sys/windows/stdio/tests.rs)0
-rw-r--r--library/std/src/sys/pal/windows/thread.rs (renamed from library/std/src/sys/windows/thread.rs)0
-rw-r--r--library/std/src/sys/pal/windows/thread_local_dtor.rs (renamed from library/std/src/sys/windows/thread_local_dtor.rs)0
-rw-r--r--library/std/src/sys/pal/windows/thread_local_key.rs (renamed from library/std/src/sys/windows/thread_local_key.rs)0
-rw-r--r--library/std/src/sys/pal/windows/thread_local_key/tests.rs (renamed from library/std/src/sys/windows/thread_local_key/tests.rs)0
-rw-r--r--library/std/src/sys/pal/windows/thread_parking.rs (renamed from library/std/src/sys/windows/thread_parking.rs)0
-rw-r--r--library/std/src/sys/pal/windows/time.rs (renamed from library/std/src/sys/windows/time.rs)0
-rw-r--r--library/std/src/sys/pal/xous/alloc.rs (renamed from library/std/src/sys/xous/alloc.rs)0
-rw-r--r--library/std/src/sys/pal/xous/locks/condvar.rs (renamed from library/std/src/sys/xous/locks/condvar.rs)0
-rw-r--r--library/std/src/sys/pal/xous/locks/mod.rs (renamed from library/std/src/sys/xous/locks/mod.rs)0
-rw-r--r--library/std/src/sys/pal/xous/locks/mutex.rs (renamed from library/std/src/sys/xous/locks/mutex.rs)0
-rw-r--r--library/std/src/sys/pal/xous/locks/rwlock.rs (renamed from library/std/src/sys/xous/locks/rwlock.rs)0
-rw-r--r--library/std/src/sys/pal/xous/mod.rs (renamed from library/std/src/sys/xous/mod.rs)0
-rw-r--r--library/std/src/sys/pal/xous/os.rs (renamed from library/std/src/sys/xous/os.rs)0
-rw-r--r--library/std/src/sys/pal/xous/stdio.rs (renamed from library/std/src/sys/xous/stdio.rs)0
-rw-r--r--library/std/src/sys/pal/xous/thread.rs (renamed from library/std/src/sys/xous/thread.rs)0
-rw-r--r--library/std/src/sys/pal/xous/thread_local_key.rs (renamed from library/std/src/sys/xous/thread_local_key.rs)0
-rw-r--r--library/std/src/sys/pal/xous/thread_parking.rs (renamed from library/std/src/sys/xous/thread_parking.rs)0
-rw-r--r--library/std/src/sys/pal/xous/time.rs (renamed from library/std/src/sys/xous/time.rs)0
259 files changed, 165 insertions, 159 deletions
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.
-
-#![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<F: Fn(f64) -> 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<F: Fn(f64) -> f64>(n: f64, log_fn: F) -> f64 {
-    log_fn(n)
-}
-
-#[cfg(not(target_os = "uefi"))]
-pub type RawOsError = i32;
+/// The PAL (platform abstraction layer) contains platform-specific abstractions
+/// for implementing the features in the other submodules, e.g. UNIX file
+/// descriptors.
+mod pal;
+
+// 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
index b7357460f39..b7357460f39 100644
--- a/library/std/src/sys/common/alloc.rs
+++ b/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
index b35c5d30b41..b35c5d30b41 100644
--- a/library/std/src/sys/common/mod.rs
+++ b/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
index af9b18e372d..af9b18e372d 100644
--- a/library/std/src/sys/common/small_c_string.rs
+++ b/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
index 32dc18ee1cf..32dc18ee1cf 100644
--- a/library/std/src/sys/common/tests.rs
+++ b/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
index 9206588be06..9206588be06 100644
--- a/library/std/src/sys/common/thread_local/fast_local.rs
+++ b/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
index 8b2c839f837..8b2c839f837 100644
--- a/library/std/src/sys/common/thread_local/mod.rs
+++ b/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
index 7cf29192122..7cf29192122 100644
--- a/library/std/src/sys/common/thread_local/os_local.rs
+++ b/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
index 51cba66fad7..51cba66fad7 100644
--- a/library/std/src/sys/common/thread_local/static_local.rs
+++ b/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
index d153914e77e..de550987a43 100644
--- a/library/std/src/sys/hermit/alloc.rs
+++ b/library/std/src/sys/pal/hermit/alloc.rs
@@ -1,6 +1,6 @@
+use super::abi;
 use crate::alloc::{GlobalAlloc, Layout, System};
 use crate::ptr;
-use crate::sys::hermit::abi;
 
 #[stable(feature = "alloc_system_type", since = "1.28.0")]
 unsafe impl GlobalAlloc for System {
diff --git a/library/std/src/sys/hermit/args.rs b/library/std/src/sys/pal/hermit/args.rs
index 220a76e4b12..220a76e4b12 100644
--- a/library/std/src/sys/hermit/args.rs
+++ b/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
index 7a0fcb31ef2..7a0fcb31ef2 100644
--- a/library/std/src/sys/hermit/env.rs
+++ b/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
index ccde05aa1d7..5eb828fea1f 100644
--- a/library/std/src/sys/hermit/fd.rs
+++ b/library/std/src/sys/pal/hermit/fd.rs
@@ -1,9 +1,9 @@
 #![unstable(reason = "not public", issue = "none", feature = "fd")]
 
+use super::abi;
 use crate::io::{self, Read};
 use crate::os::hermit::io::{FromRawFd, OwnedFd, RawFd};
 use crate::sys::cvt;
-use crate::sys::hermit::abi;
 use crate::sys::unsupported;
 use crate::sys_common::{AsInner, FromInner, IntoInner};
 
diff --git a/library/std/src/sys/hermit/fs.rs b/library/std/src/sys/pal/hermit/fs.rs
index 6aa4ea7f5b4..694482a8a30 100644
--- a/library/std/src/sys/hermit/fs.rs
+++ b/library/std/src/sys/pal/hermit/fs.rs
@@ -1,3 +1,5 @@
+use super::abi::{self, O_APPEND, O_CREAT, O_EXCL, O_RDONLY, O_RDWR, O_TRUNC, O_WRONLY};
+use super::fd::FileDesc;
 use crate::ffi::{CStr, OsString};
 use crate::fmt;
 use crate::hash::{Hash, Hasher};
@@ -7,10 +9,6 @@ use crate::os::hermit::io::{AsFd, AsRawFd, BorrowedFd, FromRawFd, IntoRawFd, Raw
 use crate::path::{Path, PathBuf};
 use crate::sys::common::small_c_string::run_path_with_cstr;
 use crate::sys::cvt;
-use crate::sys::hermit::abi::{
-    self, O_APPEND, O_CREAT, O_EXCL, O_RDONLY, O_RDWR, O_TRUNC, O_WRONLY,
-};
-use crate::sys::hermit::fd::FileDesc;
 use crate::sys::time::SystemTime;
 use crate::sys::unsupported;
 use crate::sys_common::{AsInner, AsInnerMut, FromInner, IntoInner};
diff --git a/library/std/src/sys/hermit/futex.rs b/library/std/src/sys/pal/hermit/futex.rs
index 427d8ff6f2e..427d8ff6f2e 100644
--- a/library/std/src/sys/hermit/futex.rs
+++ b/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
index 9967482197e..9967482197e 100644
--- a/library/std/src/sys/hermit/memchr.rs
+++ b/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
index abd7eb353f8..937603cfd8a 100644
--- a/library/std/src/sys/hermit/mod.rs
+++ b/library/std/src/sys/pal/hermit/mod.rs
@@ -115,7 +115,7 @@ pub unsafe extern "C" fn runtime_entry(
     argv: *const *const c_char,
     env: *const *const c_char,
 ) -> ! {
-    use crate::sys::hermit::thread_local_dtor::run_dtors;
+    use thread_local_dtor::run_dtors;
     extern "C" {
         fn main(argc: isize, argv: *const *const c_char) -> i32;
     }
diff --git a/library/std/src/sys/hermit/net.rs b/library/std/src/sys/pal/hermit/net.rs
index bd8b493d65a..3cf63fccf2e 100644
--- a/library/std/src/sys/hermit/net.rs
+++ b/library/std/src/sys/pal/hermit/net.rs
@@ -1,11 +1,11 @@
 #![allow(dead_code)]
 
+use super::fd::FileDesc;
 use crate::cmp;
 use crate::io::{self, BorrowedBuf, BorrowedCursor, IoSlice, IoSliceMut};
 use crate::mem;
 use crate::net::{Shutdown, SocketAddr};
 use crate::os::hermit::io::{AsFd, AsRawFd, BorrowedFd, FromRawFd, RawFd};
-use crate::sys::hermit::fd::FileDesc;
 use crate::sys::time::Instant;
 use crate::sys_common::net::{getsockopt, setsockopt, sockaddr_to_addr};
 use crate::sys_common::{AsInner, FromInner, IntoInner};
diff --git a/library/std/src/sys/hermit/os.rs b/library/std/src/sys/pal/hermit/os.rs
index c79197a9ad1..a54536aecb8 100644
--- a/library/std/src/sys/hermit/os.rs
+++ b/library/std/src/sys/pal/hermit/os.rs
@@ -1,3 +1,4 @@
+use super::abi;
 use crate::collections::HashMap;
 use crate::error::Error as StdError;
 use crate::ffi::{CStr, OsStr, OsString};
@@ -8,7 +9,6 @@ use crate::os::hermit::ffi::OsStringExt;
 use crate::path::{self, PathBuf};
 use crate::str;
 use crate::sync::Mutex;
-use crate::sys::hermit::abi;
 use crate::sys::memchr;
 use crate::sys::unsupported;
 use crate::vec;
diff --git a/library/std/src/sys/hermit/stdio.rs b/library/std/src/sys/pal/hermit/stdio.rs
index 514de1df6f9..ac54385e8ce 100644
--- a/library/std/src/sys/hermit/stdio.rs
+++ b/library/std/src/sys/pal/hermit/stdio.rs
@@ -1,6 +1,6 @@
+use super::abi;
 use crate::io;
 use crate::io::{IoSlice, IoSliceMut};
-use crate::sys::hermit::abi;
 
 pub struct Stdin;
 pub struct Stdout;
diff --git a/library/std/src/sys/hermit/thread.rs b/library/std/src/sys/pal/hermit/thread.rs
index 332151e40d0..3384906a15e 100644
--- a/library/std/src/sys/hermit/thread.rs
+++ b/library/std/src/sys/pal/hermit/thread.rs
@@ -1,12 +1,12 @@
 #![allow(dead_code)]
 
+use super::abi;
+use super::thread_local_dtor::run_dtors;
 use crate::ffi::CStr;
 use crate::io;
 use crate::mem;
 use crate::num::NonZeroUsize;
 use crate::ptr;
-use crate::sys::hermit::abi;
-use crate::sys::hermit::thread_local_dtor::run_dtors;
 use crate::time::Duration;
 
 pub type Tid = abi::Tid;
diff --git a/library/std/src/sys/hermit/thread_local_dtor.rs b/library/std/src/sys/pal/hermit/thread_local_dtor.rs
index 98adaf4bff1..98adaf4bff1 100644
--- a/library/std/src/sys/hermit/thread_local_dtor.rs
+++ b/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
index 7d91460aba3..b0e9634d229 100644
--- a/library/std/src/sys/hermit/time.rs
+++ b/library/std/src/sys/pal/hermit/time.rs
@@ -1,10 +1,10 @@
 #![allow(dead_code)]
 
+use super::abi;
+use super::abi::timespec;
+use super::abi::{CLOCK_MONOTONIC, CLOCK_REALTIME, NSEC_PER_SEC};
 use crate::cmp::Ordering;
 use crate::ops::{Add, AddAssign, Sub, SubAssign};
-use crate::sys::hermit::abi;
-use crate::sys::hermit::abi::timespec;
-use crate::sys::hermit::abi::{CLOCK_MONOTONIC, CLOCK_REALTIME, NSEC_PER_SEC};
 use crate::time::Duration;
 use core::hash::{Hash, Hasher};
 
diff --git a/library/std/src/sys/itron/abi.rs b/library/std/src/sys/pal/itron/abi.rs
index 5eb14bb7e53..5eb14bb7e53 100644
--- a/library/std/src/sys/itron/abi.rs
+++ b/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
index 7a47cc6696a..7a47cc6696a 100644
--- a/library/std/src/sys/itron/condvar.rs
+++ b/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
index fbc822d4eb6..fbc822d4eb6 100644
--- a/library/std/src/sys/itron/error.rs
+++ b/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
index 1f6cc419476..1f6cc419476 100644
--- a/library/std/src/sys/itron/mutex.rs
+++ b/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
index 44d409444bc..44d409444bc 100644
--- a/library/std/src/sys/itron/spin.rs
+++ b/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
index 94beb50a254..94beb50a254 100644
--- a/library/std/src/sys/itron/task.rs
+++ b/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
index ae0f718535b..ae0f718535b 100644
--- a/library/std/src/sys/itron/thread.rs
+++ b/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
index fe9934439d1..fe9934439d1 100644
--- a/library/std/src/sys/itron/thread_parking.rs
+++ b/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
index 427ea0d80e1..427ea0d80e1 100644
--- a/library/std/src/sys/itron/time.rs
+++ b/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
index d14035d9da4..d14035d9da4 100644
--- a/library/std/src/sys/itron/time/tests.rs
+++ b/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<F: Fn(f64) -> 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<F: Fn(f64) -> 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
index a78084de0fa..a78084de0fa 100644
--- a/library/std/src/sys/personality/dwarf/eh.rs
+++ b/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
index 652fbe95a14..652fbe95a14 100644
--- a/library/std/src/sys/personality/dwarf/mod.rs
+++ b/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
index 1644f37083a..1644f37083a 100644
--- a/library/std/src/sys/personality/dwarf/tests.rs
+++ b/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
index cb52ae89b19..cb52ae89b19 100644
--- a/library/std/src/sys/personality/emcc.rs
+++ b/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
index 6f317131145..6f317131145 100644
--- a/library/std/src/sys/personality/gcc.rs
+++ b/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
index d37b8ce6346..d37b8ce6346 100644
--- a/library/std/src/sys/personality/mod.rs
+++ b/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
index 8a063b65dac..8a063b65dac 100644
--- a/library/std/src/sys/sgx/abi/entry.S
+++ b/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
index 18e6d5b3fa2..18e6d5b3fa2 100644
--- a/library/std/src/sys/sgx/abi/mem.rs
+++ b/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
index 9508c387415..9508c387415 100644
--- a/library/std/src/sys/sgx/abi/mod.rs
+++ b/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
index 229b3b3291f..229b3b3291f 100644
--- a/library/std/src/sys/sgx/abi/panic.rs
+++ b/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
index 02dff0ad29f..02dff0ad29f 100644
--- a/library/std/src/sys/sgx/abi/reloc.rs
+++ b/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
index 2b23e368cc3..2b23e368cc3 100644
--- a/library/std/src/sys/sgx/abi/thread.rs
+++ b/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
index 09c4ab3d3e9..09c4ab3d3e9 100644
--- a/library/std/src/sys/sgx/abi/tls/mod.rs
+++ b/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
index 4eeff8f6ef7..4eeff8f6ef7 100644
--- a/library/std/src/sys/sgx/abi/tls/sync_bitset.rs
+++ b/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
index d7eb2e139d0..d7eb2e139d0 100644
--- 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
diff --git a/library/std/src/sys/sgx/abi/usercalls/alloc.rs b/library/std/src/sys/pal/sgx/abi/usercalls/alloc.rs
index f99cea360f1..f99cea360f1 100644
--- a/library/std/src/sys/sgx/abi/usercalls/alloc.rs
+++ b/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
index e19e843267a..e19e843267a 100644
--- a/library/std/src/sys/sgx/abi/usercalls/mod.rs
+++ b/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
index 10c1456d4fd..10c1456d4fd 100644
--- a/library/std/src/sys/sgx/abi/usercalls/raw.rs
+++ b/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
index 58b8eb215d7..58b8eb215d7 100644
--- a/library/std/src/sys/sgx/abi/usercalls/tests.rs
+++ b/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
index 4aea28cb83e..0c7bf9a9201 100644
--- a/library/std/src/sys/sgx/alloc.rs
+++ b/library/std/src/sys/pal/sgx/alloc.rs
@@ -1,8 +1,8 @@
 use crate::alloc::{GlobalAlloc, Layout, System};
 use crate::ptr;
-use crate::sys::sgx::abi::mem as sgx_mem;
 use core::sync::atomic::{AtomicBool, Ordering};
 
+use super::abi::mem as sgx_mem;
 use super::waitqueue::SpinMutex;
 
 // Using a SpinMutex because we never want to exit the enclave waiting for the
diff --git a/library/std/src/sys/sgx/args.rs b/library/std/src/sys/pal/sgx/args.rs
index ef4176c4ac0..ef4176c4ac0 100644
--- a/library/std/src/sys/sgx/args.rs
+++ b/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
index aa1174664ae..aa1174664ae 100644
--- a/library/std/src/sys/sgx/condvar.rs
+++ b/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
index 8043b7c5213..8043b7c5213 100644
--- a/library/std/src/sys/sgx/env.rs
+++ b/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
index b3686d0e283..b3686d0e283 100644
--- a/library/std/src/sys/sgx/fd.rs
+++ b/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
index 9967482197e..9967482197e 100644
--- a/library/std/src/sys/sgx/memchr.rs
+++ b/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
index 09d3f7638ca..09d3f7638ca 100644
--- a/library/std/src/sys/sgx/mod.rs
+++ b/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
index 0dbf020ebe0..0dbf020ebe0 100644
--- a/library/std/src/sys/sgx/mutex.rs
+++ b/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
index 03620a08f2c..03620a08f2c 100644
--- a/library/std/src/sys/sgx/net.rs
+++ b/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
index 86f4c7d3d56..86f4c7d3d56 100644
--- a/library/std/src/sys/sgx/os.rs
+++ b/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
index c805c15e702..c805c15e702 100644
--- a/library/std/src/sys/sgx/path.rs
+++ b/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
index d89de18ca5f..d89de18ca5f 100644
--- a/library/std/src/sys/sgx/rwlock.rs
+++ b/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
index 5fd6670afd4..5fd6670afd4 100644
--- a/library/std/src/sys/sgx/rwlock/tests.rs
+++ b/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
index 2e680e740fd..2e680e740fd 100644
--- a/library/std/src/sys/sgx/stdio.rs
+++ b/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
index 7ac9d1d64b4..7ac9d1d64b4 100644
--- a/library/std/src/sys/sgx/thread.rs
+++ b/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
index c7a57d3a3d4..c7a57d3a3d4 100644
--- a/library/std/src/sys/sgx/thread_local_key.rs
+++ b/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
index 0006cd4f1be..0006cd4f1be 100644
--- a/library/std/src/sys/sgx/thread_parking.rs
+++ b/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
index db4cf2804bf..db4cf2804bf 100644
--- a/library/std/src/sys/sgx/time.rs
+++ b/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
index 25eca61d67b..25eca61d67b 100644
--- a/library/std/src/sys/sgx/waitqueue/mod.rs
+++ b/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
index f6e851ccadd..f6e851ccadd 100644
--- a/library/std/src/sys/sgx/waitqueue/spin_mutex.rs
+++ b/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
index 4c5994bea61..4c5994bea61 100644
--- a/library/std/src/sys/sgx/waitqueue/spin_mutex/tests.rs
+++ b/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
index bf91fdd08ed..bf91fdd08ed 100644
--- a/library/std/src/sys/sgx/waitqueue/tests.rs
+++ b/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
index c736cab576e..c736cab576e 100644
--- a/library/std/src/sys/sgx/waitqueue/unsafe_list.rs
+++ b/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
index c653dee17bc..c653dee17bc 100644
--- a/library/std/src/sys/sgx/waitqueue/unsafe_list/tests.rs
+++ b/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
index 32800bd9a9d..32800bd9a9d 100644
--- a/library/std/src/sys/solid/abi/fs.rs
+++ b/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
index 8440d572cfb..8440d572cfb 100644
--- a/library/std/src/sys/solid/abi/mod.rs
+++ b/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
index eb06a6dd927..eb06a6dd927 100644
--- a/library/std/src/sys/solid/abi/sockets.rs
+++ b/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
index d013bd87610..d013bd87610 100644
--- a/library/std/src/sys/solid/alloc.rs
+++ b/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
index 6855c113b28..6855c113b28 100644
--- a/library/std/src/sys/solid/env.rs
+++ b/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
index 547b4f3a984..547b4f3a984 100644
--- a/library/std/src/sys/solid/error.rs
+++ b/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
index 6c66b93a3e1..6c66b93a3e1 100644
--- a/library/std/src/sys/solid/fs.rs
+++ b/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
index a862bb78702..a862bb78702 100644
--- a/library/std/src/sys/solid/io.rs
+++ b/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
index 452b7a3de1b..452b7a3de1b 100644
--- a/library/std/src/sys/solid/memchr.rs
+++ b/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
index 5af83653cf8..5af83653cf8 100644
--- a/library/std/src/sys/solid/mod.rs
+++ b/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
index a768e2406c8..1c310648a3d 100644
--- a/library/std/src/sys/solid/net.rs
+++ b/library/std/src/sys/pal/solid/net.rs
@@ -68,7 +68,7 @@ pub fn cvt_gai(err: c_int) -> io::Result<()> {
     }
 }
 
-/// Just to provide the same interface as sys/unix/net.rs
+/// Just to provide the same interface as sys/pal/unix/net.rs
 pub fn cvt_r<T, F>(mut f: F) -> io::Result<T>
 where
     T: IsMinusOne,
diff --git a/library/std/src/sys/solid/os.rs b/library/std/src/sys/pal/solid/os.rs
index ff81544ba91..ff81544ba91 100644
--- a/library/std/src/sys/solid/os.rs
+++ b/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
index 7045c9be25b..7045c9be25b 100644
--- a/library/std/src/sys/solid/path.rs
+++ b/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
index ecb4eb83b9b..ecb4eb83b9b 100644
--- a/library/std/src/sys/solid/rwlock.rs
+++ b/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
index 50f0176967b..50f0176967b 100644
--- a/library/std/src/sys/solid/stdio.rs
+++ b/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
index 26918a4fcb0..26918a4fcb0 100644
--- a/library/std/src/sys/solid/thread_local_dtor.rs
+++ b/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
index b37bf999698..b37bf999698 100644
--- a/library/std/src/sys/solid/thread_local_key.rs
+++ b/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
index f83f1644fe8..f83f1644fe8 100644
--- a/library/std/src/sys/solid/time.rs
+++ b/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
index e236819aa23..e236819aa23 100644
--- a/library/std/src/sys/teeos/alloc.rs
+++ b/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
index c08e8145b8c..c08e8145b8c 100644
--- a/library/std/src/sys/teeos/locks/condvar.rs
+++ b/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
index c58e9c7fd45..c58e9c7fd45 100644
--- a/library/std/src/sys/teeos/locks/mod.rs
+++ b/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
index 27cdb88788f..27cdb88788f 100644
--- a/library/std/src/sys/teeos/locks/rwlock.rs
+++ b/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
index ed8c54b2c36..ed8c54b2c36 100644
--- a/library/std/src/sys/teeos/mod.rs
+++ b/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
index 0df681dbfa5..0df681dbfa5 100644
--- a/library/std/src/sys/teeos/net.rs
+++ b/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
index e54a92f01f8..e54a92f01f8 100644
--- a/library/std/src/sys/teeos/os.rs
+++ b/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
index b45c3bb40e7..b45c3bb40e7 100644
--- a/library/std/src/sys/teeos/rand.rs
+++ b/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
index 9ca04f29273..9ca04f29273 100644
--- a/library/std/src/sys/teeos/stdio.rs
+++ b/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
index 155f333f906..155f333f906 100644
--- a/library/std/src/sys/teeos/thread.rs
+++ b/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
index 5c6bc4d6750..5c6bc4d6750 100644
--- a/library/std/src/sys/teeos/thread_local_dtor.rs
+++ b/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
index ad3904d82f3..15404ac3ea6 100644
--- a/library/std/src/sys/uefi/alloc.rs
+++ b/library/std/src/sys/pal/uefi/alloc.rs
@@ -3,9 +3,9 @@
 
 use r_efi::protocols::loaded_image;
 
+use super::helpers;
 use crate::alloc::{GlobalAlloc, Layout, System};
 use crate::sync::OnceLock;
-use crate::sys::uefi::helpers;
 
 #[stable(feature = "alloc_system_type", since = "1.28.0")]
 unsafe impl GlobalAlloc for System {
diff --git a/library/std/src/sys/uefi/args.rs b/library/std/src/sys/pal/uefi/args.rs
index 4ff7be748e9..18a69afa7d9 100644
--- a/library/std/src/sys/uefi/args.rs
+++ b/library/std/src/sys/pal/uefi/args.rs
@@ -1,11 +1,11 @@
 use r_efi::protocols::loaded_image;
 
+use super::helpers;
 use crate::env::current_exe;
 use crate::ffi::OsString;
 use crate::fmt;
 use crate::iter::Iterator;
 use crate::mem::size_of;
-use crate::sys::uefi::helpers;
 use crate::vec;
 
 pub struct Args {
diff --git a/library/std/src/sys/uefi/env.rs b/library/std/src/sys/pal/uefi/env.rs
index c106d5fed3e..c106d5fed3e 100644
--- a/library/std/src/sys/uefi/env.rs
+++ b/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
index 9837cc89f2d..9837cc89f2d 100644
--- a/library/std/src/sys/uefi/helpers.rs
+++ b/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
index 4edc00e3ea0..4edc00e3ea0 100644
--- a/library/std/src/sys/uefi/mod.rs
+++ b/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
index e6693db68e6..e6693db68e6 100644
--- a/library/std/src/sys/uefi/os.rs
+++ b/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
index 106682eee56..106682eee56 100644
--- a/library/std/src/sys/uefi/path.rs
+++ b/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
index a533d8a0575..a533d8a0575 100644
--- a/library/std/src/sys/uefi/stdio.rs
+++ b/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
index 8806eda3ac0..8806eda3ac0 100644
--- a/library/std/src/sys/uefi/tests.rs
+++ b/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
index af0089978ec..af0089978ec 100644
--- a/library/std/src/sys/unix/alloc.rs
+++ b/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
index 0f704994f55..0f704994f55 100644
--- a/library/std/src/sys/unix/android.rs
+++ b/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
index 9f7dcc0416e..9f7dcc0416e 100644
--- a/library/std/src/sys/unix/args.rs
+++ b/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
index 5346d229116..5346d229116 100644
--- a/library/std/src/sys/unix/cmath.rs
+++ b/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
index 3d4ba509829..3d4ba509829 100644
--- a/library/std/src/sys/unix/env.rs
+++ b/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
index bf1fb3123c4..bf1fb3123c4 100644
--- a/library/std/src/sys/unix/fd.rs
+++ b/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
index 5d17e46786c..5d17e46786c 100644
--- a/library/std/src/sys/unix/fd/tests.rs
+++ b/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
index 72e7b1b1fc3..6d0b892ea2f 100644
--- a/library/std/src/sys/unix/fs.rs
+++ b/library/std/src/sys/pal/unix/fs.rs
@@ -2008,7 +2008,7 @@ mod remove_dir_impl {
 
         pub unsafe fn openat(dirfd: c_int, pathname: *const c_char, flags: c_int) -> c_int {
             get_openat_fn().map(|openat| openat(dirfd, pathname, flags)).unwrap_or_else(|| {
-                crate::sys::unix::os::set_errno(libc::ENOSYS);
+                crate::sys::pal::unix::os::set_errno(libc::ENOSYS);
                 -1
             })
         }
@@ -2019,7 +2019,7 @@ mod remove_dir_impl {
             #[cfg(all(target_os = "macos", target_arch = "x86_64"))]
             weak!(fn fdopendir(c_int) -> *mut DIR, "fdopendir$INODE64");
             fdopendir.get().map(|fdopendir| fdopendir(fd)).unwrap_or_else(|| {
-                crate::sys::unix::os::set_errno(libc::ENOSYS);
+                crate::sys::pal::unix::os::set_errno(libc::ENOSYS);
                 crate::ptr::null_mut()
             })
         }
@@ -2027,7 +2027,7 @@ mod remove_dir_impl {
         pub unsafe fn unlinkat(dirfd: c_int, pathname: *const c_char, flags: c_int) -> c_int {
             weak!(fn unlinkat(c_int, *const c_char, c_int) -> c_int);
             unlinkat.get().map(|unlinkat| unlinkat(dirfd, pathname, flags)).unwrap_or_else(|| {
-                crate::sys::unix::os::set_errno(libc::ENOSYS);
+                crate::sys::pal::unix::os::set_errno(libc::ENOSYS);
                 -1
             })
         }
diff --git a/library/std/src/sys/unix/futex.rs b/library/std/src/sys/pal/unix/futex.rs
index d310be6c7a1..d310be6c7a1 100644
--- a/library/std/src/sys/unix/futex.rs
+++ b/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
index 29c340dd349..29c340dd349 100644
--- a/library/std/src/sys/unix/io.rs
+++ b/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
index 18acd5ecccd..18acd5ecccd 100644
--- a/library/std/src/sys/unix/kernel_copy.rs
+++ b/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
index a524270e3fb..a524270e3fb 100644
--- a/library/std/src/sys/unix/kernel_copy/tests.rs
+++ b/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
index fe9559f2a56..fe9559f2a56 100644
--- a/library/std/src/sys/unix/l4re.rs
+++ b/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
index 5d89e5a13fd..5d89e5a13fd 100644
--- a/library/std/src/sys/unix/locks/fuchsia_mutex.rs
+++ b/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
index 4bd65dd25c2..4bd65dd25c2 100644
--- a/library/std/src/sys/unix/locks/futex_condvar.rs
+++ b/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
index c01229586c3..c01229586c3 100644
--- a/library/std/src/sys/unix/locks/futex_mutex.rs
+++ b/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
index aa0de900238..aa0de900238 100644
--- a/library/std/src/sys/unix/locks/futex_rwlock.rs
+++ b/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
index b2e0e49ad73..b2e0e49ad73 100644
--- a/library/std/src/sys/unix/locks/mod.rs
+++ b/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
index 2dc1b0c601e..2dc1b0c601e 100644
--- a/library/std/src/sys/unix/locks/pthread_condvar.rs
+++ b/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
index 8a78bc1fd73..8a78bc1fd73 100644
--- a/library/std/src/sys/unix/locks/pthread_mutex.rs
+++ b/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
index 04662be9d82..04662be9d82 100644
--- a/library/std/src/sys/unix/locks/pthread_rwlock.rs
+++ b/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
index 73ba604eccb..73ba604eccb 100644
--- a/library/std/src/sys/unix/memchr.rs
+++ b/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
index b5da5f870ec..b5da5f870ec 100644
--- a/library/std/src/sys/unix/mod.rs
+++ b/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
index ec861f9cb86..8f537de7026 100644
--- a/library/std/src/sys/unix/net.rs
+++ b/library/std/src/sys/pal/unix/net.rs
@@ -6,7 +6,7 @@ use crate::net::{Shutdown, SocketAddr};
 use crate::os::unix::io::{AsFd, AsRawFd, BorrowedFd, FromRawFd, IntoRawFd, RawFd};
 use crate::str;
 use crate::sys::fd::FileDesc;
-use crate::sys::unix::IsMinusOne;
+use crate::sys::pal::unix::IsMinusOne;
 use crate::sys_common::net::{getsockopt, setsockopt, sockaddr_to_addr};
 use crate::sys_common::{AsInner, FromInner, IntoInner};
 use crate::time::{Duration, Instant};
diff --git a/library/std/src/sys/unix/os.rs b/library/std/src/sys/pal/unix/os.rs
index 881b3a25c51..881b3a25c51 100644
--- a/library/std/src/sys/unix/os.rs
+++ b/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
index efc29955b05..efc29955b05 100644
--- a/library/std/src/sys/unix/os/tests.rs
+++ b/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
index 7bd2f656a24..7bd2f656a24 100644
--- a/library/std/src/sys/unix/os_str.rs
+++ b/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
index e2a99045e41..e2a99045e41 100644
--- a/library/std/src/sys/unix/os_str/tests.rs
+++ b/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
index 837f68d3eaf..837f68d3eaf 100644
--- a/library/std/src/sys/unix/path.rs
+++ b/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
index 33db24e77e4..33db24e77e4 100644
--- a/library/std/src/sys/unix/pipe.rs
+++ b/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
index 074f0a105e3..074f0a105e3 100644
--- a/library/std/src/sys/unix/process/mod.rs
+++ b/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
index c5f04fb8b3b..f615e8086dc 100644
--- a/library/std/src/sys/unix/process/process_common.rs
+++ b/library/std/src/sys/pal/unix/process/process_common.rs
@@ -63,7 +63,7 @@ cfg_if::cfg_if! {
 
             let bit = (signum - 1) as usize;
             if set.is_null() || bit >= (8 * size_of::<sigset_t>()) {
-                crate::sys::unix::os::set_errno(libc::EINVAL);
+                crate::sys::pal::unix::os::set_errno(libc::EINVAL);
                 return -1;
             }
             let raw = slice::from_raw_parts_mut(
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
index 4e41efc9096..4e41efc9096 100644
--- a/library/std/src/sys/unix/process/process_common/tests.rs
+++ b/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
index 9931c2af2f1..9931c2af2f1 100644
--- a/library/std/src/sys/unix/process/process_fuchsia.rs
+++ b/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
index ee86a5f88dd..fac6d92439e 100644
--- a/library/std/src/sys/unix/process/process_unix.rs
+++ b/library/std/src/sys/pal/unix/process/process_unix.rs
@@ -362,7 +362,7 @@ impl Command {
             // If #[unix_sigpipe] is not specified, reset SIGPIPE to SIG_DFL for backward compatibility.
             //
             // #[unix_sigpipe] is an opportunity to change the default here.
-            if !crate::sys::unix_sigpipe_attr_specified() {
+            if !crate::sys::pal::unix_sigpipe_attr_specified() {
                 #[cfg(target_os = "android")] // see issue #88585
                 {
                     let mut action: libc::sigaction = mem::zeroed();
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
index 6e952ed7c42..6e952ed7c42 100644
--- a/library/std/src/sys/unix/process/process_unix/tests.rs
+++ b/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
index 2fbb3192265..9453c8a384e 100644
--- a/library/std/src/sys/unix/process/process_unsupported.rs
+++ b/library/std/src/sys/pal/unix/process/process_unsupported.rs
@@ -1,8 +1,8 @@
 use crate::fmt;
 use crate::io;
 use crate::num::NonZeroI32;
+use crate::sys::pal::unix::unsupported::*;
 use crate::sys::process::process_common::*;
-use crate::sys::unix::unsupported::*;
 use core::ffi::NonZero_c_int;
 
 use libc::{c_int, pid_t};
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
index 72b7ae18cff..72b7ae18cff 100644
--- 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
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
index 5132eab10a1..5132eab10a1 100644
--- 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
diff --git a/library/std/src/sys/unix/process/process_vxworks.rs b/library/std/src/sys/pal/unix/process/process_vxworks.rs
index 1ff2b2fb383..1ff2b2fb383 100644
--- a/library/std/src/sys/unix/process/process_vxworks.rs
+++ b/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
index 2e596486f9c..2e596486f9c 100644
--- a/library/std/src/sys/unix/process/zircon.rs
+++ b/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
index cf0fe0f47c5..cf0fe0f47c5 100644
--- a/library/std/src/sys/unix/rand.rs
+++ b/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
index 3dbab4cc486..923637cbaf2 100644
--- a/library/std/src/sys/unix/stack_overflow.rs
+++ b/library/std/src/sys/pal/unix/stack_overflow.rs
@@ -55,7 +55,7 @@ mod imp {
     use libc::{MAP_ANON, MAP_PRIVATE, PROT_NONE, PROT_READ, PROT_WRITE, SIGSEGV};
 
     use crate::sync::atomic::{AtomicBool, AtomicPtr, Ordering};
-    use crate::sys::unix::os::page_size;
+    use crate::sys::pal::unix::os::page_size;
     use crate::sys_common::thread_info;
 
     // Signal handler for the SIGSEGV and SIGBUS handlers. We've got guard pages
diff --git a/library/std/src/sys/unix/stdio.rs b/library/std/src/sys/pal/unix/stdio.rs
index 97e75f1b5b6..97e75f1b5b6 100644
--- a/library/std/src/sys/unix/stdio.rs
+++ b/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
index 7e4a01a5ecd..7e4a01a5ecd 100644
--- a/library/std/src/sys/unix/thread.rs
+++ b/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
index 58f7ab84101..58f7ab84101 100644
--- a/library/std/src/sys/unix/thread_local_dtor.rs
+++ b/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
index 2b2d079ee4d..2b2d079ee4d 100644
--- a/library/std/src/sys/unix/thread_local_key.rs
+++ b/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
index 8231f3cba2d..8231f3cba2d 100644
--- a/library/std/src/sys/unix/thread_parking/darwin.rs
+++ b/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
index 185333c072f..185333c072f 100644
--- a/library/std/src/sys/unix/thread_parking/mod.rs
+++ b/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
index 3be08122138..3be08122138 100644
--- a/library/std/src/sys/unix/thread_parking/netbsd.rs
+++ b/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
index ae805d84399..ae805d84399 100644
--- a/library/std/src/sys/unix/thread_parking/pthread.rs
+++ b/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
index f62eb828ee5..f62eb828ee5 100644
--- a/library/std/src/sys/unix/time.rs
+++ b/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
index 61088ff16ed..61088ff16ed 100644
--- a/library/std/src/sys/unix/weak.rs
+++ b/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
index d715ae45401..d715ae45401 100644
--- a/library/std/src/sys/unsupported/alloc.rs
+++ b/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
index a2d75a61976..a2d75a61976 100644
--- a/library/std/src/sys/unsupported/args.rs
+++ b/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
index 5c379992b20..5c379992b20 100644
--- a/library/std/src/sys/unsupported/common.rs
+++ b/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
index d2efec506c5..d2efec506c5 100644
--- a/library/std/src/sys/unsupported/env.rs
+++ b/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
index 6ac1b5d2bcf..6ac1b5d2bcf 100644
--- a/library/std/src/sys/unsupported/fs.rs
+++ b/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
index 6372fca74e0..6372fca74e0 100644
--- a/library/std/src/sys/unsupported/io.rs
+++ b/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
index 3f0943b50ee..3f0943b50ee 100644
--- a/library/std/src/sys/unsupported/locks/condvar.rs
+++ b/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
index 0e0f9eccb21..0e0f9eccb21 100644
--- a/library/std/src/sys/unsupported/locks/mod.rs
+++ b/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
index 4a13c55fb8b..4a13c55fb8b 100644
--- a/library/std/src/sys/unsupported/locks/mutex.rs
+++ b/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
index 789ef9b29e5..789ef9b29e5 100644
--- a/library/std/src/sys/unsupported/locks/rwlock.rs
+++ b/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
index e1a38de6471..e1a38de6471 100644
--- a/library/std/src/sys/unsupported/mod.rs
+++ b/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
index bbc52703f96..bbc52703f96 100644
--- a/library/std/src/sys/unsupported/net.rs
+++ b/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
index 11fde1888ba..11fde1888ba 100644
--- a/library/std/src/sys/unsupported/once.rs
+++ b/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
index 248b34829f2..248b34829f2 100644
--- a/library/std/src/sys/unsupported/os.rs
+++ b/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
index d7d8f297ae5..d7d8f297ae5 100644
--- a/library/std/src/sys/unsupported/pipe.rs
+++ b/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
index a639afcc674..a639afcc674 100644
--- a/library/std/src/sys/unsupported/process.rs
+++ b/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
index b5e3f5be988..b5e3f5be988 100644
--- a/library/std/src/sys/unsupported/stdio.rs
+++ b/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
index a8db251de20..a8db251de20 100644
--- a/library/std/src/sys/unsupported/thread.rs
+++ b/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
index 84660ea5881..84660ea5881 100644
--- a/library/std/src/sys/unsupported/thread_local_dtor.rs
+++ b/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
index b6e5e4cd2e1..b6e5e4cd2e1 100644
--- a/library/std/src/sys/unsupported/thread_local_key.rs
+++ b/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
index 197078bb186..197078bb186 100644
--- a/library/std/src/sys/unsupported/thread_parking.rs
+++ b/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
index 6d67b538a96..6d67b538a96 100644
--- a/library/std/src/sys/unsupported/time.rs
+++ b/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
index c42c310e3a2..c42c310e3a2 100644
--- a/library/std/src/sys/wasi/args.rs
+++ b/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
index 730e356d7fe..730e356d7fe 100644
--- a/library/std/src/sys/wasi/env.rs
+++ b/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
index d7295a799da..d7295a799da 100644
--- a/library/std/src/sys/wasi/fd.rs
+++ b/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
index e8238665452..e8238665452 100644
--- a/library/std/src/sys/wasi/fs.rs
+++ b/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
index 2cd45df88fa..2cd45df88fa 100644
--- a/library/std/src/sys/wasi/io.rs
+++ b/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
index 5919cc506d9..5919cc506d9 100644
--- a/library/std/src/sys/wasi/mod.rs
+++ b/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
index 2239880ffbe..2239880ffbe 100644
--- a/library/std/src/sys/wasi/net.rs
+++ b/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
index d53bddd8e9d..530d3602172 100644
--- a/library/std/src/sys/wasi/os.rs
+++ b/library/std/src/sys/pal/wasi/os.rs
@@ -209,7 +209,7 @@ pub fn env() -> Env {
         return Env { iter: result.into_iter() };
     }
 
-    // See src/libstd/sys/unix/os.rs, same as that
+    // See src/libstd/sys/pal/unix/os.rs, same as that
     fn parse(input: &[u8]) -> Option<(OsString, OsString)> {
         if input.is_empty() {
             return None;
diff --git a/library/std/src/sys/wasi/stdio.rs b/library/std/src/sys/pal/wasi/stdio.rs
index 4cc0e4ed5a4..4cc0e4ed5a4 100644
--- a/library/std/src/sys/wasi/stdio.rs
+++ b/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
index a0eefa8811a..a0eefa8811a 100644
--- a/library/std/src/sys/wasi/thread.rs
+++ b/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
index 016b06efbdc..016b06efbdc 100644
--- a/library/std/src/sys/wasi/time.rs
+++ b/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
index 6dceb1689a8..6dceb1689a8 100644
--- a/library/std/src/sys/wasm/alloc.rs
+++ b/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
index f4fbe9f4855..f4fbe9f4855 100644
--- a/library/std/src/sys/wasm/atomics/futex.rs
+++ b/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
index 714b7049227..714b7049227 100644
--- a/library/std/src/sys/wasm/atomics/thread.rs
+++ b/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
index 730e356d7fe..730e356d7fe 100644
--- a/library/std/src/sys/wasm/env.rs
+++ b/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
index 6c05b56e1bf..6c05b56e1bf 100644
--- a/library/std/src/sys/wasm/mod.rs
+++ b/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
index d53ea16005f..d53ea16005f 100644
--- a/library/std/src/sys/windows/alloc.rs
+++ b/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
index 674a3e1d92d..674a3e1d92d 100644
--- a/library/std/src/sys/windows/alloc/tests.rs
+++ b/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
index a7ea59e85f7..90e1bff52a3 100644
--- a/library/std/src/sys/windows/api.rs
+++ b/library/std/src/sys/pal/windows/api.rs
@@ -27,7 +27,7 @@
 //! This module must only depend on core and not on std types as the eventual
 //! hope is to have std depend on sys and not the other way around.
 //! However, some amount of glue code may currently be necessary so such code
-//! should go in sys/windows/mod.rs rather than here. See `IoResult` as an example.
+//! should go in sys/pal/windows/mod.rs rather than here. See `IoResult` as an example.
 
 use core::ffi::c_void;
 use core::ptr::addr_of;
diff --git a/library/std/src/sys/windows/args.rs b/library/std/src/sys/pal/windows/args.rs
index ee7dba6e5b3..fbbdbc21265 100644
--- a/library/std/src/sys/windows/args.rs
+++ b/library/std/src/sys/pal/windows/args.rs
@@ -6,6 +6,7 @@
 #[cfg(test)]
 mod tests;
 
+use super::os::current_exe;
 use crate::ffi::OsString;
 use crate::fmt;
 use crate::io;
@@ -14,7 +15,6 @@ use crate::os::windows::prelude::*;
 use crate::path::{Path, PathBuf};
 use crate::sys::path::get_long_path;
 use crate::sys::process::ensure_no_nuls;
-use crate::sys::windows::os::current_exe;
 use crate::sys::{c, to_u16s};
 use crate::sys_common::wstr::WStrUnits;
 use crate::vec;
@@ -318,8 +318,8 @@ pub(crate) fn to_user_path(path: &Path) -> io::Result<Vec<u16>> {
     from_wide_to_user_path(to_u16s(path)?)
 }
 pub(crate) fn from_wide_to_user_path(mut path: Vec<u16>) -> io::Result<Vec<u16>> {
+    use super::fill_utf16_buf;
     use crate::ptr;
-    use crate::sys::windows::fill_utf16_buf;
 
     // UTF-16 encoded code points, used in parsing and building UTF-16 paths.
     // All of these are in the ASCII range so they can be cast directly to `u16`.
diff --git a/library/std/src/sys/windows/args/tests.rs b/library/std/src/sys/pal/windows/args/tests.rs
index 82c32d08c5e..484a90ab056 100644
--- a/library/std/src/sys/windows/args/tests.rs
+++ b/library/std/src/sys/pal/windows/args/tests.rs
@@ -1,5 +1,5 @@
+use super::*;
 use crate::ffi::OsString;
-use crate::sys::windows::args::*;
 
 fn chk(string: &str, parts: &[&str]) {
     let mut wide: Vec<u16> = OsString::from(string).encode_wide().collect();
diff --git a/library/std/src/sys/windows/c.rs b/library/std/src/sys/pal/windows/c.rs
index d55d9bace81..d55d9bace81 100644
--- a/library/std/src/sys/windows/c.rs
+++ b/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
index f91e1054a04..f91e1054a04 100644
--- a/library/std/src/sys/windows/c/windows_sys.lst
+++ b/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
index b38b70c8983..b38b70c8983 100644
--- a/library/std/src/sys/windows/c/windows_sys.rs
+++ b/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
index 36578d5a34e..36578d5a34e 100644
--- a/library/std/src/sys/windows/cmath.rs
+++ b/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
index f60b3a2c700..f60b3a2c700 100644
--- a/library/std/src/sys/windows/compat.rs
+++ b/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
index f0a99d6200c..f0a99d6200c 100644
--- a/library/std/src/sys/windows/env.rs
+++ b/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
index 42484543686..42484543686 100644
--- a/library/std/src/sys/windows/fs.rs
+++ b/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
index c4495f81a5a..c4495f81a5a 100644
--- a/library/std/src/sys/windows/handle.rs
+++ b/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
index d836dae4c30..d836dae4c30 100644
--- a/library/std/src/sys/windows/handle/tests.rs
+++ b/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
index 649826d25ce..649826d25ce 100644
--- a/library/std/src/sys/windows/io.rs
+++ b/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
index 66fafa2c00b..953bcc27dee 100644
--- a/library/std/src/sys/windows/locks/condvar.rs
+++ b/library/std/src/sys/pal/windows/locks/condvar.rs
@@ -27,7 +27,7 @@ impl Condvar {
         let r = c::SleepConditionVariableSRW(
             self.inner.get(),
             mutex::raw(mutex),
-            crate::sys::windows::dur2timeout(dur),
+            crate::sys::pal::windows::dur2timeout(dur),
             0,
         );
         if r == 0 {
diff --git a/library/std/src/sys/windows/locks/mod.rs b/library/std/src/sys/pal/windows/locks/mod.rs
index 0e0f9eccb21..0e0f9eccb21 100644
--- a/library/std/src/sys/windows/locks/mod.rs
+++ b/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
index ef2f84082cd..ef2f84082cd 100644
--- a/library/std/src/sys/windows/locks/mutex.rs
+++ b/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
index e69415baac4..e69415baac4 100644
--- a/library/std/src/sys/windows/locks/rwlock.rs
+++ b/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
index b9e5bcc1b4b..b9e5bcc1b4b 100644
--- a/library/std/src/sys/windows/memchr.rs
+++ b/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
index 8b722f01a5d..8b722f01a5d 100644
--- a/library/std/src/sys/windows/mod.rs
+++ b/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
index 6cd758ec5c3..c34e01e000a 100644
--- a/library/std/src/sys/windows/net.rs
+++ b/library/std/src/sys/pal/windows/net.rs
@@ -90,7 +90,7 @@ pub fn cvt_gai(err: c_int) -> io::Result<()> {
     if err == 0 { Ok(()) } else { Err(last_error()) }
 }
 
-/// Just to provide the same interface as sys/unix/net.rs
+/// Just to provide the same interface as sys/pal/unix/net.rs
 pub fn cvt_r<T, F>(mut f: F) -> io::Result<T>
 where
     T: IsMinusOne,
diff --git a/library/std/src/sys/windows/os.rs b/library/std/src/sys/pal/windows/os.rs
index 829dd5eb97a..829dd5eb97a 100644
--- a/library/std/src/sys/windows/os.rs
+++ b/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
index 458d6e11c20..458d6e11c20 100644
--- a/library/std/src/sys/windows/os/tests.rs
+++ b/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
index 237854fac4e..237854fac4e 100644
--- a/library/std/src/sys/windows/os_str.rs
+++ b/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
index d9684f21753..d9684f21753 100644
--- a/library/std/src/sys/windows/path.rs
+++ b/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
index 623c6236166..623c6236166 100644
--- a/library/std/src/sys/windows/path/tests.rs
+++ b/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
index 7624e746f5c..7624e746f5c 100644
--- a/library/std/src/sys/windows/pipe.rs
+++ b/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
index 9ec775959fd..9ec775959fd 100644
--- a/library/std/src/sys/windows/process.rs
+++ b/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
index 3fc0c75240c..3fc0c75240c 100644
--- a/library/std/src/sys/windows/process/tests.rs
+++ b/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
index 5d8fd13785a..5d8fd13785a 100644
--- a/library/std/src/sys/windows/rand.rs
+++ b/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
index 627763da856..627763da856 100644
--- a/library/std/src/sys/windows/stack_overflow.rs
+++ b/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
index afdf7f566ae..afdf7f566ae 100644
--- a/library/std/src/sys/windows/stack_overflow_uwp.rs
+++ b/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
index 819a48266d9..96c23f82aec 100644
--- a/library/std/src/sys/windows/stdio.rs
+++ b/library/std/src/sys/pal/windows/stdio.rs
@@ -1,5 +1,6 @@
 #![unstable(issue = "none", feature = "windows_stdio")]
 
+use super::api;
 use crate::cmp;
 use crate::io;
 use crate::mem::MaybeUninit;
@@ -9,7 +10,6 @@ use crate::str;
 use crate::sys::c;
 use crate::sys::cvt;
 use crate::sys::handle::Handle;
-use crate::sys::windows::api;
 use core::str::utf8_char_width;
 
 #[cfg(test)]
diff --git a/library/std/src/sys/windows/stdio/tests.rs b/library/std/src/sys/pal/windows/stdio/tests.rs
index 1e53e0bee63..1e53e0bee63 100644
--- a/library/std/src/sys/windows/stdio/tests.rs
+++ b/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
index 1fe74493519..1fe74493519 100644
--- a/library/std/src/sys/windows/thread.rs
+++ b/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
index cf542d2bfb8..cf542d2bfb8 100644
--- a/library/std/src/sys/windows/thread_local_dtor.rs
+++ b/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
index 5eee4a9667b..5eee4a9667b 100644
--- a/library/std/src/sys/windows/thread_local_key.rs
+++ b/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
index c739f0caf3e..c739f0caf3e 100644
--- a/library/std/src/sys/windows/thread_local_key/tests.rs
+++ b/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
index eb9167cd855..eb9167cd855 100644
--- a/library/std/src/sys/windows/thread_parking.rs
+++ b/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
index 09e78a29304..09e78a29304 100644
--- a/library/std/src/sys/windows/time.rs
+++ b/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
index b3a3e691e0d..b3a3e691e0d 100644
--- a/library/std/src/sys/xous/alloc.rs
+++ b/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
index 1bb38dfa341..1bb38dfa341 100644
--- a/library/std/src/sys/xous/locks/condvar.rs
+++ b/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
index f3c5c5d9fb0..f3c5c5d9fb0 100644
--- a/library/std/src/sys/xous/locks/mod.rs
+++ b/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
index ea51776d54e..ea51776d54e 100644
--- a/library/std/src/sys/xous/locks/mutex.rs
+++ b/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
index 618da758adf..618da758adf 100644
--- a/library/std/src/sys/xous/locks/rwlock.rs
+++ b/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
index c2550dcfd83..c2550dcfd83 100644
--- a/library/std/src/sys/xous/mod.rs
+++ b/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
index 8d2eaee8aa6..8d2eaee8aa6 100644
--- a/library/std/src/sys/xous/os.rs
+++ b/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
index 2ac694641ba..2ac694641ba 100644
--- a/library/std/src/sys/xous/stdio.rs
+++ b/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
index 78c68de7bf3..78c68de7bf3 100644
--- a/library/std/src/sys/xous/thread.rs
+++ b/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
index 3771ea65700..3771ea65700 100644
--- a/library/std/src/sys/xous/thread_local_key.rs
+++ b/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
index aa39c6d2718..aa39c6d2718 100644
--- a/library/std/src/sys/xous/thread_parking.rs
+++ b/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
index 4e4ae67efff..4e4ae67efff 100644
--- a/library/std/src/sys/xous/time.rs
+++ b/library/std/src/sys/pal/xous/time.rs