From 3b5e79890eef806ef0cd41cc7de1ee6ca028f21c Mon Sep 17 00:00:00 2001 From: Bart Oldeman Date: Sat, 3 Aug 2002 04:08:58 +0000 Subject: [PATCH] Fix some prototypes and add definitions for "extended open" support. git-svn-id: https://svn.code.sf.net/p/freedos/svn/kernel/trunk@412 6ac86273-5f31-0410-b378-82cca8765d1b --- hdr/device.h | 4 ++-- hdr/dirmatch.h | 2 +- hdr/exe.h | 1 + hdr/fcb.h | 2 +- hdr/file.h | 15 +++++++++++++++ hdr/nls.h | 12 ++++++------ hdr/pcb.h | 6 ++++++ hdr/process.h | 4 ++-- 8 files changed, 34 insertions(+), 12 deletions(-) diff --git a/hdr/device.h b/hdr/device.h index aabb3c3..d2d3ac8 100644 --- a/hdr/device.h +++ b/hdr/device.h @@ -126,8 +126,8 @@ struct dhdr { struct dhdr FAR *dh_next; UWORD dh_attr; - VOID(*dh_strategy) (); - VOID(*dh_interrupt) (); + VOID(*dh_strategy) (void); + VOID(*dh_interrupt) (void); BYTE dh_name[8]; }; diff --git a/hdr/dirmatch.h b/hdr/dirmatch.h index b8e55d1..7a32723 100644 --- a/hdr/dirmatch.h +++ b/hdr/dirmatch.h @@ -36,7 +36,7 @@ static BYTE *dirmatch_hRcsId = #endif typedef struct { - BYTE dm_drive; + UBYTE dm_drive; BYTE dm_name_pat[FNAME_SIZE + FEXT_SIZE]; BYTE dm_attr_srch; UWORD dm_entry; diff --git a/hdr/exe.h b/hdr/exe.h index c895db0..8d23620 100644 --- a/hdr/exe.h +++ b/hdr/exe.h @@ -53,6 +53,7 @@ typedef struct { } exe_header; #define MAGIC 0x5a4d +#define OLD_MAGIC 0x4d5a /* * Log: exe.h,v diff --git a/hdr/fcb.h b/hdr/fcb.h index 1253b72..092f28e 100644 --- a/hdr/fcb.h +++ b/hdr/fcb.h @@ -78,7 +78,7 @@ static BYTE *fcb_hRcsId = /* File Control Block (FCB) */ typedef struct { - BYTE fcb_drive; /* Drive number 0=default, 1=A, etc */ + UBYTE fcb_drive; /* Drive number 0=default, 1=A, etc */ BYTE fcb_fname[FNAME_SIZE]; /* File name */ BYTE fcb_fext[FEXT_SIZE]; /* File name Extension */ UWORD fcb_cublock; /* Current block number of */ diff --git a/hdr/file.h b/hdr/file.h index e143e43..c3ef757 100644 --- a/hdr/file.h +++ b/hdr/file.h @@ -51,6 +51,21 @@ static BYTE *file_hRcsId = #define O_WRONLY SFT_MWRITE #define O_RDWR SFT_MRDWR +/* bits 2, 3 reserved */ +/* bits 4, 5, 6 sharing modes */ +#define O_NOINHERIT 0x0080 +#define O_OPEN 0x0100 /* not */ +#define O_TRUNC 0x0200 /* both */ +#define O_CREAT 0x0400 +#define O_LEGACY 0x0800 +#define O_LARGEFILE 0x1000 +#define O_NOCRIT 0x2000 +#define O_SYNC 0x4000 +#define O_FCB 0x8000 + +/* status for extended open */ +enum {S_OPENED = 1, S_CREATED = 2, S_REPLACED = 3}; + /* * Log: file.h,v * diff --git a/hdr/nls.h b/hdr/nls.h index 3a9af62..d591541 100644 --- a/hdr/nls.h +++ b/hdr/nls.h @@ -175,7 +175,7 @@ * * Performance tweaks: * When the system -- This word applies to the combination of kernel and - * any loaded MUX-14 extension   la NLSFUNC here. -- uppercases + * any loaded MUX-14 extension á la NLSFUNC here. -- uppercases * _filenames_, it must perform a DOS-65-A2 internally. In the basic * implementation this request would be channeled through MUX-14, even * if there is no external NLSFUNC at all. Also, when a NLS pkg had @@ -517,22 +517,22 @@ extern BYTE FAR hcTablesStart[], hcTablesEnd[]; #define CSYS_FD_IDSTRING "FreeDOS COUNTRY.SYS v1.0\r\n" -struct nlsCSys_function { /* S3: function definition */ +struct csys_function { /* S3: function definition */ UDWORD csys_rpos; /* relative position to actual data */ UWORD csys_length; UBYTE csys_fctID; /* As passed to DOS-65-XX */ UBYTE csys_reserved1; /* always 0, reserved for future use */ }; -struct nlsCSys_ccDefinition { /* S1: country/codepage reference */ +struct csys_ccDefinition { /* S1: country/codepage reference */ UDWORD csys_rpos; /* moving the 4byte value to the front can increase performance */ UWORD csys_cp; UWORD csys_cntry; }; -struct nlsCSys_numEntries { /* helper structure for "number of entries" */ - UWORD csys_numEntries; +struct csys_numEntries { /* helper structure for "number of entries" */ + UWORD csys_entries; }; /* Actually, this structure is never really used */ @@ -541,7 +541,7 @@ struct nlsCSys_fileHeader { /* S0: primary structure */ /* decrement by 1 to cut off \0 from IDString -- ska */ }; -struct nlsCSys_completeFileHeader { /* as S0, but full 128 bytes */ +struct csys_completeFileHeader { /* as S0, but full 128 bytes */ unsigned char csys_idstring[sizeof(CSYS_FD_IDSTRING) - 1]; unsigned char csys_padbytes[128 - (sizeof(CSYS_FD_IDSTRING) - 1)]; }; diff --git a/hdr/pcb.h b/hdr/pcb.h index 87a3785..657a1b3 100644 --- a/hdr/pcb.h +++ b/hdr/pcb.h @@ -81,6 +81,12 @@ typedef struct _iregss { UWORD ip, cs, flags; } iregs; +/* struct used for local copy of registers */ +typedef struct { + xreg a, b, c, d; + UWORD si, di, ds, es; +} lregs; + /* Registers directly passed to syscall; must be the same order as iregs! Is used to define parameters. */ diff --git a/hdr/process.h b/hdr/process.h index 33e6ec9..f25347c 100644 --- a/hdr/process.h +++ b/hdr/process.h @@ -68,7 +68,7 @@ typedef struct { /* CP/M-like entry point */ UBYTE ps_farcall; /* 05 far call opcode */ - VOID(FAR ASMCFUNC * ps_reentry) (); /* 06 re-entry point */ + VOID(FAR ASMCFUNC * ps_reentry) (void); /* 06 re-entry point */ intvec ps_isv22, /* 0a terminate address */ ps_isv23, /* 0e break address */ ps_isv24; /* 12 critical error address */ @@ -76,7 +76,7 @@ typedef struct { UBYTE ps_files[20]; /* 18 file table - 0xff is unused */ UWORD ps_environ; /* 2c environment paragraph */ BYTE FAR *ps_stack; /* 2e user stack pointer - int 21 */ - WORD ps_maxfiles; /* 32 maximum open files */ + UWORD ps_maxfiles; /* 32 maximum open files */ UBYTE FAR *ps_filetab; /* 34 open file table pointer */ VOID FAR *ps_prevpsp; /* 38 previous psp pointer */ BYTE FAR *ps_dta; /* 3c process dta address */