2000-05-06 21:34:20 +02:00
|
|
|
/****************************************************************/
|
|
|
|
/* */
|
|
|
|
/* portab.h */
|
|
|
|
/* */
|
|
|
|
/* DOS-C portability typedefs, etc. */
|
|
|
|
/* */
|
|
|
|
/* May 1, 1995 */
|
|
|
|
/* */
|
|
|
|
/* Copyright (c) 1995 */
|
|
|
|
/* Pasquale J. Villani */
|
|
|
|
/* All Rights Reserved */
|
|
|
|
/* */
|
|
|
|
/* This file is part of DOS-C. */
|
|
|
|
/* */
|
|
|
|
/* DOS-C is free software; you can redistribute it and/or */
|
|
|
|
/* modify it under the terms of the GNU General Public License */
|
|
|
|
/* as published by the Free Software Foundation; either version */
|
|
|
|
/* 2, or (at your option) any later version. */
|
|
|
|
/* */
|
|
|
|
/* DOS-C is distributed in the hope that it will be useful, but */
|
|
|
|
/* WITHOUT ANY WARRANTY; without even the implied warranty of */
|
|
|
|
/* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See */
|
|
|
|
/* the GNU General Public License for more details. */
|
|
|
|
/* */
|
|
|
|
/* You should have received a copy of the GNU General Public */
|
|
|
|
/* License along with DOS-C; see the file COPYING. If not, */
|
|
|
|
/* write to the Free Software Foundation, 675 Mass Ave, */
|
|
|
|
/* Cambridge, MA 02139, USA. */
|
|
|
|
/****************************************************************/
|
|
|
|
|
|
|
|
#ifdef MAIN
|
|
|
|
#ifdef VERSION_STRINGS
|
|
|
|
static char *portab_hRcsId = "$Id$";
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
|
|
|
|
/*
|
|
|
|
* $Log$
|
2001-06-03 16:16:18 +02:00
|
|
|
* Revision 1.9 2001/06/03 14:16:17 bartoldeman
|
|
|
|
* BUFFERS tuning and misc bug fixes/cleanups (2024c).
|
|
|
|
*
|
2001-04-15 05:21:50 +02:00
|
|
|
* Revision 1.8 2001/04/15 03:21:50 bartoldeman
|
|
|
|
* See history.txt for the list of fixes.
|
|
|
|
*
|
2001-03-21 03:56:26 +01:00
|
|
|
* Revision 1.7 2001/03/21 02:56:25 bartoldeman
|
|
|
|
* See history.txt for changes. Bug fixes and HMA support are the main ones.
|
2001-03-19 05:50:56 +01:00
|
|
|
*
|
|
|
|
* Revision 1.5 2001/03/08 21:15:00 bartoldeman
|
|
|
|
* Fixes for MK_FP and friends from Tom Ehlert; reduces kernel by 1.5k.
|
|
|
|
*
|
2000-08-06 06:18:21 +02:00
|
|
|
* Revision 1.4 2000/08/06 04:18:21 jimtabor
|
|
|
|
* See history.txt
|
|
|
|
*
|
2000-05-25 22:56:23 +02:00
|
|
|
* Revision 1.3 2000/05/25 20:56:19 jimtabor
|
|
|
|
* Fixed project history
|
|
|
|
*
|
2000-05-08 06:30:00 +02:00
|
|
|
* Revision 1.2 2000/05/08 04:28:22 jimtabor
|
|
|
|
* Update CVS to 2020
|
2000-05-06 21:34:20 +02:00
|
|
|
*
|
2000-05-25 22:56:23 +02:00
|
|
|
* Revision 1.1.1.1 2000/05/06 19:34:53 jhall1
|
|
|
|
* The FreeDOS Kernel. A DOS kernel that aims to be 100% compatible with
|
|
|
|
* MS-DOS. Distributed under the GNU GPL.
|
|
|
|
*
|
2000-05-06 21:34:20 +02:00
|
|
|
* Revision 1.2 1999/08/25 03:17:11 jprice
|
|
|
|
* ror4 patches to allow TC 2.01 compile.
|
|
|
|
*
|
|
|
|
* Revision 1.1.1.1 1999/03/29 15:39:33 jprice
|
|
|
|
* New version without IPL.SYS
|
|
|
|
*
|
|
|
|
* Revision 1.3 1999/02/01 01:40:06 jprice
|
|
|
|
* Clean up
|
|
|
|
*
|
|
|
|
* Revision 1.2 1999/01/22 04:17:40 jprice
|
|
|
|
* Formating
|
|
|
|
*
|
|
|
|
* Revision 1.1.1.1 1999/01/20 05:51:01 jprice
|
|
|
|
* Imported sources
|
|
|
|
*
|
|
|
|
*
|
|
|
|
* Rev 1.5 04 Jan 1998 23:14:16 patv
|
|
|
|
* Changed Log for strip utility
|
|
|
|
*
|
|
|
|
* Rev 1.4 29 May 1996 21:25:16 patv
|
|
|
|
* bug fixes for v0.91a
|
|
|
|
*
|
|
|
|
* Rev 1.3 19 Feb 1996 3:15:32 patv
|
|
|
|
* Added NLS, int2f and config.sys processing
|
|
|
|
*
|
|
|
|
* Rev 1.2 01 Sep 1995 17:35:44 patv
|
|
|
|
* First GPL release.
|
|
|
|
*
|
|
|
|
* Rev 1.1 30 Jul 1995 20:43:50 patv
|
|
|
|
* Eliminated version strings in ipl
|
|
|
|
*
|
|
|
|
* Rev 1.0 02 Jul 1995 10:39:50 patv
|
|
|
|
* Initial revision.
|
|
|
|
*/
|
|
|
|
|
|
|
|
/****************************************************************/
|
|
|
|
/* */
|
|
|
|
/* Machine dependant portable types. Note that this section is */
|
|
|
|
/* used primarily for segmented architectures. Common types and */
|
|
|
|
/* types used relating to segmented operations are found here. */
|
|
|
|
/* */
|
|
|
|
/* Be aware that segmented architectures impose on linear */
|
|
|
|
/* architectures because they require special types to be used */
|
|
|
|
/* throught the code that must be reduced to empty preprocessor */
|
|
|
|
/* replacements in the linear machine. */
|
|
|
|
/* */
|
|
|
|
/* #ifdef <segmeted machine> */
|
|
|
|
/* # define FAR far */
|
|
|
|
/* # define NEAR near */
|
|
|
|
/* #endif */
|
|
|
|
/* */
|
|
|
|
/* #ifdef <linear machine> */
|
|
|
|
/* # define FAR */
|
|
|
|
/* # define NEAR */
|
|
|
|
/* #endif */
|
|
|
|
/* */
|
|
|
|
/****************************************************************/
|
|
|
|
|
|
|
|
#ifdef MC68K
|
|
|
|
|
|
|
|
#define far /* No far type */
|
|
|
|
#define interrupt /* No interrupt type */
|
|
|
|
|
|
|
|
#define VOID void
|
|
|
|
#define FAR /* linear architecture */
|
|
|
|
#define NEAR /* " " */
|
|
|
|
#define INRPT interrupt
|
|
|
|
|
|
|
|
#define CONST
|
|
|
|
#define REG register
|
|
|
|
|
|
|
|
#define API int /* linear architecture */
|
|
|
|
#define NONNATIVE
|
|
|
|
|
|
|
|
#define PARASIZE 4096 /* "paragraph" size */
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifdef I86
|
|
|
|
|
|
|
|
#define VOID void
|
|
|
|
#define FAR far /* segment architecture */
|
|
|
|
#define NEAR near /* " " */
|
|
|
|
#define INRPT interrupt
|
|
|
|
|
|
|
|
#define CONST const
|
|
|
|
#define REG register
|
|
|
|
|
|
|
|
#define API int far pascal /* segment architecture */
|
|
|
|
#define NATIVE
|
|
|
|
|
|
|
|
#define PARASIZE 16 /* "paragraph" size */
|
|
|
|
#endif
|
|
|
|
|
|
|
|
/* */
|
|
|
|
/* Boolean type & definitions of TRUE and FALSE boolean values */
|
|
|
|
/* */
|
|
|
|
typedef int BOOL;
|
|
|
|
#define FALSE (1==0)
|
|
|
|
#define TRUE (1==1)
|
|
|
|
|
|
|
|
/* */
|
|
|
|
/* Common pointer types */
|
|
|
|
/* */
|
|
|
|
#ifndef NULL
|
|
|
|
#define NULL 0
|
|
|
|
#endif
|
|
|
|
|
|
|
|
/* */
|
|
|
|
/* Convienence defines */
|
|
|
|
/* */
|
|
|
|
#define FOREVER while(TRUE)
|
|
|
|
#ifndef max
|
|
|
|
#define max(a,b) (((a) > (b)) ? (a) : (b))
|
|
|
|
#endif
|
|
|
|
#ifndef min
|
|
|
|
#define min(a,b) (((a) < (b)) ? (a) : (b))
|
|
|
|
#endif
|
|
|
|
|
|
|
|
/* */
|
|
|
|
/* Common byte, 16 bit and 32 bit types */
|
|
|
|
/* */
|
|
|
|
typedef char BYTE;
|
|
|
|
typedef short WORD;
|
|
|
|
typedef long DWORD;
|
|
|
|
|
|
|
|
typedef unsigned char UBYTE;
|
|
|
|
typedef unsigned short UWORD;
|
2000-08-06 06:18:21 +02:00
|
|
|
typedef unsigned long UDWORD;
|
2000-05-06 21:34:20 +02:00
|
|
|
|
|
|
|
typedef short SHORT;
|
|
|
|
|
|
|
|
typedef unsigned int BITS; /* for use in bit fields(!) */
|
|
|
|
|
|
|
|
typedef int COUNT;
|
|
|
|
typedef unsigned int UCOUNT;
|
|
|
|
typedef unsigned long ULONG;
|
|
|
|
|
2001-06-03 16:16:18 +02:00
|
|
|
#define STATIC /* local calls inside module */
|
|
|
|
|
|
|
|
|
2000-05-06 21:34:20 +02:00
|
|
|
#ifdef UNIX
|
|
|
|
typedef char FAR *ADDRESS;
|
|
|
|
#else
|
|
|
|
typedef void FAR *ADDRESS;
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifdef STRICT
|
|
|
|
typedef signed long LONG;
|
|
|
|
#else
|
|
|
|
#define LONG long
|
|
|
|
#endif
|
|
|
|
|
|
|
|
/* General far pointer macros */
|
|
|
|
#ifdef I86
|
2000-08-06 06:18:21 +02:00
|
|
|
#ifndef MK_FP
|
2001-03-19 05:50:56 +01:00
|
|
|
#define MK_FP(seg,ofs) ((VOID far *)(((ULONG)(seg)<<16)|(UWORD)(ofs)))
|
|
|
|
#define FP_SEG(fp) ((UWORD)((ULONG)(VOID FAR *)(fp)>>16))
|
2000-05-06 21:34:20 +02:00
|
|
|
#define FP_OFF(fp) ((UWORD)(fp))
|
|
|
|
#endif
|
2000-08-06 06:18:21 +02:00
|
|
|
#endif
|
2000-05-06 21:34:20 +02:00
|
|
|
|
|
|
|
#ifdef MC68K
|
|
|
|
#define MK_FP(seg,ofs) ((VOID *)(&(((BYTE *)(seg))[(ofs)])))
|
|
|
|
#define FP_SEG(fp) (0)
|
|
|
|
#define FP_OFF(fp) (fp)
|
|
|
|
#endif
|
2001-03-19 06:08:53 +01:00
|
|
|
|
|
|
|
/*
|
|
|
|
this suppresses the warning
|
|
|
|
unreferenced parameter 'x'
|
|
|
|
and (hopefully) generates no code
|
|
|
|
*/
|
|
|
|
|
|
|
|
#if defined(__TURBOC__)
|
|
|
|
#define UNREFERENCED_PARAMETER(x) if (x);
|
|
|
|
#else
|
|
|
|
#define UNREFERENCED_PARAMETER(x) x;
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
|
|
#if defined(__TURBOC__)
|
|
|
|
#define FDCALL pascal
|
|
|
|
#define CDECL cdecl
|
|
|
|
#else
|
|
|
|
#define FDCALL
|
|
|
|
#define CDECL
|
2001-04-15 05:21:50 +02:00
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifdef I86
|
|
|
|
/* commandline overflow - removing /DPROTO
|
|
|
|
TE*/
|
|
|
|
#define PROTO
|
|
|
|
#endif
|
|
|
|
|