Commit Graph

4961 Commits

Author SHA1 Message Date
John Scipione d34a680c04 Screen Saver: fix race condition
Start the screensaver in the window thread instead of the runner
thread so that there is no lock contention for the window lock in
the runner thread when the saver starts.

The view that gets drawn into is assumed to have been prepared before
being passed to the runner thread, and this assumption has been made
true for the screensaver preview and screen_blanker apps.

Eliminate fHasStarted and the corresponding HasStarted() method in
ScreenSaverRunner as they are no longer needed.

Drawing still happens in the runner thread, and still needs to lock
the window thread potentially causing contention, yet, there
is a timeout here so the contention won't freeze the screensaver window,
only delay drawing the screensaver.

Drawing could be moved to the window thread via message passing to avoid
lock contention with the window but this would defeat a big part of the
purpose of having a separate rendering thread.

This fixes #10125 and #4260
2013-11-14 23:30:26 -05:00
John Scipione 5d023095c2 ScreenSaverRunner: Suspend() and Resume() return status_t 2013-11-14 23:30:13 -05:00
John Scipione e22c01af03 Screen Saver: style fixes 2013-11-14 23:30:10 -05:00
Pawel Dziepak 288a2664a2 scheduler: Remove sSchedulerInternalLock
* pin idle threads to their specific CPUs
 * allow scheduler to implement SMP_MSG_RESCHEDULE handler
 * scheduler_set_thread_priority() reworked
 * at reschedule: enqueue old thread after dequeueing the new one
2013-11-13 05:31:58 +01:00
Pawel Dziepak 829f836324 scheduler: Minor cleanup 2013-11-12 04:42:12 +01:00
Ingo Weinhold e5f6591382 VM: vm_memset_physical(): Correct length parameter type 2013-11-11 22:27:52 +01:00
Pawel Dziepak 7e1c4534df libroot: Add adaptive mutex implementation 2013-11-08 03:37:30 +01:00
Pawel Dziepak 03fb2d8868 kernel: Remove gSchedulerLock
* Thread::scheduler_lock protects thread state, priority, etc.
 * sThreadCreationLock protects thread creation and removal and list of
   threads in team.
 * Team::signal_lock and Team::time_lock protect list of threads in team
   as well.
 * Scheduler uses its own internal locking.
2013-11-08 02:41:26 +01:00
Pawel Dziepak 72addc62e0 kernel: Introduce Thread::time_lock and Team::time_lock 2013-11-07 22:16:36 +01:00
Axel Dörfler 547cd462f8 trim: Added is_called_via_syscall() function.
* And use it in get_trim_data_from_user(), formerly known as copy_*().
* This fixes differentiating between user and kernel buffers.
2013-11-07 19:06:13 +01:00
Axel Dörfler 99086aa323 trim: Target SCSI UNMAP command instead of WRITE SAME.
* The UNMAP command is theoretically much faster, as it can get many block
  ranges instead of just a single range.
* Furthermore, the ATA TRIM command resembles it much better.
* Therefore, fs_trim_data now gets an array of ranges, and we use SCSI UNMAP
  to trim.
* Updated BFS code to collect array ranges to fully support the new
  fs_trim_data possibilities.
2013-11-07 19:03:47 +01:00
Axel Dörfler 960c56aea5 This gets the trim command as WRITE SAME operation to SCSI
* Neither hardware nor driver to test it; AHCI/IDE support is next
  on the table.
2013-11-07 19:03:35 +01:00
Axel Dörfler 29a8450843 Added B_TRIM_DEVICE ioctl. 2013-11-07 19:01:24 +01:00
Pawel Dziepak 3519eb334a kernel: Change Thread::team_lock to rw_spinlock 2013-11-07 04:20:59 +01:00
Pawel Dziepak defee266db kernel: Add read write spinlock implementation 2013-11-07 04:20:32 +01:00
Pawel Dziepak d3e5752b11 scheduler: Performance mode is actually low latency mode 2013-11-07 01:50:20 +01:00
Pawel Dziepak 83983eaf38 kernel: Remove Thread::alarm 2013-11-07 01:40:02 +01:00
Pawel Dziepak aa4aca0264 kernel: Protect signal data with Team::signal_lock 2013-11-07 01:32:48 +01:00
Pawel Dziepak 73ad2473e7 Remove remaining unnecessary 'volatile' qualifiers 2013-11-06 00:03:07 +01:00
Pawel Dziepak 273f2f38cd kernel: Improve spinlock implementation
atomic_or() and atomic_and() are not supported by x86 are need to be
emulated using CAS. Use atomic_get_and_set() and atomic_set() instead.
2013-11-05 22:47:18 +01:00
Pawel Dziepak 077c84eb27 kernel: atomic_*() functions rework
* No need for the atomically changed variables to be declared as
   volatile.
 * Drop support for atomically getting and setting unaligned data.
 * Introduce atomic_get_and_set[64]() which works the same as
   atomic_set[64]() used to. atomic_set[64]() does not return the
   previous value anymore.
2013-11-05 22:32:59 +01:00
Ingo Weinhold 986e4abce4 Add new API find_path[s](), find_path_for_path()
The new functions are meant to replace many uses of find_directory():
* find_paths() is supposed to be used when the directories of a certain
  kind in all installation directories are needed (e.g. font
  directories, add-on directory, etc.). Using this API makes code
  robust wrt addition or removal of installation locations.
