Commit Graph

51575 Commits

Author SHA1 Message Date
Adrien Destugues
5fae0bc1a2 Add some cppunit-based tests for BTextView.
Note that this does not reproduce #8447. I could not get more precise
details from involved people about how to reproduce this, and the patch
was already applied anyway, so I'm stopping my investigation for now.
Feel free to complete this with more test cases.
2014-09-19 09:59:38 +02:00
Stefano Ceccherini
0bbed9620a TextGapBuffer: Style changes
Change long to int32
Removed useless parenthesis
2014-09-19 09:28:14 +02:00
Stefano Ceccherini
0eb9b74e00 BTextView: Fixed GetText().
Patch by Pete Goodeve which fixes a problem in TextGapBuffer::GetString()
used by BTextView::GetText(). Thanks! Fixes #8447.
2014-09-19 09:17:17 +02:00
Stephan Aßmus
d6bd3409e5 HaikuDepot: Don't right-align publisher/copyright...
... in the available space in the package title area. Just looks too random.
2014-09-18 22:39:45 +02:00
Stephan Aßmus
81c000dd0d HaikuDepot: Add "Log in" menu item which shows new window 2014-09-18 22:39:43 +02:00
Stephan Aßmus
700a71bdb8 HaikuDepot: WIP interface for logging in...
... or creating a new account in the web application. Just the interface,
nothing is functional, yet.
2014-09-18 22:39:41 +02:00
Stephan Aßmus
4f4f859c1a HaikuDepot: Small code cleanups in PackageInfo. 2014-09-18 22:39:38 +02:00
Stefano Ceccherini
ef860b2e96 NetStack: Fix locking
Change the monitor_lock to be a recursive_lock, fixing #7039.
Notify_device_monitor acquires the monitor lock, then the
monitor unregisters itself, calling unregister_device_monitor, which
acquires the monitor lock again.
2014-09-18 21:45:44 +02:00
Adrien Destugues
3ae6595c39 Build fix. 2014-09-18 17:41:21 +02:00
Janus
a74b2df992 Fix #9448. [notification_server] monitors screen resolution 2014-09-18 17:06:15 +02:00
Augustin Cavalier
016ef2de8b makefile_engine: fix wording, rewrap, bump version, capitalize name.
* Improve wording, fix spelling errors, rewrap
* Capitalize name
* Adjust templates to match.

Fixes #11158.

Signed-off-by: Adrien Destugues <pulkomandy@pulkomandy.tk>
2014-09-18 16:29:44 +02:00
Alex Smith
8c7c8ec49f Update x86_64 bison package to 2.6.5
The previous package was broken (would often segfault, prevented
building Haiku cross-tools under x86_64), so update to the latest
version in HaikuPorts.

Signed-off-by: Alex Smith <alex@alex-smith.me.uk>
2014-09-18 15:14:16 +01:00
Adrien Destugues
77e139232c Syntax fix.
Sorry!
2014-09-18 15:01:57 +02:00
Adrien Destugues
1c3d2f2da4 Remove git_cvs from the non-hybrid gcc2 image.
It depends on gcc4-only package cvsps. Thanks to Ingo for suggestion on
how to do this.
2014-09-18 14:57:50 +02:00
Adrien Destugues
fda3962062 Migrate to Python 2.7.
* I rebuilt all packages that depend directly on python: I hope I
didn't miss anything.
* SVN upgraded to 1.8.10 because I couldn't get 1.6.18 to build. This
required uodating expat, apr and apr_util, and adding serf which
replaces neon for SVN http support.
* Everything seems to be running fine so far.
2014-09-18 10:06:33 +02:00
Julien Lepiller
73309d564f bootman: add the drive's icon in the drive list
* Also check status of GetIcon()
* Delete fDrive, fIcon in destructor

Fixes #7088

