Commit Graph
100 Commits
Author SHA1 Message Date
Augustin Cavalier fe9e1e0c4f package_infos: Restore old compat version in x86_64.
The x86_64 buildmaster was only updated past the R1~beta1 version
a few weeks ago, so most packages still have a R1~alpha4_pm dependency.
Thus thus broke the build. Revert it for now so we don't do that.
2019-02-20 19:43:37 -05:00
Augustin Cavalier 5fd8023312 XHCI: Disable Stop/SetTRD/Reset again.
They don't seem to particularly help, and there are reports
that this broke XHCI completely on some devices.

This reverts commit a21f7b525b.
2019-02-20 16:37:03 -05:00
Augustin Cavalier 01796e78f4 kernel/x86: Re-introduce the 1MB lower barrier.
It was removed in 2008 to make VM86 work, which is now gone.

Fixes #14911.
2019-02-20 15:37:06 -05:00
Augustin Cavalier 10aa58d7c3 kernel/vm: Make sure the base address is larger than fBase.
This is technically only a functional change following the previous
commit, which unconditionally made sure the address was larger than
the base except for B_EXACT_ADDRESS. Essentially this makes sure
that if an address is passed which is smaller than the base is
passed in, it won't immediately fail just by being too small.

Checked against BeOS (0x0 passed to create_area with B_BASE_ADDRESS
succeeds, and returns 0x2000 consistently.) This is also needed
to not break userland initialization following the next commit.
2019-02-20 15:33:32 -05:00
Augustin Cavalier 836a9548e0 kernel/vm: Remove VM86-related address space hacks.
VM86 was removed in 2012, so these are no longer needed.
The USER_BASE vs. USER_BASE_ANY distinction still seems like a
potentially useful one, though, so I've left all those changes in.
2019-02-20 13:28:25 -05:00
Augustin Cavalier b08b51b417 BFS: Fix vising attribute runs in FileSystemVisitor.
See inline comment. Fixes "vnode refcount > 0" assert failures while
running checkfs after yesterday's commits.
2019-02-20 11:24:15 -05:00
Augustin Cavalier 13c4bc94ca kernel: Undo changes to pinned threads and blocking.
This reverts commit 58ed2965d0.
This reverts commit 055d49b1fd.

I was mistaken, it is perfectly legal to block a pinned thread.
It seems we'll need some other way to detect invalid context
switches.
2019-02-20 10:34:18 -05:00
Augustin Cavalier 055d49b1fd kernel/x86: Pin the current thread before calling interrupt handlers.
int_io_* functions do not touch the thread state, but we already have
it here as we will modify its contents later, so it makes more sense
to set this flag here.

This is mostly only relevant following the previous commit, i.e.
finding interrupt handlers that brokenly try to context-switch.
2019-02-19 21:38:15 -05:00
Augustin Cavalier 58ed2965d0 kernel: Panic on attempts to block a pinned thread.
Preventing "normal" context switches caused by a time interrupt
is the primary reason for pinning threads. "thread_block" and friends,
however, cause an explicit context switch and will not return until
another thread unblocks us.

Calling these while a thread is pinned is thus undefined behavior,
and so we should just panic in the case anyone attempts to do so.
2019-02-19 21:35:39 -05:00
Augustin Cavalier a21f7b525b XHCI: Move and reorder Stop/SetTRD/Reset during endpoint creation.
Fixes a lot of "command failed: invalid context" errors on a variety
of devices following previous commits. Does not seem to affect much,
though.
2019-02-19 21:33:54 -05:00
Augustin Cavalier a182f19364 USB: Properly assign IDs to USB Bus Managers (HCI drivers).
Previously they would just get -1, as the BusManager class
would request their ID before they had been added to the Stack.
Now we add them to the stack inside ::Start(), rather than letting
the individual drivers do that just after ::Start(), and then assign
the ID there directly.
2019-02-19 17:14:54 -05:00
Augustin Cavalier d6f3954f39 XHCI: Tweak copyright header.
* List authors in alphabetical order.
 * Add myself.
 * Make first copyright year the actual year the file was created.