* find_path() is supposed to be used when files/directories associated
  with a loaded program, library, or add-on need to be found (e.g. data
  files or global settings).
* find_path_for_path() is similar to find_path(), but it starts from a
  given path instead of an image.
2013-11-05 21:40:43 +01:00
Pawel Dziepak f4b088a992 kernel: Protect UserTimers with sUserTimerLock 2013-11-05 05:36:05 +01:00
Pawel Dziepak 4824f7630b kernel: Add sequential lock implementation 2013-11-05 04:16:13 +01:00
Pawel Dziepak 3c819aaa72 kernel: DPC: remove schedulerLocked argument 2013-11-04 23:51:18 +01:00
Pawel Dziepak 11cacd0c13 kernel: Remove thread_block_with_timeout_locked() 2013-11-04 23:45:14 +01:00
Jérôme Duval e2183a14c4 Increased kernel stack size by another page for 64-bit
* USB boot now works on x86_64 with PM.
2013-11-04 18:53:49 +01:00
Pawel Dziepak d8fcc8a825 kernel: Remove B_TIMER_ACQUIRE_SCHEDULER_LOCK flag
The flag main purpose is to avoid race conditions between event handler
and cancel_timer(). However, cancel_timer() is safe even without
using gSchedulerLock.

If the event is scheduled to happen on other CPU than the CPU that
invokes cancel_timer() then cancel_timer() either disables the event
before its handler starts executing or waits until the event handler
is done.

If the event is scheduled on the same CPU that calls cancel_timer()
then, since cancel_timer() disables interrupts, the event is either
executed before cancel_timer() or when the timer interrupt handler
starts running the event is already disabled.
2013-10-31 01:49:43 +01:00
Pawel Dziepak c8dd9f7780 kernel: Add thread_unblock() and use it where possible 2013-10-30 03:58:36 +01:00
Pawel Dziepak 9c0ff0eed1 kernel: Add cpufreq module for Intel P-states
Since Sandy Bridge managing P-states on Intel processors is much easier
and more powerful than when using previous versions of EIST.
2013-10-30 00:55:03 +01:00
Pawel Dziepak 22d8248267 kernel: Add support and interface for cpufreq modules 2013-10-30 00:48:07 +01:00
Julian Harnath 7f64b301b1 Reduce lock contention in kernel port subsystem.
* Replace ports list mutex with R/W-lock.

* Move team port list protection to separate array of mutexes.
  Relieve contention on sPortsLock by removing Team::port_list from its
  protected items. With this, set_port_owner() only needs to acquire the
  sPortsLock for reading.

* Add another hash table holding the ports by name. Used by find_port()
  so it doesn't have to iterate over the list anymore.

* Use slab-based memory allocator for port messages. sPortQuotaLock was
  acquired on every message send or receive and was thus another point
  of contention. The lock is not necessary anymore.

* Lock for port hashes and Port::lock are no longer locked in a nested
  fashion to reduce chances of blocking other threads.

* Make operations concurrency-safe by adding an atomically accessed
  Port::state which provides linearization points to port creation and
  deletion. Both operations are now divided into logical and physical
  parts, the logical part just updating the state and the physical part
  adding/remove it to/from the port hash and team port list.

* set_port_owner() is the only remaining function which still locks
  Port::lock and one or two of sTeamListLock[] in a nested fashion.
  Since it needs to move the port from one team list to another and
  change Port::owner, there's no way around.

* Ports are now reference counted to make accesses to already-deleted
  ports safe.

* Should fix #8007.
2013-10-26 16:10:03 +02:00
Ingo Weinhold 3f40dcb6b4 PackageWriterImpl::_AttributeRemoved(): Update string cache
When removing a string attribute, decrement the referenced string's
usage count in the string cache. This fixes the potentially incorrect
usage counts in update mode. Not a serious problem, but it could lead
to only singly (or no longer) used strings to be written to the string
subsection instead of encoding them inline and thus to slightly greater
file sizes.
2013-10-25 22:54:44 +02:00
Ingo Weinhold b8f713e904 PackageReaderImpl: Add public TOC section accessor 2013-10-25 22:54:44 +02:00
Ingo Weinhold e07b8bd2df package kit: ReaderImplBase: Add public attrs section accessor 2013-10-25 22:54:43 +02:00
Ingo Weinhold 06064b9b4f RangeArray::AddRange(): Fix joining with single subsequent range
When joining with a single range, firstRange would be the same as
RangeAt(endIndex - 1) and we would overwrite its offset field before
getting its end offset, thus possibly resulting in a wrong joined range
size.
2013-10-25 22:54:43 +02:00
Pawel Dziepak 978fc08065 scheduler: Remove support for running different schedulers
Simple scheduler behaves exactly the same as affine scheduler with a
single core. Obviously, affine scheduler is more complicated thus
introduces greater overhead but quite a lot of multicore logic has been
disabled on single core systems in the previous commit.
2013-10-24 02:04:03 +02:00
Pawel Dziepak ed8627e535 kernel/util: Fix MinMaxHeap::_GrowHeap() 2013-10-24 00:59:58 +02:00
Pawel Dziepak 31a75d402f kernel: Protect lock internals with per-lock spinlock 2013-10-24 00:01:18 +02:00
Pawel Dziepak 4c4994435d kernel/util: Fixes in [MinMax]Heap implementation 2013-10-22 23:56:31 +02:00
Ingo Weinhold df266f1c93 BDaemonClient::CommitTransaction(): Align with documentation
The method is supposed to return B_OK as long as the _result object has
been initialized, even if committing the transaction failed. Fixes the
unhelpful error messages of pkgman when committing the transaction
failed for some reason.
2013-10-22 01:12:02 +02:00
Pawel Dziepak 5cf9b69b49 kernel/util: Minor improvements in Heap and MinMaxHeap
* [MinMax]Heap::ModifyKey(): Do not attempt to move node if the key
   actually hasn't changed.
 * Allow allocating initial array at construction.
