Commit Graph

8413 Commits

Author SHA1 Message Date
Adrien Destugues
3749038b53 MouseDownThread: let thread terminate cleanly.
* Killing the thread leaks resources, and it will terminate cleanly and
safely when the destructor exits anyway.
* Fixes #12293. Thanks to ttcoder, jackburton and bonefish for investigating!
* Does not fix #12286. Going to bissect now...
2015-08-07 21:05:55 +02:00
Dario Casalinuovo
7771139cdf BMediaEventLooper: Rewrite ControlLoop()
* The first problem was the O(n^2) complexity of the algorithm, it's
  now linear and try to act in a circular way by dispatching
  events and reading the port in a balanced way. This exclude
  a certain degree of possible deadlocks.
* Add detection and escape when the system try to kill the
  thread. This solve some blocking issues on exit et similia
  that i had with libjackcompat.
* The algorithm choose soon which event to focus on.
* Lateness is calculated just before the event is dispatched
  as it is the more appropriate place, otherwise we would be
  calculating something imprecise/guessed.
* Remove timed_event_queue::queued_time. It's more precise to
  just use the RealTime() before to Dispatch the event.
* It should solve the BSoundPlayer lateness problems.
* With those improvements the media_kit is not going to lock
  completely under stress conditions, instead it try to work
  in a best effort shape.
* There's still room for improvements, for example i'm considering some
  strategies in lateness situations such as update scheduling latency,
  try to decrease waiting time and detect when we are too early on
  the other hand to recover when the load go down.
* Thanks to Julian Harnath for sharing his WIP patch which helped
  with some controls such as avoiding negative lateness.
* Comments are welcome!
2015-08-03 01:35:09 +02:00
Michael Lotz
f9a8f3e727 Clean up various whitespace and fix one header guard. 2015-08-02 23:19:07 +02:00
Jérôme Duval
b4665f9a59 HttpForm needs another friend class for GCC6. 2015-07-30 22:25:19 +02:00
Axel Dörfler
7b0ff5c6e6 BAlert: use layout API, allow any number of buttons.
* Added default constructor; you can now alter the complete behavior
  via setters, and also add buttons afterwards.
2015-07-30 19:50:03 +02:00
Axel Dörfler
99b4affab6 Added BWindow::ResizeToPreferred().
* B_AUTO_UPDATE_SIZE_LIMITS only really makes sense for resizable
  windows, and it only sets the minimum/maximum window size.
* ResizeToPreferred() resizes the window to its preferred size, and
  also supports height-for-width layouts.
2015-07-30 19:49:48 +02:00
Dario Casalinuovo
8acd164f8c Add new version of launch_media_server
* Due to the needs to provide a peaceful UX, i moved out the
  notifications mechanism from the Media preflet and i have
  integrated it with the launch and shutdown functions of MediaDefs.h.
* This implied to introduce a new launch_media_server function
  similar to the shutdown_media_server allowing to specify a custom
  notification function too.
* Both functions then are reworked to send by default notifications
  to the Deskbar, this was needed because in a lot of situations
  the mechanism failed without correctly noticing the user.
* The one argument launch_media_server is considered to be deprecated,
  the default argument is removed to mantain binary compatibility but
  make new apps to automatically use the new one with just the default
  arguments. This is needed due to conflicts in overloading.
* Improve notifications by indirectly extending localization
  to old BeOS apps.
2015-07-29 18:03:32 +02:00
Jérôme Duval
189156a069 Boot stdio.h: define a bunch of functions required by c++ headers. 2015-07-26 10:07:21 +02:00
Jérôme Duval
4fb4b32043 Force use of std::isnan() in agg_conv_curve.h.
cmath could be included before inclusion of this header, thus undefining isnan.
2015-07-25 23:42:14 +02:00
Dario Casalinuovo
32afe10ab2 BMediaRoster: Add B_MEDIA_SERVER_STARTED and B_MEDIA_SERVER_QUIT
* This is done by watching to registrar notifications
  and providing a minimal service to contact the
  media roster in private API. The roster use this
  service to automatically reconnect to the media_server.
