Commit Graph

49211 Commits

Author SHA1 Message Date
Jérôme Duval
70422d06a9 ipv6: avoid unbounded stack usage in send_fragments(). 2018-04-11 23:43:47 +00:00
Jérôme Duval
df4bea7d7c usb_hid: add a list blacklisted devices 2018-04-09 22:06:55 +02:00
Alexander Coers
272475393c Changed PNG translator config view
Removed workaround for already fixed bug 4217 and removed the call
to SetExplicitPreferredSize(), since the layout system was always able 
to calculate good values for PreferredSize.
So for me the call seems to be superfluous.

Fixes #13353
2018-04-09 13:01:26 +00:00
krish_iyer
f960e7e9a2 Support kit: Fixed issues in BString unit tests
1: Changed CPPUNIT_ASSERT -> CPPUNIT_ASSERT_EQUAL
2: Fixed coding style: Added two lines after including libraries, maintained 80 characters(MAX) in each line and space at comment start
3: Fixed the failure for "BString::Search" test "i != 0 by chaning the testing method(StartsWith->IStartsWith) and changed the string to be searched(sT->st)

Change-Id: I1237d1f2d0e3af7757963cc940bae929f487f088
2018-04-07 16:52:44 +00:00
Jérôme Duval
509c7718dd fat: dosfs_read_attr used the user buffer directly
It now uses user_strlcpy().
2018-04-07 17:53:47 +02:00
Michael Lotz
a113ad395f Cleanup: Remove debug leftover introduced in hrev51871. 2018-04-06 21:28:33 +02:00
Michael Lotz
9c4845e767 kernel: Implement wait info count limit in wait_for_objects.
Since wait_for_objects can wait on sems, threads and ports in addition
to FDs, limiting to RLIMIT_NOFILES as in the select/poll case does not
work. Since space is allocated for the wait objects in kernel memory,
limiting their number to a valid range is still desireable.

The limit is now placed at the sum of max sem, thread and port count
plus RLIMIT_NOFILES.

This also fixes a signed vs. unsigned comparison warning in
check_max_fds introduced in hrev51866.
2018-04-06 21:20:11 +02:00
Barrett17
80e9e5f3e7 Add new tests to MediaTest 2018-04-06 02:33:26 +02:00
Barrett17
5ba361f8bf ffmpeg: Fix warning about setting stream timebase
Spotted by jackburton, doesn't fix #13407.
2018-04-06 02:33:26 +02:00
Jérôme Duval
b1f1332ebb PackageKit: use the correct kernel headers.
The debug build of the packagefs kernel addon failed because user_memcpy had no type.
Using the correct headers for user_memcpy and IS_USER_ADDRESS fixed the issue.
2018-04-05 17:51:13 +02:00
hyche
0a4cbf0d1e btrfs: Fix stack corruption on MakeReference()...
because it needs extra space for storing data, and flexible array member o
doesn't do this.
I thought it was...

Change-Id: If64c06827809a4e021581c6adf8e0f198cf47450
2018-04-04 06:19:55 +00:00
Michael Lotz
c101b57682 kernel: Implement FD limit check for select/poll.
The amount of FDs that can be selected/polled needs to be limited by
the RLIMIT_NOFILES.
2018-04-04 00:09:23 +02:00
Michael Lotz
321372e3ef kernel: Make size argument to create_area_etc() size_t.
It was limited to a uint32 and could for example be overflown by the
slab MemoryManager that uses size_t on a 64 bit system.

This aligns the signature with create_area() that already uses size_t
for the size argument.

Note that the function is currently private, so the impact should be
limited.
2018-04-04 00:07:59 +02:00
Jérôme Duval
e1ceb339a0 kernel: override access control in user_[un]block_thread()...
when reading/writing the wait_status in userland. fixes #14067.
2018-04-03 22:42:14 +02:00
Jérôme Duval
048796e140 hda: sync snoop quirk pci ids list based on alsa. 2018-04-03 16:49:11 +02:00
Kim Brown
cb3445aa2a Installer: WorkerThread: Add syslog to ignored paths
A new install should start with an empty syslog. Adding
the syslog path to the set of ignored paths will prevent
an existing syslog file from being copied into the new
install.

Fixes #8373
Change-Id: I79ecf95773a34360185d38ee4ef0c8337b062e7a
2018-04-02 21:05:47 +00:00
François Revol
4498948fcf recover: Work around use-after-free
Inode::_FindPath() always deletes the inode it uses regardless
the source, including when it's from the HashtableInodeSource.

But the later returned the inode object directly from the hashtable
when it's inside, so it gets deleted bu _FindPath… then reused later on
when searching the hashtable again.

I'm not sure it's the correct solution but at least malloc_debug doesn't
complain anymore.
2018-03-27 23:14:32 +02:00
Andrew Lindesay
b45e8b1ef9 HaikuDepot : additional debugging for json-rpc invocations 2018-03-25 05:44:19 +00:00
Jérôme Duval
823466613f usb_raw: the command struct wasn't copied back in some cases.
hopefully fixes #14050 after e2e571c035.
2018-03-24 20:03:47 +01:00
Jérôme Duval
a25f7264b6 BString: fix Split() for multiple characters separators...
as suggested by Janus in #14045. Thanks!
* add a unit test for BString::Split().
2018-03-22 21:29:43 +01:00
hy che
7cf48d4e51 TextView: Remove redundant check in ScrollToOffset as PointAt() already does the check.
Change-Id: I2bf541fca84ef27749484ee1be05fb9debac32e2
2018-03-22 10:28:44 +00:00
Andrew Lindesay
d13c3d8967 HaikuDepot : Handling for Depot Name Anomalies
There is a problem primarily manifesting itself in
the x86_64 build where the packages' names from the
solver are not correlating with the names of the
as-configured depots.  There was also a problem
with a local variable being the same name as a function
parameter.  This does not fix the underlying problem,
but avoids further anomalies in the HaikuDepot UI.

Possibly related trac #11317, #11674, #13940.
Change-Id: Ic140f114bbe38e59c78760213843bf492ff7a270
2018-03-22 10:14:34 +00:00
Rene Gollent
364cbeb2e3 Debugger: Adjust type handling with namespaces.
DwarfImageDebugInfo:
- In some, but not all cases, gcc5 generates type information where the DIEType
  is a child of a namespace rather than of its containing compilation unit.
  This needs to be taken into account when building our name lookup table, as
  we'll otherwise not find the full definition of such types when attempting to
  locate them for corresponding variables. Fixes an issue reported by Axel.
2018-03-17 17:00:50 -04:00
Alexander von Gluck IV
3b60bc6b9b openfirmware/ppc: A few minor fixes and extra debugging
* Show old page table location and provide more feedback
* 16 int32 * 0x10000000 > sizeof(int32), fix to uint32

Change-Id: Ib68c34f5d3c6bfa1da53241e6586c07e4e494750
2018-03-13 21:35:22 -05:00
Jérôme Duval
1ce4890bd6 ata: DMA requires a SG list
READCD can actually be requested so that no SG list is prepared.
Should help with #13775
2018-03-13 19:50:57 +01:00
hyche
690d16c628 btrfs: Add error log for _Find() 2018-03-13 08:46:53 +00:00
Jérôme Duval
c91002a1db Revert "EHCI USB: process the extended capabilities chain"
This reverts commit 137135a10d.

Change-Id: I6e6ef1933b3b3f5eda7278d37b673eefe2867c2a
2018-03-12 17:01:25 +00:00
Jérôme Duval
137135a10d EHCI USB: process the extended capabilities chain
...instead of the first one only.
2018-03-12 12:25:34 +00:00
Jérôme Duval
8bcb93452a ntfs: don't change permissions when the volume is read-only.
* check that the volume isn't read-only on write_stat.
* should help with #14029.
2018-03-10 19:11:03 +01:00
Jérôme Duval
d885e1b33d fat: don't change permissions when the volume is read-only.
* check that the volume isn't read-only on write/write_pages.
* should help with #14029.
2018-03-10 18:25:09 +01:00
Jérôme Duval
09320f38d7 Roster: fix debug build on x86_64. 2018-03-10 16:03:13 +01:00
Jérôme Duval
6899a856fe Shutdown: follow up on ff6135f474
* calling TRoster::GetShutdownApps() multiple times with the same lists
leads to problems because the lists aren't emptied first.
* instead we watch the user app launches, add them in the fUserApps list,
and let _QuitApps() iterates through the fUserApps list until it is empty.
2018-03-10 16:02:50 +01:00
Jérôme Duval
fc2aef743a x86,x86_64: remove dependency on libavdevice. 2018-03-09 18:47:28 +01:00
Alexander von Gluck IV
2214edcbc9 ppc,arm: Inline with hrev51157, validate fontconfig feature
Change-Id: I15b33fb40c019e659aef03e561c6bdb40288f91a
2018-03-08 14:58:05 -06:00
Augustin Cavalier
61206a24c9 build: Cleanup of libgnuregex usage.
John's revert of my removal commit dragged back a bunch of cygwin/sunos
cruft, as well as re-adding RegExp.cpp to the host libshared, that we don't
need.

Instead, remove this and add libgnuregex_build to just the tools/keymap
link alongside the FreeBSD gnuregex case.
2018-03-07 18:04:31 -05:00
Jérôme Duval
df3ac004ba gensyscalls: locate objects in an arch-specific subdir.
Change-Id: I5f5be0110596296de7c380b128d7a39f91e1ec66
2018-03-07 20:20:03 +00:00
Humdinger
d87eeceea5 Layout changes to AboutWindow
Most icons don't look that nice when blown up to 128px:

Before: https://lut.im/KNZw0f8j5r/3lnnRzzFXJSewq9Y.png
With this change: https://lut.im/3XcXJZv6ad/LsYKadFOiIJo1Kbz.png

* Use a 64px icon
* Make the window resizable
* Make the window a bit wider

Thanks Janus for hints where to insert SetExplicitMaxSize()...
2018-03-05 17:40:53 +01:00
Hrishi Hiraskar
ff6135f474 Shutdown: Apps can be launched in USER_APP_TERMINATION_PHASE
User can now launch applications in USER_APP_TERMINATION_PHASE
(like when there is a dialog to save an open document). Fixes
Change-Id: I3126e6ab8d2fd76016becb6ce0f726f82ecb7f3b
2018-03-04 15:20:46 +00:00
Andrew Lindesay
d5b1013185 HaikuDepot : Coalesce Loading Change Notifications
When the application is starting, it will load in bulk data.  As it
does so, it may issue some change notifications to listeners.  For
each small change in packages' data, there is a notification.  The
system was built to accommodate coalesced changes.  This commit will
coalesce those changes during the bulk load for cases where there
are listeners present.

