Commit Graph

8924 Commits

Author SHA1 Message Date
riastradh
3e23190f1c Get arguments in the right order for copyout. (Oops!) 2014-10-05 10:00:03 +00:00
riastradh
66f474049f Make uuidgen(2) generate v4 (random) uuids.
Rip out all the needless MAC address and date/time leakage.  No more
uuid_init necessary, nor contention over a global uuid state.

While here, simplify uuid_snprintf and fix a strict aliasing
violation.
2014-10-04 11:15:44 +00:00
hannken
b09a3a32e3 When creating a vnode with vcache_get() mark the vnode VI_CHANGING until
it is fully initialised.  It may be on the specnode list before it is
fully initialised and revoking it then would panic.

Should prevent the panic from PR kern/49171 (panic when closing a pty).
2014-10-03 14:45:38 +00:00
justin
86efea3a92 Work around pedantic compiler 2014-10-02 23:07:30 +00:00
christos
7c397b34ce remove casts to the same type. 2014-09-21 17:17:15 +00:00
matt
c3dcd587c0 Allow MD code to use something other than __cpu_simple_lock_t for doing spin
locks but use the same logic.

MUTEX_SPINBIT_LOCK_INIT
MUTEX_SPINBIT_LOCK_TRY
MUTEX_SPINBIT_LOCKED_P
MUTEX_SPINBIT_LOCK_UNLOCK
MUTEX_INITIALIZE_SPIN_IPL

For those platforms without sub-word CAS, you can use these to place the
mutex lock and ipl inside a full machine word and use CAS to update them.
2014-09-19 17:52:43 +00:00
joerg
83d5fa366c Replace random with cprng_fast32. Reorganise computation to replace
(32bit) division with (long) multiplication.
2014-09-08 22:01:24 +00:00
matt
45b1ec740d Try not to use f_data, use f_{vnode,socket,pipe,mqueue,kqueue,ksem} to get
a correctly typed pointer.
2014-09-05 09:20:59 +00:00
matt
0d71dac81d Missed a C++ keyword (DEBUG case) 2014-09-05 06:50:58 +00:00
matt
a35d1a8c7c Don't next structure and enum definitions.
Don't use C++ keywords new, try, class, private, etc.
2014-09-05 05:57:21 +00:00
matt
3b59fcc025 Don't nest struct undo and change it to sem_undo_entry 2014-09-05 05:54:48 +00:00
matt
31ef76f127 Don't use catch as a varible name. 2014-09-05 05:33:39 +00:00
manu
8c40e8bcff Fix build with TFTPROOT option enabled 2014-08-26 09:38:54 +00:00
nonaka
61876aebbe fix typo. (s/MODULE_DEFAULT_AUTOLOAD/MODULAR_DEFAULT_AUTOLOAD/) 2014-08-24 11:36:11 +00:00
jnemeth
ee79d5b0e4 Create an "options MODULAR_DEFAULT_AUTOLOAD" config option and add
it to all kernel configs that contain "options MODULAR".  This
option turns on module autoloading by default (which is the current
default).  This allows people who don't want module autoloading on
by default to disable it by simply removing/commentting this line.
2014-08-24 07:59:22 +00:00
pooka
71c14bfaa2 Change the meaning of the boolean parameter to domaininit().
was: attach route domain if found from domains link set
now: attach any domain which is found from domains link set

No functional change to monolithic kernel.  In a rump kernel, which
attaches networking domains "modularly", prevents domains from
accidentally leaking in via the link set in static linked scenarios.

Problem reported by cube, Tom Bousso, and the voices in my head.
2014-08-22 11:28:03 +00:00
chs
99a9d84aad eliminate COMPAT_OLDNOTE and just always recognize the old notes. 2014-08-17 23:03:58 +00:00
joerg
a26164117a Reorganize symbol table embedding. The existing option SYMTAB_SPACE is
replaced by the make option COPY_SYMTAB set to any value. The copy of
the symbol table is no longer put into a buffer in kern_ksyms.o, but a
small helper object. This object is build first with a dummy size, then
the kernel is linked to compute the real dimension of the symbol table
buffer. After that, the helper object is rebuild and the kernel linked
again.
2014-08-17 21:17:43 +00:00
apb
f498235332 Add COMPAT_70 to conf/files; add compat_70 to kern/syscalls.conf
and compat/netbsd32/syscalls.conf.
2014-08-16 17:24:28 +00:00
apb
5f48354283 If mutex_tryenter() fails, don't call mutex_exit(). 2014-08-15 11:05:35 +00:00
mrg
e1e8d3be37 avoid calling into time code when cold, and avoid calling nanotime()
if we're not going to use the result anyway.