2013-10-21 21:24:05 +02:00
Pawel Dziepak 7ea42e7add kernel: Remove invoke_scheduler_if_idle 2013-10-21 02:38:57 +02:00
Pawel Dziepak ea79da9500 kernel: Remove support for thread_queue 2013-10-21 02:30:20 +02:00
Pawel Dziepak cd8d4e39fd kernel: Introduce scheduler modes of operation 2013-10-21 02:17:00 +02:00
Pawel Dziepak 343c489689 kernel: Create CPU topology tree 2013-10-21 01:33:35 +02:00
Pawel Dziepak 5cbf227236 kernel/util: Allocate only one array in MinMaxHeap 2013-10-20 23:33:55 +02:00
John Scipione bd336e3abc Update semantic shortcuts
Update BKeymap::GetModifiedCharacters() to translate a given character
and set of modifiers filling out a list of all characters that match for another
set of modifiers.

This allows us to, for example, get all characters in the normal map that
have the '+' character in the corresponding shift map.

It is fully generic allowing one to get a list of characters in any map given
a character and modifiers of another map.

Also I converted from using a BList to using a BObjectList.

With this, along with BWindow::HasShortcut(), the semantic shortcuts now
work not only with Command+'=', but any key in the normal map that has
'+' in it's shift map as long as it isn't already taken by another shortcut.
2013-10-19 19:30:47 -04:00
Jérôme Duval 6180dde498 Revert "usb_disk: retry when usb disk not ready"
This reverts commit d46d383800.

Regression: CD/DVD-ROM media changes are not recognized anymore.
2013-10-19 22:06:10 +02:00
John Scipione 1d04310459 Keymap: Add a method to get modified characters for a key
This method fills out the passed-in BList of modified utf-8 characters for
a given utf-8 character and set of modifiers.

For example if you pass in "=" and B_SHIFT_KEY the list will get filled
out with each character in the shift map that has "=" in the normal map.

Each supported keymap modifier combination is available.

The reason this is useful will soon become apparent.

A BList is used because the character might be mapped multiple times,
for example if you have a Mac keyboard you've got two "=" keys, one in
0x1d and one in 0x6a.

The caller is responsible for creating the BList and destroying it as well as
freeing the resulting character strings.
2013-10-18 03:10:00 -04:00
Pawel Dziepak 18c0d163ed kernel/util: Add MinMaxHeap implementation 2013-10-17 19:22:29 +02:00
John Scipione 916be2df3c Consolidate adding add-on directories
This builds off of hrev46243 adding add-on directories all in one place
in AddOnMonitorHandler instead of repeating the code 3 times in
IndexServer, AddOnManager, and MediaAddOnServer.

The safe mode checking in InputServer is now redundant since it all
gets funneled into AddOnMonitorHandler::AddAddOnDirectories()
and the safe mode flags are checked there.

We should probably remove the InputServer::SafeMode() method, but,
I didn't want to break anything that depended on it so I left it.
2013-10-17 01:28:31 -04:00
Pawel Dziepak 278c9784a1 scheduler_affine: Use global core heap and per-core CPU heaps
There is a global heap of cores, where the key is the highest priority
of threads running on that core. Moreover, for each core there is
a heap of logical processors on this core where the key is the priority
of currently running thread.

The per-core heap is used for load balancing among logical processors
on that core. The global heap is used in initial decision where to put
the thread (note that the algorithm that makes this decision is not
complete yet).
2013-10-17 02:11:28 +02:00
Pawel Dziepak cf863a5040 kernel: Decide whether to use simple or affine scheduler
Simple scheduler is used when we do not have to worry about cache affinity
(i.e. single core with or without SMT, multicore with all cache levels
shared).

When we replace gSchedulerLock with more fine grained locking affine
scheduler should also be chosen when logical CPU count is high (regardless
of cache).
2013-10-16 18:39:25 +02:00
François Revol bc1184c253 bootloader: Add an arguments_count field to stage2_args
Some boot platforms pass a non-NULL-terminated list of args
to the loader, so store the count here to avoid having to copy
the list itself.
2013-10-15 22:15:03 +02:00
Pawel Dziepak f20ad54be2 kernel: Add support for SMP systems to simple scheduler
In SMP systems simple scheduler will be used only when all logical
processors share all levels of cache and the number of CPUs is low.
In such systems we do not have to care about cache affinity and
the contention on the lock protecting shared run queue is low. Single
run queue makes load balancing very simple.
2013-10-15 00:29:04 +02:00
Pawel Dziepak 29e65827fd kernel: Remove possibility to yield to all threads
Kernel support for yielding to all (including lower priority) threads
has been removed. POSIX sched_yield() remains unchanged.

