Commit Graph

5053 Commits

Author SHA1 Message Date
John Scipione e8c8f8536c Storage Kit: Style fixes to database_support.h 2014-07-17 14:51:31 -04:00
John Scipione db1ef05aef BShape: Style fixes for docs 2014-07-14 19:02:44 -04:00
Ingo Weinhold e1e6c12480 BPackageWriter::Recompress(): Change param to BPositionIO*
Besides that this is a nicer interface, it allows us to get a the HPKG
header as a side effect of initializing the reader, thus preventing
seeking backward in the file. This makes "package recompress - <file>"
work.
2014-07-13 17:57:57 +02:00
Ingo Weinhold 43a6b92c64 PackageReaderImpl: Delay reading sections until ParseContent() 2014-07-13 17:57:56 +02:00
Ingo Weinhold 1606450b32 ReaderImplBase::Init(): Make file size check optional
If the file doesn't support GetSize(), skip the header total size file
size check.
2014-07-13 17:57:56 +02:00
Ingo Weinhold 05b565f4f2 Add private BDataPositionIOWrapper
Implements the BPositionIO interface on top of a BDataIO, requiring the
{Read,Write}At() accesses to be sequential.
2014-07-13 17:57:56 +02:00
Ingo Weinhold 44c4771163 BPackageWriter: Add BPositionIO support 2014-07-13 17:57:55 +02:00
Julian Harnath b916156a83 Move libroot synchronization functions to private namespace
* Prefix lock functions with __ to mark them as private. Add
  forwarding macros to keep existing code working.

* Avoids symbol name clashes with kernel lock APIs, occuring when
  using kernellandemu-lib in userlandfs. Thanks to Ingo for the
  suggestion.
2014-07-13 16:19:08 +02:00
Julian Harnath 2e75b75292 Fix building Haiku from Haiku
* Always include cdefs.h to have __[BEGIN|END]_DECLS defined.
  Somehow, this didn't affect cross-build, but it made building
  from Haiku fail.
2014-07-13 15:35:31 +02:00
Ingo Weinhold 8f5130edfa package kit: Actually add support for B_HPKG_COMPRESSION_NONE
Until now we always declared in the HPKG header that the package file is
zlib compressed. For uncompressed files we would just store all
individual chunks uncompressed. Now we handle completely uncompressed
files slightly differently: We don't write the redundant chunk size
table anymore. The size savings are minor, but it makes the uncompressed
format read-streamable which may be handy.
2014-07-12 23:12:21 +02:00
Ingo Weinhold e527b79631 Switch package file accessor classes to use BPositionIO
* PackageFileHeap{Reader,Writer} as well as Package{Reader,Writer} and
  their implementation and super classes do now internally use a
  BPositionIO instead of a FD to access the package file. This provides
  more flexibility needed for features to come.
* BPackageReader has already grown a new Init() version with a
  BPositionIO* parameter.
2014-07-12 15:40:22 +02:00
Ingo Weinhold c55a06055f Add private class BFdIO
Simple BPositionIO implementation using the POSIX API on a FD. In effect
similar to BFile, but more easily ported to kernel and boot loader (and
the FD is reusable).
2014-07-12 15:40:21 +02:00
Axel Dörfler de9c061339 bfs: Use the QueryParserUtils instead of its own copy.
* Ingo copied the methods into a shared location, and then obviously
  "forgot" to let BFS use them. As a side note for Ingo: the complete
  error GCC reported was "std::fssh_size_t" not defined with the macro
  wrapper as code location. The actual problem was a "using std::size_t"
  in some C++ header that accidentally got included after the wrapper.
* The shared Query code is not yet used. That'll be done another time.
* Renamed BFS_SHELL define to FS_SHELL, such that QueryParserUtils can be
  used in any file system shell, not just the bfs_shell.
2014-07-09 22:54:39 +02:00
Ingo Weinhold cdfeba5a1e BPackageWriter: Add Recompress()
Allows rewriting an existing package file with a different compression.
2014-07-08 22:00:35 +02:00
Ingo Weinhold a5330a8e41 Remove private support kit BUrl
Use the public BUrl from the network kit instead.
2014-07-03 17:39:59 +02:00
Ingo Weinhold 6926863e37 DynamicBuffer::Write(): Fix return type and semantics 2014-07-03 17:39:58 +02:00
Ingo Weinhold 7616c39db6 DynamicBuffer: dos2unix 2014-07-03 17:39:57 +02:00
Ingo Weinhold 739f15e144 Revert "Revert "DynamicBuffer: implement BDataIO""
This reverts commit 747b401e87.
2014-07-03 17:39:57 +02:00
Ingo Weinhold 72cf56a0fd BZlibCompressionAlgorithm: Basic support for gzip format 2014-07-01 21:54:58 +02:00
Ingo Weinhold b3263ad3e1 Switch package kit to BZlibCompressionAlgorithm
... and remove the Zlib{Compressor,Decompressor} API.
2014-06-30 21:55:41 +02:00
Ingo Weinhold dcdc33b0af Add B[Zlib]CompressionAlgorithm
* BCompressionAlgorithm is a base class for classes that provide
  compression/decompression functionality. There are methods for
  compressing/decompressing a single buffer and factory methods for
  a compressing/decompressing input/output BDataIO.