Change-Id: I1cc6668f61917c0068d5559b2bf338ea75d453da
2018-03-03 20:01:16 +00:00
Barrett17
2cb3cabcb0 MediaClient: Revert debugging edits
* The -a argument ended up in my git commit inadvently,
sorry about that.
2018-03-03 16:20:34 +01:00
Barrett17
6072c6f1cb MediaConnection: Cleanup after disconnect 2018-03-03 16:15:24 +01:00
Barrett17
65a94fbbaf MediaConnection: Fix Disconnect bug 2018-03-02 04:02:16 +01:00
Barrett17
852b62956b MediaClient: Rename IsRunning to IsStarted 2018-03-02 03:58:54 +01:00
Barrett17
a6ac14c71c MediaClient: Add ClientRegistered callback 2018-03-02 03:34:25 +01:00
Barrett17
1c15261f5a MediaConnection: Add connection name handling 2018-03-02 03:18:26 +01:00
Barrett17
83bcc405f3 MediaClientDefs: Cleanup unneded methods 2018-03-02 00:52:33 +01:00
Barrett17
d717df83d3 MediaClientNode::GetLatency use base version 2018-03-01 22:56:04 +01:00
Barrett17
9391114b8e MediaClientNode: Remove unuseful Disconnect calls
* While those calls were unharmful, better to remove them.
2018-03-01 22:55:03 +01:00
Barrett17
f015d06b84 MediaClient: Remove Preroll and SyncTo 2018-03-01 17:09:24 +01:00
Barrett17
6dc7d85423 MediaConnection: Review format negotiation mechanism 2018-03-01 17:09:24 +01:00
Barrett17
182ec76b44 MediaConnection: Remove format change protocol 2018-03-01 17:09:24 +01:00
Humdinger
f9492b5f11 Add Theo Knez
for his translations to Swedish. Thanks, Theo!
2018-03-01 08:55:51 +01:00
Humdinger
b965ce7025 Changes to HaikuDepot GUI
As discussed at #13860.

* Moved "Show only featured packages" from the "Show" menu to a
  checkbox in the filter view.
* Moved "Repositories" popup menu into the menu bar.
* Removed the "Featured packages" title.
* Entering a search term doesn't override the "Only featured"
  filter anymore (used to disable the "Only featured" filter).
2018-02-28 19:17:57 +00:00
Jérôme Duval
959fdbd314 acpi_battery: use user_strlcpy in acpi_battery_read().
* also check for user addresses in acpi_battery_control().
2018-02-28 20:10:34 +01:00
Jérôme Duval
6470e36518 acpi_button: use user_memcpy to write the user buffer.
* fix warning on x86_64.
2018-02-28 18:37:46 +01:00
Kacper Kasper
821f3e571b ProcessController: fix replicant for up to 12 CPUs. 2018-02-28 16:44:25 +01:00
Kacper Kasper
57313774b9 AboutSystem: don't add licenses twice. 2018-02-28 16:02:12 +01:00
Barrett17
444d8ec0e2 MediaConnection: Hide connection callbacks
* At this point we want to avoid the user calling the callbacks
in the form of BMediaConnection. Instead we force to use the
BMediaInput and BMediaOutput versions.
2018-02-27 02:43:38 +01:00
Barrett17
ff56eda570 MediaConnection: Move buffer management on producer side 2018-02-27 01:50:09 +01:00
Andrew Lindesay
54312619ab HaikuDepot : 'Old Client' Handling
The server side has the ability to reject client
requests where the client is no longer supported
because it is presumably too old.  This change
will inform the user when this happens and will
prevent the client from attempting further server
communications within this execution of the
application.
2018-02-26 21:51:45 +00:00
Alexander von Gluck IV
3a747315b2 stdlib: Add common bsd mkstemps function
Change-Id: I8c54f4b42e8b41f9a769b8b53f074a307b1a054c
2018-02-26 21:46:25 +00:00
Hrishi Hiraskar
6dc1f7eb1e [pkgman] pkgman informs if package is already installed.
While installing packages through pkgman, it will inform if specific
package is already installed. Fixes #12447 : [pkgman] inform if a
package is already installed.
Change-Id: I194bc849c42ba52a696a6cb52d87aebaff530f35
2018-02-26 18:33:58 +00:00
Jérôme Duval
0bb9fd3868 write_overlay: Read()/Write() with user_memcpy(). 2018-02-26 18:59:01 +01:00
Xiang Fan
fb6387f2b4 kernel: add /dev/null polling test
Bug: 13965
2018-02-26 10:44:22 +00:00
Xiang Fan
a9388f6d39 kernel: vfs: don't notify output-only select events by default
Output-only events (B_EVENT_ERROR, B_EVENT_DISCONNECTED and
B_EVENT_INVALID, with B_EVENT_INVALID masked out before passing down
events) are used to indicate error, so they should not be notified if
the vnode does not have select().

Bug: 13965
2018-02-26 10:44:22 +00:00
Xiang Fan
f3b05a74bb kernel: devfs: don't notify output-only select events by default
Output-only events (B_EVENT_ERROR, B_EVENT_DISCONNECTED and
B_EVENT_INVALID, with B_EVENT_INVALID masked out before passing down
events) are used to indicate error, so they should not be notified if
the device does not have Select().

Bug: 13965
2018-02-26 10:44:22 +00:00
Xiang Fan
8a38c1fdc2 kernel: fd: don't notify output-only select events by default
Output-only events (B_EVENT_ERROR, B_EVENT_DISCONNECTED and
B_EVENT_INVALID, with B_EVENT_INVALID masked out before passing down
events) are used to indicate error, so they should not be notified if
the filesystem does not explicitly provide an fd_select() override.

Bug: 13965
2018-02-26 10:44:22 +00:00
Barrett17
9cf18a39cd MediaConnection: BufferSize should be inherited
* While it's trivial for audio to calculate the buffer size,
it isn't the same for video.
2018-02-25 23:44:33 +01:00
Jérôme Duval
4bd0c1066b runtime_loader: add hybrid support. 2018-02-25 08:29:51 +01:00
Barrett17
befa252fbf MediaConnection: Non simple connections should be inherited
* BSimpleMediaConnections are provided for that.
* Make SetOutputEnabled private.
2018-02-24 16:13:34 +01:00
Barrett17
c61ffa962e MediaConnection: Remove latency range interface
* In preparation for the introduction of BMediaGraph.
2018-02-24 15:42:16 +01:00
Janus
be5456794b Haikudepot: Draw BarberPole border only when displayed 2018-02-24 13:29:07 +01:00
Jérôme Duval
b5ace95f87 scsi_periph: use user_memcpy for user buffers.
ioctls in this module can actually be called from the kernel (file systems or
ddm).
2018-02-24 10:08:46 +01:00
Barrett17
72958d8ba8 MediaClient: Remove SetRunMode 2018-02-24 02:30:40 +01:00
Jérôme Duval
3da236362c usb_hid: also use user_memcpy() in TabletProtocolHandler. 2018-02-23 23:27:51 +01:00
Kacper Kasper
e0c304f798 efi: fix 64-bit build. 2018-02-23 22:23:51 +01:00
Jérôme Duval
ee1521b957 pci: map msix maps for the kernel only. 2018-02-22 22:44:56 +01:00
John Scipione
940a3a2322 Revert "build/libgnuregex: Remove."
This reverts commit ca087b0532.

Mac OS X requires libgnuregex for Keymap
2018-02-16 16:45:11 -08:00
Jérôme Duval
bec80c1ced white space cleanup 2018-02-10 19:34:43 +01:00
Jérôme Duval
718d7149b1 white space cleanup 2018-02-10 16:15:37 +01:00
Jérôme Duval
e2e571c035 usb_raw: use user_memcpy to read/write the user buffers.
also check buffer addresses passed through structures. For transfers, first compute
the direction of the transfer, to copy before or after the actual transfer.
2018-02-08 13:54:06 +01:00
Jérôme Duval
f1549b1611 usb_hid: use user_memcpy to read/write the user buffers.
also check buffer addresses.
2018-02-08 13:31:15 +01:00
Rene Gollent
770075026c Debugger: Rework type handlers to allow for custom selection.
TypeHandler:
- Add name field for presentation purposes. Adapt subclasses accordingly.

TypeHandlerRoster:
- Add methods to count and retrieve all type handlers for a given type,
  and adjust CreateValueNode to allow for passing in an explicit handler.
  Adjust callers accordingly.

VariablesViewState:
- Add helpers to store an explicitly chosen type handler for a node.

TypeHandlerMenuItem:
- ActionMenuItem subclass that takes care of reference management
  for its contained type handler.

VariablesView:
- Add context menu for choosing type handlers if applicable. Implement
  support for invoking said type handlers in a similar manner to explicit
  typecasts.
- Adjust saving/restoring the view state so that hidden nodes are taken
  into account as well. This is necessary since it may be the case that
  the handler had to be applied to the hidden child rather than the visible
  node (i.e. the BMessage handler when applied to a pointer to a BMessage).

All together, these changes allow choosing to switch between views of a type
when the Debugger has multiple handlers for it. For example, for BMessages
this allows switching between displaying the raw underlying structure vs
the decoded message content.
2018-02-04 14:13:01 -05:00
Jérôme Duval
401fb209ea kernel: use x2apic on hypervisor, or if already enabled.
* this can be disabled per safe mode setting.
2018-02-04 19:08:53 +01:00
Jérôme Duval
ac690cf148 glue: correctly support different architectures.
* use MergeObject even if we don't need the merged object: the rule does what
is needed and is standardly used for instance in libroot.so.
* add a grist to source files for the bootstrap glue.
2018-01-31 22:57:56 +01:00
Andreas Faerber
b71f9969c9 Fix OpenPIC 2018-01-31 20:27:34 +00:00
Andreas Faerber
0ae2a0c4d7 Fix device type check
B_DEVICE_TYPE is a 16-bit numeric ID.
2018-01-31 20:26:11 +00:00
Filip Maryjanski
51290f11aa ScreenSaver: add live update of screensavers list.
Fixes #13956

Change-Id: Icfc26c1617541f030ece31d36f1e3bb0c2ec96b0
2018-01-31 03:16:41 +00:00
Jérôme Duval
9dd4d2dd05 kernel: support for Intel SMAP and SMEP on x86_64.
SMAP will generated page faults when the kernel tries to access user pages unless overriden.
If SMAP is enabled, the override instructions are written where needed in memory with
binary "altcodepatches".
Support is enabled by default, might be disabled per safemode setting.

