7 #define TEMP_BASE ((unsigned char*) 0x400000) /* 4MB */
8 #define SYMTAB_BASE ((unsigned char*) 8192) /* 8kB */
10 /* 3390 with 0 key length, and 4096 data length */
11 #define RECORDS_PER_CYL (15*12)
12 #define RECORDS_PER_TRACK 12
14 /* the nucleus fn ft (in EBCDIC) => HVF ELF */
15 #define CP_FN "\xC8\xE5\xC6\x40\x40\x40\x40\x40"
16 #define CP_FT "\xC5\xD3\xC6\x40\x40\x40\x40\x40"
21 #define memcpy(d,s,l) __builtin_memcpy((d), (s), (l))
22 #define memcmp(d,s,l) __builtin_memcmp((d), (s), (l))
23 #define memset(s,c,n) __builtin_memset((s),(c),(n))
26 * I/O related structs, macros & variables
29 u8 cmd
; /* Command code */
31 u16 count
; /* Count */
32 u32 addr
; /* Data Address */
33 } __attribute__((packed
,aligned(8)));
35 #define CCW_FLAG_CD 0x80 /* Chain-Data */
36 #define CCW_FLAG_CC 0x40 /* Chain-Command */
37 #define CCW_FLAG_SLI 0x20 /* Suppress-Length-Indication */
38 #define CCW_FLAG_SKP 0x10 /* Skip */
39 #define CCW_FLAG_PCI 0x08 /* Program-Controlled-Interruption */
40 #define CCW_FLAG_IDA 0x04 /* Indirect-Data-Address */
41 #define CCW_FLAG_S 0x02 /* Suspend */
42 #define CCW_FLAG_MIDA 0x01 /* Modified-Indirect-Data-Address */
46 u32 param
; /* Interruption Parameter */
49 u8 key
:4, /* Subchannel Key */
51 c
:1, /* Streaming-Mode Control */
52 m
:1, /* Modification Control */
53 y
:1; /* Synchronization Control */
54 u8 f
:1, /* Format Control */
55 p
:1, /* Prefetch Control */
56 i
:1, /* Initial-Status-Interruption Control */
57 a
:1, /* Address-Limit-Checking control */
58 u
:1, /* Suppress-Suspend-Interruption Control */
60 h
:1, /* Format-2-IDAW Control */
61 t
:1; /* 2K-IDAW Control */
62 u8 lpm
; /* Logical-Path Mask */
63 u8 l
:1, /* Incorrect-Length-Suppression Mode */
64 d
:1, /* Modified-CCW-Indirect-Data-Addressing Control */
66 x
:1; /* ORB-Extension Control */
69 u32 addr
; /* Channel-Program Address */
72 u8 css_prio
; /* Channel-Subsystem Priority */
74 u8 cu_prio
; /* Control-Unit Priority */
82 } __attribute__((packed
,aligned(4)));
84 #define ADDR31(x) ((u32) (u64) (x))
86 extern void __do_io();
87 extern void PGMHANDLER();
89 extern void load_nucleus(void);
91 extern struct orb ORB
;
94 * EDF related structs & macros
96 #define EDF_LABEL_BLOCK_NO 3
97 #define EDF_SUPPORTED_BLOCK_SIZE 4096
100 u32 IDENT
; /* VOL START / LABEL IDENTIFIER */
101 #define __ADTIDENT 0xC3D4E2F1 /* 'CMS1' in EBCDIC */
102 u8 ID
[6]; /* VOL START / VOL IDENTIFIER */
103 u8 VER
[2]; /* VERSION LEVEL */
104 u32 DBSIZ
; /* DISK BLOCK SIZE */
105 u32 DOP
; /* DISK ORIGIN POINTER */
106 u32 CYL
; /* NUM OF FORMATTED CYL ON DISK */
107 u32 MCYL
; /* MAX NUM FORMATTED CYL ON DISK */
108 u32 NUM
; /* Number of Blocks on disk */
109 u32 USED
; /* Number of Blocks used */
110 u32 FSTSZ
; /* SIZE OF FST */
111 u32 NFST
; /* NUMBER OF FST'S PER BLOCK */
112 u8 DCRED
[6]; /* DISK CREATION DATE (YYMMDDHHMMSS) */
113 u8 FLGL
; /* LABEL FLAG BYTE (ADTFLGL) */
114 #define ADTCNTRY 0x01 /* Century for disk creation date (0=19, 1=20),
115 * corresponds to ADTDCRED. */
117 u32 OFFST
; /* DISK OFFSET WHEN RESERVED */
118 u32 AMNB
; /* ALLOC MAP BLOCK WITH NEXT HOLE */
119 u32 AMND
; /* DISP INTO HBLK DATA OF NEXT HOLE */
120 u32 AMUP
; /* DISP INTO USER PART OF ALLOC MAP */
121 u32 OFCNT
; /* Count of SFS open files for this ADT */
122 u8 SFNAM
[8]; /* NAME OF SHARED SEGMENT */
126 u8 FNAME
[8]; /* filename */
127 u8 FTYPE
[8]; /* filetype */
128 u8 DATEW
[2]; /* DATE LAST WRITTEN - MMDD */
129 u8 TIMEW
[2]; /* TIME LAST WRITTEN - HHMM */
130 u16 WRPNT
; /* WRITE POINTER - ITEM NUMBER */
131 u16 RDPNT
; /* READ POINTER - ITEM NUMBER */
132 u8 FMODE
[2]; /* FILE MODE - LETTER AND NUMBER */
133 u16 RECCT
; /* NUMBER OF LOGICAL RECORDS */
134 u16 FCLPT
; /* FIRST CHAIN LINK POINTER */
135 u8 RECFM
; /* F*1 - RECORD FORMAT - F OR V */
136 #define FSTDFIX 0xC6 /* Fixed record format (EBCDIC 'F') */
137 #define FSTDVAR 0xE5 /* Variable record format (EBCDIC 'V') */
138 u8 FLAGS
; /* F*2 - FST FLAG BYTE */
139 #define FSTRWDSK 0x80 /* READ/WRITE DISK */
140 #define FSTRODSK 0x00 /* READ/ONLY DISK */
141 #define FSTDSFS 0x10 /* Shared File FST */
142 #define FSTXRDSK 0x40 /* EXTENSION OF R/O DISK */
143 #define FSTXWDSK 0xC0 /* EXTENSION OF R/W DISK */
144 #define FSTEPL 0x20 /* EXTENDED PLIST */
145 #define FSTDIA 0x40 /* ITEM AVAILABLE */
146 #define FSTDRA 0x01 /* PREVIOUS RECORD NULL */
147 #define FSTCNTRY 0x08 /* Century for date last written (0=19, 1=20),\\
148 corresponds to FSTYEARW, FSTADATI. */
149 #define FSTACTRD 0x04 /* ACTIVE FOR READING */
150 #define FSTACTWR 0x02 /* ACTIVE FOR WRITING */
151 #define FSTACTPT 0x01 /* ACTIVE FROM A POINT */
152 #define FSTFILEA 0x07 /* THE FILE IS ACTIVE */
153 u32 LRECL
; /* LOGICAL RECORD LENGTH */
154 u16 BLKCT
; /* NUMBER OF 800 BYTE BLOCKS */
155 u16 YEARW
; /* YEAR LAST WRITTEN */
156 u32 FOP
; /* ALT. FILE ORIGIN POINTER */
157 u32 ADBC
; /* ALT. NUMBER OF DATA BLOCKS */
158 u32 AIC
; /* ALT. ITEM COUNT */
159 u8 NLVL
; /* NUMBER OF POINTER BLOCK LEVELS */
160 u8 PTRSZ
; /* LENGTH OF A POINTER ELEMENT */
161 u8 ADATI
[6]; /* ALT. DATE/TIME(YY MM DD HH MM SS) */
162 u8 REALM
; /* Real filemode */
163 u8 FLAG2
; /* F*3 - FST FLAG BYTE 2 FSTFLAG2 */
164 #define FSTPIPEU 0x10 /* Reserved for CMS PIPELINES usage */