Commit graph

957 commits

Author SHA1 Message Date
Wojciech Zajac 7896beeeca Fixed setup packet configuration for USBD and disconnection cleanup 2014-07-28 17:05:50 +02:00
Wojciech Zajac f73cacc767 Fix for usbd-usb_storage pairing and URB handling. Additional cleanup. 2014-07-28 17:05:50 +02:00
Wojciech Zajac 9f2204a8ad Resolution of some currently fixable TODOs 2014-07-28 17:05:50 +02:00
Lionel Sambuc 310904bf12 Message type for TTY_INPUT_EVENT
Change-Id: I2bae0a2c8326b36c438f9b340c394ec66189c1c8
2014-07-28 17:05:49 +02:00
Lionel Sambuc 1576ef5542 Message type for DL_{READ,WRITE}V_S
Change-Id: I6e25e8e994b0bdec2bb54f50e6db08e6e935c819
2014-07-28 17:05:45 +02:00
Lionel Sambuc 992b76139f Message type for DL_TASK_REPLY
Change-Id: I7f15f8f874366e93866f53d7a60a0c7ef9c98636
2014-07-28 17:05:45 +02:00
Lionel Sambuc 079646e056 Message type for DL_GETSTAT_S
Change-Id: Ia5c2bf7a3d796a6a0463af70059e82fddd43d69c
2014-07-28 17:05:45 +02:00
Lionel Sambuc 50ab3b569d Message type for DL_CONF{,_REPLY}
Change-Id: Ib0e435875b6f5cacdcbc8593f9a887b0a4c472c1
2014-07-28 17:05:45 +02:00
Lionel Sambuc 1a943bea52 Message type for INPUT_SETLEDS
Change-Id: I84ee6ee43d771409526468ce45f1ddc27e9ca986
2014-07-28 17:05:44 +02:00
Lionel Sambuc d6626d0575 Message type for RTCDEV_*
Change-Id: Ie4257e745e1d8b6a151934949f10c7fdb1ac4778
2014-07-28 17:05:44 +02:00
Lionel Sambuc 3a82a3f90a Message type for BUSC_I2C_EXEC
Change-Id: I4b6e33df2dd70d40af4a2f2c899324a40107c56a
2014-07-28 17:05:44 +02:00
Lionel Sambuc b8e631ff13 Message type for BUSC_I2C_RESERVE
Change-Id: Iedc2615b41c65f826868a70448fb1143bd85670f
2014-07-28 17:05:43 +02:00
Lionel Sambuc ff905e5276 Message type for BUSC_PCI_GET_BAR
Change-Id: I5cb21f09a2c80473101f8da3f435e4dcc3b05491
2014-07-28 17:05:43 +02:00
Wojciech Zajac a42c8f6c41 Error checking for USB interrupt transfer 2014-07-28 17:05:41 +02:00
Wojciech Zajac fc49538d86 Initial interrupt URBs support 2014-07-28 17:05:41 +02:00
Wojciech Zajac 5308df03ed Volatile keyword fix for MUSB reset loop. 2014-07-28 17:05:40 +02:00
Kees Jongenburger 880ae44a72 usb:Adding usb enumeration.
usbd update from JPEmbedded

Change-Id: I4098b29a3188abe7110d59f0746ea40ac5818bbf

http://gerrit.minix3.org/#/c/2698/
2014-07-28 17:05:40 +02:00
Kees Jongenburger 146e5a99e4 usbd:fix get_bp workaround
Change-Id: I6967dc515e3da4330503eb716e8f0165df71b8f1

http://gerrit.minix3.org/#/c/2697/
2014-07-28 17:05:40 +02:00
Kees Jongenburger 9cc744ad52 arm:build and install usbd by default.
Change-Id: I3f7a5bf5d4b75ba820297b0d5fb4447e5126e641

http://gerrit.minix3.org/#/c/2696/
2014-07-28 17:05:40 +02:00
Kees Jongenburger 27bb595b9d build:always build and install the usb mass storage driver.
Change-Id: Ib54902a21443bd110bfc7498c00776831cbdefaf