Change-Id: Ife26cd765056aeaf65b2ffa3cadd0dcf4e273a96
2018-01-30 20:05:39 +00:00
Jérôme Duval
43e75989a6 libnetwork: link against the arch specific libbsd and libutil. 2018-01-30 19:19:18 +01:00
Jérôme Duval
1a77020df1 libutil: add hybrid support. 2018-01-30 19:19:18 +01:00
Axel Dörfler
08a4536b1f BMessage: Added missing [Get|Set]Pointer()
* SetPointer() was declared, but not defined.
2018-01-29 21:43:21 +01:00
Jérôme Duval
857d600ae1 Add missing libroot stub on x86 (different from x86_64). 2018-01-29 17:47:41 +01:00
Jérôme Duval
c676a5c19e Make the Haiku package not depends on noto_sans_cjk_jp ...
except for regular builds.
2018-01-29 15:59:00 +01:00
Andrew Lindesay
80a272eed8 HaikuDepot : Changelog, Remove old API and Version Bump
This change re-instates the change-log function (TRAC#13827) that was
dropped in earlier changes.  Also now-disused API handling logic is
removed.  A small code-style fix is made and the version of the
application has been incremented so that this version's logic can later
be detected by the HDS application server.
2018-01-28 12:43:26 +01:00
Jérôme Duval
1603eec4a4 kernel: vm: allow mmapping of the last page of the userspace. 2018-01-27 17:15:52 +01:00
Jérôme Duval
3bcf027203 auich: use user_memcpy to read/write the user buffers.
* also check buffer addresses passed through structures.
* map registers kernel only.
* alloc dma descriptors kernel only.
2018-01-25 20:35:39 +01:00
Jérôme Duval
13daa9299e Fix initial stack alignment on 64-bit systems.
gcc does re-align the stack in the main() function prologue, however,
we still need to set the right alignment for other cases: thread entry,
.init and .fini code that is executed before main() is called or after
it has returned, and signal handlers which may use a separate stack.

Part of #10509
2018-01-24 07:59:55 +00:00
Jérôme Duval
34cdda1dd5 kernel: x86: enable writes before patching.
Follow up for commit a2021292d4.
Binary patching would otherwise fail after the kernel text area
becomes read-only.
2018-01-23 17:59:41 +01:00
Jérôme Duval
c8fcb2a04e udis86: Add clac/stac instructions for SMAP.
still in a PR:
e9dfa2d79a
2018-01-22 20:06:55 +01:00
Fredrik Holmqvist
ff2e2f8198 Upgrade to ACPICA 20180105
Tested on x86_64 and x86_gcc2, works on my machine and most likely fixes
that was most likely due to missing lock sync in previous ACPI upgrade.

 * Redid some of kallisti5's work as it was easier to start from earlier
   version.

 * Evaluating 64 bit physical addressing on 32 bit Haiku again as this
   was likely the cause of pagefaults (#12377):
"Implemented internal support for full 64-bit addresses that appear in all
Generic Address Structure (GAS) structures. Previously, only the lower 32
bits were used. Affects the use of GAS structures in the FADT and other
tables, as well as the GAS structures passed to the AcpiRead and
AcpiWrite public external interfaces that are used by drivers. Lv Zheng."

 * Mostly bugfixes in ACPICA
2018-01-21 20:09:45 +01:00
Fredrik Holmqvist
3f04c8352e Revert "acpica: Upgrade to 20170303"
This reverts commit 0bc647d605.
2018-01-21 20:09:45 +01:00
Ho Tuan Kiet
9c1f9724c2 Fix various unsafe usages of strcat/strcpy
Coverity ID: 608930, 743872, 743873, 743874, 608932, 608933, 1424961, 609034
Change-Id: I2702dfb402df7eee500617cb9b8d6f567296fc13
2018-01-19 06:32:43 +00:00
Jérôme Duval
4f2fac067d hda: use user_memcpy to read/write the user buffers.
also check buffer addresses passed through structures.

Sponsored-by:	https://liberapay.com/korli
2018-01-18 21:19:03 +01:00
Jérôme Duval
755bade8ba Factorize multi audio drivers control function.
With user buffer checks and copies about the same for every driver, it seems logical
to avoid duplicate this code.

Sponsored-by:	https://liberapay.com/korli
2018-01-18 21:19:03 +01:00
Leorize
1a59e1d91c gnu: introduce memmem(3)
Implementation imported from OpenBSD

Change-Id: If2620dc7ed373650bb3dabb0f22c2cd84b9e0ef9
2018-01-17 19:39:18 +00:00
Jérôme Duval
8d794763d5 dprintf: remove redondant user address check.
check user_memcpy success.
2018-01-17 19:19:36 +01:00
hyche
3f43dd8710 btrfs: Fix btrfs_dir_entry doesn't read data from disk correctly. 2018-01-16 16:21:46 +00:00
Jérôme Duval
483c45843d kernel: x86: add some more cpuid flags. 2018-01-15 20:18:43 +01:00
Jérôme Duval
05a859ebd7 usb: map registers or allocate area for the kernel only. 2018-01-15 19:52:13 +01:00
hyche
ce029df2d8 btrfs: Fix wrong function name in log error 2018-01-14 15:02:20 +00:00
hyche
5686d4e190 btrfs: Init status, prevent from unitialized check 2018-01-14 15:02:20 +00:00
hyche
b568492fbd btrfs: Make SearchSlot() look cleaner 2018-01-14 15:02:20 +00:00
Jérôme Duval
a2021292d4 kernel: Binary code patches on x86.
This will be used to support SMAP.

Sponsored-by:	https://liberapay.com/korli
2018-01-14 13:20:38 +01:00
Rene Gollent
7082366900 Debugger: Fix crash in teams window.
- Some of the recent changes for memory management exposed a race
  condition, where the teams window would potentially try to access
  already freed objects on quit. Ensure we acquire references to the target
  host so this doesn't happen.
2018-01-13 15:36:22 -05:00
Jérôme Duval
813b6c656f disasm: add to the image on x86_64. 2018-01-13 15:54:21 +01:00
Jérôme Duval
0291f00909 udis86: update to current version. 2018-01-13 15:54:21 +01:00
Jérôme Duval
9409021432 kernel: x86: add cpuid feature 7 flags. 2018-01-13 09:33:47 +01:00
Rene Gollent
ac9e464b78 Debugger: Fix various issues in the DWARF subsystem.
AttributeClasses:
- Fix typo in get_attribute_name_classes which resulted in us not
  handling DW_AT_linkage_name properly.
- Fix incorrect class specification for DW_AT_default_value due
  to inconsistencies in the DWARF documentation (the table of attribute
  classes indicates it is only a reference, but the detailed description
  indicates it also being possible to be a flag or constant, both of
  which gcc outputs).

DebugInfoEntries:
- Add accessor for DIEClassBaseType's inner types.

DwarfImageDebugInfo:
- When looking up types, create a basic target interface to pass on
  to the type context. Otherwise, type lookups that required DWARF
  expression evaluation would crash.
- When building the type name table, we now recursively walk a class's
  inner types, and add them to the list as well. This omission would
  cause the debugger to lack the type description for such classes,
  and consequently be unable to display their details in the variables
  view.
2018-01-12 22:23:57 -05:00
Andrew Aldridge
f6d25a3a81 strtod: Do not consume "x" in incomplete hex input
Adapted from upstream glibc commits:
* 405698e946dbed472491f85867eb511eb080e05a
* 43b9d657408fbf47a47934f9e7c84ed87f7f5a18

Fixes #13949
2018-01-12 16:45:14 +00:00
Jérôme Duval
a820f1f01d WebPositive: disable debug code.
should fix the debug build for WebPositive.
2018-01-12 16:46:08 +01:00
Rene Gollent
c0936b5a03 Debugger: Another set of #13800 fixes.
AbstractTable/Table/TreeTable:
- Let BColumnListView take care of deleting columns. The previous
  approach was resulting in the columns being leaked.

Debugger:
- Don't detach the UI reference, as TeamDebugger will acquire its own.

GraphicalUserInterface:
- Cleanup of file panel handler.

SourceView:
- Clean up marker manager.

*Roster:
- Clean up registered objects in destructors.

GlobalTypeLookup:
- Clean up hash tables.

NetworkTargetHostInterfaceInfo:
- Fix reference handling for settings.
2018-01-11 22:39:55 -05:00
Rene Gollent
ffe684b96c Debugger: Fix type issue in BList handler.
BListValueNode:
- BList's item count member is an int32. However, when the handler was reading
  said variable, it was mistakenly reading the number of bytes corresponding to
  to the address size of the architecture instead.This would cause the read to
  fail, and consequently BList and/or BObjectList variables to not display
  their contents properly on x86-64.
2018-01-11 22:39:55 -05:00
Jérôme Duval
bbb5a50f9b kernel: debug: map the frame_buffer for the kernel only. 2018-01-11 19:59:10 +01:00
Rene Gollent
3995592cdf Debugger: Fix #13939, more work on #13800.
- Fix various cases where OpenHashTables weren't being cleared properly.
- Fix various reference counting errors.
- Simplify FileManager reference handling.
- Fix bug in LocatableDirectory where the directory named '/' would have its
  name returned as empty. This would lead to failed lookups for entries already
  in the table, and ultimately corrupted the hash table when deleting unused
  entries, leading to #13939. This was previously never noticed due to the
  entries not being freed properly.
- AbbreviationTable wasn't clearing its entries.
2018-01-10 19:29:36 -05:00
Jérôme Duval
144f03cda1 random: use user_memcpy/user_strlcpy to read/write the user buffer.
* also check the user buffer address.
2018-01-10 20:57:59 +01:00
Jérôme Duval
d9e4ef3f76 dprintf: use user_memcpy/user_strlcpy to read the user buffer.
* also check the user buffer address.
2018-01-10 19:08:30 +00:00
Augustin Cavalier
a31e05bb68 MediaPlayer: Compare return value of FindMatch against B_ERROR.
Thanks Rene for the review!
2018-01-10 13:49:32 -05:00
Jérôme Duval
79707fefe0 bfs: INode::ReadAttribute() and WriteAttribute() used the user buffer directly
They now use user_memcpy(). Also copy the user buffer used to update the index.
2018-01-10 18:28:14 +00:00
Jérôme Duval
149553d727 packagefs: ReadAttribute with user_memcpy(). 2018-01-10 18:26:24 +00:00
Owen
6ba5b421a3 Add PlaylistTrackCount and PlaylistTrackTitle to scripting
PlaylistTrackCount returns the number of tracks in Playlist,
and PlaylistTrackTitle the title of a numbered track.

Also, remove B_TRANSLATE macros in scripting properties
2018-01-10 18:20:58 +00:00
Jérôme Duval
8c44fc0f65 PackageKit: tweak classes used by packagefs to write to user buffers.
when compiled in kernel mode, BMemoryIO::WriteAt() and BBufferDataReader::ReadData()
now check the buffer to write to, and eventually call user_memcpy() instead of memcpy().
2018-01-09 20:40:12 +01:00
Jérôme Duval
51051c56d3 kernel: wait_for_objects: read the user sigmask with user_memcpy() 2018-01-08 22:19:07 +01:00
Jérôme Duval
9fbffea6f4 kernel: vfs: don't use the attribute name user buffer directly.
instead copy the name on the stack.
2018-01-07 23:33:04 +01:00
Jérôme Duval
ff678dd91b kernel: image: _get_next_image_info shouldn't use a user buffer directly
_user_get_next_image_info() now copies the cookie on the stack, calls
_get_next_image_info() and copy back the cookie to the user buffer.
2018-01-07 22:57:41 +01:00
Jérôme Duval
6e28d80927 kernel: port: check USE_USER_COPY flag before masking it.
writev_port_etc() used memcpy() instead of user_memcpy() for user buffers.
The branch was even left out silently as an optimization on gcc5.
2018-01-07 22:41:39 +01:00
Jérôme Duval
da8f9c86bd kernel: disk_device_manager: no return in method returning void 2018-01-06 21:38:16 +01:00
Jérôme Duval
4644c7cc92 kernel: disk_device_manager: clean user interface
* avoid assignment in if statements
* use boolean conditions
* use copy_from_user_value/copy_to_user_value instead of user_memcpy
* no functional changes except user buffer addresses check in:
_user_get_next_disk_device_id(), _user_get_disk_system_info(),
_user_get_next_disk_system_info(), _user_find_disk_system()
* remove TODO "Add user address checks and check return values of user_memcpy()!".
2018-01-06 21:38:16 +01:00
Jérôme Duval
74fed5b52c kernel: net_notifications: check user buffer address ...
in control syscall
2018-01-06 21:38:09 +01:00
Jérôme Duval
9572fa7340 kernel: signal: check user buffer addresses...
in _user_set_signal_mask(), _user_sigaction(), _user_sigsuspend(), _user_set_signal_stack().
2018-01-06 17:15:18 +01:00
Jérôme Duval
e04d859b34 PowerStatus: call the APM syscall with the correct struct. 2018-01-06 16:13:11 +01:00
Jérôme Duval
b68d872bdb kernel: apm: check buffer parameter in apm_control syscall 2018-01-06 16:11:32 +01:00
Jérôme Duval
9c18398fe4 kernel: system_info: correctly check the user buffer...
before writing.
2018-01-06 12:05:20 +01:00
François Revol
4069b740e5 pthread: assign handle argument before resuming the created thread
It's not specified by POSIX:
http://pubs.opengroup.org/onlinepubs/009695399/functions/pthread_create.html
"There is no requirement on the implementation that the ID of the
created thread be available before the newly created thread starts executing."

However I've run into it with MPD which assumed this, probably because
of Linux:
https://github.com/MusicPlayerDaemon/MPD/issues/188

It doesn't hurt anyway.
2018-01-06 05:07:43 +01:00
Michael Lotz
0a7f661ae2 kernel: Fix scheduler tracing formats and priority field type.
* Use format macros for printing to fix priting on 64 bit.
* Use int32 for all priority fields, some of them were truncated.
2018-01-05 22:48:56 +01:00
Michael Lotz
3084a7000f Cleanup: Remove one trailing whitespace. 2018-01-05 22:48:56 +01:00
ohnx
452ac99fa7 mkdos: Handle memory allocation better
In the kernel and command-line tool, don't leak allocated memory,
even if the tool returns an error.

In the command-line tool, also handle memory allocation errors
nicely by giving the user an OOM message if allocation fails.

Fixes CID 1425367 and 1425224.

Signed-off-by: Augustin Cavalier <waddlesplash@gmail.com>
2018-01-03 22:35:58 -05:00
Jérôme Duval
e46e9fee6b vfs: check userland buffers before reading them. 2018-01-03 21:15:30 +01:00
ohnx
7766c048b3 libroot: Fix possible typo in printf_size.c
It appears as if there is a typo in printf_size.c; it makes
no sense to compare an unitialized variable in such a way.
Since `info->width` is referenced later on in the variable
assignment, it seems possible that the intended statement
was to place the larger of the values between `info->width`
and `info->prec` into `width`.

Fixes CID 609431.

korli: Patch applied in cddfcf2f87
was incomplete. This patch completes with what upstream did in 2004:
fa5753eede.patch

Signed-off-by: Jérôme Duval <jerome.duval@gmail.com>
2018-01-03 19:42:55 +01:00
Michael Lotz
36ef138ce5 kernel: Implement WEXITED for waitid.
Previously dead teams were always returned (as needed for wait/waitpid).
Using waitid it should however be possible to omit the WEXITED flag to
only get stopped (WUNTRACED | WSTOPPED) or continued (WCONTINUED) teams.

Adjust the other caller of the _kern_wait_for_child syscall, used by the
various less specific wait* functions, to always include WEXITED. This
avoids having to special case waitid in the syscall interface or with an
extra flag.

Add a check to ensure that any of these flags is set to avoid the now
possible case of nothing being specified. This fails with B_BAD_VALUE
(EINVAL) as on other systems.
2018-01-03 01:52:52 +01:00
Michael Lotz
63e2d20137 kernel: Treat WSTOPPED synonymous to WUNTRACED.
On other systems their values are usually aliased. We defined them as
two different values, but didn't handle WSTOPPED anywhere. The check
is now simply extended to cover both bits.
2018-01-03 01:22:53 +01:00
Michael Lotz
afe8d6621d kernel: Avoid double lock in wait_for_child with child == team.
When wait_for_child was called with a child argument equal to the
current team, the team was locked again to check if it was a child of
itself.

This is now handled the same way as on other systems, where this case
results in ECHILD (and not EINVAL).
2018-01-03 01:10:29 +01:00
Rene Gollent
b1ab02c434 Debugger: More memory management fixes.
DwarfImageDebugInfo:
- Type name/info entries weren't being freed properly.

BaseUnit:
- The array of entries itself was being destroyed, but not the actual
  objects. Consequently none of the DIE objects were ever being freed.

CfaRuleSet:
- The register rules array wasn't being freed.

FileManager:
- References to entries weren't being released. Some more work remains to be
  done here though, as a subset of these objects still have a non-zero ref
  count in the end.
2017-12-31 17:52:59 -05:00
Augustin Cavalier
8a9e1e0d4a Removal of non-Haiku target platform logic from build system (part 1.)
Following recent changes to use libroot_build on Haiku also, it is now
actually impossible to build Haiku components on non-Haiku platforms
(BeOS R5, Dan0, BONE, Zeta), so we can remove any logic related to this.

This is only the first part; still to be removed are:
 * SetSubDirSupportedPlatformsBeOSCompatible
 * HOST_PLATFORM_BEOS_COMPATIBLE
 * TARGET_PLATFORM_BEOS_COMPATIBLE
2017-12-31 16:14:22 -05:00
Fredrik Holmqvist
1446507ce3 Remove the code to force ACPI to shutdown on CPU0
It was discussed and introduced based on docs that some systems
need this to shutdown properly. I can find no mention of this in
ACPICA or ACPI docs.
This needs to be re-evalutad, as all my shutdowns been successful
after disabling it and I can't locate where this info came from
or if it actually helped.

See 1316462ab0 for original commit
and bug 12306 on current shutdown issue.
2017-12-31 17:43:31 +01:00
Augustin Cavalier
03544bf000 libroot_build: Full passthrough to system attributes.
As it turns out, using the xattr emulation layer plus "libgnu"
causes some strange mixups at package build time, and so packages
built with it were winding up with no attributes at all.

So I've just bitten the bullet and written a full passthrough layer
to the system attributes. Verified using a full build of haiku.hpkg
this time ... after a lot of painful debugging of symlink mixups.

Hopefully I am finally rid of this plague...
2017-12-30 16:35:51 -05:00
Fredrik Holmqvist
7d93e79a04 Latest ACPI update removed some essential configuration
* The global lock, needed for hw <-> os to sync, was a no op.
  This means that OS and HW could read and write to same value
  at the same time, causing garbled data and crashes. This is easiest
  to see in battery status, where battery values and OEM name would
  become garbage. It also causes instability and failure to shutdown

* ACPI used 64 bit addressing (which it normally should) on 32 bit.
  This would cause page faults as it would jump to incorrect addresses
2017-12-30 19:26:01 +01:00
Augustin Cavalier
699b4bbab9 libroot_build: *Actually* fix attribute usage on Haiku.
To quote jscipione (from 95e8362c52),
"Let me tell you a story about a bug" -- though this tale spans a much
lesser time than that one did.

In 5e19679ea3, I enabled libroot_build for
Haiku, instead of using the system libroot as we had before. There were
a number of bugs introduced along with this that I hadn't fixed (and there
may be more after this), but most of the obvious ones (crashes on x86_64...)
were fixed shortly enough.

Attribute usage, though, was a different story. Unlike most of the POSIX
calls in libroot, which were aliasing system functions no matter what the
platform, the attribute calls were not, as they are specific to Haiku.

Initially I had completely forgot about them, and it wasn't until a few days
later when I noticed that I had an "attributes" directory in my generated
that I realized that the "generic" attribute layer was being used on Haiku.
I attempted a fix for this in 5e19679ea3,
thinking that would clear the problem up, but I didn't actually run a test
beyond seeing that my BuildConfig had been updated properly. In fact,
BuildSetup was hard-wired to not even pass that definition through on
Haiku, and so that commit had in effect caused nothing.

My initial "fix" of just changing BuildSetup then caused a build failure,
as while libroot_build itself compiled, it ran into errors whenever attributes
were used, because in letting the real libroot's attribute calls shine
through, I had bypassed libroot_build's FD emulation/shim layer.

Then I tried and failed at three separate attempts to solve this with code:
 - a version of the "fs_attr_...h" interface for Haiku. This proved possible
   in theory, but in practice I would need to reimplement a lot of attribute
   handling code in it, because all I had access to from there was syscalls.

 - a version of "fs_attr_untyped" that bypassed its reimplementations of
   the "fs*attr" functions for the libroot ones, only using the FD shim layer.
   This proved possibly not even theoretically possible because it would have
   caused preprocessor hell in some of the build headers, and also assumptions
   about how attributes are read were totally different.

 - a completely new "fs_attr_haiku" that was a completely new interface to
   the fs*attr functions. This proved practically impossible because of the
   need to include structures from the system libroot to call out to readdir,
   etc. that attempts to solve would also have caused preprocessor hell.

Then I realized that the Linux xattr emulation library, which I'd used
as a reference when attempting the first solution, was shipped by default
as a system library in all builds of Haiku ... and so I could just tell
fs_attr_untyped to use the Linux xattr handler, and then link against libgnu.

So that is how I arrived at this strange and decidedly unorthodox solution
to a problem of my own creation.
2017-12-29 21:26:00 -05:00
ohnx
e6c08856dd bin/compress: Remove.
Per #10267, "Most (ported) third-party software should be removed
from the Haiku source repository."

Since HaikuPorts already has the ncompress package, this file
should no longer exist.

Signed-off-by: Augustin Cavalier <waddlesplash@gmail.com>
Original patch missed modifying the "minimum" definition and the
src/bin/Jamfile, so I took care of that.
2017-12-29 15:33:56 -05:00
Ho Tuan Kiet
5450ee2d87 bin/media_client: return 0 on success
In MediaPlay.cpp, media_play returns non-zero value on failure but forgets to return zero on success.

Coverity CID: 1422617

Signed-off-by: Augustin Cavalier <waddlesplash@gmail.com>
2017-12-29 15:28:38 -05:00
Ho Tuan Kiet
f94f87c710 bin/pc: Mark non-returning function as void
set_var doesn't return any value yet its return type is ULONG, and Coverity freaks out about that. This patch turns that function into a void function.

Coverity CID: 603433

Signed-off-by: Augustin Cavalier <waddlesplash@gmail.com>
2017-12-29 15:28:30 -05:00
Rene Gollent
3d9b569384 Debugger: Further work on memory leak hunting.
TeamWindow:
- Properly delete stack frame selection entries in destructor.

TeamDebugger:
- The reference to TeamDebugInfo wasn't correctly initialized to own,
  leading to TeamDebugInfo never being destroyed.

FunctionInstance:
- Also clear source code reference in destructor.

ImageDebugInfo:
- Release references to specific infos in destructor. These are acquired
  on our behalf when loading the image info, but were never released,
  leading to the latter never being freed.

DwarfManager:
- Release references to files in destructor.

FileManager:
- Release entries in various destructors.

Somewhat improves the situation in #13800, but is still far from complete,
as a thorough review of this nature hasn't ever really been done.
2017-12-28 23:22:13 -05:00
Rene Gollent
8bb774fc37 Debugger: Fix a memory leak.
TeamDebugger:
- In several cases, BReferences on thread handlers after a call to
  _GetThreadHandler() weren't correctly initialized to account for
  that function implicitly acquiring a reference on our behalf, leading
  to the reference count to spiral out of control, and consequently the
  handler would never be freed. Found while attempting to address
  #13800, likely more to come.
2017-12-27 23:52:13 -05:00
Rene Gollent
16b34a8fc7 Fix FreeBSD build.
- Recent changes to the build system appear to make the assumption
  that the GNU regex APIs are universally available. This isn't the
  case on FreeBSD, which requires libgnuregex to provide that
  functionality. This broke the host keymap build.
2017-12-27 23:06:56 -05:00
Julian Harnath
4e6fbe0320 HaikuDepot: notify work status from main window
* Update the work status view with package state changes from
  MainWindow instead of PackageListView, because PackageListView
  does not always show all packages that are going to be installed
  (e.g. dependencies that are not shown when a search filter is
  active).

* Fixes the bug that prevented pending/download status to show up
  for dependencies when filters are used.
2017-12-27 15:13:34 +00:00
Augustin Cavalier
3305611025 Mail Kit: Delete now-unused DES implementation. 2017-12-26 13:59:25 -05:00
Julian Harnath
39f49f7033 HaikuDepot: speed up package change handling
* During package population, when the repository is being
  refreshed, thousands of package change messages arrive
  in MainWindow while the PackageInfo fields are filled with
  data.

  Every such message caused a full generation of a package
  list (including applying filters to all known packages),
  which is quite slow, and caused the freezing from bug
  #13823. The list was only used temporarily to figure out
  if the package should be visible now or not.

* Instead of generating a new package list, we now only
  match the single updated PackageInfo against the current
  filters.

* Fixes #13823

* To reduce CPU usage even more, it would be better to not
  generate at all, or not subscribe to, package changes while the
  list is being initially populated, and/or to coalesce all the
  changes to each package info into one update message (instead
  of one for title, one for prominence, etc).
  Deferring subscription requires some additional thought on when
  to subscribe then, and how to avoid leaving a "hole" where
  changes would go unnoticed.
2017-12-26 17:31:59 +00:00
Augustin Cavalier
ca087b0532 build/libgnuregex: Remove.
It was needed on macOS for a time when BUrl used regexes for parsing.
Now it does not, and so we can remove libshared's RegExp from build
libshared, and thus also libgnuregex.
2017-12-24 12:27:47 -05:00
Augustin Cavalier
0d4fd77ef9 Magnify: Fix build on GCC5 (-Wambiguous-else). 2017-12-24 12:23:50 -05:00
Augustin Cavalier
726fb6c441 notification_server: Fix x86_64 build (missing parentheses). 2017-12-24 12:04:26 -05:00
Adrien Destugues
ab75d3b5a8 Do not advertise libavdevice in ffmpeg build feature.
It is not actually used by our ffmpeg plugin.
2017-12-24 16:39:23 +01:00
Owen
0278976dd5 magnify: make it controllable by scripting
scripting properties:
* Info, Grid, and Stick (true/false)
* CopyImage
* MakeSquare
* Zoom (1-100)

Decreasing pixel size from the menu will half the size
until it's less than 32.

fixes #13884

Signed-off-by: Adrien Destugues <pulkomandy@pulkomandy.tk>
2017-12-24 12:05:09 +01:00
ohnx
d2f5cd017c WebPositive: Improve CookieWindow cookie deletion
Fixes Coverity issue CID 1340122.
Also resolves two TODO items in the code: allowing the deletion
of a selection of cookies, and deleting all cookies from a site
when there are no specific cookies selected.

Signed-off-by: Adrien Destugues <pulkomandy@pulkomandy.tk>
2017-12-24 12:04:21 +01:00
Hrishi Hiraskar
226f6c8bf1 Notification_Server: Added ability to choose position of notifications
The feature gives user ability to choose the position of notifications
out of Follow Deskbar, Lower Right, Lower Left, Upper Right and Upper
Left. Fixes #9749 - Notification_Server: add the ability to choose the
position of notifications (easy).

Signed-off-by: Adrien Destugues <pulkomandy@pulkomandy.tk>
2017-12-24 12:02:38 +01:00
Automatic Committer
80e42f9c84 Update pci.ids from pciids.sourceforge.net 2017-12-21 05:20:13 +01:00
Augustin Cavalier
add916a765 Restore the "GPL licensing not permitted" in GLUT license headers.
It was originally there but was removed erroneously. The emails in which
we received permission to relicense stated this restriction explicitly.
2017-12-20 19:35:55 -05:00
Augustin Cavalier
04c3bd6cf1 Team: Defer adding the team to parent and hash until just before starting.
Previously I had intended to take the simpler route and just lock the
already-inserted team before setting the io_context (as in prior commits),
but after hearing some reports from users that some other seemingly
unrelated KDLs had possibly cleared up after the first iteration of
that fix, I decided to go with this route instead.

Now we do not insert the team into the parent and hash and send the
notification until just before the team's main thread is actually started;
i.e. we now initialize not only io_context but also the team's args, VM
address space, and user data (and if creation of any of these fails
we do not inset the team into the hash at all.)

Since the team structure was not locked at all while this initialization
was taking place, any number of race-dependent bugs could have been
caused by this on multicore systems.
2017-12-19 22:47:31 -05:00
Augustin Cavalier
4ecdf1e195 team: Only lock while actually setting io_context, not while creating it.
Thanks Ingo for the review!
2017-12-19 20:51:01 -05:00
Andrew Lindesay
d483b4d0b5 HaikuDepot : More Backend Communications Improvements
Fixes for x86_64 build (tests)
2017-12-20 00:14:37 +01:00
Andrew Lindesay
1065ea343d HaikuDepot : More Backend Communications Improvements
Fixes for x86_64 build (additional)
2017-12-19 23:26:21 +01:00
Andrew Lindesay
29f98e1f33 HaikuDepot : More Backend Communications Improvements
Fixes for x86_64 build.
2017-12-19 22:47:04 +01:00
Andrew Lindesay
0df6decf1b HaikuDepot : More Backend Communications Improvements
Added missing files from prior commit.
2017-12-19 21:50:31 +01:00
Adrien Destugues
197c659920 libnetwork: re-introduce gethostbyname_r and gethostbyaddr_r
These are needed by existing openjdk package. Let's keep them until we
get the OpenJDK build working again and can remove the requirement.
2017-12-19 21:22:14 +01:00
Andrew Lindesay
3094fef308 HaikuDepot : More Backend Communications Improvements
* Further improves the logging and provides some
  basic performance numbers.
* Moves the bulk-load logic out of the data-model
  class.
* Introduces a state-machine for the bulk-load
  process so that it will be more easily able to be
  shifted to non-blocking IO when the HTTP libraries
  can do that.
* Implements concurrent loading of the bulk-data to
  hopefully improve lead time for icons and meta-data.
* Loads data to a temporary file and then moves to the
  final location in order to avoid partially written
  data in the cache.
* Handles situations where no network is available;
  prevents attempt to access the network.
* Allows bulk-load processes to be cancelled when the
  application quits.
* Introduces command-line arguments to help simulate
  scenarios to help with testing performance and
  network absence.
* Implements ordered insert and binary search in the
  'List' class + basic unit test.
2017-12-19 20:56:53 +01:00
Augustin Cavalier
11b65332b4 kernel/team: Lock the team while modifying the io_context.
Second part of the fix for #13861. Thanks Ingo for the review!
2017-12-17 22:27:44 -05:00
Augustin Cavalier
019828aba7 VFS: Add proper locking of the team structure in disconnect_mount_or_vnode_fds.
The KDL in #13861 was apparently caused by a NULL io_context. I read over
the Team code and have applied the following fixes here as a result:

  1. A NULL io_context is entirely possible, as implied by the NULL check
     before deinitializing it in Team's destructor, so account for that.

  2. Team objects have a class-wide lock which must be acquired before
     directly accessing class members, so use that here.

First part of the fix for #13861.
2017-12-17 22:27:44 -05:00
Augustin Cavalier
2c2516b9b6 libhaikucompat: Delete.
Was decoupled from the build since the switch to use libroot_build
even on Haiku.
2017-12-18 18:06:12 -05:00
Augustin Cavalier
a128e43004 calloc_test: Apply correct version.
Sorry for the noise...
2017-12-17 17:51:12 -05:00
ohnx
3934b3e6cc Add tests for calloc()
Signed-off-by: Augustin Cavalier <waddlesplash@gmail.com>
2017-12-17 17:02:47 -05:00
Mason X
8a4744fbe4 Catch integer overflow in calloc (Fixes #13820)
calloc, when multiplying to find the true size of memory desired
by a user, will occasionally overflow if the numbers are too
large. This commit makes calloc ensure that the multiplication
does not overflow by dividing the result by one of the numbers,
and checking to ensure that the result is equal to the other
number. If there is overflow, it is treated as an OOM error.

Signed-off-by: Augustin Cavalier <waddlesplash@gmail.com>
2017-12-17 17:02:09 -05:00
Augustin Cavalier
bfc37fd122 libroot/posix/stdio: Remove unused portions.
We use glibc's versions of these functions.
2017-12-17 13:55:13 -05:00
Augustin Cavalier
cfafb3da99 rmd160: Remove from tree.
Not used or referenced anywhere.
2017-12-17 13:08:10 -05:00
Augustin Cavalier
3d44a8b6f4 zic: Remove from tree.
Not referenced anywhere or included in the build.
2017-12-17 13:08:10 -05:00
Kacper Kasper
ffd80a755d Add EXR image to MIME DB. 2017-12-17 17:57:55 +01:00
Kacper Kasper
b875d6d43b Outsource OpenEXR.
* Style fixes in EXRTranslator.
2017-12-17 17:57:53 +01:00
Alexander von Gluck IV
11790e14ef kernel/drivers: Kill Beceem WiMAX driver. RIP
I wrote this back in 2010 as my first driver project.

Reasons to remove it:
  * The license is GPL
  * Current WiMAX hardware is generally WIFI based.
  * It controlled the hardware, but never worked
    for network access since we need SSL certs and stuff
    which vendors weren't too open with.
  * WiMAX kind of died (at least in the US)

I left the wwan directory, it would be a nice spot
for CDMA / GSM dongle drivers.
2017-12-17 09:18:15 -06:00
Augustin Cavalier
d144f95270 HaikuDepot: Add "Check for updates" item in Tools menu to open SoftwareUpdater. 2017-12-16 13:50:13 -05:00
Augustin Cavalier
77de2e81a1 Repositories: Remove default repository URL constants.
Since automatic updates are enabled by default, these will already
be in the system repository settings.
2017-12-16 13:08:09 -05:00
Augustin Cavalier
8ea8a648f8 repository_infos: Enable automatic updates on the main Haiku repostiory.
Fixes #13868.
2017-12-16 13:01:58 -05:00
Leorize
0006cc3fbf libs/bsd: add explicit_bzero(3)
Signed-off-by: Augustin Cavalier <waddlesplash@gmail.com>
2017-12-16 12:54:58 -05:00
Leorize
9a1d046775 libs/bsd: add readpassphrase(3)
Imported from freedesktop libbsd project

Signed-off-by: Augustin Cavalier <waddlesplash@gmail.com>
2017-12-16 12:54:23 -05:00
Augustin Cavalier
503ef6d4dd build: Correct libroot_build's usage of xattrs on a Haiku host.
Implemented by just not defining the functions at all and letting
the Haiku ones shine through. In the future, though, we should wrap
them properly.

(Between the switch to libroot_build and this commit, libroot_build
was using the generic attribute emulation layer on Haiku ... whoops.)
2017-12-14 19:36:14 -05:00
Augustin Cavalier
637d99977c tools: Fixes following build syscall change. 2017-12-14 08:32:19 -05:00
Augustin Cavalier
1465ec71a0 build/kernel: Properly shadow syscall functions.
I didn't notice this in the previous commit because apparently GCC2
just links against libroot's versions of them. On GCC5, however,
the version from libroot_build was used even for calls from libroot itself,
which led to infinite loops and then stack overflows.

So instead we must have the "syscall" functions in libroot_build shadow
the real ones by being named differently, which I did by changing their
prefix from "_kern" to "_kernbuild" via preprocessor macros.

Since the build syscalls.h is now substantially different than the non-
build one (and has not been synchronized in nearly a decade anyway),
I've just stripped out all the syscall defns except for the ones actually used
in the build.

Thanks to kallisti5 for helping me debug and test.
2017-12-13 23:40:05 -05:00
Augustin Cavalier
5e19679ea3 build: Use libroot_build on Haiku.
Previously we just used the system libroot, which of course meant
that when libroot's ABI changed, the build broke. Now we use the full
libroot_build that we do on non-Haiku platforms. The logic for "BeOS-compatible
but not Haiku" does not really apply anymore, so it has been gutted where
appropriate (and libhaikucompat has been decoupled from the build.)

The only caveat here is the change to Errors.h -- we really should be using
the system's one where I included the one from the tree, but for whatever
reason, GCC2 refused to handle the #include_next properly.

Fixes the build breakage of Haiku-on-Haiku by my prior commits (sorry).
2017-12-13 19:47:39 -05:00
Alexander von Gluck IV
3065fd47a0 MediaPlayer: Relicense to MIT
* The GPL license here was a relic from the past to help
  control YellowTab's use of Haiku source code. The intent
  at the time was to relicense MIT.  Some GPL parts remained.
* This is going to get harder and harder to correct over time.
* This code makes Haiku *not* MIT. Lets correct that.
* I reached out to everyone who made changes to these files and
  got personal approvals to relicense MIT.
* If I missed somebody, *and* you feel as though the MIT license
  doesn't meet your needs, please contact Haiku, Inc. and we will
  work to revert your changes.

  Marcus Overhagen      EMAIL   - MIT OK 11/29/17
  Stephan Aßmus         EMAIL   - MIT OK 11/28/17
  Axel Dörfler          IRC     - MIT OK 11/29/17
  Ryan Leavengood       KEYBASE - MIT OK 11/28/17
  Michael Lotz          IRC     - MIT OK 11/29/17
  Adrien Destugues      EMAIL   - MIT OK 11/28/17
  Joachim Seemer        EMAIL   - MIT OK 11/28/17
  Jonas Sundström       EMAIL   - MIT OK 11/29/17
  François Revol        IRC     - MIT OK 11/29/17
  Jérôme Duval          EMAIL   - MIT OK 11/29/17
  Oliver Tappe          EMAIL   - MIT OK 11/29/17
  Dziadek               EMAIL   - MIT OK 11/29/17
  Philippe Saint-Pierre EMAIL   - MIT OK 12/6/17
  Philippe Houdoin      EMAIL   - MIT OK 12/8/17
  Dario Casalinuovo     IRC     - MIT OK 12/13/17
2017-12-13 14:40:11 -06:00
Augustin Cavalier
cef24e1a43 userlandfs: Pre-define and use the right KMessage.
Otherwise, later on when we include the real one Clang errors about
there being two conflicting KMessages declared in separate contexts.
2017-12-12 20:10:42 -05:00
Augustin Cavalier
b06b5456a5 btrfs: [] on the end of a struct field is a variable length array.
This throws an error in Clang, so just declare these as pointers.
2017-12-12 20:09:41 -05:00
Augustin Cavalier
361f980f9d More "missing space after macro; invalid in C++11" error fixes. 2017-12-12 20:08:26 -05:00
Augustin Cavalier
efdaac9c08 kernel/convertutf: Fix file mode. 2017-12-10 12:07:23 -05:00
Augustin Cavalier
5285006210 btrfs: Attempt to fix GCC2 build. 2017-12-10 11:21:15 -05:00
hyche
99768086b1 BTRFS: Add author and license.
Signed-off-by: Augustin Cavalier <waddlesplash@gmail.com>
2017-12-10 11:03:56 -05:00
hyche
4896a3735e BTRFS: Implement btrfs_remove_dir that can remove directories in most case.
We need to handle a case when node size is small reasonably it can be merged with another node or push data from other node to this node.

Signed-off-by: Augustin Cavalier <waddlesplash@gmail.com>
2017-12-10 11:03:04 -05:00
hyche
166917c9cd BTRFS: Implement btrfs_create_dir that can create directories in most case.
We need to handle a case when node is full, the solution should be split or push data to another node.

Signed-off-by: Augustin Cavalier <waddlesplash@gmail.com>
2017-12-10 11:03:03 -05:00
hyche
a9e85cb62f BTRFS: Implement Dereference() in Inode that remove the "name" and unlink it with inode.
Signed-off-by: Augustin Cavalier <waddlesplash@gmail.com>
2017-12-10 11:03:03 -05:00
hyche
8042a045b0 BTRFS: Implement Remove() in Inode that removes inode_item.
Signed-off-by: Augustin Cavalier <waddlesplash@gmail.com>
2017-12-10 11:03:02 -05:00
hyche
b44d924df4 BTRFS: Implement MakeReference() in Inode that will link file name to inode.
Signed-off-by: Augustin Cavalier <waddlesplash@gmail.com>
2017-12-10 11:03:02 -05:00
hyche
371935de18 BTRFS: Implement Insert() in Inode that inserts inode_item.
Signed-off-by: Augustin Cavalier <waddlesplash@gmail.com>
2017-12-10 11:03:01 -05:00
hyche
36a24fb34e BTRFS: Implement Create() that allocate new Inode object.
Signed-off-by: Augustin Cavalier <waddlesplash@gmail.com>
2017-12-10 11:03:01 -05:00
hyche
20185bb9c3 BTRFS: Implement RemoveEntries() for BTree that will remove consecutive items and its data.
Signed-off-by: Augustin Cavalier <waddlesplash@gmail.com>
2017-12-10 11:03:00 -05:00
hyche
84bc447cae BTRFS: Implement InsertEntries() that will insert consecutive items and its data.
Signed-off-by: Augustin Cavalier <waddlesplash@gmail.com>
2017-12-10 11:03:00 -05:00
hyche
02bce792d8 BTRFS: Added function to convert standard filetypes to btrfs filetypes.
Signed-off-by: Augustin Cavalier <waddlesplash@gmail.com>
2017-12-10 11:03:00 -05:00
hyche
883b9bf29f BTRFS: Implement CopyOnWrite relevant functions, and BTree holds new attribute that record its root level.
CopyOnWrite works like this:
* Cache original node
* Allocating new block
* Cache new block to be writable
* Copy original node to new node, and changing.
Also if a node is already be COW-ed it cannot be COW-ed again, it will be changed in-place instead.

InternalCopy does CopyOnWrite all the nodes that we don't need to change anything on them.

Signed-off-by: Augustin Cavalier <waddlesplash@gmail.com>
2017-12-10 11:02:59 -05:00
hyche
89484dc08d BTRFS: Implement some copy relevant helpers.
Copy() copys data from other node, MoveEntries() changes data on the current node.

Signed-off-by: Augustin Cavalier <waddlesplash@gmail.com>
2017-12-10 11:02:58 -05:00
hyche
27ffe0583b BTRFS: Implement some space relevant helpers.
Signed-off-by: Augustin Cavalier <waddlesplash@gmail.com>
2017-12-10 11:02:58 -05:00
hyche
4368661f03 BTRFS: Implement GetNewBlock() function that will find the logical address for allocating and convert it to physical block.
Signed-off-by: Augustin Cavalier <waddlesplash@gmail.com>
2017-12-10 11:02:57 -05:00
hyche
c1320b3a33 BTRFS: Implement a simple journaling approach, this is not finished and mostly satisfy the need for passing Transaction object for many functions.
Some details about the current Journal:
* Journal can only end transaction.
* It holds a transaction id of fs (fCurrentGeneration) that increments each time a transaction starts.
* _TransactionWritten now just printing message.

Signed-off-by: Augustin Cavalier <waddlesplash@gmail.com>
2017-12-10 11:02:57 -05:00
hyche
1750cd1e92 block_cache: Implement cache_has_block_in_transaction function that will check the existence of block in one specific transaction.
Signed-off-by: Augustin Cavalier <waddlesplash@gmail.com>
2017-12-10 11:02:56 -05:00
hyche
8137f447cb BTRFS: Fix memory leak
Missing delete for some tree roots.

Signed-off-by: Augustin Cavalier <waddlesplash@gmail.com>
2017-12-10 11:02:55 -05:00
hyche
0deb03560f BTRFS: Fix mismatched type of index in inode_ref item.
Signed-off-by: Augustin Cavalier <waddlesplash@gmail.com>
2017-12-10 11:02:54 -05:00
hyche
af419b0e98 BTRFS: Implement ExtentAllocator
There are 4 new classes, structs:
* CachedExtent, is a AVLTreeNode, caches the extent locating in extent tree, a extent can be free, allocated, metadata or a data extent. It also hold a references count,
that is incremented each time a new extent refer to it (COW) and item data, that is only for allocated extent (NULL for free).
* CachedTreeExtent, is a AVLTree, cache the whole extent tree and has CachedExtent as its node.
* BlockGroup represents the group of extents that represent the region for each type of allocated extent. For example, region for data extents, metada blocks. It
responsible for inserting nodes in CachedTreeExtent.
* And the final, ExtentAllocator it knows how to allocate/deallocate extents, but for now only the allocating is implemented, actually allocating and deallocating works
are already implemented, they are in functions _AddFreeExtent, _AddAllocatedExtent in CachedTreeExtent. However the deallocating is not needed for now, so it will be
finished later then.

Signed-off-by: Augustin Cavalier <waddlesplash@gmail.com>
2017-12-10 10:56:12 -05:00
hyche
bfd7a4fb42 BTRFS: Reimplement TreeIterator, add some error checks and remove redundancies.
Add BTree::Path as a attribute so enhance performance, so that everytime we iterate through items it wont search all the root to leaf
again. The Iterator is initialized without rewinding to make more flexible.

Signed-off-by: Augustin Cavalier <waddlesplash@gmail.com>
2017-12-10 10:56:11 -05:00
hyche
3216460dec BTRFS: Implement BTree::Path and change _Find.
Remove attribute fCurrentSlot in BTree::Node as it will be handled by Path explicitly. BTree control Path by passing its type in
BTree's method, Path also hold BTree type as its attribute to do some internal actions.
Add constant BTREE_KEY_TYPE_ANY, find search key has this type will success regardless of the found key's type.

Split the  the _Find function into Traverse and GetEntry. Traverse will fill in the Path (nodes and slots) along way its finding,
GetEntry will get the item data, item size, key from leaf, if the slot is valid, that we have from Traverse. The _Find function also
check type if is correct and then retrieve. Doing this way there will be more flexible, the "read" flag is not needed as we only
need Path to manipulate tree, and it also enhance the performance at some points, because Path caches all the nodes from root to leaf,
so that we don't have to block_cache_put and block_cache_get after each finding.

Signed-off-by: Augustin Cavalier <waddlesplash@gmail.com>
2017-12-10 10:56:11 -05:00
hyche
8160f31fc1 BTRFS: Node now holding Volume instead of cache to retrieve more values
Signed-off-by: Augustin Cavalier <waddlesplash@gmail.com>
2017-12-10 10:56:10 -05:00
hyche
16de9db54b BTRFS: Fix mismatched type of item size (should be uint32), and ObjectID of first subvolume when lookup directory (described in commit bd2dab1)
Signed-off-by: Augustin Cavalier <waddlesplash@gmail.com>
2017-12-10 10:56:09 -05:00
hyche
2ed88a489c BTRFS: Fix node search slot
* Not handle traversing type correctly (looks for the graph).
* Reorder the codes because *slot is uninitialized if type is BTREE_EXACT.
* Incorrect return type: int32 -> status_t

Signed-off-by: Augustin Cavalier <waddlesplash@gmail.com>
2017-12-10 10:56:08 -05:00
Adrien Destugues
d87218f79e Add test for stack alignment. 2017-12-10 09:28:49 +01:00
Adrien Destugues
6a028821b6 x86 glue code: keep stack aligned.
The glue code pushed 12 bytes to the stack, breaking the 16-byte stack
alignment requirement. This would be fixed by the main() prologue from
gcc, but all "init" and "fini" code (static/global constructors/ destructors)
would run with a misaligned stack.

This was already fixed for x86_64 in hrev49731. Note that the fix here
is slightly different, the pointer is realigned after it is saved to EBP
and the function epilogue restores it from EBP, so no changes to crtn.S are
needed.
2017-12-10 09:23:22 +01:00
Owen
9e53d4e91b Accepts URLs as command line arguments.
Fixes #9793

Signed-off-by: Kacper Kasper <kacperkasper@gmail.com>
2017-12-09 20:02:06 +01:00
Janus
da9188ac28 StyledEdit: avoid crash on replace window
* Fixes #13842
2017-12-08 15:08:43 +01:00
Adrien Destugues
2d10453741 Add a simple video decoding test
This application tests the BMediaTrack/BMediaFile API and underlying
ffmpeg plugin for video decoding. You can press (or hold) any key to go
through frames in a video. This avoids debugging both MediaPlayer and
the underlying libraries at the same time.

It shows that ReadFrames is getting video frames out of PTS order.
2017-12-07 22:45:44 +01:00
Adrien Destugues
a9020afcb6 BHttpHeaders: fix gcc5 build. 2017-12-07 22:45:44 +01:00
Adrien Destugues
ed8f28a480 Move HeadersReceived hook after parsing of cookies
I still don't get what's happening, but doing the cookie parsing at the
same time as the main thread is handling HeadersReceived seems to
trigger a memory corruption, and it will escape all my attempts to debug
it (adding printfs or any other slight change to the code will make it
go away). So just chage the order we do things and hope that's enough to
always avoid it.

As a side effect, HeadersReceived can now rely on the cookies being
already stored in the cookie jar, which I think makes more sense.

I still plan to rewrite the HTTP request code as a proper state machine,
instead of one long Run() function. This would allow to run it in
smaller steps, and thus group multiple requests in a single thread
(triggering them from poll, select, or similar).
2017-12-07 22:45:44 +01:00
Automatic Committer
0ba5f365d0 Update pci.ids from pciids.sourceforge.net 2017-12-07 05:20:14 +01:00
Augustin Cavalier
dfaaa345ff get_package_dependencies: When adding a package fails, actually report why.
e.Details() gives "additional details" and not the real failure
message, which is in e.Message(), so actually print that.
2017-12-05 20:15:49 -05:00
Augustin Cavalier
f3114cade7 Tracker: Add shortcut_catcher to UseHeaders.
Tracker uses KeyInfos.h from it. Previously this wasn't needed
due to the SEARCH_SOURCE added in the Shortcuts preferences,
but as that is now just a UseHeaders, we need it here (if only
for the DoCatalogs.)
2017-12-05 20:14:21 -05:00
A-star-ayush
bf1a86c199 TCP: Fixed RTO update and dup ACKs generation.
i) there was an integer promotion problem in updating the retransmission
timeout : a signed int was being divided by an unsigned int. This was causing
the values to overflow. Thus leading to huge values for timeout which
manifested in the perception of pause in data flow.

ii) for an ack to be recognised as a duplicate ack, the advertised window
must remain same. This was not taken care of in the code so I added it.