* BZlibCompressionAlgorithm is a BCompressionAlgorithm implementation
  using zlib.
2014-06-30 21:55:41 +02:00
Ingo Weinhold 6a89a36aa0 Move package kit Zlib* classes to support kit
Also move to B* namespace and no longer expose the zlib dependency in
the headers.
2014-06-30 21:55:41 +02:00
Ingo Weinhold 0dab9e5cb4 package kit: ReaderImplBase: Remove superfluous scratch buffer 2014-06-30 21:51:16 +02:00
Ingo Weinhold 0a62e01902 PackageWriterImpl: Remove superfluous method 2014-06-30 21:51:16 +02:00
Ingo Weinhold 84297881bb Remove BPackageKit::[...]::AbstractDataWriter and friends
* FDDataWriter and ZlibDataWriter weren't used anymore.
* AbstractDataWriter was implemented only by PackageFileHeapWriter,
  which was only used by WriterImplBase.
* Add a PackageFileHeapWriter::AddDataThrows() which has semantics
  equivalent to the previously inherited WriteDataThrows().
2014-06-23 22:58:15 +02:00
Ingo Weinhold 32832cbe47 Remove BPackageKit::BDataOutput
Use BDataIO instead.
2014-06-23 22:58:15 +02:00
Ingo Weinhold dec78bb27c Add new error codes B_PARTIAL_{READ,WRITE} 2014-06-23 22:58:15 +02:00
Adrien Destugues 9576c4b742 BRegion scaling: fix semantics to avoid holes/overlaps
Thanks to Stippi for pointing this out.
2014-06-19 19:23:29 +02:00
Adrien Destugues 669ac9d6f5 BRegion: add ScaleBy method.
* Is there a reason to not have it?
2014-06-19 18:05:14 +02:00
Ingo Weinhold d2d1af830b Revert "Move ZlibDecompressor to libshared"
This reverts commit 9af2105d36.

Conflicts:
	src/kits/package/Jamfile
2014-06-18 22:13:39 +02:00
Ingo Weinhold 747b401e87 Revert "DynamicBuffer: implement BDataIO"
This reverts commit 36b1f55a18.
2014-06-18 22:13:39 +02:00
Ingo Weinhold a05da9f4b2 Revert "...and also fix a mismatched prototype"
This reverts commit 6555120f3b.
2014-06-18 22:13:38 +02:00
Ingo Weinhold d5660e67af Revert "build fix follow up on status_t/ssize_t changes."
This reverts commit 7202cfb455.
2014-06-18 22:13:38 +02:00
Ingo Weinhold 5c9672edeb Add watching support for installation location package changes
Can be requested/stopped via BPackageRoster::{Start,Stop}Watching().
The notification message has the what code B_PACKAGE_UPDATE and contains
fields "event", "location", and "change count".
2014-06-17 20:32:26 +02:00
Ingo Weinhold f2f19f110d BPackageManager: Support installing/updating local package files
* The Install() and Update() versions that take a const char* array
  now check whether a string looks like a path to a local package file.
  If so, they use that file instead of interpreting the string as a
  search string.
* Extend the repository hierarchy. There's now a LocalRepository base
  class from which InstalledRepository and the new MiscLocalRepository
  derive. The latter is instantiated once and collects all package files
  specified by path.
2014-06-15 17:21:01 +02:00
Ingo Weinhold eee422752c BPackageManager: Make BCommitTransactionResult available
* BFatalErrorException: Add commitTransactionResult property and
  respective constructor. In case committing the transaction failed,
  BPackageManager throws a BFatalErrorException with the result.
* BFatalErrorException::UserInteractionHandler: Pass
  BCommitTransactionResult to ProgressTransactionCommitted().
2014-06-15 17:21:01 +02:00
Ingo Weinhold 0de3219e33 package daemon: Rework error and issue propagation to client
* BDaemonClient: Move inner class BCommitTransactionResult to top level
  and make it public.
* BCommitTransactionResult:
  - Add a whole bunch of specific error code enum values. Such an error
    code is now the primary error, as opposed to before where we would
    mix status_t and enum value errors. There's a systemError property
    of type status_t which may provide additional information, though
    (depending on the primary error type).
  - Remove the errorMessage property. Due to mapping all errors to the
    specific error codes this is no longer necessary. Mixing such a
    message with another error description is also not very helpful when
    it comes to localization (still not supported, though).
  - Add several properties (paths, strings, error codes) that serve as
    arguments to the primary error and are used by FullErrorMessage().
  - Add issues property, a list of instances of new class
    BTransactionIssue. Those describe non-critical issues (e.g. failed
    update of a settings file) that occurred in the process of
    committing the transaction. Those issues should be presented to the
    user by the package management program.
