Commit Graph

9366 Commits

Author SHA1 Message Date
Augustin Cavalier
394fba6684 unistd.h: POSIX_THREAD_ATTR_STACKADDR was implemented back in March. 2019-07-11 23:05:27 -04:00
Augustin Cavalier
42e3c6f978 KPath: Use an object_cache for the path buffers in the normal case.
This was (following the packagefs changes) the number-one (by call
count) consumer of malloc() during the boot -- 52866 calls, and 100%
of them either 1024 or 1025 bytes!

Virtually all of these are ephemeral (indeed, the object_cache
stats after a boot with this patch shows there is only a single slab
of 64 buffers allocated, and most of them unused), so this is
probably a significant performance boost.

Change-Id: I659f5707510cbfeafa735d35eea7b92732ead666
2019-07-11 22:52:10 -04:00
Augustin Cavalier
2f6dc2bb79 kernel: Commit missing change to team.h.
If the buildbots were working, I would have been informed of this
about an hour after I committed it last night. But it seems they aren't.
Maybe kallisti5 will have some more incentive to work on that?
2019-07-08 17:58:43 -04:00
Augustin Cavalier
a90e9ba7b9 kernel/team: Create a team_get_team_struct() function and utilize it.
Cleans up some lock/get/unlock sequences, and makes it possible
for external consumers to get team structs (which will be necessary
for permissions checks.)
2019-07-04 16:54:33 -04:00
Alexander von Gluck IV
b313d63eae arm/atomics: Move cpu-specific memory barriers to arch_cpu
* Now matches the rest of the architectures.

Change-Id: I6699e0c8f729923770f136f2c9599185a685336a
Reviewed-on: https://review.haiku-os.org/c/1527
Reviewed-by: Alex von Gluck IV <kallisti5@unixzen.com>
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>
Reviewed-by: Axel Dörfler <axeld@pinc-software.de>
2019-06-20 20:20:03 +00:00
Augustin Cavalier
74c38cab40 BMenuBar & Deskbar: Make the hack to call ShowMenuBar a lot less ugly.
The previous hack, which as the comment (and __MWERKS__) implies
dates all the way back to the Be era, finally broke: int32 is "int"
on non-x86, not "long", and so this generated an undefined symbol
error on ARM.

The best solution seems to be to make StartMenuBar merely protected,
and then make a subclass where it is fully public to call it.
This is a lot less fragile (and much less ugly.)

Change-Id: I0519d0d9eeb1cc4523d0c6dd4fdfe8688ed1092c
Reviewed-on: https://review.haiku-os.org/c/1516
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>
2019-06-17 11:49:48 +00:00
Adrien Destugues
f74f860085 BitmapButton: move from WebPositive to libshared
Remove a currently unused copy of it from HaikuDepot.

Change-Id: Idb97fae8e7190da6bc1049b3c1f1df929ea91bab
Reviewed-on: https://review.haiku-os.org/c/1506
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2019-06-16 14:51:01 +00:00
Augustin Cavalier
4d0fd41d24 kernel/lock.h: Reorder function declarations so the comment is correct. 2019-06-15 12:14:49 -04:00
Augustin Cavalier
03c14d2989 stdlib.h: Add noreturn attribute to exit and _Exit.
Fixes #15110.
2019-06-15 12:14:06 -04:00
Augustin Cavalier
3ca2e85bfd Interface: Add casts to memcpy/memset invocations on BPoint & BRect.
Their copy constructors are exactly what GCC would generate,
but we can't remove them because doing so would make them
trivially copyable, and so they would be passed in registers
on x86_64, an ABI breakage.

So instead we have to add explicit casts to void* here.
2019-05-24 16:10:13 -04:00
Augustin Cavalier
1705656eac Add (void*) casts to memcpy/memset invocations to appease GCC 8.
A lot of these classes are not *technically* "trivially copyable"
for one reason or another, but in all of these cases it seems
OK to me to use memcpy/memset on them. Adding a cast to void*
tells GCC that "I know what I'm doing here" and shuts up the
warning.
2019-05-24 14:21:37 -04:00
Augustin Cavalier
7a73df5e2c Debugger: Remove needless explicit copy constructors.
These worked in identical fashion to what the default copy
constructors would be, but their mere presence marks the class
as being "non-trivially copyable," which means that memcpy'ing
it is now a -Werror on GCC 8.

We have to be careful when making this change, though: classes
which *are* trivially copyable can be passed inside registers
on x86_64, so changes like these break ABI in a dangerous way.
These classes is private, so it should not be a problem, but
for other classes (e.g. BRect, BPoint) we cannot fix them
properly right now.
2019-05-24 14:17:02 -04:00
Jérôme Duval
38ce902686 posix: add posix_fadvise(), only error checks.
should help for ports.

Change-Id: Id504bdb79cb68db4b615f58848e0e1a86ced8d2b
Reviewed-on: https://review.haiku-os.org/c/1467
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>
2019-05-21 15:07:43 +00:00
Adrien Destugues
66cb2efaa8 Move StripeView to libshared
Change-Id: Ib8ff2f731f9d34e04854f1c2ec288a3db1036793
Reviewed-on: https://review.haiku-os.org/c/1458
Reviewed-by: Rene Gollent <rene@gollent.com>
2019-05-21 06:55:45 +00:00
Augustin Cavalier
33f7f28798 kernel & runtime_loader: Don't load from non-packaged when "Disable user
add-ons" is set.

Confirmed to fix #14361. It is finally possible to un-brick an install
with a bad system library in non-packaged without having to use another
install to do so.

Change-Id: Iafea7821f02cb34e77c766b1f97d1c19206b1081
Reviewed-on: https://review.haiku-os.org/c/1452
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>
2019-05-20 14:08:28 +00:00
Augustin Cavalier
69712d5c00 OS.h: Reorder includes alphabetically. 2019-05-19 12:37:14 -04:00
Augustin Cavalier
218a8c03cb Revert the Codec Kit.
All of Barrett's individual reverts have been squashed into this
one commit, save a few actual bugfixes.

Change-Id: Ib0a7d0a841d3ac40b1fca7372c58b7f9229bd1f0
2019-05-17 14:43:32 -04:00
Calvin Hill
6ee7bb4f7b cpu_type.h: Allow cpu_type functions to be accessible from C.
This allows cpu_type.h to be used in C-based software,
with the get_cpu_*() functions all accessible via C as well
as C++ code.

Tested changes with sysinfo, AboutHaiku and Pulse.

Change-Id: Ide87d8e3f2ba5f0f1890f385b1ac90c677bcc274
Reviewed-on: https://review.haiku-os.org/c/1453
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2019-05-16 17:07:38 +00:00
Jérôme Duval
89f1fd6512 Bump gutenprint version.
needs gutenprint8 packages to be uploaded.

Change-Id: I1204ff8b1bb85cc0eb615082b205280daabbc290
Signed-off-by: Augustin Cavalier <waddlesplash@gmail.com>
2019-05-14 19:11:41 -04:00
Jeroen Oortwijn
72f7f7d976 USB_hid.h: Add Report Type constants
From "Device Class Definition for Human Interface Devices (HID)
Ver. 1.11", par. 7.2.1, page 51.

Change-Id: I4628f8ca940758aaf4a09290e9fa407d30374e7a
Reviewed-on: https://review.haiku-os.org/c/1450
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2019-05-14 07:24:09 +00:00
François Revol
629397f222 Add basic support for loading ControlLook add-ons
app_server just passes the add-on path around.

Maybe we should make sure the add-on can be loaded when setting it.

Change-Id: I3acd3299782a22c1666bd5435dbf3d8053e359fa
Reviewed-on: https://review.haiku-os.org/c/1430
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2019-05-13 22:15:30 +00:00
Murai Takashi
0ecfc6f3e3 Added some support for GCC 9.
Change-Id: I6b6cd53e00601592b44e1f2aa2804c8c9c9593d9
Reviewed-on: https://review.haiku-os.org/c/1438
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>
Reviewed-by: Stephan Aßmus <superstippi@gmx.de>
2019-05-07 23:07:17 +00:00
Augustin Cavalier
c2cbf95810 kernel: Add and fix ownership checks in mutex_destroy and mutex_transfer.
* mutex_destroy() only checked wether or not there were waiters,
   not if the lock itself was presently held by another thread.
   Now we do, which should make #15015 panic much earlier instead
   of trying to use freed memory.
 * mutex_transfer_lock() and recursive_lock_transfer_lock() did
   not check that the calling thread actually owned the lock.
   Now it does, which should trigger asserts if anyone tries
   to do this.
2019-05-02 16:07:39 -04:00
Alexander von Gluck IV
d117379205 posix/if_types.h: Remove IFT_IEEE1394, breaks build
* Sneaky ifdef in libnetwork/netresolv/irs
* Sorry for spam.

Change-Id: I241d65b63d0bb8b281e3db0adcad2814b1476c7e
2019-04-22 13:21:50 -05:00
Alexander von Gluck IV
db3b4a3caf posix/if_types.h: Fix tun id, add a few more
* Oops, there's a standard for these. Stick to the standard.
* Add a few that could be useful someday.
* Mention iana spec.

Change-Id: I4cf75e8c1e4b25f65d10921c7075fbd53f44e14e
2019-04-22 13:06:04 -05:00
Alexander von Gluck IV
612c05bd76 network/tun: Style fixes; no functional change 2019-04-17 19:24:19 +00:00
Alexander von Gluck IV
64948daae8 tun/tap: Build fixes for tun add-on 2019-04-17 14:12:59 +00:00
François Revol
23901a75de Stub out a tun/tap module from the loopback code
Not functional yet.

Change-Id: I6f7427c5fa176595927d73dd3b11b04945f66d84
2019-04-17 14:12:59 +00:00
François Revol
b110fce124 Add sources for my original BeOS BONE tun/tap config driver
as a starting point.

