--- MiNT/src/file.h 2018/04/24 17:55:53 1.1.1.2 +++ MiNT/src/file.h 2018/04/24 17:58:10 1.1.1.5 @@ -1,6 +1,10 @@ /* -Copyright 1991,1992 Eric R. Smith. All rights reserved. +Copyright 1991,1992 Eric R. Smith. + +Copyright 1992,1993,1994 Atari Corporation. + +All rights reserved. */ @@ -16,6 +20,8 @@ struct filesys; /* forward declaration struct devdrv; /* ditto */ +struct timeout; /* and ditto */ + typedef struct f_cookie { @@ -62,7 +68,7 @@ typedef struct dtabuf { long dta_size; - char dta_name[TOS_NAMELEN]; + char dta_name[TOS_NAMELEN+1]; } DTABUF; @@ -84,6 +90,10 @@ typedef struct dirstruct { /* NOTE: this must be at least 45 bytes */ + struct dirstruct *next; /* linked together so we can close them + + on process termination */ + } DIR; @@ -150,7 +160,7 @@ typedef struct xattr { ushort dev; - ushort reserved1; + ushort rdev; /* "real" device */ ushort nlink; @@ -292,7 +302,9 @@ typedef struct filesys { #define FS_NOXBIT 0x04 /* if a file can be read, it can be executed */ +#define FS_LONGPATH 0x08 /* file system understands "size" argument to + "getname" */ long ARGS_ON_STACK (*root) P_((int drv, fcookie *fc)); @@ -318,7 +330,9 @@ typedef struct filesys { long ARGS_ON_STACK (*remove) P_((fcookie *dir, const char *name)); - long ARGS_ON_STACK (*getname) P_((fcookie *relto, fcookie *dir, char *pathname)); + long ARGS_ON_STACK (*getname) P_((fcookie *relto, fcookie *dir, + + char *pathname, int size)); long ARGS_ON_STACK (*rename) P_((fcookie *olddir, char *oldname, @@ -352,7 +366,9 @@ typedef struct filesys { long ARGS_ON_STACK (*dskchng) P_((int drv)); - long zero; + long ARGS_ON_STACK (*release) P_((fcookie *)); + + long ARGS_ON_STACK (*dupcookie) P_((fcookie *new, fcookie *old)); } FILESYS; @@ -450,7 +466,7 @@ struct kerinfo { void ARGS_ON_STACK (*nap) P_((unsigned)); - void ARGS_ON_STACK (*sleep) P_((int que, long cond)); + int ARGS_ON_STACK (*sleep) P_((int que, long cond)); void ARGS_ON_STACK (*wake) P_((int que, long cond)); @@ -462,13 +478,21 @@ struct kerinfo { int ARGS_ON_STACK (*denyshare) P_((FILEPTR *, FILEPTR *)); + LOCK * ARGS_ON_STACK (*denylock) P_((LOCK *, LOCK *)); -/* reserved for future use */ - LOCK * ARGS_ON_STACK (*denylock) P_((LOCK *, LOCK *)); +/* functions for adding/cancelling timeouts */ - long res2[9]; + struct timeout * ARGS_ON_STACK (*addtimeout) P_((long, void (*)())); + + void ARGS_ON_STACK (*canceltimeout) P_((struct timeout *)); + + + +/* reserved for future use */ + + long res2[7]; }; @@ -698,6 +722,8 @@ struct kerinfo { #define TIOCSFLAGS (('T'<< 8) | 23) +#define TIOCOUTQ (('T'<< 8) | 24) + /* cursor control Fcntls: @@ -758,6 +784,26 @@ struct kerinfo { #define PTRACE11 (('P'<< 8) | 11) +#define PLOADINFO (('P'<< 8) | 12) + +#define PFSTAT (('P'<< 8) | 13) + + + +struct ploadinfo { + + /* passed */ + + short fnamelen; + + /* returned */ + + char *cmdlin, *fname; + +}; + + + #define SHMGETBLK (('M'<< 8) | 0) @@ -986,6 +1032,36 @@ struct dev_descr { +#define FS_INSTALL 0xf001 /* let the kernel know about the file system */ + +#define FS_MOUNT 0xf002 /* make a new directory for a file system */ + +#define FS_UNMOUNT 0xf003 /* remove a directory for a file system */ + +#define FS_UNINSTALL 0xf004 /* remove a file system from the list */ + + + + + +struct fs_descr + +{ + + FILESYS *file_system; + + short dev_no; /* this is filled in by MiNT if arg == FS_MOUNT*/ + + long flags; + + long reserved[4]; + +}; + + + + + /* number of BIOS drives */ #define NUM_DRIVES 32 @@ -1012,7 +1088,19 @@ struct dev_descr { -#define PROC_BASE_DEV 0xA000 +/* various fields for the "rdev" device numbers */ + +#define BIOS_DRIVE_RDEV 0x0000 + +#define BIOS_RDEV 0x0100 + +#define FAKE_RDEV 0x0200 + +#define PIPE_RDEV 0x7e00 + +#define UNK_RDEV 0x7f00 + +#define PROC_RDEV_BASE 0xa000 @@ -1032,5 +1120,35 @@ extern char follow_links[]; +/* internal bios file structure */ + + + +#define BNAME_MAX 13 + + + +struct bios_file { + + char name[BNAME_MAX+1]; /* device name */ + + DEVDRV *device; /* device driver for device */ + + short private; /* extra info for device driver */ + + ushort flags; /* flags for device open */ + + struct tty *tty; /* tty structure (if appropriate) */ + + struct bios_file *next; + + short lockpid; /* owner of the lock */ + + XATTR xattr; /* guess what... */ + +}; + + + #endif /* _filesys_h */