/************************************************************************/
/*      SH7604 Include File                                Ver 1.2      */
/************************************************************************/
struct st_sci {                                         /* struct SCI   */
              union {                                   /* SMR          */
                    unsigned char BYTE;                 /*  Byte Access */
                    struct {                            /*  Bit  Access */
                           unsigned char CA  :1;        /*    C/A       */
                           unsigned char CHR :1;        /*    CHR       */
                           unsigned char PE  :1;        /*    PE        */
                           unsigned char OE  :1;        /*    O/E       */
                           unsigned char STOP:1;        /*    STOP      */
                           unsigned char MP  :1;        /*    MP        */
                           unsigned char CKS :2;        /*    CKS       */
                           }      BIT;                  /*              */
                    }           SMR;                    /*              */
              unsigned char     BRR;                    /* BRR          */
              union {                                   /* SCR          */
                    unsigned char BYTE;                 /*  Byte Access */
                    struct {                            /*  Bit  Access */
                           unsigned char TIE :1;        /*    TIE       */
                           unsigned char RIE :1;        /*    RIE       */
                           unsigned char TE  :1;        /*    TE        */
                           unsigned char RE  :1;        /*    RE        */
                           unsigned char MPIE:1;        /*    MPIE      */
                           unsigned char TEIE:1;        /*    TEIE      */
                           unsigned char CKE :2;        /*    CKE       */
                           }      BIT;                  /*              */
                    }           SCR;                    /*              */
              unsigned char     TDR;                    /* TDR          */
              union {                                   /* SSR          */
                    unsigned char BYTE;                 /*  Byte Access */
                    struct {                            /*  Bit  Access */
                           unsigned char TDRE:1;        /*    TDRE      */
                           unsigned char RDRF:1;        /*    RDRF      */
                           unsigned char ORER:1;        /*    ORER      */
                           unsigned char FER :1;        /*    FER       */
                           unsigned char PER :1;        /*    PER       */
                           unsigned char TEND:1;        /*    TEND      */
                           unsigned char MPB :1;        /*    MPB       */
                           unsigned char MPBT:1;        /*    MPBT      */
                           }      BIT;                  /*              */
                    }           SSR;                    /*              */
              unsigned char     RDR;                    /* RDR          */
              char              wk[2];                  /*              */
};                                                      /*              */
struct st_frt {                                         /* struct FRT   */
              union {                                   /* TIER         */
                    unsigned char BYTE;                 /*  Byte Access */
                    struct {                            /*  Bit  Access */
                           unsigned char ICIE :1;       /*    ICIE      */
                           unsigned char      :3;       /*              */
                           unsigned char OCIAE:1;       /*    OCIAE     */
                           unsigned char OCIBE:1;       /*    OCIBE     */
                           unsigned char OVIE :1;       /*    OVIE      */
                           }      BIT;                  /*              */
                    }           TIER;                   /*              */
              union {                                   /* FTCSR        */
                    unsigned char BYTE;                 /*  Byte Access */
                    struct {                            /*  Bit  Access */
                           unsigned char ICF  :1;       /*    ICF       */
                           unsigned char      :3;       /*              */
                           unsigned char OCFA :1;       /*    OCFA      */
                           unsigned char OCFB :1;       /*    OCFB      */
                           unsigned char OVF  :1;       /*    OVF       */
                           unsigned char CCLRA:1;       /*    CCLRA     */
                           }      BIT;                  /*              */
                    }           FTCSR;                  /*              */
              unsigned short    FRC;                    /* FRC          */
              unsigned short    OCR;                    /* OCRA or OCRB */
              union {                                   /* TCR          */
                    unsigned char BYTE;                 /*  Byte Access */
                    struct {                            /*  Bit  Access */
                           unsigned char IEDGA:1;       /*    IEDGA     */
                           unsigned char      :5;       /*              */
                           unsigned char CKS  :2;       /*    CKS       */
                           }      BIT;                  /*              */
                    }           TCR;                    /*              */
              union {                                   /* TOCR         */
                    unsigned char BYTE;                 /*  Byte Access */
                    struct {                            /*  Bit  Access */
                           unsigned char      :3;       /*              */
                           unsigned char OCRS :1;       /*    OCRS      */
                           unsigned char      :2;       /*              */
                           unsigned char OLVLA:1;       /*    OLVLA     */
                           unsigned char OLVLB:1;       /*    OLVLB     */
                           }      BIT;                  /*              */
                    }           TOCR;                   /*              */
              unsigned short    FICR;                   /* FICR         */
};                                                      /*              */
struct st_intc {                                        /* struct INTC  */
               union {                                  /* IPRB         */
                     unsigned short WORD;               /*  Word Access */
                     struct {                           /*  Bit  Access */
                            unsigned char  UU:4;        /*    SCI       */
                            unsigned char  UL:4;        /*    FRT       */
                            }       BIT;                /*              */
                     }          IPRB;                   /*              */
               union {                                  /* VCRA         */
                     unsigned short WORD;               /*  Word Access */
                     struct {                           /*  Bit  Access */
                            unsigned char  H;           /*    SERV      */
                            unsigned char  L;           /*    SRXV      */
                            }       BYTE;               /*              */
                     }          VCRA;                   /*              */
               union {                                  /* VCRB         */
                     unsigned short WORD;               /*  Word Access */
                     struct {                           /*  Bit  Access */
                            unsigned char  H;           /*    STXV      */
                            unsigned char  L;           /*    STEV      */
                            }       BYTE;               /*              */
                     }          VCRB;                   /*              */
               union {                                  /* VCRC         */
                     unsigned short WORD;               /*  Word Access */
                     struct {                           /*  Bit  Access */
                            unsigned char  H;           /*    FICV      */
                            unsigned char  L;           /*    FOCV      */
                            }       BYTE;               /*              */
                     }          VCRC;                   /*              */
               union {                                  /* VCRD         */
                     unsigned short WORD;               /*  Word Access */
                     struct {                           /*  Bit  Access */
                            unsigned char  H;           /*    FOVV      */
                            }       BYTE;               /*              */
                     }          VCRD;                   /*              */
               char             wk[118];                /*              */
               union {                                  /* ICR          */
                     unsigned short WORD;               /*  Word Access */
                     struct {                           /*  Bit  Access */
                            unsigned char  NMIL :1;     /*    NMIL      */
                            unsigned char       :6;     /*              */
                            unsigned char  NMIE: 1;     /*    NMIE      */
                            unsigned char       :7;     /*              */
                            unsigned char  VECMD:1;     /*    VECMD     */
                            }       BIT;                /*              */
                     }          ICR;                    /*              */
               union {                                  /* IPRA         */
                     unsigned short WORD;               /*  Word Access */
                     struct {                           /*  Bit  Access */
                            unsigned char  UU:4;        /*    DIVU      */
                            unsigned char  UL:4;        /*    DMAC      */
                            unsigned char  LU:4;        /*    WDT       */
                            }       BIT;                /*              */
                     }          IPRA;                   /*              */
               union {                                  /* VCRWDT       */
                     unsigned short WORD;               /*  Word Access */
                     struct {                           /*  Bit  Access */
                            unsigned char  H;           /*    WITV      */
                            unsigned char  L;           /*    BCMV      */
                            }       BYTE;               /*              */
                     }          VCRWDT;                 /*              */
};                                                      /*              */
struct st_dmac {                                        /* struct DMAC  */
               union {                                  /* DMAOR        */
                     unsigned int    LONG;              /*  Long Access */
                     struct {                           /*  Bit  Access */
                            unsigned int       :28;     /*              */
                            unsigned int   PR  :1 ;     /*    PR        */
                            unsigned int   AE  :1 ;     /*    AE        */
                            unsigned int   NMIF:1 ;     /*    NMIF      */
                            unsigned int   DME :1 ;     /*    DME       */
                            }        BIT;               /*              */
                     }          DMAOR;                  /*              */
};                                                      /*              */
struct st_dmac0 {                                       /* struct DMAC0 */
		unsigned char   wk1[1];                 /*              */
                union {                                 /* DRCR         */
                      unsigned char BYTE;               /*  Byte Access */
                      struct {                          /*  Bit  Access */
                             unsigned char   :6;        /*              */
                             unsigned char RS:2;        /*    RS        */
                             }      BIT;                /*              */
                      }         DRCR;                   /*              */
                char            wk2[270];               /*              */
                void           *SAR;                    /* SAR          */
                void           *DAR;                    /* DAR          */
                unsigned int    TCR;                    /* TCR          */
                union {                                 /* CHCR         */
                      unsigned int   LONG;              /*  Long Access */
                      struct {                          /*  Bit  Access */
                             unsigned int     :16;      /*              */
                             unsigned int   DM: 2;      /*    DM        */
                             unsigned int   SM: 2;      /*    SM        */
                             unsigned int   TS: 2;      /*    TS        */
                             unsigned int   AR: 1;      /*    AR        */
                             unsigned int   AM: 1;      /*    AM        */
                             unsigned int   AL: 1;      /*    AL        */
                             unsigned int   DS: 1;      /*    DS        */
                             unsigned int   DL: 1;      /*    DL        */
                             unsigned int   TB: 1;      /*    TB        */
                             unsigned int   TA: 1;      /*    TA        */
                             unsigned int   IE: 1;      /*    IE        */
                             unsigned int   TE: 1;      /*    TE        */
                             unsigned int   DE: 1;      /*    DE        */
                             }       BIT;               /*              */
                      }         CHCR;                   /*              */
                char            wk3[16];                /*              */
                unsigned int    VCRDMA;                 /* VCRDMA       */
};                                                      /*              */
struct st_dmac1 {                                       /* struct DMAC1 */
		unsigned char   wk1[2];                 /*              */
                union {                                 /* DRCR         */
                      unsigned char BYTE;               /*  Byte Access */
                      struct {                          /*  Bit  Access */
                             unsigned char   :6;        /*              */
                             unsigned char RS:2;        /*    RS        */
                             }      BIT;                /*              */
                      }         DRCR;                   /*              */
                char            wk2[285];               /*              */
                void           *SAR;                    /* SAR          */
                void           *DAR;                    /* DAR          */
                unsigned int    TCR;                    /* TCR          */
                union {                                 /* CHCR         */
                      unsigned int   LONG;              /*  Long Access */
                      struct {                          /*  Bit  Access */
                             unsigned int     :16;      /*              */
                             unsigned int   DM: 2;      /*    DM        */
                             unsigned int   SM: 2;      /*    SM        */
                             unsigned int   TS: 2;      /*    TS        */
                             unsigned int   AR: 1;      /*    AR        */
                             unsigned int   AM: 1;      /*    AM        */
                             unsigned int   AL: 1;      /*    AL        */
                             unsigned int   DS: 1;      /*    DS        */
                             unsigned int   DL: 1;      /*    DL        */
                             unsigned int   TB: 1;      /*    TB        */
                             unsigned int   TA: 1;      /*    TA        */
                             unsigned int   IE: 1;      /*    IE        */
                             unsigned int   TE: 1;      /*    TE        */
                             unsigned int   DE: 1;      /*    DE        */
                             }       BIT;               /*              */
                      }         CHCR;                   /*              */
                char            wk3[8];                 /*              */
                unsigned int    VCRDMA;                 /* VCRDMA       */
};                                                      /*              */
struct st_divu {                                        /* struct DIVU  */
               int              DVSR;                   /* DVSR         */
               int              DVDNT;                  /* DVDNT        */
               char             wk1[2];                 /*              */
               union {                                  /* DVCR         */
                     unsigned short  WORD;              /*  Word Access */
                     struct {                           /*  Bit  Access */
                            unsigned short      :14;    /*              */
                            unsigned short OVFIE:1;     /*    OVFIE     */
                            unsigned short OVF  :1;     /*    OVF       */
                            }        BIT;               /*              */
                     }          DVCR;                   /*              */
               char             wk2[2];                 /*              */
               unsigned short   VCRDIV;                 /* VCRDIV       */
               int              DVDNTH;                 /* DVDNTH       */
               int              DVDNTL;                 /* DVDNTL       */
};                                                      /*              */
struct st_ubc {                                         /* struct UBC   */
              void             *BARA;                   /* BARA         */
              unsigned long     BAMRA;                  /* BAMRA        */
              union {                                   /* BBRA         */
                    unsigned short   WORD;              /*  Word Access */
                    struct {                            /*  Bit  Access */
                           unsigned short    :8;        /*              */
                           unsigned short CPA:2;        /*    CPA       */
                           unsigned short IDA:2;        /*    IDA       */
                           unsigned short RWA:2;        /*    RWA       */
                           unsigned short SZA:2;        /*    SZA       */
                           }         BIT;               /*              */
                    }           BBRA;                   /*              */
              char              wk1[22];                /*              */
              void             *BARB;                   /* BARB         */
              unsigned long     BAMRB;                  /* BAMRB        */
              union {                                   /* BBRB         */
                    unsigned short   WORD;              /*  Word Access */
                    struct {                            /*  Bit  Access */
                           unsigned short    :8;        /*              */
                           unsigned short CPB:2;        /*    CPB       */
                           unsigned short IDB:2;        /*    IDB       */
                           unsigned short RWB:2;        /*    RWB       */
                           unsigned short SZB:2;        /*    SZB       */
                           }         BIT;               /*              */
                    }           BBRB;                   /*              */
              char              wk2[6];                 /*              */
              unsigned long     BDRB;                   /* BDRB         */
              unsigned long     BDMRB;                  /* BDMRB        */
              union {                                   /* BRCR         */
                    unsigned short   WORD;              /*  Word Access */
                    struct {                            /*  Bit  Access */
                           unsigned short CMFCA:1;      /*    CMFCA     */
                           unsigned short CMFPA:1;      /*    CMFPA     */
                           unsigned short EBBE :1;      /*    EBBE      */
                           unsigned short UMD  :1;      /*    CMD       */
                           unsigned short      :1;      /*              */
                           unsigned short PCBA :1;      /*    PCBA      */
                           unsigned short      :2;      /*              */
                           unsigned short CMFCB:1;      /*    CMFCB     */
                           unsigned short CMFPB:1;      /*    CMFPB     */
                           unsigned short      :1;      /*              */
                           unsigned short SEQ  :1;      /*    SEQ       */
                           unsigned short DBEB :1;      /*    DBEB      */
                           unsigned short PCBB :1;      /*    PCBB      */
                           }         BIT;               /*              */
                    }           BRCR;                   /*              */
};                                                      /*              */
struct st_bsc {                                         /* struct BSC   */
              union {                                   /* BCR1         */
                    unsigned int     LONG;              /*  Long Access */
                    struct {                            /*  Bit  Access */
                           unsigned int         :16;    /*              */
                           unsigned int   MASTER: 1;    /*    MASTER    */
                           unsigned int         : 2;    /*              */
                           unsigned int   ENDIAN: 1;    /*    ENDIAN    */
                           unsigned int   BSTROM: 1;    /*    BSTROM    */
                           unsigned int   PSHR  : 1;    /*    PSHR      */
                           unsigned int   AHLW  : 2;    /*    AHLW      */
                           unsigned int   A1LW  : 2;    /*    A1LW      */
                           unsigned int   A0LW  : 2;    /*    A0LW      */
                           unsigned int         : 1;    /*              */
                           unsigned int   DRAM  : 3;    /*    DRAM      */
                           }         BIT;               /*              */
                    }           BCR1;                   /*              */
              union {                                   /* BCR2         */
                    unsigned int     LONG;              /*  Long Access */
                    struct {                            /*  Bit  Access */
                           unsigned int       :24;      /*              */
                           unsigned int   A3SZ: 2;      /*    A3SZ      */
                           unsigned int   A2SZ: 2;      /*    A2SZ      */
                           unsigned int   A1SZ: 2;      /*    A1SZ      */
                           }         BIT;               /*              */
                    }           BCR2;                   /*              */
              union {                                   /* WCR          */
                    unsigned int     LONG;              /*  Long Access */
                    struct {                            /*  Bit  Access */
                           unsigned int      :16;       /*              */
                           unsigned int   IW3: 2;       /*    IW3       */
                           unsigned int   IW2: 2;       /*    IW2       */
                           unsigned int   IW1: 2;       /*    IW1       */
                           unsigned int   IW0: 2;       /*    IW0       */
                           unsigned int   W3:  2;       /*    IW3       */
                           unsigned int   W2:  2;       /*    IW2       */
                           unsigned int   W1:  2;       /*    IW1       */
                           unsigned int   W0:  2;       /*    IW0       */
                           }         BIT;               /*              */
                    }           WCR;                    /*              */
              union {                                   /* MCR          */
                    unsigned int     LONG;              /*  Long Access */
                    struct {                            /*  Bit  Access */
                           unsigned int       :16;      /*              */
                           unsigned int   TRP : 1;      /*    TRP       */
                           unsigned int   RCD : 1;      /*    RCD       */
                           unsigned int   TRWL: 1;      /*    TRWL      */
                           unsigned int   TRAS: 2;      /*    TRAS      */
                           unsigned int   BE  : 1;      /*    BE        */
                           unsigned int   RASD: 1;      /*    RASD      */
                           unsigned int       : 1;      /*              */
                           unsigned int   AMX2: 1;      /*    AMX2      */
                           unsigned int   SZ  : 1;      /*    SZ        */
                           unsigned int   AMX1: 1;      /*    AMX1      */
                           unsigned int   AMX0: 1;      /*    AMX0      */
                           unsigned int   RFSH: 1;      /*    RFSH      */
                           unsigned int   RMD : 1;      /*    RMD       */
                           }         BIT;               /*              */
                    }           MCR;                    /*              */
              union {                                   /* RTCSR        */
                    unsigned int     LONG;              /*  Long Access */
                    struct {                            /*  Bit  Access */
                           unsigned int       :24;      /*              */
                           unsigned int   CMF : 1;      /*    CMF       */
                           unsigned int   CMIE: 1;      /*    CMIE      */
                           unsigned int   CKS : 3;      /*    CKS       */
                           }         BIT;               /*              */
                    }           RTCSR;                  /*              */
              unsigned int      RTCNT;                  /* RTCNT        */
              unsigned int      RTCOR;                  /* RTCOR        */
};                                                      /*              */
union un_sbycr {                                        /* union SBYCR  */
               unsigned char    BYTE;                   /*  Byte Access */
               struct {                                 /*  Bit  Access */
                      unsigned char SBY  :1;            /*    SBY       */
                      unsigned char HIZ  :1;            /*    HIZ       */
                      unsigned char      :1;            /*              */
                      unsigned char MSTP4:1;            /*    MSTP4     */
                      unsigned char MSTP3:1;            /*    MSTP3     */
                      unsigned char MSTP2:1;            /*    MSTP2     */
                      unsigned char MSTP1:1;            /*    MSTP1     */
                      unsigned char MSTP0:1;            /*    MSTP0     */
                      }         BIT;                    /*              */
};                                                      /*              */
union un_ccr {                                          /* union CCR    */
             unsigned char      BYTE;                   /*  Byte Access */
             struct {                                   /*  Bit  Access */
                    unsigned char W :2;                 /*    W         */
                    unsigned char   :1;                 /*              */
                    unsigned char CP:1;                 /*    CP        */
                    unsigned char TW:1;                 /*    TW        */
                    unsigned char OC:1;                 /*    OC        */
                    unsigned char ID:1;                 /*    ID        */
                    unsigned char CE:1;                 /*    CE        */
                    }           BIT;                    /*              */
};                                                      /*              */
#define SCI   (*(volatile struct st_sci   *)0xFFFFFE00) /* SCI   Address*/
#define FRT   (*(volatile struct st_frt   *)0xFFFFFE10) /* FRT   Address*/
#define INTC  (*(volatile struct st_intc  *)0xFFFFFE60) /* INTC  Address*/
#define DMAC  (*(volatile struct st_dmac  *)0xFFFFFFB0) /* DMAC  Address*/
#define DMAC0 (*(volatile struct st_dmac0 *)0xFFFFFE70) /* DMAC0 Address*/
#define DMAC1 (*(volatile struct st_dmac1 *)0xFFFFFE70) /* DMAC1 Address*/
#define DIVU  (*(volatile struct st_divu  *)0xFFFFFF00) /* INTC  Address*/
#define UBC   (*(volatile struct st_ubc   *)0xFFFFFF40) /* UBC   Address*/
#define BSC   (*(volatile struct st_bsc   *)0xFFFFFFE0) /* BSC   Address*/
#define SBYCR (*(volatile union  un_sbycr *)0xFFFFFE91) /* SBYCR Address*/
#define CCR   (*(volatile union  un_ccr   *)0xFFFFFE92) /* CCR   Address*/