Change-Id: I9c3b1027a7fda4ab1eaced486eb2455a19571fee
2019-04-17 14:12:59 +00:00
Jérôme Duval
02f7c69828 TranslationErrors.h: document as deprecated.
TranslationDefs.h: SupportDefs.h already includes Errors.h, remove TranslationErrors.h.
2019-04-15 20:45:19 +02:00
Augustin Cavalier
f1fafe317f kernel/OS.h: Include sys/types.h instead of pthread.h.
This avoids polluting the namespace significantly. Also adjust
all files which depended on this behavior to include pthread.h
directly.
2019-04-12 15:26:25 -04:00
Les De Ridder
e982a0b217 btrfs: make file system name consistent
Change-Id: I5276be636875809f78201cb6274d64499252de73
Reviewed-on: https://review.haiku-os.org/c/1394
Reviewed-by: Stephan Aßmus <superstippi@gmx.de>
2019-04-09 12:03:12 +00:00
Alexander von Gluck IV
40fcf16358 kernel/riscv64: Add missing kernel_arg ranges to get build going.
Change-Id: Idf549a5e4d01e6dc8949ec1252296337e5ef970c
Reviewed-on: https://review.haiku-os.org/c/1380
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>
2019-04-05 14:29:23 +00:00
Alexander von Gluck IV
e0ec8de753 kernel/riscv64: ATOMIC64 FUNCS are not syscalls
Change-Id: I8696939ec2fab6f3960a9a41f0b5c9fcd6949760
Reviewed-on: https://review.haiku-os.org/c/1379
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>
2019-04-05 14:29:23 +00:00
PulkoMandy
fea91fdc77 sparc: pci bus manager
Copied from PPC with the hooks for Apple hardware removed.
To be completed with the actual PCI bus implementation for Sun machines.
This is where we start doing machine specific stuff, apparently.

Change-Id: I06af4de9621e9d40593d153642478d928083e49a
Reviewed-on: https://review.haiku-os.org/c/1364
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2019-04-04 20:31:25 +00:00
PulkoMandy
e8f58ba4be sparc: fix bootloader build
- Add various missing jamfiles
- Add required implementation stubs
- Update openfirmware jamfiles for multiboot support
- Update linker rules for sparc loader

Change-Id: I2d06c7a4d33827f58d82946687003f9a0dcb1b7d
Reviewed-on: https://review.haiku-os.org/c/1329
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2019-04-04 20:31:25 +00:00
Alexander von Gluck IV
566e253f24 kernel: Fill remaining riscv64 architecture headers 2019-04-04 09:09:49 -05:00
Alexander von Gluck IV
5e06ebe141 kernel/arch/riscv64: Correct some architecture headers 2019-04-04 09:09:38 -05:00
Alexander von Gluck IV
45b21f00ce riscv64: Drop duplicate KERNEL_LOAD_BASE 2019-04-04 09:09:34 -05:00
Alexander von Gluck IV
c59cde3d69 riscv32: Drop any remaining mentions
* I added this early on, but to be honest, any interesting
  workstation class hardware would be riscv64.
* Since riscv32 is mostly embedded or low power, just drop.

Change-Id: Id36274c882c46e766268f2ab53eb1bd5f95227be
Reviewed-on: https://review.haiku-os.org/c/1352
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>
2019-04-04 13:23:32 +00:00
Alexander von Gluck IV
382c3f6e0c headers/config: Fix RISCV64 define typoed to 32
Change-Id: I20890218f5edd279ab1080432a4d91f5a7f64dee
2019-04-02 14:46:28 -05:00
Augustin Cavalier
454b04ca27 HaikuConfig: Change _BEOS_COMPATIBLE_TYPES to only be defined on i386.
Hopefully soon we will have our first 32-bit non-x86 architectures.
No functional change for x86 32- and 64-bit intended.
2019-03-30 16:57:05 -04:00
Augustin Cavalier
5ffbe7d778 Change all references to "__INTEL__" to "__i386__".
They are functionally identical, but the former is a BeOS/Haiku-specfic
macro that we include in the compiler specs, and the latter is defined
by GCC.
2019-03-30 16:54:01 -04:00
Augustin Cavalier
b357daa5c5 build: Deprecate SetSubDirSupportedPlatformsBeOSCompatible.
By default, all targets support the "haiku" platform, and we no longer
support building for BeOS, Dan0, Zeta, or other BeOS-compatible targets,
so this is no longer needed.

Also remove all references to the non-Haiku compatible platforms, and
change all BEOS_COMPATIBLE checks to HAIKU_COMPATIBLE. Removal of
all SetSubDirSupportedPlatformsBeOSCompatible invocations
will be in the next commit.
2019-03-30 14:54:14 -04:00
PulkoMandy
8ff82ee2d4 sparc: fix debug support
Declare and use the correct registers to define a stack frame.

Change-Id: Ice3ba8f8715313a715f6b1cb553a6883541f5cc4
Reviewed-on: https://review.haiku-os.org/c/1327
Reviewed-by: Alex von Gluck IV <kallisti5@unixzen.com>
2019-03-30 15:23:15 +00:00
PulkoMandy
3bfbec8336 sparc: More missing defines in platform headers
* Kernel is 64 bit, and we won't need a 32bit load base.

Change-Id: I729bab01c8f71083002db061e153b0e5052b9a1c
Reviewed-on: https://review.haiku-os.org/c/1326
Reviewed-by: Alex von Gluck IV <kallisti5@unixzen.com>
2019-03-30 15:23:15 +00:00
Augustin Cavalier
569791be52 headers/posix: Define the byteswap macros unconditionally.
It helps if one tests GCC4+ fixes on GCC4+...
2019-03-27 10:19:50 -04:00
Augustin Cavalier
8e309168b9 headers/posix: Use separate naming for the byte-swap macros.
This avoids a compile error on GCC4 when ByteOrder.h is included
after it.
2019-03-27 00:25:34 -04:00
Augustin Cavalier
6d5e91f0c9 headers/posix: Make casts in netinet byteswap functions uniform. 2019-03-26 22:31:33 -04:00
Augustin Cavalier
fcf0b31fb9 bootloader: Add the network endianness macros to NetDefs.h.
This file contains all the protocol- and interface-related
definitions, so this seems to be where they belong.

Required following previous commits.
2019-03-26 21:51:42 -04:00
Augustin Cavalier
fb52ab82d2 Minor tweaks to fix the build after the last commit.
* firewire and freebsd_network expect the macros come from
   sys/param.h, as this is one of the places FreeBSD defines them
 * All others are Haiku-native and can use Be-style macros.
2019-03-26 20:06:09 -04:00
Augustin Cavalier
9cb15d72bd netinet/in: Use the GCC4 builtin byteswap functions for htonl.
Fixes the build breakage caused by PulkoMandy's recent commit.
Remove these from ByteOrder.h now also, as per POSIX they should
come from netinet/in.h.

This is a small source compatibility breakage, but it will only
affect a small portion of non-POSIX, partially-Be applications.
2019-03-26 19:33:43 -04:00
Augustin Cavalier
204ec4dec6 build: Use the main ByteOrder.h.
The only differences between the two were whitespace and then the
GCC4 builtin byteswap functions.
2019-03-26 19:13:01 -04:00
Augustin Cavalier
d15fda2c7e build/BeBuild.h: Throw an error if the compatibility headers are not included.
If this triggers, it means something is using the "build" errors while
the build system thinks it is not, which is always an error. Nothing
triggers this at present, but some subtle bugs in the build system
a while back would have been caught by this.
2019-03-26 18:59:42 -04:00
Andreas Faerber
e1b41d44a3 boot loader: Wire up net_stack_cleanup()
Add a platform cleanup hook before starting the kernel. The openfirmware
and PXE loaders clean up their network stack there, while the other
loaders currently do nothing.

This closes ticket #6166

Change-Id: I34765892dfd9b2310c6af97c9ff7d414afae49e5
Reviewed-on: https://review.haiku-os.org/c/50
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2019-03-26 20:25:19 +00:00
Alexander von Gluck IV
c085f38639 riscv64: Fill in more bulk architecture items around libroot/kernel
Change-Id: Ia2a86d8814d06950ea2d2d19d966c642d26f81d6
Reviewed-on: https://review.haiku-os.org/c/1302
Reviewed-by: Alex von Gluck IV <kallisti5@unixzen.com>
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>
2019-03-25 17:16:03 +00:00
CodeforEvolution
e2c7bb900c Add Reboot Check to BPackageRoster
A bit of an explanation for these weirdly named functions:
LatestActivePackageInfos() returns the packages on the system that are
both installed and fully set up. When packages are in the middle of being
installed, LatestInactivePackageInfos() shows the packages in the process
of being installed. Once the installation process is done,
LatestInactivePackageInfos() returns nothing. If there are packages that
can't be fully activated without a reboot, CurrentlyActivePackageInfos()
will return the same information as LatestActivePackageInfos(), or if
everything has been installed and activated, it will return no packages.

Change-Id: Ia1814a5abda6d815c46e0b46dc812b4e7af81de3
Reviewed-on: https://review.haiku-os.org/c/1129
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>
2019-03-18 14:10:42 +00:00
Augustin Cavalier
d3f27239b1 bus: Remove IDE.h and change ATA bus manager paths. 2019-03-13 11:34:13 -04:00
PulkoMandy
f42cda29e8 sparc: get libroot to build
Add various stubs to fix undefined references. No implementation for
anything yet.

Change-Id: I2d398bc2369d099e3a35f0713058d6a5edc6801d
Reviewed-on: https://review.haiku-os.org/c/1138
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2019-03-10 20:57:18 +00:00
PulkoMandy
eea7ceb31d Add BytePointer to help with pointer conversions
This behaves mostly like a pointer, but pointer maths works in bytes,
not the native object size.

It avoids casting to char* and back when doing byte-based pointer math,
making the code easier to read.

