diff options
author | Roland McGrath <roland@gnu.org> | 2001-04-05 06:39:21 +0000 |
---|---|---|
committer | Roland McGrath <roland@gnu.org> | 2001-04-05 06:39:21 +0000 |
commit | b42bd0d675ec7d1e1fbbf274fadbea984c8dab22 (patch) | |
tree | a7f61083f2dfa365d5d9e7101c72e8cb5b3b16a9 /i386/i386at/fd.c | |
parent | 2d43f4abdedd003eb070d633bac0e3a6fb3a746b (diff) |
2001-04-04 Roland McGrath <roland@frob.com>
* ddb/db_access.h: Fix obsolescent #else/#endif syntax.
* ddb/db_aout.c: Likewise.
* ddb/db_break.c: Likewise.
* ddb/db_break.h: Likewise.
* ddb/db_command.c: Likewise.
* ddb/db_command.h: Likewise.
* ddb/db_cond.c: Likewise.
* ddb/db_examine.c: Likewise.
* ddb/db_expr.c: Likewise.
* ddb/db_ext_symtab.c: Likewise.
* ddb/db_input.c: Likewise.
* ddb/db_lex.c: Likewise.
* ddb/db_macro.c: Likewise.
* ddb/db_mp.c: Likewise.
* ddb/db_output.c: Likewise.
* ddb/db_print.c: Likewise.
* ddb/db_run.c: Likewise.
* ddb/db_sym.c: Likewise.
* ddb/db_task_thread.c: Likewise.
* ddb/db_task_thread.h: Likewise.
* ddb/db_trap.c: Likewise.
* ddb/db_variables.c: Likewise.
* ddb/db_watch.c: Likewise.
* ddb/db_watch.h: Likewise.
* ddb/db_write_cmd.c: Likewise.
* device/dev_pager.c: Likewise.
* device/device_port.h: Likewise.
* device/device_types_kernel.h: Likewise.
* device/ds_routines.h: Likewise.
* device/errno.h: Likewise.
* device/if_ether.h: Likewise.
* device/if_hdr.h: Likewise.
* device/io_req.h: Likewise.
* device/net_io.c: Likewise.
* device/net_io.h: Likewise.
* i386/i386/ast_check.c: Likewise.
* i386/i386/cswitch.S: Likewise.
* i386/i386/db_disasm.c: Likewise.
* i386/i386/db_interface.c: Likewise.
* i386/i386/db_trace.c: Likewise.
* i386/i386/debug.h: Likewise.
* i386/i386/debug_i386.c: Likewise.
* i386/i386/debug_trace.S: Likewise.
* i386/i386/eflags.h: Likewise.
* i386/i386/gdt.h: Likewise.
* i386/i386/hardclock.c: Likewise.
* i386/i386/idt-gen.h: Likewise.
* i386/i386/ipl.h: Likewise.
* i386/i386/ktss.h: Likewise.
* i386/i386/kttd_interface.c: Likewise.
* i386/i386/ldt.h: Likewise.
* i386/i386/lock.h: Likewise.
* i386/i386/locore.S: Likewise.
* i386/i386/mp_desc.h: Likewise.
* i386/i386/pic.c: Likewise.
* i386/i386/pic.h: Likewise.
* i386/i386/pio.h: Likewise.
* i386/i386/pit.h: Likewise.
* i386/i386/seg.h: Likewise.
* i386/i386/thread.h: Likewise.
* i386/i386/trap.c: Likewise.
* i386/i386/trap.h: Likewise.
* i386/i386/vm_param.h: Likewise.
* i386/i386/vm_tuning.h: Likewise.
* i386/i386at/autoconf.c: Likewise.
* i386/i386at/blit.c: Likewise.
* i386/i386at/conf.c: Likewise.
* i386/i386at/fd.c: Likewise.
* i386/i386at/idt.h: Likewise.
* i386/i386at/immc.c: Likewise.
* i386/i386at/kd.c: Likewise.
* i386/i386at/kd_event.c: Likewise.
* i386/i386at/kd_mouse.c: Likewise.
* i386/i386at/model_dep.c: Likewise.
* i386/i386at/rtc.c: Likewise.
* i386/include/mach/i386/asm.h: Likewise.
* i386/include/mach/i386/eflags.h: Likewise.
* i386/include/mach/i386/mach_i386.defs: Likewise.
* i386/include/mach/i386/multiboot.h: Likewise.
* i386/include/mach/i386/trap.h: Likewise.
* i386/include/mach/i386/vm_types.h: Likewise.
* i386/include/mach/sa/stdarg.h: Likewise.
* i386/intel/pmap.c: Likewise.
* i386/intel/pmap.h: Likewise.
* include/alloca.h: Likewise.
* include/device/device_types.defs: Likewise.
* include/device/device_types.h: Likewise.
* include/device/disk_status.h: Likewise.
* include/device/net_status.h: Likewise.
* include/mach/mach.defs: Likewise.
* include/mach/memory_object.defs: Likewise.
* include/mach/std_types.defs: Likewise.
* include/mach_debug/hash_info.h: Likewise.
* include/mach_debug/ipc_info.h: Likewise.
* include/mach_debug/mach_debug.defs: Likewise.
* include/mach_debug/mach_debug_types.defs: Likewise.
* include/mach_debug/mach_debug_types.h: Likewise.
* include/mach_debug/vm_info.h: Likewise.
* include/mach_debug/zone_info.h: Likewise.
* include/sys/ioctl.h: Likewise.
* include/sys/time.h: Likewise.
* ipc/ipc_entry.h: Likewise.
* ipc/ipc_hash.h: Likewise.
* ipc/ipc_init.c: Likewise.
* ipc/ipc_kmsg.c: Likewise.
* ipc/ipc_kmsg.h: Likewise.
* ipc/ipc_marequest.c: Likewise.
* ipc/ipc_marequest.h: Likewise.
* ipc/ipc_mqueue.c: Likewise.
* ipc/ipc_mqueue.h: Likewise.
* ipc/ipc_notify.c: Likewise.
* ipc/ipc_notify.h: Likewise.
* ipc/ipc_object.c: Likewise.
* ipc/ipc_object.h: Likewise.
* ipc/ipc_port.c: Likewise.
* ipc/ipc_port.h: Likewise.
* ipc/ipc_pset.c: Likewise.
* ipc/ipc_pset.h: Likewise.
* ipc/ipc_right.c: Likewise.
* ipc/ipc_right.h: Likewise.
* ipc/ipc_space.c: Likewise.
* ipc/ipc_space.h: Likewise.
* ipc/mach_debug.c: Likewise.
* ipc/mach_msg.c: Likewise.
* ipc/mach_msg.h: Likewise.
* ipc/mach_port.c: Likewise.
* kern/act.c: Likewise.
* kern/assert.h: Likewise.
* kern/ast.c: Likewise.
* kern/ast.h: Likewise.
* kern/bootstrap.c: Likewise.
* kern/counters.c: Likewise.
* kern/counters.h: Likewise.
* kern/debug.h: Likewise.
* kern/exception.c: Likewise.
* kern/host.h: Likewise.
* kern/ipc_host.c: Likewise.
* kern/ipc_host.h: Likewise.
* kern/ipc_kobject.c: Likewise.
* kern/ipc_mig.c: Likewise.
* kern/ipc_tt.c: Likewise.
* kern/ipc_tt.h: Likewise.
* kern/kalloc.h: Likewise.
* kern/lock_mon.c: Likewise.
* kern/mach_clock.c: Likewise.
* kern/mach_factor.c: Likewise.
* kern/mach_param.h: Likewise.
* kern/machine.c: Likewise.
* kern/processor.c: Likewise.
* kern/profile.c: Likewise.
* kern/queue.h: Likewise.
* kern/sched.h: Likewise.
* kern/startup.c: Likewise.
* kern/syscall_emulation.h: Likewise.
* kern/syscall_subr.c: Likewise.
* kern/syscall_subr.h: Likewise.
* kern/syscall_sw.c: Likewise.
* kern/syscall_sw.h: Likewise.
* kern/task.h: Likewise.
* kern/thread_swap.h: Likewise.
* kern/time_out.h: Likewise.
* kern/time_stamp.c: Likewise.
* kern/time_stamp.h: Likewise.
* kern/timer.c: Likewise.
* kern/timer.h: Likewise.
* kern/xpr.c: Likewise.
* kern/xpr.h: Likewise.
* kern/zalloc.c: Likewise.
* kern/zalloc.h: Likewise.
* linux/dev/drivers/block/ide.c: Likewise.
* linux/dev/include/linux/blk.h: Likewise.
* linux/src/include/linux/cdrom.h: Likewise.
* linux/src/include/linux/md.h: Likewise.
* util/cpu.h: Likewise.
* vm/memory_object.c: Likewise.
* vm/memory_object.h: Likewise.
* vm/pmap.h: Likewise.
* vm/vm_debug.c: Likewise.
* vm/vm_external.h: Likewise.
* vm/vm_fault.c: Likewise.
* vm/vm_fault.h: Likewise.
* vm/vm_kern.h: Likewise.
* vm/vm_map.c: Likewise.
* vm/vm_map.h: Likewise.
* vm/vm_object.h: Likewise.
* vm/vm_pageout.c: Likewise.
* vm/vm_pageout.h: Likewise.
* vm/vm_user.h: Likewise.
Diffstat (limited to 'i386/i386at/fd.c')
-rw-r--r-- | i386/i386at/fd.c | 106 |
1 files changed, 53 insertions, 53 deletions
diff --git a/i386/i386at/fd.c b/i386/i386at/fd.c index 773411b..82c4077 100644 --- a/i386/i386at/fd.c +++ b/i386/i386at/fd.c @@ -1,25 +1,25 @@ -/* +/* * Mach Operating System * Copyright (c) 1993,1991,1990,1989 Carnegie Mellon University * All Rights Reserved. - * + * * Permission to use, copy, modify and distribute this software and its * documentation is hereby granted, provided that both the copyright * notice and this permission notice appear in all copies of the * software, derivative works or modified versions, and any portions * thereof, and that both notices appear in supporting documentation. - * + * * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS" * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE. - * + * * Carnegie Mellon requests users of this software to return to - * + * * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU * School of Computer Science * Carnegie Mellon University * Pittsburgh PA 15213-3890 - * + * * any improvements or extensions that they make and grant Carnegie Mellon * the rights to redistribute these changes. */ @@ -57,12 +57,12 @@ WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. #include <sys/ioctl.h> #include <device/buf.h> #include <device/errno.h> -#else MACH_KERNEL +#else /* MACH_KERNEL */ #include <sys/buf.h> #include <sys/errno.h> #include <sys/user.h> #include <sys/ioctl.h> -#endif MACH_KERNEL +#endif /* MACH_KERNEL */ #include <i386/pio.h> #include <i386/machspl.h> #include <chips/busses.h> @@ -127,15 +127,15 @@ vm_offset_t FdDmaPage = (vm_offset_t) 0; vm_offset_t fd_std[NFD] = { 0 }; struct bus_device *fd_dinfo[NFD*2]; struct bus_ctlr *fd_minfo[NFD]; -struct bus_driver fddriver = +struct bus_driver fddriver = {fdprobe, fdslave, fdattach, 0, fd_std, "fd", fd_dinfo, "fdc", fd_minfo, 0}; int m765verify[MAXUNIT] = {1,1,1,1}; /* write after read flag */ - /* 0 != verify mode */ + /* 0 != verify mode */ /* 0 == not verify mode */ #ifdef MACH_KERNEL extern struct buf *geteblk(); -#endif MACH_KERNEL +#endif /* MACH_KERNEL */ #define trfrate(uip, type) outb(VFOREG(uip->addr),(((type)&RATEMASK)>>6)) #define rbskrate(uip, type) trfrate(uip,(type)&RAPID?RPSEEK:NMSEEK) @@ -170,7 +170,7 @@ struct bus_ctlr *ctlr; return 0; } (void)pmap_map(cip->b_vbuf, - (vm_offset_t)cip->b_pbuf, + (vm_offset_t)cip->b_pbuf, (vm_offset_t)cip->b_pbuf+PAGE_SIZE, VM_PROT_READ | VM_PROT_WRITE); } @@ -208,7 +208,7 @@ struct bus_device *dev; uip->b_unitf=uip; cip->b_unitf=uip; } - uip->d_drtab.dr_type &= ~OKTYPE; + uip->d_drtab.dr_type &= ~OKTYPE; printf(", port = %x, spl = %d, pic = %d.", dev->address, dev->sysdep, dev->sysdep1); @@ -220,7 +220,7 @@ struct bus_device *dev; * * TITLE: fdopen * - * ABSTRACT: Open a unit. + * ABSTRACT: Open a unit. * ****************************************************************************/ fdopen(dev, flag, otyp) @@ -247,7 +247,7 @@ int otyp; /* not used */ chkbusy(cmdp); cmdp->c_stsflag |= MTRFLAG; mtr_on(uip); - if(inb(VFOREG(uip->addr))&OPENBIT || + if(inb(VFOREG(uip->addr))&OPENBIT || !(uip->d_drtab.dr_type&OKTYPE)){ uip->d_drtab.dr_type &= ~OKTYPE; if(!rbrate(RAPID, uip)) @@ -290,7 +290,7 @@ int otyp; /* not used */ * Called on last close. mark the unit closed and not-ready. * * Unix doesn't actually "open" an inode for rootdev, swapdev or pipedev. - * If UNIT(swapdev) != UNIT(rootdev), then must add code in init() to + * If UNIT(swapdev) != UNIT(rootdev), then must add code in init() to * "open" swapdev. These devices should never be closed. * *****************************************************************************/ @@ -305,10 +305,10 @@ off_t offset; /* not used */ spl_t s; #ifdef MACH_KERNEL -#else MACH_KERNEL +#else /* MACH_KERNEL */ if ((dev == rootdev) || (dev == swapdev)) /* never close these */ return(0); -#endif MACH_KERNEL +#endif /* MACH_KERNEL */ /* Clear the bit. * If last close of drive insure drtab queue is empty before returning. @@ -321,9 +321,9 @@ off_t offset; /* not used */ splx(s); #ifdef MACH_KERNEL return(0); -#else MACH_KERNEL +#else /* MACH_KERNEL */ close(0); -#endif MACH_KERNEL +#endif /* MACH_KERNEL */ } /***************************************************************************** * @@ -357,7 +357,7 @@ struct buf *bp; /* buffer header */ bp->b_error = 0; /* set b_resid to b_bcount because we haven't done anything yet */ bp->b_resid = bp->b_bcount; - if (!(dr->dr_type & OKTYPE) || + if (!(dr->dr_type & OKTYPE) || ((sdr = getparm(MEDIATYPE(bp->b_dev)))==(struct fddrtab *)ERROR) || /* wrong parameters */ (sdr->dr_ncyl != dr->dr_ncyl) || (sdr->dr_nsec != dr->dr_nsec) || @@ -433,7 +433,7 @@ struct fdcmd *cmdp; while(cmdp->c_devflag & STRCHK){ cmdp->c_devflag |= STRWAIT; sleep(&cmdp->c_devflag,PZERO); - } + } } /*************************************************************************** * @@ -446,7 +446,7 @@ struct fdcmd *cmdp; while(cmdp->c_devflag & FDMCHK ){ cmdp->c_devflag |= FDWAIT; sleep(&cmdp->c_devflag,PZERO); - } + } } /*************************************************************************** * @@ -538,12 +538,12 @@ struct unit_info *uip; cmdp->c_rwdata[0] = RDMV; break; case B_FORMAT: - cmdp->c_dcount = FMTCNT; + cmdp->c_dcount = FMTCNT; cmdp->c_rwdata[0] = FMTM; cmdp->c_saddr = cip->b_sector / uip->d_drtab.dr_spc; resid = cip->b_sector % uip->d_drtab.dr_spc; cmdp->c_rwdata[1] = slave|((resid/uip->d_drtab.dr_nsec)<<2); - cmdp->c_rwdata[2] = + cmdp->c_rwdata[2] = ((struct fmttbl *)cip->b_buf->b_un.b_addr)->s_type; cmdp->c_rwdata[3] = uip->d_drtab.dr_nsec; cmdp->c_rwdata[4] = uip->d_drtab.dr_fgpl; @@ -563,7 +563,7 @@ struct unit_info *uip; resid = cip->b_sector % uip->d_drtab.dr_spc; cmdp->c_rwdata[3] = resid / uip->d_drtab.dr_nsec; cmdp->c_rwdata[1] = slave|(cmdp->c_rwdata[3]<<2); - cmdp->c_rwdata[2] = cmdp->c_saddr = + cmdp->c_rwdata[2] = cmdp->c_saddr = cip->b_sector / uip->d_drtab.dr_spc; cmdp->c_rwdata[4] = (resid % uip->d_drtab.dr_nsec) + 1; cmdp->c_rwdata[5] = 2; @@ -591,13 +591,13 @@ struct unit_info *uip; fdread(dev, uio) register dev_t dev; struct uio *uio; -{ +{ #ifdef MACH_KERNEL /* no need for page-size restriction */ return (block_io(fdstrategy, minphys, uio)); -#else MACH_KERNEL +#else /* MACH_KERNEL */ return(physio(fdstrategy,&fdrbuf[UNIT(dev)],dev,B_READ,fdminphys,uio)); -#endif MACH_KERNEL +#endif /* MACH_KERNEL */ } /***************************************************************************** * @@ -615,9 +615,9 @@ struct uio *uio; #ifdef MACH_KERNEL /* no need for page-size restriction */ return (block_io(fdstrategy, minphys, uio)); -#else MACH_KERNEL +#else /* MACH_KERNEL */ return(physio(fdstrategy,&fdrbuf[UNIT(dev)],dev,B_WRITE,fdminphys,uio)); -#endif MACH_KERNEL +#endif /* MACH_KERNEL */ } /***************************************************************************** * @@ -720,7 +720,7 @@ char *info; return(result); } -#else MACH_KERNEL +#else /* MACH_KERNEL */ /***************************************************************************** * * TITLE: fdioctl @@ -730,7 +730,7 @@ char *info; * CALLING ROUTINES: kernel * ****************************************************************************/ -int +int fdioctl(dev, cmd, cmdarg, flag) dev_t dev; /* major, minor numbers */ int cmd; /* command code */ @@ -751,10 +751,10 @@ int flag; /* not used */ } return(EINVAL); } -#endif MACH_KERNEL +#endif /* MACH_KERNEL */ /**************************************************************************** * - * set fd parameters + * set fd parameters * ****************************************************************************/ int @@ -782,7 +782,7 @@ long cmdarg; } /**************************************************************************** * - * get fd parameters + * get fd parameters * ****************************************************************************/ int @@ -821,7 +821,7 @@ int *cmdarg; register struct fddrtab *dr = &unit_info[UNIT(dev)].d_drtab; if(!(dr->dr_type & OKTYPE)) - return(EINVAL); + return(EINVAL); varg = (union io_arg *)cmdarg; num_trks = varg->ia_fmt.num_trks; track = (daddr_t)(varg->ia_fmt.start_trk*dr->dr_nsec); @@ -832,7 +832,7 @@ int *cmdarg; bp->b_flags &= ~B_DONE; bp->b_dev = dev; bp->b_error = 0; bp->b_resid = 0; - bp->b_flags = B_FORMAT; + bp->b_flags = B_FORMAT; bp->b_bcount = dr->dr_nsec * FMTID; bp->b_blkno = (daddr_t)((track << 9) / NBPSCTR); if(makeidtbl(bp->b_un.b_addr,dr, @@ -841,7 +841,7 @@ int *cmdarg; fdstrategy(bp); biowait(bp); if(bp->b_error) - if((bp->b_error == (char)EBBHARD) || + if((bp->b_error == (char)EBBHARD) || (bp->b_error == (char)EBBSOFT)) return(EIO); else @@ -904,11 +904,11 @@ int ctrl; struct fdcmd *cmdp = &ctrl_info[ctrl].b_cmd; if(cmdp->c_stsflag & INTROUT) untimeout(fdintr, ctrl); - cmdp->c_stsflag &= ~INTROUT; + cmdp->c_stsflag &= ~INTROUT; switch(cmdp->c_intr){ case RWFLAG: rwintr(uip); - break; + break; case SKFLAG: case SKEFLAG|SKFLAG: case RBFLAG: @@ -1000,7 +1000,7 @@ rwend: outb(0x0a, 0x06); D(printf("\n->rwierr %x ", rtn)); rwierr(uip); } else { /* write command */ - if(((cip->b_buf->b_flags&(B_FORMAT|B_READ|B_WRITE))==B_WRITE) + if(((cip->b_buf->b_flags&(B_FORMAT|B_READ|B_WRITE))==B_WRITE) && !(cip->b_buf->b_flags & B_VERIFY)) { D(printf("->w/v ")); cip->b_buf->b_flags |= B_VERIFY; @@ -1175,7 +1175,7 @@ register char seekpoint; * * TITLE: m765sweep * - * ABSTRACT: Perform an initialization sweep. + * ABSTRACT: Perform an initialization sweep. * **************************************************************************/ m765sweep(uip, cdr) @@ -1248,7 +1248,7 @@ struct unit_info *uip; cmdp->c_intr = CMDRST; if(((cip->b_buf->b_flags&(B_READ|B_VERIFY))!=(B_READ|B_VERIFY)) && uip->dev->slave) - dr->dr_type &= ~OKTYPE; + dr->dr_type &= ~OKTYPE; bp = cip->b_buf; bp->b_flags |= B_ERROR; switch(cip->b_status&BYTEMASK){ @@ -1438,7 +1438,7 @@ register int cylno; cmdp->c_intr |= WUPFLAG; outb(DATAREG(uip->addr), cylno); /* seek count */ rtn = ERROR; - while(rtn){ + while(rtn){ uip->wakeme = 1; sleep(uip, PZERO); if((rtn = sis(uip)) == ST0OK) @@ -1455,7 +1455,7 @@ register int cylno; * seek commnd routine(use interrupt) * *****************************************************************************/ -fdiseek(uip, cylno) +fdiseek(uip, cylno) struct unit_info *uip; int cylno; { @@ -1476,7 +1476,7 @@ int cylno; cylno = cylno * 2; uip->b_cmd->c_intr |= SKFLAG; outb(DATAREG(uip->addr), cylno); /* seek count */ -fdiend: +fdiend: if(rtn) rtn |= SEEKCMD<<8; return(rtn); @@ -1542,7 +1542,7 @@ struct unit_info *uip; dmalen = i386_trunc_page(address) + I386_PGBYTES - address; if ( (cip->b_rwerr&MRMASK) >= 0x10) dmalen = 0x200; - if (dmalen<=cip->b_xferdma) + if (dmalen<=cip->b_xferdma) cip->b_xferdma = dmalen; else dmalen = cip->b_xferdma; @@ -1588,9 +1588,9 @@ struct unit_info *uip; (B_READ|B_VERIFY))?TOUT:ITOUT; #ifdef MACH_KERNEL timeout(fdintr,uip->dev->ctlr,cnt0); -#else MACH_KERNEL +#else /* MACH_KERNEL */ cmdp->c_timeid = timeout(fdintr,uip->dev->ctlr,cnt0); -#endif MACH_KERNEL +#endif /* MACH_KERNEL */ } return(rtn); } @@ -1631,7 +1631,7 @@ struct unit_info *uip; int cnt0 = STSCHKCNT; while(cnt0--) - if(((ind=inb(STSREG(uip->addr))) & DATAOK) && + if(((ind=inb(STSREG(uip->addr))) & DATAOK) && ((ind & DTOCPU) == mode)) return(0); return(TIMEOUT); @@ -1655,9 +1655,9 @@ struct unit_info *uip; cmdp->c_stsflag |= MTROFF; #ifdef MACH_KERNEL timeout(mtr_off,uip,MTRSTOP); -#else MACH_KERNEL +#else /* MACH_KERNEL */ cmdp->c_mtrid = timeout(mtr_off,uip,MTRSTOP); -#endif MACH_KERNEL +#endif /* MACH_KERNEL */ } /***************************************************************************** * |