Commit Graph

7826 Commits

Author SHA1 Message Date
Pawel Dziepak e3d001ff02 x86: Implement multicast ICIs 2013-12-19 19:35:44 +01:00
Jonathan Schleifer f5a47df37d Fix the agg headers to be proper C++.
Signed-off-by: Axel Dörfler <axeld@pinc-software.de>
2013-12-19 02:00: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
Jonathan Schleifer a7d796e232 Only declare strl{cpy,cat} if they aren't defines.
On some system (e.g. OS X Mavericks), those are defines to compiler
built-ins, thus trying to declare them will fail.
2013-12-17 19:58:51 +01:00
Murai Takashi 70b978fd9f Fix the build with GCC4.8
Signed-off-by: Jérôme Duval <jerome.duval@gmail.com>
2013-12-17 18:01:44 +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
John Scipione 1e1afb3939 Updates to BOutlineListView for docs
mostly param naming.

No functional change intended.
2013-12-11 16:13:52 -05:00
Adrien Destugues 824dd0a834 Reintroduce BUrlResult and add BDataRequest
* BUrlResult is back, with ContentType and Length methods.
* BHttpResult subclasses it and use HTTP header fields to implement
those
* Introduce BDataRequest for "data" URIs. These embed the data inside
the URI, either as plaintext or base64 encoded.
2013-12-11 17:29:25 +01: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 bcfdf88186 apps, kernel: Remove B_MAX_CPU_COUNT 2013-12-06 21:57:58 +01:00
Pawel Dziepak fd96cf08a7 libroot: Remove _SC_NPROCESSORS_MAX and _SC_CPUID_MAX
_SC_NPROCESSORS_MAX and _SC_CPUID_MAX appear to be supported only by
Solaris. There isn't much point in exposing such values to the userland
anyway.
2013-12-06 21:54:07 +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
Pawel Dziepak e736a456ba kernel: Forbid implicit casts between spinlock and int32 2013-11-29 03:36:31 +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
Ingo Weinhold 01adde8502 BPackageInfo: Add ArchitectureName() 2013-11-27 15:38:42 +01:00
Ingo Weinhold f96ed66270 BPackageVersion: Add comparison operators 2013-11-27 15:38:41 +01:00
Ingo Weinhold ecd7a82e0d BSolverPackage: Add Version() 2013-11-27 15:38:41 +01:00
Adrien Destugues 509755e136 HttpRequest: remove fOutputBuffer
We can send the data directly to the output socket instead of copying it
into a BString first, at the cost of very slightly less information in
debug output.
2013-11-26 10:21: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 1e8ed5558d cpufreq: Rank modules and choose the best one 2013-11-25 00:08:13 +01:00
Pawel Dziepak 03f7d3d1db kernel: Restore logical processor disabling 2013-11-24 22:51:07 +01:00
Michael Lotz dcc56bf748 BNetEndpoint: Fix socket leak and reduce Accept() overhead.
When using the copy constructor of BNetEndpoint the socket of the
original endpoint gets dup'ed. The Accept() method later directly reset
the fSocket member of the newly created BNetEndpoint to the socket
returned by accept(). The socket dup'ed by the copy constructor was
therefore leaked.

Of course dup'ing the socket and copying the local and remote addresses
is superfluous in the accept case, as these members all get set to new
values. To reduce that overhead there is now a new private constructor
that directly gets the final socket and remote and local address.
2013-11-24 22:36:29 +01:00
Ingo Weinhold 2b76973fa2 mimeset: Use TextSnifferAddon when using a custom MIME DB
That addresses the problem that packaged text files aren't correctly
identified (ticket #9972). All concerned packages have to be rebuilt,
of course.
2013-11-22 12:24:13 +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 62b164bd71 BPathFinder: Add BPackageResolvableExpression initialization
Add a constructor and a SetTo() method with a
BPackageResolvableExpression parameter instead of a path. The path of
the package satisfying the expression is used.

The new functionality lives in libpackage as it uses the package kit.
2013-11-21 13:29:21 +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
Ingo Weinhold 88706cfaa5 package kit: Add API for parsing resolvable expression strings
* Add BPackageInfo::ParseResolvableExpressionString().
* Add BPackageResolvableExpression constructor and SetTo() taking an
  expression string.
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
Ingo Weinhold efe9df3791 driver settings: Add load_driver_settings_file()
Allows loading an already opened driver settings file (by FD).
2013-11-19 15:06:30 +01:00
Ingo Weinhold 0eb197d40c BPathFinder: Coding style improvements 2013-11-19 02:05:36 +01:00
Ingo Weinhold 22e92014f0 s/B_FIND_PATH_IMAGE_PACKAGE_PATH/B_FIND_PATH_PACKAGE_PATH/
It doesn't only work for image files, so make the name more general.
2013-11-19 02:05:35 +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
Stefano Ceccherini 905f910e53 Network route API: Second try (WIP).
Implement BNetworkRoster::GetRoutes() and BNetworkInterface::GetRoutes().
Also implement BNetworkInterface::GetDefaultGateway().
There is code duplication at the moment, and the api only supports IPV4.
2013-11-16 13:29:32 +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
Stefano Ceccherini 0074cea398 Implement BNetworkRoster::GetNextRoute()
Implement BNetworkRoster::GetNextRoute() and used it in Network preflet.
2013-11-15 21:59:28 +01:00
Adrien Destugues 564e256649 Various fixes to Services Kit
* Remove useless dummy protocol loop in UrlRequest
 * Stop HTTP requests before deleting the socket and other things the
loop may still be using
 * Deletion of items from the authentication map wasn't working
 * Remove some debug traces
2013-11-15 16:32:18 +01: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
John Scipione 6f33360fac BPopUpMenu style fixes for documentation, no functional change intended 2013-11-11 19:27:45 -05:00
Ingo Weinhold e5f6591382 VM: vm_memset_physical(): Correct length parameter type 2013-11-11 22:27:52 +01:00
Jérôme Duval 847ab5a734 acpi: EcGpeHandler() should return ACPI_REENABLE_GPE.
* this clears the GPE if level triggered and possibly enables the GPE.
See AcpiEvFinishGpe() and AcpiEvGpeDispatch().
2013-11-11 18:59:38 +01:00
Jérôme Duval a0f124211a scsi: define SCSI_DEVICE_MAX_LUN_COUNT to set a custom max lun count.
* virtio_scsi can have 16384 luns, though we cap at 256 as our scsi_ccb
only uses uchar as a type for target_lun and target_id members.
* minor code cleanup in scsi_scan_bus().
2013-11-09 13:09:20 +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