Commit Graph

49211 Commits

Author SHA1 Message Date
Jérôme Duval
b3e749b0c1 kernel,libroot,boot: remove c++11 and gnu++11 flags.
* c++14 is the default with current GCC
* remove pragmas for x86intrin.h
2018-05-28 18:54:22 +02:00
Jérôme Duval
8e4aa13350 console: use user_memcpy to read the user buffer. 2018-05-26 15:52:37 +02:00
Jérôme Duval
57aac99526 nforce: sync with FreeBSD 11.1. 2018-05-26 13:52:40 +02:00
Jérôme Duval
2df44799a5 rdc: sync with FreeBSD 11.1. 2018-05-26 13:52:40 +02:00
Augustin Cavalier
053cc0d4fe ape_reader: Properly fix the build under GCC 7.
Since we cannot '#define wchar_t char' anymore, we need to properly
fix the source code to work with char instead.
2018-05-23 18:59:32 -04:00
Adrien Destugues
ca4d9e0f9f ape_reader: build fix.
We support wchar_t now, so don't try to avoid it.
2018-05-23 22:57:25 +02:00
Jérôme Duval
177f5facbf kernel drivers: have timer hooks return B_HANDLED_INTERRUPT.
* 0 means B_UNHANDLED_INTERRUPT.
* uses int32 as return type.
2018-05-23 18:41:35 +02:00
waddlesplash
b87a52803f tests: Fix the build under GCC 7. 2018-05-22 20:43:06 -04:00
waddlesplash
77d1e4fd44 kernel: TARGET_PACKAGING_ARCH not HAIKU_ARCH for present compiler arch.
HAIKU_ARCH is CPU architecture. Sorry for the noise...
2018-05-22 20:41:52 -04:00
waddlesplash
3d5f8b7ccf protocols/unix: Fix build after previous commit. 2018-05-22 19:46:20 -04: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
Jérôme Duval
fc48586b9b kernel/libroot: use compiler built-in for rdtsc().
* spares two MOV instructions.
* the warning is fixed upstream:
2bbcec1f88
2018-05-22 17:48:02 +02:00
Augustin Cavalier
3acaf25e8f kernel: Disable rtl-stv1 optimization on GCC 7.
See inline comment and accompanying ticket.
2018-05-21 20:52:11 -04:00
Augustin Cavalier
c5a6b06396 add-ons/print: Disable probably-bogus warnings on GCC 7. 2018-05-21 20:51:23 -04:00
Augustin Cavalier
66e852769e VSTHost: Fix the build on GCC 7.
rename round -> vstround.
2018-05-21 17:57:50 -04:00
Jérôme Duval
8ac3d98578 x86_64: use the compiler built-in for cpuid. 2018-05-21 15:28:55 +02:00
Jérôme Duval
ba6f86b896 syskonnect: sync with FreeBSD 11.1. 2018-05-21 14:39:32 +02:00
Murai Takashi
5d75f4346e Media preference: Replace strncpy with strlcpy
Replace strncpy() with strlcpy() since destination size equals
maximum number of characters to copy.

Change-Id: I7d540c60c9915324c2271abaee8b7134bf0c3814
2018-05-21 06:59:30 +00:00
Augustin Cavalier
eabd8bf74b fuse: Fix build under gcc6+
* GCC6+ will warn when you truncate potentally "too much data"
  Volume name 255. fName is 32.
* We don't think we care enough to enlarge fName?

Change-Id: I6f453ee62c856481605594b2ae5ff9ab41244bd1
2018-05-20 17:47:12 -05:00
Augustin Cavalier
59a59d1ac7 Appearance: Another BString::SetToFormat instead of sprintf. 2018-05-20 18:18:13 -04:00
Augustin Cavalier
fe3a28958a Appearance: Use BString::SetToFormat instead of sprintf to create hex color.
Fixes a GCC7 Werror about (potential) format overflow.
2018-05-20 17:35:53 -04:00
Alexander von Gluck IV
172c944a5b kernel/kernel_cpp: Change nothrow_t syntax for gcc6+
* Fix for explicit constructor change.
  https://github.com/gcc-mirror/gcc/commit/a3f25f0f

Change-Id: I330ad9c3bff1d7f3e0284f3dcda86e17d974c57d
2018-05-20 15:44:32 -05:00
Murai Takashi
54d72f0643 Fix calling abs(unsigned)
Casting the substraction result to int
since call of overloaded 'abs(uint)' is ambiguous.

