Commit Graph

23743 Commits

Author SHA1 Message Date
Michael Lotz 656af4e869 * Initialize all of the fields in the UHCI class so in case of an error in the
constructor the object can be safely deleted (as documented for bug #1473)
* Some simplifications by caching the Pipe object for a transfer
* Minor cleanup

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@24954 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-04-13 05:56:10 +00:00
Axel Dörfler 6ad23dbbf4 Some cleanup:
* Reordered to have the constructor/destructor first.
* Two blanks between functions.
* Removed superfluous constructor calls.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@24953 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-04-13 04:57:13 +00:00
Axel Dörfler 4b3b81da9e This header is no longer necessary, since Ingo added the BSD timer macros
to our sys/time.h - this fixes a lot of warnings, too.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@24952 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-04-13 02:28:43 +00:00
Rene Gollent 1174007caf Modified bin/keymap's -h option to write a variable to the generated header
indicating the name of the keymap. Correspondingly, modified input_server 
to use the aforementioned variable in order to write the name attribute
to ~/config/Key_map. This allows Keymap prefs to correctly recognize the name
of the default keymap on a fresh build.



git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@24951 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-04-12 22:41:19 +00:00
Ingo Weinhold f9ee0e634a Added unix sockets protocol module. There's still quite some debug
output enabled.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@24950 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-04-12 18:42:12 +00:00
Ingo Weinhold f13ba03959 * Removed SyscallRestartWrapper comparison operators. They are not
needed, since we've got a cast operator.
* Reverted r24927-r24929. There's no potential ambiguity anymore.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@24949 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-04-12 17:18:31 +00:00
Ingo Weinhold 460c990c5d The syscalls that were returning an address always copied back the full
address back to userland, even if the provided buffer was smaller. Fixes
a problem with Firefox, which is for some reason providing a buffer
smaller than our sockaddr_in.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@24948 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-04-12 16:59:49 +00:00
Michael Lotz c8661c3885 Make a local copy of the passed in isochronous packet descriptors before
handing them over to the USB stack. Otherwise the finisher (kernel) thread
would have no way to fill those packets when they came from a user space
address range. Completely untested though.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@24947 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-04-12 14:20:53 +00:00
Jérôme Duval c103aef2b3 disabled check for memory overlaps for the time being
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@24946 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-04-12 13:36:33 +00:00
Stephan Aßmus 2082f2d5c1 * Cleanup and improvements in the debug output
* Handles wrapping of the chunk buffer for the case that we need to read
  additional chunk data, but still need the data from the last chunk
  buffer as well.
* Don't skip the very first frame when calculating the timing.
* Includes some new code to handle seeking internally, but it is currently
  disabled and incomplete.
* Prepared to recover from floating point exceptions generated in some rare 
  situations by xvid, but we are currently missing fenv.h in our public POSIX
  headers, so it is disabled.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@24945 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-04-12 13:24:33 +00:00
Michael Lotz b6d44561ff Quick buildfix.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@24944 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-04-12 10:27:04 +00:00
Ingo Weinhold 59234b36ce * Added support for SCM_RIGHTS (sending file descriptors).
* Fixed shutdown(). It was computing the wrong fifo flags and set the
  wrong ones from the wrong variable on the peer fifo.
* Generally made the Unix sockets behave more like they should. E.g.
  after closing one end, it must still be possible to read from the
  other (as long as there are buffered data). Also fine-tuned when to
  return what errors from recv()/send().


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@24943 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-04-12 09:37:13 +00:00
Jérôme Duval 316b5f9214 updated bzip2 to 1.0.5
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@24942 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-04-12 09:30:47 +00:00
Ingo Weinhold 97cdbb548e Added support for sending/receiving ancillary data. The protocol modules
have two more optional hooks for attaching supplied ancillary data to a
net_buffer and for processing received ancillary data. Not sure, if that
is flexible enough for all kinds of ancillary data, but it is for
SCM_RIGHTS and also should for SCM_CRED[ENTIAL]S (if we ever decide to
implement one of those) -- don't know any other types on other protocol
levels.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@24941 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-04-12 09:28:05 +00:00
Ingo Weinhold 62d7da1f45 Added support for attaching ancillary data to a net_buffer. It's a naive
implementation ATM, since it malloc()s the required memory.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@24940 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-04-12 09:19:44 +00:00
Ingo Weinhold 5f2d64a25e * _user_{send,recf}msg() no longer copy iovecs on the stack. They use
the heap and the IOV_MAX limit.
* They also take the responsibility of copying the ancillary data in and
  out.
* These syscalls were badly broken. They used a member of an
  uninitialized structure instead of the iovec pointer passed from
  userland. sendmsg() would thus fail or send arbitrary data, recvmsg()
  would overwrite arbitrary memory.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@24939 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-04-12 08:50:17 +00:00
Jérôme Duval 9c6ab2ae36 fixed bug #2067
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@24938 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-04-12 08:37:03 +00:00
Ingo Weinhold 0cc82d47d4 Added close_fd_index() which is pretty much like close(), but gets the
IO context in which to close the FD.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@24937 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-04-12 08:32:29 +00:00
Ingo Weinhold ac4630e161 * Added <sys/param.h> include, which is needed for _ALIGN().
* Added SCM_RIGHTS macro.
* Added a few non-standard but widely-used CMSG_*() macros.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@24936 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-04-12 08:30:25 +00:00
Michael Pfeiffer dff9173818 Save and restore MBR and write boot menu.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@24935 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-04-12 08:25:38 +00:00
Michael Pfeiffer 7437e205be Removed debug code.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@24934 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-04-12 08:21:35 +00:00
Michael Pfeiffer 86ad7d1c71 Refactored and reformatted.
Select default item at start.
Added timeout handling.
Don't switch to graphics mode, stay in text mode instead. Graphics mode led to display issues with lilo.
Reverted order of text color like it is in original bootman.
Fixed bugs.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@24933 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-04-12 08:19:25 +00:00
Michael Pfeiffer 1b56fe8db5 Helper application that converts the contents of a file into an uint8 array.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@24932 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-04-12 08:10:57 +00:00
Michael Pfeiffer 20abf32b6d Boot menu and loader by Dengg David.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@24931 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-04-12 08:10:29 +00:00
Jérôme Duval 2be56e7576 Applied patch from n3s: the check for file extension was broken. Thanks!
This fixes bug #2034


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@24930 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-04-12 07:58:43 +00:00
Jérôme Duval 6cb51e58bc better cast to the good type to avoid confusing gcc
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@24929 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-04-12 07:17:01 +00:00
Jérôme Duval b1459ca4b4 hmm I managed to break the comparaison order...
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@24928 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-04-12 07:08:56 +00:00
Jérôme Duval bdfe92370f gcc4 build fix. Here is one of the two errors:
src/system/kernel/fs/fd.cpp: In function 'ssize_t common_user_vector_io(int, off_t, const iovec*, size_t, bool)':
src/system/kernel/fs/fd.cpp:727: error: ISO C++ says that these are ambiguous, even though the worst conversion for the first is better than the worst conversion for the 
second:
headers/private/kernel/syscall_restart.h:151: note: candidate 1: bool SyscallRestartWrapper<Type>::operator<(const Type&) const [with Type = long int]
src/system/kernel/fs/fd.cpp:727: note: candidate 2: operator<(long int, int) <built-in>


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@24927 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-04-12 07:04:45 +00:00
Michael Lotz 349a9cfc0f Use a list of host controller modules instead of using open_module_list() and
read_next_module_name(). This is ugly and less flexible but it allows us to
explicitly force an initialization order. As detailed by the added comment
there seem to be controllers/BIOSes that require the EHCI controller to be
initialized after the companion host controller or else they refuse to publish
any high speed devices. This was the case for bug #1236 and my laptop when
legacy emulation is enabled and any device was plugged in at boot. This change
fixed the problem for me and hopefully closes bug #1236 too.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@24926 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-04-12 06:10:36 +00:00
Michael Lotz e959baed58 * Set the interrupt threshold of the controller when doing the rest of the
initialization as suggested by the EHCI spec and do not touch it again
  once the controller is running. Doing so would result in undefined behaviour
  according to EHCI specs.
* Set the port routing policy after the controller has started and not before
  as suggested by the EHCI specs.
* Explicitly set the segment register after resetting the host controller and
  not before, as this likely has no real effect ;-)