2019-02-19 16:41:47 -05:00
Augustin Cavalier c62142a72b kernel: Add missing NULL check to _user_xsi_semget.
Private semaphores will have a key of -1, but IPC_PRIVATE is 0,
meaning it is possible to wind up here and get a NULL semaphoreSet
if someone passes us an argument of -1.

Reported on Twitter.
2019-02-18 23:24:28 -05:00
Augustin Cavalier d47cf79f7c XHCI: Rework endpoint-for-pipe setup and initialization.
* Stop/Reset/Set was commented out because it caused invalid context
   states. This was because we cannot run those commands until after
   we have configured the endpoint. Moving them to after that
   makes it work properly.
 * Add the endpoint to the context after configuring it, not before.
 * After configuration, we need to issue either an EvaluateContext
   or a ConfigureEndpoint, but not both, depending on whether
   this is endpoint number 1 (Control) or not.

All cross-checked against FreeBSD (the last change in particular comes
directly from a change of theirs.)

Tested with usb_disk and usb_hid on already-working hardware, no
obvious regressions. Possibly helps with #13834, among other
initialization problems.
2019-02-18 17:04:12 -05:00
Augustin Cavalier 0ca15910c4 XHCI: Check return value of _LinkDescriptorForPipe. 2019-02-18 11:53:05 -05:00
Augustin Cavalier db360a2064 XHCI: Make sure we have at least one TRB in CreateDescriptorChain.
Linux seems to do the same thing. Confirmed as correct by korli
in #12929.
2019-02-18 11:53:05 -05:00
Augustin Cavalier eae896c7ae XHCI: Print command code in "unsuccessful command" log message.
This should help with debugging #13772.
2019-02-18 10:15:55 -05:00
Augustin Cavalier a881209f38 XHCI: Minor tweaks and other changes.
* Cap fSlotCount at the hardware level, not just at the software
   level.
 * Clear interrupts in init routine.
 * Write high DMA address of DCBAAP.

Found by cross-comparing with DragonFlyBSD and OpenBSD.
2019-02-18 10:05:04 -05:00
Augustin Cavalier 6554cc220f XHCI: Fix the build of tracing code. 2019-02-18 10:03:47 -05:00
Augustin Cavalier c054900882 kernel: Sanity-check interrupts in snooze().
This didn't trigger any panics on my bare-metal dev install when tested,
but it might explain some easily-reproducible hardlocks (i.e. can't
even drop to KDL via emergency keys) I was seeing on other machines.
2019-02-17 14:36:16 -05:00
Augustin Cavalier 1eededf17f kernel: Only sanity-check interrupts in switch_sem_etc under KDEBUG.
"are_interrupts_enabled()" is a "relatively" expensive function, so avoiding
it makes sense. This is the same way it's done elsewhere in sem.cpp, as well
as for mutexes and condition variables also.
2019-02-17 14:34:36 -05:00
Augustin Cavalier c61fa718f2 usb_disk: Handle user buffer-to-partial buffer copies correctly.
Discovered by an SMAP violation triggered by running "writembr" on a
USB drive.
2019-02-17 13:10:24 -05:00
Augustin Cavalier 6b0251e1bd syscall_args: Remove R5 compatibility hack. 2019-02-17 13:06:49 -05:00
Augustin Cavalier 50428c35ad btrfs: Fix double-free in Inode::_Read().
extent_data is now held by a MemoryDeleter, so thus with this line
it would have been freed twice.
2019-02-15 14:19:07 -05:00
Augustin Cavalier b6adef8501 media_server: Adapt to new HashMap API. 2019-02-14 20:47:13 -05:00
Augustin Cavalier b7598b65ba HashSet: Make iterator const.
Nothing that uses this API at present needs a const iterator (and
as far as I could see, nothing ever called Remove() on the iterator.)
But this is now how HashMap's API works, so let's be consistent.
2019-02-14 20:43:49 -05:00
Augustin Cavalier 97babea6d7 app_server: Adapt to new HashMap API. 2019-02-14 20:43:23 -05:00
Augustin Cavalier 759d502e32 HashSet: Fix the build with GCC 7. 2019-02-14 19:57:42 -05:00
Augustin Cavalier fc8e5be1c8 HashMap: Fix the build with GCC 7. 2019-02-14 19:52:45 -05:00
Augustin Cavalier b6840f3610 netfs: Take advantage of HashKeyPointer.
Change-Id: I80b6eb40749a0d592b69bc7030608916b1c94a35
Reviewed-on: https://review.haiku-os.org/c/1054
Reviewed-by: waddlesplash <[email protected]>
2019-02-15 00:34:36 +00:00
Augustin Cavalier de48af7a58 Adapt all consumers of HashSet and HashMap to the slightly-different APIs.
No functional changes intended. Tested and verified as working.

