Commit Graph

64709 Commits

Author SHA1 Message Date
Augustin Cavalier
1b72036bef libroot: Replace scandir, alphasort implementations with musl's.
Notably alphasort actually uses strcoll not strcmp, so this does
affect behavior. scandir should be the same.
2022-09-27 17:28:46 -04:00
Augustin Cavalier
d2d46658d7 libroot: Move threads.c to libstdthread folder and rename to match FreeBSD.
It was introduced long ago, now that we have the same folder as FreeBSD
does we should put it in the same place.

Synchronize with FreeBSD while at it.
2022-09-27 17:24:57 -04:00
David Karoly
a3c9f71efd boot/efi: factor out generic mmu functions
This change moves the common functions related to EFI memory map
to arch/generic for arm, arm64, x86.

riscv64 and x86_64 shall be handled separately as they use some
more architecture-specific logic:
* riscv64 needs special treatment for the M-mode resident code
  located at 0x80000000 which is reported as available in the
  EFI memory map provided by u-boot.
* x86_64 has a slightly different logic for building the
  memory regions list so some additional rework and testing will be
  needed before it can be unified with the generic mmu functions.

Change-Id: I430c84dfc693c5b6f04c170dec8ffb1db2c2ace1
Reviewed-on: https://review.haiku-os.org/c/haiku/+/5694
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
2022-09-27 19:13:36 +00:00
Oscar Lesta
c907db6c62 Tracker: fix build with DEBUG=1
Change-Id: Ieaaf23b0780f50837153634ad3e82eda6e5978f8
Reviewed-on: https://review.haiku-os.org/c/haiku/+/5700
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2022-09-27 19:12:54 +00:00
Jérôme Duval
2b9426c90a hda: detect one more intel audio device per device ID
Change-Id: I91de99c0242a2546e0a3cac94a4f46719f048889
Reviewed-on: https://review.haiku-os.org/c/haiku/+/5699
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2022-09-26 17:32:17 +00:00
David Karoly
820db870a7 kernel/x86: fix build for 32-bit ELF loader on 64-bit arch
Change-Id: I7c9e8cb7a3d03d40167f7924c17e95f5ad646afe
Reviewed-on: https://review.haiku-os.org/c/haiku/+/5695
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Reviewed-by: Jérôme Duval <jerome.duval@gmail.com>
2022-09-26 14:54:39 +00:00
Oscar Lesta
5d7ed80a63 /bin/pidof: add it to regular images and to the Haiku package.
Change-Id: I07cbc6b715ee5d549ec4fcaf9b28398ee6ffb3dc
Reviewed-on: https://review.haiku-os.org/c/haiku/+/5697
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Reviewed-by: Jérôme Duval <jerome.duval@gmail.com>
Reviewed-by: Adrien Destugues <pulkomandy@pulkomandy.tk>
2022-09-26 14:50:02 +00:00
Dominic Martinez
388d91a7b8 build: fix jam clean when using emulated attributes
should help #10065

Change-Id: I4ebe28834201076c6710be52fc2ace580099dd6c
Reviewed-on: https://review.haiku-os.org/c/haiku/+/5313
Reviewed-by: Jérôme Duval <jerome.duval@gmail.com>
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
2022-09-26 14:31:07 +00:00
David Karoly
5897f7b623 boot/efi/x86: enable support for 64-bit ELF
Change-Id: Id3b207444b55041dc83ee1afdd61b467ce13ff70
Reviewed-on: https://review.haiku-os.org/c/haiku/+/5665
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Reviewed-by: Adrien Destugues <pulkomandy@pulkomandy.tk>
2022-09-26 14:30:19 +00:00
Jérôme Duval
fbca1c4088 kernel/x86_64: configure LFENCE as a serializing instruction on AMD
Change-Id: I152bf41c3479f81fc458abdf8d89874ffa3a08d7
Reviewed-on: https://review.haiku-os.org/c/haiku/+/5691
Reviewed-by: Jérôme Duval <jerome.duval@gmail.com>
2022-09-25 08:15:15 +00:00
Jérôme Duval
a6e9176bc5 x86_64: prefix rdtsc with lfence, or use rdtscp if available
a strong monotonicity is a property of system_time(). Performance should be
a bit impacted (around 10%).
removed omit-frame-pointer hints as the compiler generates the same without.

