Commit Graph

41156 Commits

Author SHA1 Message Date
Philippe Saint-Pierre f6bd30f2af Partitioning system: avoid leakage of resource
The storage returned from GetSession() was leaked

CID 10827
2011-11-27 23:35:36 -05:00
Philippe Saint-Pierre 342169dfe2 Fix resource leakage
CID 10828
2011-11-27 23:24:18 -05:00
Ingo Weinhold 363c147d86 FreeBSD host sys/stat.h: Add missing extern "C" 2011-11-28 05:11:35 +01:00
Ingo Weinhold d68eb11df9 fs_attr_generic.cpp: Fix warning 2011-11-28 05:02:27 +01:00
Ingo Weinhold 62f5df5852 Provide futimens(), utimensat() missing on FreeBSD 2011-11-28 05:02:09 +01:00
Ingo Weinhold b328f5b034 libroot_build: Explicitly support FreeBSD struct stat anomalies
Use stat::st_{a,m}timespec on FreeBSD instead of the POSIXish
stat::st_{a,m}tim. Fixes part of the FreeBSD build issues recently
introduced.
2011-11-28 04:30:49 +01:00
Philippe Saint-Pierre 9f66f05b58 Fix never met condition
(descriptor & 0x10)==1 could never be met, it would return 0x10 or 0x00

CID 2567
2011-11-27 18:42:17 -05:00
Philippe Saint-Pierre 4d5d809045 No functional changes. Improve readability.
Thanks Axel!
2011-11-27 18:13:13 -05:00
Philippe Saint-Pierre ec9e2f9018 No functional change, avoid confusion in Coverity about exceptions
CID 9248, CID 9250, CID 10844, CID 10977, CID 10978, CID 10979, CID 10980,
CID 10981, CID 10982, CID 10983
2011-11-27 17:47:45 -05:00
Alexander von Gluck IV ef9c898bba Better tracing in radeon_hd device code 2011-11-27 16:09:59 -06:00
Alexander von Gluck IV 59f573a303 Better tracing in radeon_hd driver code 2011-11-27 16:09:59 -06:00
Matt Madia 1bd42c1053 Mention the current transition to Pootle. 2011-11-27 16:42:32 -05:00
Alexander von Gluck IV 30207c6c8c Move thermal query into new driver sensor source file
* thermal query still works pre-atombios init
2011-11-27 14:41:35 -06:00
Philippe Saint-Pierre 8e844f63e9 Fix bogus argument validation
* The comparaison couldn't ever not match. Based on the comment above the
  function, I made it so that flags must contain at least one of B_WATCH_NAME,
  B_WATCH_STAT or B_WATCH_ATTR

CID 2586
2011-11-27 13:24:43 -05:00
Philippe Saint-Pierre b21c95d4f6 Move NULL check before dereference tries
CID 5912
2011-11-27 12:44:05 -05:00
Philippe Saint-Pierre 08eb0b74a9 Move the NULL check before the dereferencing try
CID 5968
2011-11-27 12:36:40 -05:00
Philippe Saint-Pierre b3fe883d9c replace usage of strncpy by strlcpy to insure NULL termination
CID 10631
2011-11-27 12:05:41 -05:00
Philippe Saint-Pierre 81a29f5613 Removing deadcode. Specific Case already taken care of.
CID 2865.
2011-11-27 11:41:29 -05:00
Alexander von Gluck IV f82aee424f Name a few unknown APU chipsets 2011-11-27 10:33:13 -06:00
Philippe Saint-Pierre aec33db178 Replace inappropriate usage of strncpy by strlcpy 2011-11-27 11:10:39 -05:00
Philippe Saint-Pierre 3927bd3c0d Prevent string overflow by replacing usage of strcpy by strncpy
CID 8951, CID 10733, CID 10734, CID 10735, CID 10736, CID 10737, CID 10738,
CID 10739
2011-11-27 01:45:21 -05:00
Philippe Saint-Pierre d2780f6f25 Protects against possible NULL return from dynamic_cast
CID 10807
2011-11-27 00:55:13 -05:00
Philippe Saint-Pierre faadd0c5ca Missing call to InitCheck() causing deadcode
CID 2959
2011-11-27 00:42:18 -05:00
Philippe Saint-Pierre d9a215b71f Comparison with an unsigned value (size_t) and < 0
CID 4190 and CID 4191
2011-11-27 00:21:41 -05:00
Philippe Saint-Pierre 20e36f6e64 Missing call to InitCheck() causing deadcode
CID 10803
2011-11-26 23:22:18 -05:00
Alexander von Gluck IV 6ccf83a908 Fix DCE versions for SUMO/SUMO2 2011-11-26 21:01:57 -06:00
Alexander von Gluck IV 5d0e16d32b Add Sumo and Sumo 2 APU PCI ID's
* move 6480G to proper location, fix chipset
* introduce several new Sumo chipset ID's
2011-11-26 21:01:57 -06:00
Philippe Saint-Pierre a633338fbe Memory leak fix
CID 5769
2011-11-26 21:57:05 -05:00
Philippe Saint-Pierre 374d5a4c6d Fix possible resource leakage and NULL dereference
* Use the std::nothrow behaviour of operator new
* Avoid to compare the CurrentDecorator at every iteration
* Avoid possible NULL dereference