Change-Id: Iaa67c2e5f0d9aff433ac7348e63e901a6a80e589
Reviewed-on: https://review.haiku-os.org/c/1043
Reviewed-by: waddlesplash <[email protected]>
2019-02-15 00:34:36 +00:00
Augustin Cavalier cc54b43e68 shared: Finish HashSet and fixup HashMap.
Changes are pretty straightforward. The iterator is now const
again, but can be passed to the hash table itself for removal
of the current item.

Change-Id: Ifd3c8096ffb187a183ca5963ed69a256562a524f
Reviewed-on: https://review.haiku-os.org/c/1042
Reviewed-by: waddlesplash <[email protected]>
2019-02-15 00:34:36 +00:00
Augustin Cavalier eff1e73cef shared: Merge BOpenHashTable in; remove OpenTracker's OpenHashTable.
The HashMap and HashSet classes are copied from userlandfs. The
HashMap one works as-is as it's already used in userlandfs; the
HashSet does not even compile yet.

Change-Id: I1deabb54deb3f289e266794ce618948b60be58c0
Reviewed-on: https://review.haiku-os.org/c/1041
Reviewed-by: waddlesplash <[email protected]>
2019-02-15 00:34:36 +00:00
Augustin Cavalier 279470d553 netfs: Take advantage of HashKeyPointer.
Change-Id: I838d91cfa9b1b16ba9c42d62cabfe4716b49e425
Reviewed-on: https://review.haiku-os.org/c/1040
Reviewed-by: Adrien Destugues <[email protected]>
Reviewed-by: Stephan Aßmus <[email protected]>
2019-02-13 10:30:29 +00:00
Augustin Cavalier 58852727a3 BOpenHashTable: We need std::nothrow, so don't depend on others to include it.
Change-Id: Ibe21cef215a730f88eeea499c305a54ce397aeba
Reviewed-on: https://review.haiku-os.org/c/1039
Reviewed-by: Adrien Destugues <[email protected]>
Reviewed-by: Stephan Aßmus <[email protected]>
2019-02-13 10:29:24 +00:00
Augustin Cavalier a5e9253fe0 BHoliday: Remove, unused.
There isn't much use for a class that can only compute the dates of
two minor and one major holiday. Probably in the future the Locale Kit
could be extended to expose ICU holiday APIs, but seeing as that
is a less-used functionality, this can just be removed altogether
for now at least.

Change-Id: I18be044be7d5c6896295ed85d294abeea90b8bb0
Reviewed-on: https://review.haiku-os.org/c/1037
Reviewed-by: Adrien Destugues <[email protected]>
2019-02-13 10:14:59 +00:00
Augustin Cavalier f167d21adc runtime_loader: Use a RecursiveLocker instead of manually unlocking.
No functional change intended.
2019-02-11 16:35:33 -05:00
Augustin Cavalier 84e34948f6 WebPositive: Translate "No SSE2" window title, also. 2019-02-11 16:31:38 -05:00
Augustin Cavalier 35758c7046 CharacterMap: The CharacterView is scroll-view aware.
Fixes #14897.
2019-02-11 16:11:18 -05:00
Augustin Cavalier 514aaae7b1 Tracker: Remove list view menu from virtual directory window.
This reverts commit ed99a95f35.

