Commit Graph

4320 Commits

Author SHA1 Message Date
Alex Wilson a84e14ca84 Merge branch 'master' of git://github.com/haiku/haiku 2011-12-15 20:50:28 -07:00
Oliver Tappe ec99f3b2a6 Adjust mbstate_t to embed the state of the ICU converter.
* make room in mbstate_t for containing an ICU-converter's state
  (well, in fact the whole converter object)
* adjust libroot's locale add-on to clone converters into a given
  mbstate_t directly
* adjust ICUThreadLocalStorageValue to contain the converter pointer
  instead of a converter-ID (if the converter is related to an
  mbstate_t, it points into the mbstate_t).
* adjust users of converters to directly use converter pointers
  instead of ICUConverterRef
* drop now unused ICUConverterManager and ICUConverterRef
* update gcc4 optional package

This brings our multibyte implementation into a fully working state,
both non-ascii and non-8-bit characters can now be handled normally
in the Terminal, i.e. this finally fixes #6276.

N.B.: Since the size of mbstate_t has changed, everything (including
the compiler!) needs to be rebuilt.
2011-12-15 13:18:11 +01:00
Alexander von Gluck IV 249495e284 Add complete set of DRM DisplayPort defines into radeon_hd
* I'd rather this be common code, but I don't have access
  to the DisplayPort specifications. If I added it as common
  code I would want to be 100% it was complete and variables
  were named properly.
* For now putting in radeon_hd private headers
2011-12-14 10:19:00 -06:00
John Scipione 0e35d5d2e5 Change instances of wether in comments to whether. No functional change intended. 2011-12-12 14:41:49 -05:00
Oliver Tappe 995d6d827f Implement our own version of wcsrtombs().
* add WcharStringToMultibyte() to libroot's locale backend
* implement wcstombs(), wcsrtombs() and wcsnrtombs() on top of that
  new backend function
2011-12-12 17:27:42 +01:00
Oliver Tappe 73186b2fcd Add implementation of mbsrtowcs() to our locale backend.
* add MultibyteStringToWchar() to ICU locale backend
* implement mbsrtowcs() and mbsnrtowcs() on top of 
  MultibyteStringToWchar()
* drop respective glibc files
2011-12-12 17:27:41 +01:00
Alexander von Gluck IV 61cf713381 Include file style cleanup, no functional change 2011-12-09 21:26:41 -06:00
Rene Gollent 4cc7fee152 Fix broken debug output. 2011-12-06 21:32:09 -05:00
Michael Lotz dd26f81c56 Add an UTF8NextCharLen() version that takes a string length.
This one works with non-terminated strings that we may need to handle.
It also validates that the sequence is valid UTF-8 so it results in
the same behaviour as the version that is used when converting to
codes (syncing the enumeration and drawing behaviour).
2011-12-06 19:09:56 +01:00
Michael Lotz 5cbe06f482 Allow replacing the object cache with the guarded heap.
This allows to use the debug features of the guarded heap also on
allocations made through the object cache API. This is obivously
horrible for performance and uses up huge amounts of memory, so the
initial and grow sizes are adjusted accordingly.

Note that this is a rather simple hack, using the object_cache pointer
to transport the allocation size. The alignment is neglected completely.
2011-12-04 13:52:06 +01:00
Michael Lotz 7418dbd908 Introduce debug page wise kernel area protection functions.
This adds a pair of functions vm_prepare_kernel_area_debug_protection()
and vm_set_kernel_area_debug_protection() to set a kernel area up for
page wise protection and to actually protect individual pages
respectively.

It was already possible to read and write protect full areas via area
protection flags and not mapping any actual pages. For areas that
actually have mapped pages this doesn't work however as no fault, at
which the permissions could be checked, is generated on access.

These new functions use the debug helpers of the translation map to mark
individual pages as non-present without unmapping them. This allows them
to be "protected", i.e. causing a fault on read and write access. As they
aren't actually unmapped they can later be marked present again.

