diff options
Diffstat (limited to 'arch/um/include/os.h')
-rw-r--r-- | arch/um/include/os.h | 74 |
1 files changed, 36 insertions, 38 deletions
diff --git a/arch/um/include/os.h b/arch/um/include/os.h index f88856c28a66..5316e8a4a4fd 100644 --- a/arch/um/include/os.h +++ b/arch/um/include/os.h | |||
@@ -1,4 +1,4 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright (C) 2002 Jeff Dike (jdike@karaya.com) | 2 | * Copyright (C) 2002 Jeff Dike (jdike@karaya.com) |
3 | * Licensed under the GPL | 3 | * Licensed under the GPL |
4 | */ | 4 | */ |
@@ -15,9 +15,9 @@ | |||
15 | #include "irq_user.h" | 15 | #include "irq_user.h" |
16 | #include "sysdep/tls.h" | 16 | #include "sysdep/tls.h" |
17 | 17 | ||
18 | #define OS_TYPE_FILE 1 | 18 | #define OS_TYPE_FILE 1 |
19 | #define OS_TYPE_DIR 2 | 19 | #define OS_TYPE_DIR 2 |
20 | #define OS_TYPE_SYMLINK 3 | 20 | #define OS_TYPE_SYMLINK 3 |
21 | #define OS_TYPE_CHARDEV 4 | 21 | #define OS_TYPE_CHARDEV 4 |
22 | #define OS_TYPE_BLOCKDEV 5 | 22 | #define OS_TYPE_BLOCKDEV 5 |
23 | #define OS_TYPE_FIFO 6 | 23 | #define OS_TYPE_FIFO 6 |
@@ -61,68 +61,68 @@ struct openflags { | |||
61 | }; | 61 | }; |
62 | 62 | ||
63 | #define OPENFLAGS() ((struct openflags) { .r = 0, .w = 0, .s = 0, .c = 0, \ | 63 | #define OPENFLAGS() ((struct openflags) { .r = 0, .w = 0, .s = 0, .c = 0, \ |
64 | .t = 0, .a = 0, .e = 0, .cl = 0 }) | 64 | .t = 0, .a = 0, .e = 0, .cl = 0 }) |
65 | 65 | ||
66 | static inline struct openflags of_read(struct openflags flags) | 66 | static inline struct openflags of_read(struct openflags flags) |
67 | { | 67 | { |
68 | flags.r = 1; | 68 | flags.r = 1; |
69 | return(flags); | 69 | return flags; |
70 | } | 70 | } |
71 | 71 | ||
72 | static inline struct openflags of_write(struct openflags flags) | 72 | static inline struct openflags of_write(struct openflags flags) |
73 | { | 73 | { |
74 | flags.w = 1; | 74 | flags.w = 1; |
75 | return(flags); | 75 | return flags; |
76 | } | 76 | } |
77 | 77 | ||
78 | static inline struct openflags of_rdwr(struct openflags flags) | 78 | static inline struct openflags of_rdwr(struct openflags flags) |
79 | { | 79 | { |
80 | return(of_read(of_write(flags))); | 80 | return of_read(of_write(flags)); |
81 | } | 81 | } |
82 | 82 | ||
83 | static inline struct openflags of_set_rw(struct openflags flags, int r, int w) | 83 | static inline struct openflags of_set_rw(struct openflags flags, int r, int w) |
84 | { | 84 | { |
85 | flags.r = r; | 85 | flags.r = r; |
86 | flags.w = w; | 86 | flags.w = w; |
87 | return(flags); | 87 | return flags; |
88 | } | 88 | } |
89 | 89 | ||
90 | static inline struct openflags of_sync(struct openflags flags) | 90 | static inline struct openflags of_sync(struct openflags flags) |
91 | { | 91 | { |
92 | flags.s = 1; | 92 | flags.s = 1; |
93 | return(flags); | 93 | return flags; |
94 | } | 94 | } |
95 | 95 | ||
96 | static inline struct openflags of_create(struct openflags flags) | 96 | static inline struct openflags of_create(struct openflags flags) |
97 | { | 97 | { |
98 | flags.c = 1; | 98 | flags.c = 1; |
99 | return(flags); | 99 | return flags; |
100 | } | 100 | } |
101 | 101 | ||
102 | static inline struct openflags of_trunc(struct openflags flags) | 102 | static inline struct openflags of_trunc(struct openflags flags) |
103 | { | 103 | { |
104 | flags.t = 1; | 104 | flags.t = 1; |
105 | return(flags); | 105 | return flags; |
106 | } | 106 | } |
107 | 107 | ||
108 | static inline struct openflags of_append(struct openflags flags) | 108 | static inline struct openflags of_append(struct openflags flags) |
109 | { | 109 | { |
110 | flags.a = 1; | 110 | flags.a = 1; |
111 | return(flags); | 111 | return flags; |
112 | } | 112 | } |
113 | 113 | ||
114 | static inline struct openflags of_excl(struct openflags flags) | 114 | static inline struct openflags of_excl(struct openflags flags) |
115 | { | 115 | { |
116 | flags.e = 1; | 116 | flags.e = 1; |
117 | return(flags); | 117 | return flags; |
118 | } | 118 | } |
119 | 119 | ||
120 | static inline struct openflags of_cloexec(struct openflags flags) | 120 | static inline struct openflags of_cloexec(struct openflags flags) |
121 | { | 121 | { |
122 | flags.cl = 1; | 122 | flags.cl = 1; |
123 | return(flags); | 123 | return flags; |
124 | } | 124 | } |
125 | 125 | ||
126 | /* file.c */ | 126 | /* file.c */ |
127 | extern int os_stat_file(const char *file_name, struct uml_stat *buf); | 127 | extern int os_stat_file(const char *file_name, struct uml_stat *buf); |
128 | extern int os_stat_fd(const int fd, struct uml_stat *buf); | 128 | extern int os_stat_fd(const int fd, struct uml_stat *buf); |
@@ -199,12 +199,12 @@ extern int os_getpid(void); | |||
199 | extern int os_getpgrp(void); | 199 | extern int os_getpgrp(void); |
200 | 200 | ||
201 | extern void init_new_thread_stack(void *sig_stack, void (*usr1_handler)(int)); | 201 | extern void init_new_thread_stack(void *sig_stack, void (*usr1_handler)(int)); |
202 | extern void init_new_thread_signals(int altstack); | 202 | extern void init_new_thread_signals(void); |
203 | extern int run_kernel_thread(int (*fn)(void *), void *arg, void **jmp_ptr); | 203 | extern int run_kernel_thread(int (*fn)(void *), void *arg, void **jmp_ptr); |
204 | 204 | ||
205 | extern int os_map_memory(void *virt, int fd, unsigned long long off, | 205 | extern int os_map_memory(void *virt, int fd, unsigned long long off, |
206 | unsigned long len, int r, int w, int x); | 206 | unsigned long len, int r, int w, int x); |
207 | extern int os_protect_memory(void *addr, unsigned long len, | 207 | extern int os_protect_memory(void *addr, unsigned long len, |
208 | int r, int w, int x); | 208 | int r, int w, int x); |
209 | extern int os_unmap_memory(void *addr, int len); | 209 | extern int os_unmap_memory(void *addr, int len); |
210 | extern int os_drop_memory(void *addr, int length); | 210 | extern int os_drop_memory(void *addr, int length); |
@@ -318,7 +318,6 @@ extern void reboot_skas(void); | |||
318 | 318 | ||
319 | /* irq.c */ | 319 | /* irq.c */ |
320 | extern int os_waiting_for_events(struct irq_fd *active_fds); | 320 | extern int os_waiting_for_events(struct irq_fd *active_fds); |
321 | extern int os_isatty(int fd); | ||
322 | extern int os_create_pollfd(int fd, int events, void *tmp_pfd, int size_tmpfds); | 321 | extern int os_create_pollfd(int fd, int events, void *tmp_pfd, int size_tmpfds); |
323 | extern void os_free_irq_by_cb(int (*test)(struct irq_fd *, void *), void *arg, | 322 | extern void os_free_irq_by_cb(int (*test)(struct irq_fd *, void *), void *arg, |
324 | struct irq_fd *active_fds, struct irq_fd ***last_irq_ptr2); | 323 | struct irq_fd *active_fds, struct irq_fd ***last_irq_ptr2); |
@@ -330,9 +329,8 @@ extern void os_set_ioignore(void); | |||
330 | extern void init_irq_signals(int on_sigstack); | 329 | extern void init_irq_signals(int on_sigstack); |
331 | 330 | ||
332 | /* sigio.c */ | 331 | /* sigio.c */ |
333 | extern void write_sigio_workaround(void); | ||
334 | extern int add_sigio_fd(int fd, int read); | ||
335 | extern int ignore_sigio_fd(int fd); | 332 | extern int ignore_sigio_fd(int fd); |
333 | extern void maybe_sigio_broken(int fd, int read); | ||
336 | 334 | ||
337 | /* skas/trap */ | 335 | /* skas/trap */ |
338 | extern void sig_handler_common_skas(int sig, void *sc_ptr); | 336 | extern void sig_handler_common_skas(int sig, void *sc_ptr); |