It isn't needed now that list view sizing is dependent
on system font size.

Fixes #14897.
2019-02-11 16:07:22 -05:00
Augustin Cavalier e5d0c9094d BView: Add a B_SCROLL_VIEW_AWARE flag.
* This indicates the view will manage whatever scrollbars are targeted
   to it.
 * Use _B_RESERVED7_ for this. It's been RESERVED since BeOS R5
   (I guess it was probably something on some older BeOS version?)
   and we don't really care about BeOS R4 ABI compatibility, so
   that should be fine.
 * Update BScrollView to not touch BScrollBar range/proportion
   when the target view has this set.
 * Update BListView to set this flag, always.

Fixes #14871.

Change-Id: I17027f3b63ef28da1e735c5393593496c415dce3
Reviewed-on: https://review.haiku-os.org/c/998
Reviewed-by: Adrien Destugues <[email protected]>
2019-02-03 18:04:13 +00:00
Augustin Cavalier 3493fcb668 headers/kernel: Add argument names to initialization functions. 2019-02-02 18:10:54 -05:00
Augustin Cavalier fa03522846 libroot: Revert changes to hide BeOS-only functions.
I wasn't thinking correctly when I made the previous change --
init_term_dyn is compiled into all applications, and so these
functions need to remain in order to not break them.
2019-02-02 18:09:28 -05:00
Augustin Cavalier 89b5768731 network/hostname: Mark as a "service"-type.
It is technically the "reverse" of DNS settings, which are also
classified as a "service", so they should go together.
2019-02-02 17:29:52 -05:00
Augustin Cavalier 15a4183640 libroot: Move some BeOS-only API calls behind _BEOS_R5_COMPATIBLE_.
This is defined by our build system on GCC2 only, so they will now
be excluded under all other architectures.
2019-02-02 14:36:26 -05:00
Augustin Cavalier 06d77ca653 libnetwork: Remove not-so-useful printf.
We don't really need to see in syslog when an application is
running in R5 compatibility mode.
2019-02-02 14:20:16 -05:00
Augustin Cavalier 8270254464 libnetwork: Rename find_own_image() to set_own_image_location().
Thanks Axel for the review!
2019-02-02 14:01:30 -05:00
Augustin Cavalier d65ffc926c libnetapi: Remove __gNetAPIStart.
Not used by anything.
2019-02-02 13:26:18 -05:00
Augustin Cavalier 67ef9f72fc network: Utilize image_id argument to initialize_before.
We don't need to search for our own image_id, we already have it now,
so just use it.
2019-02-01 20:33:41 -05:00
Augustin Cavalier c5e4e4ffb4 headers/kernel: Include declarations of initialization functions in image.h.
No "real" functional change, but this causes GCC7 to throw errors when
these functions are declared without the image_id argument, which
in some files they were (as this commit repairs.)

This change is largely inconsequential on x86, but on callee-cleanup-args
targets, leaving out the argument would probably cause stack corruption.
2019-02-01 20:30:39 -05:00
Augustin Cavalier d545ad17ce headers/kernel: Define B_CURRENT_IMAGE_SYMBOL via __func__.
Previously, __haiku_init_before was a symbol that was included in
each (shared) object, and so it could be used to determine what
one we were in. Now, there are no such universal symbols that
are declared private to only the object, so we have to use
a different approach.

__func__ is defined as a const char* at the very beginning of
every function it's used in, set to a string of the function name
only, i.e., the arguments and return type are left off. So while
including that is perhaps not quite optimal, in practice this
definition is used extremely rarely (it was introduced by Haiku,
and it is used in only 2 applications at all that I could find --
WebKit and Canna.)

