Changeset abf6c01 in mainline
- Timestamp:
- 2018-11-09T22:03:24Z (6 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 436a0a5
- Parents:
- ba9a150
- git-author:
- Jiří Zárevúcky <zarevucky.jiri@…> (2018-11-08 17:00:46)
- git-committer:
- Jiří Zárevúcky <zarevucky.jiri@…> (2018-11-09 22:03:24)
- Location:
- kernel
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/generic/src/ipc/ipc.c
rba9a150 rabf6c01 213 213 errno_t ipc_call_sync(phone_t *phone, call_t *request) 214 214 { 215 answerbox_t *mybox = slab_alloc(answerbox_cache, 0); 215 answerbox_t *mybox = slab_alloc(answerbox_cache, FRAME_ATOMIC); 216 if (!mybox) 217 return ENOMEM; 218 216 219 ipc_answerbox_init(mybox, TASK); 217 220 -
kernel/generic/src/main/kinit.c
rba9a150 rabf6c01 120 120 thread = thread_create(kmp, NULL, TASK, 121 121 THREAD_FLAG_UNCOUNTED, "kmp"); 122 if (thread != NULL) { 123 thread_wire(thread, &cpus[0]); 124 thread_ready(thread); 125 } else 122 if (!thread) 126 123 panic("Unable to create kmp thread."); 127 124 125 thread_wire(thread, &cpus[0]); 126 thread_ready(thread); 128 127 thread_join(thread); 129 128 thread_detach(thread); -
kernel/generic/src/mm/as.c
rba9a150 rabf6c01 151 151 as_t *as_create(unsigned int flags) 152 152 { 153 as_t *as = (as_t *) slab_alloc(as_cache, 0); 153 as_t *as = (as_t *) slab_alloc(as_cache, FRAME_ATOMIC); 154 if (!as) 155 return NULL; 156 154 157 (void) as_create_arch(as, 0); 155 158 -
kernel/generic/src/mm/slab.c
rba9a150 rabf6c01 667 667 size_t (*destructor)(void *obj), unsigned int flags) 668 668 { 669 slab_cache_t *cache = slab_alloc(&slab_cache_cache, 0); 669 slab_cache_t *cache = slab_alloc(&slab_cache_cache, FRAME_ATOMIC); 670 if (!cache) 671 panic("Not enough memory to allocate slab cache %s.", name); 672 670 673 _slab_cache_create(cache, name, size, align, constructor, destructor, 671 674 flags); … … 730 733 NO_TRACE static void _slab_free(slab_cache_t *cache, void *obj, slab_t *slab) 731 734 { 735 if (!obj) 736 return; 737 732 738 ipl_t ipl = interrupts_disable(); 733 739 -
kernel/generic/src/proc/task.c
rba9a150 rabf6c01 199 199 task_t *task_create(as_t *as, const char *name) 200 200 { 201 task_t *task = (task_t *) slab_alloc(task_cache, 0);202 if ( task == NULL) {201 task_t *task = (task_t *) slab_alloc(task_cache, FRAME_ATOMIC); 202 if (!task) 203 203 return NULL; 204 }205 204 206 205 task_create_arch(task); -
kernel/generic/src/proc/thread.c
rba9a150 rabf6c01 165 165 166 166 #ifdef CONFIG_FPU 167 thread->saved_fpu_context = slab_alloc(fpu_context_cache, kmflags); 167 thread->saved_fpu_context = slab_alloc(fpu_context_cache, 168 FRAME_ATOMIC | kmflags); 168 169 if (!thread->saved_fpu_context) 169 170 return ENOMEM; … … 338 339 thread_flags_t flags, const char *name) 339 340 { 340 thread_t *thread = (thread_t *) slab_alloc(thread_cache, 0);341 thread_t *thread = (thread_t *) slab_alloc(thread_cache, FRAME_ATOMIC); 341 342 if (!thread) 342 343 return NULL; … … 652 653 653 654 return waitq_sleep_timeout(&thread->join_wq, usec, flags, NULL); 655 656 // FIXME: join should deallocate the thread. 657 // Current code calls detach after join, that's contrary to how 658 // join is used in other threading APIs. 654 659 } 655 660 -
kernel/generic/src/sysinfo/sysinfo.c
rba9a150 rabf6c01 204 204 205 205 *psubtree = 206 (sysinfo_item_t *) slab_alloc(sysinfo_item_cache, 0);206 (sysinfo_item_t *) slab_alloc(sysinfo_item_cache, FRAME_ATOMIC); 207 207 if (!*psubtree) 208 208 return NULL; … … 280 280 281 281 sysinfo_item_t *item = 282 (sysinfo_item_t *) slab_alloc(sysinfo_item_cache, 0);282 (sysinfo_item_t *) slab_alloc(sysinfo_item_cache, FRAME_ATOMIC); 283 283 if (!item) 284 284 return NULL; -
kernel/test/mm/slab1.c
rba9a150 rabf6c01 50 50 51 51 for (i = 0; i < count; i++) { 52 data[i] = slab_alloc(cache, 0); 53 memsetb(data[i], size, 0); 52 data[i] = slab_alloc(cache, FRAME_ATOMIC); 53 if (data[i]) 54 memsetb(data[i], size, 0); 54 55 } 55 56 … … 66 67 67 68 for (i = 0; i < count; i++) { 68 data[i] = slab_alloc(cache, 0); 69 memsetb(data[i], size, 0); 69 data[i] = slab_alloc(cache, FRAME_ATOMIC); 70 if (data[i]) 71 memsetb(data[i], size, 0); 70 72 } 71 73 … … 82 84 83 85 for (i = count / 2; i < count; i++) { 84 data[i] = slab_alloc(cache, 0); 85 memsetb(data[i], size, 0); 86 data[i] = slab_alloc(cache, FRAME_ATOMIC); 87 if (data[i]) 88 memsetb(data[i], size, 0); 86 89 } 87 90 … … 131 134 for (j = 0; j < 10; j++) { 132 135 for (i = 0; i < THR_MEM_COUNT; i++) 133 thr_data[offs][i] = slab_alloc(thr_cache, 0);136 thr_data[offs][i] = slab_alloc(thr_cache, FRAME_ATOMIC); 134 137 for (i = 0; i < THR_MEM_COUNT / 2; i++) 135 138 slab_free(thr_cache, thr_data[offs][i]); 136 139 for (i = 0; i < THR_MEM_COUNT / 2; i++) 137 thr_data[offs][i] = slab_alloc(thr_cache, 0);140 thr_data[offs][i] = slab_alloc(thr_cache, FRAME_ATOMIC); 138 141 for (i = 0; i < THR_MEM_COUNT; i++) 139 142 slab_free(thr_cache, thr_data[offs][i]);
Note:
See TracChangeset
for help on using the changeset viewer.