If a thread really needs to yield to everyone it can reduce its priority
to the lowest possible and then yield (it will then need to manually
return to its prvious priority upon continuing).
2013-10-09 20:42:34 +02:00
Pawel Dziepak fee8009184 kernel: Add another penalty for CPU bound threads
Each thread has its minimal priority that depends on the static priority.
However, it is still able to starve threads with even lower priority
(e.g. CPU bound threads with lower static priority). To prevent this
another penalty is introduced. When the minimal priority is reached
penalty (count mod minimal_priority) is added, where count is the number
of time slices since the thread reached its minimal priority. This prevents
starvation of lower priorirt threads (since all CPU bound threads may have
their priority temporaily reduced to 1) but preserves relation between
static priorities - when there are two CPU bound threads the one with
higher static priority would get more CPU time.
2013-10-09 20:13:47 +02:00
Pawel Dziepak 4ade765cab kernel/util: Add heap implementation 2013-10-09 04:26:09 +02:00
Ingo Weinhold 066d508682 boot loader: Support loading haiku-*.hpkg
... i.e. properly canonically named Haiku system packages.
2013-10-09 03:48:25 +02:00
Ingo Weinhold bd3bb3cf58 boot loader vfs.h: small cleanup 2013-10-09 03:48:25 +02:00
John Scipione fb6cc6d855 Move Thread classes from Tracker to shared
So that they may be utilized outside of Tracker
2013-10-08 20:25:15 -04:00
Pawel Dziepak a2bdd2842f kernel: Add scheduler_op for dumping thread data 2013-10-09 02:08:49 +02:00
Pawel Dziepak 0896565a6e kernel: Support sched_yield() properly
sched_yield() should not yield to the threads with lower priority.
2013-10-09 01:18:55 +02:00
Ingo Weinhold 908ce69d6e IteratableSplayTree: Add FindClosest() 2013-10-08 21:03:49 +02:00
Pawel Dziepak 9363e99b19 kernel: Remove Thread::next_priority 2013-10-08 20:21:35 +02:00
Pawel Dziepak 4cba4ff1df kernel/util: Use private/kernel/debug.h 2013-10-08 01:36:30 +02:00
Pawel Dziepak b8c1df9b00 kernel: Add O(1) lookup and insertion priority queue 2013-10-05 20:16:06 +02:00
Pawel Dziepak 7039b950fb x86[_64]: Fix style issues 2013-10-05 18:03:00 +02:00
Ingo Weinhold de49e34927 Add symbol versioning for find_directory()
Should already have been done back when the semantics for the
B_COMMON_*DIRECTORY constants was changed.

Currently old and new version behave the same. So this is just a
contingency measure ATM.
2013-10-05 01:33:26 +02:00
Ingo Weinhold 38fa81bf8f Remove B_COMMON*_DIRECTORY and kCommon*Directory constants
* This does intentionally break source compatibility, so that a review
  of concerned code is forced.
* Binary compatibility should be maintained in most cases. The values
  of the constants for the writable directories are now used for the
  writable system directories. The values for the non-writable
  directories are mapped to "/boot/system/data/empty/...", an empty or
  non-existent directory, so that they will simply be skipped in search
  paths. Only code that explicitly expects to find something in a
  B_COMMON_* directory, will fail.
2013-10-04 02:30:30 +02:00
Ingo Weinhold 4b7e219688 Remove /boot/common for good
* Remove support for the "common" installation location from packagefs,
  package kit, package daemon, package managers.
* Rename the B_COMMON_*_DIRECTORY constants referring to writable
  directories to B_SYSTEM_*_DIRECTORY.
* Remove/adjust the use of various B_COMMON_*_DIRECTORY constants.
  I'm sure some occurrence still remain. They can be adjusted when the
  remaining B_COMMON_*_DIRECTORY constants are removed.
2013-10-03 21:52:25 +02:00
Ingo Weinhold f73f5d4c42 Initial changes to remove /boot/common
* find_directory() and hard-coded paths use /boot/system instead of
  /boot/common.
* The build system creates the writable directories in /boot/system
  instead of /boot/common.
* The build system no longer installs any packages in /boot/common.
2013-10-03 21:52:25 +02:00
Pawel Dziepak 149c82a8ec kernel/util: Add bitmap implementation 2013-10-03 04:27:49 +02:00
Pawel Dziepak 36cc64a9b3 x86[_64]: Add CPU cache topology detection for AMD and Intel CPUs 2013-10-02 23:48:03 +02:00
Pawel Dziepak 1f50d09018 kernel/util: Add bit hack utilities 2013-10-02 21:24:46 +02:00
Pawel Dziepak 8ec897323e x86[_64]: Add CPU topology detection for Intel processors 2013-10-02 01:19:17 +02:00
Pawel Dziepak 4110b730db x86[_64]: Add support for CPUID sub-leaves
Some CPUID leaves may contain one or more sub-leaves accessed by setting
ECX to an appropriate value.
2013-10-01 20:31:18 +02:00
Julian Harnath d46d383800 usb_disk: retry when usb disk not ready
* Resolves #10043
* Fixes a non-booting issue due to hrev46099
2013-09-30 22:32:48 -05:00
Alexander von Gluck IV df0a1762ab usb_disk: fix line endings; no functional change
* Occurred in hrev46099
* Line endings dos2unix
* Remove extra lines at end of file
* Jerome! Get a better text editor :-)
2013-09-30 22:32:47 -05:00
Axel Dörfler cf06f96628 libshared: Factored out driver settings class from net_server.
* The new class is called DriverSettingsMessageAdapter which can translate
  between a driver_settings file, and a BMessage.