Signed-off-by: Augustin Cavalier <waddlesplash@gmail.com>

Helps with #13769 but does not fix it completely (upload gets
farther but still stalls.)
2017-12-04 15:12:03 -05:00
Augustin Cavalier
f1e8af173c net_socket: control op should be uint32.
Where it is called from stack_interface_ioctl, the parameter
is already a uint32 there.

Fixes #13826.
2017-12-03 13:57:26 -05:00
Augustin Cavalier
8b222e6272 IORequest: NULL check does not belong in method body.
Found by Clang's -Wtautological-undefined-compare.
2017-12-03 13:44:16 -05:00
Augustin Cavalier
47bedf1601 PackageDataInlineReader: Do not use fData before it has been set.
Spotted by Clang.
2017-12-02 22:24:55 -05:00
Augustin Cavalier
7c234361eb Fix more class/struct mixups. 2017-12-02 22:24:06 -05:00
Augustin Cavalier
bf77c15232 kernel/vm: Correct virtual function declarations.
The base VMCache class changed to the generic_ types with their
introduction in in *2011* (435c43f591),
but these classes were never properly adapted. These functions should not
be called here (they panic() -- but the base class only returns B_ERROR,
so that is a difference at least.)

Found by Clang's -Woverloaded-virtual.
2017-12-02 21:42:50 -05:00
Rene Gollent
737de463dd Debugger: Fix #13797.
- When reading the areas note, there was no check in place to ensure that a
  matching segment for the address was actually found. This would later lead
  to a crash when attempting to read memory from the corresponding (missing)
  piece of memory in the core.