There really isn't any other way to get a pointer that we know
for certain is within the current object besides this one
without inserting one, but that really isn't merited just for this.
(__builtin_return_address() has problematic semantics wrt. inlining,
including linker-inlining.) So this will have to do.
2019-02-01 20:24:31 -05:00
Augustin Cavalier 475172337b headers/kernel: Move B_WAIT_TILL_LOADED to a syscall header.
It is only used as an argument to _kern_load_image directly, not to
any of the load_image functions in image.h, so it belongs in a syscall-
specific header like other such constants.

No functional change intended.
2019-02-01 19:45:56 -05:00
Augustin Cavalier 04b9fbfdfa headers/kernel: Clean up image.h.
* Add missing whitespace.
 * Remove definition of the now-gone __haiku_init_before.

No functional change intended.
2019-02-01 19:20:25 -05:00
Augustin Cavalier a396188f23 BSound: Add explicit cast to bigtime_t.
Fixes the GCC2 build.
2019-02-01 11:30:08 -05:00
Augustin Cavalier f7e2391702 XHCI: Use InitKernelAccess/PrepareKernelAccess properly.
* Actually check return codes of InitKernelAccess().
 * WriteDescriptorChain accesses the memory in the IO vectors, so
   we need to PrepareKernelAccess before calling it.

Fixes #14752.
2019-01-31 22:48:04 -05:00
Augustin Cavalier 32d4274178 kernel/team: Use a rw_spinlock to guard the sTeamsHash.
Virtually identical to my prior change to sThreadsHash.
2019-01-31 20:09:10 -05:00
Augustin Cavalier 5796ecc706 kernel/thread: Add proper permissions checks.
* Add a utility thread_check_permissions(), which takes the target
   thread, the calling thread, and whether or not this is a "kernel" call,
   and then returns whether the target thread may be legally modified.
 * Refactor all calls that operate by sending a signal to the thread
   into a single thread_send_signal() utility function, which now uses
   thread_check_permissions() appropriately.
 * Manually add the permissions checks to other functions as needed.

Solves a bunch of decade+-old TODOs.
2019-01-31 20:05:39 -05:00
Augustin Cavalier d745129c7a kernel: Mark TeamThreadTable::GetIterator() const.
We use it only while holding a "read" lock, so it must be.
2019-01-31 20:03:28 -05:00
Augustin Cavalier 8140719777 WebPositive: Use spinners for font size options.
Fixes #14845.
2019-01-29 13:31:09 -05:00
Augustin Cavalier 849f58107a build_cross_tools_gcc4: Enable initfini-array in binutils.
Our implementation of it now behaves properly after the last commit.

Change-Id: I6bebc91ae0f9512ea07ad6a7a4ccea9ee758e01b
Reviewed-on: https://review.haiku-os.org/c/908
Reviewed-by: waddlesplash <[email protected]>
2019-01-28 16:37:28 +00:00
Augustin Cavalier 354b60af29 runtime_loader: Rework static initialization handling.
Previously, static initializers were just in ".ctors", which was handled
by GCC's crtbeginS, and that was injected in-between crti and crtn. Now,
however, binutils puts static initializers into init_array/fini_array by
default, which runtime_loader handles, but of course as initialize_after and
terminate_after are supposed to be called *after* all static initializers
are called; and since runtime_loader called init_array after _init, they
were not.

Now, we get rid of the __haiku_init_before/etc. functions, and move their
functionality inside runtime_loader. This is a "soft" ABI breakage,
which is mitigated by adding another ABI breakage (runtime_loader now
returns NULL for the initialize_before/etc. symbols, as otherwise
old applications would have their initialize_before/etc. called twice;
once by runtime_loader, and then once by __haiku_init_before/etc.)

I don't see or know of any reason why an application would want to
get those symbols at runtime, though, so this shouldn't have any
adverse effects.