2015-07-24 12:19:33 +02:00
Dario Casalinuovo
e57acc3a99 BMediaRoster: Fix initialization and destruction
* Improve consistency by adding a BMediaRosterEx destructor
  and using it for the specular functionality of ctor instead
  to use the father's class destructor.
* Avoid double initialization of MediaInitializer that
  becomes MediaRosterUndertaker.
* Remove superfluos call to BMediaRoster::Quit()
  in media_addon_server.
2015-07-24 12:19:32 +02:00
Dario Casalinuovo
6cd18b575c BMediaRosterEx: cleanup and fix style in the header 2015-07-24 12:19:32 +02:00
Dario Casalinuovo
67483edabd Add BMediaRoster::IsRunning
* This function is provided to check
  if media services are running.
2015-07-24 12:19:31 +02:00
Augustin Cavalier
2090ed133e Tracker: IconMenuItem: Don't "use namespace" in a shared header. 2015-07-23 11:50:23 -04:00
Axel Dörfler
34671d601a Added execvpe().
* This closes #12114 again; while not POSIX, it's just a line away.
* Removed exect() from the header -- not sure where this came from.
  but I can't find anything about it on the net.
* Consolidated use of asterisk style in exec.cpp.
2015-07-23 13:30:30 +02:00
Augustin Cavalier
58ee42e9df BToolBar: Add a "text" parameter.
For defining the text that appears alongside the icon.

This function really has too many parameters; we probably should break
it out into a BAction class...
2015-07-22 17:37:56 -04:00
Axel Dörfler
326e03f721 BLaunchRoster: removed be_launch_roster again.
* Not implemented, an unused -- no need for a global instance.
2015-07-22 20:45:33 +02:00
Axel Dörfler
d94e9c97d2 launch_daemon: Added support for external events.
* Other apps can register events, and the launch_daemon can act on them
  when they are triggered.
2015-07-22 20:45:24 +02:00
Axel Dörfler
fb7dad2b49 BRoster: Added ability to pass env on launch.
* Added BRoster::Private::Launch() that adds an additional parameter
  to pass a pointer to the environment of the launched app.
2015-07-22 20:44:03 +02:00
Axel Dörfler
06e0f8079f registrar: Fixed app_server detection.
* This also fixes the shutdown process, as the registrar no longer
  kills the app_server.
* Removed SERVER_PORT_NAME definition as it has no use anymore.
2015-07-22 20:43:58 +02:00
Axel Dörfler
4c67f79c2c FirstBootPrompt: launch installer/desktop targets directly.
* No need for shell scripting here.
2015-07-22 20:43:44 +02:00
Axel Dörfler
7987907008 launch_daemon: We can now talk to the authentication manager.
* When creating the port of the registrar's authentication manager, we
  now set it manually, so that the user/group functions work.
* This allows LaunchDaemon::_StartSession() to set up the user, and
  groups as needed.
2015-07-22 20:43:26 +02:00
Axel Dörfler
560119c9a4 launch_daemon: Don't verify passwords.
* Instead, the caller should have done this already. This is really
  outside of the scope of the launch_daemon.
* Fixed Login with empty passwords; removed the (unused) test login
  feature along the way.
2015-07-22 20:43:22 +02:00
Axel Dörfler
c4b6278c02 DriverSettingsMessageAdapter: added "wildcard" support.
* You can now add arbitrarily named fields to the message as well,
  without having them all specified in the template.
* Also added a missing converter method that is called when there
  are no values to add, and implemented all methods in the base
  class, so that you only have to implement the methods you actually
  need.
2015-07-22 20:42:22 +02:00
Axel Dörfler
78e39852fa launch_daemon: Use BRoster::Launch() without registrar.
* BRoster now allows settings a "no-registrar" mode that is currently
  only honored in _LaunchApp(), though.
* Job::Launch() is now using this, which also allows launching
  applications by signature (ie. if the job name matches the
  signature, you can omit the "launch" option).