Change-Id: I24b4919f8a487d275f537391132cae635aaa030e
2018-05-20 20:29:16 +00:00
Jérôme Duval
013af6f0eb build: define architectureObject as local variable. 2018-05-20 13:19:39 +02:00
Alexander von Gluck IV
95daec1061 u-boot: Generate boot.scr for mmc
* This gives us a solid automatic entry point to u-boot
* A uEnv.txt specifies the fdt file name
* This should work on any modern u-boot for most architectures
* Non-mmc targets will likely need some work

Change-Id: I9a00316a213a15e85d3f2e18574d64920d9bdb76
2018-05-19 20:04:50 -05:00
waddlesplash
39f5d71fe4 iconv: Fix the build on GCC6+.
Patch from http://git.savannah.gnu.org/gitweb/?p=libiconv.git;a=commit;h=b29089d8b43abc8fba073da7e6dccaeba56b2b70
to fix an "undefined reference" error to that function (https://savannah.gnu.org/bugs/?47953).
2018-05-19 20:35:33 -04:00
Jérôme Duval
36d628673c hda: sync snoop quirk pci ids list based on alsa. 2018-05-19 13:34:52 +02:00
Jérôme Duval
b54ad7b4f4 freebsd11_network: add missing bus_get_dma_tag method for marvell_yukon. 2018-05-19 12:58:28 +02:00
Jérôme Duval
95ed3b4432 kernel/x86_64: add signal handler compat code.
* x86_64_signal_handler_compat is a dump of x86 x86_signal_frame_function().
* the x86 compiler should be used to produce this code, which ends up in the
commpage.

Change-Id: I03da02c376f67ff83dbaba9bcb144da726463996
2018-05-18 15:19:41 +00:00
Sergei Reznikov
f42d4b5cc4 CodyCam: center error messages 2018-05-18 15:12:13 +03: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
cd6365c7ce style fixes 2018-05-17 22:23:36 +02:00
Jérôme Duval
9e095e1ef8 marvell_yukon: sync with FreeBSD 11.1.
* add imin() to libkern.h.
2018-05-17 21:34:11 +02:00
Adrien Destugues
79cb8f02d9 PS/2 synaptics: minimal clickpad support
Handled as a 1-button mouse. We didn't really support this since the old
Macintosh ADB mouses, so let's see if that code aged well!

Change-Id: Ibed2423023e821ae4ce608f0ddbc5ac32bfbd8f7
2018-05-17 06:18:19 +00:00
Adrien Destugues
258b7d4a8b ps2_synaptics: support Lenovo use of extra buttons
On some Thinkpads, the extra buttons are used for the trackpoint, so
they should be reported as "main" buttons, not extended ones. An
(undocumented) information query was added to the firmware to report
when this is the case, however it is not advertised as supported by the
firmware itself by the usual mechanism.

What we do is (just as the Linux driver) detect that the tocuhpad has a
PS/2 passthrough (likely used to daisy-chain a trackpoint on the same
PS/2 port) and also advertises extra buttons (an unlikely case, it is
already uncommon to even get a middle button these days...) and assume
that the information query is available then.

When the query is available and reports the quirk, the extended buttons
are reported as 0, 1, 2 (left, right, middle), instead of extra buttons
the userland would have no idea what to do with.

Change-Id: Iad5a9e140b6e49c298dcc901f4e331a4a847d7b2
2018-05-17 06:18:19 +00:00
Murai Takashi
b08627f310 Fix catching polymorphic type by value
Replace catching polymorphic type std::bad_alloc 'by value'
with 'by reference'.
Pointed by gcc8
2018-05-16 13:49:46 +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
496080235a kernel/x86_64: add ia32 syscall entry and commpage syscall code.
* only for Intel sysenter/sysexit.
* the entry function processes stack arguments as follows:
    we look up the syscall in the table, find the number of arguments.
    reserve place on the stack for the arguments.
    copy arguments on the stack
    pop register arguments
    call the syscall function
    place the return value in ax and dx registers.
* TODO: we need to store the arguments somewhere for the post-syscall tracing.
* the thread exit stub is 32-bit, for the time being use hexadecimal instructions.

Change-Id: Ie5c502eb596d4fa7613d238de80643566bc19ed8
2018-05-15 10:27:18 +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
Murai Takashi
6692e4c87f Remove RAND_MAX
Since RAND_MAX is not used in source code and
pre-defined in stdlib.h .

Change-Id: Ic16dd9c86bc96cea409a82e83f5593257808568d
2018-05-15 05:31:34 +09:00
Murai Takashi
96ef28f853 xhci: Remove unnecessary parentheses
Remove unnecessary parentheses in declaration of
'trbs' pointed out by gcc8.

Change-Id: I87d043866929d1a7f56ce97aa3667c91eeed52e0
2018-05-14 10:33:23 +00:00
Adrien Destugues
e003057f5d PS/2 Synaptics: add support for extended buttons
It is possible to get up to 8 extra buttons on synaptics touchpads.
On some Thinkpad models, these are used to implement the trackpoint
buttons (reported as buttons 4, 5 and 6). Since the touchpad itself has
no buttons (it is a clickpad), we may at least try to handle these
properly.

Change-Id: I5d4021e36fb3ac86ecf213c5666f9b6ddd3e2bca
2018-05-12 18:21:26 +00:00
Zoltán Mizsei
ebdb22de92 Fix ps2 debug build on x86_64
Change-Id: I579656b6b0619b44aa4a02c87720762cb5dd1415
2018-05-12 18:20:31 +00:00
Jérôme Duval
356fc3bf06 BWindow: fix debug build. 2018-05-09 21:00:55 +02:00
Jérôme Duval
0032be820b kernel/x86: asm offsets for the extended syscall table.
the x86_64 compat syscall entry needs size and offset of parameters to
handle them correctly to the syscall function. struct extended_syscall_info
and struct syscall_parameter_info provide parameter count, size and offsets.

Change-Id: I7e5c7b6e19e757b28b43c3b3419b7071fae321f8
2018-05-09 18:24:32 +00:00
Axel Dörfler
ae47dec0fd mount_server: Use scoring mechanism to detect volume
* This makes mounting volumes more stable; ie. you can put your
  drive in another slot, or boot your native system in emulation, and
  it will still find the drives to mount.
* The old method is still left there in order to achieve a smooth
  transition.
2018-05-08 20:22:27 +00:00
Adrien Destugues
ad33fd78a5 BAffineTransform: de-virtualize some calls in flattening code
The Flatten and Unflatten method should check the size according to the
matching FlattenedSize method, not a possibly overriden version.

May also fix #14128 since we avoid use of the vtable by doing this.
2018-05-08 15:40:01 +00:00
Jérôme Duval
edf7f4cd5f virtio_scsi: actually write the cdb size
instead of the sense size. Should help with #14133.
2018-05-08 17:33:01 +02:00
Jérôme Duval
645dc27d9d broadcom570x: sync with FreeBSD 11.1.
* add a few sysctl definitions, kern_getenv().
2018-05-07 22:05:51 +02:00
Jérôme Duval
57ca9c743d broadcom440x: sync with FreeBSD 11.1. 2018-05-07 22:05:50 +02:00
Jérôme Duval
3f853fd3c2 usb_audio: use user_memcpy to read/write the user buffers.
* also check buffer addresses passed through structures.
* fixes gcc5 and 64-bit warnings.
* only setup tested (lack of isochronous transfers).
2018-05-07 19:04:45 +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
33dc8de507 kernel: remove incorrect inline and static keywords for syscalls. 2018-05-06 16:27:47 +00:00
Jérôme Duval
2aaad308b8 runtime_loader: enable elf32 on x86_64, elf64 on x86.
use x86 as default sSearchPathSubDir in compatibility mode.
use the generic memset/memcpy when x86_64 is the primary arch.

Change-Id: Ib464c308ff97f7ae2482ef4c037de1b1bb2bf61b
2018-05-05 09:37:49 +00:00
Jérôme Duval
51dfedd76b libroot_x86: use the generic memset/memcpy when x86_64 is the primary arch.
the standard x86 implementation uses the commpage, which is difficult to setup. we could
also use the C++11 version instead.

Change-Id: I4be7e3466082ff2c91bc32bef377a664ce65f3fc
2018-05-05 09:37:16 +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
Adrien Destugues
7dba237f7f BSecureSocket: re-enable RSA cipher suite
my.justenergy.com allows only RSA, so we can't connect there without
this. Other websites may have a similar problem.

Also improve the handling of the error, as it was giving a generic
"general system error" to the user.

Fixes #13975.
2018-05-05 08:48:22 +02:00
Jessica Hamilton
f599721237 bootloader/efi: remove partition before adding to new list.
* A Node/Partition cannot be member of two lists at once. This
  resolves an issue where a partition cannot be found later
  due to corruption of a NodeList.
2018-05-05 14:14:35 +12:00
Jessica Hamilton
bb96d47d9b Revert "efi: force boot menu to show."
This reverts commit 3ceaa03c60.
2018-05-05 14:14:21 +12:00
Jessica Hamilton
3ceaa03c60 efi: force boot menu to show. 2018-05-05 14:11:26 +12:00
Alexander von Gluck IV
dd485ed444 elf: Add aarch64 and riscv defines
* Add some additional defines as well.

Change-Id: I0a40f6b80a634ddaf83a8c22b9726a6e1f49bd34
2018-05-04 18:32:33 +00:00
Philippe Houdoin
91077c485a /bin/shutdown: fixed bug, was returning non zero even on shutdown
success. Spotted by mcandre, thanks!
2018-05-03 12:22:45 +02:00
Jérôme Duval
1894e9b6a7 Add runtime_loader in secondary bootstrap packages.
add grist to runtime_loader source files.

Change-Id: I09c58b5cc1d57034632df99b4fb3c80e3ff49e3e
2018-05-02 16:46:02 +00:00
Jérôme Duval
fe11711026 virtio: add driver for the virtio balloon device
* how-to for qemu: command line option: -balloon virtio
* in the monitor view
    - to switch the vm size to 500MB: balloon 500
    - to display balloon info: info balloon
2018-05-02 14:24:40 +00:00
Adrien Destugues
401c837afc multi_audio: remove some unused debug macros
We were #defining DEBUG here, which leads to some system-wide debugging
macros being always enabled as well (PRINT_OBJECT and the like). This
should be managed only using SetConfigVar in UserBuildConfig.

Remove the unused UNIMPLEMENTED and BROKEN macros because everything is
implemented, and nothing is currently known to be broken :)
2018-04-29 17:25:46 +00:00
Augustin Cavalier
648f0d5f08 libroot_build: Properly remap fs_attr_* functions.
This was done using macros before, which isn't the way we have things set up.
In theory that method should work, however if not all consumers include the
libroot_build headers properly, then it breaks in subtle but confusing ways,
which is not what we want at all.