Change-Id: I42344c63f69c6f8ef260f6c3ca30202b6dfb153e
Reviewed-on: https://review.haiku-os.org/c/907
Reviewed-by: Jérôme Duval <[email protected]>
Reviewed-by: waddlesplash <[email protected]>
2019-01-28 16:37:28 +00:00
Augustin Cavalier 187bbba6af mime_db: Fix another typo. 2019-01-27 14:36:56 -05:00
Augustin Cavalier 4854630d29 BScrollView: Resize scrollbars dynamically based on target's B_SUPPORTS_LAYOUT...
...instead of the BScrollView itself's layout flag. Thanks to Adrien and
Kacper for discussion on the mailing list.
2019-01-27 14:35:32 -05:00
Augustin Cavalier b2d62af35a mime_db: Sniff rule must be on one line. 2019-01-27 13:42:27 -05:00
Augustin Cavalier 4bf8cf7a1b DefaultMediaTheme: Properly set control targets.
In removing the "GroupView" class and replacing it with a real BGroupView,
I missed that it its AttachedToWindow() implementation iterated over all
child controls and set their targets to themselves. It seems this is how
the Media Kit gets change messages from them, and so the lack of this
broke changing parameter values. Whoops.

But it seems that changing menu option values has been broken for a long time
(perhaps forever?), as in order for a BOptionPopUp to send messages to anything,
its AttachedToWindow() must be called (as this sets the BMenuItem's targets
to itself, so it can forward the messages.) So now that is fixed too.
2019-01-26 15:36:43 -05:00
Augustin Cavalier 132990ecdc idualwifi7260: Fix logic errors in iwm_pcie_load_firmware_chunk.
* There's no reason to have a while() loop here, because:
    - if msleep returns 0, that means we were woken up by the interrupt handler,
      and we are going to exit immediately as sc_fw_chunk_done will now be 1
      (there is nothing else that sleeps on sc_fw.)
    - if msleep doesn't return 0 (i.e. it returned ETIMEDOUT) then we will
      exit immediately because of the if-test.
   So, just use a single msleep() and then check sc_fw_chunk_done as before.
 * The comment said we were sleeping for 5 seconds, but the msleep was only
   for 1. Before the "sync firmware loading" FreeBSD commit, this was 1
   second and so was the comment, and in that commit the comment was changed
   and the function call wasn't.

The bugs here were introduced in the same FreeBSD commit as the "sizeof" bug
that I merged a fix for earlier.

Possibly fixes failures to initialize uCode on certain devices.
2019-01-25 11:25:16 -05:00
Augustin Cavalier f290b76670 People: Enclose PeopleView in a BScrollView.
People uses a customizeable set of attributes, and on my install
that has a lot of old BeOS applications, the window is too tall
for the screen. So now it will be possible to scroll it.

Depends on the prior change to BScrollView to auto-update
scrollbar limits when the window size changes, as otherwise
you will not be able to scroll properly.

As you can see by the date, I've had this patch sitting around
for almost 2 years now, waiting for BScrollView layouted behavior
to be fixed...

Change-Id: Iee7a691771d3b17efb2f6aba8c5011986ad0e36b
Reviewed-on: https://review.haiku-os.org/c/894
Reviewed-by: waddlesplash <[email protected]>
2019-01-24 18:52:39 +00:00
Augustin Cavalier 9e7d077d1b Media Kit: Remove DynamicScrollView from DefaultMediaTheme.
As of the last commit, a BScrollView in layouted mode now behaves
this way by default.

Change-Id: I07bd17d6d20e494c0e2f08172c0d54b10fa5d26d
Reviewed-on: https://review.haiku-os.org/c/893
Reviewed-by: Adrien Destugues <[email protected]>
2019-01-24 18:52:39 +00:00
Augustin Cavalier 5b0e5c0ac6 BScrollView: Automatically update the scrollbar proportions in layout mode.
Since we know what size the target view is / wants to be, we can automatically
set the range, steps, and proportion trivially. In non-layout mode, we retain
the old behavior. Applications or views that need custom scrolling behavior almost
certainly will be using BScrollBars directly and not this, so this should not be
"wasted computation" in pretty much any case.

Greatly improves the appearance and UX of the default case of a layouted
view inside a BScrollView.

