Commit Graph

57805 Commits

Author SHA1 Message Date
Augustin Cavalier
f0cdb09104 headers/bsd: Add sys/queue.h.
Requested in #12617.
2017-12-14 19:07:04 -05:00
Augustin Cavalier
637d99977c tools: Fixes following build syscall change. 2017-12-14 08:32:19 -05:00
Augustin Cavalier
1465ec71a0 build/kernel: Properly shadow syscall functions.
I didn't notice this in the previous commit because apparently GCC2
just links against libroot's versions of them. On GCC5, however,
the version from libroot_build was used even for calls from libroot itself,
which led to infinite loops and then stack overflows.

So instead we must have the "syscall" functions in libroot_build shadow
the real ones by being named differently, which I did by changing their
prefix from "_kern" to "_kernbuild" via preprocessor macros.

Since the build syscalls.h is now substantially different than the non-
build one (and has not been synchronized in nearly a decade anyway),
I've just stripped out all the syscall defns except for the ones actually used
in the build.

Thanks to kallisti5 for helping me debug and test.
2017-12-13 23:40:05 -05:00
Augustin Cavalier
5e19679ea3 build: Use libroot_build on Haiku.
Previously we just used the system libroot, which of course meant
that when libroot's ABI changed, the build broke. Now we use the full
libroot_build that we do on non-Haiku platforms. The logic for "BeOS-compatible
but not Haiku" does not really apply anymore, so it has been gutted where
appropriate (and libhaikucompat has been decoupled from the build.)

The only caveat here is the change to Errors.h -- we really should be using
the system's one where I included the one from the tree, but for whatever
reason, GCC2 refused to handle the #include_next properly.

Fixes the build breakage of Haiku-on-Haiku by my prior commits (sorry).
2017-12-13 19:47:39 -05:00
Alexander von Gluck IV
3065fd47a0 MediaPlayer: Relicense to MIT
* The GPL license here was a relic from the past to help
  control YellowTab's use of Haiku source code. The intent
  at the time was to relicense MIT.  Some GPL parts remained.
* This is going to get harder and harder to correct over time.
* This code makes Haiku *not* MIT. Lets correct that.
* I reached out to everyone who made changes to these files and
  got personal approvals to relicense MIT.
* If I missed somebody, *and* you feel as though the MIT license
  doesn't meet your needs, please contact Haiku, Inc. and we will
  work to revert your changes.

  Marcus Overhagen      EMAIL   - MIT OK 11/29/17
  Stephan Aßmus         EMAIL   - MIT OK 11/28/17
  Axel Dörfler          IRC     - MIT OK 11/29/17
  Ryan Leavengood       KEYBASE - MIT OK 11/28/17
  Michael Lotz          IRC     - MIT OK 11/29/17
  Adrien Destugues      EMAIL   - MIT OK 11/28/17
  Joachim Seemer        EMAIL   - MIT OK 11/28/17
  Jonas Sundström       EMAIL   - MIT OK 11/29/17
  François Revol        IRC     - MIT OK 11/29/17
  Jérôme Duval          EMAIL   - MIT OK 11/29/17
  Oliver Tappe          EMAIL   - MIT OK 11/29/17
  Dziadek               EMAIL   - MIT OK 11/29/17
  Philippe Saint-Pierre EMAIL   - MIT OK 12/6/17
  Philippe Houdoin      EMAIL   - MIT OK 12/8/17
  Dario Casalinuovo     IRC     - MIT OK 12/13/17
2017-12-13 14:40:11 -06:00
Alexander von Gluck IV
ccfffc0f6d docker/cross-compiler: Updates + improvements 2017-12-13 14:40:11 -06:00
Alexander von Gluck IV
453dc171ae 3rdparty/kallisti5: Tool to compress running sysroot into a tar.gz 2017-12-13 08:36:33 -06:00
Augustin Cavalier
cef24e1a43 userlandfs: Pre-define and use the right KMessage.
Otherwise, later on when we include the real one Clang errors about
there being two conflicting KMessages declared in separate contexts.
2017-12-12 20:10:42 -05:00
Augustin Cavalier
b06b5456a5 btrfs: [] on the end of a struct field is a variable length array.
This throws an error in Clang, so just declare these as pointers.
2017-12-12 20:09:41 -05:00
Augustin Cavalier
361f980f9d More "missing space after macro; invalid in C++11" error fixes. 2017-12-12 20:08:26 -05:00
Augustin Cavalier
36f28382db configure: Properly test for set crossToolsPrefix and targetArchs.
Now you can specify a --build-cross-tools and then override just
GCC from it with a following --use-clang in the same configure
invocation.
2017-12-12 20:07:38 -05:00
Augustin Cavalier
0d020b8298 headers/build: Use the system's types.h on Haiku.
Technically a "hack" (but then again most of the config/build stuff is);
as we need to use the system's config/types.h in order to get stdint
definitions and the like.