2015-07-22 20:42:13 +02:00
Axel Dörfler
c086a1834b launch_daemon: Improved target support.
* You can now put jobs/services into a target.
* Instead of having Login started as part of the normal boot process,
  it's now in the "login" target.
* The app_server now launches the login target when a login becomes
  available (ie. during startup, but that could be improved later on).
2015-07-22 20:41:51 +02:00
Axel Dörfler
ac0a462fba launch_daemon: Basic user session implementation.
* Instead of launching Tracker/Deskbar directly, we now launch the
  Login application.
* This will now start a new session for the selected user (the password
  is currently ignored).
* When a user session is started, the launch_daemon forks, and the
  child then restarts the LaunchDaemon application in user mode.
* It then registers itself with its parent, in order to resolve user
  dependent services.
* Added a user launch file that will cause Tracker, and Deskbar to
  start in the new session.
2015-07-22 20:41:37 +02:00
Axel Dörfler
bea38cb711 registrar: implemented auth port via launch_daemon.
* get_roster_port_name() is no longer needed.
* This also removes the app_server restart code from the debug
  server -- this will be done by the launch_daemon in the future.
2015-07-22 20:41:01 +02:00
Axel Dörfler
798ad3db30 BLooper: don't delete a launch_daemon port.
* Unless the service is really to be quit, the port should stay around;
  but that decision is to be made by the launch_daemon, not the service
  itself.
2015-07-22 20:40:52 +02:00
Axel Dörfler
4bf862e368 syslog_daemon: Converted to BServer.
* Instead of letting the kernel search for the syslog port, the
  daemon now registers itself with the kernel (which even solves
  a TODO).
* A port is created for the actual log messages from the launch_daemon,
  and used on start.
* However, the SyslogTest does not yet work, due to the BMessage <->
  KMessage communication problems.
2015-07-22 20:40:47 +02:00
Axel Dörfler
9d69dc097d libroot: added ability to communicate with the launch_daemon.
* These methods don't really work yet, as BMessage doesn't support
  replying with a KMessage; the request is received, but the reply
  never gets to the target.
2015-07-22 20:40:42 +02:00
Axel Dörfler
43aec2c726 launch_daemon: added support for arbitrary ports.
* Dropped "create_port" -- this is now the default for services.
* Additionally (or alternatively, if you use the "legacy" mode), you can
  now create named ports, and specify their capacity.
* Added convenience methods to BLaunchRoster that automatically use the
  signature of the current be_app.
2015-07-22 20:40:38 +02:00
Axel Dörfler
592ffe6461 The app_server is now a regular BServer. 2015-07-22 20:40:29 +02:00
Axel Dörfler
d482c7ca5b launch_daemon: actually launch the jobs.
* BRoster::Launch() cannot be used (yet), as it pre-registers the
  application we're launching, and that won't work for the registrar or
  anything else until the registrar is up and running.
* Renamed B_GET_LAUNCH_CONNECTIONS to B_GET_LAUNCH_DATA.
* Add the team ID to the get-launch-data reply.
* Added BLaunchRoster::GetPort() for convenience.
* Removed some superfluous debug output, but temporarily dump all stdio
  to /dev/dprintf (ie. the syslog).
* Made job matching case insensitive (as MIME types should be).
2015-07-22 20:40:01 +02:00
Axel Dörfler
035e3e77ed kernel: profile system when SYSTEM_PROFILER is defined.
* This enables a mechanism to profile almost the complete boot process
  (starting with main2()), if SYSTEM_PROFILER is defined to 1.
* You can access the profiling data using "profile -r".
2015-07-22 20:39:52 +02:00
Axel Dörfler
1480e5da6f The beginnings of a launch_daemon for Haiku.
* This will be heavily inspired by Apple's launchd, as well as
  systemd -- for now it really doesn't do a whole lot, though.
* What works so far: the configuration files are read, parsed, and
  the jobs created.