2017-12-02 15:58:28 -05:00
Rene Gollent
dfc46d83b7 runtime_loader: Fix #13799.
- Don't remove .eh_frame in the linker scripts, as this saves little
  space in practice, and results in debug binaries of the runtime loader
  not being properly debuggable due to missing canonical frame
  information.
2017-12-02 15:41:41 -05:00
Alexander Coers
5797d59f94 ATA: Support for Highpoint HPT36x/37x PCI controller
Signed-off-by: Augustin Cavalier <waddlesplash@gmail.com>
Fixes #13819. Some style fixes by me.
2017-12-02 11:45:57 -05:00
Augustin Cavalier
2b1481f0dc Fix a few more miscellaneous (harmless) Clang warnings. 2017-12-02 00:12:51 -05:00
Augustin Cavalier
d3eba978d3 shortcuts: Collapse needless SEARCH_SOURCE to a UseHeaders. 2017-12-02 00:00:51 -05:00
Augustin Cavalier
1812b1f732 preferences/bluetooth: Correct predefinitions.
Thanks to various Clang warnings/errors due to clashing definitions.
2017-12-01 23:59:56 -05:00
Augustin Cavalier
00aac5fdeb drivers: Add spaces around preprocessor macros in string literals.
It is illegal not to have these in C++11.
2017-12-01 23:59:09 -05:00
Augustin Cavalier
b4b5583536 hardlink_packages: Clarify packages directories in helptext. 2017-12-01 22:29:56 +01:00
Augustin Cavalier
30c9d3c0cc kernel: Correct class/struct mixups.
Almost certainly harmless. Spotted by Clang.
2017-12-01 20:27:15 -05:00
Augustin Cavalier
220a7208a3 xres: Add missing braces.
Found by Clang's -Wmisleading-indentation.
2017-12-01 14:24:45 -05:00
Augustin Cavalier
be622abddb fluidsynth: Remove from tree.
Not included in the build (or even wired to Jam) since the new package
repo changes merge.
2017-12-01 10:14:45 +01:00
Automatic Committer
26b4b8319b Update usb.ids from www.linux-usb.org 2017-11-30 05:21:36 +01:00
Julian Harnath
1d8d3ee32b Document workaround for using test_app_server
* Add a note about a workaround that can be used to run
  test_app_server, which currently fails to load the right
  library libbe_test.so. The bug should be fixed too, but
  with this, it can at least be used until then.
