]> CyberLeo.Net >> Repos - FreeBSD/releng/8.1.git/blob - sys/pc98/pc98/pc98_machdep.h
Copy stable/8 to releng/8.1 in preparation for 8.1-RC1.
[FreeBSD/releng/8.1.git] / sys / pc98 / pc98 / pc98_machdep.h
1 /*-
2  * Copyright (c) KATO Takenori, 1996.  All rights reserved.
3  * 
4  * Redistribution and use in source and binary forms, with or without
5  * modification, are permitted provided that the following conditions
6  * are met:
7  * 1. Redistributions of source code must retain the above copyright
8  *    notice, this list of conditions and the following disclaimer as
9  *    the first lines of this file unmodified.
10  * 2. Redistributions in binary form must reproduce the above copyright
11  *    notice, this list of conditions and the following disclaimer in the
12  *    documentation and/or other materials provided with the distribution.
13  * 3. The name of the author may not be used to endorse or promote products
14  *    derived from this software without specific prior written permission.
15  * 
16  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
17  * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
18  * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
19  * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
20  * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
21  * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
22  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
23  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
24  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
25  * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26  *
27  * $FreeBSD$
28  */
29
30 #ifndef __PC98_PC98_PC98_MACHDEP_H__
31 #define __PC98_PC98_PC98_MACHDEP_H__
32
33 void    pc98_init_dmac(void);
34 unsigned int    pc98_getmemsize(unsigned *, unsigned *);
35
36 struct  ccb_calc_geometry;
37 int     scsi_da_bios_params(struct ccb_calc_geometry *);
38
39 #define PC98_VECTOR_SIZE                        (0x400)
40 #define PC98_SYSTEM_PARAMETER_SIZE              (0x240)
41 #define PC98_SAVE_AREA                          (0xa1000)
42
43 #if defined(_KERNEL) && !defined(LOCORE)
44 /* BIOS parameter block */
45 extern unsigned char    pc98_system_parameter[]; /* in locore.c */
46
47 #define OFS_pc98_machine_type           0x220
48 #define OFS_epson_machine_id            0x224
49 #define OFS_epson_bios_id               0x225
50 #define OFS_epson_system_type           0x226
51
52 #define PC98_SYSTEM_PARAMETER(x) pc98_system_parameter[(x)-0x400]
53 #define pc98_machine_type (*(unsigned long*)&pc98_system_parameter[OFS_pc98_machine_type])
54 #define epson_machine_id        (pc98_system_parameter[OFS_epson_machine_id])
55 #define epson_bios_id           (pc98_system_parameter[OFS_epson_bios_id])
56 #define epson_system_type       (pc98_system_parameter[OFS_epson_system_type])
57
58 # define PC98_TYPE_CHECK(x)     ((pc98_machine_type & (x)) == (x))
59
60 /*
61  * PC98 machine type
62  */
63 #define M_NEC_PC98      0x0001
64 #define M_EPSON_PC98    0x0002
65 #define M_NOT_H98       0x0010
66 #define M_H98           0x0020
67 #define M_NOTE          0x0040
68 #define M_NORMAL        0x1000
69 #define M_8M            0x8000
70
71 /*
72  * EPSON machine list
73  */
74 #define EPSON_PC386_NOTE_A      0x20
75 #define EPSON_PC386_NOTE_W      0x22
76 #define EPSON_PC386_NOTE_AE     0x27
77 #define EPSON_PC386_NOTE_WR     0x2a
78 #define EPSON_PC486_GR          0x2b
79 #define EPSON_PC486_P           0x30
80 #define EPSON_PC486_GR_SUPER    0x31
81 #define EPSON_PC486_GR_PLUS     0x32
82 #define EPSON_PC486_HX          0x34
83 #define EPSON_PC486_HG          0x35
84 #define EPSON_PC486_SE          0x37
85 #define EPSON_PC486_SR          0x38
86 #define EPSON_PC486_HA          0x3b
87
88 /* IDE HDD geometry conversion. */
89 #define AD_GEOM_ADJUST_NONE             0       /* Do nothing. */
90 #define AD_GEOM_ADJUST_COMPATIDE        1       /* PC-98 IDE BIOS. */
91 #define AD_GEOM_ADJUST_COMPATSCSI       2       /* PC-98 SCSI. */
92 #define AD_GEOM_ADJUST_COMPATCYL16      100     /* Compat Rev. 1.28. */
93
94 #define MEDIASIZE_4_3G          (4351LL * 1024LL * 1024LL)      /* 4351M */
95 #define MEDIASIZE_8G            (8192LL * 1024LL * 1024LL)      /* 8192M */
96 #define MEDIASIZE_29_5G         (30239LL * 1024LL * 1024LL)     /* 30239M */
97 #define MEDIASIZE_31_5G         (32255LL * 1024 * 1024)         /* 32255M */
98 #define MEDIASIZE_32G           (32768LL * 1024LL * 1024LL)     /* 32768M */
99 #define MEDIASIZE_60G           (61440LL * 1024LL * 1024LL)     /* 61440M */
100 #define MEDIASIZE_120G          (122400LL * 1024LL * 1024LL)    /* 122400M */
101 #define MEDIASIZE_127G          (130558LL * 1024LL * 1024LL)    /* 130558M */
102
103 #endif /* _KERNEL */
104
105 #endif /* __PC98_PC98_PC98_MACHDEP_H__ */