Previously there was a config_build directory which allowed the existence
of two types.h -- the system one, and the headers/build one, but seeing
as we only need this to provide Haiku-specific core types on other platforms,
using the system's one should be fine.

Our core type definitions have not changed in some time (and it's unclear
when they would change aside from potential new platforms), breakage of the
Haiku-on-Haiku build due to this should not happen often (if ever.)
2017-12-12 18:51:13 -05:00
Augustin Cavalier
02c9c92ae2 BeBuild: Treat TinyCC as GCC4 ABI.
Since it's just a C compiler "technically" the ABI does not matter,
but since it also can target other ABIs from one toolchain (e.g. x64),
just treat it as GCC4 ABI unilaterally.

Fixes #13847.
2017-12-11 19:28:45 -05:00
Augustin Cavalier
82bffcc3a7 headers/build: Reunify BeBuild.h and related cleanup.
Now that we do not target BeOS and also do not include the main headers
directory when building "build" binaries, we can drop the separate
config_build directory and thus also the separate BeBuild.h, and just
..-include the regular one.

The build BeBuild.h defined empty _IMPEXP_ROOT and _IMPEXP_BE preprocessor
macros that the regular one does not; so I also re-synchronized
headers which used these as needed.
2017-12-11 19:15:47 -05:00
Augustin Cavalier
416460cf4a HaikuPorts: Update build packages set (again).
Previous libwebp package pulled in some dependencies we didn't want.
2017-12-10 15:44:48 -05:00
Augustin Cavalier
2934d7f856 HaikuPorts: Update build packages set. 2017-12-10 14:28:26 -05:00
Augustin Cavalier
efdaac9c08 kernel/convertutf: Fix file mode. 2017-12-10 12:07:23 -05:00
Augustin Cavalier
5285006210 btrfs: Attempt to fix GCC2 build. 2017-12-10 11:21:15 -05:00
hyche
99768086b1 BTRFS: Add author and license.
Signed-off-by: Augustin Cavalier <waddlesplash@gmail.com>
2017-12-10 11:03:56 -05:00
hyche
4896a3735e BTRFS: Implement btrfs_remove_dir that can remove directories in most case.
We need to handle a case when node size is small reasonably it can be merged with another node or push data from other node to this node.

Signed-off-by: Augustin Cavalier <waddlesplash@gmail.com>
2017-12-10 11:03:04 -05:00
hyche
166917c9cd BTRFS: Implement btrfs_create_dir that can create directories in most case.
We need to handle a case when node is full, the solution should be split or push data to another node.