2017-11-29 19:43:16 +00:00
Greg Crain
af0c1fa658 xhci: fix hub descriptor command request
The command to get the hub descriptor needs to be a class request and was incorrect causing a Stall error for the hub. The the driver does not handle a stall error yet, causing odd behavior.

Signed-off-by: Jérôme Duval <jerome.duval@gmail.com>
2017-11-29 17:40:02 +01:00
Axel Dörfler
e96835a9a4 Added simple test_launch_daemon.
* Expects its config files in /boot/home/test_launch.
* Uses standard I/O, and is always in user mode.
* Also added test_launch_roster command that is able to talk to the test
  server like it does to the real thing.
2017-11-29 17:19:46 +01:00
Alexander von Gluck IV
272510c371 bfs_tools/bfsinfo: Cleanup output, use human sizes
* Correct some warnings on 64-bit
2017-11-28 14:57:09 -06:00
Janus
3004f55c5c keystore: Clean up the code add an icon.
* Need more work see #13812 and #11315
2017-11-28 21:19:45 +01:00
Alexander von Gluck IV
8f087d87f9 bfs_tools: License clarification to MIT.
* Consulted with Axel D. via IRC to confirm license desires.
2017-11-28 09:26:04 -06:00
Janus
1abde80b3b ZipOMatic: modernize barberpole widget
* Use the code/graphic of the new barberpole (Haikudepot)
* See #13808
* I hope soon we will have a system standard widget
2017-11-28 14:07:02 +01:00
Janus
0588dd3ae2 [Haikudepot] Change barberpole colors
* Feel free to tweak tint and other parameters
* As suggested by waddlesplash this should extend the progressbar
* Should fix #13808
2017-11-27 23:16:54 +01:00
Julian Harnath
416c116003 HaikuDepot: resize window to largest screenshot of pkg
* When opening the screenshot window for a package, set the window
  size to the largest dimensions of all the screenshots of this
  package. Prevents it from resizing/jumping around when browsing
  through the images.
