Unified · Split
| @@ -74,19 +74,7 @@ void __bound_init(void); · 73 unmodified lines | |||
| 74 | void __bound_new_region(void *p, unsigned long size); | 74 | void __bound_new_region(void *p, unsigned long size); |
| 75 | int __bound_delete_region(void *p); | 75 | int __bound_delete_region(void *p); |
| 76 | 76 | ||
| 77 | /* currently, tcc cannot compile that because we use unsupported GNU C | 77 | #define FASTCALL __attribute__((regparm(3))) |
| 78 | extensions */ | ||
| 79 | #if !defined(__TINYC__) | ||
| 80 | void *__bound_ptr_add(void *p, int offset) __attribute__((regparm(2))); | ||
| 81 | void *__bound_ptr_indir1(void *p, int offset) __attribute__((regparm(2))); | ||
| 82 | void *__bound_ptr_indir2(void *p, int offset) __attribute__((regparm(2))); | ||
| 83 | void *__bound_ptr_indir4(void *p, int offset) __attribute__((regparm(2))); | ||
| 84 | void *__bound_ptr_indir8(void *p, int offset) __attribute__((regparm(2))); | ||
| 85 | void *__bound_ptr_indir12(void *p, int offset) __attribute__((regparm(2))); | ||
| 86 | void *__bound_ptr_indir16(void *p, int offset) __attribute__((regparm(2))); | ||
| 87 | void __bound_local_new(void *p) __attribute__((regparm(1))); | ||
| 88 | void __bound_local_delete(void *p) __attribute__((regparm(1))); | ||
| 89 | #endif | ||
| 90 | 78 | ||
| 91 | void *__bound_malloc(size_t size, const void *caller); | 79 | void *__bound_malloc(size_t size, const void *caller); |
| 92 | void *__bound_memalign(size_t size, size_t align, const void *caller); | 80 | void *__bound_memalign(size_t size, size_t align, const void *caller); |
| @@ -168,7 +156,7 @@ static void bound_alloc_error(void) · 75 unmodified lines | |||
| 168 | 156 | ||
| 169 | /* return '(p + offset)' for pointer arithmetic (a pointer can reach | 157 | /* return '(p + offset)' for pointer arithmetic (a pointer can reach |
| 170 | the end of a region in this case */ | 158 | the end of a region in this case */ |
| 171 | void *__bound_ptr_add(void *p, int offset) | 159 | void * FASTCALL __bound_ptr_add(void *p, int offset) |
| 172 | { | 160 | { |
| 173 | unsigned long addr = (unsigned long)p; | 161 | unsigned long addr = (unsigned long)p; |
| 174 | BoundEntry *e; | 162 | BoundEntry *e; |
| @@ -194,7 +182,7 @@ void *__bound_ptr_add(void *p, int offset) · 19 unmodified lines | |||
| 194 | /* return '(p + offset)' for pointer indirection (the resulting must | 182 | /* return '(p + offset)' for pointer indirection (the resulting must |
| 195 | be strictly inside the region */ | 183 | be strictly inside the region */ |
| 196 | #define BOUND_PTR_INDIR(dsize) \ | 184 | #define BOUND_PTR_INDIR(dsize) \ |
| 197 | void *__bound_ptr_indir ## dsize (void *p, int offset) \ | 185 | void * FASTCALL __bound_ptr_indir ## dsize (void *p, int offset) \ |
| 198 | { \ | 186 | { \ |
| 199 | unsigned long addr = (unsigned long)p; \ | 187 | unsigned long addr = (unsigned long)p; \ |
| 200 | BoundEntry *e; \ | 188 | BoundEntry *e; \ |
| @@ -227,7 +215,7 @@ void *__bound_ptr_indir ## dsize (void *p, int offset) \ · 26 unmodified lines | |||
| 227 | #endif | 215 | #endif |
| 228 | 216 | ||
| 229 | /* called when entering a function to add all the local regions */ | 217 | /* called when entering a function to add all the local regions */ |
| 230 | void __bound_local_new(void *p1) | 218 | void FASTCALL __bound_local_new(void *p1) |
| 231 | { | 219 | { |
| 232 | unsigned long addr, size, fp, *p = p1; | 220 | unsigned long addr, size, fp, *p = p1; |
| 233 | GET_CALLER_FP(fp); | 221 | GET_CALLER_FP(fp); |
| @@ -243,7 +231,7 @@ void __bound_local_new(void *p1) · 9 unmodified lines | |||
| 243 | } | 231 | } |
| 244 | 232 | ||
| 245 | /* called when leaving a function to delete all the local regions */ | 233 | /* called when leaving a function to delete all the local regions */ |
| 246 | void __bound_local_delete(void *p1) | 234 | void FASTCALL __bound_local_delete(void *p1) |
| 247 | { | 235 | { |
| 248 | unsigned long addr, fp, *p = p1; | 236 | unsigned long addr, fp, *p = p1; |
| 249 | GET_CALLER_FP(fp); | 237 | GET_CALLER_FP(fp); |