* The jobs are even initialized, and their message ports created.
* BApplication now retrieves a previously created port from the
  launch_daemon for use with BServer.
* Only the registrar actually uses this for now.
2015-07-22 20:39:47 +02:00
Augustin Cavalier
5f83ad89eb Tracker: Move DirMenu.h to headers/private/tracker so other applications can uuse it. 2015-07-21 19:52:43 -04:00
Jérôme Duval
94887feb64 Added some support for GCC 5+. 2015-07-20 21:45:02 +02:00
Rene Gollent
df459da6ed {Tree,Table}: Add cell rect accessor.
BColumnListView:
- Add helper method for getting the visible rect of a given field.
  Refactor SuggestTextPosition to use it.

{Tree,Table}:
- Add wrapper to retrieve table cell rect using the aforementioned
  BCLV helper.
2015-07-17 23:12:39 -04:00
Alexander von Gluck IV
1b69f3394b radeon_hd: Properly and consistently pick HPD ID 2015-07-14 20:38:15 -05:00
Augustin Cavalier
6fd2553690 TabView: Lots of style fixes. 2015-07-14 11:22:44 -04:00
Augustin Cavalier
c432a83bf3 TabView: Add TabViewPrivate class, actually fix non-layout SetView.
Thanks to Axel and Stephan for reviewing!
2015-07-14 11:04:39 -04:00
Alexander von Gluck IV
7ea1ad1028 radeon_hd: Fix dp aux request / response shifts 2015-07-13 23:26:24 -05:00
Augustin Cavalier
6031dea0cb BTabView: Lots of fixes & cleanup.
* Address TODO about setting fSelected when nothing is done.
 * Pass a pointer to the tab view to the BTab so that it can call Invalidate().
  (Checked against BeOS).
 * Call Invalidate() from the BTab after SetView() & SetName().

Fixes #12108 & #12196.
2015-07-13 21:34:52 -04:00
Dario Casalinuovo
c079d8d6d9 Implement BMediaRoster::GetNodeAttributesFor 2015-07-13 18:13:48 +02:00
Dario Casalinuovo
1cc20d8231 BBufferGroup: Check for duplicated buffer id
* This exclude some possible cheating cases.
  It impose to have only a buffer_id per thread,
  so instances will not be duplicated if not needed.
2015-07-11 15:40:16 +02:00
Jérôme Duval
a83446983d libroot: added a complex.h header based on ...
http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/complex.h.html
* added missing parts from glibc.
* x86_64 was already complete, x86 was missing a few functions.
* should help with #12202, provided that the gcc4 buildtools are rebuilt.
2015-07-10 22:39:21 +02:00
Dario Casalinuovo
b6f0f88432 Implement BMediaRoster::GetFileFormatsFor 2015-07-10 18:46:20 +02:00
Dario Casalinuovo
7548648420 Implement BMediaRoster::SyncToNode 2015-07-10 18:46:19 +02:00
Dario Casalinuovo
7bcdb36249 media_server: Improve BTimeSource slave nodes management
The media_server is now able to remember the timesource associated to
a certain registered_node and always remove it when the owner
application crash, Fixes Ticket #11852
2015-07-09 23:45:16 +02:00
Alexander von Gluck IV
63b02c37d4 accelerants/common: Add displayport aux message struct 2015-07-08 00:03:38 -05:00
John Scipione
c466b4daeb IK: Change orientation param name to direction
for ScrollView::ScrollBar in ScrollView.h and the documentation. This makes
the parameter name consisent and fixes a doxygen warning.
2015-07-07 16:22:22 -07:00
Alexander von Gluck IV
bf8fe3ddb3 radeon_hd: Add Hawaii,Topaz,Tonga,Carrizo chips/cards 2015-07-07 10:27:44 -05:00
Alexander von Gluck IV
7e24b659c4 build: Convert to external libedit build package
* Drop lib/edit and matching bsd header
* Convert Debugger to libedit build package
* Should solve problems with libedit consumers
  not defining _BSD_SOURCE