Change-Id: I6a8681a398345f0c7d419a2cfe7244d972ffa62f
Reviewed-on: https://review.haiku-os.org/c/1086
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2019-03-09 17:09:11 +00:00
Jérôme Duval
ba56d0a513 pthread: add pthread_getattr_np.
non standard extension, but widely available to obtain attributes for a thread.
also provides an alias for pthread_getattr_np which is the bsd equivalent.

Change-Id: I26ef8245ed2537186f48c8b8bdf3e42b03e70892
Reviewed-on: https://review.haiku-os.org/c/1172
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>
2019-03-08 19:50:45 +00:00
Jérôme Duval
901c3d44b0 pthread: implement pthread_attr_[get|set]stack.
remove pthread_attr_[get|set]stackaddr from unimplemented functions.

Change-Id: I58807e86c75a189a576639ae1b2e4505a63700a5
Reviewed-on: https://review.haiku-os.org/c/1152
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2019-03-07 16:55:14 +00:00
Jérôme Duval
9e1ce8ed92 kernel: tweak USER_SIZE.
Change-Id: Id0a4ad785bbd195e425dd32ca891dc4525bb3e18
Reviewed-on: https://review.haiku-os.org/c/1151
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2019-03-05 22:38:49 +00:00
Augustin Cavalier
ee735d1b33 PackageKit: Fix BPackageInfoAttributeValue::Clear for GCC2.
These are simple structs, so hopefully GCC8 will be OK with us
memsetting them. We can't use the standard = {} route because
GCC2 does not support that.
2019-03-03 17:04:22 -05:00
Murai Takashi
752ec5c625 Package kit: Fix -Werror=class-memaccess
Initialize each class members instead of memset()
for clearing PackageInfoAttributeValue.
Pointed out by gcc8.

Change-Id: I8bdb328e2271e49e840b1294dba9cca544805e72
Reviewed-on: https://review.haiku-os.org/c/1114
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2019-03-03 21:07:42 +00:00
PulkoMandy
a7c23bb4a9 kernel/arch/sparc: stubs to get the kernel to link
Add empty implementation of timer, elf, vm, debugger support, to let the
kernel link.

Also add the kernel linker script.

Change-Id: If0795fa6554aea3df1ee544c25cc4832634ffd78
Reviewed-on: https://review.haiku-os.org/c/1108
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2019-03-03 20:56:20 +00:00
PulkoMandy
c1566b1555 sparc: more platform headers
Previous commit adding these was merged very quickly, so here's one
more...

Change-Id: I23c424db7631db1f0ec48e2d0ae47c8409ae6af2
Reviewed-on: https://review.haiku-os.org/c/1088
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2019-03-03 20:56:20 +00:00
Niels Sascha Reedijk
d7b8d76a78 BSD headers: remove _BSD_SOURCE feature gate for sysexits.h
During the compilation of LLVM version 8, the build failed because it depends
on a constant in this file. In hrev49042 all BSD headers were feature-gated by
_BSD_SOURCE. This is not done (for this file) in glibc and (obviously) not in
BSD's libc.

Since this is not common practise, I would propose removing the feature gate
for this header file, as it would mean that we would have to upstream patches
for ports of other software that depends on the availability of these
constants.

Change-Id: I486f0c2e87eff489ce92d03589a6299ef1be6ca5
Reviewed-on: https://review.haiku-os.org/c/1144
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2019-03-03 20:49:19 +00:00
Alexander von Gluck IV
05dda88dc1 headers/riscv64: Implement basic arch headers
Change-Id: I6bfbacb61eae84ffebc30c2565683348d684d88f
Reviewed-on: https://review.haiku-os.org/c/1063
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>
2019-02-26 14:50:35 +00:00
Adrien Destugues
5629675a32 sparc: add defines and minimum set of required files
Gets the stage0 bootstrap to run.
Imlementation is probably nonsense at this point.

Change-Id: I10876efbb54314b864c0ad951152757cdb2fd366
Reviewed-on: https://review.haiku-os.org/c/1061
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2019-02-23 16:30:50 +00:00
Augustin Cavalier
86dfe1d9a8 BAffineTransform: Remove "register" storage class.
Long since deprecated, and compilers can figure this out on
their own now. Fixes a lot of errors in Clang.
2019-02-21 14:03:05 -05:00
Barrett17
83a69e16c5 MediaExtractor and MediaWriter fix constness
* Fixes an ugly hack, where the codec was initialized in the
InitCheck and prevented the method to be const too.
2019-02-21 17:43:11 +01:00
Barrett17
2caa4ec708 codec_kit: Fix build 2019-02-21 17:36:55 +01:00
Barrett17
662583b300 MediaStreamer: Extend API to support DVD navigation
* This is a general review of the code and includes a rework
 of the sniffing API.
2019-02-21 16:39:58 +01:00
Adrien Destugues
a6a6e3a842 Package kit: add likely-useful architectures
Required for bootstrapping them.

Change-Id: I179d8c73b08688946049bf18ff9151ef047e449b
Reviewed-on: https://review.haiku-os.org/c/1071
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2019-02-20 22:29:36 +00:00
Augustin Cavalier
01796e78f4 kernel/x86: Re-introduce the 1MB lower barrier.
It was removed in 2008 to make VM86 work, which is now gone.

Fixes #14911.
2019-02-20 15:37:06 -05:00
ahenriksson
8497a2cc28 vfs: functions to change a vnode busy status and ID
The kernel version is only partially tested.

Change-Id: I9a2f6c78087154ab137eadbced99062a8a2dd688
Reviewed-on: https://review.haiku-os.org/c/918
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2019-02-19 18:44:43 +00:00
Adrien Destugues
ff76d2df8e sdhci and mmc implementation
sdhci:
- Add semaphore for interrupt management
- Add basic operations (setting clock, executing a command)
- Add early initialization (clocks and power up)
- Wrap the bus in a C++ class to ease usage
- Expose API to MMC bus manager
- TODO: manage card insertion and removal interrupts
- TODO: use MSI when available

mmc_bus:
- Implements SD card management independant of the way we access the bus
  (later on different drivers can provide the same API as SDHCI)
- Worker thread to do the initialization
- Implement card initialization process up until getting an RCA from the
  card. This is the generic part to assign an ID to the card, after this
  point commands can be targetted at the specific card so it can be
  handed over to the mmc_disk driver.
- TODO: initialization for non-SDHC cards which do not reply to CMD8.

Change-Id: I71950ca3ce206378a68fa7f97c19f638183d6cdd
Reviewed-on: https://review.haiku-os.org/c/1032
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2019-02-19 18:33:25 +00:00
Augustin Cavalier
6b0251e1bd syscall_args: Remove R5 compatibility hack. 2019-02-17 13:06:49 -05:00
Barrett17
784c192df2 AdapterIO: Don't inclue RWLocker header in public file 2019-02-17 14:22:30 +01:00
Barrett17
303f574120 MediaPlugin: Use three decimals for plugin version
* That allow to manage minor and major versions.
2019-02-17 14:15:08 +01:00
Barrett17
eb6626e962 MetaData: Implement copy constructor 2019-02-17 11:54:10 +01:00
Barrett17
d0064da6a5 MetaData: Introduce missing keys 2019-02-17 11:54:09 +01:00
Barrett17
9ad840d86f MetaData: Correct doxygen brief 2019-02-17 11:54:09 +01:00
Alexander von Gluck IV
5ac9b50641 headers/riscv64: Fill out headers needed by buildtools
Change-Id: I131a44fbcf7b4f6471cc737cff40bd2966ec9764
2019-02-16 19:43:27 -06:00
Augustin Cavalier
b7598b65ba HashSet: Make iterator const.
Nothing that uses this API at present needs a const iterator (and
as far as I could see, nothing ever called Remove() on the iterator.)
But this is now how HashMap's API works, so let's be consistent.
2019-02-14 20:43:49 -05:00
Augustin Cavalier
759d502e32 HashSet: Fix the build with GCC 7. 2019-02-14 19:57:42 -05:00
Augustin Cavalier
fc8e5be1c8 HashMap: Fix the build with GCC 7. 2019-02-14 19:52:45 -05:00
Augustin Cavalier
de48af7a58 Adapt all consumers of HashSet and HashMap to the slightly-different APIs.
No functional changes intended. Tested and verified as working.

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

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

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

Change-Id: I18be044be7d5c6896295ed85d294abeea90b8bb0
Reviewed-on: https://review.haiku-os.org/c/1037
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>
2019-02-13 10:14:59 +00:00
Puck Meerburg
2f1a930a4a Fix CID 1255187, 1255202, 1255213, 1255260, 1255308
Change-Id: If2357dc8e6147b2f1983f646e4f3ba70195e59ff
Reviewed-on: https://review.haiku-os.org/c/85
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
Reviewed-by: Stephan Aßmus <superstippi@gmx.de>
2019-02-11 21:37:40 +00:00
Adrien Destugues
7232789211 Extract parse_size function from ramdisk command.
Change-Id: If7dd36321e1ed2feb20b4c76ddaf303bc997d8b7
Reviewed-on: https://review.haiku-os.org/c/1018
Reviewed-by: Jérôme Duval <jerome.duval@gmail.com>
Reviewed-by: Axel Dörfler <axeld@pinc-software.de>
2019-02-08 07:19:26 +00:00
Jérôme Duval
f33f4868fe posix_spawn: add posix_spawn_file_actions_add[f]chdir_np.
see http://austingroupbugs.net/view.php?id=1208
and https://sourceware.org/bugzilla/show_bug.cgi?id=17405

* also free paths in posix_spawn_file_actions_destroy().

Change-Id: I8bed848154025bd5a25322bdc4c25aa417f86ec6
Reviewed-on: https://review.haiku-os.org/c/1010
Reviewed-by: Rene Gollent <rene@gollent.com>
2019-02-06 16:39:33 +00:00
Jérôme Duval
af61539918 posix_spawn: add POSIX_SPAWN_SETSID.
see http://austingroupbugs.net/view.php?id=1044