Note that these are debug helpers and have quite a few restrictions as
described in the comment above the function and is only useful for some
very specific and constrained use cases.
2011-12-03 19:49:18 +01:00
Michael Lotz 643cf35ee8 Add debug helper functions to mark pages present.
They can be used to mark pages as present/non-present without actually
unmapping them. Marking pages as non-present causes every access to
fault. We can use that for debugging as it allows us to "read protect"
individual kernel pages.
2011-12-03 19:45:31 +01:00
Michael Lotz 44dffa86c0 Fix the etc path that was accidentally changed. 2011-12-02 14:22:28 +01:00
Michael Lotz 79f0056002 Fix virtual 8086 mode to properly account for TLS.
* The vm86 code or the code running in virtual 8086 mode may clobber the
  %fs register that we use for the CPU dependent thread local storage
  (TLS). Previously the vm86 code would simply restore %fs on exit, but
  this doesn't always work. If the thread got unscheduled while running
  in virtual 8086 mode and was then rescheduled on a different CPU, the
  vm86 exit code would restore the %fs register with the TLS value of
  the old CPU, causing anything using TLS in userland to crash later on.
  Instead we skip the %fs register restore on exit (as do the other
  interrupt return functions) and explicitly update the potentially
  clobbered %fs by calling x86_set_tls_context(). This will repopulate
  the %fs register with the TLS value for the right CPU. Fixes #8068.

* Made the static set_tls_context() into x86_set_tls_context() and made
  it available to others to faciliate the above.

* Sync the vm86 specific interrupt code with the changes from hrev23370,
  using the iframe pop macro to properly return. Previously what was
  pushed in int_bottom wasn't poped on return.

* Account for the time update macro resetting the in_kernel flag and
  reset it to 1, as we aren't actually returning to userland. This
  didn't cause any harm though as only the time tracking is using that
  flag so far.

* Some minor cleanup.
2011-11-25 16:10:19 +01:00
Ingo Weinhold ad07ecd821 BString::Private class to access BString internals 2011-11-25 06:19:45 +01:00
Ingo Weinhold 6ae0ecd49a Add a package info "install-path" attribute
The attribute is intended for simplifying package building. The
package's install path will be used for the package's .self package
symlink, allowing installation to a temporary directory when building
the package.
2011-11-25 06:19:35 +01:00
Ingo Weinhold 7efa133cb4 BPackageWriter: Add SetCheckLicenses()
The default is still "true", but now it is possible to disable the
license check.
2011-11-25 06:19:34 +01:00
Ingo Weinhold 609fc55f96 Rename the package links directory
Rename the package links directory from /package-links to just
/packages.
2011-11-25 06:19:33 +01:00
Ingo Weinhold bde1972229 Move <directories.h> to headers/private/system 2011-11-25 06:19:32 +01:00
Ingo Weinhold a54f7dc250 Move B_MIME_STRING_TYPE to <TypeConstants.h> 2011-11-25 06:19:24 +01:00
Ingo Weinhold 2c5c1adc91 Remove TwoKeyAVLTree from kernel utils again
It's not ready for shared use yet.
2011-11-25 06:19:23 +01:00
Ingo Weinhold 6cc3dcdb9b Move helper function out of QueryParser.h
They live in the new QueryParserUtils.{h,cpp} now.
2011-11-25 06:19:23 +01:00
Ingo Weinhold 8fd0aea602 AVLTreeMap fixes
* AVLTreeMap::_GetKey(): Change return type from const Key& to Key, so
  the strategy can do that as well and doesn't have have a Key object in
  the node.
* Fix the Auto strategy: It was using the undefined _GetKey() instead
  of GetKey().