* The net_server Settings class is now just using this class.
2013-09-30 01:13:13 +02:00
Rene Gollent 9345049af8 Package Kit: Implement progress notifications.
- BJobStateListener: Add progress state and corresponding hook.
- FetchFileJob: Notify job progress hook on libcurl notifications.
- UserInteractionHandler: Add hooks for download progress and checksum
  validation progress.
- PackageManager: inherit from JobStateListener and watch for job
  notifications for internally generated jobs. Forward to corresponding
  UserInteractionHandler hooks as needed.
- Adapt pkgman, HaikuDepot and package_daemon to above changes.
  Neither HaikuDepot nor package_daemon's progress hooks are wired up to
  do anything yet though.
2013-09-29 17:25:33 -04:00
Rene Gollent fe39d2eb8d BPackageManager: Eliminate RequestHandler.
- Pull functionality back into package manager itself since the extra
  indirection doesn't really buy us anything in this case, as neither
  request that it handles requires a decision provider.
- Adjust pkgman and HaikuDepot accordingly.
2013-09-29 17:25:32 -04:00
Rene Gollent cd76e0903f libpackage: Use libcurl directly for downloads.
- Initial step towards allowing listening for download progress.
2013-09-29 17:25:29 -04:00
Ingo Weinhold 81a828b660 BPackageManager: Auto-refresh if repository cache is missing
This makes the initial "pkgman refresh" superfluous, that was necessary
for "install"/"search" to work.
2013-09-29 13:14:43 +02:00
Ingo Weinhold 81291304ad Merge remote-tracking branch 'haiku/master' into package-management
Conflicts:
	build/jam/BuildSetup
	build/jam/HaikuImage
	build/jam/board/sam460ex/BoardSetup
	build/jam/board/verdex/BoardSetup
	data/catalogs/apps/icon-o-matic/fr.catkeys
	src/add-ons/kernel/drivers/audio/hda/hda_codec.cpp
	src/add-ons/kernel/drivers/disk/usb/usb_disk/usb_disk.cpp
	src/apps/debugger/files/FileManager.cpp
	src/apps/debugger/files/FileManager.h
	src/apps/debugger/user_interface/gui/inspector_window/MemoryView.cpp
	src/apps/haiku-depot/MainWindow.cpp
	src/apps/haiku-depot/MainWindow.h
	src/apps/haiku-depot/Model.cpp
	src/apps/haiku-depot/PackageInfo.h
	src/apps/haiku-depot/PackageInfoListener.h
	src/apps/haiku-depot/PackageInfoView.cpp
	src/apps/haiku-depot/PackageInfoView.h
	src/apps/haiku-depot/PackageListView.cpp
	src/apps/haiku-depot/PackageListView.h
	src/system/kernel/arch/arm/arch_timer.cpp
	src/system/libroot/os/arch/arm/atomic.S
	src/tools/translation/bitsinfo/Jamfile
	src/tools/translation/bmpinfo/Jamfile
	src/tools/translation/tgainfo/Jamfile
2013-09-27 01:55:45 +02:00
Ingo Weinhold 0ee677e7f1 Add BRemoveEngine
Similar to BCopyEngine, but it (surprise!) removes an entry.
2013-09-27 00:51:30 +02:00
Ingo Weinhold 4cf3529cbb BCopyEngine: Add base class BEntryOperationEngineBase
It contains a helper class Entry, which allows to generalize the
BCopyEngine::CopyEntry() parameters.
2013-09-27 00:51:30 +02:00
Ingo Weinhold 43ff23ebbf <NotOwningEntryRef.h>: Denote BPrivate explicitly 2013-09-27 00:51:29 +02:00
Jerome Duval 3ffd22ce6d usb_disk: base the error sense handling on a reference table.
* imported asc-num.txt as a reference, was used to generate the asc sense table.
* use the sense asc and key tables to know which action and status codes are
to be applied.
* tested with an hard disk and a dvd reader.
* these tables could be reused by the scsi_periph module.
2013-09-20 23:56:06 +02:00
Oliver Tappe 0a345af77e Separate notification from deletion in repository-handlers.
* Add NotifyDone() to all repository-attribute handlers and invoke that
  to notify any listeners.
* Unify deletion to a single implementation of Delete() in the base
  class. Before, the root handler for a repository didn't do that, but
  just triggered the notification.