Change-Id: I9ae4fe07ea0fa7e20eb9a1d8c64e971e7353bcff
Reviewed-on: https://review.haiku-os.org/c/1008
Reviewed-by: Rene Gollent <rene@gollent.com>
2019-02-04 19:21:30 +00:00
Augustin Cavalier
e5d0c9094d BView: Add a B_SCROLL_VIEW_AWARE flag.
* This indicates the view will manage whatever scrollbars are targeted
   to it.
 * Use _B_RESERVED7_ for this. It's been RESERVED since BeOS R5
   (I guess it was probably something on some older BeOS version?)
   and we don't really care about BeOS R4 ABI compatibility, so
   that should be fine.
 * Update BScrollView to not touch BScrollBar range/proportion
   when the target view has this set.
 * Update BListView to set this flag, always.

Fixes #14871.

Change-Id: I17027f3b63ef28da1e735c5393593496c415dce3
Reviewed-on: https://review.haiku-os.org/c/998
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>
2019-02-03 18:04:13 +00:00
Augustin Cavalier
3493fcb668 headers/kernel: Add argument names to initialization functions. 2019-02-02 18:10:54 -05:00
Augustin Cavalier
d65ffc926c libnetapi: Remove __gNetAPIStart.
Not used by anything.
2019-02-02 13:26:18 -05:00
Augustin Cavalier
c5e4e4ffb4 headers/kernel: Include declarations of initialization functions in image.h.
No "real" functional change, but this causes GCC7 to throw errors when
these functions are declared without the image_id argument, which
in some files they were (as this commit repairs.)

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

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

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

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

No functional change intended.
2019-02-01 19:20:25 -05:00
Rob Gill
434c347111 headers/libs/agg Fix PVS 33
* Fix successive assignment of 'da'

	* also trailing whitespace removal

Change-Id: Ic127150c18c042839d4104ccc5830adf19550399
Reviewed-on: https://review.haiku-os.org/c/954
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2019-01-29 04:04:01 +00:00
Rob Gill
d1f885b435 headers/libs/agg Fix PVS 11, PVS12
* Replace hard-coded math constants with M_SQRT1_2
	(math.h was already included)

	* also trailing whitespace removal

Change-Id: I5e9511060d2f812830f7621bee3aff9a517576e5
Reviewed-on: https://review.haiku-os.org/c/956
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2019-01-29 04:02:25 +00:00
Alexander von Gluck IV
cf77ef1857 haiku_loader: Toss iSCSITarget, add TCP stack to loader.
* This iSCSI implementation only worked on PPC big-endian atm.
* We're pretty sure iSCSI support in haiku_loader doesn't make
  much sense anymore. iPXE on (on arm,x86,etc EFI/BIOS platforms)
  supports iSCSI boot of disks.
* Haiku could use a iSCSI driver add-on, but it would exist much
  higher up and likely use standard drivers vs bare-minimum iSCSI
  target impementations.
* Leaving TCP and adding to all arches since it could make sense
  for haiku's native network disk subsystem or network debugging?

Change-Id: Ic181b93a1d8ffd77f69e00e372b44b79abbddb42
Reviewed-on: https://review.haiku-os.org/c/899
Reviewed-by: Alex von Gluck IV <kallisti5@unixzen.com>
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2019-01-28 16:47:08 +00:00
Augustin Cavalier
4854630d29 BScrollView: Resize scrollbars dynamically based on target's B_SUPPORTS_LAYOUT...
...instead of the BScrollView itself's layout flag. Thanks to Adrien and
Kacper for discussion on the mailing list.
2019-01-27 14:35:32 -05:00
Adrien Destugues
1322d50732 HttpRequest: write whole request to socket
Better performance by using a single write, and some servers may not be
happy about getting so many TCP fragments for the HTTP header.

Change-Id: If7139e2a7748ea423d470676e70bd523a89031b2
Reviewed-on: https://review.haiku-os.org/c/909
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2019-01-27 07:55:55 +00:00
Fredrik Holmqvist
9edb207fab Fix for bug 6991, replace registrars timer tick
Registrar schedules an event every second to do
fRoster-CheckSanity(). This uses 2.5% cpu on my machine
when idle. Changing it to five seconds lowers it to 0.1%

waddlesplash then pointed me to this bug which changes it
to watch for team deletion and call fRoster->CheckSanity()

As I know little in this area, it's mostly based on what
LaunchDaemon does in MessageRecieved.

Change-Id: Ie69f9399cab41d2d492d469b5d3dc88e6080c15c
Reviewed-on: https://review.haiku-os.org/c/876
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2019-01-24 18:57:50 +00:00
Augustin Cavalier
2502d45aca BTabView: Change layout constructor to default to B_WIDTH_FROM_WIDEST.
This seems to fit the "spirit of layout" better.

Change-Id: I7a75b58de4c9f703d828cdd292b7b91ee720c135
Reviewed-on: https://review.haiku-os.org/c/891
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2019-01-24 18:52:39 +00:00
Augustin Cavalier
a4f5124fcc Media Kit: Rewrite DefaultMediaTheme to use layouts.
The old fixed-rect method was very error-prone in corner-cases,
resulting in half-visible (cut off) parameters, incorrectly
sized controls, etc. on various devices, which often made it
impossible to use.

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

Fixes #11592 and related tickets.

Change-Id: I65175f760bda98e42d1fc68ba8e526470bf17c25
Reviewed-on: https://review.haiku-os.org/c/889
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>
2019-01-22 14:25:09 +00:00
Leorize
b9c25b0d0e unistd: introduce nice()
This commit implements nice() as specified in POSIX.1-2008.

Fixes #4932.

Change-Id: Ibd8d4636d9e3a8adf0f26a081d5b1180f0cbb839
Reviewed-on: https://review.haiku-os.org/c/863
Reviewed-by: Jérôme Duval <jerome.duval@gmail.com>
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2019-01-19 18:31:58 +00:00
Timothy Gu
8ae2e95643 libroot: add [gs]etpriority implementation
Implemented against POSIX-1.2013.

The implementation POSIX requirement thats setpriority() shall affect the
priority of all system scope threads only extends to POSIX threads. This
is implemented by modifying the default attributes for newly spawned
pthreads.

It is not possible to modify the default pthread attributes for different
processes with the current implementation, as default pthread attributes
are implemented in user-space. As a result, PRIO_PROCESS for which and 0
for who is the only supported combination for setpriority().

While it is possible to move the default attributes to the kernel, it
is chosen not to so as to keep the pthread implementation user-space only.

POSIX requires that lowering the nice value (increasing priority) can be
done only by processes with appropriate privileges. However, as Haiku
currently doesn't harbor any restrictions in setting the thread priority,
this is not implemented.

It is possible to have small precision errors when converting from Unix-
style thread priority to Be-style. For example, the following program
outputs "17" instead of the expected "18":

	#include <stdio.h>
	#include <sys/resource.h>

	int
	main()
	{
		setpriority(PRIO_PROCESS, 0, 18);
		printf("%d\n", getpriority(PRIO_PROCESS, 0));
		return 0;
	}

The underlying reason is because when you setpriority() both 18 and 19
are converted to the Be-style "2". This problem should not happen with
priority levels lower than or equal to 20, when the Be notation is more
precise than the Unix-style.

Done as a part of GCI 2014. Fixes #2817.

Signed-off-by: Timothy Gu <timothygu99@gmail.com>
Co-authored-by: Leorize <leorize+oss@disroot.org>
Change-Id: Ie14f105b00fe8563d16b3562748e1c2e56c873a6
Reviewed-on: https://review.haiku-os.org/c/78
Reviewed-by: Jérôme Duval <jerome.duval@gmail.com>
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2019-01-19 18:31:58 +00:00
Fredrik Holmqvist
ffbedf6088 Revert "Fix for bug 6991, replace registrars timer tick"
Unintentional commit, still not used to gerrit things

This reverts commit a02e4534f5.
2019-01-16 21:17:48 +01:00
Fredrik Holmqvist
a02e4534f5 Fix for bug 6991, replace registrars timer tick
Registrar schedules an event every second to do
fRoster-CheckSanity(). This uses 2.5% cpu on my machine
when idle. Changing it to five seconds lowers it to 0.1%

waddlesplash then pointed me to this bug which changes it
to watch for team deletion and call fRoster->CheckSanity()

As I know little in this area, it's mostly based on what
LaunchDaemon does in MessageRecieved.
2019-01-16 21:13:04 +01:00
Adrien Destugues
5f603da01a Better shape for submenu arrow
Just use BControLook where appropriate. It already provides a nice arrow
drawing function (also used in DeskBar expander and in scrollbar
buttons).

Fix second part of #8900

Changes by John Scipione:

Update menu mark and submenu arrow color with menu text color

Use text color for checkmark and submenu arrow colors, tint less black.
This means that colored bg/white text menu item will also draw a white
checkmark and submenu arrow.

Break out BMenuItem::Draw functionality into private methods _IsActive,
_LowColor() and _HighColor() methods and use them to set the mark colors.

Scale submenu arrow and checkmark with item height (which scales with
font size.)

does not align shortcuts with submenu arrows... but if you were to do
that you'd add item->Bounds().Height() / 2.

Signed-off-by: John Scipione <jscipione@gmail.com>

Change-Id: I8299094ef88bf227510b116eb1b84c261dc94723
Reviewed-on: https://review.haiku-os.org/c/341
Reviewed-by: Stefano Ceccherini <stefano.ceccherini@gmail.com>
Reviewed-by: Axel Dörfler <axeld@pinc-software.de>
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2019-01-14 15:59:57 +00:00
Murai Takashi
647b5a29e9 utf8_functions.h: Fix PVS 359
Fix integer constant SIZE_MAX is converted to pointer.

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

Change-Id: Ia0f23e7b1cd058f70f76a5849acb2d02e0f0da09
Reviewed-on: https://review.haiku-os.org/c/817
Reviewed-by: Stephan Aßmus <superstippi@gmx.de>
2019-01-06 00:06:56 +00:00
Rob Gill
6086986d30 kernel/x86: additional msr and cpuid items
Adds SSBD and L1TF related items