* Progress on #10267
2015-07-04 15:29:05 -05:00
Alexander von Gluck IV
cc8f1d2ffd headers/os: Add gcc 5 to BeBuild.h
* While we still use gcc 4, the host tools won't
  build on gcc 5 systems without this.
* x86_64 compiles under gcc 5.10 successfully
2015-06-24 23:06:23 -05:00
Adrien Destugues
50440c4220 Remove gethostbyname_r and gethostbyaddr_r from headers
* They were not in BeOS.
* They are also not in netresolv, they are deprecated and getaddrinfo
should be used.
2015-06-17 21:30:02 +02:00
Adrien Destugues
f972422c66 Add a simple DNS caching system to BNetworkAddress
netresolv (and libbind) won't cache DNS requests, which can result in a
lot of DNS requests being made for the same host. Implement a simple
cache in RAM (local to each application) which will keep the most
recently requested addresses cached. This can speed up loading of an
HTTP page a lot, by saving a DNS request for each resource stored on the
same server as the main page.
2015-06-14 15:47:13 +02:00
Adrien Destugues
8d2aee6bc8 libbind: integrate "netresolv" patches from NetBSD.
libbind development was transferred to the NetBSD project at
http://wiki.netbsd.org/individual-software-releases/netresolv/

There isn't an official release yet, but they provide a set of patches
against the latest libbind release.

* Remove all files we don't use
* Merge the changes to the remaining files
* Add some new files we need
* Move getifaddrs implementation to libnetwork (instead of libbnetapi)
so it can be used by netresolv.

Fixes #8293 : netresolv uses getifaddrs to determine if there is a local
IPv6 address. If there is not, it will not return AAAA records.
2015-06-14 15:47:03 +02:00
Adrien Destugues
404cb7e310 BReference: missing const cast when building a BReference<const>
* The internal BReference is on a non-const object so it can increment
and decrement the reference count, so we need to cast the const away.
2015-06-14 15:46:53 +02:00
Jérôme Duval
0dc6b011fe malloc: implement malloc_usable_size().
* Fix #12132
2015-06-13 14:29:11 +02:00
Axel Dörfler
8a86ad7593 libbe: Fixed current_team() to work after a fork.
* This allows to start a valid looper in the forked child, for example.
2015-06-12 10:43:15 +02:00
Adrien Destugues
4b2d018be4 Implement MSG_NOSIGNAL
* Part of latest POSIX specification, this prevents send() on a closed
socket to raise a SIGPIPE signal (but EPIPE is returned).
2015-06-10 17:39:53 +02:00
Axel Dörfler
6ff95509c2 JobQueue: fixed leak, notification, added Pop() variant.
* Was leaking fQueuedJobs on destruction.
* fHaveRunnableJobSem implementation was not completed; it was never
  released.
* Added Pop() variant that is a bit more flexible, and allows for a
  timeout as well as waiting even when the queue is empty, and can
  return a status code.
2015-06-03 16:22:44 +02:00
Hamish Morrison
d6d439f3f7 Reimplement unnamed POSIX semaphores using user_mutex
* Fixes sharing semantics, so non-shared semaphores in non-shared
  memory do not become shared after a fork.
* Adds two new system calls: _user_mutex_sem_acquire/release(),
  which reuse the user_mutex address-hashed wait mechanism.
* Named semaphores continue to use traditional sem_id semaphores.
2015-05-24 14:03:40 +01:00
Axel Dörfler
e711e6e42f Moved BJob, and JobQueue into the support kit.
* Put it in the BSupportKit namespace, following the style introduced
  with the package kit for now.
* The BSupportKit::BJob class no longer knows about the package kit's
  Context class. However, the BPackageKit::BJob class does.
* Due to the namespace juggling, a lot of files had to be touched.
* The JobQueue class remains private.
* Due to the way Haiku is built on itself, you cannot build this change
  under Haiku with an older release.
