@@ -63,7 +63,7 @@ struct HugeSectorBlock {
6363
6464/* Normal entry. This minimizes user stack usage by avoiding local */
6565/* variables needed for the rest of the handler. */
66- /* this here works on the users stack !! and only very few functions
66+ /* this here works on the users stack !! and only very few functions
6767 are allowed */
6868
6969/* TODO: really, really make sure that this function works properly */
@@ -74,12 +74,12 @@ struct HugeSectorBlock {
7474/* to compile under gcc-ia16 to correctly-behaving code _for now_. But */
7575/* it will be better to be able to guarantee this. -- tkchia 20191207 */
7676
77- /* Update: I added experimental SS != DGROUP support, and a __seg_ss */
78- /* address space qualifier, to gcc-ia16 around January 2020. This */
79- /* function now uses these if available. In particular, the iregs *irp */
80- /* structure will always be on the stack, so (as far as the calling */
81- /* convention permits) the function can treat the irp pointer as a */
82- /* 16-bit pointer relative to SS. -- tkchia 20200417 */
77+ /* Update: I added experimental SS != DGROUP support, and a __seg_ss */
78+ /* address space qualifier, to gcc-ia16 around January 2020. This */
79+ /* function now uses these if available. In particular, the iregs *irp */
80+ /* structure will always be on the stack, so (as far as the calling */
81+ /* convention permits) the function can treat the irp pointer as a */
82+ /* 16-bit pointer relative to SS. -- tkchia 20200417 */
8383#if defined __GNUC__ && defined __IA16_FEATURE_ATTRIBUTE_NO_ASSUME_SS_DATA
8484__attribute__((no_assume_ss_data ))
8585VOID ASMCFUNC int21_syscall (iregs __seg_ss * irp , ...)
@@ -142,16 +142,16 @@ VOID ASMCFUNC int21_syscall(iregs FAR * irp)
142142
143143 /* the remaining are FreeDOS extensions */
144144
145- /* return CPU family */
145+ /* return CPU family */
146146 case 0xfa :
147147 irp -> AL = CPULevel ;
148148 break ;
149-
150- #if 0 /* unknown if used / usage */
151- case 0xfb :
149+
150+ #if 0 /* unknown if used / usage */
151+ case 0xfb :
152152#endif
153153
154- #if 1 /* duplicates DOS 4 int 2F/122Fh, but used by CALLVER */
154+ #if 1 /* duplicates DOS 4 int 2F/122Fh, but used by CALLVER */
155155 /* set FreeDOS returned version for int 21.30 from BX */
156156 case 0xfc :
157157 os_setver_major = irp -> BL ;
@@ -216,15 +216,15 @@ VOID ASMCFUNC int21_syscall(iregs FAR * irp)
216216int int21_fat32 (lregs * r )
217217{
218218 COUNT rc ;
219-
219+
220220 switch (r -> AL )
221221 {
222222 /* Get extended drive parameter block */
223223 case 0x02 :
224224 {
225225 struct dpb FAR * dpb ;
226226 struct xdpbdata FAR * xddp ;
227-
227+
228228 if (r -> CX < sizeof (struct xdpbdata ))
229229 return DE_INVLDBUF ;
230230
@@ -235,12 +235,12 @@ int int21_fat32(lregs *r)
235235 /* hazard: no error checking! */
236236 flush_buffers (dpb -> dpb_unit );
237237 dpb -> dpb_flags = M_CHANGED ; /* force reread of drive BPB/DPB */
238-
238+
239239 if (media_check (dpb ) < 0 )
240240 return DE_INVLDDRV ;
241-
241+
242242 xddp = MK_FP (r -> ES , r -> DI );
243-
243+
244244 fmemcpy (& xddp -> xdd_dpb , dpb , sizeof (struct dpb ));
245245 xddp -> xdd_dpbsize = sizeof (struct dpb );
246246
@@ -260,7 +260,7 @@ int int21_fat32(lregs *r)
260260 case 0x03 :
261261 {
262262 struct xfreespace FAR * xfsp = MK_FP (r -> ES , r -> DI );
263-
263+
264264 if (r -> CX < sizeof (struct xfreespace ))
265265 return DE_INVLDBUF ;
266266
@@ -281,10 +281,10 @@ int int21_fat32(lregs *r)
281281 dpb = GetDriveDPB (r -> DL , & rc );
282282 if (rc != SUCCESS )
283283 return rc ;
284-
284+
285285 xdffp -> xdff_datasize = sizeof (struct xdpbforformat );
286286 xdffp -> xdff_version .actual = 0 ;
287-
287+
288288 switch ((UWORD ) xdffp -> xdff_function )
289289 {
290290 case 0x00 :
@@ -328,7 +328,7 @@ int int21_fat32(lregs *r)
328328 /* hazard: no error checking! */
329329 flush_buffers (dpb -> dpb_unit );
330330 dpb -> dpb_flags = M_CHANGED ;
331-
331+
332332 if (media_check (dpb ) < 0 )
333333 return DE_INVLDDRV ;
334334 break ;
@@ -372,7 +372,7 @@ int int21_fat32(lregs *r)
372372 default :
373373 return DE_INVLDFUNC ;
374374 }
375-
375+
376376 break ;
377377 }
378378 /* Extended absolute disk read/write */
@@ -384,28 +384,28 @@ int int21_fat32(lregs *r)
384384 UBYTE mode ;
385385 /* bit 0 of SI is 0 read / 1 write, bits 13/14 indicate a type: */
386386 /* 0 any, 1 fat, 2 dir, 3 file. Type is mostly for "write hints" */
387-
387+
388388 if (r -> CX != 0xffff || (r -> SI & ~0x6001 ))
389389 {
390390 return DE_INVLDPARM ;
391391 }
392-
392+
393393 if (r -> DL > lastdrive || r -> DL == 0 )
394394 return -0x207 ;
395-
395+
396396 if ((r -> SI & 1 ) == 0 ) /* while uncommon, reads CAN have type hints */
397397 mode = DSKREADINT25 ;
398398 else
399399 mode = DSKWRITEINT26 ;
400-
400+
401401 r -> AX =
402402 dskxfer (r -> DL - 1 , SectorBlock -> blkno , SectorBlock -> buf ,
403403 SectorBlock -> nblks , mode );
404-
404+
405405 if (mode == DSKWRITEINT26 )
406406 if (r -> AX == 0 )
407407 setinvld (r -> DL - 1 );
408-
408+
409409 if (r -> AX > 0 )
410410 return -0x20c ;
411411 break ;
@@ -780,10 +780,10 @@ VOID ASMCFUNC int21_service(iregs FAR * r)
780780
781781 if (ReturnAnyDosVersionExpected )
782782 {
783- /* TE for testing purpose only and NOT
783+ /* TE for testing purpose only and NOT
784784 to be documented:
785785 return programs, who ask for version == XX.YY
786- exactly this XX.YY.
786+ exactly this XX.YY.
787787 this makes most MS programs more happy.
788788 */
789789 UBYTE FAR * retp = MK_FP (r -> cs , r -> ip );
@@ -824,14 +824,14 @@ VOID ASMCFUNC int21_service(iregs FAR * r)
824824 {
825825 int drv = (lr .DL == 0 || lr .AH == 0x1f ) ? default_drive : lr .DL - 1 ;
826826 struct dpb FAR * dpb = get_dpb (drv );
827-
827+
828828 if (dpb == NULL )
829829 {
830830 CritErrCode = - DE_INVLDDRV ;
831831 lr .AL = 0xFF ;
832832 break ;
833833 }
834- /* hazard: no error checking! */
834+ /* hazard: no error checking! */
835835 flush_buffers (dpb -> dpb_unit );
836836 dpb -> dpb_flags = M_CHANGED ; /* force flush and reread of drive BPB/DPB */
837837
@@ -852,7 +852,7 @@ VOID ASMCFUNC int21_service(iregs FAR * r)
852852
853853 break ;
854854/*
855- case 0x33:
855+ case 0x33:
856856 see int21_syscall
857857*/
858858 /* Get InDOS flag */
@@ -1148,7 +1148,7 @@ VOID ASMCFUNC int21_service(iregs FAR * r)
11481148 lr .AX = 0 ;
11491149 goto short_check ;
11501150/*
1151- case 0x50:
1151+ case 0x50:
11521152 case 0x51:
11531153 see int21_syscall
11541154*/
@@ -1397,7 +1397,7 @@ VOID ASMCFUNC int21_service(iregs FAR * r)
13971397 break ;
13981398#endif
13991399
1400- /* UNDOCUMENTED: return current psp
1400+ /* UNDOCUMENTED: return current psp
14011401 case 0x62: is in int21_syscall
14021402 lr.BX = cu_psp;
14031403 break;
@@ -1410,7 +1410,7 @@ VOID ASMCFUNC int21_service(iregs FAR * r)
14101410#if 0
14111411 /* not really supported, but will pass. */
14121412 lr .AL = 0x00 ; /*jpp: according to interrupt list */
1413- /*Bart: fails for PQDI and WATCOM utilities:
1413+ /*Bart: fails for PQDI and WATCOM utilities:
14141414 use the above again */
14151415#endif
14161416 switch (lr .AL )
@@ -1589,7 +1589,7 @@ VOID ASMCFUNC int21_service(iregs FAR * r)
15891589 /* get canonical long name or path, truename that accepts short name and returns long name */
15901590 case 0x02 : {
15911591 }
1592- default :
1592+ default :
15931593 goto unsupp ;
15941594 }
15951595 }
@@ -1602,7 +1602,7 @@ VOID ASMCFUNC int21_service(iregs FAR * r)
16021602 case 0xa0 :
16031603 /* Win95 LFN - find file close */
16041604 case 0xa1 : {
1605- lfn_findclose :
1605+ lfn_findclose :
16061606 goto unsupp ;
16071607 }
16081608#if 0
@@ -1667,7 +1667,7 @@ VOID ASMCFUNC int21_service(iregs FAR * r)
16671667 /* from DOS date/time to Win95 UTC */
16681668 case 0x01 : {
16691669 }
1670- default :
1670+ default :
16711671 goto unsupp ;
16721672 }
16731673 }
@@ -1803,8 +1803,8 @@ struct int25regs {
18031803 UWORD flags , ip , cs ;
18041804};
18051805
1806- /*
1807- this function is called from an assembler wrapper function
1806+ /*
1807+ this function is called from an assembler wrapper function
18081808*/
18091809VOID ASMCFUNC int2526_handler (WORD mode , struct int25regs FAR * r )
18101810{
@@ -2002,9 +2002,9 @@ VOID ASMCFUNC int2F_12_handler(struct int2f12regs FAR *pr)
20022002 r .BX = FP_OFF (& winStartupInfo );
20032003 winStartupInfo .winver = r .di ; /* match what caller says it is */
20042004#if defined __GNUC__
2005- winseg1 = FP_SEG (& winStartupInfo );
2006- winseg2 = FP_SEG (& DATASTART );
2007- winseg3 = FP_OFF (& markEndInstanceData );
2005+ winseg1 = FP_SEG (& winStartupInfo );
2006+ winseg2 = FP_SEG (& DATASTART );
2007+ winseg3 = FP_OFF (& markEndInstanceData );
20082008#endif
20092009 winInstanced = 1 ; /* internal flag marking Windows is active */
20102010 DebugPrintf (("Win startup\n" ));
@@ -2103,7 +2103,7 @@ VOID ASMCFUNC int2F_12_handler(struct int2f12regs FAR *pr)
21032103 else return BX:CX size in bytes allocated to driver
21042104 and DX:AX set to A2AB:B97Ch */
21052105 mcb FAR * smcb = MK_PTR (mcb , (r .ES - 1 ), 0 ); /* para before is possibly submcb segment */
2106- /* drivers always start a seg:0 (DI==0), so if not then either
2106+ /* drivers always start a seg:0 (DI==0), so if not then either
21072107 not device driver or duplicate (ie device driver file loaded
21082108 is of multi-driver variety; multiple device drivers in same file,
21092109 whose memory was allocated as a single chunk)
@@ -2231,18 +2231,18 @@ VOID ASMCFUNC int2F_12_handler(struct int2f12regs FAR *pr)
22312231 -- p -> sft_count ;
22322232 }
22332233 break ;
2234-
2234+
22352235 case 0x0a : /* perform critical error */
22362236 /* differs from 0x06 as uses current drive & error on stack */
22372237 /* code, drive number, error, device header */
22382238 r .AL = CriticalError (0x38 , /* ignore/retry/fail - based on RBIL possible return values */
2239- default_drive ,
2240- r .callerARG1 , /* error, from RBIL passed on stack */
2239+ default_drive ,
2240+ r .callerARG1 , /* error, from RBIL passed on stack */
22412241 CDSp [(WORD )default_drive ].cdsDpb -> dpb_device );
22422242 r .FLAGS |= FLG_CARRY ;
22432243 if (r .AL == 1 ) r .FLAGS &= ~FLG_CARRY ; /* carry clear if should retry */
22442244 break ;
2245-
2245+
22462246 case 0x0b : /* sharing violation occurred */
22472247 {
22482248 /* ES:DI = SFT for previous open of file */
@@ -2253,8 +2253,8 @@ VOID ASMCFUNC int2F_12_handler(struct int2f12regs FAR *pr)
22532253 if ((sftp -> sft_mode & O_FCB ) || !(sftp -> sft_mode & (O_SHAREMASK | O_NOINHERIT )))
22542254 {
22552255 r .AL = CriticalError (0x38 , /* ignore/retry/fail - ??? */
2256- default_drive ,
2257- r .callerARG1 , /* error, from RBIL passed on stack */
2256+ default_drive ,
2257+ r .callerARG1 , /* error, from RBIL passed on stack */
22582258 CDSp [(WORD )default_drive ].cdsDpb -> dpb_device );
22592259 /* clear carry if should retry */
22602260 if (r .AL == 1 ) r .FLAGS &= ~FLG_CARRY ;
@@ -2314,7 +2314,7 @@ VOID ASMCFUNC int2F_12_handler(struct int2f12regs FAR *pr)
23142314 break ;
23152315
23162316 case 0x13 :
2317- /* uppercase character */
2317+ /* uppercase character */
23182318 /* for now, ASCII only because nls.c cannot handle DS!=SS */
23192319 r .AL = (unsigned char )r .callerARG1 ;
23202320 if (r .AL >= 'a' && r .AL <= 'z' )
@@ -2347,7 +2347,7 @@ VOID ASMCFUNC int2F_12_handler(struct int2f12regs FAR *pr)
23472347 ; returns
23482348 ; CF set if error
23492349 ; DS:SI pointer to CDS for drive
2350- ;
2350+ ;
23512351 ; called like
23522352 ; push 2 (c-drive)
23532353 ; mov ax,1217
@@ -2398,7 +2398,7 @@ VOID ASMCFUNC int2F_12_handler(struct int2f12regs FAR *pr)
23982398 break ;
23992399 }
24002400 strcpy (TempCDS .cdsCurrentPath , "?:\\" );
2401- * TempCDS .cdsCurrentPath = (BYTE )(r .callerARG1 & 0xff );
2401+ * TempCDS .cdsCurrentPath = (BYTE )(r .callerARG1 & 0xff );
24022402 TempCDS .cdsBackslashOffset = 2 ;
24032403 if (cdsp -> cdsFlags )
24042404 {
@@ -2419,7 +2419,7 @@ VOID ASMCFUNC int2F_12_handler(struct int2f12regs FAR *pr)
24192419 r .FLAGS &= ~FLG_CARRY ;
24202420 break ;
24212421 }
2422-
2422+
24232423 case 0x20 : /* get job file table entry */
24242424 {
24252425 psp FAR * p = MK_FP (cu_psp , 0 );
@@ -2544,10 +2544,10 @@ VOID ASMCFUNC int2F_12_handler(struct int2f12regs FAR *pr)
25442544 goto error_carry ;
25452545 }
25462546 break ;
2547-
2547+
25482548 case 0x2c : /* added by James Tabor For Zip Drives
25492549 Return Null Device Pointer */
2550- /* by UDOS+RBIL: get header of SECOND device driver in device chain,
2550+ /* by UDOS+RBIL: get header of SECOND device driver in device chain,
25512551 omitting the NUL device TE */
25522552 r .BX = FP_SEG (nul_dev .dh_next );
25532553 r .AX = FP_OFF (nul_dev .dh_next );
@@ -2569,7 +2569,7 @@ VOID ASMCFUNC int2F_12_handler(struct int2f12regs FAR *pr)
25692569 os_setver_major = r .DL ;
25702570 os_setver_minor = r .DH ;
25712571 }
2572- else /* set returned version from emulated true DOS version */
2572+ else /* set returned version from emulated true DOS version */
25732573 {
25742574 os_setver_major = os_major ;
25752575 os_setver_minor = os_minor ;
0 commit comments