Commit Graph

62214 Commits

Author SHA1 Message Date
Adrien Destugues
b966e83785 Add some documentation for libroot
Mainly for features.h and feature defines, which seems to be an ongoing
source of confusion and not well understood.
2020-12-29 14:04:20 +01:00
Adrien Destugues
683d891a6b Fix typo in BNotification documentation 2020-12-29 14:04:15 +01:00
Adrien Destugues
db7dcab7b1 asprintf should be available if _GNU_SOURCE is defined
As documented in the Linux manpage:
https://man7.org/linux/man-pages/man3/asprintf.3.html
Change-Id: I855b3310ae9111ddf48c13c26b9eb496c200accb
Reviewed-on: https://review.haiku-os.org/c/haiku/+/3554
Reviewed-by: Stephan Aßmus <superstippi@gmx.de>
2020-12-28 23:09:21 +00:00
Adrien Destugues
99f2b96894 elf.h: add some missing defines
Needed for ghc.
2020-12-28 22:20:43 +01:00
Jérôme Duval
1f8a8d2b48 boot/bios_ia32: basic support la57 aka 5-level paging for x86_64 kernels
la57 kernel support is required. we simply add a 5th level and enable the cr4
feature. the safemode option "256tb_memory_limit" is named after the 4gb one,
but the current support is limited to 512GB as before (this can be later extended).

Change-Id: I922774473c4a6112a0e4ff74162285ad58aa53af
Reviewed-on: https://review.haiku-os.org/c/haiku/+/3552
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>
Reviewed-by: Axel Dörfler <axeld@pinc-software.de>
2020-12-28 18:21:11 +00:00
Jérôme Duval
58353b3809 kernel/x86_64: LA57 aka 5-level paging
this enables the kernel to correctly take over when the bootloader prepares
the paging in 4-level or 5-level.

Change-Id: I0444486d8e17aade574e2afe255a3c2cfc49f21f
Reviewed-on: https://review.haiku-os.org/c/haiku/+/3551
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>
Reviewed-by: Axel Dörfler <axeld@pinc-software.de>
2020-12-28 18:21:11 +00:00
Andrew Lindesay
cb8472235b HaikuDepot: Screenshot List
Remove the use of custom list class related to
screenshots on a package.

Relates To #15534

Change-Id: I8289c25ef0ab5a6715dd9c6c83b6602a25d2f544
Reviewed-on: https://review.haiku-os.org/c/haiku/+/3549
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>
2020-12-27 19:32:57 +00:00
Jeremy Visser
8fe17af9a7 NetServer: set B_UNCONFIGURED_ADDRESS_FAMILIES flag for IPv6 link local mask
In NetServer::_ConfigureIPv6LinkLocal, it was observed that the
IPv6 link local addresses being added by the function had invalid
masks applied, which upon investigation turned out to be
uninitialised memory.

It turns out that this call:

  BNetworkAddress localLinkMask("ffff:ffff:ffff:ffff::");

...internally relies on getaddrinfo(), which only works if the OS
already has an IPv6 address. Since this is the first IPv6 address,
this will always fail. Since the error code is not checked, this
results in uninitialised memory being used as the IPv6 mask.

There are a variety of possible ways to solve this problem, but
the one presented here passes the B_UNCONFIGURED_ADDRESS_FAMILIES
flag which tells the resolver to always resolve IPv6 addresses.

Change-Id: Ic1fbbd7cffdc6ec87cf160b9d7b02f077d2cf659
Reviewed-on: https://review.haiku-os.org/c/haiku/+/3548
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>
2020-12-27 13:19:34 +00:00
Autocomitter
96ceef6eb2 Update translations from Pootle 2020-12-26 08:47:59 +00:00
Pascal Abresch
d6005b727c StyledEdit: convert main view to layout api
Change-Id: I913c8f559faf09654b0e249f512858ed24fe1ffe
Reviewed-on: https://review.haiku-os.org/c/haiku/+/3537
Reviewed-by: John Scipione <jscipione@gmail.com>
2020-12-24 09:09:05 +00:00
Máximo Castañeda
80a920f65d BSoundPlayer: check for NULL node
Fixes #16683