Thanks to Jessica for advice.

Change-Id: Idd45df5547daecf8239932957088da03ddfccf87
2018-04-29 17:25:18 +00:00
Jérôme Duval
88c1a9d048 virtio_net: improve performance.
* use so many buffers as the queue can contain.
* queue receive requests as soon as possible.
* don't wait for transmit completion.
* interface can now be brought down and up.
* add locking around access to lists and virtio queues.
* iperf results: guest->host 400MBits/sec.

Change-Id: I6423e4afcb59f280d702893cc8d22a9ef908113a
2018-04-26 18:46:06 +02:00
Jérôme Duval
e1ac2a3e45 virtio_pci: write config in IO-space instead of PCI config space. 2018-04-26 18:07:42 +02:00
Jérôme Duval
988f999816 virtio_block: fix build nach API change. 2018-04-26 16:36:04 +02: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
30764e3821 launch_daemon: Fixed getting data of stopped service
* If you stopped a service, and ran it manually, it would hang forever
  waiting for its port data.
2018-04-25 22:56:22 +02:00
Fredrik Holmqvist
86901205d0 Avoid arithmetic operations on void pointers
See what I did there?
2018-04-25 21:42:16 +02:00
Fredrik Holmqvist
6d34de21b8 Missing else in else if. 2018-04-25 21:41:33 +02:00
Fredrik Holmqvist
72c715ecbe Another while (( ..) 2018-04-25 21:41:33 +02:00
Fredrik Holmqvist
a7affb9189 The ' = ' character is no more. 2018-04-25 21:41:33 +02:00
Fredrik Holmqvist
b18b18ac3e Wrong order of arguments in header.
It is called from KernelInterface with Mount(&fs, server, serverName, path..
That is also what FileSystem.cpp says.
2018-04-25 21:41:33 +02: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
Axel Dörfler
6d7b8a3088 launch_daemon: Renamed TeamRegistrator to TeamListener 2018-04-25 10:10:43 +02:00
Jérôme Duval
95cebb26c7 fat: fix gcc2 build 2018-04-24 20:32:40 +02:00
Jérôme Duval
7760bb460f ntfs: fake_read_attrib used the user buffer directly
It now uses user_strlcpy()
2018-04-24 20:06:05 +02:00
Jérôme Duval
b0bcd96bd7 fat: use the return value of strlcpy instead of strlen. 2018-04-24 19:54:00 +02:00
Fredrik Holmqvist
e3becd53ee Ternary operator proper precedence.
Going through PVS Studio blogs on Haiku.
2018-04-23 23:25:16 +02:00
Axel Dörfler
7750fdcf18 vfs: _user_flock() did not use FS advisory locking calls
* The kernel's advisory locking implemenation must not be used if the
  file system has its own (ie. network file systems).
* Added ASSERT to free_vnode() that assures there is no locking left;
  I recently had a lot of them around.
2018-04-22 15:13:29 +02:00
Fredrik Holmqvist
58c99ce4d4 malloc_referenced adds +1 to int32 pointer so use its release 2018-04-22 12:47:30 +02:00
Fredrik Holmqvist
c0ceea9c79 Remove unused var and always true check. Clean redeclaration. 2018-04-22 12:09:56 +02:00
Fredrik Holmqvist
aa2c061c3d cppcheck: Shifting 32-bit value by 63 bits is undefined. 2018-04-22 11:47:15 +02:00
Fredrik Holmqvist
99400bbed0 Objs in array was deleted, but not array itself. 2018-04-22 00:12:08 +02:00
Zoltán Mizsei
c74be242c4 iwn: add working pci id for Intel 6235 2018-04-21 22:06:04 +00:00
Fredrik Holmqvist
c7fad27a8b Free ci on error 2018-04-21 23:37:01 +02:00
Fredrik Holmqvist
29208af825 Redundant '(' 2018-04-21 23:36:04 +02:00
Fredrik Holmqvist
5676dce83c memcmp on sizeof(x)==0 bytes fix 2018-04-21 23:34:16 +02:00
Adrien Destugues
1b4fdf606d intel_extreme: fix C++ syntax.
Thanks to tqh and cpcheck for finding this.
2018-04-21 22:12:26 +02:00
Jérôme Duval
853a76f1f3 vt612x: sync with FreeBSD 11.1. 2018-04-21 22:07:48 +02:00
Jérôme Duval
e68394b978 ar81xxx: sync with FreeBSD 11.1. 2018-04-21 21:55:58 +02:00
Jérôme Duval
dde876f9f8 kernel: pae paging: align *TableEntry() with 64bit paging
use SetTableEntry() in PutPageTableInPageDir() and PutPageTableEntryInTable().
2018-04-21 10:06:51 +00:00
Jérôme Duval
03df8bfcf2 kernel: vm: reduce stack usage in swap_init_post_modules().
* avoid a struct copy in PartitionScorer.
* reduce stack usage in get_mount_point().

Change-Id: I60a3161ba39e9a50eaae972b7ff5b4a26d6292fa
2018-04-18 12:37:02 +00:00
Jérôme Duval
1fb59be1d1 Fix some usages of BStackOrHeapArray.
Validates the buffer with IsValid() before actually using it. Thanks Rene!
2018-04-16 14:30:34 +00:00
Jérôme Duval
4b588b36ad virtio_scsi: avoid unbounded stack usage in ExecuteRequest(). 2018-04-11 23:45:50 +00:00
Jérôme Duval
48c1ae929e libroot: avoid excessive stack usage in __find_directory()
create_path() is inlined in __find_directory().
2018-04-11 23:44:22 +00:00
Jérôme Duval
70422d06a9 ipv6: avoid unbounded stack usage in send_fragments(). 2018-04-11 23:43:47 +00:00
Jérôme Duval
df4bea7d7c usb_hid: add a list blacklisted devices 2018-04-09 22:06:55 +02:00
Alexander Coers
272475393c Changed PNG translator config view
Removed workaround for already fixed bug 4217 and removed the call
to SetExplicitPreferredSize(), since the layout system was always able 
to calculate good values for PreferredSize.
So for me the call seems to be superfluous.

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Part of #10509
2018-01-24 07:59:55 +00:00
Jérôme Duval
34cdda1dd5 kernel: x86: enable writes before patching.
Follow up for commit a2021292d4.
Binary patching would otherwise fail after the kernel text area
becomes read-only.
2018-01-23 17:59:41 +01:00
Jérôme Duval
c8fcb2a04e udis86: Add clac/stac instructions for SMAP.
still in a PR:
e9dfa2d79a
2018-01-22 20:06:55 +01:00