Changeset 36e9cd1 in mainline for uspace/lib
- Timestamp:
- 2010-02-10T23:15:27Z (16 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 0701066
- Parents:
- 3149fc0
- Location:
- uspace/lib/libc
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/libc/arch/ia64/include/ddi.h
r3149fc0 r36e9cd1 39 39 #include <libarch/types.h> 40 40 41 #define IO_SPACE_BOUNDARY ( 64 * 1024)41 #define IO_SPACE_BOUNDARY ((void *) (64 * 1024)) 42 42 43 43 uint64_t get_ia64_iospace_address(void); -
uspace/lib/libc/arch/sparc64/include/ddi.h
r3149fc0 r36e9cd1 37 37 #include <libarch/types.h> 38 38 39 static inline memory_barrier(void)39 static inline void memory_barrier(void) 40 40 { 41 asm volatile ("membar #LoadLoad | #StoreStore\n" ::: "memory"); 41 asm volatile ( 42 "membar #LoadLoad | #StoreStore\n" 43 ::: "memory" 44 ); 42 45 } 43 46 -
uspace/lib/libc/arch/sparc64/include/fibril.h
r3149fc0 r36e9cd1 48 48 STACK_ALIGNMENT) - (STACK_BIAS + SP_DELTA); \ 49 49 (c)->fp = -STACK_BIAS; \ 50 (c)->tp = ptls; \50 (c)->tp = (uint64_t) ptls; \ 51 51 } while (0) 52 52 -
uspace/lib/libc/generic/clipboard.c
r3149fc0 r36e9cd1 148 148 aid_t req = async_send_1(clip_phone, CLIPBOARD_GET_DATA, tag, NULL); 149 149 rc = async_data_read_start(clip_phone, (void *) sbuf, size); 150 if ( rc == EOVERFLOW) {150 if ((int) rc == EOVERFLOW) { 151 151 /* 152 152 * The data in the clipboard has changed since -
uspace/lib/libc/generic/fibril.c
r3149fc0 r36e9cd1 41 41 #include <unistd.h> 42 42 #include <stdio.h> 43 #include <arch/barrier.h> 43 44 #include <libarch/faddr.h> 44 45 #include <futex.h> … … 133 134 int fibril_switch(fibril_switch_type_t stype) 134 135 { 135 fibril_t *srcf, *dstf;136 136 int retval = 0; 137 137 138 138 futex_down(&fibril_futex); 139 139 140 140 if (stype == FIBRIL_PREEMPT && list_empty(&ready_list)) 141 141 goto ret_0; 142 142 143 143 if (stype == FIBRIL_FROM_MANAGER) { 144 if ( list_empty(&ready_list) && list_empty(&serialized_list))144 if ((list_empty(&ready_list)) && (list_empty(&serialized_list))) 145 145 goto ret_0; 146 146 147 /* 147 148 * Do not preempt if there is not enough threads to run the 148 149 * ready fibrils which are not serialized. 149 150 */ 150 if ( list_empty(&serialized_list) &&151 threads_in_manager <= serialized_threads) {151 if ((list_empty(&serialized_list)) && 152 (threads_in_manager <= serialized_threads)) { 152 153 goto ret_0; 153 154 } 154 155 } 156 155 157 /* If we are going to manager and none exists, create it */ 156 if ( stype == FIBRIL_TO_MANAGER || stype == FIBRIL_FROM_DEAD) {158 if ((stype == FIBRIL_TO_MANAGER) || (stype == FIBRIL_FROM_DEAD)) { 157 159 while (list_empty(&manager_list)) { 158 160 futex_up(&fibril_futex); … … 162 164 } 163 165 164 srcf = __tcb_get()->fibril_data;166 fibril_t *srcf = __tcb_get()->fibril_data; 165 167 if (stype != FIBRIL_FROM_DEAD) { 168 166 169 /* Save current state */ 167 170 if (!context_save(&srcf->ctx)) { 168 171 if (serialization_count) 169 172 srcf->flags &= ~FIBRIL_SERIALIZED; 173 170 174 if (srcf->clean_after_me) { 171 175 /* … … 173 177 * restored context here. 174 178 */ 175 void *stack = srcf->clean_after_me->stack; 179 void *stack = srcf->clean_after_me->stack; 176 180 if (stack) { 177 181 /* … … 188 192 srcf->clean_after_me = NULL; 189 193 } 194 190 195 return 1; /* futex_up already done here */ 191 196 } 192 197 193 198 /* Save myself to the correct run list */ 194 199 if (stype == FIBRIL_PREEMPT) … … 197 202 list_append(&srcf->link, &manager_list); 198 203 threads_in_manager--; 199 } else { 204 } else { 200 205 /* 201 206 * If stype == FIBRIL_TO_MANAGER, don't put ourselves to … … 206 211 } 207 212 213 /* Avoid srcf being clobbered by context_save() */ 214 srcf = __tcb_get()->fibril_data; 215 208 216 /* Choose a new fibril to run */ 209 if (stype == FIBRIL_TO_MANAGER || stype == FIBRIL_FROM_DEAD) { 217 fibril_t *dstf; 218 if ((stype == FIBRIL_TO_MANAGER) || (stype == FIBRIL_FROM_DEAD)) { 210 219 dstf = list_get_instance(manager_list.next, fibril_t, link); 211 220 if (serialization_count && stype == FIBRIL_TO_MANAGER) { … … 214 223 } 215 224 threads_in_manager++; 216 225 217 226 if (stype == FIBRIL_FROM_DEAD) 218 227 dstf->clean_after_me = srcf; … … 228 237 } 229 238 list_remove(&dstf->link); 230 239 231 240 futex_up(&fibril_futex); 232 241 context_restore(&dstf->ctx); 233 242 /* not reached */ 234 243 235 244 ret_0: 236 245 futex_up(&fibril_futex); -
uspace/lib/libc/generic/ipc.c
r3149fc0 r36e9cd1 728 728 int *flags) 729 729 { 730 int res; 731 sysarg_t tmp_flags; 732 res = ipc_call_sync_3_2(phoneid, IPC_M_SHARE_IN, (ipcarg_t) dst, 730 sysarg_t tmp_flags = 0; 731 int res = ipc_call_sync_3_2(phoneid, IPC_M_SHARE_IN, (ipcarg_t) dst, 733 732 (ipcarg_t) size, arg, NULL, &tmp_flags); 733 734 734 if (flags) 735 735 *flags = tmp_flags; 736 736 737 return res; 737 738 } -
uspace/lib/libc/include/macros.h
r3149fc0 r36e9cd1 48 48 #define STRING_ARG(arg) #arg 49 49 50 #define LOWER32(arg) (( arg) & 0xffffffff)51 #define UPPER32(arg) ((( arg) >> 32) & 0xffffffff)50 #define LOWER32(arg) (((uint64_t) (arg)) & 0xffffffff) 51 #define UPPER32(arg) (((((uint64_t) arg)) >> 32) & 0xffffffff) 52 52 53 53 #define MERGE_LOUP32(lo, up) \
Note:
See TracChangeset
for help on using the changeset viewer.