2015-05-21 21:37:01 +02:00
Axel Dörfler
5ce80a78c9 BMessage: implemented KMessage reply.
* When you receive a message from a KMessage, and reply to it,
  it will automatically reply as KMessage, too.
* This allows to communicate with BLoopers from within the kernel
  or libroot.so.
2015-05-13 23:06:51 +02:00
Axel Dörfler
4d50aa327c MessageAdapter: cleanup, no functional change. 2015-05-13 23:06:49 +02:00
Jérôme Duval
73de58376a Update icu x86_64 package with namespace renaming enabled.
"Renaming" means the icu namespace is suffixed with the version number,
atm icu_55. Using "renaming" allows to use two different versions of ICU,
thus easing upgrades. For instance haikuwebkit uses a current version of ICU,
while the system uses a newer one after an upgrade.

* Replace all uses of the icu namespace in our public headers, with a macro
defaulting to icu. As the namespace is only used for private fields pointers,
there should be no impact.
* Locale kit *.cpp have to import the macro from <unicode/uversion.h> *before*
including any locale headers. Ditto for a Time preferences cpp file. This way,
the correct current icu namespace is referenced.
* Fixes bug #12057.
2015-05-10 21:52:36 +02:00
François Revol
54656b39c6 stdio.h: declare fcloseall() GNU extension
Since libroot already exports it and I've found some code using it.
2015-05-08 23:46:15 +02:00
Hamish Morrison
10b4fed24f Add support for pthread_condattr_get/setclock()
* Allows use of either CLOCK_REALTIME or CLOCK_MONOTONIC as the time
  base for pthread_cond_timedwait().
2015-05-02 20:55:57 +01:00
François Revol
b526d04a5b paths.h: add _BSD_SOURCE guard back, also check for _GNU_SOURCE
So things (like m4) expecting paths.h as part of glibc will get
what they want with _GNU_SOURCE.
2015-04-21 01:34:26 +02:00
François Revol
7dd1073833 ByteOrder.h: add explicit casts when using gcc builtins
Those return uintNN_t types instead of our own types,
but uint32 for example is long while uint32_t isn't,
giving some trouble with the PRI* macros for example on PPC.
2015-04-21 00:25:29 +02:00
François Revol
ae65896a9f paths.h: fix some paths
We don't have /sbin so...
2015-04-20 23:33:29 +02:00
François Revol
110600c698 paths.h: remove the _BSD_SOURCE guard
It seems like glibc also has paths.h and m4 fails to bootstrap
without _PATH_BSHELL.

This file really needs some cleanup btw, since most is actually
irrelevant or incorrect for Haiku.
2015-04-20 23:31:20 +02:00
François Revol
d508fd4c33 PPC: leave all atomic ops as gcc inlines
I'm not sure the 64bit versions are really implemented though...
2015-04-20 17:52:39 +02:00
Michael Lotz
62d30d9e49 libmedia: Put AddOnManager into BPrivate::media namespace.
The AddOnManager was in the global namespace, clashing with application
classes with the same name.

The input_server has an AddOnManager of its own. When the
shortcut_catcher filter was loaded by said AddOnManager, it in turn
loaded libgame.so, which in turn loaded libmedia.so, where an
AddOnManager was created for the global AddOnManager instance in
libmedia.so. Unfortunately the wrong AddOnManager, the one from the
input_server, was created. This lead to two AddOnManagers being active
in the input_server which very well could be responsible for #11049
and #11280.

This was a regression since the move of the AddOnManager from the
media_server to libmedia.so in hrev47086. This also fits with the two
tickets.

I actually noticed the problem when debugging the shutdown process of
the input_server, where the destruction of the wrong AddOnManager
caused a deadlock with itself.
2015-04-19 23:47:05 +02:00
Jessica Hamilton
c7ad68f08c assert.h: add comments explaining the omission of include guards 2015-04-17 07:03:40 +12:00
Jessica Hamilton
9f17027980 assert.h: remove include guards
* including assert.h multiple times with NDEBUG varying is
  perfectly legal, and required by POSIX.