Change-Id: Iccea2bb9e057e0d011a18609212f175f9b5e678d
Reviewed-on: https://review.haiku-os.org/825
Reviewed-by: Adrien Destugues <pulkomandy@pulkomandy.tk>
2019-01-04 19:06:05 +00:00
Barrett17
e7933432e9 BCodecRoster: Remove MakeFormatFor
* I want to introduce a new way for plugins to
register for a format. Supporting the old FormatManager is
too painful at this point and not worth the effort.
2018-12-28 23:01:02 +01:00
Barrett17
fa911df6e6 Move FormatManager back to the media_kit
* We don't aim to replicate this functionality. I don't
think this will be useful at all in future iterations.
Originally I planned to rewrite it on top of the new
BMediaFormat, but now I am of the hopinion this is
greatly unneeded.
2018-12-28 22:55:25 +01:00
Barrett17
708de94fde MetaData: Add doxygen brief 2018-12-28 22:24:07 +01:00
Barrett17
e98351d3bc MetaData: Revert types to uint32 and define framerate as float
* Adds some missing methods signatures.
* integer vs float framerate is a longstanging debate. In theory,
in digital a/v there should not be need for floating point framerates.
This is because unless the software is run on exoteric hardware, there
is not need for it. Unfortunately, some legacy from the past like the
29.7 hz debate (NTSC) still may need to work under floating point framerates.
Even if in pratice it'd be run at 30 hz anyway.
* In theory, to handle all those correctly we should use a rational framerate,
however most code should be rewritten to support that correctly, and
it'd add some excessive complexities.
* All integer types are reverted back to unsigned ones. There's really
no reason to use signed integers there, and more importantly the danger
for integer underflows and the attached security concerns is very big.
2018-12-27 12:26:45 +01:00
Michael Lotz
13beda00d3 kernel: Fix race condition when waiting for load of new team.
There was no synchronization of the check of the done flag and the
waiting thread suspending to wait for it. It was therefore possible that
the new team both set the flag and triggered the wakeup of the waiting
thread in that time window, causing it to miss both the set flag and the
thread resumption.

Use a condition variable instead.

Fixes #13081.

Change-Id: I93c45db8dd773fe42b45c4b67153bcd39e200d3b
Reviewed-on: https://review.haiku-os.org/803
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2018-12-26 23:48:41 +00:00
Barrett17
30d69e3f5e BMetaData: Add missing stuff to describe a media format
* We will need those for BMediaFormatBuilder.
2018-12-26 12:34:44 +01:00
Michael Lotz
e4103b1b92 libroot: Introduce thread specific heap init/exit hooks.
This allows heap implementations to initialize and clean up any thread
specific structures. The current default hoard heap does not use these.

Note that the thread exit hook will not be called for the main thread as
the heap may be needed during process termination (__cxa_finalize for
example).

Change-Id: I703fbd34dec0d9029d619a2125c5b19d8c1933aa
Reviewed-on: https://review.haiku-os.org/799
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2018-12-25 23:00:20 +00:00
Augustin Cavalier
da31c58577 shared/locks: Add RecursiveLocker.
Copied from the kernel version.
2018-12-17 19:51:45 -05:00
Augustin Cavalier
a41ed241d9 headers/compatibility: Re-add missed _BSD_SOURCE guards to vis.h 2018-12-16 21:01:03 -05:00
Augustin Cavalier
324336d1ed libbsd: Update vis and unvis from FreeBSD.
Fixes #11061.
2018-12-16 18:32:55 -05:00
Augustin Cavalier
08858e10fa kernel_cpp: Don't import all of the "std" namespace.
This file is included, directly or indirectly, by most of the
kernel-space C++ code, and so importing the entirety of "std"
seriously pollutes the global namespace.

So instead, just import "std::nothrow", which is the only thing
we really want in the global namespace. Tested on both GCC2
and GCC7 and seems to work just fine.

While I'm here, also update the include guards and copyright
header to match the standard format used elsewhere.
2018-12-10 19:44:07 -05:00
Augustin Cavalier
6b83d77fb7 smp: Make {acquire|release}_read_seqlock_inline cast explicitly.
Also fix braces.
2018-12-09 23:01:42 -05:00
Augustin Cavalier
86c12bf05b kernel: Initialize all fields of rw_lock in RW_LOCK_INITIALIZER.
Spotted by Clang.
2018-12-09 23:01:11 -05:00
Augustin Cavalier
5dd66afb7d headers: Remove some extra semicolons.
Spotted by Clang.
2018-12-09 23:00:47 -05:00
Murai Takashi
e28abad762 userlandfs: Fix -Werror=parentheses
Remove unnecessary parentheses in declaration of pointers.
Pointed out by gcc8.

Change-Id: I6f56b12349b6c8433f7ce237f5ce5d7af45bf103
Reviewed-on: https://review.haiku-os.org/750
Reviewed-by: Adrien Destugues <pulkomandy@pulkomandy.tk>
Reviewed-by: Skipp_OSX <jscipione@gmail.com>
2018-12-04 20:46:43 +00:00
Adrien Destugues
151343ebc8 BLooper: API to hijack existing thread.
I need this to use loopers in WebKit, which spawns threads and expects
to be able to turn them into event loops later on.

This is the pattern already used in BApplication, we may as well make it
available elsewhere.

Change-Id: I5939ca89d33cb3bcc92567b302c2038d976af598
Reviewed-on: https://review.haiku-os.org/735
Reviewed-by: Axel Dörfler <axeld@pinc-software.de>
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2018-12-02 21:36:31 +00:00
Murai Takashi
4c5e5d8b04 tools/locale: Fix using auto_ptr to array.
Use BStackOrHeapArray instead of using auto_ptr to array.

Change-Id: I171cb002829c36ec51ba7d1e387869263e2a40f2
Reviewed-on: https://review.haiku-os.org/745
Reviewed-by: Adrien Destugues <pulkomandy@pulkomandy.tk>
2018-12-02 21:31:26 +00:00
Barrett17
b6802a9530 MetaData: Remove support for uint32 keys
* We try to conform to what ffmpeg does, it is
unuseful to support metadata keys formats which
aren't really used anywhere.
* Add TODO with some infos for future improvements.
2018-12-01 12:30:54 +01:00
Barrett17
a57cf128a6 Codec Kit: Introduce declarative macro with version and name
* Namespaces protect symbols, I didn't consider that when adding
the BCodecKit namespace, so, the AddOnManager complained that
instantiate_plugin() was missing. A macro is introduced that allow
plugins to specify it's className, version and name, this ease
the declaration of the plugin symbols, otherwise the function
should have been declared inside the BCodecKit namespace which
we would like to avoid.
* The code is also more future proof, since in future the AddOn manager
can begin to check for plugin versions.
2018-12-01 11:19:12 +01:00
Murai Takashi
f0a1a07c73 RegionSupport: Fix PVS 338-346
Fix 'true / false' value is implicitly cast to the integer type.

Change-Id: I2f72fcd34d2d97d20e2a98ed5efe25919a485c9d
Reviewed-on: https://review.haiku-os.org/739
Reviewed-by: Jérôme Duval <jerome.duval@gmail.com>
2018-11-30 21:13:14 +00:00
Barrett17
36f94d9e39 Move RawFormats.h to Codec Kit
* This should be probably uniformed with the future
media kit format defs. Not sure why those formats are
separated and used only by the codec kit. Eventually,
if needed can be changed to some name that differentiate
them better than media defs.
2018-11-29 08:06:34 +01:00
Barrett17
278d03da22 media_kit: Remove most private dependencies from codec_kit
* Move to BCodecKit namespace and make extensive use
of BCodecRoster.
* This is a first step in the right direction of
decreasing private dependencies. Some APIs are being
translated to the CodecKit. I am doing an investigation
on which APIs are really used among apps, so that the new
kit can be more slim and oriented toward easy development
and can be extended in the right direction instead to
continue maintaning unuseful code.
* BMediaFormats needs still a bit of love.
* General improvements in style and code maintainability.
2018-11-27 11:38:05 +01:00
Barrett17
fe9542fdb5 BCodecRoster: Add useful functionality from MediaFormats 2018-11-27 11:38:05 +01:00
Barrett17
d33bd9ec7b Codec Kit: Introduce BCodecKit namespace 2018-11-27 11:38:04 +01:00
Nathan Sashihara
247414814e Fix IN6_IS_ADDR_V4MAPPED & IN6_IS_ADDR_V4COMPAT false positives
Change-Id: I71af73718667b800c416e47203f8b9924a1096c4
Reviewed-on: https://review.haiku-os.org/733
Reviewed-by: Rene Gollent <rene@gollent.com>
2018-11-27 02:43:53 +00:00
Barrett17
f20ff4faec CodecRoster: Add GetDecoderInfo 2018-11-26 07:41:27 +01:00
Barrett17
1b96c34179 ChunkProvider/ChunkWriter: Move method to protected
* Remove inline destructor.
2018-11-25 14:07:46 +01:00
Barrett17
ee09c29148 Media Kit: Update private code 2018-11-25 13:02:02 +01:00
Barrett17
be805d02d7 Codec Kit: Rename classes to BFoo pattern 2018-11-25 13:02:02 +01:00
Barrett17
082e4ae4a7 Codec Kit: Rename files 2018-11-25 13:02:02 +01:00
Augustin Cavalier
ef593f61a2 ELF: Ignore PT_EH_FRAME and PT_STACK.
This allows Clang builds (linked with our cross binutils) to
at least start runtime_loader and then try to load launch_daemon.
That fails with an infinite loop somewhere...
2018-11-24 21:08:31 -05:00
Augustin Cavalier
807304b100 build: Add basic support for MinGW hosts.
This doesn't fully work yet (the FS code in libroot_build
needs to be adapted, as some of the symlink-related calls
are not available on MinGW), but it gets much further than
the "Cygwin" target did.
2018-11-23 16:24:25 -05:00
Augustin Cavalier
37c106060a build: Remove support for cross-building from Cygwin and SunOS.
These have been broken for a long time. Some Cygwin changes that
are relevant on MinGW are kept here, but users on Windows who
want to build Haiku should probably use WSL at this point.

