Commit Graph

52560 Commits

Author SHA1 Message Date
Máximo Castañeda
7f9c675629 MediaExtractor: access chunk cache only when we have it
Change-Id: I533bb2e25b0756acaaa227cdd06c4067d4120066
Reviewed-on: https://review.haiku-os.org/c/haiku/+/3622
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>
2021-01-10 22:07:16 +00:00
Jérôme Duval
f9b26e4c30 xhci: SubmitNormalRequest: divide exception on zero trbSize
workaround for #16586

Change-Id: Id9d538f46b62585f4a12c3796781ae1207ed2454
Reviewed-on: https://review.haiku-os.org/c/haiku/+/3611
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2021-01-10 21:58:02 +00:00
Adrien Destugues
b8d6e720ba DriveSetup: allow formatting a mounted partition
It is automatically unmounted, if possible.

Part of #16304.
2021-01-10 21:32:30 +01:00
Adrien Destugues
7de9578142 ProcessController: fix huge bar for low CPU systems 2021-01-10 20:46:59 +01:00
Adrien Destugues
7b661b559e BSecureSocket: fix read error handling
The current documentation
(https://www.openssl.org/docs/man1.1.1/man3/SSL_read.html) says that
SSL_read returning 0 should be handled as an error. So, let's do that.

Change-Id: I6781826ea700b6e597fd2d444fd96a1a5270c6cf
Reviewed-on: https://review.haiku-os.org/c/haiku/+/3620
Reviewed-by: Stephan Aßmus <superstippi@gmx.de>
2021-01-10 17:34:44 +00:00
Alexander von Gluck IV
1ccfdb2bd5 system/boot: Fix u-boot build under arm
Change-Id: Ie10acfd10e8feab71660f99938cbb5bbab565772
Reviewed-on: https://review.haiku-os.org/c/haiku/+/3618
Reviewed-by: Alex von Gluck IV <kallisti5@unixzen.com>
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>
2021-01-10 16:56:23 +00:00
Adrien Destugues
f377a91a31 ProcessController: gcc2 build fix 2021-01-10 16:20:06 +01:00
Adrien Destugues
98791e6d67 intel_cstates: provide more info in panic
This should help understanding the problem in #16546, which we don't
understand how it can happen.
2021-01-10 15:52:14 +01:00
Adrien Destugues
d9848639c6 DriveSetup: clarify partition state
DriveSetup does not make it clear when there is empty space or when a
partition is not formatted. Reword things a bit to make this easier to
understand.

This was a common source of confusion in various video reviews of Haiku,
with people trying to install Haiku to a partition that had not been
formatted.

Part of #16304
2021-01-10 15:12:46 +01:00
Alexander von Gluck IV
c38dea9e37 processcontroller: Scale up width on high core counts
* 4 cores or less, use static table. More make view larger.
* 16 cores or less, 2px CPU bars
* More than 16 cores, 1px CPU bars
* Tested through 128 cores in qemu

Change-Id: I5fb460e7ee5848d0395b109acc602e86f4d5bbd7
Reviewed-on: https://review.haiku-os.org/c/haiku/+/3616
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>
2021-01-10 13:47:08 +00:00
Adrien Destugues
61282f9574 Tracker: fix invisible selection text in disabled windows
Regression introduced in hrev54742 which used DeskTextColor() on a
non-desktop view. The view color isn't set anywhere in that case and
does not match the background color, which led to drawing white text on
a white background.

Moreover, a second bug was stacked on that: the selection is drawn in
"reverse video" (using the document color for the text and document text
color for the background) only for active windows. For inactive ones, it
is drawn normally, and then a middle-grey rectangle is alpha blended on
top. Add a comment to clarify that and reintroduce the ckeck that had
been removed.

Also replace the hardcoded black for the selection background, so it
will be more easily visible for people using dark mode.

Fixes #16627.
2021-01-10 13:49:17 +01:00
Adrien Destugues
e3927d6ad4 Haiku control look: bring back the tab seams
They were accidentally removed in hrev54634 in an attempt to clean up
the code.

Reintroduce the old logic with some cleanup and improvements:
- There was a mixup of "tab side" vs "border". The constant values for
  the two are the same, so it still worked as designed, but it made the
  code harder to follow since it deals with both borders and tab sides.
- Define an isVertical boolean to decide if the tab view is vertical,
  avoiding repeated tests for specific tabview sides.

Fixes #16640.
2021-01-10 13:01:05 +01:00
Adrien Destugues
c37693ddac KeyboardLayoutView: remove B_FLAT button flag for drawing keys
We do not want flat buttons here. This was introduced to get the Be
control look to draw inverted color labels on the buttons, but there
must be another way to do this.

Fixes #16660.
2021-01-10 12:17:57 +01:00
Humdinger
8ff235aa28 Sentence casing
+ avoid spaces at the end of a translatable string, as those can
easily be missed by the translators.

Change-Id: Ic41e613b44e4248529d1f68f6bab13a048e66f3e
Reviewed-on: https://review.haiku-os.org/c/haiku/+/3612
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>
2021-01-10 07:00:28 +00:00
Jérôme Duval
d12e6085a0 kernel/thread: handle invalid user_thread pointer in user_[un]block_thread
should help with #16736

Change-Id: I103488679b8c352855fbd19405bb30c978cf4457
Reviewed-on: https://review.haiku-os.org/c/haiku/+/3613
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2021-01-09 18:12:18 +00:00
Jérôme Duval
62826a0665 strace: continue_thread can fail when the origin team is gone
Change-Id: I2de8aaaf90ef987d3871dbbbef73c49240d99a89
Reviewed-on: https://review.haiku-os.org/c/haiku/+/3615
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2021-01-09 18:10:39 +00:00
Stephan Aßmus
8c812f2d63 BHttpRequest: Fix the cast and therefor GCC2 build
Change-Id: Ia0729a20d143721d395d5d50719e87b99b76bb05
Reviewed-on: https://review.haiku-os.org/c/haiku/+/3614
Reviewed-by: Stephan Aßmus <superstippi@gmx.de>
2021-01-09 15:56:08 +00:00
Adrien Destugues
f15516ff92 Package Kit: re-use downloads from unfinished transactions
There are three parts to this change:
- In FetchFileJob, if the request fails with a timeout or IO error
  (probably because of unstable connection) attempt to resume the
  download with a range request. No limit on number of retries
  currently, maybe we should add one.
- In PackageManager, before downloading a file, look around in other
  transaction directories in case it's already there. Partial and
  complete downloads are differentiated by an attribute which the
  fetch file job maintains. For complete downloads, no fetch job is
  scheduled, for partial downloads, the fetch job will request the
  remainder of the file.
- In BHttpRequest, the implementation of SetRangeStart() and
  SetRangeEnd() have been added, along with some refactoring to
  handle listener notifications consistently. This also fixed a
  bug where the final notification for download progress was not
  emitted for compressed data.

Fixes #12414.

Change-Id: I3e285741ed0e5651594a7c2e1c7170644a9d297d
Reviewed-on: https://review.haiku-os.org/c/haiku/+/3404
Reviewed-by: Stephan Aßmus <superstippi@gmx.de>
Reviewed-by: Alex von Gluck IV <kallisti5@unixzen.com>
2021-01-09 15:20:09 +00:00
Adrien Destugues
d753645e3f MediaExtractor: fix cache size computation for audio
Untested. If audio is not decoding well, try increasing the constant.

Change-Id: I151764e6bb3e69088904d33bfeb683bf0569bd23
Reviewed-on: https://review.haiku-os.org/c/haiku/+/3605
Reviewed-by: Alex von Gluck IV <kallisti5@unixzen.com>
2021-01-08 14:28:41 +00:00
Adrien Destugues
a736630c63 Fix ppc build
Remaining uses of PAGE_SIZE that I didn't notice.
2021-01-08 13:26:02 +01:00
Adrien Destugues
68d37cfb3a Fix definition of PAGESIZE and B_PAGE_SIZE
On sparc, the minimal page size we can use is 8K. Since B_PAGE_SIZE and
PAGESIZE defines were hardcoded to 4K, this resulted in a lot of
confusion in all code trying to manipulate pages.

- Remove cpu.h from headers/private/kernel/arch/*. It dates back from
  NewOS and was not used anymore since our kernel uses B_PAGE_SIZE
  (PAGE_SIZE was the only thing defined in this header).
- Add posix/arch/*/limits.h with the arch specific page size and include
  it from the main limits.h.
- Adjust bios_ia32/debug.cpp which was the only place using the
  PAGE_SIZE constant from the deleted headers.
- Change OS.h to define B_PAGE_SIZE to be the same as POSIX PAGESIZE.
- Define PAGESIZE in the build header if the host OS doesn't.

Change-Id: I8c3732cf952ea3c2f088aa16d216678fbf198b96
Reviewed-on: https://review.haiku-os.org/c/haiku/+/3558
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>
2021-01-08 12:02:16 +00:00
Adrien Destugues
fa1f5839be sdhci_pci: fix quirk and interrupt handling for Ricoh device
- The quirk was not properly applied due to misuse of the device API
- The interrupts could run out of sync, leading to not properly waiting
  for commands to terminate before reading their result. Add panic to
  check for that (at the start of the next command) and fix the code.

Change-Id: If83b7bbb3c3446d374115ed22c09b91020028578
Reviewed-on: https://review.haiku-os.org/c/haiku/+/3609
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2021-01-07 20:37:34 +00:00
Alexander von Gluck IV
e9a5037fba tools/mbrtool: A simple tool to create MBR partitions
Change-Id: I0f04b257ad49d07c03d630df47c4891c1fd7a954
Reviewed-on: https://review.haiku-os.org/c/haiku/+/3570
Reviewed-by: Stephan Aßmus <superstippi@gmx.de>
2021-01-06 23:40:29 +00:00
Jérôme Duval
242adb20f3 Terminal: implement ECMA-48 "REP"
fix #16724

Change-Id: Ie9f8252393a65a0101a6d78db2360f48bb52bc73
Reviewed-on: https://review.haiku-os.org/c/haiku/+/3607
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>
2021-01-06 20:31:51 +00:00
X512
18f5075784 StyledEdit: fix replace menu item
Regression after hrev54812.

Change-Id: I5f8e06c5b161eb859afc7f03b08e1c0cb07a99d0
Reviewed-on: https://review.haiku-os.org/c/haiku/+/3604
Reviewed-by: humdinger <humdingerb@gmail.com>
2021-01-06 13:26:05 +00:00
Adrien Destugues
96fbe0f747 NetworkStatus: build fix. 2021-01-06 12:50:43 +01:00
Adrien Destugues
cba63b6451 bfs: build fix.
I built only the bootloader for sparc when testing, so some code was
disabled because it's guarded by _BOOT_MODE.

Confirmed that the generated assembler is not larger than before (the
disassembly file is the same size, but for some reason functions were in
a different order, making it difficult to compare more closely)
2021-01-06 12:49:08 +01:00
X512
4758408a92 StyledEdit: fix layout
Fixes #16721.

Change-Id: I1ab1489b5cfe6ae0fce4ba1de9d14c69685e5a65
Reviewed-on: https://review.haiku-os.org/c/haiku/+/3603
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>
2021-01-06 08:32:06 +00:00
Adrien Destugues
e41c31cd83 sdhci: move quirk init to the right place
It needs to be done once per device and only after we have decided that
the device is supported and should be handled by the driver.

Change-Id: Ia00c1fbb151ab181abbfcfaed538cf58985aea07
Reviewed-on: https://review.haiku-os.org/c/haiku/+/3601
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2021-01-05 21:37:03 +00:00
PulkoMandy
60f8e54f2b bfs: fix misaligned access
The BFS on-disk data is not aligned. Reading it to memory and trying to
access fields directly does not work on sparc. memcpy the data to an
aligned variable before handling it with its native size.

gcc knows how to access unaligned data, but we need to tell it when to do
so. This is done with the "packed" attribute, but it works only on
structs. So we have to wrap the values in a struct.

Thanks to C++ features, we can make the struct
relatively transparent by having an assigment operator (for writes) and
a cast operator (for read access), so there is no need to access the
value inside the struct with ".value" everywhere. The rest of the code
is then largely unchanged (except for use in printf statements and other
vararg functions, where the implicit casting can't work).

gcc takes care of performing the access in the correct way on platforms
that need it (old ARM, sparc) and can still optimize things on other
architectures where specific code is not needed for unaligned access.

Fixes #9255

Change-Id: I3bf62590dee059ad32b1845bdc4eace165b73203
Reviewed-on: https://review.haiku-os.org/c/haiku/+/2363
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>
2021-01-05 18:51:49 +00:00
Jeremy Visser
b81d67ed0c NetworkStatus: print all interface addresses, not just the first
The NetworkStatus applet by default only shows the first address
on the interface, assuming IPv4 semantics and ignoring others.

This assumption doesn't hold true for IPv6-enabled systems, which
not only have both IPv4+IPv6 addresses, but typically multiple
IPv6 addresses (link-local and global at a minimum).

In addition, it's not unheard of to have multiple IPv4 addresses
on a single interface, even though it's difficult to configure in
Haiku at time of writing.

This change loops through all available addresses and prints them
in the status.

No attention to ordering is made; future enhancements could
include sorting IPv6 global/link-local, displaying the type, etc.

Change-Id: Ib437e32fc878b5baafa8c2437659e10fb6fcffbf
Reviewed-on: https://review.haiku-os.org/c/haiku/+/3550
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>
2021-01-05 18:26:12 +00:00
Stephan Aßmus
f866207173 Package Server: Handle existing files when commiting transaction
Package files to be committed may already exist in the packages folder,
there is no good reason to fail the transaction. These may be packages
which are not activated, or there may be other reasons. While I have
not investigated how this situation may form, I don't see a good reason
to spend the time. Simply compare the contents of the existing file
with the file from the transaction, only fail if they are different.

Change-Id: I2a574df38385c8dead8bac2beace94436d43760a
Reviewed-on: https://review.haiku-os.org/c/haiku/+/3597
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>
2021-01-05 17:24:51 +00:00
Adrien Destugues
844c42f079 sdhci_pci: fix xupport for Ricoh controllers
There is a quirk needed to switch the controller to standard SD mode
(copied from FreeBSD).

The response type configuration for R7 response was incorrect, this
response type does not have a data phase. This made the Ricoh SDHCI
implementation generate an unexpected "transfer complete" interrupt,
while apparently the implementation in QEMU didn't.

The interrupt generation is a bit different from what I got in QEMU
when developping the driver, for some commands, we get only a
"transfer complete" and no "command complete" interrupt as I'd expect
when the command completes.

This is handled in the following way:
- The interrupt always releases the semaphore to notify that something
  has happened (once per event)
- When the main thread waits for an event, it always uses the same
  pattern:

while (!condition)
	acquire_sem(...)

This pattern makes it not wait at all if the condition is already
satisfied. If the interrupt triggers later or already happened when the
code gets to execute this while loop, the semaphore can be left with
some tokens in it. These will be emptied the next time the thread waits
on something.

To make sure ths works properly and everything is synchronizing as
expected, some extra checks are added before execution of a command to
make sure the hardware is in the expected state.

There is also lots of extra tracing, I prefer to leave this enabled
initially and wait for some other users to test this new driver on their
hardware. When we are confident enough that it is compatible with
several implementations, we can reduce the tracing or turn it off.

Change-Id: Ib9617dbea62f87124dbaad0027b53a13d949641f
Reviewed-on: https://review.haiku-os.org/c/haiku/+/3600
Reviewed-by: Alex von Gluck IV <kallisti5@unixzen.com>
2021-01-05 02:06:44 +00:00
Adrien Destugues
d1fee57dee mmc_disk: add SDHC support.
The main differences:
- The initialization sequence requires an additional command (this was
  already done)
- The layout of the CSD register and the way to compute the device
  geometry from it changes
- The read and write commands parameter is a sector number instead of a
  byte position

Change-Id: Ie729e333c9748f36b37acd70c970adfd425cf0b6
Reviewed-on: https://review.haiku-os.org/c/haiku/+/3512
Reviewed-by: Alex von Gluck IV <kallisti5@unixzen.com>
2021-01-05 02:06:44 +00:00
Adrien Destugues
e21a1abec4 mmc: properly set DMA restrictions
- The restrictions are now set by the sdhci bus and retrieved from there
  by the DMAResources.
- Configure SDMA with the maximal available boundary check of 512K and
  publish the corresponding DMA restrictions.
- dma_resource cannot be initialized implicitly as a member of
  mmc_disk_driver_info because mmc_disk_driver_info is allocated with
  malloc/free, not new/delete. So we now explicitly allocate and delete
  it.

This allows reads and writes of more than a single block at a time.

Change-Id: Ibb97c91543312c7970c28a7a8c68a12708263e32
Reviewed-on: https://review.haiku-os.org/c/haiku/+/3505
Reviewed-by: Alex von Gluck IV <kallisti5@unixzen.com>
2021-01-05 02:06:44 +00:00
Adrien Destugues
9a37366b51 mmc_disk: add write support
Change-Id: I77cf1612569c43e79917ac5a1493b7ab4a04cb47
Reviewed-on: https://review.haiku-os.org/c/haiku/+/3504
Reviewed-by: Alex von Gluck IV <kallisti5@unixzen.com>
2021-01-05 02:06:44 +00:00
Adrien Destugues
7a160a8629 mmc_disk: read using "simple DMA"
The SDHCI spec also offers an "advanced DMA" mode where we can use
scatter-gather lists. It would allow to remove several of the DMA
restrictions, but hardware support for it is optional, so we need this
version anyway.

The geometry is retrieved on demand in the first read or write or in a
call to the get geometry or get device size ioctl. It is not possible to
retrieve it from the device initialization because that is called as
part of the mmc_bus scanning, which needs a specific sequence of
commands and keeps the bus locked to prevent drivers to insert their own
commands in the middle of that sequence.

TODO:
- Move the DMA restrictions definition to sdhci_pci and forward it up to
  mmc_disk (which is the one creating the IOScheduler)
- Decide if we want to keep non-DMA support (probably should, but it
  makes things more complex, because it uses virtual addresses)

Change-Id: Ib1dd14eacf62052d747bfb3ef7820bc5a34d3030
Reviewed-on: https://review.haiku-os.org/c/haiku/+/3471
Reviewed-by: Alex von Gluck IV <kallisti5@unixzen.com>
2021-01-05 02:06:44 +00:00
Adrien Destugues
cc2642c124 sdhci/mmc: add to the image.
Change-Id: Ic43965efea2c62b6e731c7552e4f27d6d20fc26b
Reviewed-on: https://review.haiku-os.org/c/haiku/+/448
Reviewed-by: Stephan Aßmus <superstippi@gmx.de>
2021-01-05 02:06:44 +00:00
Alexander von Gluck IV
6b49a15b64 media_kit: Dynamic allocation of ChunkCache based on media
* The "default" of 3MiB wasn't enough for modern larger media
  formats, resulting in inability to play 4k video no matter
  how much horse power you threw at Haiku. (4k is ~8MiB)
* This dynamically calculates the ChunkCache based on the
  video framesize * 2.
* 4k video now plays smoothly on my Ryzen 1800x.

Change-Id: I65bf6bd6fa60ac3196ea70eeeb5e655d43c10bcd
Reviewed-on: https://review.haiku-os.org/c/haiku/+/3598
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2021-01-03 20:51:37 +00:00
PulkoMandy
76fed28ab1 sparc: implement elf relocation
Needed to load the kernel properly.

Change-Id: Iab520398271be2ee3a740af4104960367c3b4ea9
Reviewed-on: https://review.haiku-os.org/c/haiku/+/3585
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2021-01-01 22:10:43 +00:00
PulkoMandy
b992c828cf sparc: add kernel debug output
Mostly the same as PowerPC, using OpenFirmware.

Change-Id: I197cc181e92da92c272ee9cfa20c8ad2d2c63d41
Reviewed-on: https://review.haiku-os.org/c/haiku/+/3579
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2021-01-01 22:10:43 +00:00
PulkoMandy
7c2dc33027 sparc: fill in kernel entry code
- Fix elf32 vs elf64 (copied from EFI)
- Write the kernel start code

Change-Id: I6133185681307ecabc617b47b36551e52f9ac2c9
Reviewed-on: https://review.haiku-os.org/c/haiku/+/3578
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2021-01-01 22:10:43 +00:00
PulkoMandy
a27d19ee57 openfirmware: move text cursor to top of screen before showing splashscreen
If we need to display some text during boot, it's nicer to have it on
top of the splashscreen, rather than scroll the display down.

Change-Id: I897073d31120ec3eebd2edc4632960db7eb7977d
Reviewed-on: https://review.haiku-os.org/c/haiku/+/3596
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2021-01-01 22:04:13 +00:00
PulkoMandy
0da81fed54 sparc: fix interrupt enable/disable code
The manually written code was all wrong (missing branch delay slots,
wrong type of return instruction used, probably more bugs). Use the same
approach as x86 to have inline functions instead, which is much better
for performance and simpler to write.

Change-Id: Iac0fc814c15311658f983da58ac7f9d3edd75b81
Reviewed-on: https://review.haiku-os.org/c/haiku/+/3595
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2021-01-01 22:04:13 +00:00
Gerasim Troeglazov
55cf87a88c wacom: Add Product ID for One by Wacom (CTL-671) tablet.
Change-Id: Iddd89877d857e87ca226dc834292bbabd3a0ca36
2021-01-01 23:50:20 +10:00
PulkoMandy
d5d6ada3fd sparc: Fix linker script for PIE
Our bootloader really doesn't want the executable section to also be
writable (even if it needs to, for relocation purposes).

Force it to be read-only in program headers by explicitly setting the
flags.

Change-Id: I5b780f6fd9df5f073f0cbc6cc96bc21479004d2c
Reviewed-on: https://review.haiku-os.org/c/haiku/+/3584
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2021-01-01 00:45:13 +00:00
PulkoMandy
6fd0953545 sparc: implement thread local storage support
The sparc ABI reserves the g7 register for this.

Change-Id: I93b81ecef72cde859972ef7b7f6b9991d35f9f29
Reviewed-on: https://review.haiku-os.org/c/haiku/+/3583
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2021-01-01 00:45:13 +00:00
PulkoMandy
c40ab52437 sparc: move stack ouf of the way
This was copied from PPC and is not done on any other architecture.

Having the stack use the kernel address results in the kernel being
loaded elsewhere. Not really a problem (the kernel is relocatable), but
it's annoying when debugging as addresses need to be converted between
the elf file and the actual loading address.

Change-Id: Iab25af1fb8998b7ef5c583459c134aea80be8d72
Reviewed-on: https://review.haiku-os.org/c/haiku/+/3581
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2021-01-01 00:45:13 +00:00
PulkoMandy
964ce00391 openfirmware: we need a larger bootloader heap size
Currently about 366K are used. Round up to next power of two.

Change-Id: Id6713b4f4eebfbced310bbd75a16a5737228ae72
Reviewed-on: https://review.haiku-os.org/c/haiku/+/3577
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2020-12-31 02:58:10 +00:00
PulkoMandy
75c2a94a87 sparc mmu: fix free physical range search
The code was ignoring most of the memory and eventually didn't find
enough of it to load all kernel modules.

Change-Id: I8abcb6cd20eb2a37147d720eb63af1c2820628f3
Reviewed-on: https://review.haiku-os.org/c/haiku/+/3576
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2020-12-31 02:58:10 +00:00
PulkoMandy
baca34bee5 bootloader heap: more detailed errors on out-of-memory
It's hard enough to debug bootloader code already, let's gather as much
info as we can from error messages.

Change-Id: I47dff402286625d1213caa36ae6ee8ecf707dfad
Reviewed-on: https://review.haiku-os.org/c/haiku/+/3574
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2020-12-31 02:58:10 +00:00
PulkoMandy
bba45f645b openfirmware: fixup video driver for 64bit
We now have a bootsplash on sparc!

Change-Id: I583a3015a86618292088fe4379f548467d30ec4f
Reviewed-on: https://review.haiku-os.org/c/haiku/+/3572
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2020-12-31 02:58:10 +00:00
PulkoMandy
185e6809fc sparc: Build fixes
- Wrong printf format in bootloader elf panic call
- Missing functions for sparc

Change-Id: I4715a8d6d3d864d379b8386dc3958e0a2c1962e7
Reviewed-on: https://review.haiku-os.org/c/haiku/+/3571
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2020-12-31 02:58:10 +00:00
Jérôme Duval
03c037b99a bootloader: defines _BOOT_PLATFORM_BIOS on x86/bios_ia32 2020-12-30 22:23:51 +01:00
PulkoMandy
55f429bd0e sparc: split the kernel into separate data and exec regions
This is what our bootloader expects. For some reason, ld does this by
default on x86, but not on other platforms. So, define the headers
ourselves.

Change-Id: I4b37938e7e6d48b19c8af68cf4a77193269335d4
Reviewed-on: https://review.haiku-os.org/c/haiku/+/3569
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2020-12-30 18:15:52 +00:00
PulkoMandy
89806d4075 openfirmware: Make realtime clock init non-fatal
The realtime clock is used only to seed the random number generator for
picking a random TCP port. This is not very important, so there's no
reason to completely fail when it doesn't work.

Change-Id: I50123433153c16595118fdf923f4b707e2c98fdd
Reviewed-on: https://review.haiku-os.org/c/haiku/+/3568
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2020-12-30 18:15:52 +00:00
PulkoMandy
9a8463437d bootloader elf: fix misaligned access
The elf region structure is packed. So it's not possible to use a
pointer to one of its fields on sparc. Use a temporary variable that's
properly aligned.

Change-Id: I9dd9b9f2b1d14821e34bc2f5b3da661086ef3fef
Reviewed-on: https://review.haiku-os.org/c/haiku/+/3567
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2020-12-30 18:15:52 +00:00
PulkoMandy
2ef7fd7186 bootloader elf: fix elf64 loading for non-x86 platforms
Some code was enabled only for EFI, but is in fact correct for all
platforms except BIOS. Switch the defines around to have the correct
code enabled by default.

Change-Id: I58b1d17a78dcf273ceee88318338b4770b500bb3
Reviewed-on: https://review.haiku-os.org/c/haiku/+/3566
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2020-12-30 18:15:52 +00:00
PulkoMandy
85b4ce6191 bootloader elf: fix tracing for 64bit
Change-Id: I59f22c5768ed245cfd937be3f60127672d6ffc61
Reviewed-on: https://review.haiku-os.org/c/haiku/+/3565
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2020-12-30 18:15:52 +00:00
PulkoMandy
3463eeac01 openfirmware: add a menu entry to go back to the firmware prompt
It's annoying to need to reboot the machine everytime I test a change to
the bootloader.

Change-Id: I1bc8530f397b2a6d66ec26f08527dab9b2a2699b
Reviewed-on: https://review.haiku-os.org/c/haiku/+/3564
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2020-12-30 18:12:07 +00:00
Pascal Abresch
f924bac3c7 StyledEdit: Fix New menu item after hrev54812
Change-Id: I583bc43dc64d46e92e20e46da9a894c489617d43
Reviewed-on: https://review.haiku-os.org/c/haiku/+/3563
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2020-12-30 17:36:10 +00:00
Pascal Abresch
39b50e1008 StyledEdit: fix statusview font size
Change-Id: I0d1fd0c0d3628c30c17748e11accc9907d028953
Reviewed-on: https://review.haiku-os.org/c/haiku/+/3562
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2020-12-30 17:36:10 +00:00
Pascal Abresch
0d6b19e963 DeskCalc: Remove __HAIKU__ ifdef
No functional change intended

Change-Id: I934bef5c8b09a267c423edf7698bb57170e43945
Reviewed-on: https://review.haiku-os.org/c/haiku/+/3559
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>
Reviewed-by: Stephan Aßmus <superstippi@gmx.de>
2020-12-30 14:47:39 +00:00
Alexander von Gluck IV
013554844f file_system/fat: Fix minor typo in last commit. Unintentional uchar to char
Change-Id: I51aab4690c6964c1daf1a2c8882756c393e354dd
2020-12-30 08:26:42 -06:00
Alexander von Gluck IV
9f3ba01bd3 file_system/fat: Rework driver for fs_shell support
* Introduce fat_shell for build system fat manipulation
* Will theoretically let us do away with mtools when we
  have another internal tool for partition manipulation

Change-Id: I661be556e79009842f157a9402c8f85da85d6336
Reviewed-on: https://review.haiku-os.org/c/haiku/+/3556
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>
2020-12-30 14:10:19 +00:00
jpdw
aa013a511f WebPositive: Dropdown menu for choosing search engine
- Move the list of search engines used for search shortcuts to
  SettingsKeys.cpp/h and remove need for dynamic allocation.
- Use it in the settings window to help filling the default search
  engine field.

Fixes #15218.

Change-Id: I3783f6a346ad0fef2cff97eb930cb98cee39f660
Reviewed-on: https://review.haiku-os.org/c/haiku/+/3439
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>
2020-12-30 13:55:10 +00:00
Axel Dörfler
786f045666 BootManager: add support for page down/up/home/end keys
* Page down is the same as the end key, and just selects the last entry
  in the boot menu.
* Likewise, page up is the same as the home key.

Change-Id: Ibaf8559b0f68462834395aaec8fb22554d7a90f6
Reviewed-on: https://review.haiku-os.org/c/haiku/+/3555
Reviewed-by: John Scipione <jscipione@gmail.com>
Reviewed-by: Jérôme Duval <jerome.duval@gmail.com>
2020-12-30 13:36:01 +00:00
Jérôme Duval
a7375336a6 virtio_net: enable initial multicast
ATM we don't filter multicast addresses.

Change-Id: I762b65504d04ab79e3bc3fe0b99d06f30f0768c2
Reviewed-on: https://review.haiku-os.org/c/haiku/+/3454
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>
2020-12-30 13:35:27 +00:00
Máximo Castañeda
2e68fbd207 Fix wrap for AUDIO_INT
Floats don't have enough precision for all 32 bit integers. In
particular, near INT32_MAX their value is INT32_MAX + 1, which, when
converted back to int becomes INT32_MIN.

Change-Id: Ief3c1177b4f69baac13df5bac977882fea95ae01
Reviewed-on: https://review.haiku-os.org/c/haiku/+/3511
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>
2020-12-30 13:35:14 +00:00
Jaidyn Ann
4c8cf0257e MediaPlayer: Fix randomizer command typos
Change-Id: I6e136477dd6b74c2f877756451b94779d02f8ff8
Reviewed-on: https://review.haiku-os.org/c/haiku/+/3557
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2020-12-29 21:44:54 +00:00
Jaidyn Ann
1cfb79d74a MediaPlayer: Fix playlist manipulation on x86_64
Fixes a problem on x86_64 with removing, shuffling, and moving
multiple playlist items.

Instead of casting directly between an array of addr_t and int32
values, an int32 array is filled manually. Commands are passed
BLists instead of int32 arrays.

Fixes #15737 #16698

Change-Id: I5f67cd511ba10b16bd52d87cda380dd15ce7ee67
Reviewed-on: https://review.haiku-os.org/c/haiku/+/3553
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2020-12-29 19:20:36 +00: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
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
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
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
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
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
Jérôme Duval
116794af63 ipv4: reenable multicast
tested between two Haiku VMs with iperf.

Change-Id: Id9d3865f2c9f8ed6c79d0ece53f51c781c77b771
Reviewed-on: https://review.haiku-os.org/c/haiku/+/3453
Reviewed-by: Rene Gollent <rene@gollent.com>
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>
2020-12-11 11:45:46 +00:00
Murai Takashi
6182c5ad27 fontdemo: Fix null pointer dereference
Fix possible null pointer dereference at line 314
when 'submenu' is NULL at line 297.
Pointed out by cppcheck.

Change-Id: I054f63d574f4a9608df49d48ee74b87cd0116f69
Reviewed-on: https://review.haiku-os.org/c/haiku/+/3492
Reviewed-by: Jérôme Duval <jerome.duval@gmail.com>
2020-12-11 08:55:35 +00:00
Murai Takashi
efc042ff48 Window: Fix dead assignment
Fix value stored to 'maxWidth' or 'maxHeight' is never read
when maxWidth > fMaxWidth or maxHeight > fMaxHeight.
Pointed out by Clang Static Analyzer.

Change-Id: I2bd0b8712d47e64298c0f915f24f7f1c87f4362e
Reviewed-on: https://review.haiku-os.org/c/haiku/+/3474
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>
Reviewed-by: Jérôme Duval <jerome.duval@gmail.com>
2020-12-10 11:40:20 +00:00
X512
6467297a1b simplify AutoDeleter code by using typedef
Change-Id: I726c3aee794b91ed51970853db3921d17a5f795e
Reviewed-on: https://review.haiku-os.org/c/haiku/+/3462
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>
2020-12-10 11:39:49 +00:00
X512
36aafa560b fix build after CObjectDeleter interface change
Change-Id: I76e217abcd13c22c4d68170e07333cdde4d7a891
Reviewed-on: https://review.haiku-os.org/c/haiku/+/3461
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>
2020-12-10 11:39:49 +00:00
X512
71e79db9b8 fix build after AutoDeleter change
Change-Id: Id6ffc8d58821159b1d570bf5ac17d8347d88f7f5
Reviewed-on: https://review.haiku-os.org/c/haiku/+/3459
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>
2020-12-10 11:39:49 +00:00
X512
ab57ee42cb fix build after MethodDeleter interface change
Change-Id: Iadb9e37772fd6588636085944c1455249ac0f926
Reviewed-on: https://review.haiku-os.org/c/haiku/+/3457
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>
2020-12-10 11:39:49 +00:00
Augustin Cavalier
6f243905bf kernel: Allow usage of magic team constants in create_area_etc.
All other functions that support these handle them specifically,
so vm_create_anonymous_area must do so as well.

Change-Id: I7233770926b718936baeff10ef73668ac15c5201
Reviewed-on: https://review.haiku-os.org/c/haiku/+/3477
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2020-12-10 03:04:52 +00:00
Adrien Destugues
369abf3be4 Have a minimum size for scrollbars
With small font sizes, the scrollbars don't need to get smaller than 14
pixels. So, don't allow the scaling to go below 1.
2020-12-09 21:57:31 +01:00
Murai Takashi
b9e10b0796 Expander: Fix dead nested assignment
Fix value stored to 'status' is never read.
Pointed out by Clang Static Analyzer.

Change-Id: I0bbeafb74168d566128b53f8ad40e71218c78c45
Reviewed-on: https://review.haiku-os.org/c/haiku/+/3473
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>
2020-12-09 20:38:41 +00:00
Adrien Destugues
5d1042057b Add Noto Sans Symbols2 to font fallbacks
Also use the correct symbol for the return key (we were using another
similar arrow because this one was not available in DejaVu Sans).

Fixes #14034.

Note that build/jam/repositories/HaikuPorts ships an old version of the
Noto package that does not include the Symbols2 font. It should be
updated. Adding this to the pile of lagging behind packages, alongside
icu, mawk/gawk, and tnftp. Can anyone take care of it?
2020-12-09 20:00:26 +01:00
Murai Takashi
2c08d25325 bin/media_client: Fix memory leak
Fix leak of memory allocated to 'app'.
Pointed out by Clang Static Analyzer.

Change-Id: I59d39b76a18893bd284db1d75e40620bb1aee9e2
Reviewed-on: https://review.haiku-os.org/c/haiku/+/3480
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>
Reviewed-by: Axel Dörfler <axeld@pinc-software.de>
2020-12-09 16:12:43 +00:00
Jérôme Duval
65b3fe452a GameKit: give up default template parameter for gcc2 2020-12-08 15:46:55 +01:00
Murai Takashi
2db8ba2c8d Menu: Fix dead store
Fix value stored to 'flags' is never read.
Pointed out by Clang Static Analyzer.

Change-Id: Ia154fbdd4dd5fb10716cf9079625ca65e2f58122
Reviewed-on: https://review.haiku-os.org/c/haiku/+/3472
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>
2020-12-08 13:46:51 +00:00
Jérôme Duval
6336b86ab8 GameKit: gcc2 build fix 2020-12-08 14:39:56 +01:00
Máximo Castañeda
fb6ee7844d GameSoundBuffer: avoid buffer copy
Change-Id: Ibffe80ebe5e8205e853e09b6ebb9ba65b53d83e7
Reviewed-on: https://review.haiku-os.org/c/haiku/+/3475
Reviewed-by: Jérôme Duval <jerome.duval@gmail.com>
2020-12-08 12:33:22 +00:00
Máximo Castañeda
cfe72209cf U8 sound format
U8 sound has a nonzero value as its zero amplitude, so it needs to be
special-cased when mixing, applying gains and other transformations.

Change-Id: I5ad96b5f39d454bffad2449ac9f27b2ae61e2ccd
Reviewed-on: https://review.haiku-os.org/c/haiku/+/3470
Reviewed-by: Jérôme Duval <jerome.duval@gmail.com>
2020-12-08 12:33:22 +00:00
Murai Takashi
6cd9975b85 bin/keymap: Fix memory leak
Fix leak of memory allocated to 'app'.
Pointed out by Clang Static Analyzer.

Change-Id: I2cbd005d42d4747937ee4b6e12ccf409f122ea24
Reviewed-on: https://review.haiku-os.org/c/haiku/+/3478
Reviewed-by: Jérôme Duval <jerome.duval@gmail.com>
2020-12-08 12:27:40 +00:00
Máximo Castañeda
8e9d64f0d6 FileGameSound: fix stuck in pause when ramped
Change-Id: I346d7b93fa8507451ee46856ad6618acd6e2d609
Reviewed-on: https://review.haiku-os.org/c/haiku/+/3469
Reviewed-by: Jérôme Duval <jerome.duval@gmail.com>
2020-12-08 04:32:56 +00:00
Máximo Castañeda
15de111dcf FileGameSound: fix buffer advance accounting
Change-Id: I15bb2b1e703cad955544a1151adc6a1277b077a8
Reviewed-on: https://review.haiku-os.org/c/haiku/+/3467
Reviewed-by: Jérôme Duval <jerome.duval@gmail.com>
2020-12-08 04:32:56 +00:00
Alexander von Gluck IV
9293eadbda opengl/glinfo: Fix broken GLinfo app
* Can't call InfoView() with an unlocked BGLView.
* If unable to obtain to glGetString, show some "unknown" messages

Change-Id: I17d8ff84feed166644d54b0e19e0ef1fce202a74
Reviewed-on: https://review.haiku-os.org/c/haiku/+/3476
Reviewed-by: X512 <danger_mail@list.ru>
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2020-12-08 00:25:45 +00:00
Alexander von Gluck IV
9adc70887e efi: Call console-control to enter text mode
Change-Id: Ife1df3415bc5a31801bcb3d925f1b7c3a105f51b
Reviewed-on: https://review.haiku-os.org/c/haiku/+/2250
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>
2020-12-07 11:32:28 +00:00
Máximo Castañeda
8eafd6cd04 GameKit: use more than 1 sec precision ramping
Change-Id: I015f116239fad5dd48f7f4509db503dc8f60c0d0
Reviewed-on: https://review.haiku-os.org/c/haiku/+/3468
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2020-12-06 18:17:55 +00:00
Augustin Cavalier
10bc5b6e2f Tracker: Increase the readability threshhold to 50%.
nephele is working a more comprehensive fix to this code, but for now,
this seems to be sufficient for the time being.
2020-12-05 15:23:14 -05:00
Lt-Henry
e6bb814359 acpi_thermal: some style corrections
Change-Id: I7194be3b284e2de839afb53037b26fc691984dd7
Reviewed-on: https://review.haiku-os.org/c/haiku/+/3442
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>
2020-12-04 07:29:11 +00:00
Lt-Henry
3d0f2eea4f acpi_thermal: get the driver working
Change-Id: Ib0b7de56ef35092da93cc5fa61bdf0cfef41c042
Reviewed-on: https://review.haiku-os.org/c/haiku/+/3440
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>
2020-12-04 07:29:11 +00:00
X512
d99d8dbdd2 app_server memory management: use ObjectDeleter to mark ownership
Make object ownership explicit by use of ObjectDeleter where possible.

Change-Id: I499a00aa3390d1510ae284419e73faffa5166430
Reviewed-on: https://review.haiku-os.org/c/haiku/+/2695
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>
Reviewed-by: Alex von Gluck IV <kallisti5@unixzen.com>
2020-12-03 18:45:14 +00:00
Adrien Destugues
a959262cd0 implement mlock(), munlock()
Change-Id: I2f04b8986d2ed32bb4d30d238d668e21a1505778
Reviewed-on: https://review.haiku-os.org/c/haiku/+/1991
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>
2020-12-03 07:58:05 +00:00
CruxBox
0dc6805e00 xfs: Read Leaf Directories
We can read leaf directories now.

Change-Id: I4276c264f9e72013fa99c898a8332cb363e9ab3e
Reviewed-on: https://review.haiku-os.org/c/haiku/+/3035
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>
2020-12-03 07:57:15 +00:00
CruxBox
bd0708fd41 xfs: Attempt at reading Leaf Directories
We can read leaf directories now but I've only checked for a single
block working right now. I might make a few more changes in an upcoming
patch.

Change-Id: I325de8a6fad4ef9298e7810256cba47a87c45187
Reviewed-on: https://review.haiku-os.org/c/haiku/+/3027
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>
2020-12-03 07:57:15 +00:00
CruxBox
a20b880907 xfs: Renaming variables and bug fix in read_dir
Main issue was use of sizeof(dirent) instead of sizeof(struct dirent).
It didn't cause any issue before but I found it ambiguous. Also, renamed
the dirent variable to buffer to remove any ambiguity.

Change-Id: I36ab40eea354424a4fddc3292ee7e1aaed446859
Reviewed-on: https://review.haiku-os.org/c/haiku/+/3198
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>
2020-12-03 07:57:15 +00:00
Jérôme Duval
00866cc149 IOCache: adjust the last iovec when the capacity isn't multiple of B_PAGE_SIZE
Patch by mark_mcs, edited by me
this fixes #16030

Change-Id: I9255fe960f73cdfc3fd2668cdaf7db19fedd70f1
Reviewed-on: https://review.haiku-os.org/c/haiku/+/3451
Reviewed-by: Rene Gollent <rene@gollent.com>
2020-12-02 23:48:32 +00:00
Adrien Destugues
5f51a74f1a Build fix.
Some code in a just merged patch needs another one that's still being
discussed on Gerrit. Extract just the parts we need to get things
building again.
2020-12-02 20:05:20 +01:00
X512
60d3078585 app_server memory management fixes: use BReference
Use BReference for more automated reference counting in app_server,
fixing some use-after-free and other problems.

Extracted from https://review.haiku-os.org/c/haiku/+/2695

Change-Id: I141bb248229405896b29feff3338447f7257b0b4
Reviewed-on: https://review.haiku-os.org/c/haiku/+/3175
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>
2020-12-02 17:59:06 +00:00
John Scipione
30ecf636e0 Tracker: Scroll text to beginning on edit name
... so that the full file name is shown.

Center the file name in the edit box a bit better, the edit box is still
off compared to the non-editable file name by a pixel sometimes.

Use be_plain_font instead of getting the font from the PoseView since
the PoseView font is set to be_plain_font.

Fixes #16476

Change-Id: Ibda9341593163cdde898a83c98bf5ccea37126be
Reviewed-on: https://review.haiku-os.org/c/haiku/+/3399
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>
2020-12-02 17:58:47 +00:00
Jérôme Duval
b943b993c7 freebsd_network: Use user_memcpy() for ETHER_ADDMULTI/ETHER_REMMULTI
Change-Id: Id0a7e50f9ae38bff42faf1d6c4a62f702347bda3
Reviewed-on: https://review.haiku-os.org/c/haiku/+/3446
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2020-12-02 07:40:16 +00:00
Máximo Castañeda
a1c9aa9d90 Get a fallback font for each missing character
Make the glyph layout engine look for a suitable font fallback for each
missing character, instead of using the first one found for all of them.

Solves #16404, #16213, maybe other garbled text issues.

Does not solve similar issues of getting slightly different positions and
widths for a whole string than for the sum of its parts due to subpixel
rendering (cf #15007 comment 2).

Change-Id: I40664e32c8ecd5f09e10aa7a60fcdaec230471b6
Reviewed-on: https://review.haiku-os.org/c/haiku/+/3273
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>
2020-12-01 11:45:27 +00:00
Mitsunori YOSHIDA
bca2f73564 nfs: Fix panic occurs when creating a file
Fix an issue #5496 where panic occurs when creating a file with nfs v2
due to the newly generated vnode of the file is not published
and is still busy.

Change-Id: I490a10d4c7de6c87e309a21da575d6cc1a521974
Reviewed-on: https://review.haiku-os.org/c/haiku/+/3436
Reviewed-by: Jérôme Duval <jerome.duval@gmail.com>
2020-12-01 07:23:55 +00:00
Fredrik Holmqvist
cb26d04e81 arm: kernel link cleanup and fixes
* Removes several previous hacks, and makes kernel loading
  by our bootloader more reliable.
* Long list of "Couldn't find both text and data" errors
  no gone in our bootloader as it loads our kernel

Change-Id: Ic9f5ed44975d41fb22d7ab19536261432abe84ba
Reviewed-on: https://review.haiku-os.org/c/haiku/+/3444
Reviewed-by: Alex von Gluck IV <kallisti5@unixzen.com>
Reviewed-by: Fredrik Holmqvist <fredrik.holmqvist@gmail.com>
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>
2020-11-30 22:08:32 +00:00
Máximo Castañeda
64fc5a66b1 DefaultMediaTheme: fix Slider scale
Values are using a scale of 1000, but limits are set 0..100. Very
visible in media preferencies when using balance controls for stereo
connections in the mixer: the control is shown full right at first and
the moment you touch it and the gain is updated, you only get sound from
the left channel.

Probably the root cause of #15836 and #16070.

Change-Id: I31d3b6b11a57ca99a1cc8373d9fb003f21b192b3
Reviewed-on: https://review.haiku-os.org/c/haiku/+/3445
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>
2020-11-30 20:06:16 +00:00
Jérôme Duval
b6e85f802d ipv4 & ipv6: remove_trailer() uses a positive size as parameter
Change-Id: Id7d009cfee7727afb8267703c22c467e5f636070
Reviewed-on: https://review.haiku-os.org/c/haiku/+/3438
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>
2020-11-30 15:02:46 +00:00