XXX: not necessarily the best fix, but better than crashing *early*
boot due to too-early nanotime() calls.

XXX: pullup.
2014-08-15 07:39:25 +00:00
riastradh
b018e9788e Lock cprng->cs_lock around rndsink_request to avoid race with callback. 2014-08-14 16:28:30 +00:00
riastradh
7e616d7734 Defer cprng_fast_init until CPUs are detected. 2014-08-14 16:27:55 +00:00
riastradh
a580220047 done is not guaranteed to be aligned; don't *(uint32_t *) it. 2014-08-11 14:07:55 +00:00
riastradh
2270989b17 buf is not guaranteed to be aligned; don't *(uint32_t *) it. 2014-08-11 13:59:24 +00:00
riastradh
bd9701def7 Back out tls-earlyentropy's rnd_add_data.
This caused recursion on rndpool_mtx when called from an rndsource's
callback.

XXX The old and new code here is a minefield demanding another
rototill.

XXX rnd_source_anonymous was not actually used before, and still is
not used now, to be cleaned up later.
2014-08-11 04:26:53 +00:00
jnemeth
3481529578 Add the infrastructure for MODULAR support for Xen kernels. At
the moment, this can only load very simple modules due to missing
symbols.  It is being add at this time to make pullups to the
netbsd-7 branch easier.  It is not enabled by default in any kernels.
2014-08-11 03:43:25 +00:00
joerg
295896705b Needs sys/atomic.h. Only define rnd_skew when it is used. 2014-08-10 18:33:41 +00:00
tls
ea6af427bd Merge tls-earlyentropy branch into HEAD. 2014-08-10 16:44:32 +00:00
gson
20b11a7262 Remove the code to allow CTLTYPE_INT and CTLTYPE_QUAD to be read and
written as either 4 or 8 byte values regardless of the type, in
accordance with "Core statement on sysctl 32-bit/64-bit changes",
http://mail-index.netbsd.org/tech-kern/2014/03/26/msg016779.html.
2014-08-09 07:05:42 +00:00
rtr
8cf67cc6d5 split PRU_CONNECT2 & PRU_PURGEIF function out of pr_generic() usrreq
switches and put into separate functions

  - always KASSERT(solocked(so)) even if not implemented
    (for PRU_CONNECT2 only)

  - replace calls to pr_generic() with req = PRU_CONNECT2 with calls to
    pr_connect2()

  - replace calls to pr_generic() with req = PRU_PURGEIF with calls to
    pr_purgeif()