Signed-off-by: Jessica Hamilton <jessica.l.hamilton@gmail.com>
2014-09-18 15:50:18 +12:00
Jérôme Duval
c8990b0907 _user_wait_for_objects: remove redundant check. 2014-09-17 21:04:14 +02:00
Adrien Destugues
7603710e9a Style fixes. 2014-09-16 21:39:53 +02:00
Adrien Destugues
804876f698 Style fixes. 2014-09-16 21:38:24 +02:00
Adrien Destugues
ce1f0d0a96 Remove the "old" network preflet.
This code is unused since 2007 and it's in the git history if you ever
need it again.
2014-09-16 21:33:12 +02:00
Adrien Destugues
2c8da96546 WebPositive: improve "show bookmark bar" menu item
* Disable the menu item when the folder doesn't exist, as the bar won't
show in that case.
* Use a mark on the item to tell wether the bar is visible, rather than
changing its label
* Simplify the logic for hiding and showing the bar. It is safe to call
_ShowBookmarkBar even if the bar doesn't exist, so no need to check for
it everywhere.

Fixes #11199.
2014-09-16 17:40:34 +02:00
Adrien Destugues
21f8e588da Optimize BUrl copy.
BUrl is passed by value in many places, and we should make sure this is
as efficient as possible. There is little point in initializing all the
strings then overwriting them by using the copy constructor, when we can
set them directly.
2014-09-16 15:30:01 +02:00
Adrien Destugues
c98378e51a Add HTTP proxy support.
* Move default context management to BUrlRequest since some code
(including the testsuite) bypass the BUrlProtocolRoster.
* Introduce proxy host and port in BUrlContext
* Have BHttpRequest use the proxy when making requests
2014-09-15 14:24:37 +02:00
Jessica Hamilton
cee64ce507 intel_extreme: probe all GPIO pins 2014-09-15 09:21:00 +02:00
Jessica Hamilton
9965ac0677 Partition.cpp: fix function prototype. 2014-09-15 16:40:25 +12:00
Jessica Hamilton
f0b0d6578b Undo accidental file mode changes. 2014-09-15 16:38:30 +12:00
Jessica Hamilton
fd7f53f049 storage kit: don't expose the dev_t in BPartition::Mount()
Comments to #9672 agree that there's really no need to
expose the dev_t handle, thus simplifying the API.

The dev_t handle, if required, can be retrieved via
BPartition::GetVolume() instead.
2014-09-15 16:28:41 +12:00
Paweł Dziepak
95e97463d2 kernel: add generic wrapper for accessing user memory
This patch adds user_access() which can be used to gracefully handle
page faults that may happen when accessing user memory. It is used
by arch_cpu_user{memcpy, memset, strlcpy}() to allow using optimized
functions from the standard library.

Currently only x64 uses this, but nothing really is arch specific here.

Signed-off-by: Paweł Dziepak <pdziepak@quarnos.org>
2014-09-14 22:39:07 +02:00
Paweł Dziepak
e81b792e8f Merge branch 'memcpy-v3'
This is a major rework of how Haiku implements memset() and memcpy() on
x64. These functions are now removed from the commpage and reimplemented
in C++ using sse2 where it proved to be beneficial. That required some
serious changes in handling fpu state. Now, full fpu state is saved
at each interrupt, but not on task switch.

Some numbers: results of building targets: kernel libroot.so runtime_loader
and HaikuDepot on Intel i7 4770 with 16GB of memory.

real
user
sys

before:
1m54.367
7m40.617
0m58.641

1m33.922
8m12.362
1m0.852

1m32.922
8m10.509
1m1.006

1m31.947
8m12.596
1m1.353

after:
1m50.959
7m43.118
0m58.923

1m30.644
8m6.385
1m0.584

1m31.549
8m7.976
0m59.792

1m31.546
8m6.733
1m0.242
2014-09-14 19:26:07 +02:00
Paweł Dziepak
4582b6e3a3 libroot/x86_64: new memcpy implementation
This patch introduces new memcpy() implementation that improves the
performance when the buffer is small. It was written for processors that
support ERMSB, but performs reasonably well on older CPUs as well.

The following benchmarks were done on Haswell i7 running Debian Jessie
with Linux 3.16.1. In each iteration 64MB buffer was copied, the
parameter "size" is the size of the buffer passed in a single call (i.e.
for "size: 2" memcpy() was called ~32 million times to copy the whole
64MB).

