Commit Graph

61185 Commits

Author SHA1 Message Date
waddlesplash
8e12c92fee freebsd_network: Implement mtx_destroy for spinlocks.
Somehow, I missed this when implementing MTX_SPIN in the first place,
and it went largely unnoticed because MTX_SPIN is rarely used and
apparently even more rarely destroyed.

Should fix #15749.
2020-03-24 21:06:37 -04:00
Alexander von Gluck IV
cb837539f5 build/scripts: make toolchain scripts more self-sustainable
Change-Id: Ibe4cf105a20184392498371ba770529d69bd61a7
Reviewed-on: https://review.haiku-os.org/c/haiku/+/2417
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2020-03-24 18:24:13 +00:00
X512
9d6177614b PPMTranslator: fix clang warning self-assign, remove redurant braces
Change-Id: I2b3f61fdf482c56b4520174e7a9c48f4ac64e1f2
Reviewed-on: https://review.haiku-os.org/c/haiku/+/2404
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>
2020-03-24 03:09:55 +00:00
X512
33378c1413 Bluetooth: fix out of bounds access
Pointed by clang.

Change-Id: If8f60619bd98027ae7bc0e7ecaa1c86db6bacf0e
Reviewed-on: https://review.haiku-os.org/c/haiku/+/2403
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>
2020-03-24 03:09:55 +00:00
Jérôme Duval
39a7a69b07 boot_loader: add missing stubs
u_boot build still broken

Change-Id: Iba93ce7bf0d5c30a95ff98420a2e419eb28bb398
Reviewed-on: https://review.haiku-os.org/c/haiku/+/2412
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>
2020-03-23 18:29:56 +00:00
Jérôme Duval
bed01fe356 AreaKeeper.h: move to headers/private/kernel
Change-Id: I9ae2b9a6243809a618c0520a26e064ce3c5be2b4
Reviewed-on: https://review.haiku-os.org/c/haiku/+/2410
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2020-03-23 16:38:01 +00:00
Jérôme Duval
2930142932 ArchitectureRules: define HAIKU_KERNEL_PIC_CCFLAGS for x86
fix broken x86_gcc2 build after 515ec47340
2020-03-23 17:24:13 +01:00
Jérôme Duval
0dbbeede37 kernel: map signal processing/data acquisition in the device manager
Change-Id: I1ef8b1d2c26a7dcf04956e6ca3c591d480c881a0
Reviewed-on: https://review.haiku-os.org/c/haiku/+/2387
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>
2020-03-23 15:38:52 +00:00
Jérôme Duval
e2a1fdf983 PCI: add subclasses for data acquisition
Change-Id: Ic4326300e4be0d9dccb4a1c8c50c0118318f62d9
Reviewed-on: https://review.haiku-os.org/c/haiku/+/2386
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>
Reviewed-by: John Scipione <jscipione@gmail.com>
2020-03-23 15:38:52 +00:00
Jérôme Duval
3bb1319682 pch_thermal: driver for intel pch thermal devices
Change-Id: I7b750957727d222b464acf3b84fb9a9d6efee9b5
Reviewed-on: https://review.haiku-os.org/c/haiku/+/2385
Reviewed-by: Jérôme Duval <jerome.duval@gmail.com>
2020-03-23 15:38:52 +00:00
Jérôme Duval
11f8b65a79 boot_loader: load intel microcode update data file
Previous version of the patch was broken by the EFI refactoring.

Change-Id: I6dd125100b22b2461c531bfd8f81b3dd28e2b751
Reviewed-on: https://review.haiku-os.org/c/haiku/+/2409
Reviewed-by: Jérôme Duval <jerome.duval@gmail.com>
2020-03-23 15:33:34 +00:00
waddlesplash
6f857fa9fb Revert "boot_loader: load intel microcode update data file"
This reverts commit a732059324.

It broke the build on most boot platforms (including EFI.)
2020-03-23 10:09:21 -04:00
X512
e2c0896a2b Sudoku: 64 bit fix
Pointed by clang.

Change-Id: I996454dcee8484716946d08d3318daf8d815b7cf
Reviewed-on: https://review.haiku-os.org/c/haiku/+/2402
Reviewed-by: Jérôme Duval <jerome.duval@gmail.com>
2020-03-23 10:20:38 +00:00
Jérôme Duval
a732059324 boot_loader: load intel microcode update data file
Change-Id: I323a57cc0b1f05ad7b60b6a141d068a3e618ee4d
Reviewed-on: https://review.haiku-os.org/c/haiku/+/2263
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>
2020-03-23 06:16:28 +00:00
X512
fc179324b0 radeon: fix computing difference
Also fix clang warning self-assign.

