Commit Graph

8878 Commits

Author SHA1 Message Date
Xiang Fan 46b328f136 wait_for_objects: add macros for output-only select types
Bug: 13965
2018-02-26 10:43:54 +00:00
Barrett17 e74e02ac05 MediaClient: Update docs and add TODOs 2018-02-25 23:44:39 +01: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
Barrett17 78fea9cd2d MediaClient: General cleanup
* We are finally not dependent on media kit definitions.
* Offline mode is not important at this moment.
2018-02-25 23:44:16 +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
Barrett17 dc4c49c305 MediaConnection: Introduce Endpoint() method.
* Used to get the other side of a connection when
available.
2018-02-24 15:42:12 +01:00
Barrett17 3b36cb5942 MediaClient: FileInterface is a bad idea, remove TODO 2018-02-24 02:34:38 +01:00
Barrett17 72958d8ba8 MediaClient: Remove SetRunMode 2018-02-24 02:30:40 +01:00
Barrett17 e8bf0f3e72 MediaClient: Reappropriate copyright 2018-02-24 02:23:41 +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
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 66fa3b1847 kernel: Add set_clac and clear_ac() definitions on non-x86 platforms. 2018-01-31 19:32:46 +01: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
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 c8fcb2a04e udis86: Add clac/stac instructions for SMAP.
still in a PR:
e9dfa2d79a
2018-01-22 20:06:55 +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 964fb0c378 kernel: make arch_kernel.h for x86 C safe. 2018-01-17 19:20:59 +01:00
Jérôme Duval 483c45843d kernel: x86: add some more cpuid flags. 2018-01-15 20:18:43 +01:00
Leorize cedb0e1179 uchar: Introduce C11 uchar.h
Currently this implementation only supports UTF-32
2018-01-14 14:42:34 +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
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
Michael Lotz da30fdf96a kernel: Fix overflow in load tracking for very large deltas.
The scheduler uses the load tracking logic to compute the load of
threads to be enqueued into the run queue. The time delta between the
last enqueue and the next enqueue may grow very large for threads
that mostly wait on conditions. In such cases the int "n" period count
variable would become too small and wrap around, leading to an
assertion failure.

For this to happen, the thread in question would have to have slept for
at least ~25 days and then wake up. Threads often affected would be ones
waiting for some other process to end, for example shell threads waiting
for a long running process to exit.

Fixes #13558.
2018-01-05 22:48:56 +01: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
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
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
Augustin Cavalier 8d4324628d syslog.h: Add LOG_NFACILITIES, LOG_FACMASK, LOG_FAC.
Not in the POSIX specification, but defined (not behind any guards)
in (at least) FreeBSD, NetBSD, glibc, and macOS.

Found by miqlas and myself while working on porting GNU inetutils.
2017-12-26 17:09:26 -05:00
Augustin Cavalier 3305611025 Mail Kit: Delete now-unused DES implementation. 2017-12-26 13:59:25 -05:00
Augustin Cavalier 95c9effd68 Migrate the BMailComponent docs to the Haiku Book.
I've updated the docs to match the current BMailComponent, documented
new functions, and cleaned up the MailComponent.h file to at least
somewhat match our coding style.

First in a series (there are 3 more old API docs on the Mail Kit in that
"Public API" folder.)
2017-12-25 19:43:51 -05: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
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
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 0be0fba248 BHttpForm: Clang also uses pair<> now. 2017-12-18 17:58:04 -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 3d61d20742 libs/bsd: add be64dec(3) and be64enc(3)
Signed-off-by: Augustin Cavalier <waddlesplash@gmail.com>
2017-12-16 12:54:41 -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 f0cdb09104 headers/bsd: Add sys/queue.h.
Requested in #12617.
2017-12-14 19:07:04 -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
Augustin Cavalier 361f980f9d More "missing space after macro; invalid in C++11" error fixes. 2017-12-12 20:08:26 -05:00
Augustin Cavalier 0d020b8298 headers/build: Use the system's types.h on Haiku.
Technically a "hack" (but then again most of the config/build stuff is);
as we need to use the system's config/types.h in order to get stdint
definitions and the like.

Previously there was a config_build directory which allowed the existence
of two types.h -- the system one, and the headers/build one, but seeing
as we only need this to provide Haiku-specific core types on other platforms,
using the system's one should be fine.

Our core type definitions have not changed in some time (and it's unclear
when they would change aside from potential new platforms), breakage of the
Haiku-on-Haiku build due to this should not happen often (if ever.)
2017-12-12 18:51:13 -05:00
Augustin Cavalier 02c9c92ae2 BeBuild: Treat TinyCC as GCC4 ABI.
Since it's just a C compiler "technically" the ABI does not matter,
but since it also can target other ABIs from one toolchain (e.g. x64),
just treat it as GCC4 ABI unilaterally.

Fixes #13847.
2017-12-11 19:28:45 -05:00
Augustin Cavalier 82bffcc3a7 headers/build: Reunify BeBuild.h and related cleanup.
Now that we do not target BeOS and also do not include the main headers
directory when building "build" binaries, we can drop the separate
config_build directory and thus also the separate BeBuild.h, and just
..-include the regular one.

The build BeBuild.h defined empty _IMPEXP_ROOT and _IMPEXP_BE preprocessor
macros that the regular one does not; so I also re-synchronized
headers which used these as needed.
2017-12-11 19:15:47 -05:00
hyche 2b6c2ec390 fs_shell: Added socket filetype.
Signed-off-by: Augustin Cavalier <waddlesplash@gmail.com>
2017-12-10 11:02:59 -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 e715614613 AVLTree: forward LeftMost and RightMost method from AVLTreeBase
Signed-off-by: Augustin Cavalier <waddlesplash@gmail.com>
2017-12-10 10:56:08 -05:00
Augustin Cavalier 06b79f5509 build/Errors.h: Synchronize with the non-build one.
This file was apparenly based off the BeOS one (as is evidenced
by the "Be Incorporated" copyright ... which is problematic.)
Now it's directly based off of the non-build one.
2017-12-05 18:36:11 -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