Change-Id: I81c252b6eeaeb35cc5f33a796a7242c0965c3f27
Reviewed-on: https://review.haiku-os.org/c/haiku/+/3546
Reviewed-by: Jérôme Duval <jerome.duval@gmail.com>
2020-12-23 19:57:32 +00:00
Alexander von Gluck IV
569564c02d efi/dtb: Find potential FDT on UEFI
* Makes our UEFI bootloader somewhat FDT/DTB aware on all
  architectures.
* Will report when an FDT is found, and provide it to kernels
  that want it.

Change-Id: I90324fc0579a9c835e60568fa9b654c2df0aba27
Reviewed-on: https://review.haiku-os.org/c/haiku/+/3543
Reviewed-by: Fredrik Holmqvist <fredrik.holmqvist@gmail.com>
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>
2020-12-23 13:51:25 +00:00
Máximo Castañeda
a0f0cb5a9d Input preferences: fix list item retrieval
Fixes #16679

Change-Id: I87844b7745dc2d9e126983a888caf01f37f6b742
Reviewed-on: https://review.haiku-os.org/c/haiku/+/3540
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>
2020-12-23 10:49:01 +00:00
Jeremy Visser
6011ce6c74 PoorMan: Add dual-stack IPv6 support
This change adds dual-stack IPv6 support to the PoorMan web server,
which will listen on all available IPv4 and IPv6 addresses and
respond to both.

This change also does some necessary plumbing to support the
output of nicely-formatted IPv6 addresses for request logging.

Change-Id: I0ce7691222f0233e2e098d67e6293b9e58d7486d
Reviewed-on: https://review.haiku-os.org/c/haiku/+/3539
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>
2020-12-23 10:48:38 +00:00
Fredrik Holmqvist
da93a24811 efi_guid struct gets equals, simplify EFI acpi_init
Change-Id: Id4bc985dc1e6f44b594f6ca5dabd3fdac8e1cac2
Reviewed-on: https://review.haiku-os.org/c/haiku/+/3545
Reviewed-by: Alex von Gluck IV <kallisti5@unixzen.com>
2020-12-22 22:12:13 +00:00
Adrien Destugues
e050005a07 Revert "openfirmware: remove real_time_clock."
This reverts commit 4e134b546a.

It breaks bootloader build on powerpc.
2020-12-22 19:39:31 +01:00
Alexander von Gluck IV
acd5d4fddf kernel/arm: Prevent a uart dereference.
* Make some wild qemu virt uart assumptions as a fallback

Change-Id: If8ff74b6a6f53b6c38515a9bdd5fba2573f21700
Reviewed-on: https://review.haiku-os.org/c/haiku/+/3541
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>
2020-12-21 14:58:28 +00:00
Alexander von Gluck IV
31fd7ccc19 kits/bluetooth: Improve knowledge of BT versions
* Drop spaces as well, any text alignment needs to
  happen in UI

Change-Id: I2258330baa51e82095e3f7432e60747abb639aa3
Reviewed-on: https://review.haiku-os.org/c/haiku/+/3538
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>
2020-12-21 14:57:10 +00:00
Máximo Castañeda
7f7f9f1def ffmpeg decoder: return last chunk of audio
Change-Id: I712e5959f066e65471777e6724637aac7a17d07c
Reviewed-on: https://review.haiku-os.org/c/haiku/+/3510
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>
2020-12-21 14:29:43 +00:00
Máximo Castañeda
42b9734805 Set normal mouse mode on set_focus_follows_mouse(false)
Change-Id: Iae4300d7da5ada391c2d2dccff2b7de7f1b38245
Reviewed-on: https://review.haiku-os.org/c/haiku/+/3509
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>
2020-12-21 14:29:15 +00:00
Adrien Destugues
015d6c1306 BMenuField: use anonymous namespace for internal class.
As suggested by korli, this is indeed a better way to hide internal
classes and make them completely unreachable from outside the cpp file
they are defined in.
2020-12-19 10:54:06 +01:00
Adrien Destugues
8a72ba1b54 Tracker: improve algorithm to decide desktop text color
Fixes #16673
2020-12-19 10:17:55 +01:00
Autocomitter
4358626708 Update translations from Pootle 2020-12-19 08:44:19 +00:00
Adrien Destugues
f7a0ebd7a5 BMenuField: Fix private ABI leakage
Problem introduced in hrev46195. The MouseDownFilter class may be
declared deep in the middle of a cpp file, yet without precautions, it
will end up being part of the ABI.