Signed-off-by: Augustin Cavalier <waddlesplash@gmail.com>
2017-12-10 11:03:03 -05:00
hyche
a9e85cb62f BTRFS: Implement Dereference() in Inode that remove the "name" and unlink it with inode.
Signed-off-by: Augustin Cavalier <waddlesplash@gmail.com>
2017-12-10 11:03:03 -05:00
hyche
8042a045b0 BTRFS: Implement Remove() in Inode that removes inode_item.
Signed-off-by: Augustin Cavalier <waddlesplash@gmail.com>
2017-12-10 11:03:02 -05:00
hyche
b44d924df4 BTRFS: Implement MakeReference() in Inode that will link file name to inode.
Signed-off-by: Augustin Cavalier <waddlesplash@gmail.com>
2017-12-10 11:03:02 -05:00
hyche
371935de18 BTRFS: Implement Insert() in Inode that inserts inode_item.
Signed-off-by: Augustin Cavalier <waddlesplash@gmail.com>
2017-12-10 11:03:01 -05:00
hyche
36a24fb34e BTRFS: Implement Create() that allocate new Inode object.
Signed-off-by: Augustin Cavalier <waddlesplash@gmail.com>
2017-12-10 11:03:01 -05:00
hyche
20185bb9c3 BTRFS: Implement RemoveEntries() for BTree that will remove consecutive items and its data.
Signed-off-by: Augustin Cavalier <waddlesplash@gmail.com>
2017-12-10 11:03:00 -05:00
hyche
84bc447cae BTRFS: Implement InsertEntries() that will insert consecutive items and its data.
Signed-off-by: Augustin Cavalier <waddlesplash@gmail.com>
2017-12-10 11:03:00 -05:00
hyche
02bce792d8 BTRFS: Added function to convert standard filetypes to btrfs filetypes.
Signed-off-by: Augustin Cavalier <waddlesplash@gmail.com>
2017-12-10 11:03:00 -05:00
hyche
2b6c2ec390 fs_shell: Added socket filetype.
Signed-off-by: Augustin Cavalier <waddlesplash@gmail.com>
2017-12-10 11:02:59 -05:00
hyche
883b9bf29f BTRFS: Implement CopyOnWrite relevant functions, and BTree holds new attribute that record its root level.
CopyOnWrite works like this:
* Cache original node
* Allocating new block
* Cache new block to be writable
* Copy original node to new node, and changing.
Also if a node is already be COW-ed it cannot be COW-ed again, it will be changed in-place instead.

InternalCopy does CopyOnWrite all the nodes that we don't need to change anything on them.

Signed-off-by: Augustin Cavalier <waddlesplash@gmail.com>
2017-12-10 11:02:59 -05:00
hyche
89484dc08d BTRFS: Implement some copy relevant helpers.
Copy() copys data from other node, MoveEntries() changes data on the current node.

Signed-off-by: Augustin Cavalier <waddlesplash@gmail.com>
2017-12-10 11:02:58 -05:00
hyche
27ffe0583b BTRFS: Implement some space relevant helpers.
Signed-off-by: Augustin Cavalier <waddlesplash@gmail.com>
2017-12-10 11:02:58 -05:00
hyche
4368661f03 BTRFS: Implement GetNewBlock() function that will find the logical address for allocating and convert it to physical block.
Signed-off-by: Augustin Cavalier <waddlesplash@gmail.com>
2017-12-10 11:02:57 -05:00
hyche
c1320b3a33 BTRFS: Implement a simple journaling approach, this is not finished and mostly satisfy the need for passing Transaction object for many functions.
Some details about the current Journal:
* Journal can only end transaction.
* It holds a transaction id of fs (fCurrentGeneration) that increments each time a transaction starts.
* _TransactionWritten now just printing message.

Signed-off-by: Augustin Cavalier <waddlesplash@gmail.com>
2017-12-10 11:02:57 -05:00
hyche
1750cd1e92 block_cache: Implement cache_has_block_in_transaction function that will check the existence of block in one specific transaction.
Signed-off-by: Augustin Cavalier <waddlesplash@gmail.com>
2017-12-10 11:02:56 -05:00
hyche
8137f447cb BTRFS: Fix memory leak
Missing delete for some tree roots.

Signed-off-by: Augustin Cavalier <waddlesplash@gmail.com>
2017-12-10 11:02:55 -05:00
hyche
0deb03560f BTRFS: Fix mismatched type of index in inode_ref item.
Signed-off-by: Augustin Cavalier <waddlesplash@gmail.com>
2017-12-10 11:02:54 -05:00
hyche
af419b0e98 BTRFS: Implement ExtentAllocator
There are 4 new classes, structs:
* CachedExtent, is a AVLTreeNode, caches the extent locating in extent tree, a extent can be free, allocated, metadata or a data extent. It also hold a references count,
that is incremented each time a new extent refer to it (COW) and item data, that is only for allocated extent (NULL for free).
* CachedTreeExtent, is a AVLTree, cache the whole extent tree and has CachedExtent as its node.
* BlockGroup represents the group of extents that represent the region for each type of allocated extent. For example, region for data extents, metada blocks. It
responsible for inserting nodes in CachedTreeExtent.
* And the final, ExtentAllocator it knows how to allocate/deallocate extents, but for now only the allocating is implemented, actually allocating and deallocating works
are already implemented, they are in functions _AddFreeExtent, _AddAllocatedExtent in CachedTreeExtent. However the deallocating is not needed for now, so it will be
finished later then.