Might help with some legacy support or UHCI/OHCI to EHCI handover problems.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@24925 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-04-12 06:10:28 +00:00
Rene Gollent 487171f0b9 Keymap preferences now saves an attribute on the Key_map file to indicate
what keymap it came from. This allows us to indicate the current keymap in
the list views. I'm not sure how to get the build system to populate that
attribute by default though.



git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@24924 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-04-12 03:28:12 +00:00
François Revol 3ee7fad0a9 export foo=bar doesn't seem to work with plain sh...
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@24923 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-04-12 02:45:21 +00:00
François Revol a559f87af8 Remove use of bashisms since we use #!/bin/sh. This should help supporting solaris.
Added sunos to the list of platforms, but it needs more work.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@24922 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-04-12 02:40:10 +00:00
Michael Lotz 77599d6d06 Redefine B_KERNEL_{READ|WRITE}_AREA to 0 for BeOS compatibility and not to
B_{READ|WRITE}_AREA. Otherwise we'd allow any user process to shredder our
data as Axel put it so nicely ;-) Thanks for the clarification.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@24921 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-04-11 22:03:34 +00:00
Michael Lotz dbcfdd5ca7 Correct the way serial devices are deleted. They are either deleted on removal
when they are not open or they are deleted on free when they are already
removed. This should fix the sudden crashes when you unplugged a device that
might not have been fully closed yet.
Also handle the case of removal correctly and don't use the usb_device anymore
after releasing it by returning from the device removed hook. Calls to the
device just return B_DEV_NOT_READY in that case.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@24920 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-04-11 21:52:39 +00:00
Ingo Weinhold c1add58abb Resolved TODOs: We now do know whether the call comes from userland or
the kernel.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@24919 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-04-11 20:43:40 +00:00
Ingo Weinhold 43d5590ce1 Yep, first clear THREAD_FLAGS_SYSCALL, then check whether it is set.
That would explain why syscall restarts were broken. In fact there's no
reason to check the flag at all, since we know we set it.