2015-04-16 23:03:40 +12:00
Adrien Destugues
091a80aeed Protect all BSD extensions with _BSD_SOURCE
* Do not define the symbols by default, as they are not in the default
libraries.
* Adjust jamfiles of all code using BSD extensions to define
_BSD_SOURCE.
* This makes Haiku slightly more compliant to standard C/POSIX.
2015-04-16 07:33:06 +02:00
Michael Lotz
0cc8c71bba BLayoutItem: Add RemoveSelf() convenience method.
It works analoguous to BView::RemoveSelf(), i.e. it removes itself from
the parent (layout in this case) and returns whether or not it had and
was successfully removed from said parent.
2015-04-15 00:34:05 +02:00
Michael Lotz
4198ccecf3 Whitespace cleanup only. 2015-04-15 00:30:56 +02:00
Dario Casalinuovo
4232706dc8 Clean SharedBufferList.h.
Signed-off-by: Adrien Destugues <pulkomandy@gmail.com>
2015-04-13 19:21:35 +02:00
Michael Lotz
9bf9ee3806 Whitespace and style cleanup only. 2015-04-12 18:50:01 +02:00
Michael Lotz
3b7b927dd0 libbnetapi: Add BNetworkRoute to replace use of route_entry.
The BNetworkRoute class manages a route_entry and the sockaddr's
associated with it. It replaces the direct use of route_entry in the
BNetworkInterface API.

Using route_entry is fragile and inconvenient as it only holds pointers
to the sockaddr's. When getting a list of routes from the kernel, each
route_entry is set up so that its pointers point into the single flat
buffer that is passed around. Creating a copy of the route_entry and
then deleting the flat buffer makes the pointers in the copy stale.
Returning these route entries therefore always lead to a use-after-free
when they were eventually used.

BNetworkRoute also takes over the code and functionallity of getting
routes from RouteSupport. The corresponding method in BNetworkRoster is
replaced by a static method in BNetworkRoute.

Also distinguish between the default route and gateway of an interface.
GetDefaultRoute() now gets the default BNetworkRoute for the interface
while GetDefaultGateway() gets the associated gateway address within
that default route. Adjust network preferences panel to this change.

Note that we currently only seem to have per interface default routes
and not an actual global default route. This was already the case before
these changes and I did not further investigate what this means.
2015-04-12 18:50:00 +02:00
Alexander von Gluck IV
9c5e234cb3 arm: Initial Cubieboard4 work
* SD cards are "blessed" with a boot0 spl and boot1 u-boot
  at fixed locations.
* Allwinner's u-boot is lacking a lot.
* Upstream u-boot should be better at some point. WIP:
  http://lists.denx.de/pipermail/u-boot/2015-January/201537.html
2015-04-11 16:53:04 -05:00
Michael Lotz
8f9d4cad45 syscalls: Remove get_stack_trace syscall again.
This reverts the other half of b959d46dbd.
2015-04-11 23:37:55 +02:00
Michael Lotz
c012e7e930 libroot: Add private __arch_get_stack_trace().
It can be used to get a stack trace of the current thread. Note that
this works by walking frame pointers and will not produce anything
useful if an application is compiled with the frame pointers omitted.

The stack base and end addresses have to be provided as arguments and
are used to check that the frame pointers fall within that range. These
values are thread specific and can be retrieved with get_thread_info().
No other sanity checks (like checking for loops in the linked list) are
done.

This is a simplified rewrite of the stack trace code from the kernel
debugger.

As this code is common to x86 and x86_64 but is not generic across
architectures I introduced x86_common as a directory to put such
sources.
2015-04-11 23:37:54 +02:00
Michael Lotz
459e651fd5 syscalls: Remove lookup_symbol syscall again.
This partially reverts b959d46dbd.
2015-04-11 11:18:51 +02:00
Michael Lotz
ebdc1d480e runtime_loader: Add imageName and exactMatch to symbol lookup.
Extend the get_nearest_symbol_at_address() private runtime_loader
export to include imageName and exactMatch arguments.