Fix CID 10947 and CID 10889
2011-11-26 21:11:51 -05:00
Philippe Saint-Pierre 36e1394ccf Fix possible resource leakage
* Also use the std::nothrow behaviour of operator new
* and remove extra indent

Fix CID 10948
2011-11-26 20:57:22 -05:00
Philippe Saint-Pierre 552d99013a Replace usage of sprintf with snprintf
Fixing CID 10964
2011-11-26 20:17:46 -05:00
Alexander von Gluck IV 54fda1c6df Enhance lvds laptop panel support
* if an edid request for LVDS panel is detected, we now
  return true and the VESA edid info.
* add #if 0'ed function to pull prefered timing info from atombios
  on LVDS panels, still need to generate a fake EDID with this.
* not sure which method above is better... maybe a combination of both
2011-11-26 17:35:33 -06:00
Alexander von Gluck IV f1a3316b96 Enhance Northern Islands support
* add HD 6480G PCI ID
* graphics memory is stored in bytes on IGP / APU evergreen+
* add an error and a fallback to PCI FB Bar size if we cannot
  find full card memory size
2011-11-26 16:07:38 -06:00
Matt Madia 2fcf7569fc Automatic whitespace cleanup 2011-11-26 15:31:59 -05:00
Niels Sascha Reedijk a27d195e23 Update 'be', 'de', 'lt', 'nl', 'ru', 'sk' from Pootle. 2011-11-26 09:06:22 +01:00
Humdinger fedd311986 Corrected some typos and stuff pointed out by Rimas. 2011-11-25 22:26:13 +01:00
Humdinger 9ea3ffe65c Corrected typo. Thanks Rimas. 2011-11-25 22:26:12 +01:00
Humdinger 1f92d747ef Removed duplicate license for GLU. Thanks Rimas. 2011-11-25 22:26:11 +01:00
Oliver Tappe 692e9b11e4 Build fix part 2: active libroot_build.a again:
* uncomment the building of libroot_build.a again
* add function remapper to HOST_STATIC_LIBROOT
* drop TODO about the function remapper not working with the static
  libroot

Ingo: please review - I think this should work, but I'm not so sure
where HOST_STATIC_LIBROOT should be in the list of libraries of its
only user (<build>bfs_fuse): where it is now or right at the end?