2013-09-18 21:16:13 +02:00
Jerome Duval 33f263cb01 virtio: add queue_is_full(), queue_is_empty(), queue_size() hooks. 2013-09-18 17:43:39 +02:00
Ingo Weinhold e9d9ac713f Add userdel 2013-09-18 16:33:17 +02:00
Oliver Tappe 50ae264dad Add support for adding a package-info to BRepositoryWriter. 2013-09-18 12:05:34 +02:00
Ithamar R. Adema 501b24c63b ARM: kernel: Make 32/64-bit atomics work for ARMv5/6
Support for 64-bit atomic operations for ARMv7+ is currently stubbed
out in libroot, but our current targets do not use it anyway.

We now select atomics-as-syscalls automatically based on the ARM
architecture we're building for. The intent is to do away with
most of the board specifics (at the very least on the kernel side)
and just specify the lowest ARMvX version you want to build for.

This will give flexibility in being able to distribute a single
image for a wide range of devices, and building a tuned system
for one specific core type.
2013-09-18 05:03:18 +02:00
Ithamar R. Adema cc65466f0d ARM: kernel: Make KDL more useful on ARM
This adds the -mapcs-frame compiler flag for ARM to have "stable"
stack frames, adds support to the kernel for dumping stack crawls,
and initial support for iframes. There' much more functionality
to unlock in KDL, but this makes debugging already a lot more
comfortable.....
2013-09-17 23:04:59 +02:00
François Revol 09d213f3b3 PPC: OF: Make sure kernel args match the U-Boot one
Since both platforms can boot the same kernel we must accept either
arg, so we make sure they are identical for now.

TODO: use a union or KMessage maybe?
2013-09-17 15:49:49 +02:00
Pawel Dziepak 772568c476 system: Use B_PAGE_SIZE to define stack sizes
As korli suggested use B_PAGE_SIZE for defining stack size related
definitions what seems to be more natural for them  and also may
help if we ever support an architecture with page size different than
4kB.
2013-09-17 14:42:04 +02:00
Stephan Aßmus ed6f171aa6 BColumnListView: Enable invalidating rows, fix SetField()
* Seems like there was no easy way to simply invalidate
   a given BRow. Introduced BColumnListView::InvalidateRow().
 * BRow::SetField() tried to invalidate the row, but invalidated
   the listview instead of the BOutlineView responsible for
   drawing the list contents. Use the new InvaalidateRow().
2013-09-17 14:42:03 +02:00
François Revol 228524afb6 Merge branch 'master' into sam460ex 2013-09-17 13:22:26 +02:00
Pawel Dziepak f06af2e2f8 system: Use B_PAGE_SIZE to define stack sizes
As korli suggested use B_PAGE_SIZE for defining stack size related
definitions what seems to be more natural for them  and also may
help if we ever support an architecture with page size different than
4kB.
2013-09-16 23:23:29 +02:00
Stephan Aßmus bdd7ba66b5 BColumnListView: Enable invalidating rows, fix SetField()
* Seems like there was no easy way to simply invalidate
   a given BRow. Introduced BColumnListView::InvalidateRow().
 * BRow::SetField() tried to invalidate the row, but invalidated
   the listview instead of the BOutlineView responsible for
   drawing the list contents. Use the new InvaalidateRow().
2013-09-16 23:20:31 +02:00
François Revol c14bca2958 Merge branch 'master' into sam460ex 2013-09-14 01:16:51 +02:00
Ingo Weinhold cf70d345b2 Merge remote-tracking branch 'haiku/master' into package-management
This reverts 8f7f28a7c3 (OpenGL: Upgrade
to
Mesa 9.2).

Conflicts:
	build/jam/BuildFeatures
	build/jam/HaikuImage
	build/jam/OptionalPackages
	build/scripts/build_cross_tools_gcc4
	src/add-ons/opengl/swpipe/Jamfile
	src/apps/diskusage/Jamfile
	src/kits/tracker/ContainerWindow.cpp
	src/kits/tracker/DeskWindow.cpp
	src/kits/tracker/Jamfile
2013-09-13 01:02:28 +02:00
Ingo Weinhold 88f12ad84f Add private BViewPort class
* It simplifies putting regular layout-aware views or layout items into
  a BScrollView.
* Not quite complete yet: Height-for-width support is missing, but that
  also requires fixing BScrollView in this respect. Scroll bar auto-hide
  support would be nice as well.
2013-09-11 04:51:03 +02:00
Ingo Weinhold 36204024cf BPackageManager: Add InstalledRepository::EnablePackage() 2013-09-10 19:14:20 +02:00
Ingo Weinhold 018173a2f5 BPackageManager: Add ResultComputed() callback 2013-09-10 19:14:20 +02:00
Ingo Weinhold c032903abc BPackageManager: Add VerifyInstallation() 2013-09-10 19:14:20 +02:00
Ingo Weinhold 7e0d2c4f94 BPackageManager: Add alternate Install()/Uninstall()/Update() 2013-09-10 19:14:20 +02:00
Ingo Weinhold 5a5d146510 BPackageManager: Make _InstallationRepository() protected 2013-09-10 19:14:19 +02:00
Ingo Weinhold 56b1376090 BActivationTransaction: Make BArchivable 2013-09-10 19:14:19 +02:00
Ingo Weinhold d4f9c465fd BDaemonClient: add comment 2013-09-10 19:14:19 +02:00
Ingo Weinhold 18f5cd171b Explicitly denote BPrivate to avoid clashes 2013-09-10 19:14:18 +02:00
Ingo Weinhold a87c7d67e3 Don't use BPackageKit::BPrivate; avoids clashes 2013-09-10 19:14:18 +02:00
Ingo Weinhold cf3bb0d753 BPackageManager: Abstract installed repository initialization
* Rename TransactionHandler -> InstallationInterface and
  DaemonClientTransactionHandler -> ClientInstallationInterface.