Pointed by clang.

Change-Id: I0e104420414fecece87015a0af9a4535ccfc8263
Reviewed-on: https://review.haiku-os.org/c/haiku/+/2401
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2020-03-23 01:30:23 +00:00
X512
39be4f89f5 Fix clang warning string-plus-int
Clang message: error: adding 'size_t' (aka 'unsigned long') to a string
does not append to the string

Change-Id: Ice854f584e92917aca6821d5ec2352fc4e38f2f0
Reviewed-on: https://review.haiku-os.org/c/haiku/+/2395
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2020-03-23 01:30:23 +00:00
X512
f17d2fbb4e app_server: fix clang warning tautological-constant-out-of-range-compare
Clang message: error: result of comparison of constant -1 with expression
of type 'direct_driver_state' is always true

Change-Id: I0ae352985a143f1d97b02ca01550480613db6c3e
Reviewed-on: https://review.haiku-os.org/c/haiku/+/2394
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2020-03-23 01:30:23 +00:00
X512
668ecf4f09 Kernel: fix operator priority warning
Pointed by clang.

Change-Id: I16aa242c94abdf1fa22c4651e63c8c236e6c1a82
Reviewed-on: https://review.haiku-os.org/c/haiku/+/2393
Reviewed-by: John Scipione <jscipione@gmail.com>
2020-03-23 01:30:23 +00:00
X512
f7db27344f Keymap: remove iterator change inside for loop, no functional change
Pointed by clang.

Change-Id: I3aaad5b1e03385358ccb729251fa31d35108f389
Reviewed-on: https://review.haiku-os.org/c/haiku/+/2392
Reviewed-by: John Scipione <jscipione@gmail.com>
Reviewed-by: Alex von Gluck IV <kallisti5@unixzen.com>
2020-03-23 01:30:23 +00:00
X512
1e3d4cf78c Kernel: remove dead code
area->name is a fixed array inside struct, not pointer, so it should
be never be NULL.

Pointed by clang.

Change-Id: Ic8930450cb8461eef158bc854f214eb47d92ce22
Reviewed-on: https://review.haiku-os.org/c/haiku/+/2391
Reviewed-by: Jérôme Duval <jerome.duval@gmail.com>
2020-03-23 01:30:23 +00:00
X512
8152128002 Fix clang warning "mismatched-tags"
Change-Id: I00f26e27d8ac24a46b528ea7ed47b92c2967ff2e
Reviewed-on: https://review.haiku-os.org/c/haiku/+/2390
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2020-03-23 01:30:23 +00:00
X512
77f5125586 Fix double extern "C" pointed by clang.
Change-Id: Ie595dd99d01149868a4f60354ef89fa861cf856b
Reviewed-on: https://review.haiku-os.org/c/haiku/+/2389
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2020-03-23 01:30:23 +00:00
Augustin Cavalier
cc0823d82e nvme_disk: Undefine PTHREAD_MUTEX_INITIALIZER before defining it.
Some things seem to indirectly include <thread_types> which includes
<pthread.h>.

Fixes a warning.
2020-03-22 20:52:46 -04:00
Augustin Cavalier
9c878a9a89 nvme_disk: Use addr_t for pointer arithmetic.
No functional change (intended).
2020-03-22 20:52:01 -04:00
Augustin Cavalier
515ec47340 ArchitectureRules: Make HAIKU_KERNEL_PIC_CCFLAGS empty by default.
This makes it entirely up to the per-architecture setup as to
what to put into it.

No functional change.
2020-03-22 20:49:55 -04:00
Augustin Cavalier
625dc38a28 libnvme: Rework qpairs to lock themselves.
They were theoretically guarded by the controller lock, but it appears
nvme_ns bypassed that, meaning that if ns_read was executed at the
same time as qpair_poll, unpredictable races could occur. This solves
that by making the qpairs guarded by their own mutex, which also
has the advantage of poll() being executable on more than one qpair
at a time.

