OpenCores
URL https://opencores.org/ocsvn/openrisc/openrisc/trunk

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [rtos/] [ecos-3.0/] [packages/] [hal/] [common/] [current/] [src/] [gdb-fileio.h] - Blame information for rev 786

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 786 skrzyp
/* gdb-fileio.h.
2
   Contains definitions used inside of the File I/O facility.
3
 
4
   Copyright 2002 Free Software Foundation, Inc.
5
 
6
*/
7
 
8
#ifndef _GDB_FILEIO_H_
9
#define _GDB_FILEIO_H_
10
 
11
#include <sys/types.h>
12
 
13
/* The following flags are defined to be independent of the host
14
   as well as the target side implementation of these constants.
15
   All constants are defined with a leading FILEIO_ in the name
16
   to allow the usage of these constants together with the
17
   corresponding implementation dependent constants in one module. */
18
 
19
/* open(2) flags */
20
#define FILEIO_O_RDONLY           0x0
21
#define FILEIO_O_WRONLY           0x1
22
#define FILEIO_O_RDWR             0x2
23
#define FILEIO_O_APPEND           0x8
24
#define FILEIO_O_CREAT          0x200
25
#define FILEIO_O_TRUNC          0x400
26
#define FILEIO_O_EXCL           0x800
27
#define FILEIO_O_BINARY       0x10000
28
#define FILEIO_O_TEXT         0x20000
29
#define FILEIO_O_SUPPORTED      (FILEIO_O_RDONLY | FILEIO_O_WRONLY| \
30
                                 FILEIO_O_RDWR   | FILEIO_O_APPEND| \
31
                                 FILEIO_O_CREAT  | FILEIO_O_TRUNC| \
32
                                 FILEIO_O_EXCL | FILEIO_O_BINARY | \
33
                                 FILEIO_O_TEXT )
34
 
35
/* mode_t bits */
36
#define FILEIO_S_IFREG        0100000
37
#define FILEIO_S_IFDIR         040000
38
#define FILEIO_S_IFCHR         020000
39
#define FILEIO_S_IRUSR           0400
40
#define FILEIO_S_IWUSR           0200
41
#define FILEIO_S_IXUSR           0100
42
#define FILEIO_S_IRWXU           0700
43
#define FILEIO_S_IRGRP            040
44
#define FILEIO_S_IWGRP            020
45
#define FILEIO_S_IXGRP            010
46
#define FILEIO_S_IRWXG            070
47
#define FILEIO_S_IROTH             04
48
#define FILEIO_S_IWOTH             02
49
#define FILEIO_S_IXOTH             01
50
#define FILEIO_S_IRWXO             07
51
#define FILEIO_S_SUPPORTED         (FILEIO_S_IFREG|FILEIO_S_IFDIR|  \
52
                                    FILEIO_S_IRWXU|FILEIO_S_IRWXG|  \
53
                                    FILEIO_S_IRWXO)
54
 
55
/* lseek(2) flags */
56
#define FILEIO_SEEK_SET             0
57
#define FILEIO_SEEK_CUR             1
58
#define FILEIO_SEEK_END             2
59
 
60
/* errno values */
61
#define FILEIO_EPERM                1
62
#define FILEIO_ENOENT               2
63
#define FILEIO_EINTR                4
64
#define FILEIO_EIO                  5
65
#define FILEIO_EBADF                9
66
#define FILEIO_EACCES              13
67
#define FILEIO_EFAULT              14
68
#define FILEIO_EBUSY               16
69
#define FILEIO_EEXIST              17
70
#define FILEIO_ENODEV              19
71
#define FILEIO_ENOTDIR             20
72
#define FILEIO_EISDIR              21
73
#define FILEIO_EINVAL              22
74
#define FILEIO_ENFILE              23
75
#define FILEIO_EMFILE              24
76
#define FILEIO_EFBIG               27
77
#define FILEIO_ENOSPC              28
78
#define FILEIO_ESPIPE              29
79
#define FILEIO_EROFS               30
80
#define FILEIO_ENOSYS              88
81
#define FILEIO_ENAMETOOLONG        91
82
#define FILEIO_EUNKNOWN          9999
83
 
84
/* limits */
85
#define FILEIO_INT_MIN    -2147483648L
86
#define FILEIO_INT_MAX     2147483647L
87
#define FILEIO_UINT_MAX    4294967295UL
88
#define FILEIO_LONG_MIN   -9223372036854775808LL
89
#define FILEIO_LONG_MAX    9223372036854775807LL
90
#define FILEIO_ULONG_MAX   18446744073709551615ULL
91
 
92
/* Integral types as used in protocol. */
93
#if 0
94
typedef __int32_t fio_int_t;
95
typedef __uint32_t fio_uint_t, fio_mode_t, fio_time_t;
96
typedef __int64_t fio_long_t;
97
typedef __uint64_t fio_ulong_t;
98
#endif
99
 
100
#define FIO_INT_LEN   4
101
#define FIO_UINT_LEN  4
102
#define FIO_MODE_LEN  4
103
#define FIO_TIME_LEN  4
104
#define FIO_LONG_LEN  8
105
#define FIO_ULONG_LEN 8
106
 
107
typedef char fio_int_t[FIO_INT_LEN];
108
typedef char fio_uint_t[FIO_UINT_LEN];
109
typedef char fio_mode_t[FIO_MODE_LEN];
110
typedef char fio_time_t[FIO_TIME_LEN];
111
typedef char fio_long_t[FIO_LONG_LEN];
112
typedef char fio_ulong_t[FIO_ULONG_LEN];
113
 
114
/* Struct stat as used in protocol.  For complete independence
115
   of host/target systems, it's defined as an array with offsets
116
   to the members. */
117
 
118
struct fio_stat {
119
  fio_uint_t  st_dev;
120
  fio_uint_t  st_ino;
121
  fio_mode_t  st_mode;
122
  fio_uint_t  st_nlink;
123
  fio_uint_t  st_uid;
124
  fio_uint_t  st_gid;
125
  fio_uint_t  st_rdev;
126
  fio_ulong_t st_size;
127
  fio_ulong_t st_blksize;
128
  fio_ulong_t st_blocks;
129
  fio_time_t  st_atime;
130
  fio_time_t  st_mtime;
131
  fio_time_t  st_ctime;
132
};
133
 
134
struct fio_timeval {
135
  fio_time_t  tv_sec;
136
  fio_long_t  tv_usec;
137
};
138
 
139
#endif /* _GDB_FILEIO_H_ */

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.