Commit Graph

59373 Commits

Author SHA1 Message Date
Augustin Cavalier
7ea987c1b8 kernel: Improvements to "resume" KDL command.
* Print a message when not resuming a thread because it is running.
   When I was using this command while working on ipro1000, I assumed
   that "no news was good news." But it seems that wasn't the case.
   Hopefully future developers will be less confused after this.
 * Allow resuming threads that are in "asleep" or "waiting" states,
   not just in "suspended" state. Presumably a developer poking around
   in KDL knows what they are doing, so allowing them to do this
   seems to make sense.
2019-01-07 23:14:41 -05:00
Augustin Cavalier
2e33d79d38 kernel: Panic on attempting to release a semaphore with interrupts disabled...
... and B_DO_NOT_RESCHEDULE unset. We already have equivalent panics
for mutexes and condition variables, so it seems to make sense to
check for this too.

There have been some bug reports recently about hard deadlocks with
symptoms (i.e. kernel debugger can't even be summoned) that match
"interrupt handler thread was context-switched while holding interrupt
lock," and this is the only major remaining path to that without
such a check.

This would have also helped me with recent FreeBSD driver porting;
I forgot to pass the flag once and deadlocked my system in precisely
this manner.
2019-01-07 22:15:58 -05:00
Augustin Cavalier
1c1efa6f2f kernel/x86: Use volatile in restore_interrupts.
We already use it in enable_interrupts, so we might as well
use it here too.
2019-01-07 22:12:36 -05:00
Augustin Cavalier
a84bb93b44 freebsd_iflib: Return the correct filter result in the interrupt handler.
Should fix #14803.
2019-01-07 21:58:50 -05:00
Augustin Cavalier
cf55254350 freebsd_wlan: Implement ieee80211_{add|get}_toa_params.
Required by the FreeBSD 12 atheroswifi driver.
2019-01-07 21:39:08 -05:00
Augustin Cavalier
2e07eed8ae aironetwifi: Upgrade to FreeBSD 12. 2019-01-07 21:06:36 -05:00
Augustin Cavalier
908c8ced92 idualwifi7260: GCC2 fixes. 2019-01-07 21:05:13 -05:00
Augustin Cavalier
53e3d3f593 freebsd_wlan: GCC2 fixes. 2019-01-07 21:04:59 -05:00
Augustin Cavalier
8842f2a01e freebsd_network: GCC2 fixes. 2019-01-07 21:04:48 -05:00
Augustin Cavalier
ac19c8509b freebsd_network: Fix redefinition warning. 2019-01-07 20:17:53 -05:00
Augustin Cavalier
86734cc40e idualwifi7260: Upgrade to FreeBSD 12.
Tested on a 7265D.
2019-01-07 20:17:53 -05:00
Augustin Cavalier
bf3654699e drivers/wlan: Merge the ratectl change commit from FreeBSD.
This is a relatively minor change that mostly just shuffles structs
around, so presumably it will not break any of these drivers.
2019-01-07 20:17:53 -05:00
Augustin Cavalier
6d0f2b487a freebsd_wlan: Update Haiku-specific code.
Now that we use SYSINIT for the "module" code instead of manually
maintaining lists, we have to make the static library slightly differently.
See inline comment.
2019-01-07 20:17:52 -05:00
Augustin Cavalier
8244a9baad freebsd_wlan: Merge the new net80211 code from FreeBSD 12.
Changes to the Haiku module will come in the next commit.
There are a few Haiku-specific changes in here; most notably some
hacks to prevent struct size changes from breaking wpa_supplicant,
and a removal of the full ieee80211_channel structure from some ioctls
where we previously returned it.
2019-01-07 20:17:52 -05:00
Augustin Cavalier
8e67fd0be0 freebsd_network: Unreserve the PCI device on error or driver removal. 2019-01-07 20:17:52 -05:00
Augustin Cavalier
f733714a6a freebsd_network: Changes for FreeBSD 12 net80211. 2019-01-07 20:17:52 -05:00
Augustin Cavalier
3d4f7f0f60 freebsd_network: Fix MTX_SYSINIT.
net80211 from FreeBSD 12 will use it.
2019-01-07 20:17:51 -05:00
Augustin Cavalier
1f7634a08c freebsd_network: Cleanup and some fixes to SYSINIT implementation.
Fixes a kernel panic on uninit_sysinit. Whoops.
2019-01-07 20:17:51 -05:00
Augustin Cavalier
67c3dfef8e freebsd_network: Fix license header in linker_set.h.
This file is a near-direct copy from FreeBSD; dunno how it wound up with
a Haiku license header.
2019-01-07 20:17:51 -05:00
Augustin Cavalier
753c7e0805 freebsd11_wlan -> freebsd_wlan.
FreeBSD 12's net80211 layer contains only 2 small KPI breaks from FreeBSD 11,
so we can upgrade it, apply those 2 changes to the drivers which are affected
(as the changes are in some lesser-used functions), and then upgrade all drivers
one at a time.
2019-01-07 20:17:51 -05:00
Murai Takashi
808cc3cd50 mail: Fix PVS 962
* Remove cast to void* in AddItem() at line 775, so that
avoid that the object which was created using 'new' operator
is immediately cast to another type.

Change-Id: I0722661611d0393896c1aac161a702a4c2f1d5d8
Reviewed-on: https://review.haiku-os.org/c/857
Reviewed-by: Barrett17 <b.vitruvio@gmail.com>
2019-01-07 12:24:24 +00:00
Murai Takashi
27a59a2fa4 cortex: Fix PVS 1206
* Remove cast to void* in AddItem() at line 363, so that
avoid that the object which was created using 'new' operator
is immediately cast to another type.
* Also remove other casts in AddItem().

Change-Id: Ia20ab39ef50dce12b9d06ca5b1736a8a8e3e9cdd
Reviewed-on: https://review.haiku-os.org/c/856
Reviewed-by: Barrett17 <b.vitruvio@gmail.com>
2019-01-07 12:23:48 +00:00
JackBurton79
ae09eb30c5 FlattenPictureTest: aestethic changes.
Add a header with the columns description. Style fixes

Change-Id: I14b66dd1c9cfff13ad8ba3ff1907dcb0696593f8
2019-01-06 22:26:04 +01:00
Stephan Aßmus
54333f5172 Don't do LCD subpixel filtering twice
The currently included version of libfreetype already has the LCD
subpixel filter turned on by default. With the switch from my
"averaging filter" back to Adrej Spielmann's filtering, there was now
another filtering being done on top of what Freetype already does.
There also seemed to be a problem with the left edge of cached
glyph bitmaps, which I didn't bother to look into. The visual result
of this change is that text looks much crisper, and the display
bugs at touching glyphs is gone.

On the other hand, LCD sub-pixel rendering is still turned on
globally, i.e. for all vector drawing, and for uncached rotated
text. The Freetype filtering is not applied there. This problem did
not exist in my "average filter", since it happened at the scanline
rendering level, not only for cached glyph bitmaps. It is however
not a regression introduced by this commit. It needs to be fixed
separately.

Change-Id: If93c2b85ed479670e6679227984fd8d9f77c11f6
Reviewed-on: https://review.haiku-os.org/c/855
Reviewed-by: Stefano Ceccherini <stefano.ceccherini@gmail.com>
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2019-01-06 18:43:49 +00:00
Stephan Aßmus
954a0a0c33 Fix some cases of updating draw state while recording a BPicture
* Also implemented recording DrawString(string, length,
   BPoint[] locations), which was previously not recorded at all.
 * Also implemented playing back recently added drawing commands
   in PicturePlayer.cpp. I don't quite understand what this is
   actually used for, but it seemed it was forgotten. I just followed
   the pattern already established in the code.
 * The other important bit in this change is to update the pen
   location when it is needed while recording a BPicture. Often
   the BView will use PenLocation() in order to transmit drawing
   commands to the app_server which use absolute coordinates only.
   This isn't actually so nice, since it means the client has to
   wait for the server to transmit the current pen location. If there
   were dedicated link-commands for pen-relative drawing commands,
   the client could just keep sending without waiting for the server.
   In any case, the app_server needs to update the pen location in
   the current DrawState and even the DrawingEngine even while
   recording a picture, because some next command may need up-2-date
   state information, such as the font state and the pen location.
 * I have not yet tried to find /all/ instances where the DrawState
   needs to be updated while recording. This change should repair
   /all/ font state changes, all versions of drawing a string, and
   all versions of StrokeLine().

Change-Id: Ia0f23e7b1cd058f70f76a5849acb2d02e0f0da09
Reviewed-on: https://review.haiku-os.org/c/817
Reviewed-by: Stephan Aßmus <superstippi@gmx.de>
2019-01-06 00:06:56 +00:00
François Revol
b98f12a601 freebsd_network: use proper BAR size in bus_alloc_mem_resource
This time we use the pci_info directly, it avoids a possible race with
PCI config regs, and we already have the value there anyway.

Signed-off-by: Augustin Cavalier <waddlesplash@gmail.com>
One crucial fix by me: check if size == 0. This avoids the deadlock
seen in #14795.
2019-01-05 14:45:54 -05:00
Augustin Cavalier
a29a8f98ed drivers/network: Mark all FreeBSD ethernet drivers as upgraded to 12. 2019-01-04 21:16:00 -05:00
Augustin Cavalier
eababbb4cf drivers/network: Upgrade sis900, syskonnect, via_rhine, vt612x to FreeBSD 12.
No real functional change.
2019-01-04 21:15:15 -05:00
Augustin Cavalier
6d2ae71f16 drivers/network: Upgrade rtl8139, rtl81xx to FreeBSD 12.
Includes some logic fixes to Haiku-specific code in the MII drivers,
and one new chipset supported by the rtl81xx MII driver. Otherwise,
no major functional change.
2019-01-04 21:13:33 -05:00
Augustin Cavalier
2b5a056e03 drivers/network: Upgrade jmicron2x0, marvell_yukon, nforce, pcnet, rdc to FreeBSD 12.
No real functional change in these.
2019-01-04 21:12:24 -05:00
Augustin Cavalier
2afe8644cf freebsd_network: Restore the hard-coded 128KB physical map size.
mmu_man changed this to be dynamically computed based on the BAR size.
It seems his computation was somehow incorrect, as it tries to allocate
a very large region here which deadlocks in the physical memory mapper.
Restoring this to 128KB un-breaks the new ipro1000 driver on more
recent hardware.

"Fixes" #14795.
2019-01-04 18:07:11 -05:00
Augustin Cavalier
a381a48f86 ipro1000: Always use DELAY() for microsecond pauses (on Haiku.)
pause() has granularity of "hz", which on FreeBSD and in our compat layer
is defined to be 1000 (so, 1ms.) As "safe_pause_us" is used copoiously
throughout startup code, this meant that (1) startup takes 100-1000x longer
than it needed to (this driver seems to most commonly delay for 10us),
and (2) this could in theory block the boot for multiple minutes if one
got particularly unlucky with the scheduler.

Probably helps with or even outright fixes #14795.
2019-01-04 17:06:22 -05:00
Augustin Cavalier
046ae71e48 EFI: Handle "Escape" scancode properly.
This should fix the Escape key being non-functional in the EFI loader
menus, which is pretty annoying when one is drilling through lots of
menus to blacklist files...
2019-01-04 16:52:42 -05:00
Rob Gill
6086986d30 kernel/x86: additional msr and cpuid items
Adds SSBD and L1TF related items

Change-Id: Iccea2bb9e057e0d011a18609212f175f9b5e678d
Reviewed-on: https://review.haiku-os.org/825
Reviewed-by: Adrien Destugues <pulkomandy@pulkomandy.tk>
2019-01-04 19:06:05 +00:00
Rob Gill
3987287dc6 bin/sysinfo: bugfix & update
Fixed bug where incorrect value of ECX passed when determining L2 cache

Updated cache/TLB identification
Updated CPU flags

Change-Id: I086f8bf7f86cba0d65e45450c74ec6e11e6bec2e
Reviewed-on: https://review.haiku-os.org/824
Reviewed-by: Adrien Destugues <pulkomandy@pulkomandy.tk>
2019-01-04 19:05:49 +00:00
Augustin Cavalier
189ed5d806 freebsd_iflib: Get the thread_id from the thread* indirectly.
This is needed on 64-bit.
2019-01-03 23:43:20 -05:00
Augustin Cavalier
3a031789fe freebsd_network: Add a missed method ID.
Some less-used drivers (e.g. marvell_yukon) need this.
2019-01-03 21:20:37 -05:00
Augustin Cavalier
8084e7c566 freebsd_network: Add cast so mbuf.h can be included as C++.
It is, as ieee80211_haiku is a C++ file.
2019-01-03 21:20:36 -05:00
Augustin Cavalier
67a0cb89e6 ipro1000: Upgrade to FreeBSD 12.
Thanks to AGMS for helping test on real hardware!
2019-01-03 21:20:36 -05:00
Augustin Cavalier
db4f8332f0 freebsd_network: Reinstate _fbsd_init_hardware and refactor probing.
Previously we just probed and then immediately attached if any devices
were found, after all initialization was done. Now we cannot do that,
as after calling SYSINIT() on certain drivers (e.g. the new ipro1000
driver), certain threads will be created that there is no good way
of tearing down.

Fortunately, it is valid to call probe() on a device before SYSINIT()
(and most other things) have been initialized, and so now we do that
in init_hardware, and then init_driver is called only if we've found
devices we support.

While we're at it, also call pci->reserve_device, which will mark us as
the driver handling said device and prevent other drivers from
using it.
2019-01-03 21:20:36 -05:00
Augustin Cavalier
83c8026372 freebsd_iflib: Import.
This is the iflib from FreeBSD 12.0 with a few select patches from
FreeBSD trunk applied (and a lot of #ifdef __HAIKU__s, as you can see.)

There are certain things it adds to SYSINIT that can't be un-initialized
(like the grouptaskqueues), and so rather than adding this to every
driver unnecessarily, a separate .a for it makes the most sense.
2019-01-03 21:20:36 -05:00
Augustin Cavalier
fd41233b07 freebsd_iflib: Import compatibility files.
These are the portions of "freebsd_iflib.a" that I've written and
do not come from FreeBSD. As the import of iflib itself will be
quite large, having a separate commit for these made sense.
2019-01-03 21:20:35 -05:00
Augustin Cavalier
81acff62c6 freebsd_network: Handle published conditions with timeout 0.
Previously, since we passed B_RELATIVE_TIMEOUT unconditionally,
a timeout of 0 would mean that it would return as soon as there was
CPU time available (so, usually, instantly.) This usually was not
a "problem" in that it caused broken behavior, but it would result
in exceptionally high CPU usage.

At first I implemented this correctly (i.e. a timeout of 0 will block
until explicitly woken up) but then discovered that our implementation
of these functions creates subtle race conditions compared to their
FreeBSD counterparts, and so to avoid deadlocks, a timeout of 1 second
is imposed. For situations where there are deadlocks due to race
conditions, this will make them painfully obvious (e.g. all network
transfers stalling for a second every 2-3 seconds or so.)
2019-01-03 21:20:35 -05:00
Augustin Cavalier
a029a69c55 freebsd_network: Properly align mbuf members. 2019-01-03 21:20:35 -05:00
Augustin Cavalier
6ef670c379 freebsd_network: Consolidate and unify SMP-related definitions.
Previously I implemented "curcpu" as ipro1000 used it, independent
of all the other SMP functions, as an optimization. Now, iflib
wants to use these functions all together, so they have to produce
consistent results.
2019-01-03 21:20:35 -05:00
Augustin Cavalier
8582775421 freebsd_network: Implement m_cljget without mbuf.
This returns an ext_buf that can be attached to an mbuf later,
which is something iflib does.
2019-01-03 21:20:34 -05:00
Augustin Cavalier
a9116ea8db freebsd_network: Add an "id" field to struct device_method.
"const char* name" is alright for the compat layer's needs to
identify functions, as we only scan the method table once and
copy the function pointers to a struct of function pointers.

iflib doesn't use a function pointer struct, though, and expects
to have the KOBJ system for function lookups, and that depends
on integer-based method IDs for fast lookups. So now every
method gets an integer ID as well as a name (and iflib's method
IDs are in the list of method IDs already.)
2019-01-03 21:20:34 -05:00
Augustin Cavalier
c25e20c5f9 freebsd_network: Add device_register hook as a recognized hook.
iflib-based drivers use it.
2019-01-03 21:20:34 -05:00
Augustin Cavalier
da60a673b6 freebsd_network: Implement SYSINIT.
Based on the already-existing linkersets framework, which seems to
work pretty well for the atheroswifi driver, so it should work for
this case also.
2019-01-03 21:20:34 -05:00
Augustin Cavalier
8267c19341 freebsd_network: Lots of additions and modifications for iflib. 2019-01-03 21:20:34 -05:00