Commit Graph

5591 Commits

Author SHA1 Message Date
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
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
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
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
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
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
Jérôme Duval
c6e120e2d2 kernel/x86_64: add setup_compat_signal_frame.
* add compatibility signal types.

Change-Id: I665020234be0ba2ccbb33bdbc338c11a214ab6e8
2018-06-12 15:55:18 +00:00
Alexander von Gluck IV
87628f17eb intel_extreme: Add additional more recent PCH devices
Change-Id: Ib9f7dc187300c9f746bca9fd7f721c1954f5be44
2018-06-11 20:34:14 -05:00
Augustin Cavalier
52d1e93353 Revert "intel_extreme: Broadwell is really Gen7(.5), not 8."
This reverts commit 4f059c1fc5.

From discussion on the mailing list, it seems I was correct the first time
and Broadwell is Gen8. The confusion comes from the SER5/SOC distinction,
which is not in the Linux driver, and I still don't know which one it really
belongs in.
2018-06-05 21:07:59 -04:00
Augustin Cavalier
4f059c1fc5 intel_extreme: Broadwell is really Gen7(.5), not 8. 2018-06-05 17:27:45 +00:00
Jérôme Duval
9e75e900da kernel: use non-deprecated signatures for new/delete operators.
add posix_memalign(), needed for c++17.
2018-05-28 20:49:15 +02:00
Adrien Destugues
8bca37d604 vfs: Bind flock locks to file descriptors
* File locks created by flock should only apply for the file descriptor
  that was used to lock the file. Another fd on the same file should then
  be denied access (calling flock should fail).
* fcntl based locks, however, are in a separate namespace and are global
  to a team.
* This issue was found when running webkitpy test suite, and should close
  ticket #13795.
* Don't use session or team as comparison in release_advisory_lock(), as
  that information might not be available anymore (e.g. when called from
  Team::~Team()). This fixes #14121.

Change-Id: I9efb96cfcefe7e72b0060220c635a665e7e643cc
Co-authored-by: Axel Dörfler <axeld@pinc-software.de>
2018-05-22 20:29:21 +00:00
Alexander von Gluck IV
7f167d4f4a radeon_hd/dp: Fix bug in lane training. Kudos gcc7
* GCC7's static analysis found this one and it still
  took #gcc and me a while to spot. Nice work gcc7!
* Should help DisplayPort training issues :-)

Change-Id: I9b47f13c95e622a2c08ff329ec9c3fc7e3db493d
2018-05-21 18:02:32 -05:00
waddlesplash
3f9e3b0a62 ICU locale backend: Increase size of fLocaleDescription from 512 to 1024 bytes.
GCC7 gave a Werror that we were snprintf'ing potentially ~860 bytes into
a 512-byte buffer.
2018-05-19 20:44:51 -04:00
Jérôme Duval
db9b70ee54 kernel: add a compatibility commpage on x86_64.
* x86 uses a commpage with 32-bit addresses, incompatible with the one used for
x86_64. For this reason, a compatibility commpage is needed to support a 32-bit
userland on x86_64.
* define ADDRESS_TYPE as a macro for addr_t (default) or uint32 (for the 32-bit
commpage).
* team_create_thread_start_internal() will use clone_commpage_area() with
KERNEL_USER_DATA_BASE or clone_commpage_compat_area() with
KERNEL_USER32_DATA_BASE, to setup the correct commpage.
* real_time_clock (in compatibility mode) also updates the compatibility
commpage with real time data.

Change-Id: I61605077ce0beabab4439ef54edd1eae26f26fd2
2018-05-18 05:11:07 +00:00
Jérôme Duval
c7c3973e09 kernel: generic user_memcpy now saves the old state.
fixes #14135.
2018-05-16 06:58:33 +00:00
Jérôme Duval
a553e95d85 kernel: support elf32 on x86_64.
* define ELF32_COMPAT to enable ELF32 macros.
* add a flag ELF_LOAD_USER_IMAGE_TEST_EXECUTABLE to only check the format.
It will be used by load_image_internal() to check which mode to use when
loading an image.
* in arch_elf_relocate_rel(), switch to elf_addr instead of addr_t, which
would be the wrong size for elf32 on x86_64.
* the ELF compat loader reuses the relevant parts of elf.cpp and arch_elf.cpp,
excluding for instance load_kernel_add_on() or dump functions.