http://gerrit.minix3.org/#/c/2693/
2014-07-28 17:05:39 +02:00
Kees Jongenburger 902045e94e build:indenting
Change-Id: I85840455ab0ff94c33a2abe342967f6248d1e45f

http://gerrit.minix3.org/#/c/2691/
2014-07-28 17:05:39 +02:00
Kees Jongenburger dfb2b8398d usb:adding usb mass storage driver.
Change-Id: I9e431d56eddfeec21413c290b2fa7ad35b566f6b

http://gerrit.minix3.org/#/c/2690/
2014-07-28 17:05:39 +02:00
Kees Jongenburger ed3391fd23 arm:adding the usbd source code.
Change-Id: Ia3c50a8c5e11bf20100354de266913112cc236f9

http://gerrit.minix3.org/#/c/2689/
2014-07-28 17:05:38 +02:00
Lionel Sambuc 6a309697f4 From Ben Gras, add select support on /dev/random.
Change-Id: I47bf4c45285458ecc224df0564edf98afdb2c9d6
2014-07-28 17:05:23 +02:00
Kees Jongenburger 4dafcd9245 build:also build the hello driver on arm.
Change-Id: I5dd82d3b56b907bfc137313f503f9d9c52c199ef
2014-07-28 17:05:21 +02:00
David van Moolenbroek 415782f70f TTY: do not reply to KERNEL
Diagnostics messages are printed using locally generated requests,
using KERNEL as the calling endpoint.  No reply should be sent for
such cases.  This check was accidentally lost with the previous
removal of tty_reply().

Change-Id: I4b76215a4d90e927b0071675d89d861aa399abb3
2014-07-28 17:05:13 +02:00
David van Moolenbroek 760f3d62d7 PTY: split off from TTY
Requires recreation of /dev/tty[pq]*, /dev/pty[pq]* device nodes.

Change-Id: I0e5a28d82faa934497fd3b97d619e506bcb5f439
2014-07-28 17:05:12 +02:00
Ben Gras 3c7f4e462e 64-bit bdev position
Change-Id: I149693624610e04af0c5e4437b5efa484a33467d
2014-07-28 17:05:10 +02:00
Lionel Sambuc 84d9c625bf Synchronize on NetBSD-CVS (2013/12/1 12:00:00 UTC)
- Fix for possible unset uid/gid in toproto
 - Fix for default mtree style
 - Update libelf
 - Importing libexecinfo
 - Resynchronize GCC, mpc, gmp, mpfr
 - build.sh: Replace params with show-params.
     This has been done as the make target has been renamed in the same
     way, while a new target named params has been added. This new
     target generates a file containing all the parameters, instead of
     printing it on the console.
 - Update test48 with new etc/services (Fix by Ben Gras <ben@minix3.org)
     get getservbyport() out of the inner loop

Change-Id: Ie6ad5226fa2621ff9f0dee8782ea48f9443d2091
2014-07-28 17:05:06 +02:00
Ben Gras 17587738d3 align <sys/ucontext.h> <sys/uio.h> <sys/un.h>
Change-Id: I70adf01fddf931a3a6931083adaa4bbe647ea6a3
2014-03-03 20:47:03 +01:00
Ben Gras 01624e6f86 <sys/socket.h>, <netinet/{in,tcp,udp,udp_var}.h>
. add sa_len to sockaddr, sin_len to sockaddr_in
	. rename SCM_CREDENTIALS to SCM_CREDS
	. retire PF_FILE (same as PF_UNIX)

Change-Id: Id3ec63fe2556fc7ceb48de8ad4e80736df3ddfc7
2014-03-03 20:47:03 +01:00
Ben Gras dda632a24f drop the minix_ prefixes for mmap and munmap
also cleanup of various minix-specific changes, cleanup of
mmap-related testing.