2011-11-25 06:19:22 +01:00
Ingo Weinhold c5c7c2d817 Build fix 2011-11-25 06:19:21 +01:00
Ingo Weinhold ab6a1e0f74 QueryParser: The last_modified index is time_t
* Changed value type from B_INT64_TYPE to B_INT32_TYPE.
* Changed QueryPolicy::NodeGetLastModifiedTime() return value from
  bigtime_t to time_t.
2011-11-25 06:19:20 +01:00
Ingo Weinhold f4bb0389e8 TwoKeyAVLTree: Add FindFirstClosest() 2011-11-25 06:19:16 +01:00
Ingo Weinhold e88759a518 Small cleanup 2011-11-25 06:19:16 +01:00
Ingo Weinhold 502a5e2388 QueryParser: Explicitly suspend/resume iterators
Extended policy by IndexIteratorSuspend() and IndexIteratorResume()
methods that are invoked for the index iterator by Query::GetNextEntry()
after entering respectively before exiting.
2011-11-25 06:19:11 +01:00
Ingo Weinhold 004b3604a0 AVLTreeMap/TwoKeyAVLTree: More access to nodes
both:
* Add Previous()/Next().
* Add Insert() version that returns a Node* instead of an Iterator.
* Add Remove() version that takes a Node* instead of a key.

TwoKeyAVLTree:
* Add GetIterator() version that takes an additional Node*, i.e.
  initializing an iterator to point to the node.
* Add Iterator::CurrentNode().
2011-11-25 06:19:10 +01:00
Ingo Weinhold e7346707c9 AVLTree: Add Previous()/Next() 2011-11-25 06:19:10 +01:00
Ingo Weinhold 856c114ca0 Add TwoKeyAVLTree to kernel utils
This is a tree implementation with elements with primary and secondary
key. The code is a cleaned up version of ramfs's implementation. ramfs
doesn't use this version yet.
2011-11-25 06:19:05 +01:00
Ingo Weinhold 9d698c4573 Create a generalized version of BFS's query code
The new version is templatized over a QueryPolicy which provides the
interface to the file system specifics.
2011-11-25 06:19:05 +01:00
Ingo Weinhold 8ffba2a6cb Write uncompressed package file TOC, if necessary 2011-11-25 06:19:00 +01:00
Ingo Weinhold 00bc8e9cbd Add support for adding/updating package entries
Add flags parameter to BPackageWriter::Init() (and the private
implementation classes) to indicate that an existing package file shall
be updated instead of created. Currently that always happens in-place.
2011-11-25 06:18:58 +01:00
Ingo Weinhold de9e64b235 Write uncompressed package attributes if necessary
When compression doesn't save space, using it nonetheless results in a
file that the reader complains about. So we fall back to writing an
uncompressed package attributes section in such a case.

The same still needs to be done for the TOC section.
2011-11-25 06:18:57 +01:00
Ingo Weinhold 5bb68d85fc Add PackageReaderImpl heapOffset/Size getters 2011-11-25 06:18:56 +01:00
Ingo Weinhold 78811461b1 Add BLowLevelPackageContentHandler section hooks
* Add hooks HandleSectionStart() and HandleSectionEnd(). They are
  invoked to bracket package file section, so the handler can
  discriminate which section the attributes belong to.
  HandleSectionStart() features a return parameter _handleSection, which
  allows to handler to pick which sections it wants to handle.
