Date: Sun, 8 Apr 2007 09:28:46 GMT From: Roman Divacky <rdivacky@FreeBSD.org> To: Perforce Change Reviews <perforce@FreeBSD.org> Subject: PERFORCE change 117634 for review Message-ID: <200704080928.l389SksY001193@repoman.freebsd.org>
next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=117634 Change 117634 by rdivacky@rdivacky_witten on 2007/04/08 09:28:39 IFC + small whitespace fixes + removal of my sg attempt now when we have sg in src. Affected files ... .. //depot/projects/linuxolator/src/sys/boot/pc98/boot0.5/Makefile#2 integrate .. //depot/projects/linuxolator/src/sys/boot/pc98/boot0.5/boot0.5.s#3 integrate .. //depot/projects/linuxolator/src/sys/boot/pc98/boot0.5/ldscript#1 branch .. //depot/projects/linuxolator/src/sys/boot/pc98/boot0.5/putssjis.s#1 branch .. //depot/projects/linuxolator/src/sys/boot/pc98/boot0.5/selector.s#2 integrate .. //depot/projects/linuxolator/src/sys/boot/pc98/boot0.5/start.s#2 integrate .. //depot/projects/linuxolator/src/sys/boot/pc98/boot2/boot.c#4 integrate .. //depot/projects/linuxolator/src/sys/compat/linprocfs/linprocfs.c#16 integrate .. //depot/projects/linuxolator/src/sys/compat/linux/linux_ioctl.c#3 integrate .. //depot/projects/linuxolator/src/sys/compat/linux/linux_ioctl.h#3 integrate .. //depot/projects/linuxolator/src/sys/conf/NOTES#23 integrate .. //depot/projects/linuxolator/src/sys/conf/files#26 integrate .. //depot/projects/linuxolator/src/sys/contrib/opensolaris/common/atomic/amd64/atomic.S#1 branch .. //depot/projects/linuxolator/src/sys/contrib/opensolaris/common/atomic/i386/atomic.S#1 branch .. //depot/projects/linuxolator/src/sys/contrib/opensolaris/uts/common/arch/amd64/atomic.S#2 delete .. //depot/projects/linuxolator/src/sys/contrib/opensolaris/uts/common/arch/i386/atomic.S#2 delete .. //depot/projects/linuxolator/src/sys/contrib/opensolaris/uts/common/fs/zfs/arc.c#2 integrate .. //depot/projects/linuxolator/src/sys/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c#2 integrate .. //depot/projects/linuxolator/src/sys/contrib/opensolaris/uts/common/os/taskq.c#2 integrate .. //depot/projects/linuxolator/src/sys/dev/ata/ata-chipset.c#13 integrate .. //depot/projects/linuxolator/src/sys/dev/mpt/mpt_cam.c#14 integrate .. //depot/projects/linuxolator/src/sys/dev/sound/pci/cmi.c#5 integrate .. //depot/projects/linuxolator/src/sys/geom/uzip/g_uzip.c#2 integrate .. //depot/projects/linuxolator/src/sys/i386/i386/identcpu.c#6 integrate .. //depot/projects/linuxolator/src/sys/i386/i386/initcpu.c#2 integrate .. //depot/projects/linuxolator/src/sys/i386/i386/minidump_machdep.c#2 integrate .. //depot/projects/linuxolator/src/sys/i386/i386/pmap.c#11 integrate .. //depot/projects/linuxolator/src/sys/i386/i386/trap.c#6 integrate .. //depot/projects/linuxolator/src/sys/i386/include/pmap.h#5 integrate .. //depot/projects/linuxolator/src/sys/i386/include/specialreg.h#5 integrate .. //depot/projects/linuxolator/src/sys/i386/include/vmparam.h#2 integrate .. //depot/projects/linuxolator/src/sys/kern/kern_jail.c#10 integrate .. //depot/projects/linuxolator/src/sys/kern/uipc_syscalls.c#9 integrate .. //depot/projects/linuxolator/src/sys/kern/vfs_lookup.c#11 edit .. //depot/projects/linuxolator/src/sys/modules/Makefile#13 integrate .. //depot/projects/linuxolator/src/sys/modules/cam/Makefile#2 integrate .. //depot/projects/linuxolator/src/sys/modules/zfs/Makefile#2 integrate .. //depot/projects/linuxolator/src/sys/netinet/libalias/alias_db.c#4 integrate .. //depot/projects/linuxolator/src/sys/netinet/libalias/alias_skinny.c#3 integrate .. //depot/projects/linuxolator/src/sys/sys/unistd.h#6 integrate Differences ... ==== //depot/projects/linuxolator/src/sys/boot/pc98/boot0.5/Makefile#2 (text+ko) ==== @@ -1,10 +1,11 @@ -# $FreeBSD: src/sys/boot/pc98/boot0.5/Makefile,v 1.4 2004/12/21 08:47:16 ru Exp $ +# $FreeBSD: src/sys/boot/pc98/boot0.5/Makefile,v 1.6 2007/04/07 13:37:45 nyan Exp $ PROG= ${BOOT}.out INTERNALPROG= FILES= ${BOOT} NO_MAN= -SRCS= start.s boot.s boot0.5.s disk.s selector.s support.s syscons.s +SRCS= start.s boot.s boot0.5.s disk.s selector.s support.s syscons.s \ + putssjis.s CLEANFILES= ${BOOT} ${BOOT}.bin BOOT= boot0.5 @@ -13,7 +14,7 @@ # unless you are glutton for punishment. BOOT_BOOT0_ORG?= 0x0000 -LDFLAGS=-N -e start -Ttext ${BOOT_BOOT0_ORG} +LDFLAGS=-N -e start -Ttext ${BOOT_BOOT0_ORG} -Wl,-T,${.CURDIR}/ldscript # The size of boot0.5 must be 7168 bytes ${BOOT}: ${BOOT}.bin ==== //depot/projects/linuxolator/src/sys/boot/pc98/boot0.5/boot0.5.s#3 (text+ko) ==== @@ -1,4 +1,4 @@ -# Copyright (c) KATO Takenori, 1999, 2000. +# Copyright (c) KATO Takenori, 1999, 2000, 2007. # # All rights reserved. Unpublished rights reserved under the copyright # laws of Japan. @@ -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/boot/pc98/boot0.5/boot0.5.s,v 1.3 2007/03/17 05:30:03 kato Exp $ +# $FreeBSD: src/sys/boot/pc98/boot0.5/boot0.5.s,v 1.4 2007/04/07 08:37:04 kato Exp $ # .global main .code16 @@ -261,8 +261,8 @@ .global ishireso ishireso: .byte 0 -title: .asciz "PC98 Boot Selector Version 1.1" -copyright: .ascii "(C)Copyright 1999, 2000 KATO Takenori. " +title: .asciz "PC98 Boot Selector Version 1.2" +copyright: .ascii "(C)Copyright 1999-2007 KATO Takenori. " .asciz "All rights reserved." msg_device: .asciz "Device" msg_sasi: .asciz "SASI/IDE unit " ==== //depot/projects/linuxolator/src/sys/boot/pc98/boot0.5/selector.s#2 (text+ko) ==== @@ -1,4 +1,4 @@ -# Copyright (c) KATO Takenori, 1999, 2000. +# Copyright (c) KATO Takenori, 1999, 2000, 2007. # # All rights reserved. Unpublished rights reserved under the copyright # laws of Japan. @@ -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/boot/pc98/boot0.5/selector.s,v 1.2 2000/08/06 14:35:37 kato Exp $ +# $FreeBSD: src/sys/boot/pc98/boot0.5/selector.s,v 1.3 2007/04/07 08:37:04 kato Exp $ # .code16 @@ -299,6 +299,11 @@ jne dev_right movw $3, mode # N88-BASIC ret + + # XXX + .space 5, 0x90 + ret # Dummy ret @0x9ab + dev_up: cmpw $0, curdevice je devmode_loop ==== //depot/projects/linuxolator/src/sys/boot/pc98/boot0.5/start.s#2 (text+ko) ==== @@ -1,4 +1,4 @@ -# Copyright (c) KATO Takenori, 1999, 2000. +# Copyright (c) KATO Takenori, 1999, 2000, 2007. # # All rights reserved. Unpublished rights reserved under the copyright # laws of Japan. @@ -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/boot/pc98/boot0.5/start.s,v 1.2 2003/05/02 09:33:12 kato Exp $ +# $FreeBSD: src/sys/boot/pc98/boot0.5/start.s,v 1.3 2007/04/07 08:37:04 kato Exp $ # .global start .code16 @@ -34,8 +34,19 @@ start: jmp start1 + # Magic + .org 0x053, 0x20 + .byte 0x4e, 0x45, 0x43 + + .org 0x8f + .byte 0x32, 0x2e, 0x37, 0x30 + .org 0x2d4 start1: + # The instruction 'call 0x9ab' can be here. See also selector.s. + nop + nop + nop cli movw %cs, %ax movw %ax, %ds ==== //depot/projects/linuxolator/src/sys/boot/pc98/boot2/boot.c#4 (text+ko) ==== @@ -49,7 +49,7 @@ */ #include <sys/cdefs.h> -__FBSDID("$FreeBSD: src/sys/boot/pc98/boot2/boot.c,v 1.16 2006/11/02 17:28:38 ru Exp $"); +__FBSDID("$FreeBSD: src/sys/boot/pc98/boot2/boot.c,v 1.17 2007/04/06 20:50:24 kan Exp $"); #include "boot.h" #include <a.out.h> @@ -70,7 +70,7 @@ static char kernel_config_namebuf[NAMEBUF_LEN + sizeof "config"]; static char linebuf[NAMEBUF_LEN]; static char namebuf[NAMEBUF_LEN]; -static struct bootinfo bootinfo; +struct bootinfo bootinfo; int loadflags; static void getbootdev(char *ptr, int *howto); ==== //depot/projects/linuxolator/src/sys/compat/linprocfs/linprocfs.c#16 (text+ko) ==== @@ -40,7 +40,7 @@ */ #include <sys/cdefs.h> -__FBSDID("$FreeBSD: src/sys/compat/linprocfs/linprocfs.c,v 1.108 2007/03/30 17:56:44 jkim Exp $"); +__FBSDID("$FreeBSD: src/sys/compat/linprocfs/linprocfs.c,v 1.109 2007/04/06 18:15:56 jkim Exp $"); #include <sys/param.h> #include <sys/queue.h> @@ -1252,3 +1252,5 @@ PSEUDOFS(linprocfs, 1); MODULE_DEPEND(linprocfs, linux, 1, 1, 1); MODULE_DEPEND(linprocfs, procfs, 1, 1, 1); +MODULE_DEPEND(linprocfs, sysvmsg, 1, 1, 1); +MODULE_DEPEND(linprocfs, sysvsem, 1, 1, 1); ==== //depot/projects/linuxolator/src/sys/compat/linux/linux_ioctl.c#3 (text+ko) ==== @@ -27,7 +27,7 @@ */ #include <sys/cdefs.h> -__FBSDID("$FreeBSD: src/sys/compat/linux/linux_ioctl.c,v 1.137 2006/07/06 21:42:36 jhb Exp $"); +__FBSDID("$FreeBSD: src/sys/compat/linux/linux_ioctl.c,v 1.138 2007/04/07 19:40:58 scottl Exp $"); #include <sys/param.h> #include <sys/systm.h> @@ -94,8 +94,8 @@ static linux_ioctl_function_t linux_ioctl_termio; static linux_ioctl_function_t linux_ioctl_private; static linux_ioctl_function_t linux_ioctl_drm; +static linux_ioctl_function_t linux_ioctl_sg; static linux_ioctl_function_t linux_ioctl_special; -static linux_ioctl_function_t linux_ioctl_sg; static struct linux_ioctl_handler cdrom_handler = { linux_ioctl_cdrom, LINUX_IOCTL_CDROM_MIN, LINUX_IOCTL_CDROM_MAX }; @@ -1595,6 +1595,11 @@ break; } + case LINUX_SCSI_GET_BUS_NUMBER: + case LINUX_SCSI_GET_IDLUN: + error = linux_ioctl_sg(td, args); + break; + /* LINUX_CDROM_SEND_PACKET */ /* LINUX_CDROM_NEXT_WRITABLE */ /* LINUX_CDROM_LAST_WRITTEN */ @@ -2534,6 +2539,24 @@ return ioctl(td, (struct ioctl_args *)args); } +static int +linux_ioctl_sg(struct thread *td, struct linux_ioctl_args *args) +{ + struct file *fp; + u_long cmd; + int error; + + if ((error = fget(td, args->fd, &fp)) != 0) { + printf("sg_linux_ioctl: fget returned %d\n", error); + return (error); + } + cmd = args->cmd; + + error = (fo_ioctl(fp, cmd, (caddr_t)args->arg, td->td_ucred, td)); + fdrop(fp, td); + return (error); +} + /* * Special ioctl handler */ @@ -2562,254 +2585,6 @@ return (error); } -int linux_sg_version = 30125; - -#ifdef LINUX_SG_DEBUG -#define DPRINTF(a) do { \ - if (ldebug(ioctl)) \ - printf(a); \ -} while (0) -#else -#define DPRINTF(a) -#endif - -#ifdef LINUX_SG_DEBUG -static void dump_sg_io(struct linux_sg_io_hdr *); -static void dump_scsireq(struct scsireq *); -#endif - -//static int bsd_to_linux_host_status(int); -//static int bsd_to_linux_driver_status(int); - -/* - * Sg ioctl handler - */ -static int -linux_ioctl_sg(struct thread *td, struct linux_ioctl_args *args) -{ - struct file *fp; - u_long com = args->cmd; - int error = 0; - //struct linux_sg_io_hdr lreq; - //union ccb req; - - if ((error = fget(td, args->fd, &fp)) != 0) - return (error); - - td->td_retval[0] = 0; - DPRINTF(("Command = %lx\n", com)); - switch (com) { - case LINUX_SG_GET_VERSION_NUM: - error = copyout(&version, (void *)args->arg, sizeof(linux_sg_version)); - break; -#if 0 - case LINUX_SG_IO: - error = copyin((void *)args->arg, &lreq, sizeof(lreq)); - if (error) { - DPRINTF(("failed to copy in request data %d\n", error)); - break; - } - -#ifdef LINUX_SG_DEBUG - dump_sg_io(&lreq); -#endif - (void)memset(&req, 0, sizeof(req)); - switch (lreq.dxfer_direction) { - case SG_DXFER_TO_DEV: - req.flags = SCCMD_WRITE; - break; - case SG_DXFER_FROM_DEV: - req.flags = SCCMD_READ; - break; - default: - DPRINTF(("unknown direction %d\n", - lreq.dxfer_direction)); - error = EINVAL; - goto done; - } - if (lreq.iovec_count != 0) { - /* XXX: Not yet */ - error = EOPNOTSUPP; - DPRINTF(("scatter/gather not supported\n")); - break; - } - - if (lreq.cmd_len > sizeof(req.cmd)) { - DPRINTF(("invalid command length %d\n", lreq.cmd_len)); - error = EINVAL; - break; - } - - error = copyin(lreq.cmdp, req.cmd, lreq.cmd_len); - if (error) { - DPRINTF(("failed to copy in cmd data %d\n", error)); - break; - } - - req.timeout = lreq.timeout; - req.cmdlen = lreq.cmd_len; - req.datalen = lreq.dxfer_len; - req.databuf = lreq.dxferp; - - error = fo_ioctl(fp, CAMIOCOMMAND, (void *)&req, td->td_ucred, td); - if (error) { - DPRINTF(("SCIOCCOMMAND failed %d\n", error)); - break; - } -#ifdef LINUX_SG_DEBUG - dump_scsireq(&req); -#endif - if (req.senselen_used) { - if (req.senselen > lreq.mx_sb_len) - req.senselen = lreq.mx_sb_len; - lreq.sb_len_wr = req.senselen; - error = copyout(req.sense, lreq.sbp, req.senselen); - if (error) { - DPRINTF(("sense copyout failed %d\n", error)); - break; - } - } else { - lreq.sb_len_wr = 0; - } - - lreq.status = req.status; - lreq.masked_status = 0; /* XXX */ - lreq.host_status = bsd_to_linux_host_status(req.retsts); - lreq.sb_len_wr = req.datalen_used; - lreq.driver_status = bsd_to_linux_driver_status(req.error); - lreq.resid = req.datalen - req.datalen_used; - lreq.duration = req.timeout; /* XXX */ - lreq.info = 0; /* XXX */ - error = copyout(&lreq, args->data, sizeof(lreq)); - if (error) { - DPRINTF(("failed to copy out req data %d\n", error)); - } - break; -#endif - case LINUX_SG_EMULATED_HOST: - case LINUX_SG_SET_TRANSFORM: - case LINUX_SG_GET_TRANSFORM: - case LINUX_SG_GET_NUM_WAITING: - case LINUX_SG_SCSI_RESET: - case LINUX_SG_GET_REQUEST_TABLE: - case LINUX_SG_SET_KEEP_ORPHAN: - case LINUX_SG_GET_KEEP_ORPHAN: - case LINUX_SG_GET_ACCESS_COUNT: - case LINUX_SG_SET_FORCE_LOW_DMA: - case LINUX_SG_GET_LOW_DMA: - case LINUX_SG_GET_SG_TABLESIZE: - case LINUX_SG_GET_SCSI_ID: - case LINUX_SG_SET_FORCE_PACK_ID: - case LINUX_SG_GET_PACK_ID: - case LINUX_SG_SET_RESERVED_SIZE: - case LINUX_SG_GET_RESERVED_SIZE: - error = ENODEV; - break; - - /* version 2 interfaces */ - case LINUX_SG_SET_TIMEOUT: - break; - case LINUX_SG_GET_TIMEOUT: - /* ioctl returns value..., grr. */ - td->td_retval[0] = 60; - break; - case LINUX_SG_GET_COMMAND_Q: - case LINUX_SG_SET_COMMAND_Q: - case LINUX_SG_SET_DEBUG: - case LINUX_SG_NEXT_CMD_LEN: - error = ENODEV; - break; - } - -//done: - fdrop(fp, td); - - DPRINTF(("Return=%d\n", error)); - return error; -} - -#if 0 -static int -bsd_to_linux_driver_status(int bs) -{ - switch (bs) { - default: - case XS_NOERROR: - return 0; - case XS_SENSE: - case XS_SHORTSENSE: - return LINUX_DRIVER_SENSE; - case XS_RESOURCE_SHORTAGE: - return LINUX_DRIVER_SOFT; - case XS_DRIVER_STUFFUP: - return LINUX_DRIVER_ERROR; - case XS_SELTIMEOUT: - case XS_TIMEOUT: - return LINUX_DRIVER_TIMEOUT; - case XS_BUSY: - return LINUX_DRIVER_BUSY; - case XS_RESET: - return LINUX_SUGGEST_ABORT; - case XS_REQUEUE: - return LINUX_SUGGEST_RETRY; - } -} - -static int -bsd_to_linux_host_status(int bs) -{ - switch (bs) { - case SCCMD_OK: - case SCCMD_SENSE: - return LINUX_DID_OK; - case SCCMD_TIMEOUT: - return LINUX_DID_TIME_OUT; - case SCCMD_BUSY: - return LINUX_DID_BUS_BUSY; - case SCCMD_UNKNOWN: - default: - return LINUX_DID_ERROR; - } -} -#endif - -#ifdef LINUX_SG_DEBUG -static void -dump_sg_io(struct linux_sg_io_hdr *lr) -{ - printf("linuxreq [interface_id=%x, dxfer_direction=%d, cmd_len=%d, " - "mx_sb_len=%d, iovec_count=%d, dxfer_len=%d, dxferp=%p, " - "cmdp=%p, sbp=%p, timeout=%u, flags=%d, pack_id=%d, " - "usr_ptr=%p, status=%u, masked_status=%u, sb_len_wr=%u, " - "host_status=%u, driver_status=%u, resid=%d, duration=%u, " - "info=%u]\n", - lr->interface_id, lr->dxfer_direction, lr->cmd_len, - lr->mx_sb_len, lr->iovec_count, lr->dxfer_len, lr->dxferp, - lr->cmdp, lr->sbp, lr->timeout, lr->flags, lr->pack_id, - lr->usr_ptr, lr->status, lr->masked_status, lr->sb_len_wr, - lr->host_status, lr->driver_status, lr->resid, lr->duration, - lr->info); -} - -static void -dump_scsireq(struct scsireq *br) -{ - int i; - printf("bsdreq [flags=%lx, timeout=%lu, cmd=[ ", - br->flags, br->timeout); - for (i = 0; i < sizeof(br->cmd) / sizeof(br->cmd[0]); i++) - printf("%.2u ", br->cmd[i]); - printf("], cmdlen=%u, databuf=%p, datalen=%lu, datalen_used=%lu, " - "sense=[ ", - br->cmdlen, br->databuf, br->datalen, br->datalen_used); - for (i = 0; i < sizeof(br->sense) / sizeof(br->sense[0]); i++) - printf("%.2u ", br->sense[i]); - printf("], senselen=%u, senselen_used=%u, status=%u, retsts=%u, " - "error=%d]\n", - br->senselen, br->senselen_used, br->status, br->retsts, br->error); -} -#endif - /* * main ioctl syscall function */ ==== //depot/projects/linuxolator/src/sys/compat/linux/linux_ioctl.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/compat/linux/linux_ioctl.h,v 1.24 2006/05/10 20:38:16 netchild Exp $ + * $FreeBSD: src/sys/compat/linux/linux_ioctl.h,v 1.25 2007/04/07 19:40:58 scottl Exp $ */ #ifndef _LINUX_IOCTL_H_ @@ -51,70 +51,6 @@ #define LINUX_IOCTL_DISK_MAX LINUX_BLKSSZGET /* - * sg - */ -#define LINUX_SG_SET_TIMEOUT 0x2201 -#define LINUX_SG_GET_TIMEOUT 0x2202 -#define LINUX_SG_EMULATED_HOST 0x2203 -#define LINUX_SG_SET_TRANSFORM 0x2204 -#define LINUX_SG_GET_TRANSFORM 0x2205 -#define LINUX_SG_GET_COMMAND_Q 0x2270 -#define LINUX_SG_SET_COMMAND_Q 0x2271 -#define LINUX_SG_SET_RESERVED_SIZE 0x2275 -#define LINUX_SG_GET_RESERVED_SIZE 0x2272 -#define LINUX_SG_GET_SCSI_ID 0x2276 -#define LINUX_SG_SET_FORCE_LOW_DMA 0x2279 -#define LINUX_SG_GET_LOW_DMA 0x227a -#define LINUX_SG_SET_FORCE_PACK_ID 0x227b -#define LINUX_SG_GET_PACK_ID 0x227c -#define LINUX_SG_GET_NUM_WAITING 0x227d -#define LINUX_SG_SET_DEBUG 0x227e -#define LINUX_SG_GET_SG_TABLESIZE 0x227f -#define LINUX_SG_GET_VERSION_NUM 0x2282 -#define LINUX_SG_NEXT_CMD_LEN 0x2283 -#define LINUX_SG_SCSI_RESET 0x2284 -#define LINUX_SG_IO 0x2285 -#define LINUX_SG_GET_REQUEST_TABLE 0x2286 -#define LINUX_SG_SET_KEEP_ORPHAN 0x2287 -#define LINUX_SG_GET_KEEP_ORPHAN 0x2288 -#define LINUX_SG_GET_ACCESS_COUNT 0x2289 - -#define LINUX_IOCTL_SG_MIN LINUX_SG_GET_TIMEOUT -#define LINUX_IOCTL_SG_MAX LINUX_SG_GET_ACCESS_COUNT - -struct linux_sg_io_hdr { - int interface_id; -#define SG_DXFER_NONE -1 -#define SG_DXFER_TO_DEV -2 -#define SG_DXFER_FROM_DEV -3 -#define SG_DXFER_TO_FROM_DEV -4 -#define SG_DXFER_UNKNOWN -5 - int dxfer_direction; - unsigned char cmd_len; - unsigned char mx_sb_len; - unsigned short iovec_count; - unsigned int dxfer_len; - void *dxferp; - unsigned char *cmdp; - unsigned char *sbp; - unsigned int timeout; - unsigned int flags; - int pack_id; - void *usr_ptr; - unsigned char status; - unsigned char masked_status; - unsigned char msg_status; - unsigned char sb_len_wr; - unsigned short host_status; - unsigned short driver_status; - int resid; - unsigned int duration; - unsigned int info; -}; - -#define SG_MAX_SENSE 16 - -/* * Host codes */ #define LINUX_DID_OK 0x00 /* OK */ @@ -208,6 +144,8 @@ #define LINUX_CDROM_DEBUG 0x5330 #define LINUX_CDROM_GET_CAPABILITY 0x5331 #define LINUX_CDROMAUDIOBUFSIZ 0x5382 +#define LINUX_SCSI_GET_IDLUN 0x5382 +#define LINUX_SCSI_GET_BUS_NUMBER 0x5386 #define LINUX_DVD_READ_STRUCT 0x5390 #define LINUX_DVD_WRITE_STRUCT 0x5391 #define LINUX_DVD_AUTH 0x5392 @@ -235,6 +173,38 @@ #define LINUX_DVD_HOST_SEND_RPC_STATE 11 /* + * SG + */ +#define LINUX_SG_SET_TIMEOUT 0x2201 +#define LINUX_SG_GET_TIMEOUT 0x2202 +#define LINUX_SG_EMULATED_HOST 0x2203 +#define LINUX_SG_SET_TRANSFORM 0x2204 +#define LINUX_SG_GET_TRANSFORM 0x2205 +#define LINUX_SG_GET_COMMAND_Q 0x2270 +#define LINUX_SG_SET_COMMAND_Q 0x2271 +#define LINUX_SG_SET_RESERVED_SIZE 0x2275 +#define LINUX_SG_GET_RESERVED_SIZE 0x2272 +#define LINUX_SG_GET_SCSI_ID 0x2276 +#define LINUX_SG_SET_FORCE_LOW_DMA 0x2279 +#define LINUX_SG_GET_LOW_DMA 0x227a +#define LINUX_SG_SET_FORCE_PACK_ID 0x227b +#define LINUX_SG_GET_PACK_ID 0x227c +#define LINUX_SG_GET_NUM_WAITING 0x227d +#define LINUX_SG_SET_DEBUG 0x227e +#define LINUX_SG_GET_SG_TABLESIZE 0x227f +#define LINUX_SG_GET_VERSION_NUM 0x2282 +#define LINUX_SG_NEXT_CMD_LEN 0x2283 +#define LINUX_SG_SCSI_RESET 0x2284 +#define LINUX_SG_IO 0x2285 +#define LINUX_SG_GET_REQUEST_TABLE 0x2286 +#define LINUX_SG_SET_KEEP_ORPHAN 0x2287 +#define LINUX_SG_GET_KEEP_ORPHAN 0x2288 +#define LINUX_SG_GET_ACCESS_COUNT 0x2289 + +#define LINUX_IOCTL_SG_MIN 0x2200 +#define LINUX_IOCTL_SG_MAX 0x22ff + +/* * VFAT */ #define LINUX_VFAT_READDIR_BOTH 0x7201 ==== //depot/projects/linuxolator/src/sys/conf/NOTES#23 (text+ko) ==== @@ -1,4 +1,4 @@ -# $FreeBSD: src/sys/conf/NOTES,v 1.1418 2007/04/02 01:04:20 mjacob Exp $ +# $FreeBSD: src/sys/conf/NOTES,v 1.1419 2007/04/07 19:40:57 scottl Exp $ # # NOTES -- Lines that can be cut/pasted into kernel and hints configs. # @@ -1215,6 +1215,10 @@ # # The pt driver drives SCSI Processor devices. # +# The sg driver provides a passthrough API that is compatible with the +# Linux SG driver. It will work in conjunction with the COMPAT_LINUX +# option to run linux SG apps. It can also stand on its own and provide +# source level API compatiblity for porting apps to FreeBSD. # # Target Mode support is provided here but also requires that a SIM # (SCSI Host Adapter Driver) provide support as well. @@ -1241,6 +1245,7 @@ device targ #SCSI Target Mode Code device targbh #SCSI Target Mode Blackhole Device device pass #CAM passthrough driver +device sg #Linux SCSI passthrough # CAM OPTIONS: # debugging options: ==== //depot/projects/linuxolator/src/sys/conf/files#26 (text+ko) ==== @@ -1,4 +1,4 @@ -# $FreeBSD: src/sys/conf/files,v 1.1190 2007/04/06 04:51:50 kan Exp $ +# $FreeBSD: src/sys/conf/files,v 1.1191 2007/04/07 19:40:57 scottl Exp $ # # The long compile-with and dependency lines are required because of # limitations in config: backslash-newline doesn't work in strings, and @@ -100,6 +100,7 @@ cam/scsi/scsi_pt.c optional pt cam/scsi/scsi_sa.c optional sa cam/scsi/scsi_ses.c optional ses +cam/scsi/scsi_sg.c optional sg cam/scsi/scsi_targ_bh.c optional targbh cam/scsi/scsi_target.c optional targ coda/coda_fbsd.c optional vcoda ==== //depot/projects/linuxolator/src/sys/contrib/opensolaris/uts/common/fs/zfs/arc.c#2 (text+ko) ==== @@ -152,8 +152,17 @@ /* * These tunables are for performance analysis. */ -uint64_t zfs_arc_max; -uint64_t zfs_arc_min; +u_long zfs_arc_max; +u_long zfs_arc_min; +#ifdef _KERNEL +TUNABLE_ULONG("vfs.zfs.arc_max", &zfs_arc_max); +TUNABLE_ULONG("vfs.zfs.arc_min", &zfs_arc_min); +SYSCTL_DECL(_vfs_zfs); +SYSCTL_ULONG(_vfs_zfs, OID_AUTO, arc_max, CTLFLAG_RD, &zfs_arc_max, 0, + "Maximum ARC size"); +SYSCTL_ULONG(_vfs_zfs, OID_AUTO, arc_min, CTLFLAG_RD, &zfs_arc_min, 0, + "Minimum ARC size"); +#endif /* * Note that buffers can be on one of 5 states: @@ -2402,6 +2411,7 @@ nhdr->b_flags = 0; nhdr->b_datacnt = 1; nhdr->b_freeze_cksum = NULL; + mutex_init(&nhdr->b_freeze_lock, NULL, MUTEX_DEFAULT, NULL); (void) refcount_add(&nhdr->b_refcnt, tag); buf->b_hdr = nhdr; atomic_add_64(&arc_anon->arcs_size, blksz); @@ -2719,12 +2729,12 @@ else arc_c_max = arc_c_min; arc_c_max = MAX(arc_c * 6, arc_c_max); -#ifdef notyet +#ifdef _KERNEL /* * Allow the tunables to override our calculations if they are * reasonable (ie. over 64MB) */ - if (zfs_arc_max > 64<<20 && zfs_arc_max < physmem * PAGESIZE) + if (zfs_arc_max > 64<<20 && zfs_arc_max < vm_kmem_size) arc_c_max = zfs_arc_max; if (zfs_arc_min > 64<<20 && zfs_arc_min <= arc_c_max) arc_c_min = zfs_arc_min; @@ -2738,6 +2748,9 @@ if (arc_c < arc_c_min) arc_c = arc_c_min; + zfs_arc_min = arc_c_min; + zfs_arc_max = arc_c_max; + arc_anon = &ARC_anon; arc_mru = &ARC_mru; arc_mru_ghost = &ARC_mru_ghost; ==== //depot/projects/linuxolator/src/sys/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c#2 (text+ko) ==== @@ -201,7 +201,7 @@ * data (cmd == _FIO_SEEK_DATA). "off" is an in/out parameter. */ static int -zfs_holey(vnode_t *vp, int cmd, offset_t *off) +zfs_holey(vnode_t *vp, unsigned long cmd, offset_t *off) { znode_t *zp = VTOZ(vp); uint64_t noff = (uint64_t)*off; /* new offset */ @@ -3065,11 +3065,11 @@ struct vop_pathconf_args /* { struct vnode *a_vp; int a_name; - int *a_retval; + register_t *a_retval; } */ *ap; { int cmd = ap->a_name; - int *valp = ap->a_retval; + register_t *valp = ap->a_retval; #if 0 vnode_t *vp = ap->a_vp; znode_t *zp, *xzp; ==== //depot/projects/linuxolator/src/sys/contrib/opensolaris/uts/common/os/taskq.c#2 (text+ko) ==== @@ -393,7 +393,7 @@ * Maxmimum number of entries in global system taskq is * system_taskq_size * max_ncpus */ -#define SYSTEM_TASKQ_SIZE 64 +#define SYSTEM_TASKQ_SIZE 1 int system_taskq_size = SYSTEM_TASKQ_SIZE; /* ==== //depot/projects/linuxolator/src/sys/dev/ata/ata-chipset.c#13 (text+ko) ==== @@ -25,7 +25,7 @@ */ #include <sys/cdefs.h> -__FBSDID("$FreeBSD: src/sys/dev/ata/ata-chipset.c,v 1.194 2007/04/06 16:21:34 sos Exp $"); +__FBSDID("$FreeBSD: src/sys/dev/ata/ata-chipset.c,v 1.195 2007/04/06 17:36:35 sos Exp $"); #include "opt_ata.h" #include <sys/param.h> @@ -4816,6 +4816,8 @@ if (ch->dma) { /* note start and stop are not used here */ ch->dma->setprd = ata_siiprb_dmasetprd; + + ch->dma->flags |= ATA_DMA_64BIT; } } ==== //depot/projects/linuxolator/src/sys/dev/mpt/mpt_cam.c#14 (text+ko) ==== @@ -94,7 +94,7 @@ * OWNER OR CONTRIBUTOR IS ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #include <sys/cdefs.h> -__FBSDID("$FreeBSD: src/sys/dev/mpt/mpt_cam.c,v 1.52 2007/03/11 01:54:59 mjacob Exp $"); +__FBSDID("$FreeBSD: src/sys/dev/mpt/mpt_cam.c,v 1.53 2007/04/07 18:15:52 mjacob Exp $"); #include <dev/mpt/mpt.h> #include <dev/mpt/mpt_cam.h> @@ -2963,8 +2963,13 @@ break; } case XPT_RESET_DEV: - xpt_print(ccb->ccb_h.path, "reset %s\n", - ccb->ccb_h.func_code == XPT_RESET_BUS? "bus" : "device"); + if (ccb->ccb_h.func_code == XPT_RESET_BUS) { + if (bootverbose) { + xpt_print(ccb->ccb_h.path, "reset bus\n"); + } + } else { + xpt_print(ccb->ccb_h.path, "reset device\n"); + } CAMLOCK_2_MPTLOCK(mpt); (void) mpt_bus_reset(mpt, tgt, lun, FALSE); MPTLOCK_2_CAMLOCK(mpt); ==== //depot/projects/linuxolator/src/sys/dev/sound/pci/cmi.c#5 (text+ko) ==== @@ -53,7 +53,7 @@ #include "mixer_if.h" #include "mpufoi_if.h" -SND_DECLARE_FILE("$FreeBSD: src/sys/dev/sound/pci/cmi.c,v 1.40 2007/03/15 16:41:26 ariff Exp $"); +SND_DECLARE_FILE("$FreeBSD: src/sys/dev/sound/pci/cmi.c,v 1.41 2007/04/08 07:52:27 ariff Exp $"); /* Supported chip ID's */ #define CMI8338A_PCI_ID 0x010013f6 @@ -946,7 +946,8 @@ sc->st = rman_get_bustag(sc->reg); sc->sh = rman_get_bushandle(sc->reg); - cmi_midiattach(sc); + if (0) + cmi_midiattach(sc); sc->irqid = 0; sc->irq = bus_alloc_resource_any(dev, SYS_RES_IRQ, &sc->irqid, ==== //depot/projects/linuxolator/src/sys/geom/uzip/g_uzip.c#2 (text+ko) ==== @@ -25,7 +25,7 @@ */ #include <sys/cdefs.h> -__FBSDID("$FreeBSD: src/sys/geom/uzip/g_uzip.c,v 1.10 2006/01/22 15:35:14 fjoe Exp $"); +__FBSDID("$FreeBSD: src/sys/geom/uzip/g_uzip.c,v 1.11 2007/04/07 02:52:13 simokawa Exp $"); #include <sys/param.h> #include <sys/bio.h> @@ -453,7 +453,7 @@ g_topology_lock(); pp2 = g_new_providerf(gp, "%s", gp->name); pp2->sectorsize = 512; - pp2->mediasize = sc->nblocks * sc->blksz; + pp2->mediasize = (off_t)sc->nblocks * sc->blksz; pp2->flags = pp->flags & G_PF_CANDELETE; if (pp->stripesize > 0) { pp2->stripesize = pp->stripesize; ==== //depot/projects/linuxolator/src/sys/i386/i386/identcpu.c#6 (text+ko) ==== @@ -39,7 +39,7 @@ */ #include <sys/cdefs.h> -__FBSDID("$FreeBSD: src/sys/i386/i386/identcpu.c,v 1.175 2007/03/26 18:03:29 njl Exp $"); +__FBSDID("$FreeBSD: src/sys/i386/i386/identcpu.c,v 1.176 2007/04/06 18:15:02 ru Exp $"); #include "opt_cpu.h" @@ -188,20 +188,6 @@ } } - /* Detect AMD features (PTE no-execute bit, 3dnow, 64 bit mode etc) */ - if (strcmp(cpu_vendor, "GenuineIntel") == 0 || - strcmp(cpu_vendor, "AuthenticAMD") == 0) { - if (cpu_exthigh >= 0x80000001) { - do_cpuid(0x80000001, regs); - amd_feature = regs[3] & ~(cpu_feature & 0x0183f3ff); - amd_feature2 = regs[2]; - } - if (cpu_exthigh >= 0x80000008) { - do_cpuid(0x80000008, regs); - cpu_procinfo2 = regs[2]; - } - } - if (strcmp(cpu_vendor, "GenuineIntel") == 0) { if ((cpu_id & 0xf00) > 0x300) { u_int brand_index; @@ -1104,7 +1090,20 @@ u_char ccr3; u_int regs[4]; - if (strcmp(cpu_vendor, "CyrixInstead") == 0) { + /* Detect AMD features (PTE no-execute bit, 3dnow, 64 bit mode etc) */ + if (strcmp(cpu_vendor, "GenuineIntel") == 0 || + strcmp(cpu_vendor, "AuthenticAMD") == 0) { + init_exthigh(); + if (cpu_exthigh >= 0x80000001) { + do_cpuid(0x80000001, regs); + amd_feature = regs[3] & ~(cpu_feature & 0x0183f3ff); + amd_feature2 = regs[2]; + } + if (cpu_exthigh >= 0x80000008) { + do_cpuid(0x80000008, regs); + cpu_procinfo2 = regs[2]; + } + } else if (strcmp(cpu_vendor, "CyrixInstead") == 0) { if (cpu == CPU_486) { /* * These conditions are equivalent to: ==== //depot/projects/linuxolator/src/sys/i386/i386/initcpu.c#2 (text+ko) ==== @@ -28,7 +28,7 @@ */ #include <sys/cdefs.h> -__FBSDID("$FreeBSD: src/sys/i386/i386/initcpu.c,v 1.55 2006/07/12 19:46:08 mr Exp $"); +__FBSDID("$FreeBSD: src/sys/i386/i386/initcpu.c,v 1.56 2007/04/06 18:15:02 ru Exp $"); #include "opt_cpu.h" @@ -41,6 +41,9 @@ #include <machine/md_var.h> #include <machine/specialreg.h> +#include <vm/vm.h> +#include <vm/pmap.h> + #if !defined(CPU_DISABLE_SSE) && defined(I686_CPU) #define CPU_ENABLE_SSE #endif @@ -686,6 +689,15 @@ break; } } +#ifdef PAE + if ((amd_feature & AMDID_NX) != 0) { + uint64_t msr; + + msr = rdmsr(MSR_EFER) | EFER_NXE; + wrmsr(MSR_EFER, msr); + pg_nx = PG_NX; + } +#endif break; #endif default: ==== //depot/projects/linuxolator/src/sys/i386/i386/minidump_machdep.c#2 (text) ==== @@ -25,7 +25,7 @@ */ #include <sys/cdefs.h> -__FBSDID("$FreeBSD: src/sys/i386/i386/minidump_machdep.c,v 1.2 2006/06/05 18:21:29 emaste Exp $"); +__FBSDID("$FreeBSD: src/sys/i386/i386/minidump_machdep.c,v 1.3 2007/04/06 18:15:02 ru Exp $"); #include <sys/param.h> #include <sys/systm.h> @@ -211,7 +211,7 @@ j = va >> PDRSHIFT; if ((pd[j] & (PG_PS | PG_V)) == (PG_PS | PG_V)) { /* This is an entire 2M page. */ - pa = pd[j] & PG_FRAME & ~PDRMASK; + pa = pd[j] & PG_PS_FRAME; for (k = 0; k < NPTEPG; k++) { if (is_dumpable(pa)) >>> TRUNCATED FOR MAIL (1000 lines) <<<
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200704080928.l389SksY001193>