Change-Id: I920145d616604f32b38d9e134ce83f3e0e848bc7
Reviewed-on: https://review.haiku-os.org/c/haiku/+/5690
Reviewed-by: Adrien Destugues <pulkomandy@pulkomandy.tk>
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
2022-09-25 08:13:49 +00:00
Niels Sascha Reedijk
a0b75afc0f NetServices: add missing include 2022-09-24 09:49:51 +01:00
Mashijams
99071c0c0b xfs: Symbolic links support
- Necessary hooks for reading symlinks are implemented

- Added support for local symlinks

- Added support for extent based symlinks

- This patch completes #17791

Change-Id: If6847974562b21f751097df357326f4643eff757
Reviewed-on: https://review.haiku-os.org/c/haiku/+/5621
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Reviewed-by: Adrien Destugues <pulkomandy@pulkomandy.tk>
2022-09-24 08:23:38 +00:00
Autocomitter
f31b83f7ef Update translations from Pootle 2022-09-24 08:16:36 +00:00
Jérôme Duval
2e69f2b076 kernel/x86: init the tsc frequency and clock speed from CPUID when available
only for Intel newer CPUs.

Change-Id: Icd83f3b643796bfb3725b5c8877b9e7828bc71d9
Reviewed-on: https://review.haiku-os.org/c/haiku/+/5688
Reviewed-by: Adrien Destugues <pulkomandy@pulkomandy.tk>
Reviewed-by: Fredrik Holmqvist <fredrik.holmqvist@gmail.com>
Reviewed-by: Alex von Gluck IV <kallisti5@unixzen.com>
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
2022-09-24 00:35:02 +00:00
David Karoly
84bd9b4ad5 boot/efi/arm64/mmu: convert TRACE to use new syntax
Change-Id: Ib25cee9e7ea37a68d0d432db8b99eb419e453e7f
Reviewed-on: https://review.haiku-os.org/c/haiku/+/5689
Reviewed-by: Fredrik Holmqvist <fredrik.holmqvist@gmail.com>
Reviewed-by: David Karoly <karolyd577@gmail.com>
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
2022-09-23 18:10:39 +00:00
David Karoly
cec78ae332 kernel/arm64: introduce virtual_ranges_to_keep
Change-Id: I6de950cb18892ebf2dd2aefa34b65b90a17e3f2c
Reviewed-on: https://review.haiku-os.org/c/haiku/+/5682
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Reviewed-by: Adrien Destugues <pulkomandy@pulkomandy.tk>
Reviewed-by: David Karoly <karolyd577@gmail.com>
2022-09-23 13:57:43 +00:00
David Karoly
a0c8f15f33 kernel/arm64: implement iframe stack and unwinding
Change-Id: I1587c1f57bd73777a188bb8f1bc58263de82fcb9
Reviewed-on: https://review.haiku-os.org/c/haiku/+/5684
Reviewed-by: Adrien Destugues <pulkomandy@pulkomandy.tk>
Reviewed-by: David Karoly <karolyd577@gmail.com>
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
2022-09-23 13:56:16 +00:00
David Karoly
139831c54c boot/efi/x86_64: log memory map on bootup
Change-Id: I94c169d598d771a813b16e31fd892d7cdafcaad8
Reviewed-on: https://review.haiku-os.org/c/haiku/+/5687
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Reviewed-by: Adrien Destugues <pulkomandy@pulkomandy.tk>
2022-09-23 11:39:04 +00:00
Jérôme Duval
ca6d474a73 virtio_block: add support for the topology feature
gets the physical block size

Change-Id: I7b4d80874d1463a5122c34171956af2b267b1c69
Reviewed-on: https://review.haiku-os.org/c/haiku/+/5669
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Reviewed-by: Adrien Destugues <pulkomandy@pulkomandy.tk>
2022-09-23 06:56:01 +00:00
Jérôme Duval
143a5f8ce6 DriveSetup: add a column for the physical block size
Change-Id: Id43df9eb4a3619ba265ed25aeb7ec82d0a26358c
Reviewed-on: https://review.haiku-os.org/c/haiku/+/5668
Reviewed-by: Adrien Destugues <pulkomandy@pulkomandy.tk>
Reviewed-by: Fredrik Holmqvist <fredrik.holmqvist@gmail.com>
2022-09-23 06:56:01 +00:00
Jérôme Duval
688acf41a3 add physical_block_size field where applicable
only scsi_disk checks the actual value, other drivers take the logical block size.

