Commit Graph

1216 Commits

Author SHA1 Message Date
hannken
e2f2c94b67 Move vnode member v_lock as vi_lock to vnode_impl.h. 2017-01-11 09:08:58 +00:00
hannken
998709c439 Rename vget() to vcache_vget() and vcache_tryvget() respectively and
move the definitions to sys/vnode_impl.h.

No functional change intended.

Welcome to 7.99.54
2017-01-02 10:33:28 +00:00
nat
f1631e52a4 Add functions to access device flags. This restores simultaneous audio
open/close.

OK hannken@ christos@
2016-12-09 19:13:47 +00:00
nat
82924a36bf The audio sub-system now supports the following features as
posted to tech-kern:

    * Simultaneous playback and mixing of multiple streams
    * Playback streams can be of different encoding, frequency, precision
      and number of channels
    * Simultaneous recording to different formats
    * One audio device per process
    * Sysctls to set the common format frequency, precision and channels
    * Independent mixer controls for recording/playback per stream
    * Utilizes little cpu time for multiple streams / good performance
    * Compatible with existing programs that use OSS/NetBSD audio
    * Changes to audioctl(1) to allow specifying process id for corresponding
      audio device
2016-12-08 10:28:44 +00:00
kre
75973081c3 Return the "true" parent's pid as the parent pid (ppid) via the
various sysctl/procfs interfaces that allow it to be interrogated.
(This is rather than the temporary parent's pid when a process is
being traced and has been reparented.)

XXX The ppid in elf32 core files has not been similarly adjusted,
XXX Should it be ?
2016-11-14 08:55:51 +00:00
pgoyette
15de9b6038 Module procfs needs ptrace_common for process_do{,fp}regs 2016-11-03 03:53:32 +00:00
pgoyette
a60b99094c * Split sys/kern/sys_process.c into three parts:
1 - ptrace(2) syscall for native emulation
        2 - common ptrace(2) syscall code (shared with compat_netbsd32)
        3 - support routines that are shared with PROCFS and/or KTRACE

* Add module glue for #1 and #2.  Both modules will be built-in to the
  kernel if "options PTRACE" is included in the config file (this is
  the default, defined in sys/conf/std).

* Mark the ptrace(2) syscall as modular in syscalls.master (generated
  files will be committed shortly).

* Conditionalize all remaining portions of PTRACE code on a new kernel
  option PTRACE_HOOKS.

XXX Instead of PROCFS depending on 'options PTRACE', we should probably
    just add a procfs attribute to the sys/kern/sys_process.c file's
    entry in files.kern, and add PROCFS to the "#if defineds" for
    process_domem().  It's really confusing to have two different ways
    of requiring this file.
2016-11-02 00:11:59 +00:00
christos
600f58d691 don't change the loop counts; noted by mrg@ 2016-09-29 19:08:48 +00:00
christos
d18e278dd0 Allow sparc kernels to build with SSP by using a constant PAGE_SIZE... 2016-09-29 18:47:35 +00:00
pgoyette
7dfb5aa5af Revert rev 1.164. This will be redone differently (using "dummy"
modules).

This implementation requires changes to a base kernel in order to
update the set of "special" modules, kinda defeating the purpose of
having modules in the first place.  The new method will use dummy
modules (with name tap and tun) which will depend on the real
modules with the if_ prefix.

Coming soon to a NetBSD near you.
2016-09-08 08:45:52 +00:00
pgoyette
75d5796c6e if_config processing wants to auto-load modules named with an if_ prefix,
while specfc wants to auto-load modules without the prefix.  For modules
which can be loaded both ways (ie, if_tap and if_tun), provide a simple
conversion table for specfs so it can auto-load the if_ module.

This table should always be quite small, and the auto-load operation is
relatively infrequent, so the additional overhead of comparing names should
be tolerable.
2016-09-08 00:07:48 +00:00
hannken
7139aab724 Remove now obsolete operation vcache_remove().
Welcome to 7.99.36
2016-08-20 12:37:06 +00:00
christos
4fbdf206cb Split p_xstat (composite wait(2) status code, or signal number depending
on context) into:
1. p_xexit:		exit code
2. p_xsig:		signal number
3. p_sflag & WCOREFLAG	bit to indicated that the process core-dumped.

Fix the documentation of the flag bits in <sys/proc.h>
2016-04-04 20:47:57 +00:00
hannken
1c27fb53ee Avoid a race with spec_revoke for the assertion too.
Final fix for PR kern/50467 Panic from disconnecting phone while reading
its contents
2016-04-04 08:03:53 +00:00
mlelstv
3bb28e76f8 Align /proc/<pid>/statm data with /proc/<pid>/stat and
provide RSS information. There is no data about shared
pages.

Helps PR 50801.
2016-03-28 17:23:47 +00:00
hannken
d222105946 Whhen spec_strategy() extracts v_rdev take care to avoid a
race with spec_revoke.

Fixes PR kern/50467 Panic from disconnecting phone while reading its contents
2016-03-26 14:58:13 +00:00
pgoyette
64f5396545 Fix a couple of checks for kernel vm_space, and convert the 'naked
panic" code to KASSERT/KASSERTMSG.