As it is now, the resulting binary still contains references to
host-libc-implementations of close() & others, which are triggered by
the other libs (like libfuse.so). If I put HOST_STATIC_LIBROOT right at
the end, those references are gone, though. But which is correct?
2011-11-25 22:04:51 +01:00
Oliver Tappe 8cdc273ad3 Build fix part 1: update generic fs-attr code 2011-11-25 21:56:27 +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
Michael Lotz 653ce5db53 Initialize the isochronous lock earlier.
The constructor may abort at various places and the destructor cleans up
everything already initialized. The mutex was however not initialized
early on, leading to #8153 where the mutex was destroied in the error
case, accessing uninitialized memory. Fixes #8153 though the reason for
the aborted constructor probably needs to be investigated as well.
2011-11-25 13:04:54 +01:00
Ingo Weinhold 34afc17190 PackageLinkDirectory::_Update(): Don't unlock after delete
When using an AutoLocker on an object, the lock must be released
explicitly before releasing the last certain reference to that object.
2011-11-25 06:20:06 +01:00
Ingo Weinhold b8ae1eb25d Volume::_RemoveNodeAndVNode(): Squash TODO
Only get/remove/put the vnode when the node is actually known to the
VFS. This does not only save unnecessary work, it also solves a
(temporary) deadlock -- at least partially. If another thread caused a
call to our get_vnode() hook just before, it would block on the volume
lock we're holding when adding/removing packages. The vnode would be
marked busy until the other thread's request was fulfilled and our call
to get_vnode() would block until timing out. Now we're calling
get_vnode() only, if we already know that the VFS already has a valid
vnode.

There still remains a race condition. If the VFS discards the vnode
right before we call get_vnode(), we essentially have the same situation
as before (i.e. us calling get_vnode() although the vnode is no longer
known to the VFS) with the same potential problem. For a real solution
we need a get_vnode() variant which can be told not to block.
2011-11-25 06:20:05 +01:00
Ingo Weinhold bbf2abc503 Node: Keep track of VFS init status
* Node::VFSInit() and VFSUninit() set/clear the new node flag
  NODE_FLAG_KNOWN_TO_VFS. They need to be called by overriding methods,
  now.
* Add Node::IsKnownToVFS() which returns the VFS init status.
2011-11-25 06:20:05 +01:00
Ingo Weinhold d9ec209546 Fix removing dependencies on package removal
The dependencies must also be dissociated from the resolvables they have
been resolved to.
2011-11-25 06:20:04 +01:00
Ingo Weinhold 564f56b150 Fix node handling on package addition/removal
* UnpackingLeafNode: Add a fFinalPackageNode attribute. It is set when
  the node is about to be removed and will point to the node's previous
  head package node and be used in its stead. From the perspective of
  the FS hooks this leaves the node in an unchanged state.
* Unpacking[Leaf,Directory]Node:
  - Add WillBeFirstPackageNode(), returning whether the given package
    node would become the head package node when added.
  - Add PrepareForRemoval() which removes all package nodes. In case of
    UnpackingLeafNode it also sets fFinalPackageNode.
  - Add CloneTransferPackageNodes(). It is only implemented for
    UnpackingLeafNode. It clones the node, transfers all package nodes
    to the clone and sets fFinalPackageNode on this node.
* Volume::_{Add,Remove}PackageNode(): Solved the following TODO: When a
  package is added or removed and a file present in both the
  added/removed package and another package with the version in the
  former having precedence, we have to remove the node (leaving it
  unchanged) and replace it by a new node. This prevents clients having
  the node opened or mapped from suddenly seeing different data. It also
  fixes unbalanced calls to PackageNode::VFSInit()/VFSUninit() which
  would result in file descriptors to package files being leaked.
2011-11-25 06:20:03 +01:00
Ingo Weinhold 4ba3c257e4 Fix package removal with skipped directories
Volume::_RemovePackageContentRootNode(): Check whether a directory
corresponding to the package directory does actually exist. This might
not be the case when the package directory has been skipped due to
clashing with a shine-through directory. Would crash in this case.
2011-11-25 06:20:03 +01:00
Ingo Weinhold 863eb983f8 Fix typo 2011-11-25 06:20:02 +01:00
Ingo Weinhold 085f6723a4 Fix build due to <directories.h> move
Apparently I should have done a complete rebuild after moving
directories.h from headers/private/libroot to .../system, since a lot of
stuff didn't build anymore.
2011-11-25 06:19:50 +01:00