f - original implementation, g - new implementation, all buffers 16 byte
aligned

cpy, size:        8, f:    79971 µs, g:    20419 µs, ∆:   74.47%
cpy, size:       32, f:    42068 µs, g:    12159 µs, ∆:   71.10%
cpy, size:      128, f:    13408 µs, g:    10359 µs, ∆:   22.74%
cpy, size:      512, f:    10634 µs, g:    10433 µs, ∆:    1.89%
cpy, size:     1024, f:    10474 µs, g:    10536 µs, ∆:   -0.59%
cpy, size:     4096, f:     9419 µs, g:     8630 µs, ∆:    8.38%

f - glibc 2.19 implementation, g - new implementation, all buffers 16 byte
aligned

cpy, size:        8, f:    26299 µs, g:    20919 µs, ∆:   20.46%
cpy, size:       32, f:    11146 µs, g:    12159 µs, ∆:   -9.09%
cpy, size:      128, f:    10778 µs, g:    10354 µs, ∆:    3.93%
cpy, size:      512, f:    12291 µs, g:    10426 µs, ∆:   15.17%
cpy, size:     1024, f:    13923 µs, g:    10571 µs, ∆:   24.08%
cpy, size:     4096, f:    11770 µs, g:     8671 µs, ∆:   26.33%

f - glibc 2.19 implementation, g - new implementation, all buffers unaligned

cpy, size:       16, f:    13376 µs, g:    13009 µs, ∆:    2.74%
cpy, size:       32, f:    11130 µs, g:    12171 µs, ∆:   -9.35%
cpy, size:       64, f:    11017 µs, g:    11231 µs, ∆:   -1.94%
cpy, size:      128, f:    10884 µs, g:    10407 µs, ∆:    4.38%
cpy, size:      256, f:    10826 µs, g:    10106 µs, ∆:    6.65%
cpy, size:      512, f:    12354 µs, g:    10396 µs, ∆:   15.85%

Signed-off-by: Paweł Dziepak <pdziepak@quarnos.org>
2014-09-14 19:16:52 +02:00
Paweł Dziepak
1d7b716f84 libroot/x86_64: new memset implementation
This patch introduces new memset() implementation that improves the
performance when the buffer is small. It was written for processors that
support ERMSB, but performs reasonably well on older CPUs as well.

The following benchmarks were done on Haswell i7 running Debian Jessie
with Linux 3.16.1. In each iteration 64MB buffer was memset()ed, the
parameter "size" is the size of the buffer passed in a single call (i.e.
for "size: 2" memset() was called ~32 million times to memset the whole
64MB).

f - original implementation, g - new implementation, all buffers 16 byte
aligned

set, size:        8, f:    66885 µs, g:    17768 µs, ∆:   73.44%
set, size:       32, f:    17123 µs, g:     9163 µs, ∆:   46.49%
set, size:      128, f:     6677 µs, g:     6919 µs, ∆:   -3.62%
set, size:      512, f:    11656 µs, g:     7715 µs, ∆:   33.81%
set, size:     1024, f:     9156 µs, g:     7359 µs, ∆:   19.63%
set, size:     4096, f:     4936 µs, g:     5159 µs, ∆:   -4.52%

f - glibc 2.19 implementation, g - new implementation, all buffers 16 byte
aligned

set, size:        8, f:    19631 µs, g:    17828 µs, ∆:    9.18%
set, size:       32, f:     8545 µs, g:     9047 µs, ∆:   -5.87%
set, size:      128, f:     8304 µs, g:     6874 µs, ∆:   17.22%
set, size:      512, f:     7373 µs, g:     7486 µs, ∆:   -1.53%
set, size:     1024, f:     9007 µs, g:     7344 µs, ∆:   18.46%
set, size:     4096, f:     8169 µs, g:     5146 µs, ∆:   37.01%

Apparently, glibc uses SSE even for large buffers and therefore does not
takes advantage of ERMSB:

set, size:    16384, f:     7007 µs, g:     3223 µs, ∆:   54.00%
set, size:    32768, f:     6979 µs, g:     2930 µs, ∆:   58.02%
set, size:    65536, f:     6907 µs, g:     2826 µs, ∆:   59.08%
set, size:   131072, f:     6919 µs, g:     2752 µs, ∆:   60.23%