Change-Id: Ifa47334e5adefd45405a823a3accbd12eee5b116
2018-05-15 10:29:00 +00:00
Jérôme Duval
27b32ee02c kernel/x86_64: adjust descriptors tables for compatibility mode.
* also adjust BOOT_GDT_SEGMENT_COUNT for x86, the definition is used by the
boot loader.
* add some 32-bit definitions.
* add a UserTLSDescriptor class, this will be used by 32-bit threads.

Change-Id: I5b1d978969a1ce97091a16c9ec2ad7c0ca831656
2018-05-15 10:27:02 +00:00
Jérôme Duval
630e3f1410 View: move BAffineTransform out of ViewSetStateInfo.
the size of BAffineTransform is architecture dependent, so we transmit
its contents in a standard array instead.

Change-Id: I907110742168846a869a48bb2d116cc5292ec7d0
2018-05-07 07:02:57 +00:00
Jérôme Duval
27bba9c3fe registrar: flat_app_info size was arch dependent.
copy each member of app_info instead.

Change-Id: Ica8d0a195b2dbaaf57d28f2fe2f7efd73c37b2c4
2018-05-05 09:30:08 +00:00
Alexander Coers
c334ab215a cpu_type.h: small fix for CPU detection
* since Core i5/Core i3 can have same model/family/stepping values
  additional string evaluation is needed

This fixes #12695
2018-05-04 06:32:48 +00:00
Jérôme Duval
61cd7e85d7 virtio: add API to uninit a device.
* free interrupts, free queues, return to init state.
* this will be used by virtio_net on interface uninit.

Change-Id: I7c1e6facc37cf6bfe19628576fdf2c0bac9e5c38
2018-04-26 06:25:41 +00:00
Jérôme Duval
6e82e42859 virtio: refactor to have a handler per queue.
* enable to iterate on available entries in one interrupt call.
* negociate -> negotiate, (void *) -> (void* ), thanks axel and philippe!

Change-Id: Ie2d290797abcbf4c0f3cb5bfff71d091bb800fa6
2018-04-26 06:25:15 +00:00
Axel Dörfler
a77aa747ea launch_daemon: Added basic logging facility
* The daemon now stores many events in am internal log.
* You can use "launch_roster log" to retrieve it.
2018-04-25 10:10:43 +02:00
Jérôme Duval
3a764d6a12 kernel: x86: add some msr and cpuid features
* for arch capabilities.
* for spec ctrl and pred cmd.
2018-04-22 18:03:16 +02:00
Michael Lotz
321372e3ef kernel: Make size argument to create_area_etc() size_t.
It was limited to a uint32 and could for example be overflown by the
slab MemoryManager that uses size_t on a 64 bit system.

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

Note that the function is currently private, so the impact should be
limited.
2018-04-04 00:07:59 +02:00
Andrew Lindesay
b45e8b1ef9 HaikuDepot : additional debugging for json-rpc invocations 2018-03-25 05:44:19 +00:00
Augustin Cavalier
61206a24c9 build: Cleanup of libgnuregex usage.
John's revert of my removal commit dragged back a bunch of cygwin/sunos
cruft, as well as re-adding RegExp.cpp to the host libshared, that we don't
need.

Instead, remove this and add libgnuregex_build to just the tools/keymap
link alongside the FreeBSD gnuregex case.
2018-03-07 18:04:31 -05:00
Barrett17
852b62956b MediaClient: Rename IsRunning to IsStarted 2018-03-02 03:58:54 +01:00
Barrett17
a6ac14c71c MediaClient: Add ClientRegistered callback 2018-03-02 03:34:25 +01:00
Barrett17
1c15261f5a MediaConnection: Add connection name handling 2018-03-02 03:18:26 +01:00