Change-Id: Ia6ff6ee14df96799c579e15d274fd4c849675577
Reviewed-on: https://review.haiku-os.org/c/892
Reviewed-by: waddlesplash <[email protected]>
2019-01-24 18:52:39 +00:00
Augustin Cavalier 2502d45aca BTabView: Change layout constructor to default to B_WIDTH_FROM_WIDEST.
This seems to fit the "spirit of layout" better.

Change-Id: I7a75b58de4c9f703d828cdd292b7b91ee720c135
Reviewed-on: https://review.haiku-os.org/c/891
Reviewed-by: waddlesplash <[email protected]>
2019-01-24 18:52:39 +00:00
Augustin Cavalier 23bdc3d636 HaikuDepot: Fix build of unit tests after last commit. 2019-01-24 13:29:45 -05:00
Augustin Cavalier 3288c09996 idualwifi7260: Merge new changes from FreeBSD.
These seem to greatly improve driver stability.
2019-01-23 23:40:46 -05:00
Augustin Cavalier 478aa96dd7 Makefile Engine: Add quotes around INSTALL_DIR.
This is the correct solution to #11419; I missed in my original commit
that $(NAME) will already be escaped, and adding quotes double-escaped
it erroneously.
2019-01-23 23:39:46 -05:00
Augustin Cavalier ad7cab8751 Haiku Book: Update BFont docs. 2019-01-23 23:10:33 -05:00
Augustin Cavalier 79456ebd5b libroot: Fix build under GCC 7. 2019-01-22 23:56:59 -05:00
Augustin Cavalier 2b4b201847 libroot: Call abort() only if a signal handler is installed.
Preserving the assert failure message in debug reports is desirable,
so if possible we should do so, not just print it to stderr. So
now we reuse the same trick from abort() directly.

Sorry for the extra noise; I should have combined these commits.
2019-01-22 22:02:59 -05:00
Augustin Cavalier 7282d46cef libroot: Style cleanups in assert.c. 2019-01-22 21:53:08 -05:00
Augustin Cavalier f52bb5ce10 libroot: Call abort() instead of debugger() from assert().
As per the POSIX specification.

This gives the calling program a chance to catch the assertion. But
in the case where no signal handler is installed for SIGABRT, we
will call debugger() anyway and present as a crash as before.

Fixes #10295.
2019-01-22 21:50:17 -05:00
Augustin Cavalier f22ee592d6 kernel/vfs: Fix shadowed variables.
The -Werror=uninitialized caught this, but I fixed it the wrong way
rather than looking at the code a little closer.

Should fix the strange bugs that cropped up after the first VFS patch.
2019-01-22 21:37:15 -05:00
Augustin Cavalier 3f77fdd1d2 kernel/vfs: Fix -Werror=maybe-uninitialized. 2019-01-22 12:47:07 -05:00
Augustin Cavalier a4f5124fcc Media Kit: Rewrite DefaultMediaTheme to use layouts.
The old fixed-rect method was very error-prone in corner-cases,
resulting in half-visible (cut off) parameters, incorrectly
sized controls, etc. on various devices, which often made it
impossible to use.

