aboutsummaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
...
* libmachdev: simplify source codeSamuel Thibault2020-07-251-19/+8
| | | | | * libmachdev/trivfs_server.c (machdev_is_master_device): Simplify source code.
* Fix references to startup in commentsSamuel Thibault2020-07-253-4/+4
|
* rumpdisk: Use bootstrap resume of fs task in machdevDamien Zammit2020-07-252-11/+123
| | | | Message-Id: <20200725011847.186969-4-damien@zamaudio.com>
* libmachdev: Implement S_i386_io_perm_createDamien Zammit2020-07-253-1/+65
| | | | | | | | Now that machdev redirects the device master port, it has to implement the i386 permission RPCs on it. Message-Id: <20200725011847.186969-2-damien@zamaudio.com> Message-Id: <20200725011847.186969-3-damien@zamaudio.com>
* libmachdev: Add resume for bootstrap serverDamien Zammit2020-07-253-26/+148
| | | | | | | | | | | | machdev users can now pass along a port to the next translator in the bootstrap chain (bootstrap_resume_task), that they'll get from their command line set by the bootloader. machdev will then call task_resume on it as appropriate. It will also have the opportunity to get fsys_getpriv calls, and thus redirect the device master port, thus having the opportunity to expose its devices on the device master port, as if they were handled by the kernel. Message-Id: <20200725011847.186969-1-damien@zamaudio.com>
* libmachdev: Remove deviceUser, this lib is a deviceServerDamien Zammit2020-07-241-3/+3
| | | | | libmachuser provides what we need Message-Id: <20200724132039.110421-1-damien@zamaudio.com>
* Add new RPC server stubs for device_intr_*Samuel Thibault2020-07-183-0/+42
| | | | | | | * boot/boot.c (ds_device_intr_register, ds_device_intr_ack): New stubs. * devnode/devnode.c (ds_device_intr_register, ds_device_intr_ack): New stubs. * eth-multiplexer/device_impl.c (ds_device_intr_register, ds_device_intr_ack): New stubs.
* rumpdisk: link the bd on success onlyDamien Zammit2020-07-181-2/+2
| | | | Otherwise we would crash after an unsuccessful device_open call.
* rumpdisk: Simplify codeDamien Zammit2020-07-181-4/+1
| | | | There is no need to store the error only to return it.
* libmachdev: Add new RPC server stubs for ds_device_intr_*Damien Zammit2020-07-181-0/+13
|
* pflocal: Fix referencing connection queue entries.Samuel Thibault2020-07-051-2/+13
| | | | | | | | | | As asserted in connq_destroy, for each entry in the queue we are supposed to keep a reference to the socket that contains the queue. So we need to keep it when connecting and release it when accepting. * pflocal/socket.c (S_socket_connect): Do not deref the peer socket when sock_connect succeeded. (S_socket_accept): Deref the socket when the accept succeeded.
* pflocal: support SO_SNDBUF for unconnected socketsSamuel Thibault2020-07-053-7/+13
| | | | | | | | | | | | | | We can store the requested value, to be applied when we connect the sockets. * pflocal/sock.h (struct sock): Add req_write_limit field. * pflocal/sock.c (sock_create): Initialize req_write_limit field to 0. (sock_connect): Bump the write_limit of the write pipe to the req_write_limit value. (sock_shutdown): Update req_write_limit from the write_limit of the write pipe. * pflocal/socket.c (S_socket_getopt, S_socket_setopt): When write_pipe is NULL, use req_write_limit.
* pflocal: return ENOTCONN on get/setpot(SO_SNDBUF) on unconnected socketSamuel Thibault2020-07-051-4/+4
| | | | | | | | EPIPE would raise SIGPIPE, which applications do not expect to happen on a mere get/setsockopt. * pflocal/socket.c (S_socket_getopt, S_socket_setopt): Return ENOTCONN instead of EPIPE.
* pflocal: Fix setsockopt(SO_SNDBUF)Samuel Thibault2020-06-271-1/+1
| | | | | * pflocal/socket.c (S_socket_setopt): Make SO_SNDBUF use write_pipe instead of read_pipe.
* pflocal: Add support for setsockopt(SO_{RECV,SND}BUF)Samuel Thibault2020-06-274-14/+108
| | | | | | | | | | Thanks Svante Signell for the initial patch. * libpipe/pipe.c (pipe_recv): Move writer wake code to... (_pipe_wake_writers): ... new function. * libpipe/pipe.h (_pipe_wake_writers): New prototype. * pflocal/sock.h (PFLOCAL_WRITE_LIMIT_MAX): New macro. * pflocal/socket.c (S_socket_setopt): Handle SO_RCVBUF and SO_SNDBUF cases.
* pflocal: Fix crash on passing erroneous portSamuel Thibault2020-06-271-1/+3
| | | | | * pflocal/socket.c (S_socket_getopt): Read `user->sock' after checking `user'.
* pflocal: Add support for getsockopt(SO_{RECV,SND}BUF)Svante Signell2020-06-271-3/+35
| | | | * S_socket_getopt: Handle SO_RCVBUF and SO_SNDBUF cases.
* TODO: drop items that were doneSamuel Thibault2020-06-061-3/+0
| | | | TLS, sigaltstack, gdb core
* libfshelp: destroy condition variable before freeing itSamuel Thibault2020-06-012-0/+2
| | | | | | | | | | To make sure that threads have really woken up. Spotted by Richard Braun. * libfshelp/rlock-drop-peropen.c (fshelp_rlock_drop_peropen): Call pthread_cond_destroy before freeing the condition variable. * libfshelp/rlock-tweak.c (fshelp_rlock_tweak): Likewise.
* libdiskfs: Add missing node lock around fshelp_rlock_drop_peropen callSamuel Thibault2020-06-012-5/+6
| | | | | fshelp_rlock_drop_peropen actually needs the node to be locked for proper waiting atomicity.
* libdiskfs: Drop spurious mutex acquisitionSamuel Thibault2020-06-011-2/+0
| | | | | | | | diskfs_make_peropen does not need node to be locked. Worse, it could try to lock it. * libdiskfs/file-reparent.c (diskfs_S_file_reparent): Do not lock node around diskfs_make_peropen.
* libdiskfs,libnetfs: add missing io_pathconf casesSamuel Thibault2020-05-282-0/+20
| | | | | | | | * libdiskfs/io-pathconf.c (diskfs_S_io_pathconf): For _PC_REC_MAX_XFER_SIZE, _PC_REC_INCR_XFER_SIZE, _PC_SYMLINK_MAX, return undefined. For _PC_2_SYMLINKS, return 1. For _PC_REC_MIN_XFER_SIZE, _PC_REC_XFER_ALIGN, _PC_ALLOC_SIZE_MIN, return page size. * libnetfs/io-pathconf.c (netfs_S_io_pathconf): Likewise.
* ext2fs: Update to upstream Hurd-reserved xattr index for "gnu.*".Jan (janneke) Nieuwenhuizen2020-05-141-1/+1
| | | | | | | | | | | | | | | | | | | | | | See https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=3980bd3b406addb327d858aebd19e229ea340b9a This supports setting (and reading) of passive trasnlators from GNU/Linux, e.g. dd if=/dev/zero of=file bs=1k count=1000 losetup /dev/loop0 file mke2fs -t ext2 -o hurd -O ext_attr /dev/loop0 mount -t ext2 -o x-xattr-translator-records /dev/loop0 /mnt mkdir -p /mnt/servers/socket touch /mnt/servers/socket/1 setfattr --name=gnu.translator --value='"/hurd/pflocal\0"' /mnt/servers/socket/1 getfattr --name=gnu.translator /mnt/servers/socket/1 # file: 1 gnu.translator="/hurd/pflocal" * ext2fs/xattr.c (xattr_prefixes): For "gnu.*", use index for the Hurd (10).
* pci-arbiter: Remove obsolete TODO itemsJoan Lledó2020-05-021-5/+0
| | | | | * pci-arbiter/TODO: Remove --pci and memset+snprintf TODO items which are already done.
* Memset directory entries to zero during their creationJoan Lledó2020-05-021-1/+2
| | | | | | | * pci-arbiter/pcifs.c: * create_dir_entry: Add memset() * create_fs_tree: Remove memset() Message-Id: <20200502172713.18654-2-jlledom@mailfence.com>
* Really enable building rumpdiskSamuel Thibault2020-04-161-0/+3
| | | | * config.make.in (HAVE_LIBRUMP): Define.
* pci-arbiter: Remove done TODO itemDamien Zammit2020-04-121-2/+0
|
* pci-ops.c: Use compatible pointersDamien Zammit2020-04-121-4/+4
|
* Rumpdisk: fix buffer sizeSamuel Thibault2020-04-111-1/+1
| | | | | * rumpdisk/block-rump.c (device_open): Reduce the dev_name buffer size by one (unused) byte.
* rumpdisk: Use more canonical parameter orderSamuel Thibault2020-04-111-2/+2
| | | | | | | To match snprintf parameter order. * rumpdisk/block-rump.c (translate_name): Make `name' parameter last. (device_open): Fix translate_name call accordingly.
* rump: do not build if rump/rump.h can't be foundSamuel Thibault2020-04-111-2/+3
| | | | * configure.ac: Combine tests for rump/rump.h and librump.
* rumpdisk: Add userspace disk support via librumpDamien Zammit2020-04-117-0/+535
|
* pci-arbiter: Fix bug on option parsing.Joan Lledó2020-04-111-10/+48
| | | | | | | | | A misuse of strtol() caused wrong parameters to be interpreted as '0' * pci-arbiter/options.c: * New function parse_number() to handle wrong input * Call parse_number() from all places where strtol was being called Message-Id: <20200411113654.6360-2-jlledom@mailfence.com>
* Fix build with -fno-commonSamuel Thibault2020-03-3152-150/+347
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | which will be the default in gcc-10. * acpi/acpifs.h (fs, acpifs_maptime): Add extern qualifier. * boot/private.h (verbose): Likewise. * eth-multiplexer/netfs_impl.h (multiplexer_maptime): Likewise. * eth-multiplexer/vdev.h (port_bucket, vdev_portclass): Likewise. * exec/priv.h (port_bucket, execboot_portclass): Likewise. * ext2fs/ext2fs.h (sblock, sblock_dirty, block_size, log2_block_size, log2_dev_blocks_per_fs_block, log2_stat_blocks_per_fs_block, zeroblock, frag_size, frags_per_block, inodes_per_block, itb_per_group, db_per_group, desc_per_block, addr_per_block, groups_count, node_to_page_lock, generation_lock, next_generation, group_desc_image, global_pokel, modified_global_blocks, use_xattr_translator_records): Likewise. * hostmux/hostmux.h (hostmux_maptime): Likewise. * isofs/isofs.h (host_name, mounted_on, disk_image, disk_image_len, logical_block_size, sblock): Likewise. * libdiskfs/diskfs.h (diskfs_shortcut_symlink, diskfs_shortcut_chrdev, diskfs_shortcut_blkdev, diskfs_shortcut_fifo, diskfs_shortcut_ifsock, diskfs_create_symlink_hook, diskfs_read_symlink_hook): Likewise. * libnetfs/callbacks.h (_netfs_translator_callback1, _netfs_translator_callback2): Likewise. * libnetfs/priv.h (netfs_mtime): Likewise. * libpager/priv.h (_pager_class): Likewise. * libtrivfs/trivfs.h (trivfs_check_access_hook, trivfs_check_open_hook, trivfs_open_hook, trivfs_protid_create_hook, trivfs_peropen_create_hook, trivfs_protid_destroy_hook, trivfs_peropen_destroy_hook, trivfs_getroot_hook): Likewise. * lwip/lwip-hurd.h (lwip_bucket, socketport_class, addrport_class, shutdown_notify_class, lwip_protid_portclasses, lwip_cntl_portclasses, lwip_bootstrap_portclass, fsys_identity, lwipcntl, lwip_owner, lwip_group): Likewise. * lwip/port/include/netif/hurdtunif.h (tunnel_cntlclass, tunnel_class): Likewise. * nfs/nfs.h (main_udp_socket, hostname, mapped_time): Likewise. * nfsd/nfsd.h (mapped_time, authserver): Likewise. * pci-arbiter/pcifs.h (fs, pcifs_maptime): Likewise. * pci-arbiter/startup.h (pci_shutdown_notify_class, arrange_shutdown_notification): Likewise. * pfinet/pfinet.h (pfinet_bucket, addrport_class, socketport_class, fsys_identity, pfinetctl, pfinet_owner, pfinet_group): Likewise. * pflocal/sserver.h (sock_port_bucket): Likewise. * proc/proc.h (authserver, self_proc, init_proc, startup_proc, proc_bucket, proc_class, generic_port_class, exc_class, generic_port, kernel_proc, global_lock): Likewise. * term/term.h (termstate, termflags, global_lock, carrier_alert, select_alert, pty_select_alert, term_bucket, tty_cntl_class, tty_class, cttyid_class, pty_class, pty_cntl_class, termctl, ptyctl, inputq, rawq, outputq, remote_input_mode, external_processing, term_owner, term_group, term_mode, bottom): Likewise. * usermux/usermux.h (usermux_maptime): Likewise. * utils/msgids.h (msgid_argp): Likewise. * libdiskfs/priv.h (_diskfs_mtime): Remove definition. * lwip/options.h (lwip_argp): Add prototype. * mach-defpager/priv.h (partitions): Name structure. (all_partitions): Add extern qualifier. * acpi/main.c (acpifs_maptime, fs): New variables. * exec/main.c (port_bucket, execboot_portclass): Likewise. * ext2fs/ext2fs.c (sblock, sblock_dirty, block_size, log2_block_size, log2_dev_blocks_per_fs_block, log2_stat_blocks_per_fs_block, frag_size, frags_per_block, inodes_per_block, itb_per_group, db_per_group, desc_per_block, addr_per_block, groups_count, next_generation, group_desc_image, global_pokel, use_xattr_translator_records): Likewise. * isofs/main.c (host_name, mounted_on, logical_block_size, sblock): Likewise. * libpager/pager-create.c (_pager_class): Likewise. * lwip/port/netif/hurdtunif.c (tunnel_cntlclass, tunnel_class): Likewise. * mach-defpager/default_pager.c (all_partitions): Likewise. * nfs/main.c (main_udp_socket, hostname, mapped_time): Likewise. * nfsd/main.c (mapped_time, authserver): Likewise. * pci-arbiter/main.c (fs, pcifs_maptime): Likewise. * pci-arbiter/startup.c (*pci_shutdown_notify_class): Likewise. * pfinet/main.c (pfinetctl, pfinet_owner, pfinet_group, pfinet_bucket, addrport_class, socketport_class, fsys_identity): Likewise. * proc/main.c (authserver, self_proc, init_proc, startup_proc, proc_bucket, proc_class, generic_port_class, exc_class, generic_port, kernel_proc, global_lock): Likewise. * term/main.c (termstate, termflags, global_lock, carrier_alert, select_alert, pty_select_alert, term_bucket, tty_cntl_class, tty_class, cttyid_class, pty_class, pty_cntl_class, termctl, ptyctl, outputq, remote_input_mode, external_processing, term_owner, term_group, term_mode, bottom): Likewise. * usermux/usermux.c (usermux_mapped_time): Rename to usermux_maptime. * lwip/main.c: Include "options.h". (lwip_argp, netif_list): Remove declarations. (lwip_bucket, socketport_class, addrport_class, shutdown_notify_class, lwip_cntl_portclasses, lwip_bootstrap_portclass, lwip_owner, lwip_group, fsys_identity, lwipcntl): New variables. * eth-multiplexer/multiplexer.c (multiplexer_maptime): Add variable. * hostmux/hostmux.c (hostmux_mapped_time): Rename variable to hostmux_maptime * libdiskfs/extra-version.c: Rename file to... * libdiskfs/priv.c: ... new file. (diskfs_shortcut_symlink, diskfs_shortcut_chrdev, diskfs_shortcut_blkdev, diskfs_shortcut_fifo, diskfs_shortcut_ifsock, diskfs_create_symlink_hook, diskfs_read_symlink_hook): Add weak variables. * libdiskfs/Makefile (OTHERSRCS): Replace extra-version.c with priv.c. * libtrivfs/priv.c: New file. * libtrivfs/Makefile (OTHERSRCS): Add priv.c * libcons/extra-version.c: Rename file to... * libcons/priv.c: ... new file. * libcons/Makefile (SRCS): Replace extra-version.c with priv.c. Fix build with #
* machdev: Expose machdev_emul_device structureSamuel Thibault2020-03-307-17/+46
| | | | | | | | | | | | | | | * libmachdev/machdev-dev_hdr.h (DEVICE_NULL): Remove macro. (emul_device): Rename structure to machdev_emul_device. (emul_device_t): Rename type to machdev_emul_device_t. (mach_device, mach_device_t, MACH_DEVICE_NULL): Move to... * libmachdev/mach_device.h: ... new file. * libmachdev/ds_routines.c: Include "mach_device.h". * libmachdev/machdev-device_emul.h: Include <mach/notify.h>, <device/device_types.h>, <device/net_status.h>, <errno.h> * libmachdev/machdev.h: Include "machdev_hdr.h". * libmachdev/mig-decls.h: Include "mach_device.h". * libmachdev/Makefile (LCLHDRS): Add mach_device.h. (installhdrs): Add machdev-dev_hdr.h.
* Add eth-multiplexer documentationZheng Da2020-03-301-0/+65
| | | | * doc/hurd.texi (eth-multiplexer): Add section.
* libmachdev: Add common machdevZheng Da2020-03-299-0/+830
| | | | * libmachdev: New directory.
* libstore: Fix memory leakSamuel Thibault2020-03-291-1/+3
| | | | | * libstore/device.c (dopen): Do not use strdup() for `rest'. Free `master'.
* libstore: Add ability to pass custom master device with format ↵Damien Zammit2020-03-291-6/+13
| | | | @master:/dev/device
* pci-arbiter: Fix short reads from libpciaccessDamien Zammit2020-03-291-4/+6
| | | | | | * pci-arbiter/pci-ops.c (S_pci_conf_read): Record and pass amount actually read from config memory. (S_pci_conf_write): Likewise for write.
* build: Fix cross build on Guix.Jan Nieuwenhuizen2020-03-221-1/+2
| | | | | | As discussed in https://lists.gnu.org/archive/html/bug-hurd/2020-03/msg00018.html. * Makeconf (lpath): Add -Wl,-rpath-link=<dir> next to -L<dir>.
* pci-arbiter: Add --device command line optionJoan Lledó2020-02-232-0/+59
| | | | | | | | | Shortcut for -d, -b, -s and -f Usage: --device [<domain>:]<bus>:<slot>.<func> E.G. --device 00:05.0 is shortcut for -d 0 -b 0 -s 5 -f 0 * pci-arbiter/options.c: Implement --slot option * pci-arbiter/options.h: Add --slot to options list
* pci-arbiter: Rename command line optionsJoan Lledó2020-02-232-20/+16
| | | | | | | | | | | | | | | | Rename some CLI options in order to add the new -D --device arg. Replace -s by -c for subclasses. Replace -D by -d for domains. Domains are optional from now on, default to 0. Replace -d by -s for devices. The formerly called "devices" are now called "slots", and "device" will refer to a combination of Domain + Bus + Slot + Function Only -G and -U options create new permission scopes. * pci-arbiter/options.c: parse_opts(): Rename options * pci-arbiter/options.h: struct argp_option options[]: Likewise
* pfinet: Fix buildSamuel Thibault2020-01-051-0/+1
| | | | * pfinet/socket.c: Define _HACK_ERRNO_H to get a proper errno definition.
* pfinet: Fix buildSamuel Thibault2020-01-051-6/+4
| | | | | | | errno is also used by glue headers, so we can not actually check it * pfinet/io-ops.c (S_io_reauthenticate): Do not check that it's EINTR that make_sock_user failed with.
* lwip,pfinet: Make S_io_reauthenticate return errorSamuel Thibault2020-01-052-2/+2
| | | | | | * lwip/io-ops.c (lwip_S_io_reauthenticate): Return errno on make_sock_user returning an error. * pfinet/io-ops.c (S_io_reauthenticate): Likewise.
* lwip,pfinet: Fix crash on make_sock_user getting EINTRSamuel Thibault2020-01-054-4/+21
| | | | | | | | | | | _ports_create_port_internal may return EINTR. * lwip/port-objs.c (make_sock_user): Set errno when ports_create_port returns an error. * pfinet/socket.c (make_sock_user): Likewise. * lwip/io-ops.c (lwip_S_io_reauthenticate): Loop while make_sock_user errors with EINTR. * pfinet/io-ops.c (S_io_reauthenticate): Likewise.
* libfshelp-tests: Fix cross-linkSamuel Thibault2020-01-011-2/+2
| | | | | * libfshelp-tests/Makefile (HURDLIBS): Add ihash and shouldbeinlibc. (race locks): Add ../libihash/libihash.a.
* password: Drop unused -lcryptSamuel Thibault2020-01-011-1/+0
| | | | * trans/Makefile (password-LDLIBS): Remove -lcrypt
* libfshelp: Fix errno value leakSamuel Thibault2019-12-281-1/+4
| | | | | | | | When the last translator box contains a port to a died translator, we do not want to consider this as a whole failure. * libfshelp/translator-list.c (fshelp_get_active_translators): On mach_port_mod_refs failure, reset err to 0.