Commit Graph

9233 Commits

Author SHA1 Message Date
Augustin Cavalier 3c2901a976 libroot: Expose the internal mutex_lock for private consumption. 2019-07-27 18:32:18 -04:00
Zoltán Mizsei 3ddf0bbc29 BSD: Use elf.h from os/kernel
Platform-dependant defines for Elf_*

Change-Id: Ib86554eb497d20e60ad7c75de4321d5b516ad88c
Reviewed-on: https://review.haiku-os.org/c/1635
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2019-07-27 15:19:31 +00:00
Adrien Destugues 58db38ed74 bsd/sys/param.h: add NBBY define
This defines the number of bits in a byte and is used in tnftpd.
Once this is merged, some patches to tnftpd can be removed.

Change-Id: Ie2d0c61ce1371daeeb8549281f4210147fb77197
Reviewed-on: https://review.haiku-os.org/c/1642
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2019-07-22 23:43:04 +00:00
Murai Takashi 319c399d61 PVS V739: EOF compared with a value of the char type.
Change-Id: Icfaff590359381fbdd3bbd7993dab92111da3ed1
Reviewed-on: https://review.haiku-os.org/c/1618
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2019-07-21 15:47:48 +00:00
Adrien Destugues 194c483884 Move SettingsHandler to libshared
It's used by both Tracker and Codycam and others might find it useful.

Change-Id: I585d3a1bdc7f8fce7d36bedf6867464cd541ba2e
Reviewed-on: https://review.haiku-os.org/c/1637
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2019-07-21 15:47:48 +00:00
Calvin Buckley f093894af1 Fix Zen-based (family 0x8f) CPU naming
Previously, it identified all Zen CPUs as Ryzen 7. Since the model
and stepping information consist of microarchitecture information
and don't carry the model number, use the parse_amd based name,
which will remove any unnecessary details from the returned name.

Fixes #15153.

Change-Id: I1a20bf35a60b2fdd20d4cc90ec2dd95fd0e6439d
Reviewed-on: https://review.haiku-os.org/c/1634
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2019-07-20 16:07:58 +00:00
CodeforEvolution e1a822a95f Conform putenv to POSIX standards
Discovered this while working on VLC, checked with other online sources too.

Change-Id: I114c20babda0ff0e90d0eeee299d8483700166bd
Reviewed-on: https://review.haiku-os.org/c/1628
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>
2019-07-20 16:02:00 +00:00
Augustin Cavalier 1f39d6dd11 arch_user_debugger: Restore the use of size_t for dr7.
The prior change broke the build with some cryptic "invalid
instruction mov" messages. So it must have been correct before.
2019-07-18 20:36:13 -04:00
Zoltán Mizsei c6fd6cbba4 Import link.h and link_elf.h from FreeBSD master
Add _D_BSD_SOURCE guarding
Change-Id: I6eefe207b5e7e645cd3aec3b1981aae59793fa98
Reviewed-on: https://review.haiku-os.org/c/1620
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>
2019-07-17 22:17:49 +00:00
Adrien Destugues a216132469 PVS V784: fix size of DR7 register
Even on 64bit CPUs it's a 32bit register.

Change-Id: I9a4de6eec225de19a90d70fae1382b662e530629
Reviewed-on: https://review.haiku-os.org/c/1625
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2019-07-17 22:17:22 +00:00
Adrien Destugues 22817d221a PVS V591: non void functions must return something
Change-Id: I1f4276bc32afab75cf857c143d2bdb4fc3b578b1
Reviewed-on: https://review.haiku-os.org/c/1612
Reviewed-by: Stephan Aßmus <superstippi@gmx.de>
2019-07-17 01:57:50 +00:00
Adrien Destugues 12d046d024 PVS V547: always false conditions
Change-Id: I389c081331b1c5ef67bef9ffcac9055573e1ebf5
Reviewed-on: https://review.haiku-os.org/c/1605
Reviewed-by: Stephan Aßmus <superstippi@gmx.de>
2019-07-17 01:48:25 +00:00
Adrien Destugues fcf7cbe79e PVS V522: null pointer dereferences
Change-Id: Iaa753ef3a93c36031789a85f87e569fc410d3304
Reviewed-on: https://review.haiku-os.org/c/1604
Reviewed-by: Stephan Aßmus <superstippi@gmx.de>
2019-07-16 20:44:32 +00:00
Kacper Kasper 17c9e98743 TextView: add shortcuts for wordwise delete
Change-Id: Ie67f6255c3f5d9d8ccc6699ed42dd71ae593fa16
Reviewed-on: https://review.haiku-os.org/c/1573
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>
2019-07-14 14:14:39 +00:00
Augustin Cavalier 39665db167 kernel/vm: Inline the VMArea::name string.
B_OS_NAME_LENGTH is 32, char* is 8 (on x64), and this structure
has quite a lot of pointers in it so it is not like we really
needed to save those 24 bytes. Hitting malloc() in here is not
so great, especially because we usually have B_DONT_LOCK_KERNEL_SPACE
turned on, so just inline and avoid it.

Change-Id: I5c94955324cfda08972895826b61748c3b69096a
2019-07-13 13:42:49 -04:00
Adrien Destugues 727e49c611 Media Kit: remove MediaExtractor::Source
The idea was that the Media Extractor could wrap the original source
given by BMediaTrack, but all operations on the data go through
MediaExtractor anyway.
We could probably move ownership of the BDataIO completely into
MediaExtractor instead.

Change-Id: I846b34b543fb983e60f6adf86cb17e835303267b
Reviewed-on: https://review.haiku-os.org/c/1587
Reviewed-by: Stephan Aßmus <superstippi@gmx.de>
2019-07-13 16:14:01 +00:00
Adrien Destugues 076b19023f elf2aout: import from FreeBSD
The sparc openboot implementation can run executables in the a.out
format. We used to generate these using objcopy, but this does not work
anymore as binutils is deprecating a.out format support.

- Import elf2aout from FreeBSD
- Add some missing bits to our elf.h and have a copy of it in the build
  headers so it can be used to build elf2aout for the host platform
  (tested for Linux)
- Use it to generate the sparc haiku_loader
- Adjust the bootloader linker script to have two "program headers": one
  that is not loadable and contains the ELF headers, and the second one
  that is loadable and contains the actual code and data. Unlike
  objcopy, elf2aout relies only on the program headers to know what to
  put in its output file (sections are ignored), so this is required
  otherwise we end up with the ELF header nested inside the a.out file,
  and everything offset from the expected load address as a result.

Confirmed that this allows to build the loader and run it as far as
before, so I'm back to needing to implement some MMU support now.

FreeBSD commit: 7551d83c353e040b32c6ac205e577dbc5f2c8955

Change-Id: I90b48e578fa7f148aeddd8c5998fdddc5cfa73fa
Reviewed-on: https://review.haiku-os.org/c/1557
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>
2019-07-13 01:29:05 +00:00
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