* "package dump" does now print the section names.
2011-11-25 06:18:55 +01:00
Ingo Weinhold 29d45d5ee7 Add RangeArray utility class
Templatized class for managing a set of sorted non-overlapping integer
ranges. Merges and splits ranges as necessary.
2011-11-25 06:18:53 +01:00
Ingo Weinhold 26589141fc Declare Array destructor inline 2011-11-25 06:18:53 +01:00
Ingo Weinhold 9395c27062 Move Debugger's Array class to headers/shared 2011-11-25 06:18:52 +01:00
Ingo Weinhold 2fce201893 BLowLevelPackageContentHandler interface extension
HandleAttributeDone(): Add parentToken parameter.
2011-11-25 06:18:50 +01:00
Ingo Weinhold 0f9a98a419 Add optional FD parameter to AddEntry()
If a FD is specified, instead of using the file with the given the FD is
used. Allows for adding entries without first copying them into the
directory structure.
2011-11-25 06:18:45 +01:00
Ingo Weinhold d046296e85 Improve FileDescriptorCloser
* Add SetTo()/Unset() methods and no-argument constructor.
* Detach() returns the FD now.
2011-11-25 06:18:44 +01:00
Ingo Weinhold 9e93bb4bfc Write resolvable compatible version to the package
To avoid a clash with the regular version or an extra attribute level we
use the "package:provides.compatible" package attribute instead of
"package:version.major".
2011-11-25 06:18:27 +01:00
Ingo Weinhold 54e721afeb Add support for bind-mounting directories
* Add support function vfs_get_mount_point(), so a file system can get
  its own mount point (i.e. the node it covers). Re-added
  fs_mount::covers_vnode for that purpose -- the root node isn't know to
  the VFS before the mount() hook returns.
* Add function vfs_bind_mount_directory() which bind-mounts a directory
  to another. The Vnode::covers/covered_by mechanism is used, so this
  isn't true bind-mounting, but sufficient for what we need ATM and
  cheaper as well. The vnodes connected thus aren't tracked yet, which
  is needed for undoing the connection when unmounting.
* get_vnode_name(): Don't use dir_read() to read the directory. Since we
  have already resolved vnode to the covered vnode, we don't want the
  dirents to be "fixed" to refer to the covering nodes. Such a vnode
  simply wouldn't be found.
2011-11-25 06:17:44 +01:00
Ingo Weinhold f4a1387cea Add vfs_ prefix to resolve_vnode_to_covering_vnode() 2011-11-25 06:17:44 +01:00
Ingo Weinhold 47ea54c55b Generalize use of Vnode::covered_by/covers
* Introduce Vnode flags for covered and covering. Can be used as a quick
  check when one doesn't already hold sVnodeLock.
* Rename resolve_mount_point_to_volume_root() to
  resolve_vnode_to_covering_vnode().
* Adjust all code that deals with transitions between mount points and
  volume root vnodes to generally support covered/covering vnodes.
2011-11-25 06:17:43 +01:00
Oliver Tappe 323b65468e Filtered flat import of Oliver's svn package management branch
Bring the changes that aren't package management related and the ones
that are but don't take effect as long as they are ignored by the build
system into the master.

Summary of changes:
* Introduce private header <directories.h> with constants for a good
  deal of paths that should usually be retrieved via find_directory().
* Replace hard-coded paths by using find_directory() or the
  <directories.h> constants (e.g. in drivers and the kernel).
* Add find_directory() constants needed for package management.
* Add __HAIKU_ABI_NAME and B_HAIKU_ABI_NAME macros.
* src/apps/deskbar: BeMenu.* -> DeskbarMenu.*,
  DeskBarUtils.* -> DeskbarUtils.*
* Change deskbar menu settings directory from ~/config/be to
  ~/config/settings/deskbar.
* Other smaller cleanups, changes, and fixes.
2011-11-25 06:17:07 +01:00
Alexander von Gluck IV cb050a33be Add support for thermal status queries on newer chipsets
* add temperature query support for Juniper, Sumo, Evergreen, and North Islands
* add missing thermal defines for evergreen cards
* northern island cards use the evergreen thermal calculations
2011-11-24 19:42:45 -06:00
Oliver Tappe ae90193596 Introduce __set_errno() throughout libroot.
* add errno_private.h, which defines the __set_errno() macro with
  and without tracing
* instead of setting errno manually, all libroot's code now invokes
  __set_errno(), which makes it much easier to trace changes to errno
* redirect glibc's use of __set_errno() to our own version
2011-11-24 23:48:18 +01:00