Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(692)

Side by Side Diff: src/untrusted/irt/irt.h

Issue 11141016: mprotect system call exposed to the untrusted code. (Closed) Base URL: svn://svn.chromium.org/native_client/trunk/src/native_client
Patch Set: Split mprotect into separate dev interface. Created 8 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | src/untrusted/irt/irt.gyp » ('j') | src/untrusted/irt/irt_dev_mprotect.c » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (c) 2012 The Native Client Authors. All rights reserved. 2 * Copyright (c) 2012 The Native Client Authors. All rights reserved.
3 * Use of this source code is governed by a BSD-style license that can be 3 * Use of this source code is governed by a BSD-style license that can be
4 * found in the LICENSE file. 4 * found in the LICENSE file.
5 */ 5 */
6 #ifndef NATIVE_CLIENT_SRC_UNTRUSTED_IRT_IRT_H_ 6 #ifndef NATIVE_CLIENT_SRC_UNTRUSTED_IRT_IRT_H_
7 #define NATIVE_CLIENT_SRC_UNTRUSTED_IRT_IRT_H_ 7 #define NATIVE_CLIENT_SRC_UNTRUSTED_IRT_IRT_H_
8 8
9 #include <stddef.h> 9 #include <stddef.h>
10 #include <sys/types.h> 10 #include <sys/types.h>
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after
84 struct nacl_irt_filename { 84 struct nacl_irt_filename {
85 int (*open)(const char *pathname, int oflag, mode_t cmode, int *newfd); 85 int (*open)(const char *pathname, int oflag, mode_t cmode, int *newfd);
86 int (*stat)(const char *pathname, struct stat *); 86 int (*stat)(const char *pathname, struct stat *);
87 }; 87 };
88 88
89 #define NACL_IRT_MEMORY_v0_1 "nacl-irt-memory-0.1" 89 #define NACL_IRT_MEMORY_v0_1 "nacl-irt-memory-0.1"
90 struct nacl_irt_memory { 90 struct nacl_irt_memory {
91 int (*sysbrk)(void **newbrk); 91 int (*sysbrk)(void **newbrk);
92 int (*mmap)(void **addr, size_t len, int prot, int flags, int fd, off_t off); 92 int (*mmap)(void **addr, size_t len, int prot, int flags, int fd, off_t off);
93 int (*munmap)(void *addr, size_t len); 93 int (*munmap)(void *addr, size_t len);
94 int (*mprotect)(void *addr, size_t len, int prot);
Mark Seaborn 2012/10/25 17:05:36 Don't add mprotect() to this interface. I assume
Petr Hosek 2012/10/25 18:46:57 Yes, sorry I have completely forgotten to remove m
94 }; 95 };
95 96
96 #define NACL_IRT_DYNCODE_v0_1 "nacl-irt-dyncode-0.1" 97 #define NACL_IRT_DYNCODE_v0_1 "nacl-irt-dyncode-0.1"
97 struct nacl_irt_dyncode { 98 struct nacl_irt_dyncode {
98 int (*dyncode_create)(void *dest, const void *src, size_t size); 99 int (*dyncode_create)(void *dest, const void *src, size_t size);
99 int (*dyncode_modify)(void *dest, const void *src, size_t size); 100 int (*dyncode_modify)(void *dest, const void *src, size_t size);
100 int (*dyncode_delete)(void *dest, size_t size); 101 int (*dyncode_delete)(void *dest, size_t size);
101 }; 102 };
102 103
103 #define NACL_IRT_THREAD_v0_1 "nacl-irt-thread-0.1" 104 #define NACL_IRT_THREAD_v0_1 "nacl-irt-thread-0.1"
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after
186 #define NACL_IRT_DEV_EXCEPTION_HANDLING_v0_1 \ 187 #define NACL_IRT_DEV_EXCEPTION_HANDLING_v0_1 \
187 "nacl-irt-dev-exception-handling-0.1" 188 "nacl-irt-dev-exception-handling-0.1"
188 typedef void (*NaClExceptionHandler)(struct NaClExceptionContext *context); 189 typedef void (*NaClExceptionHandler)(struct NaClExceptionContext *context);
189 struct nacl_irt_dev_exception_handling { 190 struct nacl_irt_dev_exception_handling {
190 int (*exception_handler)(NaClExceptionHandler handler, 191 int (*exception_handler)(NaClExceptionHandler handler,
191 NaClExceptionHandler *old_handler); 192 NaClExceptionHandler *old_handler);
192 int (*exception_stack)(void *stack, size_t size); 193 int (*exception_stack)(void *stack, size_t size);
193 int (*exception_clear_flag)(void); 194 int (*exception_clear_flag)(void);
194 }; 195 };
195 196
197 /*
198 * NOTE: This is a 'dev' interface which is NOT stable.
199 * In the future, requests for this interface will fail.
200 */
201 #define NACL_IRT_DEV_MPROTECT_v0_1 "nacl-irt-dev-mprotect-0.1"
202 struct nacl_irt_dev_mprotect {
203 int (*mprotect)(void *addr, size_t len, int prot);
204 };
205
196 #if defined(__cplusplus) 206 #if defined(__cplusplus)
197 } 207 }
198 #endif 208 #endif
199 209
200 #endif /* NATIVE_CLIENT_SRC_UNTRUSTED_IRT_IRT_H */ 210 #endif /* NATIVE_CLIENT_SRC_UNTRUSTED_IRT_IRT_H */
OLDNEW
« no previous file with comments | « no previous file | src/untrusted/irt/irt.gyp » ('j') | src/untrusted/irt/irt_dev_mprotect.c » ('J')

Powered by Google App Engine
This is Rietveld 408576698