Commit Graph

5176 Commits

Author SHA1 Message Date
Ithamar R. Adema
4b47d96a77 arm: fix compiler ARM architecture detection
For determining if to define ATOMIC{,64}_FUNCS_ARE_SYSCALLS, use
the proper macro.
2014-02-15 11:46:11 +01:00
Ithamar R. Adema
5cef6be21f arm/atomic: fixup arch_atomic.h
* Remove _inline functions, since we're not using inlines
* Use compiler barrier instead of GCC builtin
2014-02-15 11:46:11 +01:00
Alexander von Gluck IV
35171b073d arm: Miscellaneous build fixes
* Use atomic_get_and_set for return value
* Atomics are no longer volatile
* Add missing arch_cpu_pause stub
* Move arch_cpu_idle to arch_cpu header to match
  other architectures
2014-02-12 23:37:15 -06:00
Alexander von Gluck IV
8018e8fa91 arm: Rework hrev46863 to use gcc built-in
* Those calls were indeed v7+ only, and our toolchain
  is v6.
2014-02-12 23:34:08 -06:00
Alexander von Gluck IV
92b2e03d0d arm: Add initial memory barrier functions
* These likely need reviewed by someone better
  at arm assembly. (#10537)
2014-02-12 23:11:11 -06:00
Jérôme Duval
7202cfb455 build fix follow up on status_t/ssize_t changes.
* added a TODO in packagefs.
2014-02-11 18:26:41 +01:00
Adrien Destugues
6555120f3b ...and also fix a mismatched prototype
gcc2 doesn't seem to notice.
2014-02-11 13:26:32 +01:00
Adrien Destugues
36b1f55a18 DynamicBuffer: implement BDataIO
This makes it possible to use it with the ZlibDecompressor.
2014-02-11 12:06:41 +01:00
Adrien Destugues
9af2105d36 Move ZlibDecompressor to libshared
* This will be used to implement compressed http streams
* Remove the custom BDataOutput class, and use BDataIO instead, for
easier integration with existing code.
2014-02-11 12:06:38 +01:00
Ingo Weinhold
32cae72412 package daemon: Handle location info request in app thread
* ... instead of queuing it for the job thread. The advantage is that
the request will be handled immediately and clients won't have to wait
for transactions (which may even require user feedback) to finish. It
complicates Volume a bit, since there are now two threads that may
access it. The shared data have been moved to a State object which is
protected by a lock.
* For commit transaction requests check whether another package request
is already pending/in progress before queuing a job. Fail immediately,
if there is.

Fixes bug #10039.
2014-02-07 01:21:57 +01:00
Pawel Dziepak
a96e17ba9d kernel: Adjust load tracking interval 2014-02-06 03:23:28 +01:00
Stephan Aßmus
a6db6bd40f Added WIP support for affine transformations to BViews.
Everything untested, but compiles, so it must work. The idea is to introduce
BAffineTransform additionally to the existing Origin and Scale properties of
BViews. One may use it in parallel or as an alternative. Painter in app_server
is not yet aware of the additional transformation. It is however already used
to transform drawing coordinates. It probably needs to work differently,
perhaps only in Painter and AGGTextRenderer.
2014-02-04 22:53:06 +01:00
Alexander von Gluck IV
339a018112 radeon_hd: Rework dp aux functions to take connector index
* This is less pretty, but we need access to the connector
  to find the HPD gpio pin mask on the card.
* dp_aux communications seem to work again.
* If you have a DisplayPort item attached to your card you
  may want to just unplug it at this point. We attempt DP
  link training and it fails. This failure will also cause
  other monitors to not function as app_server still isn't
  multi-head aware (#10486)
2014-02-03 20:20:13 -06:00
Alexander von Gluck IV
8ebdc440de radeon_hd: Better tracing. Fix DP ack bitwise shift 2014-02-03 06:44:28 +00:00
Pawel Dziepak
527da4ca8a x86[_64]: Separate bootloader and kernel GDT and IDT logic
From now on bootloader sets up its own minimal valid GDT and IDT. Then
the kernel replaces them with its own tables.
2014-01-28 00:44:02 +01:00
Adrien Destugues
50df6e9824 Add missing pipe character in KDL keymap.
For non-US keyboards, the extra 102th/105th key is used to reach \. But,
we also need it to report | when shifted (this is the key left to
"enter").

This affects only USB keyboards. Thanks to gordoncjp for reporting!
2014-01-27 10:57:11 +01:00
Ingo Weinhold
ee2974dadb mime/Database: Add SetIcon[ForType]() BBitmap* version
When switching AppMetaMimeCreator from BMimeType to Database the
SetIcon[ForType]() calls with a BBitmap* ended up calling the vector
icon version with the icon_size as the data size argument, thus not only
not writing the bitmap icon attributes, but also clobbering the vector
icon attribute.
2014-01-25 11:53:47 +01:00
Ingo Weinhold
6ef57ae2a9 pkgman: Add full-sync command
* BSolver/LibsolvSolver: Add FullSync() method. It uses libsolv's
SOLVER_DISTUPGRADE mode.
* BPackageManager: Add FullSync() using the new solver mode.
* pkgman: Add full-sync command.

The new command is similar to the update command without arguments, just
more aggressive, allowing downgrading or even removal of packages, to
match the state of the repositories. Just like "update" it doesn't work
properly yet.
2014-01-25 10:47:35 +01:00
Pawel Dziepak
82bcd89b92 kernel: Add CPUSet::{Clear, Set}BitAtomic() functions 2014-01-24 13:59:58 +01:00
Pawel Dziepak
03451e4cc1 kernel: Fix deadlock with thread sending signal to itself
UserEvent can be fired from scheduler_reschedule() i.e. while holding current
thread scheduler_lock. If the current thread goes sleep and during reschedule
one of its timers sends a signel to it, then scheduler_enqueue_in_run_queue()
attempts to acquire again its scheduler_lock resulting in a deadlock.

There was also a minor issue with both scheduler_reschedule() and
scheduler_enqueue_in_run_queue() acquiring current CPU scheduler mode lock.
2014-01-24 13:59:58 +01:00
Adrien Destugues
d417133ed2 Fix cookies with far expiration date.
Some websites set cookies expiring in the (not so) far future, after year 2038.
So, using time_t to store the cookie expiration date won't do. Use the
BDateTime class instead.

This makes goodsearch.com login work again (#10460).
2014-01-23 17:22:46 +01:00
Stephan Aßmus
14652ec4bb trim support code: The passed in MemoryDeleter was never used.
When a buffer has to be allocated, I guess the intention was to
assign the MemoryDeleter to it, so that it would later be freed.
CID 1130505
2014-01-22 22:23:31 +01:00
Rene Gollent
701a5d6b79 Resolve #10435.
Adjust Database{Location} to only attempt to create a mimetype when
actually necessary, and fail otherwise if a writable version doesn't yet
exist. Correspondingly, adjust callers such as
DatabaseLocation::DeleteAttribute(). Fixes a problem where a caller asking
to perform a mimeset could fail early due to SetSupportedTypes() attempting
to update the read-only mime database entry supplied by a package, and
consequently most of the mimeset operations would be skipped.
2014-01-20 20:52:32 -05:00
Alexander von Gluck IV
14919567d1 kernel: Add more architecture code post-scheduler
* Fix incorrect cpu vendor name mapping
* Add additional CPU architectures
* Add additional CPU vendors
* Rework PowerPC arch_system_info passing
  PVR back for cpu model
2014-01-19 21:53:56 -06:00
Pawel Dziepak
e1720098c6 kernel: No need for arch specific ifdefs in arch/atomic.h 2014-01-20 04:09:17 +01:00
Alexander von Gluck IV
c9e66bfc9b kernel: Add missing smp memory barrier calls. Set max cpu to 1
* Set max cpu to 1 for PPC until atomic functions are finished
* We have atomic functions inline in the kernel and assembly
  code in libroot post-scheduler merge... isn't that a lot of
  duplication?
2014-01-19 19:33:21 -06:00
Alexander von Gluck IV
fb8026e82b kernel: Add missing PPC CPU functions for idle / pause 2014-01-19 14:38:01 -06:00
Alexander von Gluck IV
524bea3553 kernel: fix missing cpu cache defines non-x86
* Regression introduced due to scheduler change
* Other other non-x86, non-ppc, and non-arm platforms
  need evalulated for this metric
2014-01-19 14:27:09 -06:00
Alexander von Gluck IV
6647d2c95a kernel: fix missing SMP_MAX_CPUS on non-x86
* Regression introduced due to scheduler change
* Drop MAX_BOOT_CPUS as it is no longer used
2014-01-19 14:09:51 -06:00
Ingo Weinhold
8540ec2446 Save previous session's debug syslog during boot
Add boot loader debug menu option "Save syslog from previous session
during boot". If enabled (defaults to true), the previous session's
debug syslog data is copy to a separate buffer and passed to the
kernel, which writes it back to the file /var/log/previous_syslog.
As long as Haiku still boots, this should now be the most convenient way
to retrieve the output from a kernel crash.
2014-01-19 10:46:00 +01:00
Adrien Destugues
ef726c687a Intel_extreme: improve i855 support.
https://github.com/druga/haiku-stuff/tree/master/intel_extreme
Rebased against current sources.

* The BIOS video mode sometimes reports a scaled mode instead of the
physical panel dimensions. Get the data from the VBT table as well, and
use it if the reported resolution is bigger.
* On first boot, force the panel native mode so the user doesn't have to
set it manually.
* Only allow a single head at a time on i855gm, as the card can't drive
both heads at the same time.
* Detect when a new requested mode is the same as the current one, and
skip modesetting in that case. Avoids screen flickering when changing
workspaces.
* Fix some cases of misdetecting which pipes to enable
2014-01-17 12:42:20 +01:00
Pawel Dziepak
d0f2d8282f Merge branch 'scheduler'
Conflicts:
	build/jam/packages/Haiku
	headers/os/kernel/OS.h
	headers/os/opengl/GLRenderer.h
	headers/private/shared/cpu_type.h
	src/add-ons/kernel/drivers/power/acpi_battery/acpi_battery.h
	src/bin/sysinfo.cpp
	src/bin/top.c
	src/system/kernel/arch/x86/arch_system_info.cpp
	src/system/kernel/port.cpp
2014-01-17 04:06:15 +01:00
Alexander von Gluck IV
7c28f77332 system: Improve AMD CPU detection
* Several CPUID's were thrown into the Athlon 64
  catch all.  Add Sempron 64 and correct CPUIDs
  solves #9553
* Add better AMD A-Series detection
2014-01-14 20:24:02 -06:00
Jonathan Schleifer
6abec6b93a Declare BLooperListIterator in the right place.
Before, it tried to typedef it to a private struct, but outside of the
class.
2014-01-10 22:31:37 +01:00
Pawel Dziepak
a2634874ed scheduler: Estimate the load thread is able to produce
Previous implementation based on the actual load of each core and share
each thread has in that load turned up to be very problematic when
balancing load on very heavily loaded systems (i.e. more threads
consuming all available CPU time than there is logical CPUs).

The new approach is to estimate how much load would a thread produce
if it had all CPU time only for itself. Summing such load estimations
of each thread assigned to a given core we get a rank that contains
much more information than just simple actual core load.
2014-01-09 03:50:54 +01:00
Alexander von Gluck IV
aa4b5749d6 runtime_loader: Detect and trigger on PE binaries
* Previously PE binaries would trigger the "incorrectly
  executable" dialog. Now we get a special message for
  B_LEGACY_EXECUTABLE and B_UNKNOWN_EXECUTABLE
* Legacy at the moment is a R3 x86 PE binary. This could
  be extended to gcc2 binaries someday far, far, down the
  road though
* The check for legacy is based on a PE flag I see
  set on every R3 binary (that isn't set on dos ones)
* Unknown is something we know *is* an executable, but
  can't do anything with (such as an MSDOS or Windows
  application)
* No performance drops as we do the PE scan last
* Tested on x86 and x86_gcc2
2014-01-07 19:38:07 -06:00
Pawel Dziepak
4ca31ac964 kernel: Fix ABA problem in try_acquire_read_spinlock() 2014-01-06 21:03:42 +01:00
Pawel Dziepak
8cf8e53774 kernel/x86: Inline atomic functions and memory barriers 2014-01-06 09:08:53 +01:00
Pawel Dziepak
cb66faef24 scheduler: Work around GCC2 limitations in function inlining
GCC2 won't inline a function if it is used before its definition.
2014-01-06 01:22:53 +01:00
Pawel Dziepak
81e04d7b97 kernel: Remove cpu_info::load
This field forces kernel to track each CPU load all the time. It is not
a problem with the current scheduler on a multicore systems, but on
single core machnies or with any other future scheduler this field may
become just an unnecessary burden. It isn't difficult for an application
to compute CPU load by itself when it needs it.
2014-01-03 19:44:57 +01:00
Pawel Dziepak
135bb9c959 kernel: Do not attempt to interrupt a thread that is not waiting 2013-12-31 03:53:56 +01:00
Pawel Dziepak
15a7f2046a kernel: Return CPU load in cpu_info 2013-12-29 22:47:06 +01:00
Pawel Dziepak
e46f284adc kernel/util: MinMaxHeap: Fix unused variable warnings 2013-12-29 22:47:05 +01:00
Pawel Dziepak
a47974dd06 scheduler: Use heap to determine highest priority thread 2013-12-29 19:24:01 +01:00
Pawel Dziepak
3309bf33c7 kernel/util: Make MinMaxHeap::Peek*() const 2013-12-23 03:52:13 +01:00
Ingo Weinhold
f0c3101151 BControl: Move icon code to separate class BIcon 2013-12-22 15:17:53 +01:00
Ingo Weinhold
be4367428b BControl subclasses: Override SetIcon()
... and implement Perform() action for potential later use.
2013-12-22 02:48:27 +01:00
Ingo Weinhold
be260374d5 BControl: Add icon support
The icon is meant as an addition to or replacement of the label. Icon
bitmaps for various states of the control (off, on, partially on, each
enabled or disabled, plus up to 125 custom states) can be set
individually via SetIconBitmap() (getter IconBitmap()).
The convenience method SetIcon() can be used to set the bitmaps for the
standard states from a single bitmap; it also supports cropping the
icon to its non-transparent area. Code borrowed from BIconButton.
2013-12-22 02:48:25 +01:00
Pawel Dziepak
b89b5d3826 x86: Make arch/smp.h a C++ only header 2013-12-20 22:05:26 +01:00
Pawel Dziepak
b258298c70 kernel: Protect cpu_ent::active_time with sequential lock
atomic_{get, set}64() are problematic on architectures without 64 bit
compare and swap.
Also, using sequential lock instead of atomic access ensures that
any reads from cpu_ent::active_time won't require any writes to shared
memory.
2013-12-20 01:31:32 +01:00
Pawel Dziepak
6639514437 x86[_64]: Support assigning MSI IRQs to arbitrary CPU 2013-12-20 01:07:08 +01:00
Pawel Dziepak
e3d001ff02 x86: Implement multicast ICIs 2013-12-19 19:35:44 +01:00
Pawel Dziepak
1b06228f13 kernel: Propagate scheduler modes to cpu{freq, idle} modules 2013-12-17 23:26:37 +01:00
Pawel Dziepak
4fcbac58de kernel: Make get_cpu_topology() return a pointer to const
The client code is not supposed to change the topology info.
It would be also nice if cpu_topology_node::children was an array of
pointers to const but that would require several const_casts in the
topology tree generation code so it's probably not worth it.
2013-12-17 22:08:18 +01:00
Jonathan Schleifer
724947ebca HashSet.h: Replace whatever that was with proper C++ 2013-12-17 19:58:52 +01:00
Pawel Dziepak
735f67481f x86: Debugger can now use dr3 2013-12-17 04:31:29 +01:00
Pawel Dziepak
a5b070f1fa x86: Store pointer to the current thread in gs:0
Apparently, reading from dr3 is slower than reading from memory
with cache hit.

Also, depending on hypervisor configuration, accessing dr3 may cause
a VM exit (and, at least on kvm, it does), what makes it much slower
than a memory access even when there is a cache miss.
2013-12-17 04:08:51 +01:00
Pawel Dziepak
611376fef7 x86: Let each CPU have its own GDT 2013-12-17 03:57:20 +01:00
Pawel Dziepak
7b9668170c kernel, boot: Increase CPU limit to 64 2013-12-16 05:00:02 +01:00
Pawel Dziepak
d02aaee17e kernel, libroot: Add more memory info in system_info
system_info now contains all information previously available only
through __get_system_info_etc(B_MEMORY_INFO, ...).
2013-12-16 04:53:46 +01:00
Pawel Dziepak
1bc7045fdf kernel, libroot: Introduce new API for obtaining system info 2013-12-16 03:58:43 +01:00
Rene Gollent
4b62c6b0bc libmedia: Fix x86-64 debug build. 2013-12-13 17:53:12 -05:00
Ingo Weinhold
9bdb5e0a92 kernel safemode: Add functions to get options early
Add get_safemode_option_early() and get_safemode_boolean_early() to get
safemode options before the kernel heap has been initialized. They use a
simplified parser.
2013-12-10 19:05:47 +01:00
Ingo Weinhold
7a1e706df7 safemode.h: Update coding style 2013-12-10 17:07:20 +01:00
Pawel Dziepak
3e0e3be760 boot, kernel: Replace MAX_BOOT_CPUS with SMP_MAX_CPUS 2013-12-06 19:43:08 +01:00
Pawel Dziepak
f0fe981769 kernel: Fix gcc2 build 2013-12-06 03:31:20 +01:00
Pawel Dziepak
2b04d8ab31 x86/paging: Use CPUSet instead of cpu_mask_t 2013-12-06 03:27:48 +01:00
Pawel Dziepak
7629d527c5 kernel: Use CPUSet in ICI code instead of cpu_mask_t 2013-12-06 03:08:39 +01:00
Pawel Dziepak
730882d615 kernel: Remove RunQueueLink.h 2013-12-05 23:28:42 +01:00
Pawel Dziepak
52b442a687 kernel: smp_cpu_rendezvous(): Use counter instead of bitmap 2013-12-05 23:10:04 +01:00
Pawel Dziepak
d287274dce scheduler: Code refactoring 2013-12-05 22:47:30 +01:00
Ingo Weinhold
7b83ce1142 Add KDL command "mapping"
* VMTranslationMap:
  - Add DebugPrintMappingInfo(): Given a virtual address it is supposed
    to print the paging structure information for that address. To be
    implemented by derived classes.
  - Add DebugGetReverseMappingInfo(): Given a physical addresss it is
    supposed to find all virtual addresses mapped to it. To be
    implemented by derived classes.
* X86VMTranslationMapPAE: Implement the new methods
  DebugPrintMappingInfo() and DebugGetReverseMappingInfo().
* Add KDL command "mapping". It supports both virtual address lookups
  and reverse lookups.
2013-12-05 05:13:21 +01:00
Ingo Weinhold
e551626f40 Implement support for a SYS:ENV attribute on executable
__flatten_process_args() does now have the executable path as an
additional (optional) parameter. If specified, the function will read
the file's SYS:ENV attribute (if set) and use its value to modified the
environment it is preparing for the new process. Currently supported
attribute values are strings consisting of "<var>=<value>" substrings
separated by "\0" (backslash zero), with '\' being used as an escape
character. The environment will be altered to contain the specified
"<var>=<value>" elements, replacing a preexisting <var> element (if
any).

A possible use case would be setting a SYS:ENV attribute with value
"DISABLE_ASLR=1" on an executable that needs ASLR disabled.
2013-12-01 18:34:07 +01:00
Ingo Weinhold
7bf85edf58 Allow disabling ASLR via DISABLE_ASLR environment variable
* VMAddressSpace: Add randomizingEnabled property.
* VMUserAddressSpace: Randomize addresses only when randomizingEnabled
  property is set.
* create_team_arg(): Check, if the team's environment contains
  "DISABLE_ASLR=1". Set the team's address space property
  randomizingEnabled accordingly in load_image_internal() and
  exec_team().
2013-12-01 02:51:50 +01:00
Ingo Weinhold
e2c5cf691d boot loader: Menu: Add SetTitle() 2013-11-30 19:56:26 +01:00
Ingo Weinhold
cbfc38c62d boot loader: MenuItem: Add SetLabel() 2013-11-30 19:39:57 +01:00
Ingo Weinhold
25a83d13b9 ramdisk: Switch to CLI command for user interface
* Drop the old "echo to control device" interface in favor of an ioctl
  interface.
* Add CLI program "ramdisk" to manage RAM disks.
2013-11-30 17:02:49 +01:00
Ingo Weinhold
5df58b522b Move TextTable from pkgman to libshared 2013-11-30 17:02:49 +01:00
Pawel Dziepak
2b7ea4cddf kernel: Remove Thread::next_state 2013-11-29 19:31:10 +01:00
Pawel Dziepak
673f08a995 kernel: Make thread_block_locked() private 2013-11-29 05:30:50 +01:00
Pawel Dziepak
7f8cf14b71 scheduler, kernel/util: Fix style issues 2013-11-29 04:51:38 +01:00
Pawel Dziepak
3514fd77f7 kernel: Reduce lock contention when processing ICIs 2013-11-29 03:36:44 +01:00
Jérôme Duval
e4e1cf9aff PCI: moved IDE api flags to PCI.h 2013-11-28 18:38:45 +01:00
Pawel Dziepak
286b341a40 kernel: Merge two occurences of thread resume code 2013-11-28 14:03:57 +01:00
Pawel Dziepak
7db89e8dc3 kernel: Rework cpuidle module
* Create new interface for cpuidle modules (similar to the cpufreq
   interface)
 * Generic cpuidle module is no longer needed
 * Fix and update Intel C-State module
2013-11-25 23:50:27 +01:00
Ingo Weinhold
fb52b1f8b4 VFS FIFO: Enlarge FIFO buffer sizes
* Increase FIFO buffer capacity from 32 to 64 KiB and the FIFO atomic
  write size ({BUF_SIZE}) from 512 bytes to 4 KiB (both like Linux).
* Fix *pathconf(..., _PC_PIPE_BUF). It was returning 4 KiB although the
  implemented atomic write size was 512 bytes only. Now both *pathconf()
  and the FIFO implementation refer to the same constant.
2013-11-25 12:45:37 +01:00
Ingo Weinhold
dd11460a49 Add a hex dump utility for use in KDL commands 2013-11-25 12:45:36 +01:00
Pawel Dziepak
0e94a12f8e kernel: Make CACHE_LINE_ALIGN visible in the whole kernel 2013-11-25 00:35:15 +01:00
Pawel Dziepak
03f7d3d1db kernel: Restore logical processor disabling 2013-11-24 22:51:07 +01:00
Ingo Weinhold
6140f897d4 TextSnifferAddon: Use MIME DB directly
A DatabaseLocation is passed to the constructor and used to verify that
the sniffed MIME type is installed instead of BMimeType::IsInstalled().
This makes the add-on independent of the default MIME DB.
2013-11-22 12:24:13 +01:00
Ingo Weinhold
85835e4186 registrar: Move more classes to libstorage_kit_mime.a
Move MimeSnifferAddon, MimeSnifferAddonManager, and TextSnifferAddon to
libstorage_kit_mime.a, so we can reuse them.
2013-11-22 12:24:12 +01:00
Pawel Dziepak
a04b7d9f96 power: Remove old cpufreq interface 2013-11-22 05:30:14 +01:00
Ingo Weinhold
ee8e91583e BPackageManager::UserInteractionHandler: Make non-abstract
Most of the hooks don't strictly need a non-empty implementation. The
defaults now simply throw exceptions in those that do. This allows the
class to be instantiated, which is useful when a BPackageManager is only
used for finding packages.
2013-11-21 13:29:21 +01:00
Ingo Weinhold
6722e1ae43 BPackageManager: Add mandatory constructor parameters
Require the installation interface and the user interaction handle to
be passed to the constructor. Formerly, derived classes set them
manually in their constructors. This makes using the class without
having to subclass it possible.
2013-11-21 13:29:20 +01:00
Pawel Dziepak
14e36af649 kernel[/util]: Fix debug builds 2013-11-21 03:24:54 +01:00
Pawel Dziepak
024541a4c8 kernel: Improve rw_spinlock implementation
* Add more debug checks
 * Reduce the number of executed instructions that lock the bus.
2013-11-21 02:25:03 +01:00
Pawel Dziepak
308f594e2a kernel, libroot: Make scheduler modes interface public 2013-11-20 23:32:40 +01:00
Ingo Weinhold
c04f3a625a boot loader: Add safe mode blacklist submenu
It's a browser for the system package content, where entries can be
selected to blacklist them. The selected entries are removed from the
packagefs instance in the boot loader, so that e.g. selected drivers
won't be picked up. The paths are also added to the safe mode driver
settings and will be interpreted when the system packagefs instance is
mounted by the kernel.
2013-11-20 16:00:35 +01:00
Ingo Weinhold
6c7abe9829 boot loader: Menu[Item] API improvements
* Make Menu and MenuItem polymorphic.
* MenuItem:
  - Make SetMarked() virtual, so it can be overridden.
  - Add SetSubmenu() and Supermenu().
  - Delete the submenu in the destructor.
* Menu:
  - Add Entered()/Exited() hooks. They frame the time the user navigates
    the menu or any of its submenus. The hooks allow for subclasses
    populating their item list dynamically.
  - Add SortItems().
* Update boot loader menu copyright text to include 2013, now that it is
  over soon. :-)
2013-11-20 16:00:34 +01:00
Ingo Weinhold
435fb01509 DoublyLinkedList: Add Sort() 2013-11-20 16:00:34 +01:00
Ingo Weinhold
7e7f482590 SinglyLinkedList: Missing include 2013-11-20 16:00:34 +01:00
Pawel Dziepak
9c2e74da04 scheduler: Move mode specific logic to separate files 2013-11-20 09:46:59 +01:00
Ingo Weinhold
3a7e0b0014 packagefs: Support blacklisting entries in packages
In each installation location, it is now possible to create a settings
file "packages" that allows to blacklist entries contained in packages.
The format is:

Package <package name> {
	EntryBlacklist {
		<entry path>
		...
	}
}
...

<package name> is the base name (no version) of the respective package
(e.g. "haiku"), <entry path> is an installation location relative path
(e.g. "add-ons/Translators/FooTranslator").

Blacklisted entries will be ignored by packagefs, i.e. they won't appear
in the file system. This addresses the issue that it may be necessary to
remove a problematic file (e.g. driver, add-on, or library), which would
otherwise require editing the containing package file.

The settings file is not not "live". Changes take effect only after
reboot (respectively when remounting the concerned packagefs volume).
2013-11-19 15:30:34 +01:00
Ingo Weinhold
2fdd1d9ef1 khash: Move string hash functions to own header/source file
Unlike khash they shouldn't be phased out (only renamed).
2013-11-19 15:08:34 +01:00
Stefano Ceccherini
0bc615438a Style fixes.
Style fixes pointed out by Axel. I'm rusty, and it shows.
Hope I got it right.
Also moved get_route() into BPrivate.
2013-11-18 20:01:35 +01:00
Stefano Ceccherini
41d4206692 Added family parameter to the GetRoutes() API.
Moved common code to a private file.
2013-11-18 10:13:26 +01:00
Pawel Dziepak
d897a478d7 kernel: Allow reassigning IRQs to logical processors 2013-11-18 04:55:25 +01:00
Ingo Weinhold
94fb954c53 find_path*(): Support user specific home directory
No longer hard-code the home directory path. Instead ask
find_directory(), so we get the correct one for the current user.
2013-11-18 01:50:49 +01:00
Pawel Dziepak
955c7edec2 kernel: Measure time spent in interrupt handlers 2013-11-18 01:50:37 +01:00
Pawel Dziepak
6a164daad4 kernel: Track load produced by interrupt handlers 2013-11-18 01:17:44 +01:00
Ingo Weinhold
8a3fe6d1bf Add private __getenv_reentrant()
A reentrant variant of getenv().
2013-11-17 19:11:02 +01:00
Ingo Weinhold
c39c9283aa Add get_architectures() and C++ versions
* get_architectures() returns the primary and the secondary
  architectures in one array. That turned out to be convenient.
* Add C++ versions for get[_secondary]_architectures(), returning a
  BStringList.
2013-11-17 02:09:37 +01:00
Ingo Weinhold
60b39cd741 Add get_*architecture() API, extend find_path*() API
* Add get_architecture(), get_primary_architecture(),
  get_secondary_architectures(), guess_architecture_for_path() to get
  the caller's architecture, the primary architecture, all secondary
  architectures, or the architecture associated with a specified path
  respectively.
* Rename the find_path*() functions to find_path*_etc() and add an
  optional architecture parameter. Add simplified find_path*()
  functions.
* BPathFinder: Add FindPath[s]() versions with an architecture
  parameter.
2013-11-17 02:09:36 +01:00
Ingo Weinhold
cf7e2ad812 runtime loader: Export get_executable_architecture() function
Given a path of an ELF file, it tries to determine its architecture.
2013-11-17 02:09:36 +01:00
John Scipione
1c776bfe37 Lock screensaver window directly
By passing the window pointer to ScreenSaverRunner contructor and using that
to lock the window when drawing instead of getting the window from the
Window() method of the view. This is safer.
2013-11-15 21:27:13 -05:00
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