* Add InstallationInterface::InitInstalledRepository(). Use in
  _AddInstalledRepository() to get the repository packages instead of
  using the package roster. The ClientInstallationInterface
  implementation does it that way.
2013-09-10 19:14:17 +02:00
Ingo Weinhold c138f1f2af BRepositoryBuilder: Add constructor for pre-init'ed repository 2013-09-10 19:14:17 +02:00
John Scipione d9acbaf0dc ScreenSaver: Timeout if window won't lock. Fixes #4260.
If we fail to lock the window in the kInitialTickRate time, quit the thread.
We were deadlocking causing #4260 because you could open several
threads by moving through the screen saver list quickly all trying to lock
the same window at the same time, classic deadlock.
2013-09-02 19:44:45 -04:00
John Scipione fa3651781a ScreenSaverRunner: Style fixes
Also update copyright info, add myself to authors list alphabetically.
2013-09-02 19:44:42 -04:00
Ingo Weinhold 83462cc28d Refactor reusable pkgman code into libpackage
* Move RepositoryBuilder class to libpackage and add B* prefix to name.
* Pull BPackageManager class out of PackageManager and move to
  libpackage. The base class is customizable via three handler objects
  responsible for transaction handling, request execution, respectively
  user interaction.
* Reorganize _ApplyPackageChanges(): Now we first prepare the
  transactions for all affected installation locations (downloading
  files etc.) and then commit them.
2013-08-31 21:19:07 +02:00
Jérôme Duval 8d2bf6953e random: add a Virtio RNG module
* The default module is replaced by the Virtio RNG module when found.
* This can have the undesired effect of rendering /dev/urandom slow.
* Tested with the following QEmu command line option:
-device virtio-rng-pci,rng=rng0 -object rng-random,filename=/dev/random,id=rng0
* moved random.h to private/drivers headers.
2013-08-29 18:47:48 +02:00
Ingo Weinhold 617be97d8e Add private storage kit class BCopyEngine
It provides the functionality to copy file system entries (also
recursively). The code originates from the copyattr sources. Some
copyattr specific functionality has been removed and the code has been
adjusted for library use (i.e. no exit()s or fprintf()s). An optional
controller object can be set to customize the behavior.
2013-08-28 00:36:28 +02:00
Jérôme Duval 0edcbd2754 apic: serialize writes to x2apic MSR...
as required by the specifications (it isn't needed with memory mapped i/o).
2013-08-26 21:48:33 +02:00
Jérôme Duval 787773400c Added x2APIC support.
* Mostly useful for virtualization at the moment. Works in QEmu.
* Can be enabled by safemode settings/menu.
* Please note that x2APIC normally requires use of VT-d interrupt remapping feature
on real hardware, which we don't support yet.
2013-08-26 21:08:21 +02:00
John Scipione 3dd9ff2b5d BMCMenuBar: Refactor MakeFocus()
Get rid of unused fRunner variable.

It is very basic now, it just works.

Also, renamed msg to message in MessageReceived() and
declared MakeFocus() above it (alphabetically).
2013-08-25 00:09:28 -04:00
John Scipione 408c0ee4cd MenuField: enable/disable the menu field when...
the child menu bar or the child menu bar's menu is enabled/disabled.

This means that there is just one status we have to check, the menu
fields, and the child menus agree. This change takes practical form
in the Backgrounds preflet which disables the placement menu when
the image is set to "None", but, only the menu got disabled and not the
parent menu field so the label was erroneously still drawn as enabled.
2013-08-20 18:15:13 -04:00
Jérôme Duval 46f7a54d8c MSI: Use the effective APIC id of the boot CPU for the address destination.
* This should only affect systems where the CPU ids aren't sequential (mostly
non Intel).
* Fixes #9807.
2013-07-29 17:36:03 +02:00
Jérôme Duval f3b8787e91 virtio.h: remove trailing whitespaces. 2013-07-18 18:27:01 +02:00
Jérôme Duval ed4a8e4d11 virtio: changed a bit the driver API by adding a driverCookie.
* the processing of requests in drivers is eased a bit with this change, but
this could be improved for instance by enabling a driver to dequeue items
in a service thread instead of the interrupt handler.
* made a few methods const.
2013-07-17 17:30:18 +02:00
Jérôme Duval ea2fa87219 scsi_cmds.h: added SCSIS_ASC_CAPACITY_DATA_HAS_CHANGED
* indicates the device data capacity has changed..
2013-07-17 17:19:46 +02:00
Alexander von Gluck IV 42eed3ba69 RadeonHD: Fix incorrect name -> chipset mapping
* Put names and chipsets next to each other to
  help prevent further mismatch.