Seems to fix the KDLs in #15123 (and maybe other NVMe tickets),
though the I/O corruptions remain.
2020-03-22 17:36:31 -04:00
Leorize
f1e5a6c914 Installer: supports installing .hpkg-based optional packages
Most of Installer was designed for old-style optional packages (files in
a folder that's copied to the target volume). This commit modifies
Installer so that it can process and install .hpkg packages.

Change-Id: Ib7d69a04ccb7879b956b5c3f0df1241c56e4987d
Reviewed-on: https://review.haiku-os.org/c/haiku/+/2400
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2020-03-22 20:40:21 +00:00
Leorize
bf551d3889 installer/CopyEngine: now only exposes a Copy() method
Previously this class exposes two methods:
- CopyFile(): only copy the file data, nothing else.
- CopyFolder(): copy files & directories between two folders, while
                preserving the attributes as well as symlinks.

With this commit, everything is unified into one method: Copy(). This
method can handle files, directories, symlinks and optionally also copy
attributes. Since most of the logic was just moved around, we can be
rather certain that this won't disrupt CopyEngine behaviors by much.

In the future we should look into using BCopyEngine to replace the
copying part of CopyEngine, as they seems to be compatible.

This change allows the Installer to make use of CopyEngine as a
general-purpose copier, in preparation for optional .hpkg installation
support.

Change-Id: Iad5ba2ebc9f34b7822e550b415308fd2b43eed47
Reviewed-on: https://review.haiku-os.org/c/haiku/+/2399
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2020-03-22 20:40:21 +00:00
Leorize
fd09d551e1 installer/CopyEngine: _CollectCopyInfo now works with all file types
CollectCopyInfo was designed to process directories only. This commit
makes it more versatile and works with everything instead.

Change-Id: Ifa74db3815411f7348e3bcc230842710058b1111
Reviewed-on: https://review.haiku-os.org/c/haiku/+/2398
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2020-03-22 20:40:21 +00:00
PulkoMandy
18da5c3042 Bootloader log: check for buffer overflow
We could overflow the in-memory log. The bounds check was there for BIOS
already but was missing in EFI and openfirmware. Could fix some crashes
when there is lots of loging.
2020-03-21 18:30:25 +01:00
PulkoMandy
99195e3c36 bootloader ethernet: fix tracing 2020-03-21 18:30:25 +01:00
Jérôme Duval
6d72c4188e virtio_net: add VIRTIO_NET_F_MTU support
Change-Id: Ie61fa0e0fe13a63d5b0ebde08303a1df836b1b52
Reviewed-on: https://review.haiku-os.org/c/haiku/+/2384
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2020-03-21 17:16:45 +00:00
Jérôme Duval
d8e1fd6eda virtio: add clear_feature hook.
Change-Id: I282ffc65a7bd692145626ab4272c5df4a792e9d4
Reviewed-on: https://review.haiku-os.org/c/haiku/+/2383
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2020-03-21 17:16:45 +00:00
Autocomitter
58b3e18891 Update translations from Pootle 2020-03-21 08:48:09 +00:00
John Scipione
b5c9fb399a Deskbar: Increase MenuBar width by 1px
... so that you can click it on the screen edge in vertical mode on
the right side. The BarMenuBar was 1px too narrow and didn't take up
the last pixel of its parent BarView container and therefore wouldn't
open the menu on click on the last pixel.

MenuBar width is increased by 1px in all modes but you probably won't
be able to notice the difference in other modes.

NULL comparison style fix and floorf call to prevent non-integer width
are included.

Fixes #15813

Change-Id: Ic5ebef5a63846a397a55358a111e33987538c455
Reviewed-on: https://review.haiku-os.org/c/haiku/+/2377
Reviewed-by: Axel Dörfler <axeld@pinc-software.de>
2020-03-20 07:58:15 +00:00
Augustin Cavalier
cbb517abfd kernel/vfs: Replace the mount mutex with a rw_lock.
Since the entry_cache operations go through the mount lock,
this may considerably speed up parallel entry cache operations.

Change-Id: Ib2f841e288eb593ee3f795922103459c77764c22
Reviewed-on: https://review.haiku-os.org/c/haiku/+/2362
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2020-03-18 21:54:38 +00:00
Niels Sascha Reedijk
dba1e7423b HaikuBook: add documentation for various deprecated layout builders
The goal of this documentation is to help people that find code that uses these
classes, understand that the code is outdated and to refer them to the newer
template-based layout builder classes.

Change-Id: I4ba632be989686749181bdbc4e7f8a29adf01a5e
Reviewed-on: https://review.haiku-os.org/c/haiku/+/2353
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>
2020-03-17 22:29:36 +00:00
PulkoMandy
a207d7b35b bootloader: reduce verbosity
- Disable tracing where it's not needed by default
- Convert some drpintf to TRACE statements
- Comment some dprintf out completely in files that don't have a TRACE
  macro.

Change-Id: I1f6062bce74bcf1dbf77bf7bccadeeb12a4df46c
Reviewed-on: https://review.haiku-os.org/c/haiku/+/2370
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2020-03-16 22:33:13 +00:00
PulkoMandy
ae5a068f62 openfirmware: implement the in-memory log
We should probably make this code more platform-generic, the
implementation is very similar to the EFI one.

Change-Id: I17c9db933bfc2a81c96816dd6348d2d0c9627951
Reviewed-on: https://review.haiku-os.org/c/haiku/+/2369
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2020-03-16 22:33:13 +00:00
PulkoMandy
442a131da7 bootloader: additional keyboard commands
In the boot menu, tab cycles between the menu items.

In the pager for logs, j and k allow to scroll the log (vim style keys).

These allow using the pager and menu on Sun machines, where Openboot
does not manage the keyboard arrow keys. It may be possible to get more
low-level input from the keyboard openboot device, but I think it is not
worth the effort for now, especially as we would need different handling
for the local keyboard and for serial ports.

Change-Id: I5fe74eb9f7a952ae49ae3c8a6bfae6ba4a16ae07
Reviewed-on: https://review.haiku-os.org/c/haiku/+/2368
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2020-03-16 22:33:13 +00:00
PulkoMandy
9ebce09880 openfirmware: alternate implementation for console
If I understand the openboot specification correctly, we should not call
the forth words directly. Instead, we should rely on the
terminal-emulator package to parse ANSI escape sequences and manage the
display for us.

Unfortunately, the ANSI parser is very limited, many sequences don't
work, including the ones for colors. But we can at least have inverse
video, which is good enough to let the menu show.

I think the PowerPC console can be modified to use the same code, at
least partially. So for now I'm keeping this code in a cross-plaform
file.

Change-Id: Ie77b9ddcc18acb735c0d77cb574e28fbabd266e6
Reviewed-on: https://review.haiku-os.org/c/haiku/+/1989
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2020-03-16 22:33:13 +00:00
Augustin Cavalier
65920cacc0 kernel/vm: Validate user addresses do not cross the kernel/user boundary.
This protects against malicious programs trying to steal/overwrite
kernel memory by overflowing user buffers.

Note that this constitutes a behavioral change to user_strlcpy:
previously, address overflows on the "source" side would either
copy less data, or copy some data and fail anyway. Now, address
overflows on either side will always fail before any data is
copied at all.

Change-Id: I01d8b22672ab3758a9dd87b521af6fedd0487417
Reviewed-on: https://review.haiku-os.org/c/haiku/+/2361
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>
2020-03-16 13:11:45 +00:00
Adrien Destugues
4f44282c3b Move source and development packages out of /system/packages on release images
Activating all these packages on live boot (especially live DVD where we
also have the write overlay eating up RAM) significantly increases
memory requirements for running Haiku, to the point that Installer may
fail to run. Move them outside the packages/ directory so they are not
activated.

Installer already skips the _sources_ directory when installing, and
lists the contents of _packages_ with checkbox to decide what to include
in the install (they are put in system/packages on the target disk).

Fix from previous version: the Haiku package was installed to /system
instead of /system/packages.

Fixes #15621.
2020-03-16 10:32:00 +01:00
PulkoMandy
e3952a44cd sparc: notes on network booting 2020-03-16 09:53:14 +01:00
Jérôme Duval
56bb1bd5c9 kernel: load cpu microcode update if loaded by the bootloader
add optional fields for microcode in kernel_args.

Change-Id: Ic5fb54cf6c9f489a2d1cdda00f63980c11dcdaeb
Reviewed-on: https://review.haiku-os.org/c/haiku/+/2264
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>
2020-03-16 06:41:16 +00:00
Leorize
4657aba9da freebsd_network/malloc: include kernel/heap.h
This header was not included when Haiku is built with KDEBUG_LEVEL=0,
causing build failures.

Change-Id: I690064f7c1a9818056a394e2655811775c4cc554
Reviewed-on: https://review.haiku-os.org/c/haiku/+/2360
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2020-03-15 23:31:27 +00:00
Augustin Cavalier
c31d8dad23 Revert "Move source and development packages out of /system/packages on release images"
This reverts commit 0ab9c3c538.

It broke booting.
2020-03-15 19:30:08 -04:00
Augustin Cavalier
d3571a6f55 Cortex: Remove missed includes of debug_tools.h. 2020-03-15 18:00:25 -04:00
Augustin Cavalier
01a7f81291 Cortex: Remove debug_tools.
Not used by anything, so not needed.
2020-03-15 17:47:10 -04:00
Augustin Cavalier
6a84844ddf Icon-O-Matic: Disable printing statistics.
Not really needed, and for now triggers a lot of deprecation warnings.
2020-03-15 17:47:09 -04:00