2017-11-27 22:15:02 +00:00
Julian Harnath
3ca9d5e90c HaikuDepot: delay indicating screenshot download progress
* Only show barber pole if screenshot download takes longer
  than 200ms
2017-11-27 22:15:02 +00:00
Julian Harnath
622e144f6c HaikuDepot: add icons to screenshot window tool bar
* Arrow icons instead of text for previous/next buttons
2017-11-27 22:15:02 +00:00
Julian Harnath
47e34fcb8a HaikuDepot: fix screenshot window toolbar
* Next-button was disabled too early
2017-11-27 22:15:02 +00:00
John Scipione
4824497d01 BDeskbar: Set auto hide default value to false
Didn't notice this before so had to do a quick fix. Catch it before
Coverity can.
2017-11-27 11:50:15 -08:00
John Scipione
fd236f33cd BWindow: Update Zoom() with Deskbar window flags
Call newly created BDeskbar methods to adjust default Zoom().

if auto-hide is turned on don't consider Deskbar's frame.

In vertical mode allow windows to zoom on top of Deskbar if
auto-raise or always on top is turned on.

Deskbar can take up a significant area so you can reclaim that
space by turning on auto-raise or always on top.

In horizontal mode ignore auto-raise and always on top settings,
don't allow windows to zoom on top of Deskbar even if these
settings are turned on.

Deskbar doesn't take up very much space and you don't want your
window to get cut-off at the bottom.
2017-11-27 11:13:50 -08:00
John Scipione
fc23c09758 BDeskbar & Deskbar: export window bool settings to BDeskbar
Add methods to get and set "Always on top", "Auto raise", and "auto hide"
which are all booleans which control aspects of the Deskbar window to
BDeskbar.

Set the bool to the default value initially. Check if sending the
message succeeds, if so check the reply which also fills out the bool.
Don't check to see if reply succeeded because the bool will only be
overwritten if it did.

Follow the BDeskbar convention Is...() for getter, Set...() for setter
e.g IsAlwaysOnTop() is the getter, SetAlwaysOnTop() is the setter.

Define new message constants to call the newly created methods.
Follow BDeskbar convention: 'gtla' is used for getter, 'stla' for setter.
g/s for getter/setter, tla is an all-lowercase code unique to each
getter/setter pair.

Copy/paste these message constants into BarApp.h unchanged. Replace four
letter codes with imported message constants in BarApp.cpp and
BarWindow.cpp. Much nicer than using bare codes.