* Exception: Adjust to transport the BCommitTransactionResult
  properties.
* CommitTransactionHandler, FsTransactions, Root, Volume: Adjust to
  BCommitTransactionResult/Exception changes.
* CommitTransactionHandler: Now requires a BCommitTransactionResult to
  which it adds the issues it encounters. The reply BMessage is no
  longer needed, though.
* Volume: Refactor common code from the three methods that use
  CommitTransactionHandler into new method _CommitTransaction.
2014-06-15 17:21:01 +02:00
Ingo Weinhold 6077cad882 BEntryOperationEngineBase::Entry: Add debug methods
Add GetPathOrName() and PathOrName() methods which try to get some kind
of usable path or at least a file name for the entry. Useful mainly for
debugging and error reporting cases.
2014-06-15 17:21:00 +02:00
Ingo Weinhold 9680cf0bce BEntryOperationEngineBase::Entry: Add node_ref+path c'tor 2014-06-15 17:21:00 +02:00
PulkoMandy 4a2260f21a Let the bootloader know about ARMv7.
When an ARMv7 CPU is detected, immediately turn on the FPU. This allows
us to use vsnprintf in the TRACE call in that function, as our libc is
compiled with floating point support and will trigger a fault if the FPU
is not available.

This lets the boot go further, and crash in mmu_init. Next steps:
* Find why mmu_init is crashing
* Setup some fault handlers, otherwise we call uboot ones, and they are
not very helpful. They will also probably not work once the mmu is
enabledvery helpful. They will also probably not work once the mmu is
enabledvery helpful. They will also probably not work once the mmu is
enabled...
2014-06-13 22:15:54 +02:00
Adrien Destugues b92e7f1512 Make BReferenceable public.
* The Network Kit now makes use of it for BUrlContext, so we need this
in the public headers.
* Problem caught by the new build bot by compiling the unit tests.
2014-06-11 17:08:05 +02:00
Axel Dörfler c1400fb617 intel_extreme: use VESA EDID info as fallback.
* Only in case retrieving EDID info failed on head A and C.
* Should help with detecting the native resolution for ticket #10878.
2014-06-04 01:02:40 +02:00
Alexander von Gluck IV e321d716e4 radeon_hd: Add latest generation radeon_hd cards
* These aren't tested, but since we go off of DCE
  versions for a lot of stuff, they may work.
* AMD doens't include market names in their drivers
  anymore, so if we want to label them it will take
  additional work.
2014-05-25 09:03:03 -05:00
Alexander von Gluck IV cc67216333 kernel: Toggle not toogle; no functional change 2014-05-20 18:36:30 -05:00
Alexander von Gluck IV a8f9011015 h2: Fix bluetooth driver build, missing PrivateKernelHeaders
* We likely should move all of this stuff to normal
  atomic test and set operations at some point.
2014-05-18 22:33:56 -05:00
Pawel Dziepak 76636769bd kernel/x86_64: inline x86_{read, write}_msr()
This patch makes it possible to inline rdmsr and wrmsr instruction. The
performance impact shouldn't be significant since they are used relatively
rarely and wrmsr is usually a serializing instruction, but there is no reason
not to do so.
2014-05-06 21:41:49 +02:00
Pawel Dziepak 88e8e24c84 kernel/x86_64: improve context switch implementation
The goal of this patch is to amortize the cost of context switch by making
the compiler aware that context switch clobbers all registers. Because all
register need to be saved anyway there is no additional cost of using
callee saved register in the function that does the context switch.
2014-05-06 21:15:55 +02:00
Pawel Dziepak 9db5b975f9 kernel/x86_64: rework of IDT handling code
Similarly to previous patch regarding GDT this is mostly a rewrite of
IDT handling code from C to C++. Thanks to constexpr IDT is now entirely
generated at compile-time.
2014-05-06 14:59:54 +02:00
Pawel Dziepak cd59bf4349 kernel/x86_64: x86_64 gdt handling code overhaul
Virtually no functional change, just rewriting the code from
"C in *.cpp files" to C++. Use of constexpr may be advantageous but
that code is not performance critical anyway.
2014-05-06 14:59:53 +02:00
Pawel Dziepak 44c0c4d3d0 runtime_loader: add support for ELF based TLS
This patch introduces support of ELF based TLS handling with lazy allocation
and initalization of TLS block for each DSO and thread. The implementation
generally follows the official ABI except that generation counter in dtv
is in fact a pointer to Generation object that contains both generation
counter and size of the dtv. That simplified the implementation a bit, but
could be changed later. The ABI requirements regariding in memory position
of TLS block is not honoured what results in static TLS model being
unsupported. However, that should not be a problem as long as
"executables" in Haiku are in fact shared objects and optimizations which
require specific TLS block in memory layout are not possible anyway.
2014-05-04 04:00:17 +02:00