PERFORCE change 39096 for review
Sam Leffler
sam at FreeBSD.org
Fri Oct 3 10:17:34 PDT 2003
http://perforce.freebsd.org/chv.cgi?CH=39096
Change 39096 by sam at sam_ebb on 2003/10/03 10:17:11
IFC @39092 (with revision of static ARP for rtentry locking)
Affected files ...
.. //depot/projects/netperf/sys/amd64/amd64/genassym.c#3 integrate
.. //depot/projects/netperf/sys/amd64/amd64/support.S#2 integrate
.. //depot/projects/netperf/sys/amd64/include/clock.h#3 integrate
.. //depot/projects/netperf/sys/amd64/include/ucontext.h#3 integrate
.. //depot/projects/netperf/sys/amd64/isa/clock.c#4 integrate
.. //depot/projects/netperf/sys/cam/scsi/scsi_cd.c#6 integrate
.. //depot/projects/netperf/sys/cam/scsi/scsi_targ_bh.c#3 integrate
.. //depot/projects/netperf/sys/cam/scsi/scsi_target.c#3 integrate
.. //depot/projects/netperf/sys/compat/linprocfs/linprocfs.c#7 integrate
.. //depot/projects/netperf/sys/conf/Makefile.amd64#2 integrate
.. //depot/projects/netperf/sys/conf/files#10 integrate
.. //depot/projects/netperf/sys/conf/kmod.mk#5 integrate
.. //depot/projects/netperf/sys/conf/ldscript.i386#2 integrate
.. //depot/projects/netperf/sys/dev/acpica/Osd/OsdSchedule.c#3 integrate
.. //depot/projects/netperf/sys/dev/ata/ata-lowlevel.c#5 integrate
.. //depot/projects/netperf/sys/dev/firewire/firewire.c#4 integrate
.. //depot/projects/netperf/sys/dev/firewire/firewire.h#4 integrate
.. //depot/projects/netperf/sys/dev/firewire/firewirereg.h#3 integrate
.. //depot/projects/netperf/sys/dev/firewire/fwcrom.c#4 integrate
.. //depot/projects/netperf/sys/dev/firewire/fwdev.c#3 integrate
.. //depot/projects/netperf/sys/dev/firewire/fwmem.c#3 integrate
.. //depot/projects/netperf/sys/dev/firewire/fwmem.h#2 integrate
.. //depot/projects/netperf/sys/dev/firewire/fwohci.c#6 integrate
.. //depot/projects/netperf/sys/dev/firewire/fwohcireg.h#4 integrate
.. //depot/projects/netperf/sys/dev/firewire/if_fwe.c#4 integrate
.. //depot/projects/netperf/sys/dev/firewire/sbp.c#6 integrate
.. //depot/projects/netperf/sys/dev/firewire/sbp.h#1 branch
.. //depot/projects/netperf/sys/dev/usb/ugen.c#5 integrate
.. //depot/projects/netperf/sys/dev/usb/uscanner.c#5 integrate
.. //depot/projects/netperf/sys/fs/procfs/procfs_dbregs.c#2 integrate
.. //depot/projects/netperf/sys/fs/procfs/procfs_fpregs.c#2 integrate
.. //depot/projects/netperf/sys/fs/procfs/procfs_regs.c#2 integrate
.. //depot/projects/netperf/sys/fs/pseudofs/pseudofs_vnops.c#4 integrate
.. //depot/projects/netperf/sys/i386/i386/bios.c#3 integrate
.. //depot/projects/netperf/sys/i386/i386/genassym.c#2 integrate
.. //depot/projects/netperf/sys/i386/i386/locore.s#3 integrate
.. //depot/projects/netperf/sys/i386/i386/machdep.c#4 integrate
.. //depot/projects/netperf/sys/i386/i386/mp_machdep.c#6 integrate
.. //depot/projects/netperf/sys/i386/i386/mpboot.s#2 integrate
.. //depot/projects/netperf/sys/i386/i386/pmap.c#12 integrate
.. //depot/projects/netperf/sys/i386/i386/support.s#3 integrate
.. //depot/projects/netperf/sys/i386/i386/swtch.s#2 integrate
.. //depot/projects/netperf/sys/i386/include/md_var.h#3 integrate
.. //depot/projects/netperf/sys/i386/include/pcb.h#2 integrate
.. //depot/projects/netperf/sys/i386/include/pmap.h#3 integrate
.. //depot/projects/netperf/sys/i386/include/vmparam.h#2 integrate
.. //depot/projects/netperf/sys/ia64/ia64/machdep.c#10 integrate
.. //depot/projects/netperf/sys/ia64/ia64/syscall.S#4 integrate
.. //depot/projects/netperf/sys/ia64/ia64/vm_machdep.c#6 integrate
.. //depot/projects/netperf/sys/kern/init_main.c#5 integrate
.. //depot/projects/netperf/sys/kern/kern_descrip.c#5 integrate
.. //depot/projects/netperf/sys/kern/kern_subr.c#2 integrate
.. //depot/projects/netperf/sys/kern/kern_synch.c#5 integrate
.. //depot/projects/netperf/sys/modules/firewire/sbp/Makefile#2 integrate
.. //depot/projects/netperf/sys/net/bridge.c#12 integrate
.. //depot/projects/netperf/sys/net/if.h#2 integrate
.. //depot/projects/netperf/sys/net/netisr.c#3 integrate
.. //depot/projects/netperf/sys/netinet/if_ether.c#11 integrate
.. //depot/projects/netperf/sys/netinet6/frag6.c#2 integrate
.. //depot/projects/netperf/sys/netinet6/in6_pcb.c#5 integrate
.. //depot/projects/netperf/sys/netinet6/in6_proto.c#2 integrate
.. //depot/projects/netperf/sys/netinet6/ip6_forward.c#5 integrate
.. //depot/projects/netperf/sys/netinet6/ip6_id.c#1 branch
.. //depot/projects/netperf/sys/netinet6/ip6_input.c#5 integrate
.. //depot/projects/netperf/sys/netinet6/ip6_output.c#7 integrate
.. //depot/projects/netperf/sys/netinet6/ip6_var.h#4 integrate
.. //depot/projects/netperf/sys/netinet6/ipsec.c#2 integrate
.. //depot/projects/netperf/sys/netkey/key.c#3 integrate
.. //depot/projects/netperf/sys/netkey/key_debug.h#3 integrate
.. //depot/projects/netperf/sys/netkey/keysock.c#3 integrate
.. //depot/projects/netperf/sys/pci/agp_i810.c#3 integrate
.. //depot/projects/netperf/sys/sparc64/include/endian.h#2 integrate
.. //depot/projects/netperf/sys/sys/cdefs.h#3 integrate
.. //depot/projects/netperf/sys/sys/mac.h#5 integrate
.. //depot/projects/netperf/sys/sys/proc.h#4 integrate
.. //depot/projects/netperf/sys/sys/systm.h#3 integrate
.. //depot/projects/netperf/sys/sys/uio.h#2 integrate
Differences ...
==== //depot/projects/netperf/sys/amd64/amd64/genassym.c#3 (text+ko) ====
@@ -37,7 +37,7 @@
*/
#include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/amd64/amd64/genassym.c,v 1.148 2003/07/25 21:15:44 obrien Exp $");
+__FBSDID("$FreeBSD: src/sys/amd64/amd64/genassym.c,v 1.149 2003/09/30 04:52:24 jeff Exp $");
#include "opt_compat.h"
#include "opt_kstack_pages.h"
@@ -85,7 +85,6 @@
ASSYM(TD_PROC, offsetof(struct thread, td_proc));
ASSYM(TD_INTR_NESTING_LEVEL, offsetof(struct thread, td_intr_nesting_level));
ASSYM(TD_CRITNEST, offsetof(struct thread, td_critnest));
-ASSYM(TD_SWITCHIN, offsetof(struct thread, td_switchin));
ASSYM(TD_MD, offsetof(struct thread, td_md));
ASSYM(P_MD, offsetof(struct proc, p_md));
==== //depot/projects/netperf/sys/amd64/amd64/support.S#2 (text+ko) ====
@@ -30,7 +30,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $FreeBSD: src/sys/amd64/amd64/support.S,v 1.101 2003/05/30 00:58:48 peter Exp $
+ * $FreeBSD: src/sys/amd64/amd64/support.S,v 1.102 2003/10/02 05:08:13 alc Exp $
*/
#include "opt_ddb.h"
@@ -64,46 +64,18 @@
/* Address: %rdi */
ENTRY(pagezero)
- movq $512, %rcx
- cld
-
- ALIGN_TEXT
+ lea 4096(%rdi),%rsi
+ xorq %rax,%rax
1:
- xorq %rax, %rax
- repe
- scasq
- jnz 2f
-
- ret
-
- ALIGN_TEXT
-
-2:
- incq %rcx
- subq $8, %rdi
-
- movq %rcx, %rdx
- cmpq $16, %rcx
-
- jge 3f
-
- movq %rdi, %r8
- andq $0x7f, %r8
- shrq $3, %r8
- movq $16, %rcx
- subq %r8, %rcx
-
-3:
- subq %rcx, %rdx
- rep
- stosq
-
- movq %rdx, %rcx
- testq %rdx, %rdx
- jnz 1b
-
- ret
-
+ movnti %rax,(%rdi)
+ movnti %rax,8(%rdi)
+ movnti %rax,16(%rdi)
+ movnti %rax,24(%rdi)
+ addq $32,%rdi
+ cmpq %rsi,%rdi
+ jne 1b
+ sfence
+ retq
ENTRY(bcmp)
xorq %rax,%rax
==== //depot/projects/netperf/sys/amd64/include/clock.h#3 (text+ko) ====
@@ -3,7 +3,7 @@
* Garrett Wollman, September 1994.
* This file is in the public domain.
*
- * $FreeBSD: src/sys/amd64/include/clock.h,v 1.46 2003/09/22 23:02:24 peter Exp $
+ * $FreeBSD: src/sys/amd64/include/clock.h,v 1.47 2003/09/30 06:38:11 peter Exp $
*/
#ifndef _MACHINE_CLOCK_H_
@@ -30,9 +30,11 @@
*/
struct clockframe;
+#ifndef BURN_BRIDGES
int acquire_timer0(int rate, void (*function)(struct clockframe *frame));
+int release_timer0(void);
+#endif
int acquire_timer2(int mode);
-int release_timer0(void);
int release_timer2(void);
int rtcin(int val);
int sysbeep(int pitch, int period);
==== //depot/projects/netperf/sys/amd64/include/ucontext.h#3 (text+ko) ====
@@ -25,7 +25,7 @@
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
- * $FreeBSD: src/sys/amd64/include/ucontext.h,v 1.14 2003/09/05 20:47:27 peter Exp $
+ * $FreeBSD: src/sys/amd64/include/ucontext.h,v 1.15 2003/10/01 01:08:04 peter Exp $
*/
#ifndef _MACHINE_UCONTEXT_H_
@@ -37,30 +37,30 @@
* sigcontext. So that we can support sigcontext
* and ucontext_t at the same time.
*/
- register_t mc_onstack; /* XXX - sigcontext compat. */
- register_t mc_rdi; /* machine state (struct trapframe) */
- register_t mc_rsi;
- register_t mc_rdx;
- register_t mc_rcx;
- register_t mc_r8;
- register_t mc_r9;
- register_t mc_rax;
- register_t mc_rbx;
- register_t mc_rbp;
- register_t mc_r10;
- register_t mc_r11;
- register_t mc_r12;
- register_t mc_r13;
- register_t mc_r14;
- register_t mc_r15;
- register_t mc_trapno;
- register_t mc_addr;
- register_t mc_err;
- register_t mc_rip;
- register_t mc_cs;
- register_t mc_rflags;
- register_t mc_rsp;
- register_t mc_ss;
+ __register_t mc_onstack; /* XXX - sigcontext compat. */
+ __register_t mc_rdi; /* machine state (struct trapframe) */
+ __register_t mc_rsi;
+ __register_t mc_rdx;
+ __register_t mc_rcx;
+ __register_t mc_r8;
+ __register_t mc_r9;
+ __register_t mc_rax;
+ __register_t mc_rbx;
+ __register_t mc_rbp;
+ __register_t mc_r10;
+ __register_t mc_r11;
+ __register_t mc_r12;
+ __register_t mc_r13;
+ __register_t mc_r14;
+ __register_t mc_r15;
+ __register_t mc_trapno;
+ __register_t mc_addr;
+ __register_t mc_err;
+ __register_t mc_rip;
+ __register_t mc_cs;
+ __register_t mc_rflags;
+ __register_t mc_rsp;
+ __register_t mc_ss;
long mc_len; /* sizeof(mcontext_t) */
#define _MC_FPFMT_NODEV 0x10000 /* device not present or configured */
==== //depot/projects/netperf/sys/amd64/isa/clock.c#4 (text+ko) ====
@@ -37,7 +37,7 @@
*/
#include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/amd64/isa/clock.c,v 1.202 2003/09/22 23:02:24 peter Exp $");
+__FBSDID("$FreeBSD: src/sys/amd64/isa/clock.c,v 1.204 2003/09/30 06:42:47 peter Exp $");
/*
* Routines to handle clock hardware.
@@ -87,11 +87,12 @@
* 32-bit time_t's can't reach leap years before 1904 or after 2036, so we
* can use a simple formula for leap years.
*/
-#define LEAPYEAR(y) ((u_int)(y) % 4 == 0)
+#define LEAPYEAR(y) (((u_int)(y) % 4 == 0) ? 1 : 0)
#define DAYSPERYEAR (31+28+31+30+31+30+31+31+30+31+30+31)
#define TIMER_DIV(x) ((timer_freq + (x) / 2) / (x))
+#ifndef BURN_BRIDGES
/*
* Time in timer cycles that it takes for microtime() to disable interrupts
* and latch the count. microtime() currently uses "cli; outb ..." so it
@@ -107,6 +108,7 @@
* before the next timer interrupt.
*/
#define TIMER0_MAX_FREQ 20000
+#endif
int adjkerntz; /* local offset from GMT in seconds */
int clkintr_pending;
@@ -128,6 +130,7 @@
static u_int32_t i8254_lastcount;
static u_int32_t i8254_offset;
static int i8254_ticked;
+#ifndef BURN_BRIDGES
/*
* XXX new_function and timer_func should not handle clockframes, but
* timer_func currently needs to hold hardclock to handle the
@@ -136,9 +139,11 @@
*/
static void (*new_function)(struct clockframe *frame);
static u_int new_rate;
+static u_int timer0_prescaler_count;
+static u_char timer0_state;
+#endif
static u_char rtc_statusa = RTCSA_DIVIDER | RTCSA_NOPROF;
static u_char rtc_statusb = RTCSB_24HR | RTCSB_PINTR;
-static u_int timer0_prescaler_count;
/* Values for timerX_state: */
#define RELEASED 0
@@ -146,7 +151,6 @@
#define ACQUIRED 2
#define ACQUIRE_PENDING 3
-static u_char timer0_state;
static u_char timer2_state;
static void (*timer_func)(struct clockframe *frame) = hardclock;
@@ -158,7 +162,8 @@
0, /* no poll_pps */
~0u, /* counter_mask */
0, /* frequency */
- "i8254" /* name */
+ "i8254", /* name */
+ 0 /* quality */
};
static void
@@ -177,6 +182,7 @@
mtx_unlock_spin(&clock_lock);
}
timer_func(&frame);
+#ifndef BURN_BRIDGES
switch (timer0_state) {
case RELEASED:
@@ -222,8 +228,10 @@
}
break;
}
+#endif
}
+#ifndef BURN_BRIDGES
/*
* The acquire and release functions must be called at ipl >= splclock().
*/
@@ -259,6 +267,7 @@
old_rate = new_rate = rate;
return (0);
}
+#endif
int
acquire_timer2(int mode)
@@ -280,6 +289,7 @@
return (0);
}
+#ifndef BURN_BRIDGES
int
release_timer0()
{
@@ -299,6 +309,7 @@
}
return (0);
}
+#endif
int
release_timer2()
@@ -931,8 +942,10 @@
freq = timer_freq;
error = sysctl_handle_int(oidp, &freq, sizeof(freq), req);
if (error == 0 && req->newptr != NULL) {
+#ifndef BURN_BRIDGES
if (timer0_state != RELEASED)
return (EBUSY); /* too much trouble to handle */
+#endif
set_timer_freq(freq, hz);
i8254_timecounter.tc_frequency = freq;
}
==== //depot/projects/netperf/sys/cam/scsi/scsi_cd.c#6 (text+ko) ====
@@ -46,7 +46,7 @@
*/
#include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/cam/scsi/scsi_cd.c,v 1.83 2003/09/11 19:27:24 phk Exp $");
+__FBSDID("$FreeBSD: src/sys/cam/scsi/scsi_cd.c,v 1.84 2003/09/30 07:52:15 phk Exp $");
#include "opt_cd.h"
@@ -63,6 +63,7 @@
#include <sys/devicestat.h>
#include <sys/sysctl.h>
#include <sys/taskqueue.h>
+#include <geom/geom_disk.h>
#include <cam/cam.h>
#include <cam/cam_ccb.h>
@@ -146,15 +147,10 @@
struct cd_params params;
union ccb saved_ccb;
cd_quirks quirks;
- struct devstat *device_stats;
STAILQ_ENTRY(cd_softc) changer_links;
struct cdchanger *changer;
int bufs_left;
struct cam_periph *periph;
- dev_t dev;
-#ifdef GONE_IN_5
- eventhandler_tag clonetag;
-#endif
int minimum_command_size;
int outstanding_cmds;
struct task sysctl_task;
@@ -162,6 +158,7 @@
struct sysctl_oid *sysctl_tree;
STAILQ_HEAD(, cd_mode_params) mode_queue;
struct cd_tocdata toc;
+ struct disk disk;
};
struct cd_page_sizes {
@@ -217,12 +214,10 @@
}
};
-#define CD_CDEV_MAJOR 15
-
-static d_open_t cdopen;
-static d_close_t cdclose;
-static d_ioctl_t cdioctl;
-static d_strategy_t cdstrategy;
+static disk_open_t cdopen;
+static disk_close_t cdclose;
+static disk_ioctl_t cdioctl;
+static disk_strategy_t cdstrategy;
static periph_init_t cdinit;
static periph_ctor_t cdregister;
@@ -294,17 +289,6 @@
PERIPHDRIVER_DECLARE(cd, cddriver);
-static struct cdevsw cd_cdevsw = {
- .d_open = cdopen,
- .d_close = cdclose,
- .d_read = physread,
- .d_write = physwrite,
- .d_ioctl = cdioctl,
- .d_strategy = cdstrategy,
- .d_name = "cd",
- .d_maj = CD_CDEV_MAJOR,
- .d_flags = D_DISK,
-};
static int num_changers;
@@ -343,27 +327,6 @@
static STAILQ_HEAD(changerlist, cdchanger) changerq;
-#ifdef GONE_IN_5
-static void
-cdclone(void *arg, char *name, int namelen, dev_t *dev)
-{
- struct cd_softc *softc;
- const char *p;
- int l;
-
- softc = arg;
- p = devtoname(softc->dev);
- l = strlen(p);
- if (bcmp(name, p, l))
- return;
- if (name[l] != 'a' && name[l] != 'c')
- return;
- if (name[l + 1] != '\0')
- return;
- *dev = softc->dev;
- return;
-}
-#endif
static void
cdinit(void)
@@ -533,11 +496,6 @@
free(softc->changer, M_DEVBUF);
num_changers--;
}
- devstat_remove_entry(softc->device_stats);
- destroy_dev(softc->dev);
-#ifdef GONE_IN_5
- EVENTHANDLER_DEREGISTER(dev_clone, softc->clonetag);
-#endif
free(softc, M_DEVBUF);
splx(s);
}
@@ -774,18 +732,18 @@
* WORM peripheral driver. WORM drives will also have the WORM
* driver attached to them.
*/
- softc->device_stats = devstat_new_entry("cd",
+ softc->disk.d_devstat = devstat_new_entry("cd",
periph->unit_number, 0,
DEVSTAT_BS_UNAVAILABLE,
DEVSTAT_TYPE_CDROM | DEVSTAT_TYPE_IF_SCSI,
DEVSTAT_PRIORITY_CD);
- softc->dev = make_dev(&cd_cdevsw, periph->unit_number,
- UID_ROOT, GID_OPERATOR, 0640, "cd%d", periph->unit_number);
- softc->dev->si_drv1 = periph;
-#ifdef GONE_IN_5
- softc->clonetag =
- EVENTHANDLER_REGISTER(dev_clone, cdclone, softc, 1000);
-#endif
+ softc->disk.d_open = cdopen;
+ softc->disk.d_close = cdclose;
+ softc->disk.d_strategy = cdstrategy;
+ softc->disk.d_ioctl = cdioctl;
+ softc->disk.d_name = "cd";
+ disk_create(periph->unit_number, &softc->disk, 0, NULL, NULL);
+ softc->disk.d_drv1 = periph;
/*
* Add an async callback so that we get
@@ -1028,14 +986,14 @@
}
static int
-cdopen(dev_t dev, int flags, int fmt, struct thread *td)
+cdopen(struct disk *dp)
{
struct cam_periph *periph;
struct cd_softc *softc;
int error;
int s;
- periph = (struct cam_periph *)dev->si_drv1;
+ periph = (struct cam_periph *)dp->d_drv1;
if (periph == NULL)
return (ENXIO);
@@ -1075,13 +1033,13 @@
}
static int
-cdclose(dev_t dev, int flag, int fmt, struct thread *td)
+cdclose(struct disk *dp)
{
struct cam_periph *periph;
struct cd_softc *softc;
int error;
- periph = (struct cam_periph *)dev->si_drv1;
+ periph = (struct cam_periph *)dp->d_drv1;
if (periph == NULL)
return (ENXIO);
@@ -1097,7 +1055,7 @@
* Since we're closing this CD, mark the blocksize as unavailable.
* It will be marked as available when the CD is opened again.
*/
- softc->device_stats->flags |= DEVSTAT_BS_UNAVAILABLE;
+ softc->disk.d_devstat->flags |= DEVSTAT_BS_UNAVAILABLE;
/*
* We'll check the media and toc again at the next open().
@@ -1391,7 +1349,7 @@
softc = (struct cd_softc *)periph->softc;
error = cam_periph_runccb(ccb, error_routine, cam_flags, sense_flags,
- softc->device_stats);
+ softc->disk.d_devstat);
if (softc->flags & CD_FLAG_CHANGER)
cdchangerschedule(softc);
@@ -1453,7 +1411,7 @@
struct cd_softc *softc;
int s;
- periph = (struct cam_periph *)bp->bio_dev->si_drv1;
+ periph = (struct cam_periph *)bp->bio_disk->d_drv1;
if (periph == NULL) {
biofinish(bp, NULL, ENXIO);
return;
@@ -1547,7 +1505,7 @@
} else {
bioq_remove(&softc->bio_queue, bp);
- devstat_start_transaction_bio(softc->device_stats, bp);
+ devstat_start_transaction_bio(softc->disk.d_devstat, bp);
scsi_read_write(&start_ccb->csio,
/*retries*/4,
@@ -1703,7 +1661,7 @@
if (softc->flags & CD_FLAG_CHANGER)
cdchangerschedule(softc);
- biofinish(bp, softc->device_stats, 0);
+ biofinish(bp, softc->disk.d_devstat, 0);
break;
}
case CD_CCB_PROBE:
@@ -1939,14 +1897,14 @@
}
static int
-cdioctl(dev_t dev, u_long cmd, caddr_t addr, int flag, struct thread *td)
+cdioctl(struct disk *dp, u_long cmd, void *addr, int flag, struct thread *td)
{
struct cam_periph *periph;
struct cd_softc *softc;
int error;
- periph = (struct cam_periph *)dev->si_drv1;
+ periph = (struct cam_periph *)dp->d_drv1;
if (periph == NULL)
return(ENXIO);
@@ -1977,14 +1935,6 @@
switch (cmd) {
- case DIOCGMEDIASIZE:
- *(off_t *)addr =
- (off_t)softc->params.blksize * softc->params.disksize;
- break;
- case DIOCGSECTORSIZE:
- *(u_int *)addr = softc->params.blksize;
- break;
-
case CDIOCPLAYTRACKS:
{
struct ioc_play_track *args
@@ -2749,6 +2699,10 @@
}
}
+/*
+ * XXX: the disk media and sector size is only really able to change
+ * XXX: while the device is closed.
+ */
static int
cdcheckmedia(struct cam_periph *periph)
{
@@ -2761,6 +2715,9 @@
softc = (struct cd_softc *)periph->softc;
cdprevent(periph, PR_PREVENT);
+ softc->disk.d_maxsize = DFLTPHYS;
+ softc->disk.d_sectorsize = 0;
+ softc->disk.d_mediasize = 0;
/*
* Get the disc size and block size. If we can't get it, we don't
@@ -2860,6 +2817,10 @@
}
softc->flags |= CD_FLAG_VALID_TOC;
+ softc->disk.d_maxsize = DFLTPHYS;
+ softc->disk.d_sectorsize = softc->params.blksize;
+ softc->disk.d_mediasize =
+ (off_t)softc->params.blksize * softc->params.disksize;
bailout:
@@ -2870,9 +2831,9 @@
* XXX problems here if some slice or partition is still
* open with the old size?
*/
- if ((softc->device_stats->flags & DEVSTAT_BS_UNAVAILABLE) != 0)
- softc->device_stats->flags &= ~DEVSTAT_BS_UNAVAILABLE;
- softc->device_stats->block_size = softc->params.blksize;
+ if ((softc->disk.d_devstat->flags & DEVSTAT_BS_UNAVAILABLE) != 0)
+ softc->disk.d_devstat->flags &= ~DEVSTAT_BS_UNAVAILABLE;
+ softc->disk.d_devstat->block_size = softc->params.blksize;
return (error);
}
==== //depot/projects/netperf/sys/cam/scsi/scsi_targ_bh.c#3 (text+ko) ====
@@ -27,7 +27,7 @@
*/
#include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/cam/scsi/scsi_targ_bh.c,v 1.19 2003/09/25 05:02:19 simokawa Exp $");
+__FBSDID("$FreeBSD: src/sys/cam/scsi/scsi_targ_bh.c,v 1.20 2003/09/30 08:03:52 simokawa Exp $");
#include <sys/param.h>
#include <sys/queue.h>
@@ -186,14 +186,21 @@
struct cam_path *path, void *arg)
{
struct cam_path *new_path;
+ struct ccb_pathinq *cpi;
+ path_id_t bus_path_id;
cam_status status;
+ cpi = (struct ccb_pathinq *)arg;
+ if (code == AC_PATH_REGISTERED)
+ bus_path_id = cpi->ccb_h.path_id;
+ else
+ bus_path_id = xpt_path_path_id(path);
/*
* Allocate a peripheral instance for
* this target instance.
*/
status = xpt_create_path(&new_path, NULL,
- xpt_path_path_id(path),
+ bus_path_id,
CAM_TARGET_WILDCARD, CAM_LUN_WILDCARD);
if (status != CAM_REQ_CMP) {
printf("targbhasync: Unable to create path "
@@ -204,10 +211,6 @@
switch (code) {
case AC_PATH_REGISTERED:
{
- struct ccb_pathinq *cpi;
-
- cpi = (struct ccb_pathinq *)arg;
-
/* Only attach to controllers that support target mode */
if ((cpi->target_sprt & PIT_PROCESSOR) == 0)
break;
@@ -222,7 +225,10 @@
}
case AC_PATH_DEREGISTERED:
{
- cam_periph_invalidate(cam_periph_find(new_path, "targbh"));
+ struct cam_periph *periph;
+
+ if ((periph = cam_periph_find(new_path, "targbh")) != NULL)
+ cam_periph_invalidate(periph);
break;
}
default:
==== //depot/projects/netperf/sys/cam/scsi/scsi_target.c#3 (text+ko) ====
@@ -28,7 +28,7 @@
*/
#include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/cam/scsi/scsi_target.c,v 1.56 2003/09/04 16:30:03 njl Exp $");
+__FBSDID("$FreeBSD: src/sys/cam/scsi/scsi_target.c,v 1.57 2003/10/02 08:56:14 simokawa Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -556,12 +556,12 @@
("write - uiomove failed (%d)\n", error));
break;
}
- priority = fuword(&user_ccb->ccb_h.pinfo.priority);
+ priority = fuword32(&user_ccb->ccb_h.pinfo.priority);
if (priority == -1) {
error = EINVAL;
break;
}
- func_code = fuword(&user_ccb->ccb_h.func_code);
+ func_code = fuword32(&user_ccb->ccb_h.func_code);
switch (func_code) {
case XPT_ACCEPT_TARGET_IO:
case XPT_IMMED_NOTIFY:
@@ -683,10 +683,10 @@
* preserved, the rest we get from the user ccb. (See xpt_merge_ccb)
*/
xpt_setup_ccb(k_ccbh, softc->path, descr->priority);
- k_ccbh->retry_count = fuword(&u_ccbh->retry_count);
+ k_ccbh->retry_count = fuword32(&u_ccbh->retry_count);
k_ccbh->func_code = descr->func_code;
- k_ccbh->flags = fuword(&u_ccbh->flags);
- k_ccbh->timeout = fuword(&u_ccbh->timeout);
+ k_ccbh->flags = fuword32(&u_ccbh->flags);
+ k_ccbh->timeout = fuword32(&u_ccbh->timeout);
ccb_len = targccblen(k_ccbh->func_code) - sizeof(struct ccb_hdr);
error = copyin(u_ccbh + 1, k_ccbh + 1, ccb_len);
if (error != 0) {
==== //depot/projects/netperf/sys/compat/linprocfs/linprocfs.c#7 (text+ko) ====
@@ -40,7 +40,7 @@
*/
#include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/compat/linprocfs/linprocfs.c,v 1.74 2003/09/22 16:05:11 des Exp $");
+__FBSDID("$FreeBSD: src/sys/compat/linprocfs/linprocfs.c,v 1.75 2003/09/30 13:35:19 des Exp $");
#include <sys/param.h>
#include <sys/queue.h>
@@ -413,7 +413,8 @@
static int
linprocfs_dostat(PFS_FILL_ARGS)
{
- int name[2], olen, plen;
+ unsigned int olen, plen;
+ int name[2];
int i, ncpu;
name[0] = CTL_HW;
==== //depot/projects/netperf/sys/conf/Makefile.amd64#2 (text+ko) ====
@@ -2,7 +2,7 @@
# Copyright 1990 W. Jolitz
# from: @(#)Makefile.i386 7.1 5/10/91
# from FreeBSD: src/sys/conf/Makefile.i386,v 1.255 2002/02/20 23:35:49
-# $FreeBSD: src/sys/conf/Makefile.amd64,v 1.9 2003/05/30 01:03:43 peter Exp $
+# $FreeBSD: src/sys/conf/Makefile.amd64,v 1.10 2003/09/30 03:49:09 peter Exp $
#
# Makefile for FreeBSD
#
@@ -31,7 +31,7 @@
.endif
.include "$S/conf/kern.pre.mk"
-DDB_ENABLED!= grep DDB opt_ddb.h
+DDB_ENABLED!= grep DDB opt_ddb.h || true
.if ${DDB_ENABLED} != ""
CFLAGS+= -fno-omit-frame-pointer
.endif
==== //depot/projects/netperf/sys/conf/files#10 (text+ko) ====
@@ -1,4 +1,4 @@
-# $FreeBSD: src/sys/conf/files,v 1.827 2003/09/27 12:53:32 phk Exp $
+# $FreeBSD: src/sys/conf/files,v 1.828 2003/10/01 15:13:29 ume Exp $
#
# The long compile-with and dependency lines are required because of
# limitations in config: backslash-newline doesn't work in strings, and
@@ -1456,6 +1456,7 @@
netinet6/in6_src.c optional inet6
netinet6/ip6_forward.c optional inet6
netinet6/ip6_fw.c optional inet6 ipv6firewall
+netinet6/ip6_id.c optional inet6
netinet6/ip6_input.c optional inet6
netinet6/ip6_mroute.c optional inet6
netinet6/ip6_output.c optional inet6
==== //depot/projects/netperf/sys/conf/kmod.mk#5 (text+ko) ====
@@ -1,5 +1,5 @@
# From: @(#)bsd.prog.mk 5.26 (Berkeley) 6/25/91
-# $FreeBSD: src/sys/conf/kmod.mk,v 1.141 2003/09/06 23:23:25 marcel Exp $
+# $FreeBSD: src/sys/conf/kmod.mk,v 1.142 2003/10/02 21:34:06 ru Exp $
#
# The include file <bsd.kmod.mk> handles installing Kernel Loadable Device
# drivers (KLD's).
@@ -169,7 +169,7 @@
SYSDIR= ${_dir}
.endif
.endfor
-.if !defined(SYSDIR) || !exists(${SYSDIR}/kern)
+.if !defined(SYSDIR) || !exists(${SYSDIR}/kern/)
.error "can't find kernel source tree"
.endif
==== //depot/projects/netperf/sys/conf/ldscript.i386#2 (text+ko) ====
@@ -1,4 +1,4 @@
-/* $FreeBSD: src/sys/conf/ldscript.i386,v 1.7 2003/01/06 07:37:15 phk Exp $ */
+/* $FreeBSD: src/sys/conf/ldscript.i386,v 1.8 2003/10/01 23:46:07 peter Exp $ */
OUTPUT_FORMAT("elf32-i386-freebsd", "elf32-i386-freebsd", "elf32-i386-freebsd")
OUTPUT_ARCH(i386)
ENTRY(btext)
@@ -6,7 +6,7 @@
SECTIONS
{
/* Read-only sections, merged into text segment: */
- . = kernbase + 0x00100000 + SIZEOF_HEADERS;
+ . = kernbase + kernload + SIZEOF_HEADERS;
.interp : { *(.interp) }
.hash : { *(.hash) }
.dynsym : { *(.dynsym) }
==== //depot/projects/netperf/sys/dev/acpica/Osd/OsdSchedule.c#3 (text+ko) ====
@@ -24,7 +24,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $FreeBSD: src/sys/dev/acpica/Osd/OsdSchedule.c,v 1.24 2003/09/29 07:29:26 njl Exp $
+ * $FreeBSD: src/sys/dev/acpica/Osd/OsdSchedule.c,v 1.26 2003/10/02 05:09:37 njl Exp $
*/
/*
@@ -243,7 +243,7 @@
* make do with that.
*/
void
-AcpiOsSleep (UINT32 Seconds, UINT32 Milliseconds)
+AcpiOsSleep(UINT32 Seconds, UINT32 Milliseconds)
{
int timo;
static int dummy;
@@ -251,31 +251,30 @@
ACPI_FUNCTION_TRACE((char *)(uintptr_t)__func__);
timo = (Seconds * hz) + Milliseconds * hz / 1000;
- if (timo == 0)
- timo = 1;
- tsleep(&dummy, 0, "acpislp", timo);
+
+ /*
+ * If requested sleep time is less than our hz resolution, use
+ * DELAY instead for better granularity.
+ */
+ if (timo > 0)
+ tsleep(&dummy, 0, "acpislp", timo);
+ else
+ DELAY(Milliseconds * 1000);
+
return_VOID;
}
void
-AcpiOsStall (UINT32 Microseconds)
+AcpiOsStall(UINT32 Microseconds)
{
ACPI_FUNCTION_TRACE((char *)(uintptr_t)__func__);
- /*
- * Maximum length for stall is 100 us. If longer, assume caller
- * really meant "sleep".
- */
- if (Microseconds <= 100)
- DELAY(Microseconds);
- else
- AcpiOsSleep(Microseconds / 1000, Microseconds % 1000);
-
+ DELAY(Microseconds);
return_VOID;
}
UINT32
-AcpiOsGetThreadId (void)
+AcpiOsGetThreadId(void)
{
struct proc *p;
/* XXX do not add FUNCTION_TRACE here, results in recursive call */
==== //depot/projects/netperf/sys/dev/ata/ata-lowlevel.c#5 (text+ko) ====
@@ -27,7 +27,7 @@
*/
#include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/dev/ata/ata-lowlevel.c,v 1.16 2003/09/20 08:38:33 sos Exp $");
+__FBSDID("$FreeBSD: src/sys/dev/ata/ata-lowlevel.c,v 1.17 2003/10/01 09:58:19 sos Exp $");
#include "opt_ata.h"
#include <sys/param.h>
@@ -644,11 +644,13 @@
static int
ata_wait(struct ata_device *atadev, u_int8_t mask)
{
+ u_int8_t status;
int timeout = 0;
- u_int8_t status;
DELAY(1);
- while (timeout < 5000000) { /* timeout 5 secs */
+
+ /* wait 5 seconds for device to get !BUSY */
+ while (timeout < 5000000) {
status = ATA_IDX_INB(atadev->channel, ATA_STATUS);
/* if drive fails status, reselect the drive just to be sure */
@@ -678,8 +680,10 @@
return -1;
if (!mask)
return (status & ATA_S_ERROR);
+
+ DELAY(1);
- /* wait 50 msec for bits wanted. */
+ /* wait 50 msec for bits wanted */
timeout = 5000;
while (timeout--) {
status = ATA_IDX_INB(atadev->channel, ATA_STATUS);
==== //depot/projects/netperf/sys/dev/firewire/firewire.c#4 (text+ko) ====
>>> TRUNCATED FOR MAIL (1000 lines) <<<
More information about the p4-projects
mailing list