ftp appears to work again.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@24918 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-04-11 20:36:50 +00:00
Ingo Weinhold 3118b3a7cb * Added fd_ops::set_flags() hook. It's only implemented by socket FDs
ATM.
* Changed common_fcntl() to also work for non-vnode-based FDs. Only the
  operations that require a vnode do fail now. F_SETFL uses the new
  fd_ops::set_flags() if available, falling back to the vnode respective
  operation.
* Changed some direct accesses to file_descriptor::u::vnode. It was safe
  in those cases, but might not be anymore if we ever change fd_vnode().

ftp can at least connect to servers again, now, but apparently we still
have a problem with syscall restarts -- downloads fail after one second,
when the timer goes off.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@24917 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-04-11 19:21:14 +00:00
Stephan Aßmus f156c25d14 Applied patch by JiSheng Zhang:
Synchronized firewire bus manager with FreeBSD current.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@24916 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-04-11 17:35:11 +00:00
Axel Dörfler ac0e5c1ce5 The fs_sync() function (or any other, for that matter) must not hold the
sMountMutex lock when calling sync() on a file system. This fixes a potential
deadlock (I just encountered for the first time).


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@24915 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-04-11 17:01:25 +00:00
Ingo Weinhold 75015ff525 * Renamed THREAD_FLAGS_IOCTL_SYSCALL to THREAD_FLAGS_SYSCALL,
syscall_restart_ioctl_is_restarted() to syscall_restart_is_restarted,
  IoctlSyscallFlagUnsetter to SyscallFlagUnsetter, and
  IoctlSyscallRestartWrapper to SyscallRestartWrapper, as they are no
  longer only used for ioctl().
* Removed unused syscall_restart_ioctl_handle_post().
* Made SyscallRestartWrapper a lot fancier. Instead of storing a
  reference to the result value, it stores the value itself, and it
  features all the interesting operators that make it appear like that
  value. This simplifies the use of the class quite a bit.
* THREAD_FLAGS_SYSCALL is now set for all socket function and the
  read[v](), write[v]() syscalls.
* Added is_syscall() function and net_stack hook to the net stack.
* Removed "kernel" parameter from all net_stack_interface and net_socket
  module hooks. They aren't need any longer, since is_syscall() can be
  used instead.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@24914 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-04-11 16:13:47 +00:00
Axel Dörfler 9493edbe9f Applied patch by Christian Fasshauer:
* get_dir_path_and_leaf() now removes trailing slashes from the path.
* This fixes bug #2016, thanks!


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@24913 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-04-11 14:37:48 +00:00
Stefano Ceccherini 838c73ba76 Removed unused BWindow friend classes, renamed some BView member
variables to fit our guidelines.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@24912 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-04-11 09:26:11 +00:00
Stefano Ceccherini 18af47f5c4 Renamed some private methods to have the underline prefix, now that
BWindow doesn't call them directly anymore.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@24911 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-04-11 08:53:25 +00:00
Stefano Ceccherini 150ddd17b1 added missing header
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@24910 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-04-11 08:29:54 +00:00
Stefano Ceccherini 10f4d0679a Added a class MenuPrivate to handle access to private BMenu methods.
BMenuItem and BWindow are no longer friends of BMenu, but use this class 
instead.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@24909 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-04-11 08:22:09 +00:00
Ingo Weinhold df50f7a9b4 * Changed the way the socket functions work:
- The net_stack driver is no longer used. Instead we have a kernel
    module which is directly used by syscall implementations in the
    kernel. I.e. we no longer tunnel those functions through ioctls, but
    have normal syscalls.
  - Removed the superfluous net starter module.
  - Implemented the FDTYPE_SOCKET type file_descriptors, that is sockets
    are no longer vnode based.
  - Adjusted libnetwork (the socket function implementations)
    accordingly.
  - Adjusted netstat accordingly.
* Socket module:
  - Implemented socketpair().
  - Added "kernel" parameter to the control hook. Quite a few more hooks
    would actually need the parameter, but I didn't change those yet,
    since that would probably also require changes to the protocol
    module interface.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@24908 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-04-11 04:12:23 +00:00
Ingo Weinhold 446d50a652 Removed unused _kern_socket() dummy.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@24907 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-04-11 03:37:18 +00:00
Ingo Weinhold 0fc6c43728 Resolved TODO: We can check for sockets, now.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@24906 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-04-11 03:35:15 +00:00
Ingo Weinhold 3cc3dcb385 Preparation for socket file descriptors.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@24905 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-04-11 03:33:59 +00:00