* Fix potential (but unlikely) string overflow
* CID 611140
2013-07-16 11:20:24 -05:00
Jérôme Duval 8dfd68e0f8 Virtio PCI: added support for MSI-X interrupts
* make use of MSI/MSI-X PCI x86 API
* MSI support untested because QEmu only offers MSI-X
* changed a bit the Virtio bus API by adding a queue count parameter
for the setup_interrupt() hook.
2013-07-11 20:37:37 +02:00
Ingo Weinhold 4387d6b33f Merge remote-tracking branch 'remotes/haiku/master' into package-management 2013-07-11 18:09:03 +02:00
Alexander von Gluck IV 991183511b RadeonHD: Drop marketing names
* They are all over the place.. I give up
* Going off of engineering names and DCE is more accurate
* A lot of this info came from the x.org wiki
* I'd like to transition some of the engineering
  name checks to use DCE versions.. they tend to be more
  accurate and exact. (in some cases we can't, but most of
  the time we can)
2013-07-09 12:40:29 -05:00
Ingo Weinhold 7e78b434f4 Merge remote-tracking branch 'haiku/master' into package-management
Conflicts:
	build/jam/HaikuImage
	build/jam/OptionalPackageDependencies
	build/jam/OptionalPackages
	build/scripts/build_cross_tools_gcc4
	src/add-ons/translators/icns/Jamfile
	src/add-ons/translators/jpeg/Jamfile
2013-07-08 14:01:00 +02:00
Ingo Weinhold e85334022e Repository file format: group attributes of a package
* Introduce new package attribute B_HPKG_ATTRIBUTE_ID_PACKAGE (valid
  only in a repository file) to group the attributes belonging to a
  package.
* BRepositoryContentHandler:
  - No longer derive from BPackageContentHandler.
  - Add hooks HandlePackage() and HandlePackageDone() that bracket the
    attributes for a package. This is more explicit and robust than
    handlers having to guess when one package ended and the next began.
* BRepositoryCache: Make use of BPackageInfoContentHandler. No need to
  duplicate the code for reading a package info from package info
  attributes.
2013-07-04 19:20:14 +02:00
Ingo Weinhold 695a1b248a repository writer: fix use of incorrect header size
The header size of the package file header was used, which resulted in
broken repository files.
2013-07-04 16:37:24 +02:00
Alexander von Gluck IV 4ce958fcd4 RadeonHD: Cleanup, new cards
* Fix some incorrect chip codenames
* Introduce a dual gpu flag
* Add some new chipsets and document
  the next generation of chips
2013-06-29 13:18:52 -05:00
Ingo Weinhold b5b9388a28 Add C++ API for driver settings
Copied from the userlandfs utility classes, adjusted coding style, did
some renaming and small interface changes.
2013-06-29 13:42:00 +02:00
Ingo Weinhold 04382d496e BPathMonitor: rewrite
This resolves all issues the test suite uncovered. It should also deal
with hard links correctly, though that hasn't been tested. Still
unsupported are:
* changes due to mounting/unmounting a volume,
* tracking of symlinks in the path components.
2013-06-27 21:57:44 +02:00
Ingo Weinhold 1eda8517f1 BOpenHashTable: Add IsEmpty() 2013-06-27 21:57:43 +02:00
Ingo Weinhold cb4a05cfdf Missed B_WATCH_FOLDERS_ONLY occurrence 2013-06-27 21:57:42 +02:00
Ingo Weinhold 38afe232de BPathMonitor: pass BMessenger by reference 2013-06-27 21:57:42 +02:00
Ingo Weinhold 7b198d812e B_WATCH_FOLDERS_ONLY -> B_WATCH_DIRECTORIES_ONLY
Stick to the nomenclature generally used in the public API.
2013-06-27 21:57:42 +02:00
Ingo Weinhold 8d572c9264 Add class NotOwningEntryRef
A entry_ref subclass that avoids cloning the entry name.
2013-06-27 21:57:41 +02:00
Ingo Weinhold 77ca66cdb7 BPathMonitor: make the node watching mechanism configurable
Add inner class BWatchingInterface and method SetWatchingInterface().
This abstracts the calls to watch_node() and stop_watching(), thus
making it possible to use the path monitor in Tracker.
2013-06-27 21:57:41 +02:00
Ingo Weinhold ad1875fd70 BPathMonitor: use pthread_once for initialization 2013-06-27 21:57:40 +02:00
Ingo Weinhold 5fa3519dec BString::Private: Add IsShareable() 2013-06-27 21:57:40 +02:00
Ingo Weinhold 105511275e Move PUuid from shared to support 2013-06-27 21:57:39 +02:00
Jérôme Duval 6e6c121b84 virtio: added several devices ids. 2013-06-07 18:00:17 +02:00
John Scipione 1c95f72222 Don't set MaxContentWidth on the menu bar of a BMenuField
Fixes #9816

It is no longer necessary, or even desirable for us to set the max
content width of the menu bar of a BMenuField now that BMenuItem
truncation and BMenuField sizing are working.

The user may, however, wish to set the max content width of the menu
bar of a BMenuField themselves like so:

menuField->MenuBar()->SetMaxContentWidth(width);

and the Interface Kit will automatically deduct the left and right
margins from the width including the space used by the drop down arrow.
2013-06-07 03:25:36 -04:00