The imageName holds the SONAME of the image, if available, so cannot
neccessarily be extracted from the image path.

Whether or not there was an exact match, i.e. the symbol with its size
contains the address, is now returned in exactMatch.
2015-04-11 11:18:50 +02:00
Michael Lotz
ec0190adb0 malloc_debug: Implement allocation dump on exit in guarded heap.
When enabled (using heap_debug_dump_allocations_on_exit(true) or
MALLOC_DEBUG=e) this causes a dump of all remaining allocations when
libroot_debug is unloaded. It uses terminate_after to be called as
late as possible.

When combined with alloc stack traces this makes for a nice if a bit
crude leak checker. Note that a lot of allocations usually remain
even at that stage due to statically, lazyly and globally allocated
stuff from the various system libraries where it isn't necessarily
worth the overhead to free them when the program terminates anyway.
2015-04-10 17:04:28 +02:00
Michael Lotz
158e20e60e malloc_debug: Implement alloc/free stack traces in guarded heap.
When configured to do so (using heap_debug_set_stack_trace_depth(depth)
or MALLOC_DEBUG=s<depth>) the guarded heap now captures stack traces on
alloc and free.

A crash due to hitting a guard page or an already freed page now dumps
these stack traces. In the case of use-after-free one can therefore see
both where the allocation was done and where it was freed.

Note that there is a hardcoded maximum stack trace depth of 50 and that
the alloc stack trace takes away space from the free stack trace which
uses up the rest of that maximum.
2015-04-10 16:28:42 +02:00
Michael Lotz
b959d46dbd syscalls: Add get_stack_trace and lookup_symbol syscalls.
The get_stack_trace syscall generates a stack trace using the kernel
debugging facilities and copies the resulting return address array to
the preallocated buffer from userland. It is only possible to get a
stack trace of the current thread.

The lookup_symbol syscall can be used to look up the symbol and image
name corresponding to an address. It can be used to resolve symbols
from a stack trace generated by the get_stack_trace syscall. Only
symbols of the current team can be looked up. Note that this uses
the symbol lookup of the kernel debugger which does not support lookup
of all symbols (static functions are missing for example).

This is meant to be used in situations where more elaborate stack trace
generation, like done in the userland debugging helpers, is not possible
due to constraints.
2015-04-10 16:00:49 +02:00
Michael Lotz
e01de52283 More whitespace cleanup all over the place. 2015-04-10 15:05:14 +02:00
Michael Lotz
e25776bd83 Whitespace cleanup only. 2015-04-08 12:56:58 +02:00
Janus
85b350edda BColumnListView: BRow height is proportional to font size.
* Add a BRow default constructor that use font size to compute height.
* Min height size for Title and Row are decoupled.
* The font ratio for Title and Row are decoupled.
* For small font use min height (set to usual 16.0).
* Better baseline formula.
* Fixes #11944.
2015-04-05 16:58:00 +00:00
Alexander von Gluck IV
b1ad5660b2 arm: Prevent bcm283X inclusion from breaking other boards
* Move *_BASE into board_config.h to prevent conflicts
2015-04-04 17:44:32 -05:00
Michael Lotz
121655e9ee malloc_debug: Add default alignment option.
This allows for something similar as was implemented in 217f090 but
makes it optional and configurable.

The MALLOC_DEBUG environment variable now can take "a<size>" to set
the default alignment to the specified size. Note that not all
alignments may be supported depending on the heap implementation.
2015-04-04 22:55:57 +02:00
Michael Lotz
5ae3af6cc5 SupportDefs: Add B_SCN* counterparts for some more types.
Namely for [s]size_t, [{phys|generic}_]addr_t and off_t.
2015-04-04 22:55:57 +02:00
Michael Lotz
a05bfeb4a9 Whitespace cleanup only. 2015-04-04 22:55:56 +02:00
Stephan Aßmus
53094e2fa1 StringForSize.h: Fixed header guard comment at EOF 2015-04-04 22:45:41 +02:00