Change-Id: I289a4fc50cf8a13df4a6082038d860853a4bd024
2014-03-03 20:47:03 +01:00
Lionel Sambuc 57476292b0 include/time.h: merged
- Defining CLOCKS_PER_SEC = 100, instead of 60.
   This define is here for legacy reasons, use sysconf(_SC_CLK_TCK) to
   retrieve the actual number of clock tick per second of the system in
   new code.

 - Moving stime prototype to minix/sysutil.h

Change-Id: I76a73cd53ac2361845f2917f62af4125adfc615d
2014-03-03 20:47:02 +01:00
Lionel Sambuc d3b0a89bab include/unistd.h: merged
Also removing lseek64, pread64, pwrite64.

Those functions have lost their "raison d'être", when off_t switched to
64bits.

Change-Id: I5aea35f01d6d10e3d6578a70323da7be5eca315a
2014-03-03 20:47:02 +01:00
Lionel Sambuc 175d3e7eae Changing the message union to anonymous.
This allows us to write things like this:
  message m;
  m.m_notify.interrupts = new_value;

or
  message *mp;
  mp->m_notify.interrupts = new_value;

The shorthands macro have been adapted for the new scheme, and will be
kept as long as we have generic messages being used.

Change-Id: Icfd02b5f126892b1d5d2cebe8c8fb02b180000f7
2014-03-03 20:46:47 +01:00
Lionel Sambuc 55d9e9954b Extending time_t to 64bits.
Change-Id: Ia96b8bfba19cb8179a0237a7d2122d415c24d73f
2014-03-03 20:45:28 +01:00
Lionel Sambuc 42e13282d7 Fix genmap, always use headers from the sources.
This fixes the compilation failure when building on MINIX.

Change-Id: Iaa2ac5d73ce5f4a8219cacbe726e1398bcdb5740
2014-03-03 20:45:27 +01:00
Gerard 78da142dab Replaced common u64.h functions with operators.
Change-Id: I71b7b4879209eeff89ce5748d67102afebf871dc
2014-03-02 12:28:32 +01:00
Ben Gras 8ccb12bb5a use netbsd <sys/signal.h> and sigset_t
. create signals-related struct message type to store sigset_t
	  directly
	. create notify-specific message types, so the generic NOTIFY_ARG
	  doesn't exist anymore
	. various related test expansions, improvements, fixes
	. add a few error-checks to sigismember() calls
	. rename kernel call specific signals fields to SYS_*

Change-Id: I53c18999b5eaf0cfa0cb25f5330bee9e7ad2b478
2014-03-02 12:28:31 +01:00
Ben Gras 6c3dfa5f3c switch to netbsd <sys/errno.h>
not entirely clean; _SIGN hack remains for now.  also leave in
minix-specific stuff like minix-specific errno's and OK.

Change-Id: I035efc52e27b92f58ae0d88dab19dec263edb6e3
2014-03-02 12:28:31 +01:00
Ben Gras 7120f34ec1 drop <minix/termios.h>, use clean <sys/termios.h>
. also implement some netbsd-style tty ioctls
	. also implement SIGINFO
	. also import netbsd stty
	. rename keymap minix CMIN (for ctrl+minus on numeric keypad)
	  to CNMIN; to keep unchanged control character default CMIN in
	  new <sys/ttydefaults.h>
	. convert CS[5678] logic in rs232 driver to explicit setting of LC
	  bits

Change-Id: I9b7d2963fe9aec00fb6e7535ef565b3191fc1c1d
2014-03-02 12:28:20 +01:00
Ben Gras a06e2ab395 big <utmp.h>-inspired netbsd switch
import/switch of:
init, getty, reboot, halt, shutdown, wall, last

changes:
	. change reboot() call to netbsd prototype and args
	. allows pristine <utmp.h>
	. use clean <sys/reboot.h> instead of <minix/reboot.h>
	. implement TIOCSCTTY for use by getty so getty can get
	  controlling terminal from init's child(ren)
	. allow NULL envp for exec