The new implementation handles unaligned buffers quite well:

f - glibc 2.19 implementation, g - new implementation, all buffers unaligned

set, size:       16, f:    10045 µs, g:    10498 µs, ∆:   -4.51%
set, size:       32, f:     8590 µs, g:     9358 µs, ∆:   -8.94%
set, size:       64, f:     8618 µs, g:     8585 µs, ∆:    0.38%
set, size:      128, f:     8393 µs, g:     6893 µs, ∆:   17.87%
set, size:      256, f:     8042 µs, g:     7621 µs, ∆:    5.24%
set, size:      512, f:     9661 µs, g:     7738 µs, ∆:   19.90%

Signed-off-by: Paweł Dziepak <pdziepak@quarnos.org>
2014-09-14 19:16:52 +02:00
Paweł Dziepak
718fd007a6 kernel/x86_64: clear xmm0-15 registers on syscall exit
As Alex pointed out we can leak possibly sensitive data in xmm registers
when returning from the kernel. To prevent that xmm0-15 are zeroed
before sysret or iret. The cost is negligible.

Signed-off-by: Paweł Dziepak <pdziepak@quarnos.org>
2014-09-14 19:16:52 +02:00
Paweł Dziepak
396b74228e kernel/x86_64: save fpu state at interrupts
The kernel is allowed to use fpu anywhere so we must make sure that
user state is not clobbered by saving fpu state at interrupt entry.
There is no need to do that in case of system calls since all fpu
data registers are caller saved.

We do not need, though, to save the whole fpu state at task swich
(again, thanks to calling convention). Only status and control
registers are preserved. This patch actually adds xmm0-15 register
to clobber list of task swich code, but the only reason of that is
to make sure that nothing bad happens inside the function that
executes that task swich. Inspection of the generated code shows
that no xmm registers are actually saved.

Signed-off-by: Paweł Dziepak <pdziepak@quarnos.org>
2014-09-14 19:16:52 +02:00
Paweł Dziepak
b41f281071 boot/x86_64: enable sse early
Enable SSE as a part of the "preparation of the environment to run any
C or C++ code" in the entry points of stage2 bootloader.

SSE2 is going to be used by memset() and memcpy().

Signed-off-by: Paweł Dziepak <pdziepak@quarnos.org>
2014-09-14 19:16:52 +02:00
Paweł Dziepak
acad7bf64a kernel/x86_64: make sure stack is properly aligned in syscalls
Just following the path of least resistance and adding andq $~15, %rsp
where appropriate. That should also make things harder to break
when changing the amount of stuff placed on stack before calling the
actual syscall routine.

Signed-off-by: Paweł Dziepak <pdziepak@quarnos.org>
2014-09-14 19:16:52 +02:00
Paweł Dziepak
f2f91078bd kernel/x86_64: remove memset and memcpy from commpage
There is absolutely no reason for these functions to be in commpage,
they don't do anything that involves the kernel in any way.

Additionaly, this patch rewrites memset and memcpy to C++, current
implementation is quite simple (though it may perform surprisingly
well when dealing with large buffers on cpus with ermsb). Better
versions are coming soon.

Signed-off-by: Paweł Dziepak <pdziepak@quarnos.org>
2014-09-14 19:16:52 +02:00
Paweł Dziepak
6156a508ad kernel/x86[_64]: remove get_optimized_functions from cpu modules
The possibility to specify custom memcpy and memset implementations
in cpu modules is currently unused and there is generally no point
in such feature.

There are only 2 x86 vendors that really matter and there isn't
very big difference in performance of the generic optmized versions
of these funcions across different models. Even if we wanted different
versions of memset and memcpy depending on the processor model or
features much better solution would be to use STT_GNU_IFUNC and save
one indirect call.

Long story short, we don't really benefit in any way from
get_optimized_functions and the feature it implements and it only adds
unnecessary complexity to the code.