Signed-off-by: Augustin Cavalier <waddlesplash@gmail.com>
2017-12-10 10:56:12 -05:00
hyche
bfd7a4fb42 BTRFS: Reimplement TreeIterator, add some error checks and remove redundancies.
Add BTree::Path as a attribute so enhance performance, so that everytime we iterate through items it wont search all the root to leaf
again. The Iterator is initialized without rewinding to make more flexible.

Signed-off-by: Augustin Cavalier <waddlesplash@gmail.com>
2017-12-10 10:56:11 -05:00
hyche
3216460dec BTRFS: Implement BTree::Path and change _Find.
Remove attribute fCurrentSlot in BTree::Node as it will be handled by Path explicitly. BTree control Path by passing its type in
BTree's method, Path also hold BTree type as its attribute to do some internal actions.
Add constant BTREE_KEY_TYPE_ANY, find search key has this type will success regardless of the found key's type.

Split the  the _Find function into Traverse and GetEntry. Traverse will fill in the Path (nodes and slots) along way its finding,
GetEntry will get the item data, item size, key from leaf, if the slot is valid, that we have from Traverse. The _Find function also
check type if is correct and then retrieve. Doing this way there will be more flexible, the "read" flag is not needed as we only
need Path to manipulate tree, and it also enhance the performance at some points, because Path caches all the nodes from root to leaf,
so that we don't have to block_cache_put and block_cache_get after each finding.

Signed-off-by: Augustin Cavalier <waddlesplash@gmail.com>
2017-12-10 10:56:11 -05:00
hyche
8160f31fc1 BTRFS: Node now holding Volume instead of cache to retrieve more values
Signed-off-by: Augustin Cavalier <waddlesplash@gmail.com>
2017-12-10 10:56:10 -05:00
hyche
16de9db54b BTRFS: Fix mismatched type of item size (should be uint32), and ObjectID of first subvolume when lookup directory (described in commit bd2dab1)
Signed-off-by: Augustin Cavalier <waddlesplash@gmail.com>
2017-12-10 10:56:09 -05:00
hyche
2ed88a489c BTRFS: Fix node search slot
* Not handle traversing type correctly (looks for the graph).
* Reorder the codes because *slot is uninitialized if type is BTREE_EXACT.
* Incorrect return type: int32 -> status_t

Signed-off-by: Augustin Cavalier <waddlesplash@gmail.com>
2017-12-10 10:56:08 -05:00
hyche
e715614613 AVLTree: forward LeftMost and RightMost method from AVLTreeBase
Signed-off-by: Augustin Cavalier <waddlesplash@gmail.com>
2017-12-10 10:56:08 -05:00
Adrien Destugues
d87218f79e Add test for stack alignment. 2017-12-10 09:28:49 +01:00
Adrien Destugues
6a028821b6 x86 glue code: keep stack aligned.
The glue code pushed 12 bytes to the stack, breaking the 16-byte stack
alignment requirement. This would be fixed by the main() prologue from
gcc, but all "init" and "fini" code (static/global constructors/ destructors)
would run with a misaligned stack.

This was already fixed for x86_64 in hrev49731. Note that the fix here
is slightly different, the pointer is realigned after it is saved to EBP
and the function epilogue restores it from EBP, so no changes to crtn.S are
needed.
2017-12-10 09:23:22 +01:00
Owen
9e53d4e91b Accepts URLs as command line arguments.
Fixes #9793

Signed-off-by: Kacper Kasper <kacperkasper@gmail.com>
2017-12-09 20:02:06 +01:00
Janus
da9188ac28 StyledEdit: avoid crash on replace window
* Fixes #13842
2017-12-08 15:08:43 +01:00
Adrien Destugues
2d10453741 Add a simple video decoding test
This application tests the BMediaTrack/BMediaFile API and underlying
ffmpeg plugin for video decoding. You can press (or hold) any key to go
through frames in a video. This avoids debugging both MediaPlayer and
the underlying libraries at the same time.

It shows that ReadFrames is getting video frames out of PTS order.
2017-12-07 22:45:44 +01:00