The new BDeskbar methods are all handled by TBarApp. The getters send
back a reply message containing the bool while the setters fall through
to existing setter cases.
2017-11-27 11:05:22 -08:00
John Scipione
f8811591e1 BDeskbar: Style fixes
Update Copyright in cpp, add myself, alphabetize, standardize
Pointer style in cpp
Update some comments
Some 80 char stuff
pragma section headers
whitespace
2017-11-26 20:40:00 -08:00
John Scipione
b1b84675f0 BWindow: Update default Zoom() to respect Deskbar
Zoom() takes up all Desktop area excluding the area
occupied by Deskbar. This is calculated using information
from the BDeskbar class.

Window zooms just as you'd expect -- it takes up fullscreen
minus area taken up by Deskbar. In vertical mode the zoom
area depends on the width of Deskbar, consequently Zoom()
is more space efficient in horizontal mode than vertical
mode because the window doesn't use the area below Deskbar.

If the zoom limits are smaller than the Desktop area, the
zoom area shrinks towards the center of the Desktop not
covered by Deskbar. This is slightly different behavior,
the window insets off-center following Deskbar.

In some scenarios zooming to the non-Deskbar area was too
restrictive. I made an exception that if there is enough
room above or below Deskbar i.e. a short window, then Zoom()
instead insets from the screen edge ignoring Deskbar. Apps
which meet this criteria include DriveSetup and Expander.
2017-11-26 20:04:43 -08:00
Julian Harnath
a83b974b13 HaikuDepot: make status bar smaller
* As requested in #13808

* Thanks to Janus for the tip with the SetBarHeight
2017-11-26 17:59:39 +00:00
Julian Harnath
d78bfd8d18 HaikuDepot: fix single package install
* Fix crash report by Diver
2017-11-26 17:48:27 +00:00
Augustin Cavalier
5f8613a22c build: Cleanup and fixes following previous commits.
* Hashing semantics for the new build repositories are different than
   the old ones, so update those (if the x86 build was not broken before
   it is now...)
 * OptionalPackages has been updated slightly (removed libtool and git_cvs
   from the default images, as they are rarely used nowadays and would pull
   in a bunch of dependencies we don't really care for either)
 * Removed lib:libqrencode from Haiku package requires (qrencode_kdl is a
   static library, the userland libqrencode is not used anywhere in the tree,
   as far as I can tell)
 * Fix build of JPEG2000 translator after update
 * Decouple fluidsynth build machinery and remove from image now that it
   is no longer used
 * Update repository URL in Repositories preflet
2017-11-25 21:15:10 +01:00
Augustin Cavalier
16b3c214f1 tools: Add a new hardlink_packages.py script.
This is essentially the replacement for "jam upload-packages" --
it goes through a directory of packages (intended to be one made by
buildmaster), picks the packages out of it that are in the repository
file passed to it, and then hardlinks them to a second directory
as well as updates the repository file and creates a package_repo.

This is what was used to mass-modify the repository files which
will be updated in the next commit.
2017-11-25 21:15:09 +01:00
Augustin Cavalier
c9f8b996fe repository_infos: Use HTTPS and point HaikuPorts to Buildmaster-generated repo. 2017-11-25 21:15:08 +01:00
Jérôme Duval
7bee81a5c2 updated usbdevs from NetBSD revision 1.743 2017-11-25 19:06:36 +01:00
Jérôme Duval
540529be6f Haiku package: depends on zstd for libbe. 2017-11-25 08:46:07 +01:00
Jérôme Duval
6ac3a280f4 Add ZstdCompressionAlgorithm.
* kernel lib is decompress only (like zlib).
* expand compression_test for zstd.
2017-11-24 21:35:49 +01:00
Julian Harnath
c210060f38 HaikuDepot: begin support for multiple screenshots
* Initial support for displaying multiple screenshots for packages
  which have more than one. Still rough and unfinished.

  Screenshot window now has a toolbar with prev/next buttons and
  a busy loading indicator. Switching through the screenshots works.

  There's currently a server-side bug which makes all data turn up
  15 times in the JSON file, so please don't report a bug about
  HaikuDepot showing 15 or 30 screenshots available when it's really
  just 1 or 2 :)

  Still to be done: toolbar icons instead of text labels; better
  handling of screenshot window resizing; maybe thumbnails of
  screenshots and preloading other screenshots in the background.
  Main window also needs a way to indicate that there are more
  screenshots than the one thumbnail, needs some more thought about
  how that might look.

  This concludes my HaikuDepot commits from the coding sprint at
  KDC 2017 Toulouse!
2017-11-24 18:22:14 +01:00
Julian Harnath
74e4161139 HaikuDepot: hide debuginfo too when hiding development pkgs
* When development packages ([...]_devel) are not shown, we now also
  hide debuginfo packages ([...]_debuginfo).

* Fixes #13095
2017-11-24 18:22:14 +01:00
Julian Harnath
72fff6d385 HaikuDepot: async listing of packages in PackageListView
* The UI became unresponsive while the PackageListView was filled
  with all the packages. This was especially apparent when using
  the search function, which clears and refills the view with every
  typed character.

* Add a new worker thread with the task of asynchronously filling the
  PackageListView. When a new data model is adopted, we hand the
  thread a copy of the visible package list. The worker thread then
  goes through the list and sends the package infos via BMessage back
  to the MainWindow, in batches of 20 infos per message. When the 20
  entries were added, it acknowledges this to the worker thread which
  will send the next 20 infos (so UI messages can get in between,
  keeping it responsive). The lists also get a unique ID so that
  model changes while the list is populating will invalidate
  previously sent messages (and cause the worker thread to cancel
  processing the outdated list).

* Search is much nicer to use this way, staying responsive and
  listing packages while typing. Still not perfect since the
  PackageListView is still cleared and refilled each time a character
  is typed, instead of just narrowing down the already displayed
  package set. But that's to be improved on another day...

* Same applies to filling FeaturedPackagesView btw
2017-11-24 18:22:14 +01:00
Julian Harnath
97844417de HaikuDepot: faster row lookup in PackageListView
* Use a hash table to find PackageRows by package name in
  PackageListView, instead of doing linear search over all rows.
  Improves performance of populating the list, since every
  AddPackage() checks if a row for the package already exists.
2017-11-24 18:22:14 +01:00
Julian Harnath
26c5107c8d HaikuDepot: fix package category assignment
* Processing of server data used wrong index into category list
2017-11-24 18:22:14 +01:00
Julian Harnath
125d42d95b HaikuDepot: add work status view
* Add new WorkStatusView which keeps the user informed about what's
  happening. It's a status bar at the bottom of the window which
  shows on the left side either a spinning barber pole (for
  operations without a progress), or a progress bar (for download
  progress). Next to that is a text view showing a descriptive
  status text.

* Currently, it will notify of the following operations:
  - Repository refresh (barber pole)
  - Background packet actions, like preparation of install or uninstall
    (barber pole)
  - Package downloads, including downloads of dependencies (progress
    bar). Status text indicates the name of the package currently
    being downloaded (if any), and how many more packages are queued
    for download after it (if any).

* Hooks into PackageListView to be notified of package status changes
  (such as becoming pending or download progress)

* When the package currently being downloaded is also selected in the
  list view, the user sees the progress bar in WorkStatusView
  as well as the one in the PackageInfoView, which is redundant. This
  still needs a good solution...
2017-11-24 18:22:14 +01:00
Julian Harnath
d737433974 HaikuDepot: add change confirmation event to progress listener
* Add a new event "ConfirmedChanges" to PackageProgressListener. It
  triggers when a package action was confirmed by the user and is
  about to be run. This can be used to e.g. get a full list of
  packages about to be installed (i.e. including dependencies)
  right before the process of fetching/installing them is started.

* Add a handler for it which looks at PackagesToActivate and sets
  all their PackageInfo states to pending (so now, when installing
  a package, its dependencies immediately become pending as well).
2017-11-24 18:22:14 +01:00
Julian Harnath
2a493ea0e0 BView: set initial frame rect invalid when using layouting
* When a view is used with the layout system, its initial frame rect
  was set to (0, 0, 0, 0), which is a BRect covering 1 pixel in the
  top left corner of the window.
  Since this a valid rect, it can cause "badly behaved" views to
  trigger redraws of themselves and other views during the layout
  process, which is ultimately the reason for the HaikuDepot UI
  freezing while populating with packages.

  The misbehaving view in this case is BTextView. When in read-only
  mode, since commit e27a53b2, its GetHeightForWidth() implementation
  causes the view to resize (really resizing, not just simulating a
  resize) and thus it invalidates itself. This is broken behaviour,
  and needs to be fixed in BTextView. Since GetHeightForWidth() is
  called during the layout process, all the not-yet-layouted views
  have a frame of (0, 0, 0, 0). The invalidation of just the one
  BTextView in the layout then hits *all* new views that are being
  layouted (because they all occupy the same one pixel in the
  corner), and they all get redrawn.
  Many view Draw() implementations ignore the update rect, so work
  is being done. And even if not, this can cause a lot of traffic
  on the app_server link. In a test case with HaikuDepot's
  FeaturedPackagesView, adding 300 rows (each containing a BTextView,
  among other views) in quick succession caused over 6 million
  commands to travel over the app_server link, completely freezing
  the UI for a long time.

* The actual problem here is in BTextView::GetHeightForWidth() and
  must be fixed there.
  However we also put in an extra-fix here because it never makes
  sense anyway to try and draw a view that has not yet been layouted.
  So we set the initial BView frame to an invalid rect
  (0, 0, -1, -1), which will suppress any actual updating, even
  when the view actively invalidates itself, as long it doesn't
  have a size yet. (The dirty region will always end up empty
  then).

* Fixes HaikuDepot UI freezing during package population (caused by
  above described behaviour from BTextViews in FeaturedPackagesView).
  Might improve performance in other applications using BTextView
  with layouting as well.
2017-11-24 18:22:14 +01:00
Julian Harnath
a78e725206 HaikuDepot: preliminary fix for crash in JSON listener
* Fix use-after-free in the auto-generated JSON listener code (was
  calling method of instance after 'delete this')
  Will also submit a patch for the code generation script in the
  haikudepotserver repo so it won't get lost -- this is just a
  temporary fix-up until then.

* Fixes some random occasional crashes
2017-11-24 18:22:14 +01:00
Julian Harnath
492c58fd9c HaikuDepot: add barber pole style progress indicator
* BarberPole view for indicating that the application is busy while
  the amount of work is not known

* Flat looks with scrolling color stripes. Number of stripes and their
  colors are freely configurable, so you could add a whole rainbow of
  colors to endlessly scroll through if you like.
2017-11-24 18:22:14 +01:00
Julian Harnath
5c821d1200 SystemProfiler: prevent nested wake-up of profiler thread
* When SystemProfiler::_MaybeNotifyProfilerThreadLocked() is called
  and the conditions are right, it will lock the thread's scheduler
  spinlock and unblock it. Internally, the unblock will enqueue the
  thread into the run queue, which causes a ThreadEnqueuedInRunQueue
  event for SystemProfiler. Since the conditions haven't changed, it
  now went into _MaybeNotifyProfilerThreadLocked again (this time
  from the profiler thread context). In there, it will try to lock
  the profiler thread's scheduling spinlock, which is already locked
  by the other thread (which is firmly sleeping). Deadlock, KDL.

* Before unblocking the profiler thread, unset fWaitingProfilerThread
  so that further events will not try to unblock it again.
2017-11-24 18:22:14 +01:00