WonderBrush has a class with the same name, and on 64bit Haiku, a mixup
of the two would happen, leading to a crash because they don't have the
same size.

Move the class into BPrivate to avoid this.

Change-Id: I60b608edf3188816281332c972c654e3c57740b4
Reviewed-on: https://review.haiku-os.org/c/haiku/+/3536
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
Reviewed-by: Rene Gollent <rene@gollent.com>
2020-12-17 20:10:59 +00:00
Alexander von Gluck IV
638910607a libnetwork/BHttpRequest: Fix type mis-alignment breaking gcc2
Change-Id: I927d54758efec30bb35cd041ac5fc91a69299099
2020-12-17 08:39:17 -06:00
Alexander von Gluck IV
d36f7ca577 libnetwork/BHttpRequest: Actually report form file upload progress
* Solves #16671

Change-Id: If112d6e2319eb076968c4caf8fcd3b8746ed324f
Reviewed-on: https://review.haiku-os.org/c/haiku/+/3515
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>
Reviewed-by: Alex von Gluck IV <kallisti5@unixzen.com>
2020-12-17 14:13:09 +00:00
John Scipione
9de7297999 audio/null: Remove extra space introduced in hrev54781
This is whitespace only, no change in functionality intended.
2020-12-16 10:22:11 -05:00
Alexander von Gluck IV
69b1d7ac94 apps/icon-o-matic: Fix null pointer dereference in export window
* Bailing early in SavePanel constructor is pretty bad and creates
  a bunch of NULL pointers things later try and reference.
* HScrollview and VScrollview no longer exist after migrating to
  using the layout kit.

Change-Id: Ia80d68508246f952547fb687e29029304a8ffd1e
Reviewed-on: https://review.haiku-os.org/c/haiku/+/3507
Reviewed-by: Alex von Gluck IV <kallisti5@unixzen.com>
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>
2020-12-16 14:45:53 +00:00
X512
03ee0e55ca kernel/team: add ability to get parent PID of arbitrary process
Fixes #16607.

Change-Id: Ia20bbde2cf078b6b99904f4e868730cbc70889c5
Reviewed-on: https://review.haiku-os.org/c/haiku/+/3400
Reviewed-by: X512 <danger_mail@list.ru>
Reviewed-by: Axel Dörfler <axeld@pinc-software.de>
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>
2020-12-16 12:23:25 +00:00
Pawan Wadhwani
10074df18f PowerStatus: eliminate redundant power notification
patched duplicate low power notifications by adding a flag to
remove redundant notification calls by adding a parameter in
the update function.

Fixes #12277

Change-Id: Iec3859156e745ce0e1c08250151e17b3317847d5
Reviewed-on: https://review.haiku-os.org/c/haiku/+/3493
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>
2020-12-16 07:42:01 +00:00
Máximo Castañeda
775eaaafd3 Mixer: fix debug build
Change-Id: I9e998d8fd35b7fd3d505067bd30e1bbcbcdd8e96
Reviewed-on: https://review.haiku-os.org/c/haiku/+/3508
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>
2020-12-16 07:41:26 +00:00
Murai Takashi
44e4aca7cc compat/freebsd_network: Fix dead store
Fix value stored to 'newPowerManagementStatus' is never read.
Pointed out by Clang Static Analyzer.

It seems FreeBSD's pci_set_powerstate_method() writes 'status'
(newPowerManagementStatus in Haiku) with PCI_WRITE_CONFIG
(pci_write_config in Haiku).

Change-Id: I9b11f746ed8e772a3f839e1bd5a6b432c9e8ff6b
Reviewed-on: https://review.haiku-os.org/c/haiku/+/3513
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2020-12-15 21:55:43 +00:00
Murai Takashi
7dec2bff46 bus_managers/firewire: Fix array index out of bounds
if found = 3 at line 200, gFirewire_softc[] index is out of bounds
at line 193, and may be at line 243.
Pointed out by cppcheck.