While there are still a few rough edges (scrollbar behavior could
be further improved, though it's already much better than it was before),
this method is much better than the previous one.

Fixes #11592 and related tickets.

Change-Id: I65175f760bda98e42d1fc68ba8e526470bf17c25
Reviewed-on: https://review.haiku-os.org/c/889
Reviewed-by: Adrien Destugues <[email protected]>
2019-01-22 14:25:09 +00:00
Augustin Cavalier 658362336e Media: Don't delete the BLayoutItem when clearing the parameter view.
It is owned by the BView which we delete on the next line; and doing this
triggers an assert if there are still child views, which the BView destructor
cleans up before deleting the layout item.

Change-Id: I2f6f913b963e15c9808328aa2e0581cd1755e8ce
Reviewed-on: https://review.haiku-os.org/c/888
Reviewed-by: Adrien Destugues <[email protected]>
Reviewed-by: waddlesplash <[email protected]>
2019-01-22 14:25:09 +00:00
Augustin Cavalier a526bddb8d bootloader: Add missing NULL check. 2019-01-16 20:37:07 -05:00
Augustin Cavalier 1fef0f0fa8 bootloader: Use the already-detected filesystem module...
...rather than enumerating again. Solves a TODO (all filesystems
save tarfs and packagefs, which require special parameters and
of course will not be on standard "partitions", have implemented
the required function.)
2019-01-16 20:33:12 -05:00
Augustin Cavalier 450dd5db3a ACPI: Fix -Wunused-but-set-variable. 2019-01-16 19:32:45 -05:00
Augustin Cavalier 20f6556bff kernel/x86: Backslash-escape trigraphs.
Fixes an instance of -Wtrigraphs.
2019-01-16 19:32:16 -05:00
Augustin Cavalier 205beac382 ArchitectureRules: Enable more warnings. 2019-01-16 19:31:58 -05:00
Augustin Cavalier 8fa626d09d XHCI: Refactor register area access and handling.
* Don't bother aligning the PCI memory addresses; they will already
   be aligned, and even if by some mystery they aren't, map_physical_memory
   should be able to handle that. This greatly simplifies the code.
 * Use one pointer and then four different offset fields instead of four
   different pointers. This is what DragonFlyBSD and FreeBSD do; it's
   a negligible loss in performance (or none at all, depending on arch
   and compiler) as it requires only one more add, and greatly clarifies
   the code as to what's going on.
 * Remove (both previously and now) unused fields from the header.
 * Compute runtime and doorbell register offsets correctly (there
   was a missing bitmask.) This is how it's done on FreeBSD and
   DragonFlyBSD.
 * Actually write the high bits of the DMA addresses. Checked against
   FreeBSD and DragonFlyBSD.
 * Tweak error message.

Possibly fixes the "invalid bus space memory access" crash, but
I don't have any hardware that occurs on so I couldn't check.

Tested in VMware, VirtualBox, and on a ThinkPad E550 (Broadwell).
2019-01-16 19:27:41 -05:00
Augustin Cavalier 09fa96ee75 settings/drivers/kernel: Reorder to be in more logical groupings.
Also add better descriptions for APM and ACPI.
2019-01-16 15:34:26 -05:00
Augustin Cavalier 40cdf7d607 accelerants/vesa: Indicate when we are a dumb framebuffer device. 2019-01-16 11:49:56 -05:00
Augustin Cavalier e04196d564 settings/drivers/kernel: Clean up and clarify comments.
No "functional" change.
2019-01-16 11:35:40 -05:00
Augustin Cavalier 9f8ad6a31a idualwifi7260: Merge fix to firmware loading from FreeBSD.
Fixes #14298.
2019-01-16 11:12:02 -05:00
Augustin Cavalier 969aecd624 kernel: Disable -Werror for zstd. 2019-01-15 17:18:58 -05:00
Augustin Cavalier 96bc0f463f kernel/x86: Fix some warnings. 2019-01-15 17:08:18 -05:00
Augustin Cavalier f3441f9702 ArchitectureRules: Enable -Werror for the kernel. 2019-01-15 14:11:50 -05:00
Augustin Cavalier f8ea9ed5b4 kernel/sem: Fix -Wformat. 2019-01-15 14:11:20 -05:00
Augustin Cavalier de7581eec9 build: Add the new "Hostname" network panel to the regular image. 2019-01-15 14:06:49 -05:00
Augustin Cavalier a9f4ce4515 bootloader: Obey "load_symbols" kernel setting. 2019-01-14 20:45:56 -05:00
Augustin Cavalier c3361cad95 bootloader: Load driver settings before the kernel.
This way, parts of the bootloader (e.g. the ELF loader) that would
like to access driver settings can do so.
2019-01-14 20:44:25 -05:00
Augustin Cavalier 36f72031b1 kernel: Obey "load_symbols" kernel setting.
Somehow this was never implemented...
2019-01-14 20:31:48 -05:00