- Timestamp:
- 2009-12-02T23:33:48Z (16 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 4924675
- Parents:
- 089d746 (diff), 8d04f709 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the(diff)
links above to see all the changes relative to each parent. - Location:
- kernel
- Files:
-
- 22 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/arch/amd64/src/amd64.c
r089d746 r84b14e2 67 67 #include <ddi/irq.h> 68 68 #include <sysinfo/sysinfo.h> 69 #include <memstr.h> 69 70 70 71 /** Disable I/O on non-privileged levels -
kernel/arch/arm32/include/atomic.h
r089d746 r84b14e2 37 37 #define KERN_arm32_ATOMIC_H_ 38 38 39 #include <arch/asm.h> 40 39 41 /** Atomic addition. 40 42 * … … 47 49 static inline long atomic_add(atomic_t *val, int i) 48 50 { 49 int ret; 50 volatile long *mem = &(val->count); 51 52 asm volatile ( 53 "1:\n" 54 "ldr r2, [%[mem]]\n" 55 "add r3, r2, %[i]\n" 56 "str r3, %[ret]\n" 57 "swp r3, r3, [%[mem]]\n" 58 "cmp r3, r2\n" 59 "bne 1b\n" 60 : [ret] "=m" (ret) 61 : [mem] "r" (mem), [i] "r" (i) 62 : "r3", "r2" 63 ); 51 long ret; 52 53 /* 54 * This implementation is for UP pre-ARMv6 systems where we do not have 55 * the LDREX and STREX instructions. 56 */ 57 ipl_t ipl = interrupts_disable(); 58 val->count += i; 59 ret = val->count; 60 interrupts_restore(ipl); 64 61 65 62 return ret; -
kernel/arch/arm32/src/mm/as.c
r089d746 r84b14e2 36 36 #include <arch/mm/as.h> 37 37 #include <genarch/mm/as_pt.h> 38 #include <genarch/mm/page_pt.h> 38 39 #include <genarch/mm/asid_fifo.h> 39 40 #include <mm/as.h> -
kernel/arch/ia32/src/ia32.c
r089d746 r84b14e2 68 68 #include <sysinfo/sysinfo.h> 69 69 #include <arch/boot/boot.h> 70 #include <memstr.h> 70 71 71 72 #ifdef CONFIG_SMP -
kernel/arch/ia64/src/cpu/cpu.c
r089d746 r84b14e2 37 37 #include <arch/register.h> 38 38 #include <print.h> 39 #include <memstr.h> 39 40 40 41 void cpu_arch_init(void) -
kernel/arch/ppc32/src/mm/as.c
r089d746 r84b14e2 35 35 #include <arch/mm/as.h> 36 36 #include <genarch/mm/as_pt.h> 37 #include <genarch/mm/page_pt.h> 37 38 #include <genarch/mm/asid_fifo.h> 38 39 #include <arch.h> -
kernel/arch/ppc32/src/mm/tlb.c
r089d746 r84b14e2 38 38 #include <interrupt.h> 39 39 #include <mm/as.h> 40 #include <mm/page.h> 40 41 #include <arch.h> 41 42 #include <print.h> -
kernel/arch/ppc32/src/ppc32.c
r089d746 r84b14e2 44 44 #include <genarch/ofw/pci.h> 45 45 #include <userspace.h> 46 #include <mm/page.h> 46 47 #include <proc/uarg.h> 47 48 #include <console/console.h> -
kernel/arch/sparc64/src/mm/tlb.c
r089d746 r84b14e2 37 37 #include <mm/as.h> 38 38 #include <mm/asid.h> 39 #include <genarch/mm/page_ht.h> 39 40 #include <arch/mm/frame.h> 40 41 #include <arch/mm/page.h> -
kernel/genarch/src/drivers/via-cuda/cuda.c
r089d746 r84b14e2 41 41 #include <ddi/device.h> 42 42 #include <synch/spinlock.h> 43 #include <memstr.h> 43 44 44 45 static irq_ownership_t cuda_claim(irq_t *irq); -
kernel/genarch/src/fb/fb.c
r089d746 r84b14e2 41 41 #include <console/console.h> 42 42 #include <sysinfo/sysinfo.h> 43 #include <mm/page.h> 43 44 #include <mm/slab.h> 44 45 #include <align.h> -
kernel/generic/include/arch.h
r089d746 r84b14e2 39 39 #include <proc/thread.h> 40 40 #include <proc/task.h> 41 #include <mm/as.h> 41 42 42 43 #define DEFAULT_CONTEXT 0 -
kernel/generic/include/proc/task.h
r089d746 r84b14e2 55 55 #include <udebug/udebug.h> 56 56 #include <ipc/kbox.h> 57 #include <mm/as.h> 57 58 58 59 #define TASK_NAME_BUFLEN 20 -
kernel/generic/include/proc/thread.h
r089d746 r84b14e2 225 225 226 226 extern void thread_init(void); 227 extern thread_t *thread_create(void (* func)(void *), void *arg, task_t *task,228 int flags, char *name, bool uncounted);229 extern void thread_attach(thread_t * t, task_t *task);230 extern void thread_ready(thread_t * t);227 extern thread_t *thread_create(void (*)(void *), void *, task_t *, int, char *, 228 bool); 229 extern void thread_attach(thread_t *, task_t *); 230 extern void thread_ready(thread_t *); 231 231 extern void thread_exit(void) __attribute__((noreturn)); 232 232 233 233 #ifndef thread_create_arch 234 extern void thread_create_arch(thread_t * t);234 extern void thread_create_arch(thread_t *); 235 235 #endif 236 236 #ifndef thr_constructor_arch 237 extern void thr_constructor_arch(thread_t * t);237 extern void thr_constructor_arch(thread_t *); 238 238 #endif 239 239 #ifndef thr_destructor_arch 240 extern void thr_destructor_arch(thread_t * t);241 #endif 242 243 extern void thread_sleep(uint32_t sec);244 extern void thread_usleep(uint32_t usec);240 extern void thr_destructor_arch(thread_t *); 241 #endif 242 243 extern void thread_sleep(uint32_t); 244 extern void thread_usleep(uint32_t); 245 245 246 246 #define thread_join(t) \ 247 247 thread_join_timeout((t), SYNCH_NO_TIMEOUT, SYNCH_FLAGS_NONE) 248 extern int thread_join_timeout(thread_t *t, uint32_t usec, int flags); 249 extern void thread_detach(thread_t *t); 250 251 extern void thread_register_call_me(void (* call_me)(void *), 252 void *call_me_with); 248 extern int thread_join_timeout(thread_t *, uint32_t, int); 249 extern void thread_detach(thread_t *); 250 251 extern void thread_register_call_me(void (*)(void *), void *); 253 252 extern void thread_print_list(void); 254 extern void thread_destroy(thread_t * t);253 extern void thread_destroy(thread_t *); 255 254 extern void thread_update_accounting(void); 256 extern bool thread_exists(thread_t * t);255 extern bool thread_exists(thread_t *); 257 256 258 257 /** Fpu context slab cache. */ … … 260 259 261 260 /* Thread syscall prototypes. */ 262 extern unative_t sys_thread_create(uspace_arg_t *uspace_uarg, 263 char *uspace_name, size_t name_len, thread_id_t *uspace_thread_id); 264 extern unative_t sys_thread_exit(int uspace_status); 265 extern unative_t sys_thread_get_id(thread_id_t *uspace_thread_id); 261 extern unative_t sys_thread_create(uspace_arg_t *, char *, size_t, 262 thread_id_t *); 263 extern unative_t sys_thread_exit(int); 264 extern unative_t sys_thread_get_id(thread_id_t *); 265 extern unative_t sys_thread_usleep(uint32_t); 266 266 267 267 #endif -
kernel/generic/include/synch/futex.h
r089d746 r84b14e2 38 38 #include <arch/types.h> 39 39 #include <synch/waitq.h> 40 #include <genarch/mm/page_ht.h>41 #include <genarch/mm/page_pt.h>42 40 43 41 /** Kernel-side futex structure. */ … … 54 52 55 53 extern void futex_init(void); 56 extern unative_t sys_futex_sleep_timeout(uintptr_t uaddr, uint32_t usec, 57 int flags); 58 extern unative_t sys_futex_wakeup(uintptr_t uaddr); 54 extern unative_t sys_futex_sleep(uintptr_t); 55 extern unative_t sys_futex_wakeup(uintptr_t); 59 56 60 57 extern void futex_cleanup(void); -
kernel/generic/include/syscall/syscall.h
r089d746 r84b14e2 43 43 SYS_THREAD_EXIT, 44 44 SYS_THREAD_GET_ID, 45 SYS_THREAD_USLEEP, 45 46 46 47 SYS_TASK_GET_ID, -
kernel/generic/src/mm/backend_phys.c
r089d746 r84b14e2 40 40 #include <arch/types.h> 41 41 #include <mm/as.h> 42 #include <mm/page.h> 42 43 #include <mm/frame.h> 43 44 #include <mm/slab.h> -
kernel/generic/src/proc/task.c
r089d746 r84b14e2 54 54 #include <func.h> 55 55 #include <string.h> 56 #include <memstr.h> 56 57 #include <syscall/copy.h> 57 58 #include <macros.h> -
kernel/generic/src/proc/thread.c
r089d746 r84b14e2 812 812 } 813 813 814 /** Syscall wrapper for sleeping. */ 815 unative_t sys_thread_usleep(uint32_t usec) 816 { 817 thread_usleep(usec); 818 return 0; 819 } 820 814 821 /** @} 815 822 */ -
kernel/generic/src/synch/futex.c
r089d746 r84b14e2 90 90 /** Initialize kernel futex structure. 91 91 * 92 * @param futex 92 * @param futex Kernel futex structure. 93 93 */ 94 94 void futex_initialize(futex_t *futex) … … 102 102 /** Sleep in futex wait queue. 103 103 * 104 * @param uaddr Userspace address of the futex counter. 105 * @param usec If non-zero, number of microseconds this thread is willing to 106 * sleep. 107 * @param flags Select mode of operation. 108 * 109 * @return One of ESYNCH_TIMEOUT, ESYNCH_OK_ATOMIC and ESYNCH_OK_BLOCKED. See 110 * synch.h. If there is no physical mapping for uaddr ENOENT is returned. 111 */ 112 unative_t sys_futex_sleep_timeout(uintptr_t uaddr, uint32_t usec, int flags) 104 * @param uaddr Userspace address of the futex counter. 105 * 106 * @return If there is no physical mapping for uaddr ENOENT is 107 * returned. Otherwise returns a wait result as defined in 108 * synch.h. 109 */ 110 unative_t sys_futex_sleep(uintptr_t uaddr) 113 111 { 114 112 futex_t *futex; … … 140 138 udebug_stoppable_begin(); 141 139 #endif 142 rc = waitq_sleep_timeout(&futex->wq, usec, flags | 143 SYNCH_FLAGS_INTERRUPTIBLE); 144 140 rc = waitq_sleep_timeout(&futex->wq, 0, SYNCH_FLAGS_INTERRUPTIBLE); 145 141 #ifdef CONFIG_UDEBUG 146 142 udebug_stoppable_end(); … … 151 147 /** Wakeup one thread waiting in futex wait queue. 152 148 * 153 * @param uaddr 154 * 155 * @return 149 * @param uaddr Userspace address of the futex counter. 150 * 151 * @return ENOENT if there is no physical mapping for uaddr. 156 152 */ 157 153 unative_t sys_futex_wakeup(uintptr_t uaddr) … … 190 186 * If the structure does not exist already, a new one is created. 191 187 * 192 * @param paddr 193 * 194 * @return 188 * @param paddr Physical address of the userspace futex counter. 189 * 190 * @return Address of the kernel futex structure. 195 191 */ 196 192 futex_t *futex_find(uintptr_t paddr) … … 284 280 /** Compute hash index into futex hash table. 285 281 * 286 * @param key Address where the key (i.e. physical address of futex counter) is287 * 288 * 289 * @return 282 * @param key Address where the key (i.e. physical address of futex 283 * counter) is stored. 284 * 285 * @return Index into futex hash table. 290 286 */ 291 287 size_t futex_ht_hash(unative_t *key) … … 296 292 /** Compare futex hash table item with a key. 297 293 * 298 * @param key Address where the key (i.e. physical address of futex counter) is299 * 300 * 301 * @return 294 * @param key Address where the key (i.e. physical address of futex 295 * counter) is stored. 296 * 297 * @return True if the item matches the key. False otherwise. 302 298 */ 303 299 bool futex_ht_compare(unative_t *key, size_t keys, link_t *item) … … 313 309 /** Callback for removal items from futex hash table. 314 310 * 315 * @param item 311 * @param item Item removed from the hash table. 316 312 */ 317 313 void futex_ht_remove_callback(link_t *item) -
kernel/generic/src/syscall/syscall.c
r089d746 r84b14e2 111 111 (syshandler_t) sys_thread_exit, 112 112 (syshandler_t) sys_thread_get_id, 113 (syshandler_t) sys_thread_usleep, 113 114 114 115 (syshandler_t) sys_task_get_id, … … 117 118 118 119 /* Synchronization related syscalls. */ 119 (syshandler_t) sys_futex_sleep _timeout,120 (syshandler_t) sys_futex_sleep, 120 121 (syshandler_t) sys_futex_wakeup, 121 122 (syshandler_t) sys_smc_coherence, -
kernel/generic/src/udebug/udebug_ops.c
r089d746 r84b14e2 50 50 #include <udebug/udebug.h> 51 51 #include <udebug/udebug_ops.h> 52 #include <memstr.h> 52 53 53 54 /**
Note:
See TracChangeset
for help on using the changeset viewer.