Change-Id: I0568c503e6edea8f78e0da402271b669ba786def
Reviewed-on: https://review.haiku-os.org/c/haiku/+/3502
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>
2020-12-15 12:02:19 +00:00
X512
ebe6011c58 app_server: do not flush back buffer outside of clipping
Introduce DrawTransaction that automatically hide/show floating overlays
and flush back buffer.

Fixes #15574.

Change-Id: I30088b74fc66cfcd5b2b433b34141e7d496f68a1
Reviewed-on: https://review.haiku-os.org/c/haiku/+/3496
Reviewed-by: Axel Dörfler <axeld@pinc-software.de>
2020-12-15 12:00:12 +00:00
Murai Takashi
799e367afd audio/usb: Fix for condition
Pointed out by cppcheck.

Change-Id: Ief24915908bbab41955924279847ba56faa12b09
Reviewed-on: https://review.haiku-os.org/c/haiku/+/3506
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>
2020-12-14 11:18:27 +00:00
X512
cdccd323b5 use common AutoDeleter types
Change-Id: I115e14b76f3ff049c5f7d9471efd3619a0038fcf
Reviewed-on: https://review.haiku-os.org/c/haiku/+/3483
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>
Reviewed-by: Axel Dörfler <axeld@pinc-software.de>
2020-12-13 19:14:13 +00:00
X512
47404f12f2 accelerant: replace AreaCloner with AreaDeleter
Reduce code duplication.

Change-Id: Ice1a14fc7378382e89c3e5a1aea6fa21b903e436
Reviewed-on: https://review.haiku-os.org/c/haiku/+/3482
Reviewed-by: Axel Dörfler <axeld@pinc-software.de>
2020-12-13 19:14:13 +00:00
X512
553f3f2309 AutoDeleter: add delarations for common types and destructors
Change-Id: I74b75a54038d5af370696302f33b5c0abab4820c
Reviewed-on: https://review.haiku-os.org/c/haiku/+/3481
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>
2020-12-13 19:14:13 +00:00
X512
84b1893b73 AutoDeleter: introduce HandleDeleter
It allow to use arbitrary handle type, null value and destructor function.

Change-Id: I87c444cb7ef1b08d1dbed7fe4171700171d651d2
Reviewed-on: https://review.haiku-os.org/c/haiku/+/2977
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>
Reviewed-by: Axel Dörfler <axeld@pinc-software.de>
2020-12-13 19:14:13 +00:00
Anarchos
74b6097078 sd/mmc: read, naive method
First implementation of reading sectors from an SD card.
This is not the best performance for many reasons:
- No DMA
- Reads only one sector at a time
- Cannot read more than 512 bytes per syscall

Also there are major limitations:
- Cannot read less than 512 bytes. The hardware of course works in full
  sectors. The mmc_disk driver should go through the io scheduler to
  make sure requests have a reasonable size and offset, and nothing
  tries to read just a few bytes in the middle of a sector.
- SD cards only (no SDHC, no MMC)

Architecture problems:
I think too much of the implementation is done in sdhci_pci and should
be moved to the upper layers. However it is difficult to say without
having implemented DMA (which indeed will be at the low level of the
sdhci controller). It doesn't help that the order of operations is a
bit different depending on wether there is DMA or not. In DMA mode you
first prepare the buffer, then run the command. In non-DMA mode you
first send the command, then read the data into the buffer. We need an
API at the mmc_bus level that doesn't care about that low-level detail.
There are other things that the MMC bus should be doing however, such
as switching to different clock speeds depending on which card is
activated and how fast it can go.

At least the following should be done:
- The read method for mmc_bus and sdhci_pci should use a scatter-gather
structure as a parameter instead of a single buffer
- See if can be integrated into ExecuteCommand at sdhci level (it's
essentially a command with an additional data phase)

Change-Id: I688b6c694561074535c9c0c2545f06dc04b06e7d
Reviewed-on: https://review.haiku-os.org/c/haiku/+/3466
Reviewed-by: Jérôme Duval <jerome.duval@gmail.com>
2020-12-13 18:56:19 +00:00
Adrien Destugues
f6d7f9f599 sdhci_pci: Remove DumpRegisters function
Reading registers can change the state of the device, so we can't do
this as a generic debug function. We'll have to more carefully decide
which registers to dump in which case.

