Commit Graph

58432 Commits

Author SHA1 Message Date
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
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
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
waddlesplash
71819cc094 ArchitectureRules: Disable the 'fork' builtin on GCC4+.
On GCC 7.3, it conflicts with our definition of 'fork'. The documentation
states that disabling builtins has no effect on versions where they
do not exist, so we don't need to check for GCC7 here.
2018-05-19 20:33:10 -04:00
waddlesplash
d1feb7cb60 build_cross_tools: Have scripts exit on failure.
Previously they just silently continued, which meant that if part of the
cross-tools build failed, you would have to scroll back pretty far to
see what the failure was.
2018-05-19 14:54:10 -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
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
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
fbrosson
4e0c3c7cfe HaikuBootstrap: add the "ram_disk" and "virtio_net" drivers.
* The ram_disk driver was missing in the bootstrap images. Adding
  it will allow the ramdisk command to work. And with a modified
  haikuports.conf one might even use a ramdisk TREE_PATH.
* The virtio_net driver will probably be handy in some situations.
2018-05-14 16:33:36 +00: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
Adrien Destugues
58ce50d3a5 Try to fix gcc2 build
git_svn needs alien_svn, but we don't include this in the build repos.
Remove it from the preinstalled software, it is available in the depot
if people need it.
2018-05-07 13:31:49 +02: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
Jessica Hamilton
74bfec3b96 build/jam: whitespace cleanup.
Change-Id: I80c9a51417631b1f283923451f5bb530097b74f3
2018-05-07 13:12:16 +12:00
Adrien Destugues
2ecf221b74 Fix name of libWebKit for newer releases.
Yes, we're now officially using "legacy" WebKit!
2018-05-06 20:22:25 +02:00
Jérôme Duval
33dc8de507 kernel: remove incorrect inline and static keywords for syscalls. 2018-05-06 16:27:47 +00:00
Adrien Destugues
efd07aad5b Update to haikuwebkit 1.6.4 (x86 only).
... and synchronize all packages with haikuports.
2018-05-05 18:00:18 +02: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
891a743ac3 x86_64: add kernel define and macro for x86 compatibility.
thus the kernel can be built with 32-bit compatibility support.

Change-Id: I5699bcb04908d5abb01da3166c3c180582b9026f
2018-05-05 09:31:40 +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