Signed-off-by: Paweł Dziepak <pdziepak@quarnos.org>
2014-09-14 19:16:51 +02:00
Oliver Tappe
5399d1df38 Fix (hopefully) bootstrap build with HAIKU_NO_DOWNLOADS=1
* With HAIKU_NO_DOWNLOADS=1, the check against existing package files
  in the download folder should only be done in the phase that is
  adding packages to be put onto the resulting target image, not in the 
  phase that is adding the bootstrap packages (as here those packages 
  will be *built*, not downloaded).
2014-09-14 14:30:56 +02:00
Axel Dörfler
5061f35c3f Installer: don't replace system/settings.
* Instead of removing "system" in the target completely, only
  replace all of its subfolders.
* The downside of the current solution is that extra files, and
  directories in "system" will not be removed. Improvements
  welcome.
2014-09-14 14:11:01 +02:00
Axel Dörfler
2dba000784 libroot: sethostname() now uses ftruncate().
* Before, it would just overwrite the previous name, leaving extra
  bytes from the previous name (they wouldn't become part of the
  host name, but it just didn't look that nice).
2014-09-14 14:11:00 +02:00
Alex Smith
6762f5f678 HaikuDepot: Fix x86_64 build failure
Fix the following errors:

  PackageInfo.cpp:85:23: error: comparison between signed and unsigned integer expressions
  PackageInfo.cpp:93:21: error: comparison between signed and unsigned integer expressions

Signed-off-by: Alex Smith <alex@alex-smith.me.uk>
2014-09-14 09:27:54 +01:00
Fredrik Holmqvist
3594baabf8 Add get_name and fix get_next_object.
TODO: Need to add defines or enum for nameType.
2014-09-14 00:01:10 +02:00
Stephan Aßmus
e0881f2139 HaikuDepot: Fixed reading bigger screenshots
* Increase the RAM limit to 128K per screenshot
 * Reduce retrieved size to 320 pixel wide
 * Don't expect to be able to read the stream in one call,
   read it in 4K chunks.
 * Print some errors in this code-path to stderr.
2014-09-13 23:03:58 +02:00
Stephan Aßmus
ab172803ff HaikuDepot: Improve filter UI, fix pkg translations
* The categories and other filter options are orthogonal. Don't
   force the user to choose between real categories and for example
   "installed" or "available" in the same drop-down. I've removed
   (for now) the Options main menu. There are now four small check-marks
   below the filtering drop-downs: Available, Installed, Development and
   Source Code. These enable showing the respective packages in the list
   view. Only "Available" is checked by default. This changes the default
   behavior to show only not-yet-installed packages. This change puts
   the filtering options in one place, the showing of development or
   source code packages is not "hidden somewhere else" anymore. I am not
   so happy with the additional row, however, I am also thinking about
   using icons instead of the checkmarks.
 * Fixed finding the suitable package translation for summary and
   description. For example, WonderBrush now has a German translation.
2014-09-13 23:03:56 +02:00
Puck Meerburg
8bfb30ceb3 BPartition: Move dev_t return value to an optional parameter
Signed-off-by: Jessica Hamilton <jessica.l.hamilton@gmail.com>
2014-09-12 18:07:53 +12:00
Janus
fcc65d4a33 Fix #6865: [Tracker] Use default checkboxes for permissions 2014-09-12 17:11:49 +12:00
Paweł Dziepak
b52b104798 boot/x86_64: convert address of previous_debug_output
Together with the previous commit should fix #10535.

Signed-off-by: Paweł Dziepak <pdziepak@quarnos.org>
2014-09-12 01:09:17 +02:00
Paweł Dziepak
c343f75d76 boot/x86_64: call debug_cleanup() before preparing mmu data
long_mmu_init() prepares initial paging structures for 64 bit kernel.
Once that function completes bootloader cannot allocate any memory
that needs to be passed to the kernel.

Signed-off-by: Paweł Dziepak <pdziepak@quarnos.org>
2014-09-12 01:09:14 +02:00
Adrien Destugues
21de8955c8 Release HaikuWebKit 1.4.4. 2014-09-11 18:30:34 +02:00
Fredrik Holmqvist
c262488a26 Codestyle. 2014-09-10 22:31:40 +02:00