Thanks,  Taylor!
2016-01-05 09:07:19 +00:00
pgoyette
69c1560ae5 Revert previous 2015-12-23 00:13:57 +00:00
pgoyette
3139a51881 If we attempt to autoload a driver module, make sure we return an error
if it fails.  Otherwise we might end up calling a builtin-but-disabled
driver module and that can generate all sorts of issues...
2015-12-22 23:54:37 +00:00
christos
8d10f96266 Replace DIOCGPART -> DIOCGPARTINFO which returns the data needed instead of
pointers.
2015-12-08 20:36:14 +00:00
christos
317f295fe6 unfortunately it is not that easy to get rid of DIOCGPART. DTRT for the
raw partition and print a warning if we overflowed. I guess the right solution
for this is to create yet another version of disklabel that is 64 bit friendly.
2015-12-08 01:57:13 +00:00
jnemeth
0a6f855e11 messing with uninitialized structs is a bad thing 2015-12-05 07:59:34 +00:00
christos
0f40b4d84e Use DIOCGMEDIASIZE instead of DIOCGPART so that we are not limited to 2G.
XXX: All DIOCGPART code needs to be removed...
XXX: pullup-7
2015-12-04 23:54:06 +00:00
maxv
6647020bbc Unused inits (harmless).
Found by Brainy.
2015-07-24 13:02:52 +00:00
hannken
418d71fb1c Unfortunately MFS uses v_data of its anonymous device vnode so
it cannot be used as vcache key.  Use v_interlock as key ...
2015-07-01 08:13:52 +00:00
hannken
af0e5d04e4 Redo previous again, v_specnode is invariant but not unique.
Set "vp->v_data = vp" and use v_data as key.
2015-06-30 06:19:21 +00:00
hannken
c6ee9f5027 Use the address of vp->v_specnode as vcache key. It is invariant
over the lifetime of the vnode.

The previous worked by luck, it took the first sizeof(void *) bytes
of struct vnode as key.

Resolves CID 1308957: wrong sizeof()
2015-06-29 16:48:20 +00:00
christos
3c9a847ffa Revert previous, and explain why. 2015-06-29 16:25:49 +00:00
christos
f42b0aee93 CID 1308957: Fix wrong sizeof() 2015-06-29 15:39:40 +00:00
hannken
4e19d4c756 Add a vfs_newvnode() method to deadfs and use it to create
anonymous device vnodes with bdevvp() and cdevvp().

Implement spec_inactive() and spec_reclaim() to handle these nodes.
2015-06-23 10:42:34 +00:00
hannken
142e4ca539 Use VFS_PROTOS() for deadfs. Rename dead_mount to dead_rootmount. 2015-06-23 10:41:59 +00:00
hannken
e10a32f7f7 Remove miscfs/syncfs and
- move the syncer into kern/vfs_subr.c.

- change the syncer to process the mountlist and VFS_SYNC as appropriate.

- use an API for mount points similiar to the API for vnodes:
  - vfs_syncer_add_to_worklist(struct mount *mp) to add
  - vfs_syncer_remove_from_worklist(struct mount *mp) to remove a mount.

No objections on tech-kern@
2015-05-06 15:57:07 +00:00
riastradh
f9534e4daa Uncomment the argument struct declarations in deadfs.
We don't actually use them, but this is the only way the vop
versioning mechanism flags code that needs changing.
2015-04-20 23:30:58 +00:00
riastradh
46e71c7d57 Make VOP_LINK return directory still locked and referenced.
Ride 7.99.10 bump.
2015-04-20 22:59:19 +00:00
riastradh
944fbd0d8b Cull unused vnode v_iflags: VI_LAYER, VI_LOCKSHARE. 2015-04-20 19:36:55 +00:00
riastradh
f6139440c5 Make vget always return vnode unlocked.
Convert callers who want locks to use vn_lock afterward.

Add extra argument so the compiler will report stragglers.
2015-04-20 13:44:16 +00:00
skrll
61497d42a7 Fix UVMHIST build. 2015-04-12 14:44:06 +00:00
riastradh
2b81644cbd Pull VOP_BMAP/VOP_STRATEGY loop from getpages into its own function.
No functional change.

In preparation for a gop_read like the existing gop_write.
2015-04-10 13:02:15 +00:00
maxv
6e39240181 Remove the 'cred' argument from bread(). Remove a now unused var in
ffs_snapshot.c. Update the man page accordingly.

ok hannken@
2015-03-28 19:24:04 +00:00
maxv
fcc99ce60e Do not uselessly include <sys/malloc.h>. 2014-11-10 18:46:33 +00:00
maxv
65896a5125 Do not uselessly include <sys/malloc.h>. 2014-11-09 18:08:06 +00:00
christos
0726b418be Maps don't change that frequently between reads, so don't give up and
do what linux does (support reading from an offset).
2014-10-17 20:49:22 +00:00
uebayasi
f62ed0e5b2 Define layerfs as an attribute. 2014-10-12 03:52:30 +00:00
uebayasi
fe9a32c84e Define filesystem attributes with vfs dependency. 2014-10-11 06:42:18 +00:00
christos
ed3aac3c8a The comment about toxicity was correct, restore VNON setting code and
then set the proper type in lookup.
2014-09-05 10:43:26 +00:00
matt
82ef6ef7b8 Try not to use f_data, use f_{vnode,socket,pipe,mqueue,kqueue,ksem} to get
a correctly typed pointer.
2014-09-05 09:26:16 +00:00
christos
13ff413336 remove debugging. 2014-09-04 13:29:50 +00:00
christos
e6cf6fbd0d Well, nasty thing happen if you set /dev/tty to VNON too. Disable for now. 2014-09-04 13:28:54 +00:00
christos
5a2111928b Fix type of /dev/tty 2014-09-04 00:30:25 +00:00
maxv
83fce8c371 1) 'error' is returned while it does not even hold an error code. Which
means that zero is returned, and the kernel keeps mounting (and it
   probably ends up in a deadlock/memory corruption somewhere).
2) 'nentries' and 'gnentries' are int and user-controlled, and there's no
   check to ensure they are greater than zero. Since they are used to
   compute the size of two copyin's, a user can control the copied size
   by giving a negative value (like 128-2^29), and thus overwrite kernel
   memory.

Both triggerable from root only.
2014-08-11 14:02:14 +00:00