However, now that we are using relative paths and don't need
to worry about drive path kludges, it's actually possible to
get some host tools built on MinGW. Changes for that coming.
2018-11-23 15:40:50 -05:00
Barrett17
44fc903a8f Codec Kit: Introduce BCodecRoster
* This class include almost everything you need to
manage codecs and iterate over them.
2018-11-22 17:41:26 +01:00
Barrett17
f5a452910a Codec Kit: Add some TODO for the future
* Little beauty fixes included.
2018-11-22 09:48:04 +01:00
Barrett17
06b088bd62 Streamer: Make constructor private 2018-11-22 09:47:12 +01:00
Barrett17
f40547016d Encoder: Make constructor private 2018-11-22 09:47:12 +01:00
Barrett17
c09a589891 Decoder: Make constructor protected 2018-11-22 09:47:12 +01:00
Barrett17
a741fb49a6 Writer: Make constructor and Init protected 2018-11-22 09:47:12 +01:00
Barrett17
75b5f33c19 Reader: Make constructor protected 2018-11-22 09:47:11 +01:00
Barrett17
af34e7abcc Codec Kit: Beauty fixes 2018-11-22 09:47:11 +01:00
Barrett17
608c9d9ae1 Codek Kit: Introduce BMetaData in Writer/MediaWriter
* Remove SetCopyright as well.
2018-11-21 17:22:58 +01:00
Barrett17
3e8f721b3b Codec Kit: Introduce BMetaData in Reader/Extractor
* Remove superfluous Copyright method.
2018-11-21 16:55:02 +01:00
Barrett17
9bbd53a288 BMetaData: Add missing functionality
* Add more metadata keys needed to support ffmpeg.
* Implement methods allowing to embed BMetaData into
BMetaData.
* Add methods to handle more types.
2018-11-21 16:51:19 +01:00
Barrett17
f722040584 BMetaData: Finalize implementation
* Use string keys. I am still convinced we need BValue.
* Use boolean instead of status_t in return, this is
much more handy in pratical use given that there's no
really a status to check.
2018-11-21 12:46:54 +01:00
Zoltán Mizsei
c95db88334 sincos, sincof, sincosl declarations in gnu/math.h
Signed-off-by: Zoltán Mizsei <zmizsei@extrowerk.com>

Change-Id: I44b39e8d76dd970e18e285b5d8b9bad715608154
Reviewed-on: https://review.haiku-os.org/715
Reviewed-by: Jérôme Duval <jerome.duval@gmail.com>
2018-11-19 23:14:51 +00:00
Augustin Cavalier
2897df9676 bluetooth: ioctls always pass size on Haiku. 2018-11-18 14:42:09 -05:00
Barrett17
1f2ddf2fd0 Codec Kit: Initial BMetaData implementation 2018-11-18 16:57:12 +01:00
Barrett17
b4d8bbd540 Codec Kit: Move Managers to private headers
* Those classes are not ready for public consumption. Ideally,
I'd add a well designed BCodecRoster wrapping them. This is part
of the general cleanup I am doing to get the code in a good state
before going to finalize the design.
* I don't plan to reintroduce BMediaFile in the media2 API, and
I'd like to remove any (explicit) usage of entry_refs and things
like that.
* I plan to introduce BMetaData and BMediaFormat which is going
to be different than what we do now.
* We need to explicitly use the mime type when it's available and
it is another design consideration when CodecRoster will be introduced.
2018-11-18 13:15:35 +01:00
Barrett17
3fe994ba28 MediaExtractor: Move stream_info to private 2018-11-18 12:53:14 +01:00
Barrett17
121db87f5f Revert "codec_kit: Remove Perform"
This reverts commit a9ccd74af7.
2018-11-18 12:06:14 +01:00
Augustin Cavalier
9cc0f06a01 kernel: Remove the B_KERNEL_AREA protection flag.
It is now no longer used.
2018-11-17 16:46:49 -05:00
Barrett17
a9ccd74af7 codec_kit: Remove Perform
* Undocumented and apparently unuseful pattern.
2018-11-17 18:42:50 +01:00
Barrett17
9d90a8381d StreamerPlugin: Add ctor 2018-11-17 18:39:39 +01:00
Michael Lotz
2f211cce6d virtio: Replace size return with usedLength in queue_dequeue.
The size was in fact the count of physical entries that were used. That
number must necessarily be the same as the number given when adding to
the queue, so that number isn't really interesting. Consequently none
of the users of that API made use of it.

Return the used length instead, which is the way virtio signals how much
valid data resides in the dequeued buffer. This is for example important
to know the frame length of incoming packets in virtio_net.
2018-11-17 00:34:49 +01:00
Alexander von Gluck IV
5bd0fbd13a build: Add riscv architecture
* I mean, qemu 3.0 supports it.
* Nobody get excited, we need all the triplets added to
  our gcc buildtools. clang 7.0 seems to be cool with riscv though.

Change-Id: I17728163e4f28a3c16cee482a253364724b06f3a
2018-11-04 13:47:50 -06:00
Axel Dörfler
efafab643c Deskbar: Resizable tray
* Adds max width and height arguments to
  instantiate_deskbar_(item|entry).
* Old applications just stay with a 16x16 scaled icon, though.
* All used apps within the repository are converted to the new call
  besides the input_server input method icon (that will need further
  API changes in the input_server).

Change-Id: I29cc439396917be2c24135888459d31364997dff
Reviewed-on: https://review.haiku-os.org/656
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2018-11-04 19:00:49 +00:00
Axel Dörfler
5fd3bc6d2c BDeskbar: Moved constants to shared header
* Instead of duplicating them in different files.
2018-11-03 20:03:15 +00:00
Kacper Kasper
800e6fe412 BStringView: add support for multiline strings
* Actually draw the string at the bottom of the frame.
* Unfortunately BStringList cannot be cached because there is no
  space left in the class.
* Change SGI and PNG translators to use it in place of BTextView.

Change-Id: I07e12bf1a8dc956d18c9624604c7b63453ad15a2
Reviewed-on: https://review.haiku-os.org/620
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2018-11-03 16:44:10 +00:00
Barrett17
7257735529 codec_kit: Some more style and cosmetic fixes 2018-10-29 10:15:26 +01:00
Barrett17
8ccd9c0741 codec_kit: Add some padding 2018-10-28 16:14:25 +01:00
Barrett17
4269364345 codec_kit: Cosmetic changes
* Move padding at the bottom.
* Add some missing newline.
* Remove superfluous private statements.
2018-10-28 15:48:48 +01:00
Barrett17
59125d3ced MediaWriter: Private stuff should stay private 2018-10-28 15:31:11 +01:00
Barrett17
e5e2a570ba ReaderPlugin: Private stuff should stay private
* Polishment since we are making this ABI public,
I'd rather remove any previous hack.
2018-10-28 15:25:12 +01:00
Barrett17
df2639bf60 Move adapter_kit API to libcodec.so 2018-10-24 16:12:04 +02:00
Barrett17
1275248a77 codec_kit: First half
* Move all codec stuff into libcodec.so
2018-10-24 16:12:03 +02:00
Jérôme Duval
c02c4653c2 virtio: sync ids with Linux.
Change-Id: I1ca852f16e2b8d5d22ebed25b682e56fd934c46c
Reviewed-on: https://review.haiku-os.org/640
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2018-10-24 07:36:51 +00:00
Barrett17
62081a2cca audio: Move hmulti_audio driver API to private audio headers
* Fix all drivers to don't access private media headers.
2018-10-23 16:33:19 +02:00
Barrett17
c13b6a683d audio: Move private opensound API to audio private headers 2018-10-23 16:27:29 +02:00
Barrett17
c6be458e6d media: Remove audio_module_driver
* I have not idea what this is for. Seems stuff from a long time ago
when for some reason someone wanted an audio driver implemented in
a kernel module. It is not used anywhere. If someone feels this should
be reverted please let me know and add an explanation.
2018-10-23 16:13:51 +02:00
Barrett17
66741d3615 media: Remove BeOSR3MediaDefs.h
* Fix for cmedia driver included.
2018-10-23 16:08:06 +02:00
Barrett17
804f91e634 media: Remove legacy multi_audio.h 2018-10-23 15:50:27 +02:00
Barrett17
b84955d416 media: Remove debug.h, finalize MediaDebug.h
* Funny rust from 0 AD.
2018-10-23 15:19:14 +02:00
Barrett17
a668e42088 media: Remove OldSoundDriver.h 2018-10-23 13:57:52 +02:00
Leorize
3074920054 posix/pthread.h: mark pthread_exit as noreturn
This should prevents GCC from throwing -Werror=return-type when
pthread_exit is used in place of return

Change-Id: Ied7da58b671e77b53d859b67193259aa78ec27d6
Reviewed-on: https://review.haiku-os.org/632
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2018-10-17 19:23:17 +00:00
Andrew Lindesay
15fed7905d Json : Fix String Writer
Tidy-up and correct logic around writing JSON
encoded strings.

related #13832