Change-Id: I5ca02cb4230857140c08794bbfeba7df982c58a3
2014-03-01 09:05:02 +01:00
Lionel Sambuc c3fc9df84a Adding ipc_ prefix to ipc primitives
* Also change _orig to _intr for clarity
 * Cleaned up {IPC,KER}VEC
 * Renamed _minix_kernel_info_struct to get_minix_kerninfo
 * Merged _senda.S into _ipc.S
 * Moved into separate files get_minix_kerninfo and _do_kernel_call
 * Adapted do_kernel_call to follow same _ convention as ipc functions
 * Drop patches in libc/net/send.c and libc/include/namespace.h

Change-Id: If4ea21ecb65435170d7d87de6c826328e84c18d0
2014-03-01 09:05:01 +01:00
David van Moolenbroek 80bd109cd3 libsys: various updates
- move system calls for use by services from libminlib into libsys;
- move srv_fork(2) and srv_kill(2) from RS and into libsys;
- replace getprocnr(2) with sef_self(3);
- rename previous getnprocnr(2) to getprocnr(2);
- clean up getepinfo(2);
- change all libsys calls that used _syscall to use _taskcall, so as
  to avoid going through errno to pass errors; this is already how
  most calls work anyway, and many of the calls previously using
  _syscall were already assumed to return the actual error;
- initialize request messages to zero, for future compatibility
  (note that this does not include PCI calls, which are in need of a
  much bigger overhaul, nor kernel calls);
- clean up more of dead DS code as a side effect.

Change-Id: I8788f54c68598fcf58e23486e270c2d749780ebb
2014-03-01 09:05:00 +01:00
David van Moolenbroek b058039a35 TTY: fix earlier PTY select "improvement"
It was just plain wrong.

Change-Id: Ieab4b4f01d9461e05e0d0ba6427a99d863d6b98d
2014-03-01 09:04:58 +01:00
David van Moolenbroek e5cc85fdc4 Extend dupfrom(2) into copyfd(2)
This single function allows copying file descriptors from and to
processes, and closing a previously copied remote file descriptor.
This function replaces the five FD-related UDS backcalls. While it
limits the total number of in-flight file descriptors to OPEN_MAX,
this change greatly improves crash recovery support of UDS, since all
in-flight file descriptors will be closed instead of keeping them
open indefinitely (causing VFS to crash on system shutdown). With the
new copyfd call, UDS becomes simpler, and the concept of filps is no
longer exposed outside of VFS.

This patch also moves the checkperms(2) stub into libminlib, thus
fully abstracting away message details of VFS communication from UDS.

Change-Id: Idd32ad390a566143c8ef66955e5ae2c221cff966
2014-03-01 09:04:58 +01:00
David van Moolenbroek 9e3e032c26 UDS: sendmsg/recvmsg fixes
- sendmsg: the accumulation of multiple in-flight file descriptors was
  already described in the comments; now the code actually does what
  the comments say :) -- also, added robustness in case of a failure;
- recvmsg: only create a socket rights message if there are file
  descriptors pending at all;
- recvmsg: copy back the control message length;
- recvmsg: use CMSG_SPACE instead of CMSG_LEN to compute sizes.

Not sure if all of this is now working according to specification,
but at least tmux seems to be happy with it.

Change-Id: I8d076c14c3ff3220b7fea730e0f08f4b4254ede5
2014-03-01 09:04:58 +01:00
David van Moolenbroek f3d8aa65ac UDS: add support for FIONREAD
Change-Id: I50030012b408242a86f8c55017429acdadff49d1
2014-03-01 09:04:58 +01:00
David van Moolenbroek 3e8346a8e8 UDS: support for nonblocking sockets
This patch includes several other fixes, which are now tested in the
test56 test set.

Change-Id: I9535d5a6c072abf966252838522c5f65b353c6c2
2014-03-01 09:04:57 +01:00
David van Moolenbroek 1e07186caf UDS: clean up source code
- move VFS calls to a separate source file;
- solve a few subtle bugs, mostly in error handling;
- simplify debug reporting code;
- make a few definitions more independent;
- restyle to something closer to KNF.

Change-Id: I7b0537adfccac8b92b5cc3e78dac9f5ce3c79f03
2014-03-01 09:04:57 +01:00