Remove fd driver from its old home and change files which include rtc.h
to account for its new location.
This commit is contained in:
parent
59ecca76d8
commit
6548b974e9
@ -35,7 +35,7 @@
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* from: @(#)machdep.c 7.4 (Berkeley) 6/3/91
|
||||
* $Id: machdep.c,v 1.334 1999/05/06 00:54:44 luoqi Exp $
|
||||
* $Id: machdep.c,v 1.335 1999/05/12 21:38:42 luoqi Exp $
|
||||
*/
|
||||
|
||||
#include "apm.h"
|
||||
@ -125,7 +125,7 @@
|
||||
#endif
|
||||
#include <i386/isa/intr_machdep.h>
|
||||
#ifndef VM86
|
||||
#include <i386/isa/rtc.h>
|
||||
#include <isa/rtc.h>
|
||||
#endif
|
||||
#include <machine/random.h>
|
||||
#include <sys/ptrace.h>
|
||||
|
@ -34,7 +34,7 @@
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* from: @(#)clock.c 7.2 (Berkeley) 5/12/91
|
||||
* $Id: clock.c,v 1.134 1999/05/28 14:08:59 bde Exp $
|
||||
* $Id: clock.c,v 1.135 1999/05/29 06:57:55 phk Exp $
|
||||
*/
|
||||
|
||||
/*
|
||||
@ -84,7 +84,7 @@
|
||||
|
||||
#include <i386/isa/icu.h>
|
||||
#include <i386/isa/isa.h>
|
||||
#include <i386/isa/rtc.h>
|
||||
#include <isa/rtc.h>
|
||||
#include <i386/isa/timerreg.h>
|
||||
|
||||
#include <i386/isa/intr_machdep.h>
|
||||
|
@ -34,7 +34,7 @@
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* from: @(#)clock.c 7.2 (Berkeley) 5/12/91
|
||||
* $Id: clock.c,v 1.134 1999/05/28 14:08:59 bde Exp $
|
||||
* $Id: clock.c,v 1.135 1999/05/29 06:57:55 phk Exp $
|
||||
*/
|
||||
|
||||
/*
|
||||
@ -84,7 +84,7 @@
|
||||
|
||||
#include <i386/isa/icu.h>
|
||||
#include <i386/isa/isa.h>
|
||||
#include <i386/isa/rtc.h>
|
||||
#include <isa/rtc.h>
|
||||
#include <i386/isa/timerreg.h>
|
||||
|
||||
#include <i386/isa/intr_machdep.h>
|
||||
|
@ -35,7 +35,7 @@
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* from: @(#)machdep.c 7.4 (Berkeley) 6/3/91
|
||||
* $Id: machdep.c,v 1.334 1999/05/06 00:54:44 luoqi Exp $
|
||||
* $Id: machdep.c,v 1.335 1999/05/12 21:38:42 luoqi Exp $
|
||||
*/
|
||||
|
||||
#include "apm.h"
|
||||
@ -125,7 +125,7 @@
|
||||
#endif
|
||||
#include <i386/isa/intr_machdep.h>
|
||||
#ifndef VM86
|
||||
#include <i386/isa/rtc.h>
|
||||
#include <isa/rtc.h>
|
||||
#endif
|
||||
#include <machine/random.h>
|
||||
#include <sys/ptrace.h>
|
||||
|
@ -34,7 +34,7 @@
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* from: @(#)clock.c 7.2 (Berkeley) 5/12/91
|
||||
* $Id: clock.c,v 1.134 1999/05/28 14:08:59 bde Exp $
|
||||
* $Id: clock.c,v 1.135 1999/05/29 06:57:55 phk Exp $
|
||||
*/
|
||||
|
||||
/*
|
||||
@ -84,7 +84,7 @@
|
||||
|
||||
#include <i386/isa/icu.h>
|
||||
#include <i386/isa/isa.h>
|
||||
#include <i386/isa/rtc.h>
|
||||
#include <isa/rtc.h>
|
||||
#include <i386/isa/timerreg.h>
|
||||
|
||||
#include <i386/isa/intr_machdep.h>
|
||||
|
@ -34,7 +34,7 @@
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* from: @(#)clock.c 7.2 (Berkeley) 5/12/91
|
||||
* $Id: clock.c,v 1.134 1999/05/28 14:08:59 bde Exp $
|
||||
* $Id: clock.c,v 1.135 1999/05/29 06:57:55 phk Exp $
|
||||
*/
|
||||
|
||||
/*
|
||||
@ -84,7 +84,7 @@
|
||||
|
||||
#include <i386/isa/icu.h>
|
||||
#include <i386/isa/isa.h>
|
||||
#include <i386/isa/rtc.h>
|
||||
#include <isa/rtc.h>
|
||||
#include <i386/isa/timerreg.h>
|
||||
|
||||
#include <i386/isa/intr_machdep.h>
|
||||
|
2398
sys/i386/isa/fd.c
2398
sys/i386/isa/fd.c
File diff suppressed because it is too large
Load Diff
@ -1,95 +0,0 @@
|
||||
/*-
|
||||
* Copyright (c) 1990 The Regents of the University of California.
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* 3. All advertising materials mentioning features or use of this software
|
||||
* must display the following acknowledgement:
|
||||
* This product includes software developed by the University of
|
||||
* California, Berkeley and its contributors.
|
||||
* 4. Neither the name of the University nor the names of its contributors
|
||||
* may be used to endorse or promote products derived from this software
|
||||
* without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* from: @(#)fd.c 7.4 (Berkeley) 5/25/91
|
||||
* $Id: fdc.h,v 1.13 1999/01/15 09:15:27 bde Exp $
|
||||
*
|
||||
*/
|
||||
|
||||
enum fdc_type
|
||||
{
|
||||
FDC_NE765, FDC_I82077, FDC_NE72065, FDC_UNKNOWN = -1
|
||||
};
|
||||
|
||||
|
||||
/***********************************************************************\
|
||||
* Per controller structure. *
|
||||
\***********************************************************************/
|
||||
struct fdc_data
|
||||
{
|
||||
int fdcu; /* our unit number */
|
||||
int baseport;
|
||||
int dmachan;
|
||||
int flags;
|
||||
#define FDC_ATTACHED 0x01
|
||||
#define FDC_HASFTAPE 0x02
|
||||
#define FDC_TAPE_BUSY 0x04
|
||||
#define FDC_STAT_VALID 0x08
|
||||
#define FDC_HAS_FIFO 0x10
|
||||
#define FDC_NEEDS_RESET 0x20
|
||||
#ifdef FDC_YE
|
||||
#define FDC_PCMCIA 0x40
|
||||
#define FDC_UNLOADED 0x80
|
||||
#endif
|
||||
struct fd_data *fd;
|
||||
int fdu; /* the active drive */
|
||||
int state;
|
||||
int retry;
|
||||
int fdout; /* mirror of the w/o digital output reg */
|
||||
u_int status[7]; /* copy of the registers */
|
||||
enum fdc_type fdct; /* chip version of FDC */
|
||||
int fdc_errs; /* number of logged errors */
|
||||
struct buf_queue_head head;
|
||||
struct buf *bp; /* active buffer */
|
||||
struct resource *res_ioport, *res_irq, *res_drq;
|
||||
int rid_ioport, rid_irq, rid_drq;
|
||||
void *fdc_intr;
|
||||
struct device *fdc_dev;
|
||||
};
|
||||
|
||||
/***********************************************************************\
|
||||
* Throughout this file the following conventions will be used: *
|
||||
* fd is a pointer to the fd_data struct for the drive in question *
|
||||
* fdc is a pointer to the fdc_data struct for the controller *
|
||||
* fdu is the floppy drive unit number *
|
||||
* fdcu is the floppy controller unit number *
|
||||
* fdsu is the floppy drive unit number on that controller. (sub-unit) *
|
||||
\***********************************************************************/
|
||||
typedef int fdu_t;
|
||||
typedef int fdcu_t;
|
||||
typedef int fdsu_t;
|
||||
typedef struct fd_data *fd_p;
|
||||
typedef struct fdc_data *fdc_p;
|
||||
typedef enum fdc_type fdc_t;
|
||||
|
||||
#define FDUNIT(s) (((s)>>6)&03)
|
||||
#define FDTYPE(s) ((s)&077)
|
@ -1,69 +0,0 @@
|
||||
/*-
|
||||
* Copyright (c) 1991 The Regents of the University of California.
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* 3. All advertising materials mentioning features or use of this software
|
||||
* must display the following acknowledgement:
|
||||
* This product includes software developed by the University of
|
||||
* California, Berkeley and its contributors.
|
||||
* 4. Neither the name of the University nor the names of its contributors
|
||||
* may be used to endorse or promote products derived from this software
|
||||
* without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* from: @(#)fdreg.h 7.1 (Berkeley) 5/9/91
|
||||
* $Id$
|
||||
*/
|
||||
|
||||
/*
|
||||
* AT floppy controller registers and bitfields
|
||||
*/
|
||||
|
||||
/* uses NEC765 controller */
|
||||
#include <i386/isa/ic/nec765.h>
|
||||
|
||||
/* registers */
|
||||
#define FDOUT 2 /* Digital Output Register (W) */
|
||||
#define FDO_FDSEL 0x03 /* floppy device select */
|
||||
#define FDO_FRST 0x04 /* floppy controller reset */
|
||||
#define FDO_FDMAEN 0x08 /* enable floppy DMA and Interrupt */
|
||||
#define FDO_MOEN0 0x10 /* motor enable drive 0 */
|
||||
#define FDO_MOEN1 0x20 /* motor enable drive 1 */
|
||||
#define FDO_MOEN2 0x40 /* motor enable drive 2 */
|
||||
#define FDO_MOEN3 0x80 /* motor enable drive 3 */
|
||||
|
||||
#define FDSTS 4 /* NEC 765 Main Status Register (R) */
|
||||
#define FDDATA 5 /* NEC 765 Data Register (R/W) */
|
||||
#define FDCTL 7 /* Control Register (W) */
|
||||
|
||||
#ifndef FDC_500KBPS
|
||||
# define FDC_500KBPS 0x00 /* 500KBPS MFM drive transfer rate */
|
||||
# define FDC_300KBPS 0x01 /* 300KBPS MFM drive transfer rate */
|
||||
# define FDC_250KBPS 0x02 /* 250KBPS MFM drive transfer rate */
|
||||
# define FDC_125KBPS 0x03 /* 125KBPS FM drive transfer rate */
|
||||
/* for some controllers 1MPBS instead */
|
||||
#endif /* FDC_500KBPS */
|
||||
|
||||
#define FDIN 7 /* Digital Input Register (R) */
|
||||
#define FDI_DCHG 0x80 /* diskette has been changed */
|
||||
/* requires drive and motor being selected */
|
||||
/* is cleared by any step pulse to drive */
|
@ -1,142 +0,0 @@
|
||||
/*-
|
||||
* Copyright (c) 1991 The Regents of the University of California.
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* 3. All advertising materials mentioning features or use of this software
|
||||
* must display the following acknowledgement:
|
||||
* This product includes software developed by the University of
|
||||
* California, Berkeley and its contributors.
|
||||
* 4. Neither the name of the University nor the names of its contributors
|
||||
* may be used to endorse or promote products derived from this software
|
||||
* without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* from: @(#)nec765.h 7.1 (Berkeley) 5/9/91
|
||||
* $Id: nec765.h,v 1.6 1997/02/22 09:38:04 peter Exp $
|
||||
*/
|
||||
|
||||
/*
|
||||
* Nec 765 floppy disc controller definitions
|
||||
*/
|
||||
|
||||
/* Main status register */
|
||||
#define NE7_DAB 0x01 /* Diskette drive A is seeking, thus busy */
|
||||
#define NE7_DBB 0x02 /* Diskette drive B is seeking, thus busy */
|
||||
#define NE7_CB 0x10 /* Diskette Controller Busy */
|
||||
#define NE7_NDM 0x20 /* Diskette Controller in Non Dma Mode */
|
||||
#define NE7_DIO 0x40 /* Diskette Controller Data register I/O */
|
||||
#define NE7_RQM 0x80 /* Diskette Controller ReQuest for Master */
|
||||
|
||||
/* Status register ST0 */
|
||||
#define NE7_ST0BITS "\020\010invld\007abnrml\006seek_cmplt\005equ_chck\004drive_notrdy\003top_head"
|
||||
|
||||
#define NE7_ST0_IC 0xc0 /* interrupt completion code */
|
||||
|
||||
#define NE7_ST0_IC_RC 0xc0 /* terminated due to ready changed, n/a */
|
||||
#define NE7_ST0_IC_IV 0x80 /* invalid command; must reset FDC */
|
||||
#define NE7_ST0_IC_AT 0x40 /* abnormal termination, check error stat */
|
||||
#define NE7_ST0_IC_NT 0x00 /* normal termination */
|
||||
|
||||
#define NE7_ST0_SE 0x20 /* seek end */
|
||||
#define NE7_ST0_EC 0x10 /* equipment check, recalibrated but no trk0 */
|
||||
#define NE7_ST0_NR 0x08 /* not ready (n/a) */
|
||||
#define NE7_ST0_HD 0x04 /* upper head selected */
|
||||
#define NE7_ST0_DR 0x03 /* drive code */
|
||||
|
||||
/* Status register ST1 */
|
||||
#define NE7_ST1BITS "\020\010end_of_cyl\006bad_crc\005data_overrun\003sec_not_fnd\002write_protect\001no_am"
|
||||
|
||||
#define NE7_ST1_EN 0x80 /* end of cylinder, access past last record */
|
||||
#define NE7_ST1_DE 0x20 /* data error, CRC fail in ID or data */
|
||||
#define NE7_ST1_OR 0x10 /* DMA overrun, DMA failed to do i/o quickly */
|
||||
#define NE7_ST1_ND 0x04 /* no data, sector not found or CRC in ID f. */
|
||||
#define NE7_ST1_NW 0x02 /* not writeable, attempt to violate WP */
|
||||
#define NE7_ST1_MA 0x01 /* missing address mark (in ID or data field)*/
|
||||
|
||||
/* Status register ST2 */
|
||||
#define NE7_ST2BITS "\020\007ctrl_mrk\006bad_crc\005wrong_cyl\004scn_eq\003scn_not_fnd\002bad_cyl\001no_dam"
|
||||
|
||||
#define NE7_ST2_CM 0x40 /* control mark; found deleted data */
|
||||
#define NE7_ST2_DD 0x20 /* data error in data field, CRC fail */
|
||||
#define NE7_ST2_WC 0x10 /* wrong cylinder, ID field mismatches cmd */
|
||||
#define NE7_ST2_SH 0x08 /* scan equal hit */
|
||||
#define NE7_ST2_SN 0x04 /* scan not satisfied */
|
||||
#define NE7_ST2_BC 0x02 /* bad cylinder, cylinder marked 0xff */
|
||||
#define NE7_ST2_MD 0x01 /* missing address mark in data field */
|
||||
|
||||
/* Status register ST3 */
|
||||
#define NE7_ST3BITS "\020\010fault\007write_protect\006drdy\005tk0\004two_side\003side_sel\002"
|
||||
|
||||
#define NE7_ST3_FT 0x80 /* fault; PC: n/a */
|
||||
#define NE7_ST3_WP 0x40 /* write protected */
|
||||
#define NE7_ST3_RD 0x20 /* ready; PC: always true */
|
||||
#define NE7_ST3_T0 0x10 /* track 0 */
|
||||
#define NE7_ST3_TS 0x08 /* two-sided; PC: n/a */
|
||||
#define NE7_ST3_HD 0x04 /* upper head select */
|
||||
#define NE7_ST3_US 0x03 /* unit select */
|
||||
|
||||
/* Commands */
|
||||
/*
|
||||
* the top three bits -- where appropriate -- are set as follows:
|
||||
*
|
||||
* 0x80 - MT multi-track; allow both sides to be handled in single cmd
|
||||
* 0x40 - MFM modified frequency modulation; use MFM encoding
|
||||
* 0x20 - SK skip; skip sectors marked as "deleted"
|
||||
*/
|
||||
#define NE7CMD_READTRK 0x42 /* read whole track */
|
||||
#define NE7CMD_SPECIFY 3 /* specify drive parameters - requires unit
|
||||
parameters byte */
|
||||
#define NE7CMD_SENSED 4 /* sense drive - requires unit select byte */
|
||||
#define NE7CMD_WRITE 0xc5 /* write - requires eight additional bytes */
|
||||
#define NE7CMD_READ 0xe6 /* read - requires eight additional bytes */
|
||||
#define NE7CMD_RECAL 7 /* recalibrate drive - requires
|
||||
unit select byte */
|
||||
#define NE7CMD_SENSEI 8 /* sense controller interrupt status */
|
||||
#define NE7CMD_WRITEDEL 0xc9 /* write deleted data */
|
||||
#define NE7CMD_READID 0x4a /* read ID field */
|
||||
#define NE7CMD_READDEL 0xec /* read deleted data */
|
||||
#define NE7CMD_FORMAT 0x4d /* format - requires five additional bytes */
|
||||
#define NE7CMD_SEEK 0x0f /* seek drive - requires unit select byte
|
||||
and new cyl byte */
|
||||
#define NE7CMD_SCNEQU 0xf1 /* scan equal */
|
||||
#define NE7CMD_SCNLE 0xf9 /* scan less or equal */
|
||||
#define NE7CMD_SCNGE 0xfd /* scan greater or equal */
|
||||
|
||||
/*
|
||||
* Enhanced controller commands:
|
||||
*/
|
||||
#define NE7CMD_VERSION 0x10 /* version (ok for all controllers) */
|
||||
|
||||
#define I8207X_CONFIGURE 0x13 /* configure enhanced features */
|
||||
|
||||
/*
|
||||
* "specify" definitions
|
||||
*
|
||||
* acronyms (times are relative to a FDC clock of 8 MHz):
|
||||
* srt - step rate; PC usually 3 ms
|
||||
* hut - head unload time; PC usually maximum of 240 ms
|
||||
* hlt - head load time; PC usually minimum of 2 ms
|
||||
* nd - no DMA flag; PC usually not set (0)
|
||||
*/
|
||||
|
||||
#define NE7_SPEC_1(srt, hut) (((16 - (srt)) << 4) | (((hut) / 16)))
|
||||
#define NE7_SPEC_2(hlt, nd) (((hlt) & 0xFE) | ((nd) & 1))
|
@ -1,117 +0,0 @@
|
||||
/*-
|
||||
* Copyright (c) 1990 The Regents of the University of California.
|
||||
* All rights reserved.
|
||||
*
|
||||
* This code is derived from software contributed to Berkeley by
|
||||
* William Jolitz.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* 3. All advertising materials mentioning features or use of this software
|
||||
* must display the following acknowledgement:
|
||||
* This product includes software developed by the University of
|
||||
* California, Berkeley and its contributors.
|
||||
* 4. Neither the name of the University nor the names of its contributors
|
||||
* may be used to endorse or promote products derived from this software
|
||||
* without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* from: @(#)rtc.h 7.1 (Berkeley) 5/12/91
|
||||
* $Id: rtc.h,v 1.10 1997/02/22 09:37:03 peter Exp $
|
||||
*/
|
||||
|
||||
#ifndef _I386_ISA_RTC_H_
|
||||
#define _I386_ISA_RTC_H_ 1
|
||||
|
||||
/*
|
||||
* MC146818 RTC Register locations
|
||||
*/
|
||||
|
||||
#define RTC_SEC 0x00 /* seconds */
|
||||
#define RTC_SECALRM 0x01 /* seconds alarm */
|
||||
#define RTC_MIN 0x02 /* minutes */
|
||||
#define RTC_MINALRM 0x03 /* minutes alarm */
|
||||
#define RTC_HRS 0x04 /* hours */
|
||||
#define RTC_HRSALRM 0x05 /* hours alarm */
|
||||
#define RTC_WDAY 0x06 /* week day */
|
||||
#define RTC_DAY 0x07 /* day of month */
|
||||
#define RTC_MONTH 0x08 /* month of year */
|
||||
#define RTC_YEAR 0x09 /* month of year */
|
||||
|
||||
#define RTC_STATUSA 0x0a /* status register A */
|
||||
#define RTCSA_TUP 0x80 /* time update, don't look now */
|
||||
#define RTCSA_RESET 0x70 /* reset divider */
|
||||
#define RTCSA_DIVIDER 0x20 /* divider correct for 32768 Hz */
|
||||
#define RTCSA_8192 0x03 /* 8192 Hz interrupt */
|
||||
#define RTCSA_4096 0x04
|
||||
#define RTCSA_2048 0x05
|
||||
#define RTCSA_1024 0x06 /* default for profiling */
|
||||
#define RTCSA_PROF RTCSA_1024
|
||||
#define RTC_PROFRATE 1024
|
||||
#define RTCSA_512 0x07
|
||||
#define RTCSA_256 0x08
|
||||
#define RTCSA_128 0x09
|
||||
#define RTCSA_NOPROF RTCSA_128
|
||||
#define RTC_NOPROFRATE 128
|
||||
#define RTCSA_64 0x0a
|
||||
#define RTCSA_32 0x0b /* 32 Hz interrupt */
|
||||
|
||||
#define RTC_STATUSB 0x0b /* status register B */
|
||||
#define RTCSB_DST 0x01 /* USA Daylight Savings Time enable */
|
||||
#define RTCSB_24HR 0x02 /* 0 = 12 hours, 1 = 24 hours */
|
||||
#define RTCSB_BCD 0x04 /* 0 = BCD, 1 = Binary coded time */
|
||||
#define RTCSB_SQWE 0x08 /* 1 = output sqare wave at SQW pin */
|
||||
#define RTCSB_UINTR 0x10 /* 1 = enable update-ended interrupt */
|
||||
#define RTCSB_AINTR 0x20 /* 1 = enable alarm interrupt */
|
||||
#define RTCSB_PINTR 0x40 /* 1 = enable periodic clock interrupt */
|
||||
#define RTCSB_HALT 0x80 /* stop clock updates */
|
||||
|
||||
#define RTC_INTR 0x0c /* status register C (R) interrupt source */
|
||||
#define RTCIR_UPDATE 0x10 /* update intr */
|
||||
#define RTCIR_ALARM 0x20 /* alarm intr */
|
||||
#define RTCIR_PERIOD 0x40 /* periodic intr */
|
||||
#define RTCIR_INT 0x80 /* interrupt output signal */
|
||||
|
||||
#define RTC_STATUSD 0x0d /* status register D (R) Lost Power */
|
||||
#define RTCSD_PWR 0x80 /* clock power OK */
|
||||
|
||||
#define RTC_DIAG 0x0e /* status register E - bios diagnostic */
|
||||
#define RTCDG_BITS "\020\010clock_battery\007ROM_cksum\006config_unit\005memory_size\004fixed_disk\003invalid_time"
|
||||
|
||||
#define RTC_RESET 0x0f /* status register F - reset code byte */
|
||||
#define RTCRS_RST 0x00 /* normal reset */
|
||||
#define RTCRS_LOAD 0x04 /* load system */
|
||||
|
||||
#define RTC_FDISKETTE 0x10 /* diskette drive type in upper/lower nibble */
|
||||
#define RTCFDT_NONE 0 /* none present */
|
||||
#define RTCFDT_360K 0x10 /* 360K */
|
||||
#define RTCFDT_12M 0x20 /* 1.2M */
|
||||
#define RTCFDT_720K 0x30 /* 720K */
|
||||
#define RTCFDT_144M 0x40 /* 1.44M */
|
||||
#define RTCFDT_288M_1 0x50 /* 2.88M, some BIOSes */
|
||||
#define RTCFDT_288M 0x60 /* 2.88M */
|
||||
|
||||
#define RTC_BASELO 0x15 /* low byte of basemem size */
|
||||
#define RTC_BASEHI 0x16 /* high byte of basemem size */
|
||||
#define RTC_EXTLO 0x17 /* low byte of extended mem size */
|
||||
#define RTC_EXTHI 0x18 /* low byte of extended mem size */
|
||||
|
||||
#define RTC_CENTURY 0x32 /* current century */
|
||||
#endif /* _I386_ISA_RTC_H_ */
|
@ -34,7 +34,7 @@
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* from: @(#)clock.c 7.2 (Berkeley) 5/12/91
|
||||
* $Id: clock.c,v 1.134 1999/05/28 14:08:59 bde Exp $
|
||||
* $Id: clock.c,v 1.135 1999/05/29 06:57:55 phk Exp $
|
||||
*/
|
||||
|
||||
/*
|
||||
@ -84,7 +84,7 @@
|
||||
|
||||
#include <i386/isa/icu.h>
|
||||
#include <i386/isa/isa.h>
|
||||
#include <i386/isa/rtc.h>
|
||||
#include <isa/rtc.h>
|
||||
#include <i386/isa/timerreg.h>
|
||||
|
||||
#include <i386/isa/intr_machdep.h>
|
||||
|
Loading…
Reference in New Issue
Block a user