mirror of
https://git.rtems.org/rtems-libbsd/
synced 2025-10-14 07:59:07 +08:00
Update to FreeBSD head 2018-04-01
Git mirror commit 8dfb1ccc26d1cea7e2529303003ff61f9f1784c4. Update #3472.
This commit is contained in:
@@ -89,6 +89,7 @@ __FBSDID("$FreeBSD$");
|
||||
|
||||
#include <vm/vm.h>
|
||||
#include <vm/vm_param.h>
|
||||
#include <vm/vm_extern.h>
|
||||
#include <vm/pmap.h>
|
||||
#include <vm/vm_map.h>
|
||||
#include <sys/copyright.h>
|
||||
@@ -579,7 +580,7 @@ proc0_init(void *dummy __unused)
|
||||
p->p_limit->pl_rlimit[RLIMIT_STACK].rlim_cur = dflssiz;
|
||||
p->p_limit->pl_rlimit[RLIMIT_STACK].rlim_max = maxssiz;
|
||||
/* Cast to avoid overflow on i386/PAE. */
|
||||
pageablemem = ptoa((vm_paddr_t)vm_cnt.v_free_count);
|
||||
pageablemem = ptoa((vm_paddr_t)vm_free_count());
|
||||
p->p_limit->pl_rlimit[RLIMIT_RSS].rlim_cur =
|
||||
p->p_limit->pl_rlimit[RLIMIT_RSS].rlim_max = pageablemem;
|
||||
p->p_limit->pl_rlimit[RLIMIT_MEMLOCK].rlim_cur = pageablemem / 3;
|
||||
@@ -726,10 +727,6 @@ start_init(void *dummy)
|
||||
struct thread *td;
|
||||
struct proc *p;
|
||||
|
||||
mtx_lock(&Giant);
|
||||
|
||||
GIANT_REQUIRED;
|
||||
|
||||
TSENTER(); /* Here so we don't overlap with mi_startup. */
|
||||
|
||||
td = curthread;
|
||||
@@ -824,7 +821,6 @@ start_init(void *dummy)
|
||||
* to user mode as init!
|
||||
*/
|
||||
if ((error = sys_execve(td, &args)) == EJUSTRETURN) {
|
||||
mtx_unlock(&Giant);
|
||||
TSEXIT();
|
||||
return;
|
||||
}
|
||||
|
@@ -215,7 +215,7 @@ sysctl_hw_usermem(SYSCTL_HANDLER_ARGS)
|
||||
{
|
||||
u_long val;
|
||||
|
||||
val = ctob(physmem - vm_cnt.v_wire_count);
|
||||
val = ctob(physmem - vm_wire_count());
|
||||
return (sysctl_handle_long(oidp, &val, 0, req));
|
||||
}
|
||||
|
||||
|
@@ -141,7 +141,11 @@ _sleep(void *ident, struct lock_object *lock, int priority,
|
||||
struct thread *td;
|
||||
struct lock_class *class;
|
||||
uintptr_t lock_state;
|
||||
#ifndef __rtems__
|
||||
int catch, pri, rval, sleepq_flags;
|
||||
#else /* __rtems__ */
|
||||
int pri, rval, sleepq_flags;
|
||||
#endif /* __rtems__ */
|
||||
WITNESS_SAVE_DECL(lock_witness);
|
||||
|
||||
td = curthread;
|
||||
@@ -174,7 +178,6 @@ _sleep(void *ident, struct lock_object *lock, int priority,
|
||||
catch = priority & PCATCH;
|
||||
pri = priority & PRIMASK;
|
||||
#else /* __rtems__ */
|
||||
(void)catch;
|
||||
pri = priority;
|
||||
#endif /* __rtems__ */
|
||||
|
||||
@@ -322,16 +325,16 @@ msleep_spin_sbt(void *ident, struct mtx *mtx, const char *wmesg,
|
||||
#endif /* __rtems__ */
|
||||
|
||||
/*
|
||||
* pause() delays the calling thread by the given number of system ticks.
|
||||
* During cold bootup, pause() uses the DELAY() function instead of
|
||||
* the tsleep() function to do the waiting. The "timo" argument must be
|
||||
* greater than or equal to zero. A "timo" value of zero is equivalent
|
||||
* to a "timo" value of one.
|
||||
* pause_sbt() delays the calling thread by the given signed binary
|
||||
* time. During cold bootup, pause_sbt() uses the DELAY() function
|
||||
* instead of the _sleep() function to do the waiting. The "sbt"
|
||||
* argument must be greater than or equal to zero. A "sbt" value of
|
||||
* zero is equivalent to a "sbt" value of one tick.
|
||||
*/
|
||||
int
|
||||
pause_sbt(const char *wmesg, sbintime_t sbt, sbintime_t pr, int flags)
|
||||
{
|
||||
KASSERT(sbt >= 0, ("pause: timeout must be >= 0"));
|
||||
KASSERT(sbt >= 0, ("pause_sbt: timeout must be >= 0"));
|
||||
|
||||
/* silently convert invalid timeouts */
|
||||
if (sbt == 0)
|
||||
@@ -352,10 +355,13 @@ pause_sbt(const char *wmesg, sbintime_t sbt, sbintime_t pr, int flags)
|
||||
sbt = howmany(sbt, SBT_1US);
|
||||
if (sbt > 0)
|
||||
DELAY(sbt);
|
||||
return (0);
|
||||
return (EWOULDBLOCK);
|
||||
}
|
||||
#endif /* __rtems__ */
|
||||
return (_sleep(&pause_wchan[curcpu], NULL,
|
||||
(flags & C_CATCH) ? PCATCH : 0, wmesg, sbt, pr, flags));
|
||||
#else /* __rtems__ */
|
||||
return (_sleep(&pause_wchan[curcpu], NULL, 0, wmesg, sbt, pr, flags));
|
||||
#endif /* __rtems__ */
|
||||
}
|
||||
|
||||
/*
|
||||
|
@@ -193,7 +193,7 @@ sysctl_load_tunable_by_oid_locked(struct sysctl_oid *oidp)
|
||||
struct sysctl_req req;
|
||||
struct sysctl_oid *curr;
|
||||
char *penv = NULL;
|
||||
char path[64];
|
||||
char path[96];
|
||||
ssize_t rem = sizeof(path);
|
||||
ssize_t len;
|
||||
uint8_t val_8;
|
||||
|
@@ -576,7 +576,8 @@ kern_clock_nanosleep(struct thread *td, clockid_t clock_id, int flags,
|
||||
} while (error == 0 && is_abs_real && td->td_rtcgen == 0);
|
||||
td->td_rtcgen = 0;
|
||||
if (error != EWOULDBLOCK) {
|
||||
TIMESEL(&sbtt, tmp);
|
||||
if (TIMESEL(&sbtt, tmp))
|
||||
sbtt += tc_tick_sbt;
|
||||
if (sbtt >= sbt)
|
||||
return (0);
|
||||
if (error == ERESTART)
|
||||
|
@@ -92,9 +92,10 @@ eventhandler_find_or_create_list(const char *name)
|
||||
CTR2(KTR_EVH, "%s: creating list \"%s\"", __func__, name);
|
||||
list = new_list;
|
||||
TAILQ_INIT(&list->el_entries);
|
||||
mtx_init(&list->el_lock, name, "eventhandler list", MTX_DEF);
|
||||
list->el_name = (char *)(list + 1);
|
||||
strcpy(list->el_name, name);
|
||||
mtx_init(&list->el_lock, list->el_name, "eventhandler list",
|
||||
MTX_DEF);
|
||||
TAILQ_INSERT_HEAD(&eventhandler_lists, list, el_link);
|
||||
}
|
||||
}
|
||||
|
@@ -155,7 +155,7 @@ pcpu_zones_startup(void)
|
||||
pcpu_zone_ptr = uma_zcreate("ptr pcpu", sizeof(void *),
|
||||
NULL, NULL, NULL, NULL, UMA_ALIGN_PTR, UMA_ZONE_PCPU);
|
||||
}
|
||||
SYSINIT(pcpu_zones, SI_SUB_KMEM, SI_ORDER_ANY, pcpu_zones_startup, NULL);
|
||||
SYSINIT(pcpu_zones, SI_SUB_VM, SI_ORDER_ANY, pcpu_zones_startup, NULL);
|
||||
|
||||
#ifndef __rtems__
|
||||
/*
|
||||
|
@@ -1403,7 +1403,7 @@ void
|
||||
sleepq_chains_remove_matching(bool (*matches)(struct thread *))
|
||||
{
|
||||
struct sleepqueue_chain *sc;
|
||||
struct sleepqueue *sq;
|
||||
struct sleepqueue *sq, *sq1;
|
||||
int i, wakeup_swapper;
|
||||
|
||||
wakeup_swapper = 0;
|
||||
@@ -1412,7 +1412,7 @@ sleepq_chains_remove_matching(bool (*matches)(struct thread *))
|
||||
continue;
|
||||
}
|
||||
mtx_lock_spin(&sc->sc_lock);
|
||||
LIST_FOREACH(sq, &sc->sc_queues, sq_hash) {
|
||||
LIST_FOREACH_SAFE(sq, &sc->sc_queues, sq_hash, sq1) {
|
||||
for (i = 0; i < NR_SLEEPQS; ++i) {
|
||||
wakeup_swapper |= sleepq_remove_matching(sq, i,
|
||||
matches, 0);
|
||||
|
@@ -524,8 +524,8 @@ copyout_unmap(struct thread *td, vm_offset_t addr, size_t sz)
|
||||
/*
|
||||
* XXXKIB The temporal implementation of fue*() functions which do not
|
||||
* handle usermode -1 properly, mixing it with the fault code. Keep
|
||||
* this until MD code is written. Currently sparc64 and mips do not
|
||||
* have proper implementation.
|
||||
* this until MD code is written. Currently sparc64 does not have a
|
||||
* proper implementation.
|
||||
*/
|
||||
|
||||
int
|
||||
|
@@ -218,7 +218,7 @@ sys_read(td, uap)
|
||||
auio.uio_resid = uap->nbyte;
|
||||
auio.uio_segflg = UIO_USERSPACE;
|
||||
error = kern_readv(td, uap->fd, &auio);
|
||||
return(error);
|
||||
return (error);
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -381,7 +381,7 @@ dofileread(td, fd, fp, auio, offset, flags)
|
||||
/* Finish zero length reads right here */
|
||||
if (auio->uio_resid == 0) {
|
||||
td->td_retval[0] = 0;
|
||||
return(0);
|
||||
return (0);
|
||||
}
|
||||
auio->uio_rw = UIO_READ;
|
||||
auio->uio_offset = offset;
|
||||
@@ -432,7 +432,7 @@ sys_write(td, uap)
|
||||
auio.uio_resid = uap->nbyte;
|
||||
auio.uio_segflg = UIO_USERSPACE;
|
||||
error = kern_writev(td, uap->fd, &auio);
|
||||
return(error);
|
||||
return (error);
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -471,7 +471,7 @@ kern_pwrite(struct thread *td, int fd, const void *buf, size_t nbyte,
|
||||
auio.uio_resid = nbyte;
|
||||
auio.uio_segflg = UIO_USERSPACE;
|
||||
error = kern_pwritev(td, fd, &auio, offset);
|
||||
return(error);
|
||||
return (error);
|
||||
}
|
||||
|
||||
#if defined(COMPAT_FREEBSD6)
|
||||
|
@@ -60,6 +60,7 @@ __FBSDID("$FreeBSD$");
|
||||
#include <sys/socket.h>
|
||||
#include <sys/socketvar.h>
|
||||
#include <sys/syscallsubr.h>
|
||||
#include <sys/uio.h>
|
||||
#ifdef KTRACE
|
||||
#include <sys/ktrace.h>
|
||||
#endif
|
||||
|
Reference in New Issue
Block a user