This change reports the physical block size from the disk rather than the block
size used by IDE/SATA/SCSI commands. On typical modern SATA disks, the SATA
commands will use 512 byte blocks, but the disk will actually read and write
4K blocks internally. This is only of importance for partition alignment for DriveSetup,
and is independant of file systems or partitioning systems. This could also influence
the recommended block size for some file systems.

Change-Id: Id0f2e22659e89fcef64c1f8d04f81cd68995e01f
Reviewed-on: https://review.haiku-os.org/c/haiku/+/5667
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Reviewed-by: Adrien Destugues <pulkomandy@pulkomandy.tk>
2022-09-23 06:56:01 +00:00
Jérôme Duval
285fe6257a libroot: fix *_np functions signature
fix f33f4868fe
*_np functions are in a not included header.
add weak aliases for the future functions without _np.

Change-Id: Ie2bcc9173a2b93a6c4052c039cb37930c1c3aaa1
Reviewed-on: https://review.haiku-os.org/c/haiku/+/5685
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2022-09-22 04:32:15 +00:00
Jérôme Duval
146d687026 cpu_type.h: remove vendor string at any place
fix bug #17951

Change-Id: Icc0ac964ff9c6322612dadb459d28a97ac69e91a
Reviewed-on: https://review.haiku-os.org/c/haiku/+/5686
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Reviewed-by: Jérôme Duval <jerome.duval@gmail.com>
2022-09-21 19:02:08 +00:00
PulkoMandy
e3d5904751 Disk Device Manager: generate a name for nameless volumes
This will give the same result as fs_stat_dev, so the filesystems will
have the same name everywhere.

Change-Id: Ic684142efaeb2c16b393f3f3e5c9c3010a054b30
Reviewed-on: https://review.haiku-os.org/c/haiku/+/5636
Reviewed-by: Jérôme Duval <jerome.duval@gmail.com>
2022-09-21 16:14:32 +00:00
X512
74a5cb7bbc shared: move ScopeExit from riscv64 arch kernel code
this file is c++11 only.

Change-Id: Ibff7acec00337a9f56f9b8e29ea262c8d64c2446
Reviewed-on: https://review.haiku-os.org/c/haiku/+/5292
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Reviewed-by: Fredrik Holmqvist <fredrik.holmqvist@gmail.com>
Reviewed-by: Jérôme Duval <jerome.duval@gmail.com>
2022-09-21 16:09:33 +00:00
John Scipione
b4d0fd9177 AboutSystem: Update replicant colors on workspace activated
Change-Id: I23bc998df8c9cc8894accc475cab8eec69db7c21
Reviewed-on: https://review.haiku-os.org/c/haiku/+/5514
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Reviewed-by: Fredrik Holmqvist <fredrik.holmqvist@gmail.com>
2022-09-21 15:26:29 +00:00
John Scipione
074aebe307 AboutSystem: Add system information replicant
Fixes #16130 (incidentally)

Change-Id: I764d143a0e6b9ebf8679149edd2aca463cb8ebfb
Reviewed-on: https://review.haiku-os.org/c/haiku/+/5511
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Reviewed-by: John Scipione <jscipione@gmail.com>
Reviewed-by: Jérôme Duval <jerome.duval@gmail.com>
2022-09-21 15:26:29 +00:00
David Karoly
537d67ae5c kernel/arm: fix frame pointer after unwinding iframe
Change-Id: I285896ff6624e26695e282d02011a31de32fc297
Reviewed-on: https://review.haiku-os.org/c/haiku/+/5678
Reviewed-by: Fredrik Holmqvist <fredrik.holmqvist@gmail.com>
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
2022-09-20 08:19:47 +00:00
Jérôme Duval
799ab823bb libroot: Add support for C11 Threads missing parts (except gcc2).
The respective files can be found in the FreeBSD source tree at:
- lib/libstdthreads/call_once.c
- lib/libstdthreads/cnd.c
- lib/libstdthreads/mtx.c
- lib/libstdthreads/threads.h
- lib/libstdthreads/tss.c

Missing is support for PTHREAD_DESTRUCTOR_ITERATIONS.

Change-Id: I7a6c79954f36195eadd1351d308c21a001192232
Reviewed-on: https://review.haiku-os.org/c/haiku/+/5675
Reviewed-by: Fredrik Holmqvist <fredrik.holmqvist@gmail.com>
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
2022-09-19 19:45:45 +00:00
Niels Sascha Reedijk
4125af2aeb Login: Fix typo in help message
Reported by zuMi, while contributing to the Italian translations. Thanks!