Change-Id: I1eca33e11dff4457f85a896c02331c1cd9ae1110
Reviewed-on: https://review.haiku-os.org/617
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2018-10-06 19:58:35 +00:00
Augustin Cavalier
ece593e6cd freebsd11_wlan: Remove the BOSII_* ioctls.
They are not used anywhere (the rest of the stack uses the FreeBSD
ioctls instead), and there has been a TODO to remove them for
quite some time.
2018-10-04 20:07:11 -04:00
CodeforEvolution
106ae4ec35 Remove Curl, Switch to NetApi in Package Kit
Change-Id: I92213ab60dc987175c323d1d9ed11ac8b3517f2f
Reviewed-on: https://review.haiku-os.org/475
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2018-09-29 17:23:52 +00:00
Andrew Lindesay
a609673ce8 Support : Fixes for Relative URL Handling
When URLs combine a base URL with a relative part, the relative part's
path component was being pre-processed.  This removed any ".." from the
path and in some cases in the unit test cases, the ".." should have been
retained and then only later applied to the base URL.  This changes
fixes this so that the relative part is not pre-processed and is applied
with it's path in a raw state.

Completes Fixes for #14377
Change-Id: I9cebb8599889494e11f40a3b54c87ebca3ed1a21
Reviewed-on: https://review.haiku-os.org/529
Reviewed-by: Jérôme Duval <jerome.duval@gmail.com>
2018-09-11 18:39:53 +00:00
Augustin Cavalier
e282a54db8 BUrl: Remove HAIKU_TARGET_PLATFORM_HAIKU from main header.
These are really only defined during the build of Haiku itself,
so we don't want them in a system header. Since none of these
functions are virtual, leaving them as declared but not defined
should be fine.
2018-09-08 18:56:33 -04:00
Augustin Cavalier
e54f86aa6a libshared: Change string_for_rate to use KiB/s instead of Kbps.
string_for_size uses KiB, etc., and so when the two are combined (e.g.
pkgman's progress display), it looked especially strange to have two
different units.
2018-09-02 00:10:30 -04:00
Augustin Cavalier
372195500d Versioning: Add BETA_1 and PRE_BETA_2 version constants.
* PRE_BETA_2 is now the default in master.
 * For libbe: R1/alpha4 used internal=8, but nobody bumped master
   at the same time, so now we are on internal=9.
2018-08-28 00:21:13 -04:00
Jérôme Duval
546fafa0a1 pty.h: fix typo. 2018-08-26 12:02:52 +02:00
Murai Takashi
3bee8ef61d Package Kit: Fix -Wmismatched-tags
Replace class with struct, since BJobStateListener is previously declared
as a struct in Job.h
Pointed by clang  [-Wmismatched-tags]

Change-Id: I75293b48bcb521d25e98702d1fc1e0ab1008d504
Reviewed-on: https://review.haiku-os.org/482
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2018-08-25 18:53:32 +00:00
Andrew Lindesay
8f30879b98 Support : Validation for Host Portion of URL
Partly Fixes #14377

Change-Id: Ia611d3653d2c16c6dcdc48ce57bd61bb6e6db366
Reviewed-on: https://review.haiku-os.org/476
Reviewed-by: Adrien Destugues <pulkomandy@pulkomandy.tk>
2018-08-25 18:50:36 +00:00
Murai Takashi
992ba1a5ce Media Kit: Fix -Wmismatched-tags
Replace struct with class, since it is previously declared as a class
in SharedBufferList.h
Pointed by clang  [-Wmismatched-tags]

Change-Id: I3ff4e285862f31a2088a773be2967102bc8b18b6
Reviewed-on: https://review.haiku-os.org/480
Reviewed-by: Barrett17 <b.vitruvio@gmail.com>
2018-08-25 15:23:52 +00:00
Augustin Cavalier
c7919fc71a packagefs: Move DebugSupport up into the file_systems shared folder.
ramfs will find it useful also.
2018-08-22 19:19:56 -04:00
Augustin Cavalier
47b079afc9 Debug.h: Implement a real STATIC_ASSERT on non-GCC2. 2018-08-22 19:19:54 -04:00
Rene Gollent
fc48ae3f80 Debugger: Fix #14375, #12343.
TeamDebugger:
- When a job is aborted, instead of calling into the user interface directly
  to reset the status message, post a message to do so. Also, only post the
  message if we aren't already in a terminating state. Otherwise, if jobs
  were still running while the team debugger is executing its destructor, it
  would attempt to make calls to the already destroyed user interface. This
  bug has likely been with us for quite some time, but was hidden by incorrect
  ref counting in the past (see #12343).
2018-08-20 16:44:20 -04:00
Murai Takashi
92b072972b Packagekit: Fix -Wmismatched-tags
Replace 'class' with 'struct', since they are already defined as 'struct'
in PackageInfoAttributeValue.h
Pointed by clang [-Wmismatched-tags]

Change-Id: I094d32c3444fe4299a3afe0872ade296f92debf9
Reviewed-on: https://review.haiku-os.org/471
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2018-08-19 20:36:25 +00:00
Augustin Cavalier
fd25b902be BControlLook: Add FBC padding.
Fixes #14295.
2018-08-14 13:54:37 -04:00
Augustin Cavalier
7457ccb4b2 BMessageFormat: Rename to BStringFormat.
The ICU class is named MessageFormat, but on Haiku, it sounds too much
like something related to BMessage (which it isn't in the slightest)
and not part of the Locale system. It works almost entirely with BStrings,
so naming it BStringFormat makes much more sense.

OK'ed by PulkoMandy and Humdinger.
2018-08-13 20:49:00 -04:00
Augustin Cavalier
f2015c2f81 boot/platform/cfe: Remove, unused.
All platforms it was theoretically useful for also have U-Boot.
OK'd by mmu_man.
2018-08-11 20:21:12 -04:00
Jérôme Duval
81375d4fbb Package Kit: add Zstd compression.
Change-Id: Idbdb7cf1bde659046a88ea69a76e3b5fc4cd7013
Reviewed-on: https://review.haiku-os.org/323
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>
2018-08-11 23:10:00 +00:00
Augustin Cavalier
f6ff5a9790 headers/private: Fix wrong filemode. 2018-08-08 23:48:37 -04:00
Murai Takashi
410632da71 UserlandFSDefs.h: Fix gcc8 build
Remove index of portInfos[], since gcc8 warns -Werror=array-bounds
in UserlandFSServer::_Announce().

Change-Id: I79c4ee9d7dc301c54454974698ebd88d1a30750a
Reviewed-on: https://review.haiku-os.org/428
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>
2018-08-06 23:40:54 +00:00
Alexander von Gluck IV
5d0fd0e422 fdt: Major over-haul of fdt
* Consolidate all fdt code into fdt bus_manager
* Build boot and kernel static libraries

Change-Id: I2a69cd7e1f1276999a80734ff12918fd49b599e5
Reviewed-on: https://review.haiku-os.org/440
Reviewed-by: Alexander von Gluck IV <kallisti5@unixzen.com>
2018-08-06 15:46:49 +00:00
Fredrik Holmqvist
04cbc2588e Use fast clearing of visible screen for splash
memset uses rep stosb on x86 during boot, with memory
not set to write-combining, which makes it slow.

Instead we do aligned writes of 2 x four bytes at once.
Only clear the minimum of size and width * height * 4
UEFI framebuffer size can be huge, upto 512MB here,
and rep stosb seems to be around 25-30MB/s

This is written as generic as possible to work on
old compilers and different platforms, without
expecting boot memset to be optimized.

This makes it almost unnoticable compared to not
clearing.
2018-08-03 13:40:04 +02:00
Jaroslaw Pelczar
3a72e3ebee ARM64: Add initial kernel headers
Signed-off-by: Augustin Cavalier <waddlesplash@gmail.com>
aarch64 -> arm64 and coding style fixes by me.
2018-08-02 20:10:13 -04:00
Augustin Cavalier
25cd28e8c1 posix: Add initial ARM64 headers.
Almost directly copied from jpelczar's work.
2018-08-02 19:59:30 -04:00
Augustin Cavalier
fb4cc98472 build: Add initial ARM64 target.
It will probably be just stubs for the significant future, but,
here it is anyway.

Regarding the naming: Yes, the official name is "aarch64." However,
Linux, FreeBSD, and Zircon all call it "arm64", and so we will do the same.

I've configured it initially to be a Clang-only port, making no
changes to GCC buildtools whatsoever here. We'll see if that sticks,
however.
2018-08-02 19:48:29 -04:00
Augustin Cavalier
edb6d3b17b kernel_cpp: Move the C++14 operator delete out of the header.
It seems not all of the kernel includes this, but some use new/delete
anyway. Further, operator delete[] was not implemented at all.

Possibly fixes the ARM build.
2018-08-01 23:42:24 -04:00
Fredrik Holmqvist
15db6949b6 Don't clear video mem on UEFI, efi video mode refactor
Writes to videomem is slow without memory remapping
Can't do the mapping without leaving UEFI, so skipping
the clear. Afaict it should always be cleared by UEFI

This saves ~10 seconds of booting on my machine
(1920*1080*4 bytes)

EFI video mode (should have been it's own commit)
 * Only do strcmp if there are enough params
 * break when found
2018-08-01 21:12:08 +02:00
Alexander von Gluck IV
605e7eaed3 arch: Cleanup a few typos. Sorry for spam.
Change-Id: Ic2fce841acdee8572005cf2a9710188d03d7cecd
2018-07-31 19:37:01 -05:00
Alexander von Gluck IV
9642f7705b arch: Cleanup of __ARM__ checks
* gcc 7.x defines __arm__ and __ARM__ (and others)
* clang defines __arm__ and __arm
* cleanup a few related ifdef vs if macros

Change-Id: I5da4bafac590f6fa3e10e543688001c2449f840d
2018-07-31 19:12:20 -05:00
Augustin Cavalier
b5c220fb7d build: Use BeOSBuildCompatibility on Haiku also.
This forces usage of the libroot_build wrapper functions even on GCC2.
Probably fixes some strange ExtractHPKGArchive failures on Haiku.
2018-07-31 19:50:46 -04:00
waddlesplash
fe66a314c8 Revert "BScrollBar: Add lines and dots knob styles to scroll bar"
This reverts commit ec1b18c58a.

This was not well enough reviewed, and it seems that at least some
consumers of the old API (e.g. WebPositive) need more than the new one provides.

Change-Id: Ie7ad1fc70dab889922424298661504b00f66d31d
2018-07-22 18:26:06 +00:00
Jérôme Duval
679518f417 setjmp.h: add noreturn keyword on longjmp variants. 2018-07-21 12:27:27 +02:00
Hrishi Hiraskar
bc8427c522 Tracker: Allow add-ons to dynamically extend popup menu.
An add-on may now add custom entries to the popup menu, in order
to provide more than one action.

Change-Id: Ib4726c0c1e70c59e3ba4d752df24b76cfee1c4a4
2018-07-19 14:00:48 +00:00
John Scipione
ec1b18c58a BScrollBar: Add lines and dots knob styles to scroll bar
Fixes #9137

Move scroll bar drawing into HaikuControlLook

Added B_SCROLLABLE flag to BControlLook

Update FakeScrollBar in Appearance to also draw using HaikuControlLook.

Focus works on scroll bars again, used by FakeScrollBar... and probably
nowhere else.

Added private _ScrollingEnabled() convenience method to BScrollBar and
use it in a few places making.

Create ScrollBarPrivate.h header to share a couple of scroll bar related
enums with HaikuControlLook that come from BeOS Scroll Bar prefs.

Stuff arrow_direction enum into BScrollBar::Private as it has been
succeeded by a similar enum already present in BControlLook and is only
around now for BScrollBar::Private::DrawScrollBarButton.

Change-Id: Idc31ee41de091ba45ded2f0315a004af00143803
2018-07-16 16:11:46 +00:00
Andrew Lindesay
3b17d8dd7f HaikuDepot / PackageKit: Repositories 'Identifier' URL
Repositories are identified with a 'url' in the
remote 'repo.info' file.  There is also a
'base url' which is the URL locally with which
the system is able to access the repository
data on.  There is some confusion between these
two terms in the source.  This change aims to
separate the two out and consistently name them.
The settings for the repository locally also was
not storing these values and that has been fixed.
Debug info about the repositories also did not
display the two urls consistently and will now
also do so.  Finally, HaikuDepot now correlates
locally configured repositories with the data in
HaikuDepotServer using the identifier URL; this
makes the use of mirrors with HaikuDepot possible.

Fixes #13888
Change-Id: I66dfe589b05c24e1ab123a6945352e0f24b60bf1
2018-07-05 20:06:54 +00:00
Murai Takashi
12ed45b60f Media kit: Suppress -Werror=class-memaccess
* Add media_format::Clear(), media_format::Unflatten().
* Replace memset() with media_format::Clear()
* Replace memcpy() with media_format::Unflatten()

Fix #14156

Change-Id: I38ebc2de4915b954a15b6f4f6b40d016506910e5
2018-07-02 21:14:30 +00:00
Augustin Cavalier
f81f6999ee Remove private vmware driver headers.
Not used since the VMware drivers were migrated out of the tree
a few years ago.
2018-06-26 17:23:23 -04:00
Augustin Cavalier
f4b42b518a drivers: Deduplify joystick_driver.h.
Now there is only the one copy in headers/private/device.
2018-06-21 18:46:30 -04:00
Augustin Cavalier
e4104854c3 if_dl: Increase size of sdl_data from 20 to 46 bytes.
FreeBSD's is presently 46 bytes. CID 1422869 warns that it can get overrun
in if_attach() in copying if_xname which is IF_NAMESIZE bytes (32).

This breaks ABI, but BeOS did not have sockaddr_dl, it is only a modern-GCC
ABI break. Since most applications assume that sockaddr_dl is variable-length
and is null-terminated, as well as not used very often, hopefully this will
require relatively few rebuilds.
2018-06-20 21:26:21 -04:00
Augustin Cavalier
9216fc0178 More class/struct mixup fixes.
Spotted by Clang.
2018-06-18 23:16:50 -04:00
Augustin Cavalier
fe17f0df1f scsi: Use _res and not res in MK_ERROR.
Some users of MK_ERROR pass in parameters from a variable called "res",
which is obviously not what they want to do, as that will use this "res"
and not theirs.

Spotted by Clang.
2018-06-18 22:05:45 -04:00
Augustin Cavalier
9ac3062734 kernel: Small fixes for Clang. 2018-06-18 19:32:13 -04:00
Augustin Cavalier
4f7b9506fd Revert the rest of the COMPAT_MODE changes (back to hrev52003.)
This reverts commit 458e758f37.
This reverts commit ce5eb94a82.
This reverts commit aac8d4c317.
This reverts commit c70cba914a.
This reverts commit 2ffbe7aaca
This reverts commit c6e120e2d2.
2018-06-15 00:20:56 -04:00
Augustin Cavalier
513403d420 Revert team and thread changes for COMPAT_MODE (hrev52010 & hrev52011).
This reverts commit c558f9c8fe.
This reverts commit 44f24718b1.
This reverts commit a69cb33030.
This reverts commit 951182620e.

There have been multiple reports that these changes break mounting NTFS partitions
(on all systems, see #14204), and shutting down (on certain systems, see #12405.)
Until they can be fixed, they are being backed out.
2018-06-14 22:25:06 -04:00
Alexander von Gluck IV
7d95ab67ad intel_extreme: Update PCH mask to match new bits
* Missed in 87628f17eb
2018-06-12 14:20:34 -05:00
Jérôme Duval
44f24718b1 kernel/x86_64: add compatibility source files to the build.
* add x86 versions of fnsave frstor.
* add missing declaration for elf32_resolve_symbol().

How-to build a x86_64/x86 bootstrap build:
mkdir generated_bootstrap; cd generated_bootstrap
../configure --bootstrap /dir/to/haikuporter/haikuporter /dir/to/haikuports.cross \
  /dir/to/haikuports --build-cross-tools x86_64 /dir/to/buildtools --build-cross-tools x86 -j8 --use-gcc-pipe
jam -q -sHAIKU_PORTER_EXTRA_OPTIONS="-j8 --sourceforge-mirror=freefr --no-source-packages" @bootstrap-raw

Change-Id: I6eae3653c42a53683ae307107fae595c4b8ebcfb
2018-06-12 17:56:55 +02:00
Jérôme Duval
a69cb33030 kernel/x86_64: setup a new thread in compatibility mode.
* define compat_thread_info, compat_rlim_t, compat_rlimit and
compat_thread_creation_attributes to be used when applicable in compatibility
mode.
* handle 32-bit types in _user_spawn_thread(), _user_get_thread_info(),
_user_get_next_thread_info(), _user_getrlimit(), _user_setrlimit(),
other syscalls are compatible as is.
* init TLS for compatibility mode threads.

Change-Id: I483ba95e6198ddac9d240671bcb56fcd2ad831d2
2018-06-12 17:56:55 +02:00
Jérôme Duval
951182620e kernel/x86_64: setup a new team in compatibility mode.
* in load_image_internal(), elf32_load_user_image checks whether the binary
format requires the compatibility mode.
* we then set up the flag THREAD_FLAGS_COMPAT_MODE and the address space size.
* the compatibility mode runtime_loader is hardcoded with x86/runtime_loader.
* if needed, the 64-bit flat_args structure is converted in-place to its 32-bit
layout.
* a 32-bit flat_args isn't handled yet (a 32-bit team execs a 64-bit binary).

Change-Id: Ia6a066bde8d1774d85de29b48dc500e27ae9668f
2018-06-12 17:56:55 +02:00
Jérôme Duval
458e758f37 kernel/x86_64: compatibility syscalls for vm.cpp.
* define compat_area_info to be used when applicable in
compatibility mode.
* handle 32-bit types in _user_reserve_address_range(), _user_get_area_info(),
_user_get_next_area_info(), _user_transfer_area(), _user_clone_area(),
_user_create_area(), _user_map_file(), other syscalls are compatible as is.
* _get_next_area_info() doesn't work well with a 32-bit address cookie (address
could be in 64-bit range). Instead use _compat_get_next_area_info() which uses
the area id as cookie, though the areas are not ordered by address any more.

Change-Id: Ic7519ca8824aa2d534b0f03ea75a1bf6ae321535
2018-06-12 17:56:55 +02:00
Jérôme Duval
ce5eb94a82 kernel/x86_64: compatibility syscall for system_info.cpp.
* define compat_system_info to be used in _user_get_system_info() in
compatibility mode.

Change-Id: Ib917d41a3a87155aee9cb536fd09e7231b232bc8
2018-06-12 17:56:55 +02:00
Jérôme Duval
aac8d4c317 kernel/x86_64: compatibility syscalls for signal.cpp.
* handle 32-bit types in _user_send_signal(), _user_sigaction(), _user_sigwait(),
_user_set_signal_stack(), _user_restore_signal_frame(), other syscalls are
compatible as is.

Change-Id: I4c8dc47bfa80f36e363d444d2a5a7be6c621606d
2018-06-12 17:56:55 +02:00
Jérôme Duval
c70cba914a kernel/x86_64: compatibility syscalls for image.cpp.
* define compat_image_info, compat_extended_image_info
to be used for respective 32-bit types of syscalls in compatibility mode.
* handle 32-bit types in _user_register_image, _user_get_image_info,
_user_get_next_image_info, other syscalls are compatible as is.

Change-Id: Ibbd33e6796208dfa70d869e36bf745bc3e18d330
2018-06-12 15:55:55 +00:00
Jérôme Duval
2ffbe7aaca kernel/x86_64: compatibility syscalls for vfs.cpp.
* define compat_flock, compat_timespec, compat_stat, compat_attr_info,
compat_fs_info, compat_fd_info to be used for respective 32-bit types
of syscalls in compatibility mode.
* handle 32-bit types in common_fcntl(), _user_read_stat(), _user_stat_attr(),
_user_read_index_stat, _user_read_fs_info, _user_write_fs_info,
_user_get_next_fd_info, other syscalls are compatible as is.

Change-Id: I5b372169fe142f67b81fd6c27e0627d5119ba687
2018-06-12 15:55:43 +00:00