PERFORCE change 62674 for review
John Baldwin
jhb at FreeBSD.org
Tue Oct 5 12:16:07 PDT 2004
http://perforce.freebsd.org/chv.cgi?CH=62674
Change 62674 by jhb at jhb_slimer on 2004/10/05 19:15:26
IFC @62673. Loop back rusage_ext changes.
Affected files ...
.. //depot/projects/smpng/sys/alpha/alpha/pmap.c#65 integrate
.. //depot/projects/smpng/sys/alpha/osf1/osf1_misc.c#31 integrate
.. //depot/projects/smpng/sys/amd64/amd64/pmap.c#36 integrate
.. //depot/projects/smpng/sys/amd64/linux32/linux32_machdep.c#4 integrate
.. //depot/projects/smpng/sys/arm/conf/IQ31244#2 integrate
.. //depot/projects/smpng/sys/arm/include/endian.h#5 integrate
.. //depot/projects/smpng/sys/boot/alpha/common/help.alpha#2 integrate
.. //depot/projects/smpng/sys/boot/common/bcache.c#6 integrate
.. //depot/projects/smpng/sys/boot/common/help.common#15 integrate
.. //depot/projects/smpng/sys/boot/forth/loader.conf#30 integrate
.. //depot/projects/smpng/sys/cam/cam_periph.h#4 integrate
.. //depot/projects/smpng/sys/cam/cam_xpt.c#22 integrate
.. //depot/projects/smpng/sys/compat/freebsd32/freebsd32_misc.c#11 integrate
.. //depot/projects/smpng/sys/compat/linux/linux_misc.c#50 integrate
.. //depot/projects/smpng/sys/compat/svr4/svr4_misc.c#34 integrate
.. //depot/projects/smpng/sys/conf/NOTES#83 integrate
.. //depot/projects/smpng/sys/dev/cy/cy.c#6 integrate
.. //depot/projects/smpng/sys/dev/fdc/fdc_isa.c#7 integrate
.. //depot/projects/smpng/sys/dev/pst/pst-iop.c#5 integrate
.. //depot/projects/smpng/sys/dev/pst/pst-iop.h#5 integrate
.. //depot/projects/smpng/sys/dev/rp/rp.c#18 integrate
.. //depot/projects/smpng/sys/dev/rp/rpvar.h#4 integrate
.. //depot/projects/smpng/sys/dev/si/si.c#18 integrate
.. //depot/projects/smpng/sys/dev/si/si.h#4 integrate
.. //depot/projects/smpng/sys/dev/si/sivar.h#2 integrate
.. //depot/projects/smpng/sys/dev/usb/ugen.c#28 integrate
.. //depot/projects/smpng/sys/dev/usb/uhci.c#33 integrate
.. //depot/projects/smpng/sys/dev/usb/umct.c#8 integrate
.. //depot/projects/smpng/sys/dev/usb/uplcom.c#15 integrate
.. //depot/projects/smpng/sys/dev/usb/usbdevs#63 integrate
.. //depot/projects/smpng/sys/fs/procfs/procfs_status.c#20 integrate
.. //depot/projects/smpng/sys/fs/unionfs/union.h#9 integrate
.. //depot/projects/smpng/sys/fs/unionfs/union_vfsops.c#21 integrate
.. //depot/projects/smpng/sys/fs/unionfs/union_vnops.c#17 integrate
.. //depot/projects/smpng/sys/geom/gate/g_gate.c#7 integrate
.. //depot/projects/smpng/sys/geom/mirror/g_mirror.c#8 integrate
.. //depot/projects/smpng/sys/geom/vinum/geom_vinum.c#8 integrate
.. //depot/projects/smpng/sys/geom/vinum/geom_vinum_share.c#3 integrate
.. //depot/projects/smpng/sys/geom/vinum/geom_vinum_subr.c#8 integrate
.. //depot/projects/smpng/sys/i386/i386/autoconf.c#20 integrate
.. //depot/projects/smpng/sys/i386/i386/pmap.c#74 integrate
.. //depot/projects/smpng/sys/ia64/ia64/pmap.c#64 integrate
.. //depot/projects/smpng/sys/kern/init_main.c#49 integrate
.. //depot/projects/smpng/sys/kern/kern_acct.c#34 integrate
.. //depot/projects/smpng/sys/kern/kern_clock.c#37 integrate
.. //depot/projects/smpng/sys/kern/kern_descrip.c#66 integrate
.. //depot/projects/smpng/sys/kern/kern_exit.c#86 integrate
.. //depot/projects/smpng/sys/kern/kern_proc.c#67 integrate
.. //depot/projects/smpng/sys/kern/kern_resource.c#52 integrate
.. //depot/projects/smpng/sys/kern/kern_shutdown.c#50 integrate
.. //depot/projects/smpng/sys/kern/kern_sig.c#98 integrate
.. //depot/projects/smpng/sys/kern/kern_synch.c#82 integrate
.. //depot/projects/smpng/sys/kern/kern_thread.c#69 integrate
.. //depot/projects/smpng/sys/kern/kern_time.c#29 integrate
.. //depot/projects/smpng/sys/kern/subr_taskqueue.c#21 integrate
.. //depot/projects/smpng/sys/kern/subr_trap.c#72 integrate
.. //depot/projects/smpng/sys/kern/subr_turnstile.c#16 integrate
.. //depot/projects/smpng/sys/kern/tty.c#49 integrate
.. //depot/projects/smpng/sys/kern/uipc_syscalls.c#59 integrate
.. //depot/projects/smpng/sys/kern/vfs_mount.c#35 integrate
.. //depot/projects/smpng/sys/libkern/arm/divsi3.S#2 integrate
.. //depot/projects/smpng/sys/netinet/ip_divert.c#38 integrate
.. //depot/projects/smpng/sys/netinet/ip_fw.h#24 integrate
.. //depot/projects/smpng/sys/netinet/ip_fw2.c#42 integrate
.. //depot/projects/smpng/sys/netinet/tcp_input.c#59 integrate
.. //depot/projects/smpng/sys/netinet/tcp_output.c#30 integrate
.. //depot/projects/smpng/sys/netinet/tcp_sack.c#3 integrate
.. //depot/projects/smpng/sys/netinet/tcp_subr.c#55 integrate
.. //depot/projects/smpng/sys/netinet/tcp_var.h#29 integrate
.. //depot/projects/smpng/sys/netinet6/ip6_output.c#36 integrate
.. //depot/projects/smpng/sys/netinet6/nd6.c#23 integrate
.. //depot/projects/smpng/sys/netipsec/key.c#14 integrate
.. //depot/projects/smpng/sys/pc98/pc98/sio_cbus.c#7 integrate
.. //depot/projects/smpng/sys/pci/agp_amd64.c#2 integrate
.. //depot/projects/smpng/sys/pci/if_dc.c#61 integrate
.. //depot/projects/smpng/sys/sys/_task.h#3 integrate
.. //depot/projects/smpng/sys/sys/interrupt.h#14 integrate
.. //depot/projects/smpng/sys/sys/proc.h#130 integrate
.. //depot/projects/smpng/sys/sys/resourcevar.h#23 integrate
.. //depot/projects/smpng/sys/sys/syscallsubr.h#11 integrate
.. //depot/projects/smpng/sys/sys/taskqueue.h#9 integrate
.. //depot/projects/smpng/sys/ufs/ffs/ffs_vfsops.c#60 integrate
Differences ...
==== //depot/projects/smpng/sys/alpha/alpha/pmap.c#65 (text+ko) ====
@@ -148,7 +148,7 @@
*/
#include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/alpha/alpha/pmap.c,v 1.171 2004/09/19 21:20:01 alc Exp $");
+__FBSDID("$FreeBSD: src/sys/alpha/alpha/pmap.c,v 1.173 2004/10/03 00:16:42 alc Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -1686,7 +1686,7 @@
}
origpte = *pte;
- pa = VM_PAGE_TO_PHYS(m) & ~PAGE_MASK;
+ pa = VM_PAGE_TO_PHYS(m);
managed = 0;
opa = pmap_pte_pa(pte);
@@ -1717,11 +1717,8 @@
*/
if (origpte & PG_MANAGED) {
if ((origpte & PG_FOW) != PG_FOW
- && pmap_track_modified(va)) {
- vm_page_t om;
- om = PHYS_TO_VM_PAGE(opa);
- vm_page_dirty(om);
- }
+ && pmap_track_modified(va))
+ vm_page_dirty(m);
}
managed = origpte & PG_MANAGED;
==== //depot/projects/smpng/sys/alpha/osf1/osf1_misc.c#31 (text+ko) ====
@@ -30,7 +30,7 @@
*/
#include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/alpha/osf1/osf1_misc.c,v 1.48 2004/08/24 20:21:21 jhb Exp $");
+__FBSDID("$FreeBSD: src/sys/alpha/osf1/osf1_misc.c,v 1.49 2004/10/05 18:51:09 jhb Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -1335,29 +1335,16 @@
struct thread *td;
struct osf1_getrusage_args *uap;
{
- struct proc *p;
- struct rusage *rup;
struct osf1_rusage oru;
+ struct rusage ru;
+ int error;
- p = td->td_proc;
- switch (uap->who) {
- case RUSAGE_SELF:
- rup = &p->p_stats->p_ru;
- mtx_lock_spin(&sched_lock);
- calcru(p, &rup->ru_utime, &rup->ru_stime, NULL);
- mtx_unlock_spin(&sched_lock);
- break;
-
- case RUSAGE_CHILDREN:
- rup = &p->p_stats->p_cru;
- break;
-
- default:
- return (EINVAL);
- }
- TV_CP(rup->ru_utime, oru.ru_utime);
- TV_CP(rup->ru_stime, oru.ru_stime);
- bcopy(&(rup->ru_first), &(oru.ru_first),
+ error = kern_getrusage(td, uap->who, &ru);
+ if (error)
+ return (error);
+ TV_CP(ru.ru_utime, oru.ru_utime);
+ TV_CP(ru.ru_stime, oru.ru_stime);
+ bcopy(&(ru.ru_first), &(oru.ru_first),
(&(oru.ru_last) - &(oru.ru_first)));
return (copyout((caddr_t)&oru, (caddr_t)uap->rusage,
@@ -1372,9 +1359,13 @@
{
int error, status;
struct osf1_rusage oru;
- struct rusage ru;
+ struct rusage ru, *rup;
- error = kern_wait(td, uap->pid, &status, uap->options, &ru);
+ if (uap->rusage != NULL)
+ rup = &ru;
+ else
+ rup = NULL;
+ error = kern_wait(td, uap->pid, &status, uap->options, rup);
if (error)
return (error);
if (uap->status != NULL)
==== //depot/projects/smpng/sys/amd64/amd64/pmap.c#36 (text+ko) ====
@@ -75,7 +75,7 @@
*/
#include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/amd64/amd64/pmap.c,v 1.503 2004/09/29 19:20:39 alc Exp $");
+__FBSDID("$FreeBSD: src/sys/amd64/amd64/pmap.c,v 1.507 2004/10/03 20:14:06 alc Exp $");
/*
* Manages physical address maps.
@@ -160,7 +160,6 @@
#endif
struct pmap kernel_pmap_store;
-LIST_HEAD(pmaplist, pmap);
vm_paddr_t avail_start; /* PA of first available physical page */
vm_paddr_t avail_end; /* PA of last available physical page */
@@ -1881,7 +1880,7 @@
if (pte == NULL)
panic("pmap_enter: invalid page directory va=%#lx\n", va);
- pa = VM_PAGE_TO_PHYS(m) & PG_FRAME;
+ pa = VM_PAGE_TO_PHYS(m);
origpte = *pte;
opa = origpte & PG_FRAME;
@@ -1922,11 +1921,8 @@
* so we go ahead and sense modify status.
*/
if (origpte & PG_MANAGED) {
- if ((origpte & PG_M) && pmap_track_modified(va)) {
- vm_page_t om;
- om = PHYS_TO_VM_PAGE(opa);
- vm_page_dirty(om);
- }
+ if ((origpte & PG_M) && pmap_track_modified(va))
+ vm_page_dirty(m);
pa |= PG_MANAGED;
}
goto validate;
@@ -1982,7 +1978,7 @@
*/
if ((origpte & ~(PG_M|PG_A)) != newpte) {
pte_store(pte, newpte | PG_A);
- /*if (origpte)*/ {
+ if (origpte) {
pmap_invalidate_page(pmap, va);
}
}
==== //depot/projects/smpng/sys/amd64/linux32/linux32_machdep.c#4 (text+ko) ====
@@ -29,7 +29,7 @@
*/
#include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/amd64/linux32/linux32_machdep.c,v 1.4 2004/09/01 02:11:27 julian Exp $");
+__FBSDID("$FreeBSD: src/sys/amd64/linux32/linux32_machdep.c,v 1.5 2004/10/05 18:51:10 jhb Exp $");
#include <sys/param.h>
#include <sys/kernel.h>
@@ -940,24 +940,14 @@
int
linux_getrusage(struct thread *td, struct linux_getrusage_args *uap)
{
+ struct l_rusage s32;
+ struct rusage s;
int error;
- caddr_t sg;
- struct l_rusage *p32, s32;
- struct rusage *p = NULL, s;
- p32 = uap->rusage;
- if (p32 != NULL) {
- sg = stackgap_init();
- p = stackgap_alloc(&sg, sizeof(struct rusage));
- uap->rusage = (struct l_rusage *)p;
- }
- error = getrusage(td, (struct getrusage_args *) uap);
+ error = kern_getrusage(td, uap->who, &s);
if (error != 0)
return (error);
- if (p32 != NULL) {
- error = copyin(p, &s, sizeof(s));
- if (error != 0)
- return (error);
+ if (uap->rusage != NULL) {
s32.ru_utime.tv_sec = s.ru_utime.tv_sec;
s32.ru_utime.tv_usec = s.ru_utime.tv_usec;
s32.ru_stime.tv_sec = s.ru_stime.tv_sec;
@@ -976,7 +966,7 @@
s32.ru_nsignals = s.ru_nsignals;
s32.ru_nvcsw = s.ru_nvcsw;
s32.ru_nivcsw = s.ru_nivcsw;
- error = copyout(&s32, p32, sizeof(s32));
+ error = copyout(&s32, uap->rusage, sizeof(s32));
}
return (error);
}
==== //depot/projects/smpng/sys/arm/conf/IQ31244#2 (text+ko) ====
@@ -15,7 +15,7 @@
# If you are in doubt as to the purpose or necessity of a line, check first
# in NOTES.
#
-# $FreeBSD: src/sys/arm/conf/IQ31244,v 1.1 2004/09/23 22:55:00 cognet Exp $
+# $FreeBSD: src/sys/arm/conf/IQ31244,v 1.2 2004/10/01 16:51:37 cognet Exp $
machine arm
ident IQ31244
@@ -83,7 +83,6 @@
# Debugging for use in -current
options KDB
options DDB #Enable the kernel debugger
-options MALLOC_PROFILE
#options INVARIANTS #Enable calls of extra sanity checking
#options INVARIANT_SUPPORT #Extra sanity checks of internal structures, required by INVARIANTS
#options WITNESS #Enable checks to detect deadlocks and cycles
==== //depot/projects/smpng/sys/arm/include/endian.h#5 (text+ko) ====
@@ -27,7 +27,7 @@
*
* @(#)endian.h 8.1 (Berkeley) 6/10/93
* $NetBSD: endian.h,v 1.7 1999/08/21 05:53:51 simonb Exp $
- * $FreeBSD: src/sys/arm/include/endian.h,v 1.4 2004/08/02 12:24:18 cognet Exp $
+ * $FreeBSD: src/sys/arm/include/endian.h,v 1.5 2004/10/01 16:55:59 cognet Exp $
*/
#ifndef _ENDIAN_H_
@@ -70,7 +70,7 @@
}
static __inline __uint32_t
-__bswap32(__uint32_t v)
+__bswap32_var(__uint32_t v)
{
__uint32_t t1;
@@ -83,7 +83,7 @@
}
static __inline __uint16_t
-__bswap16(__uint32_t v)
+__bswap16_var(__uint32_t v)
{
__asm __volatile(
"mov %0, %1, ror #8\n"
@@ -94,4 +94,32 @@
return (v);
}
+
+#ifdef __OPTIMIZE__
+
+#define __bswap32_constant(x) \
+ ((((x) & 0xff000000U) >> 24) | \
+ (((x) & 0x00ff0000U) >> 8) | \
+ (((x) & 0x0000ff00U) << 8) | \
+ (((x) & 0x000000ffU) << 24))
+
+#define __bswap16_constant(x) \
+ ((((x) & 0xff00) >> 8) | \
+ (((x) & 0x00ff) << 8))
+
+#define __bswap16(x) \
+ (__builtin_constant_p(x) ? \
+ __bswap16_constant(x) : \
+ __bswap16_var(x))
+
+#define __bswap32(x) \
+ (__builtin_constant_p(x) ? \
+ __bswap32_constant(x) : \
+ __bswap32_var(x))
+
+#else
+#define __bswap16(x) __bswap16_var(x)
+#define __bswap32(x) __bswap32_var(x)
+
+#endif /* __OPTIMIZE__ */
#endif /* !_ENDIAN_H_ */
==== //depot/projects/smpng/sys/boot/alpha/common/help.alpha#2 (text+ko) ====
@@ -1,0 +1,25 @@
+$FreeBSD: src/sys/boot/alpha/common/help.alpha,v 1.2 2004/10/01 19:44:42 ru Exp $
+
+################################################################################
+# Treboot DReboot the system
+
+ reboot
+
+ Causes the system to immediately reboot.
+
+################################################################################
+# Thalt DHalt the system
+
+ halt
+
+ Causes the system to halt.
+
+################################################################################
+# Theap DDisplay memory management statistics
+
+ heap
+
+ Requests debugging output from the heap manager. For debugging use
+ only.
+
+################################################################################
==== //depot/projects/smpng/sys/boot/common/bcache.c#6 (text+ko) ====
@@ -25,12 +25,14 @@
*/
#include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/boot/common/bcache.c,v 1.12 2003/08/25 23:30:41 obrien Exp $");
+__FBSDID("$FreeBSD: src/sys/boot/common/bcache.c,v 1.13 2004/10/03 16:34:01 stefanf Exp $");
/*
* Simple LRU block cache
*/
+#include <sys/stdint.h>
+
#include <stand.h>
#include <string.h>
#include <bitstring.h>
@@ -337,7 +339,7 @@
u_int i;
for (i = 0; i < bcache_nblks; i++) {
- printf("%08x %04x %04x|", bcache_ctl[i].bc_blkno, (unsigned int)bcache_ctl[i].bc_stamp & 0xffff, bcache_ctl[i].bc_count & 0xffff);
+ printf("%08jx %04x %04x|", (uintmax_t)bcache_ctl[i].bc_blkno, (unsigned int)bcache_ctl[i].bc_stamp & 0xffff, bcache_ctl[i].bc_count & 0xffff);
if (((i + 1) % 4) == 0)
printf("\n");
}
==== //depot/projects/smpng/sys/boot/common/help.common#15 (text+ko) ====
@@ -319,13 +319,6 @@
value is 1 (default), but this may cause problems with
some peripherals. Set to 0 to disable.
- set vfs.root.mountdelay=<value>
-
- Delay root partition mount if there is no required provider.
-
- value is a maximum number of seconds to wait for provider to
- show up (default is 5 seconds).
-
################################################################################
# Tshow DShow the values of variables
==== //depot/projects/smpng/sys/boot/forth/loader.conf#30 (text+ko) ====
@@ -6,7 +6,7 @@
#
# All arguments must be in double quotes.
#
-# $FreeBSD: src/sys/boot/forth/loader.conf,v 1.90 2004/09/30 20:02:07 ru Exp $
+# $FreeBSD: src/sys/boot/forth/loader.conf,v 1.91 2004/10/05 11:26:43 pjd Exp $
##############################################################
### Basic configuration options ############################
@@ -98,8 +98,6 @@
#net.inet.tcp.tcbhashsize="" # Set the value of TCBHASHSIZE
#vfs.root.mountfrom="" # Specify root partition in a way the
# kernel understands
-#vfs.root.mountdelay="5" # Delay root partition mount if there is no
- # required provider
#vm.kmem_size="" # Sets the size of kernel memory (bytes)
#debug.ktr.cpumask="0xf" # Bitmask of CPUs to enable KTR on
#debug.ktr.mask="0x1200" # Bitmask of KTR events to enable
==== //depot/projects/smpng/sys/cam/cam_periph.h#4 (text+ko) ====
@@ -25,7 +25,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $FreeBSD: src/sys/cam/cam_periph.h,v 1.14 2004/07/15 08:25:59 phk Exp $
+ * $FreeBSD: src/sys/cam/cam_periph.h,v 1.15 2004/10/05 04:22:20 scottl Exp $
*/
#ifndef _CAM_CAM_PERIPH_H
@@ -81,8 +81,7 @@
};
typedef enum {
- CAM_PERIPH_BIO,
- CAM_PERIPH_NET
+ CAM_PERIPH_BIO
} cam_periph_type;
/* Generically usefull offsets into the peripheral private area */
==== //depot/projects/smpng/sys/cam/cam_xpt.c#22 (text+ko) ====
@@ -28,7 +28,7 @@
*/
#include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/cam/cam_xpt.c,v 1.142 2004/07/15 08:25:59 phk Exp $");
+__FBSDID("$FreeBSD: src/sys/cam/cam_xpt.c,v 1.143 2004/10/05 04:22:20 scottl Exp $");
#include <sys/param.h>
#include <sys/bus.h>
@@ -598,7 +598,6 @@
/* Queues for our software interrupt handler */
typedef TAILQ_HEAD(cam_isrq, ccb_hdr) cam_isrq_t;
static cam_isrq_t cam_bioq;
-static cam_isrq_t cam_netq;
/* "Pool" of inactive ccbs managed by xpt_alloc_ccb and xpt_free_ccb */
static SLIST_HEAD(,ccb_hdr) ccb_freeq;
@@ -658,7 +657,6 @@
#endif
/* Pointers to software interrupt handlers */
-static void *camnet_ih;
static void *cambio_ih;
#if defined(CAM_DEBUG_FLAGS) && !defined(CAMDEBUG)
@@ -1367,7 +1365,6 @@
TAILQ_INIT(&xpt_busses);
TAILQ_INIT(&cam_bioq);
- TAILQ_INIT(&cam_netq);
SLIST_INIT(&ccb_freeq);
STAILQ_INIT(&highpowerq);
@@ -1429,7 +1426,6 @@
}
/* Install our software interrupt handlers */
- swi_add(NULL, "camnet", camisr, &cam_netq, SWI_CAMNET, 0, &camnet_ih);
swi_add(NULL, "cambio", camisr, &cam_bioq, SWI_CAMBIO, 0, &cambio_ih);
}
@@ -3610,7 +3606,6 @@
&& (--timeout > 0)) {
DELAY(1000);
(*(sim->sim_poll))(sim);
- camisr(&cam_netq);
camisr(&cam_bioq);
}
@@ -3621,7 +3616,6 @@
xpt_action(start_ccb);
while(--timeout > 0) {
(*(sim->sim_poll))(sim);
- camisr(&cam_netq);
camisr(&cam_bioq);
if ((start_ccb->ccb_h.status & CAM_STATUS_MASK)
!= CAM_REQ_INPROG)
@@ -4838,12 +4832,9 @@
done_ccb->ccb_h.pinfo.index = CAM_DONEQ_INDEX;
swi_sched(cambio_ih, 0);
break;
- case CAM_PERIPH_NET:
- TAILQ_INSERT_TAIL(&cam_netq, &done_ccb->ccb_h,
- sim_links.tqe);
- done_ccb->ccb_h.pinfo.index = CAM_DONEQ_INDEX;
- swi_sched(camnet_ih, 0);
- break;
+ default:
+ panic("unknown periph type %d",
+ done_ccb->ccb_h.path->periph->type);
}
}
splx(s);
==== //depot/projects/smpng/sys/compat/freebsd32/freebsd32_misc.c#11 (text+ko) ====
@@ -25,7 +25,7 @@
*/
#include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/compat/freebsd32/freebsd32_misc.c,v 1.23 2004/06/17 17:16:41 phk Exp $");
+__FBSDID("$FreeBSD: src/sys/compat/freebsd32/freebsd32_misc.c,v 1.24 2004/10/05 18:51:10 jhb Exp $");
#include "opt_compat.h"
@@ -91,9 +91,13 @@
{
int error, status;
struct rusage32 ru32;
- struct rusage ru;
+ struct rusage ru, *rup;
- error = kern_wait(td, uap->pid, &status, uap->options, &ru);
+ if (uap->rusage != NULL)
+ rup = &ru;
+ else
+ rup = NULL;
+ error = kern_wait(td, uap->pid, &status, uap->options, rup);
if (error)
return (error);
if (uap->status != NULL)
@@ -639,24 +643,14 @@
int
freebsd32_getrusage(struct thread *td, struct freebsd32_getrusage_args *uap)
{
+ struct rusage32 s32;
+ struct rusage s;
int error;
- caddr_t sg;
- struct rusage32 *p32, s32;
- struct rusage *p = NULL, s;
- p32 = uap->rusage;
- if (p32) {
- sg = stackgap_init();
- p = stackgap_alloc(&sg, sizeof(struct rusage));
- uap->rusage = (struct rusage32 *)p;
- }
- error = getrusage(td, (struct getrusage_args *) uap);
+ error = kern_getrusage(td, uap->who, &s);
if (error)
return (error);
- if (p32) {
- error = copyin(p, &s, sizeof(s));
- if (error)
- return (error);
+ if (uap->rusage != NULL) {
TV_CP(s, s32, ru_utime);
TV_CP(s, s32, ru_stime);
CP(s, s32, ru_maxrss);
@@ -673,7 +667,7 @@
CP(s, s32, ru_nsignals);
CP(s, s32, ru_nvcsw);
CP(s, s32, ru_nivcsw);
- error = copyout(&s32, p32, sizeof(s32));
+ error = copyout(&s32, uap->rusage, sizeof(s32));
}
return (error);
}
==== //depot/projects/smpng/sys/compat/linux/linux_misc.c#50 (text+ko) ====
@@ -28,7 +28,7 @@
*/
#include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/compat/linux/linux_misc.c,v 1.160 2004/08/16 11:12:57 obrien Exp $");
+__FBSDID("$FreeBSD: src/sys/compat/linux/linux_misc.c,v 1.161 2004/10/05 18:51:10 jhb Exp $");
#include "opt_mac.h"
@@ -689,9 +689,9 @@
int
linux_times(struct thread *td, struct linux_times_args *args)
{
- struct timeval tv;
+ struct timeval tv, utime, stime, cutime, cstime;
struct l_times_argv tms;
- struct rusage ru;
+ struct proc *p;
int error;
#ifdef DEBUG
@@ -699,15 +699,17 @@
printf(ARGS(times, "*"));
#endif
- mtx_lock_spin(&sched_lock);
- calcru(td->td_proc, &ru.ru_utime, &ru.ru_stime, NULL);
- mtx_unlock_spin(&sched_lock);
+ p = td->td_proc;
+ PROC_LOCK(p);
+ calcru(p, &utime, &stime);
+ calccru(p, &cutime, &cstime);
+ PROC_UNLOCK(p);
- tms.tms_utime = CONVTCK(ru.ru_utime);
- tms.tms_stime = CONVTCK(ru.ru_stime);
+ tms.tms_utime = CONVTCK(utime);
+ tms.tms_stime = CONVTCK(stime);
- tms.tms_cutime = CONVTCK(td->td_proc->p_stats->p_cru.ru_utime);
- tms.tms_cstime = CONVTCK(td->td_proc->p_stats->p_cru.ru_stime);
+ tms.tms_cutime = CONVTCK(cutime);
+ tms.tms_cstime = CONVTCK(cstime);
if ((error = copyout(&tms, args->buf, sizeof(tms))))
return error;
@@ -851,7 +853,7 @@
linux_wait4(struct thread *td, struct linux_wait4_args *args)
{
int error, options, tmpstat;
- struct rusage ru;
+ struct rusage ru, *rup;
struct proc *p;
#ifdef DEBUG
@@ -866,7 +868,11 @@
if (args->options & __WCLONE)
options |= WLINUXCLONE;
- error = kern_wait(td, args->pid, &tmpstat, options, &ru);
+ if (args->rusage != NULL)
+ rup = &ru;
+ else
+ rup = NULL;
+ error = kern_wait(td, args->pid, &tmpstat, options, rup);
if (error)
return error;
==== //depot/projects/smpng/sys/compat/svr4/svr4_misc.c#34 (text+ko) ====
@@ -33,7 +33,7 @@
*/
#include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/compat/svr4/svr4_misc.c,v 1.73 2004/09/24 20:26:15 jhb Exp $");
+__FBSDID("$FreeBSD: src/sys/compat/svr4/svr4_misc.c,v 1.74 2004/10/05 18:51:10 jhb Exp $");
#include "opt_mac.h"
@@ -861,44 +861,30 @@
struct thread *td;
struct svr4_sys_times_args *uap;
{
- int error, *retval = td->td_retval;
- struct tms tms;
- struct timeval t;
- struct rusage *ru;
- struct rusage r;
- struct getrusage_args ga;
+ struct timeval tv, utime, stime, cutime, cstime;
+ struct tms tms;
+ struct proc *p;
+ int error;
- caddr_t sg = stackgap_init();
- ru = stackgap_alloc(&sg, sizeof(struct rusage));
+ p = td->td_proc;
+ PROC_LOCK(p);
+ calcru(p, &utime, &stime);
+ calccru(p, &cutime, &cstime);
+ PROC_UNLOCK(p);
- ga.who = RUSAGE_SELF;
- ga.rusage = ru;
+ tms.tms_utime = timeval_to_clock_t(&utime);
+ tms.tms_stime = timeval_to_clock_t(&stime);
- error = getrusage(td, &ga);
- if (error)
- return error;
+ tms.tms_cutime = timeval_to_clock_t(&cutime);
+ tms.tms_cstime = timeval_to_clock_t(&cstime);
- if ((error = copyin(ru, &r, sizeof r)) != 0)
- return error;
-
- tms.tms_utime = timeval_to_clock_t(&r.ru_utime);
- tms.tms_stime = timeval_to_clock_t(&r.ru_stime);
-
- ga.who = RUSAGE_CHILDREN;
- error = getrusage(td, &ga);
+ error = copyout(&tms, uap->tp, sizeof(tms));
if (error)
- return error;
+ return (error);
- if ((error = copyin(ru, &r, sizeof r)) != 0)
- return error;
-
- tms.tms_cutime = timeval_to_clock_t(&r.ru_utime);
- tms.tms_cstime = timeval_to_clock_t(&r.ru_stime);
-
- microtime(&t);
- *retval = timeval_to_clock_t(&t);
-
- return copyout(&tms, uap->tp, sizeof(tms));
+ microtime(&tv);
+ td->td_retval[0] = (int)timeval_to_clock_t(&tv);
+ return (0);
}
@@ -1149,6 +1135,7 @@
int st;
svr4_siginfo_t *s;
{
+ struct timeval utime, stime;
svr4_siginfo_t i;
int sig;
@@ -1159,16 +1146,11 @@
if (p) {
i.si_pid = p->p_pid;
- mtx_lock_spin(&sched_lock);
- if (p->p_state == PRS_ZOMBIE) {
- i.si_stime = p->p_ru->ru_stime.tv_sec;
- i.si_utime = p->p_ru->ru_utime.tv_sec;
- }
- else {
- i.si_stime = p->p_stats->p_ru.ru_stime.tv_sec;
- i.si_utime = p->p_stats->p_ru.ru_utime.tv_sec;
- }
- mtx_unlock_spin(&sched_lock);
+ PROC_LOCK(p);
+ calcru(p, &utime, &stime);
+ PROC_UNLOCK(p);
+ i.si_stime = stime.tv_sec;
+ i.si_utime = utime.tv_sec;
}
if (WIFEXITED(st)) {
@@ -1296,7 +1278,8 @@
PROC_UNLOCK(q);
sx_xunlock(&proctree_lock);
q->p_xstat = 0;
- ruadd(&p->p_stats->p_cru, q->p_ru);
+ ruadd(&p->p_stats->p_cru, &p->p_crux, q->p_ru,
+ &q->p_rux);
FREE(q->p_ru, M_ZOMBIE);
q->p_ru = NULL;
==== //depot/projects/smpng/sys/conf/NOTES#83 (text+ko) ====
@@ -1,4 +1,4 @@
-# $FreeBSD: src/sys/conf/NOTES,v 1.1279 2004/09/23 08:34:50 phk Exp $
+# $FreeBSD: src/sys/conf/NOTES,v 1.1281 2004/10/04 14:16:17 yar Exp $
#
# NOTES -- Lines that can be cut/pasted into kernel and hints configs.
#
@@ -514,6 +514,8 @@
# The `ether' device provides generic code to handle
# Ethernets; it is MANDATORY when an Ethernet device driver is
# configured or token-ring is enabled.
+# The `vlan' device implements the VLAN tagging of Ethernet frames
+# according to IEEE 802.1Q. It requires `device miibus'.
# The `wlan' device provides generic code to support 802.11
# drivers, including host AP mode; it is MANDATORY for the wi
# driver and will eventually be required by all 802.11 drivers.
@@ -558,7 +560,7 @@
# See pppd(8) for more details.
#
device ether #Generic Ethernet
-device vlan #VLAN support
+device vlan #VLAN support (needs miibus)
device wlan #802.11 support
device token #Generic TokenRing
device fddi #Generic FDDI
==== //depot/projects/smpng/sys/dev/cy/cy.c#6 (text+ko) ====
@@ -29,7 +29,7 @@
*/
#include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/dev/cy/cy.c,v 1.159 2004/07/15 20:47:37 phk Exp $");
+__FBSDID("$FreeBSD: src/sys/dev/cy/cy.c,v 1.160 2004/10/05 07:42:19 phk Exp $");
#include "opt_compat.h"
@@ -77,6 +77,7 @@
#include <sys/lock.h>
#include <sys/malloc.h>
#include <sys/mutex.h>
+#include <sys/serial.h>
#include <sys/syslog.h>
#include <sys/tty.h>
@@ -89,51 +90,7 @@
#define NCY 10 /* KLUDGE */
-/*
- * Dictionary so that I can name everything *sio* or *com* to compare with
- * sio.c. There is also lots of ugly formatting and unnecessary ifdefs to
- * simplify the comparision. These will go away.
- */
-#define LSR_BI CD1400_RDSR_BREAK
-#define LSR_FE CD1400_RDSR_FE
-#define LSR_OE CD1400_RDSR_OE
-#define LSR_PE CD1400_RDSR_PE
-#define MCR_DTR CD1400_MSVR2_DTR
-#define MCR_RTS CD1400_MSVR1_RTS
-#define MSR_CTS CD1400_MSVR2_CTS
-#define MSR_DCD CD1400_MSVR2_CD
-#define MSR_DSR CD1400_MSVR2_DSR
-#define MSR_RI CD1400_MSVR2_RI
-#define NSIO (NCY * CY_MAX_PORTS)
-#define comconsole cyconsole
-#define comdefaultrate cydefaultrate
-#define com_events cy_events
-#define comhardclose cyhardclose
-#define commctl cymctl
-#define comparam cyparam
-#define comspeed cyspeed
-#define comstart cystart
-#define comwakeup cywakeup
-#define p_com_addr p_cy_addr
-#define sioclose cyclose
-#define siodriver cydriver
-#define sioinput cyinput
-#define siointr1 cyintr
-#define sioioctl cyioctl
-#define sioopen cyopen
-#define siopoll cypoll
-#define siosettimeout cysettimeout
-#define siosetwater cysetwater
-#define comstop cystop
-#define siowrite cywrite
-#define sio_fast_ih cy_fast_ih
-#define sio_inited cy_inited
-#define sio_irec cy_irec
-#define sio_lock cy_lock
-#define sio_slow_ih cy_slow_ih
-#define sio_timeout cy_timeout
-#define sio_timeout_handle cy_timeout_handle
-#define sio_timeouts_until_log cy_timeouts_until_log
+#define NPORTS (NCY * CY_MAX_PORTS)
#define CY_MAX_PORTS (CD1400_NO_OF_CHANNELS * CY_MAX_CD1400s)
@@ -153,34 +110,18 @@
#define LOTS_OF_EVENTS 64 /* helps separate urgent events from input */
-#define CALLOUT_MASK 0x80
-#define CONTROL_MASK 0x60
-#define CONTROL_INIT_STATE 0x20
-#define CONTROL_LOCK_STATE 0x40
-#define DEV_TO_UNIT(dev) (MINOR_TO_UNIT(minor(dev)))
-#define MINOR_MAGIC_MASK (CALLOUT_MASK | CONTROL_MASK)
/*
- * Not all of the magic is parametrized in the following macros. 16 and
- * 0xff are related to the bitfields in a dev_t. CY_MAX_PORTS must be
- * ((0xff & ~MINOR_MAGIC_MASK) + 1) for things to work.
- */
-#define MINOR_TO_UNIT(mynor) (((mynor) >> 16) * CY_MAX_PORTS \
- | (((mynor) & 0xff) & ~MINOR_MAGIC_MASK))
-#define UNIT_TO_MINOR(unit) (((unit) / CY_MAX_PORTS) << 16 \
- | (((unit) & 0xff) & ~MINOR_MAGIC_MASK))
-
-/*
* com state bits.
* (CS_BUSY | CS_TTGO) and (CS_BUSY | CS_TTGO | CS_ODEVREADY) must be higher
* than the other bits so that they can be tested as a group without masking
* off the low bits.
*
* The following com and tty flags correspond closely:
- * CS_BUSY = TS_BUSY (maintained by comstart(), siopoll() and
+ * CS_BUSY = TS_BUSY (maintained by cystart(), cypoll() and
* comstop())
- * CS_TTGO = ~TS_TTSTOP (maintained by comparam() and comstart())
- * CS_CTS_OFLOW = CCTS_OFLOW (maintained by comparam())
- * CS_RTS_IFLOW = CRTS_IFLOW (maintained by comparam())
+ * CS_TTGO = ~TS_TTSTOP (maintained by cyparam() and cystart())
+ * CS_CTS_OFLOW = CCTS_OFLOW (maintained by cyparam())
+ * CS_RTS_IFLOW = CRTS_IFLOW (maintained by cyparam())
* TS_FLUSH is not used.
* XXX I think TIOCSETA doesn't clear TS_TTSTOP when it clears IXON.
* XXX CS_*FLOW should be CF_*FLOW in com->flags (control flags not state).
@@ -207,8 +148,8 @@
#define CE_RECORD(com, errnum) (++(com)->delta_error_counts[errnum])
#ifdef SMP
-#define COM_LOCK() mtx_lock_spin(&sio_lock)
-#define COM_UNLOCK() mtx_unlock_spin(&sio_lock)
+#define COM_LOCK() mtx_lock_spin(&cy_lock)
+#define COM_UNLOCK() mtx_unlock_spin(&cy_lock)
#else
#define COM_LOCK()
#define COM_UNLOCK()
@@ -228,36 +169,13 @@
/* com device structure */
struct com_s {
u_char state; /* miscellaneous flag bits */
- bool_t active_out; /* nonzero if the callout device is open */
-#if 0
- u_char cfcr_image; /* copy of value written to CFCR */
-#endif
u_char etc; /* pending Embedded Transmit Command */
u_char extra_state; /* more flag bits, separate for order trick */
-#if 0
- u_char fifo_image; /* copy of value written to FIFO */
-#endif
u_char gfrcr_image; /* copy of value read from GFRCR */
-#if 0
- bool_t hasfifo; /* nonzero for 16550 UARTs */
- bool_t loses_outints; /* nonzero if device loses output interrupts */
-#endif
u_char mcr_dtr; /* MCR bit that is wired to DTR */
u_char mcr_image; /* copy of value written to MCR */
u_char mcr_rts; /* MCR bit that is wired to RTS */
-#if 0
-#ifdef COM_MULTIPORT
- bool_t multiport; /* is this unit part of a multiport device? */
-#endif /* COM_MULTIPORT */
- bool_t no_irq; /* nonzero if irq is not attached */
- bool_t poll; /* nonzero if polling is required */
- bool_t poll_output; /* nonzero if polling for output is required */
-#endif
>>> TRUNCATED FOR MAIL (1000 lines) <<<
More information about the p4-projects
mailing list