Change-Id: I15e8fc17390188c6d0051384d047ebe06d19a2bc
Reviewed-on: https://review.haiku-os.org/c/haiku/+/5677
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Reviewed-by: Jérôme Duval <jerome.duval@gmail.com>
2022-09-19 16:54:23 +00:00
David Karoly
ef89435316 boot/x86: unify KERNEL_LOAD_ADDRESS for BIOS and EFI
Change-Id: Ia3157c7c0908698da94c1aa85cb6366fb00fb7f1
Reviewed-on: https://review.haiku-os.org/c/haiku/+/5670
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Reviewed-by: Jérôme Duval <jerome.duval@gmail.com>
Reviewed-by: Fredrik Holmqvist <fredrik.holmqvist@gmail.com>
2022-09-19 14:51:58 +00:00
David Karoly
303283fb7a kernel/arm64: implement stack trace
Change-Id: If5627fb4d37bdb7260d7e14c0c3e8cf7bcbee53d
Reviewed-on: https://review.haiku-os.org/c/haiku/+/5672
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Reviewed-by: Jérôme Duval <jerome.duval@gmail.com>
Reviewed-by: David Karoly <karolyd577@gmail.com>
2022-09-19 14:51:18 +00:00
David Karoly
9a31a30528 implement TLS for arm64
Use the EL0 Read-Only Software Thread ID Register aka TPIDRRO_EL0
to store TLS pointer.

The EL0 Read-Only Software Thread ID Register is read-only in User mode
and read/write in privileged modes.

Change-Id: Idea7e3d66cd391dbbe3f9395cb37716089a49e13
Reviewed-on: https://review.haiku-os.org/c/haiku/+/5673
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Reviewed-by: Fredrik Holmqvist <fredrik.holmqvist@gmail.com>
Reviewed-by: David Karoly <karolyd577@gmail.com>
2022-09-19 14:51:00 +00:00
Javier Steinaker
244a9826b8 strptime: swapped the order of the constants to make musl's implementation Haiku-compatible
Change-Id: Iecfe13dcf8e8216e274ed1f194e1c891042f6bd1
Reviewed-on: https://review.haiku-os.org/c/haiku/+/5635
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Reviewed-by: Fredrik Holmqvist <fredrik.holmqvist@gmail.com>
Reviewed-by: Niels Sascha Reedijk <niels.reedijk@gmail.com>
2022-09-18 20:49:43 +00:00
Javier Steinaker
baed91b3b6 strptime: swapped the order of the constants to make musl's implementation Haiku-compatible
Change-Id: Iecfe13dcf8e8216e274ed1f194e1c891042f6bd1
2022-09-18 16:23:31 +01:00
Niels Sascha Reedijk
da8162be21 Merge branch 'master' into dev/netservices
Change-Id: Ic4c065b9a76fcabd6450dd1ab5882510f922a128
2022-09-18 16:16:37 +01:00
Niels Sascha Reedijk
c68590fd4d Tests: fix unittest build and include BMemoryRingIO shared tests
When change 2966 was merged as hrev56269, it was decided to first introduce
this in libshared instead of libbe.so. The test was moved accordingly, but
not all the code in the unittests was properly updated. This change completes
it.

Note that the test currently crashes, so it needs more investigation whether
that is a test issue or a BMemoryRingIO issue. Fixing this is beyond the
scope of this change.

Change-Id: I0f61d1dd013da904b3e4545db11fefa9da2da0a2
Reviewed-on: https://review.haiku-os.org/c/haiku/+/5676
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Reviewed-by: Jérôme Duval <jerome.duval@gmail.com>
2022-09-18 14:11:06 +00:00
David Karoly
98dea60252 kernel/x86/elf: fix build with TRACE enabled
Change-Id: Ibed0d5e628500b0c5e2f999d95587490079519d3
Reviewed-on: https://review.haiku-os.org/c/haiku/+/5671
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Reviewed-by: Fredrik Holmqvist <fredrik.holmqvist@gmail.com>
2022-09-18 06:16:09 +00:00
Autocomitter
f43b68b9c8 Update translations from Pootle 2022-09-17 08:15:39 +00:00
Jérôme Duval
a9ada46be8 ahci: propagate physical block size to scsi read capacity 16
Change-Id: I8dab117fe8da9fc6e0f18adaa178ff79bc7c6ae4
Reviewed-on: https://review.haiku-os.org/c/haiku/+/5666
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Reviewed-by: Jérôme Duval <jerome.duval@gmail.com>
2022-09-16 09:16:19 +00:00
David Karoly
806a5d179e boot/efi/x86: move bootGDTDescriptor to local variable
Global variable gBootGDTDescriptor is used only in function arch_start_kernel()
so we can convert it to a local variable.

