Changeset 22
- Timestamp:
- 11/13/05 22:32:16 (6 years ago)
- Files:
-
- arch/i386/kernel/callgate.c (modified) (3 diffs)
- arch/i386/kernel/irq.c (modified) (1 diff)
- arch/i386/lib/usercopy.c (modified) (1 diff)
- arch/i386/mm/fault.c (modified) (1 diff)
- include/linux/module.h (modified) (1 diff)
- include/linux/sched.h (modified) (2 diffs)
- kernel/exit.c (modified) (1 diff)
- kernel/fork.c (modified) (1 diff)
- kernel/module.c (modified) (2 diffs)
- kernel/sched.c (modified) (3 diffs)
- kernel/timer.c (modified) (1 diff)
- .version (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
arch/i386/kernel/callgate.c
r21 r22 363 363 return -1; 364 364 }*/ 365 tsk->available=0;366 365 //Set memory map 367 366 if (mm) { … … 371 370 tsk->active_mm=mm; 372 371 } 373 372 tsk->caller=current; 374 373 //Set capabilities basedo on who called us 375 374 tsk->cap_effective=current->cap_effective; … … 413 412 tsk->state=TASK_RUNNING; 414 413 }*/ 414 /*if (ptrbitmap & NO_WAIT) { 415 //increase priority 416 set_user_nice(tsk, -20); 417 } else { 418 set_user_nice(tsk, 0); 419 }*/ 415 420 wake_up_process(tsk); 416 421 if (!(ptrbitmap & NO_WAIT)) { 417 422 tsk->bytes_to_pop=0; 418 interruptible_sleep_on(&tsk->wait_driverfinish);423 sleep_on(&tsk->wait_driverfinish); 419 424 //Free any memory we allocated 420 425 for (i=0; i<argc; i++) { arch/i386/kernel/irq.c
r21 r22 234 234 else { 235 235 unsigned long args[3]={irq, (unsigned long) action->dev_id, (unsigned long) regs}; 236 calldriver((unsigned long) action->handler, args, 3, current->mm, NO_WAIT | 0);236 calldriver((unsigned long) action->handler, args, 3, NULL, NO_WAIT | 0); 237 237 retval|=IRQ_HANDLED; 238 238 } arch/i386/lib/usercopy.c
r1 r22 595 595 copy_to_user(void __user *to, const void *from, unsigned long n) 596 596 { 597 if (current->ring==1) { 598 printk("need to copy %d bytes from %x to %x\n", n, from, to); 599 return 0; 600 } 597 601 might_sleep(); 598 602 if (access_ok(VERIFY_WRITE, to, n)) arch/i386/mm/fault.c
r6 r22 520 520 if (!pte_present(*pte_k)) 521 521 { 522 printk("Could not find pte_k");523 522 goto no_context; 524 523 } include/linux/module.h
r21 r22 323 323 struct task_struct *worker_threads[NR_DRIVERTHREADS]; 324 324 325 //Lock for worker threads 326 spinlock_t threads_lock; 327 325 328 /*ring we got loaded in*/ 326 329 unsigned int ring; include/linux/sched.h
r21 r22 526 526 void *origcurrentaddr; 527 527 int bytes_to_pop; 528 struct task_struct *caller; 528 529 }; 529 530 … … 744 745 extern int FASTCALL(wake_up_process(struct task_struct * tsk)); 745 746 extern void FASTCALL(wake_up_forked_process(struct task_struct * tsk, unsigned long clone_flags)); 747 extern int wake_up_sync(task_t *p); 746 748 #ifdef CONFIG_SMP 747 749 extern void kick_process(struct task_struct *tsk); kernel/exit.c
r21 r22 837 837 //Make it look like we finished, but stick around 838 838 struct task_struct *tsk=current; 839 int irq; 839 840 tsk->exit_code=exit_code; 840 841 tsk->state=TASK_UNINTERRUPTIBLE; 841 if (tsk->currentmapped) {842 /*if (tsk->currentmapped) { 842 843 ClearPageReserved(pfn_to_page(__pa(tsk) >> PAGE_SHIFT)); 843 844 ClearPageReserved(pfn_to_page((__pa(tsk) >> PAGE_SHIFT) + 1)); 844 845 vunmap(tsk->origcurrentaddr); 845 846 tsk->currentmapped=0; 846 } 847 }*/ 848 irq=tsk->bytes_to_pop; 847 849 task_pt_regs(tsk)->esp+=tsk->bytes_to_pop; 848 850 tsk->bytes_to_pop=0; kernel/fork.c
r21 r22 946 946 init_waitqueue_head(&p->wait_chldexit); 947 947 init_waitqueue_head(&p->wait_driverfinish); 948 p->caller=p; 948 949 p->vfork_done = NULL; 949 950 spin_lock_init(&p->alloc_lock); kernel/module.c
r21 r22 1873 1873 //FIXME: Figure out what ring to load module in (how?) 1874 1874 mod->ring=1; 1875 spin_lock_init(&mod->threads_lock); 1875 1876 for (i=0; i<NR_DRIVERTHREADS; i++) { 1876 1877 pid=create_driver_thread(0, mod->ring); … … 1943 1944 if (within(addr, mod->module_init, mod->init_size) || 1944 1945 within(addr, mod->module_core, mod->core_size)) { 1946 spin_lock_irq(&mod->threads_lock); 1945 1947 //Now find an availalbe one 1946 1948 while (i < (NR_DRIVERTHREADS-1+use_reserved)) { 1947 1949 if (mod->worker_threads[i]->available) { 1950 mod->worker_threads[i]->available=0; 1948 1951 tsk=mod->worker_threads[i]; 1952 spin_unlock_irq(&mod->threads_lock); 1949 1953 goto out; 1950 1954 } kernel/sched.c
r21 r22 2181 2181 } 2182 2182 2183 int wake_up_sync(task_t *p) { 2184 return try_to_wake_up(p, TASK_UNINTERRUPTIBLE | TASK_INTERRUPTIBLE, 1); 2185 } 2186 2183 2187 /* 2184 2188 * schedule() is the main scheduler function. … … 2360 2364 { 2361 2365 task_t *p = curr->task; 2366 if (!p) BUG(); 2362 2367 return try_to_wake_up(p, mode, sync); 2363 2368 } … … 4062 4067 4063 4068 int mod_signal_pending(struct task_struct *p) { 4064 return signal_pending(p );4065 } 4069 return signal_pending(p->caller); 4070 } kernel/timer.c
r21 r22 457 457 if ((unsigned long) fn > PAGE_OFFSET) 458 458 fn(data); 459 else 460 calldriver((unsigned long)fn, &data, 1, current->mm, NO_WAIT); 459 else { 460 461 calldriver((unsigned long)fn, &data, 1, NULL, NO_WAIT); 462 } 461 463 spin_lock_irq(&base->lock); 462 464 goto repeat; .version
r21 r22 1 2 381 268