Change-Id: I4a706b749a0dd2f4f0e29b602b90354fbf6d66f8
Reviewed-on: https://review.haiku-os.org/c/haiku/+/3465
Reviewed-by: Jérôme Duval <jerome.duval@gmail.com>
2020-12-13 18:56:19 +00:00
Adrien Destugues
eb92a83453 sd/mmc: fix warnings
Change-Id: I5d0c95240cd5594b0f8090f5ec7b3f6ee181dacc
Reviewed-on: https://review.haiku-os.org/c/haiku/+/3464
Reviewed-by: Jérôme Duval <jerome.duval@gmail.com>
2020-12-13 18:56:19 +00:00
Adrien Destugues
f7c1481c00 sd/mmc: update documentation
- add info about qemu debugging features
- update qemu command line to current syntax
- add some extra options to make things easier
- remove list of files (directories are enough) and instead add a short description of each module.

Change-Id: Ie9980d8143c33655147f161b248c45689ba82476
Reviewed-on: https://review.haiku-os.org/c/haiku/+/3463
Reviewed-by: Jérôme Duval <jerome.duval@gmail.com>
2020-12-13 18:56:19 +00:00
Adrien Destugues
e46898932c Initial work for the mmc_disk driver
No read and write support for now. But we implement getting SD card
capacity. SDHC is not supported yet (it uses a different layout for the
CSD register which will be rejected by this version of the code)

Change-Id: Ife844a62f3846c0a780259e9a3a08195e2fd965e
Reviewed-on: https://review.haiku-os.org/c/haiku/+/1068
Reviewed-by: Jérôme Duval <jerome.duval@gmail.com>
2020-12-13 18:56:19 +00:00
Murai Takashi
b66b01c283 bin/bfs_tools: Fix array index is out of bounds
If length == BPLUSTREE_MAX_KEY_LENGTH at line 237,
buffer[] index may be out of bounds at line 245.
Pointed out by cppcheck.

Change-Id: Ib86abeaa72526b327af85ca9a26b050834f5a2c9
Reviewed-on: https://review.haiku-os.org/c/haiku/+/3501
Reviewed-by: Jérôme Duval <jerome.duval@gmail.com>
2020-12-13 16:44:30 +00:00
Andrew Lindesay
5b1ae51c6b HaikuDepot: Memory Leak Fix
Change-Id: Ibd311d10009484ba834843149740c5a11f283202
Reviewed-on: https://review.haiku-os.org/c/haiku/+/3500
Reviewed-by: Stephan Aßmus <superstippi@gmx.de>
2020-12-13 10:07:22 +00:00
Murai Takashi
37cd311852 ICNSTranslator: Fix same expression used in consecutive assignments
Fix same expression (imageTypeInfo.iconWidth) is used in consecutive
assignments of 'iconWidth' and 'iconHeight' at line 191, 192.
Pointed out by cppcheck.

Change-Id: I251a4b8e6c83f86aad4fa0030ebc362f3b97fb0e
Reviewed-on: https://review.haiku-os.org/c/haiku/+/3499
Reviewed-by: Jérôme Duval <jerome.duval@gmail.com>
2020-12-12 13:54:12 +00:00
Murai Takashi
c3427db750 audio/null: Fix null pointer dereference
Fix possible null pointer dereference at line 350-354
when 'device' is NULL at line 347.
Pointed out by cppcheck.

Change-Id: I25a090172a0d17ef3cb1fe607f70a31e579d13b0
Reviewed-on: https://review.haiku-os.org/c/haiku/+/3498
Reviewed-by: Jérôme Duval <jerome.duval@gmail.com>
2020-12-12 13:53:56 +00:00
Sean Long
151de9ff9b BHandler documentation: Fix typo
Change-Id: Ia533d028163248f37ff3c92a8aa981d28b47e34c
Reviewed-on: https://review.haiku-os.org/c/haiku/+/3497
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>
2020-12-12 08:55:41 +00:00
Autocomitter
7c8377101f Update translations from Pootle 2020-12-12 08:45:25 +00:00