Change-Id: I8b6ad2c0903364bdcdcc1039aea6c9c09253fe09
Reviewed-on: https://review.haiku-os.org/c/haiku/+/5663
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Reviewed-by: David Karoly <karolyd577@gmail.com>
2022-09-15 07:39:02 +00:00
David Karoly
6a7095af63 boot/efi/x86: move bootGDT local variable
Global variable gBootGDT is used only in function arch_mmu_init_gdt()
so we can convert it to a local variable.

Change-Id: I06174dcd6df4b7bd5136a7e2fabafdc3273f03d3
Reviewed-on: https://review.haiku-os.org/c/haiku/+/5662
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Reviewed-by: Fredrik Holmqvist <fredrik.holmqvist@gmail.com>
2022-09-15 07:39:02 +00:00
David Karoly
e98ad6fc50 kernel/x86/pae: fix build with TRACE enabled
Change-Id: Ifbf979608978a66ad6d2b9af8002c39f1f205422
Reviewed-on: https://review.haiku-os.org/c/haiku/+/5661
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
2022-09-15 04:36:38 +00:00
David Karoly
f9be2680d9 x86: use elif defined(__x86_64__) in arch_kernel.h
Change-Id: Ibad5f34d73d48c5d1af870131f20ae9b52d88eb8
Reviewed-on: https://review.haiku-os.org/c/haiku/+/5664
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Reviewed-by: Jérôme Duval <jerome.duval@gmail.com>
2022-09-15 04:33:47 +00:00
PulkoMandy
49a00a128a userlandfs: implement get_fs_info using ioctl
This avoids introducing an entirely custom hook in FUSE.
It uses the ioctl hook in an unconventional way (calling it with no
valid fuse_file_info) but this can be fixed if a filesystem requires it
(by opening a file handle on /, doing the ioctl, then closing again).

An updated version of fusesmb-haiku is available and confirmed working:
https://github.com/haikuarchives/fusesmb-haiku

Change-Id: If1268113874363fa035e5340be75e9f5198216d6
Reviewed-on: https://review.haiku-os.org/c/haiku/+/5199
Reviewed-by: Adrien Destugues <pulkomandy@pulkomandy.tk>
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
2022-09-13 18:51:12 +00:00
Jérôme Duval
750afaef94 bfs: disable some block sizes when the partition size is too small
these would otherwise trigger an assert when initializing.
fixes #6781

Change-Id: I4fa34455e7734f6a4039705527bf5ab09b46998d
Reviewed-on: https://review.haiku-os.org/c/haiku/+/5659
Reviewed-by: Adrien Destugues <pulkomandy@pulkomandy.tk>
2022-09-13 18:48:25 +00:00
Jérôme Duval
eac10866e2 DriveSetup: select the actual partition type instead of defaulting to BeFS
Change-Id: Id73ad3398e802eb10b1928317bb9987ddee30eb6
Reviewed-on: https://review.haiku-os.org/c/haiku/+/5658
Reviewed-by: Adrien Destugues <pulkomandy@pulkomandy.tk>
2022-09-13 18:48:25 +00:00
Jérôme Duval
6b3e198d41 gpt: let the type be changed
Change-Id: I1c049c28b416d13b679aa32eb8cbc41a3273a05d
Reviewed-on: https://review.haiku-os.org/c/haiku/+/5657
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2022-09-13 18:48:25 +00:00
Jérôme Duval
6b7504173c kernel: KPartitioningSystem::SetType() should use the child ID
KPartitioningSystem::SetName() and KPartitioningSystem::SetType() are very similar.
SetName() already worked for GPT, and with this change SetType() now works for GPT too.
Change-Id: If1456a8f5e94ae2e2a05b75e3691f912bd1324ee
Reviewed-on: https://review.haiku-os.org/c/haiku/+/5656
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
2022-09-13 18:48:25 +00:00