put common code from unp_connect2() (used by unp_connect() into
unp_connect1() and call out to it when needed

patch only briefly reviewed by rmind@
2014-08-09 05:33:00 +00:00
rtr
822872eada split PRU_RCVD function out of pr_generic() usrreq switches and put into
separate functions

  - always KASSERT(solocked(so)) even if not implemented

  - replace calls to pr_generic() with req = PRU_RCVD with calls to
    pr_rcvd()
2014-08-08 03:05:44 +00:00
rtr
1e7c4c7b77 actually use the passed in struct lwp *l instead of curlwp in unp_connect() 2014-08-05 08:52:10 +00:00
rtr
651e5bd3f8 split PRU_SEND function out of pr_generic() usrreq switches and put into
separate functions

   xxx_send(struct socket *, struct mbuf *, struct mbuf *,
       struct mbuf *, struct lwp *)

  - always KASSERT(solocked(so)) even if not implemented

  - replace calls to pr_generic() with req = PRU_SEND with calls to
    pr_send()

rename existing functions that operate on PCB for consistency (and to
free up their names for xxx_send() PRUs

  - l2cap_send() -> l2cap_send_pcb()
  - sco_send() -> sco_send_pcb()
  - rfcomm_send() -> rfcomm_send_pcb()

patch reviewed by rmind
2014-08-05 07:55:31 +00:00
rtr
ce6a5ff64f revert the removal of struct lwp * parameter from bind, listen and connect
user requests.

this should resolve the issue relating to nfs client hangs presented
recently by wiz on current-users@
2014-08-05 05:24:26 +00:00
wiz
87561671c1 defintion -> definition 2014-08-03 19:14:24 +00:00
apb
7f8e46d66a BUILDINFO part 2: expose sysctl kern.buildinfo 2014-08-03 09:15:21 +00:00
mrg
332faa4f02 call ->pr_abort(so) now instead of generic PRU_ABORT.
fixes kern/49056, and appears to remove the only missed PRU_ABORT call.
2014-07-31 20:28:59 +00:00
rtr
a6b73d7819 * remove declarations of unp_bind, unp_discard, unp_disconnect1, unp_drop,
unp_shutdown1, unp_internalize and unp_output functions from sys/un.h
  and  instead declare them as static in uipc_usrreq.c with prototype
  declarations as necessary.

* remove struct lwp * parameter from unp_output() while here and just
  use curlwp instead.

as discussed with rmind
2014-07-31 14:12:57 +00:00
rtr
892163b8e9 split PRU_DISCONNECT, PRU_SHUTDOWN and PRU_ABORT function out of
pr_generic() usrreq switches and put into separate functions

   xxx_disconnect(struct socket *)
   xxx_shutdown(struct socket *)
   xxx_abort(struct socket *)

   - always KASSERT(solocked(so)) even if not implemented
   - replace calls to pr_generic() with req =
PRU_{DISCONNECT,SHUTDOWN,ABORT}
     with calls to pr_{disconnect,shutdown,abort}() respectively

rename existing internal functions used to implement above functionality
to permit use of the names for xxx_{disconnect,shutdown,abort}().

   - {l2cap,sco,rfcomm}_disconnect() ->
{l2cap,sco,rfcomm}_disconnect_pcb()
   - {unp,rip,tcp}_disconnect() -> {unp,rip,tcp}_disconnect1()
   - unp_shutdown() -> unp_shutdown1()

patch reviewed by rmind
2014-07-31 03:39:35 +00:00
rtr
ad6ae402db split PRU_CONNECT function out of pr_generic() usrreq switches and put
into seaparate functions

  xxx_listen(struct socket *, struct mbuf *)

  - always KASSERT(solocked(so)) and KASSERT(nam != NULL)
  - replace calls to pr_generic() with req = PRU_CONNECT with
    pr_connect()
  - rename existin {l2cap,sco,rfcomm}_connect() to
    {l2cap,sco,rfcomm}_connect_pcb() respectively to permit
    naming consistency with other protocols functions.
  - drop struct lwp * parameter from unp_connect() and at_pcbconnect()
    and use curlwp instead where appropriate.

patch reviewed by rmind
2014-07-30 10:04:25 +00:00
ozaki-r
eb39a9c3b5 Fix typo in comment 2014-07-30 07:44:00 +00:00
maxv
382770f2eb 'result' -> 'error' 2014-07-25 16:28:12 +00:00
dholland
53d9b9366b typo in comment 2014-07-25 08:30:10 +00:00
dholland
0facca34ba Regen for fdiscard and posix_fallocate. 2014-07-25 08:27:35 +00:00
dholland
738b7a54cf Add fdiscard and posix_fallocate syscalls. 2014-07-25 08:25:47 +00:00
dholland
0233554e35 Regen for VOP_FALLOCATE/VOP_FDISCARD. 2014-07-25 08:18:50 +00:00
dholland
842f3a34a8 Add VOP_FALLOCATE and VOP_FDISCARD. 2014-07-25 08:16:47 +00:00
dholland
f9228f4225 Add d_discard to all struct cdevsw instances I could find.
All have been set to "nodiscard"; some should get a real implementation.
2014-07-25 08:10:31 +00:00
dholland
47cbdc3670 Add d_discard to struct bdevsw/cdevsw, and the plumbing to access it.
Unfortunately we need d_discard in both since we need to be able to
discard from both the block and character forms of disks. I'm
increasingly thinking it would be better to restructure the ops
dispatching so each type of device (ttys, disks, tapes, etc.) has its
own function table. Then we wouldn't need to change every tty driver
to add a disk op.
2014-07-25 07:56:14 +00:00