Changeset 22

Show
Ignore:
Timestamp:
11/13/05 22:32:16 (6 years ago)
Author:
dkaplan1
Message:

Lots of modifications to make the rtc driver work, see bugzilla for more
information

copy_to_user still untested

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • arch/i386/kernel/callgate.c

    r21 r22  
    363363        return -1; 
    364364    }*/ 
    365     tsk->available=0; 
    366365    //Set memory map 
    367366    if (mm) { 
     
    371370        tsk->active_mm=mm; 
    372371    } 
    373  
     372    tsk->caller=current; 
    374373    //Set capabilities basedo on who called us 
    375374    tsk->cap_effective=current->cap_effective; 
     
    413412        tsk->state=TASK_RUNNING; 
    414413    }*/ 
     414    /*if (ptrbitmap & NO_WAIT) { 
     415        //increase priority 
     416        set_user_nice(tsk, -20); 
     417    } else { 
     418        set_user_nice(tsk, 0); 
     419    }*/ 
    415420    wake_up_process(tsk); 
    416421    if (!(ptrbitmap & NO_WAIT)) { 
    417422        tsk->bytes_to_pop=0; 
    418         interruptible_sleep_on(&tsk->wait_driverfinish); 
     423        sleep_on(&tsk->wait_driverfinish); 
    419424        //Free any memory we allocated 
    420425        for (i=0; i<argc; i++) { 
  • arch/i386/kernel/irq.c

    r21 r22  
    234234    else { 
    235235        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); 
    237237        retval|=IRQ_HANDLED; 
    238238    } 
  • arch/i386/lib/usercopy.c

    r1 r22  
    595595copy_to_user(void __user *to, const void *from, unsigned long n) 
    596596{ 
     597    if (current->ring==1) { 
     598        printk("need to copy %d bytes from %x to %x\n", n, from, to); 
     599        return 0; 
     600    } 
    597601        might_sleep(); 
    598602        if (access_ok(VERIFY_WRITE, to, n)) 
  • arch/i386/mm/fault.c

    r6 r22  
    520520                if (!pte_present(*pte_k)) 
    521521    { 
    522         printk("Could not find pte_k"); 
    523522        goto no_context; 
    524523    } 
  • include/linux/module.h

    r21 r22  
    323323  struct task_struct *worker_threads[NR_DRIVERTHREADS]; 
    324324 
     325  //Lock for worker threads 
     326  spinlock_t threads_lock; 
     327 
    325328  /*ring we got loaded in*/ 
    326329  unsigned int ring; 
  • include/linux/sched.h

    r21 r22  
    526526    void *origcurrentaddr; 
    527527    int bytes_to_pop; 
     528    struct task_struct *caller; 
    528529}; 
    529530 
     
    744745extern int FASTCALL(wake_up_process(struct task_struct * tsk)); 
    745746extern void FASTCALL(wake_up_forked_process(struct task_struct * tsk, unsigned long clone_flags)); 
     747extern int wake_up_sync(task_t *p); 
    746748#ifdef CONFIG_SMP 
    747749 extern void kick_process(struct task_struct *tsk); 
  • kernel/exit.c

    r21 r22  
    837837    //Make it look like we finished, but stick around 
    838838    struct task_struct *tsk=current; 
     839    int irq; 
    839840    tsk->exit_code=exit_code; 
    840841    tsk->state=TASK_UNINTERRUPTIBLE; 
    841     if (tsk->currentmapped) { 
     842    /*if (tsk->currentmapped) { 
    842843        ClearPageReserved(pfn_to_page(__pa(tsk) >> PAGE_SHIFT)); 
    843844        ClearPageReserved(pfn_to_page((__pa(tsk) >> PAGE_SHIFT) + 1)); 
    844845        vunmap(tsk->origcurrentaddr); 
    845846        tsk->currentmapped=0; 
    846     } 
     847    }*/ 
     848    irq=tsk->bytes_to_pop; 
    847849    task_pt_regs(tsk)->esp+=tsk->bytes_to_pop; 
    848850    tsk->bytes_to_pop=0; 
  • kernel/fork.c

    r21 r22  
    946946        init_waitqueue_head(&p->wait_chldexit); 
    947947  init_waitqueue_head(&p->wait_driverfinish); 
     948  p->caller=p; 
    948949        p->vfork_done = NULL; 
    949950        spin_lock_init(&p->alloc_lock); 
  • kernel/module.c

    r21 r22  
    18731873  //FIXME: Figure out what ring to load module in (how?) 
    18741874  mod->ring=1; 
     1875  spin_lock_init(&mod->threads_lock); 
    18751876  for (i=0; i<NR_DRIVERTHREADS; i++) { 
    18761877      pid=create_driver_thread(0, mod->ring); 
     
    19431944        if (within(addr, mod->module_init, mod->init_size) || 
    19441945                within(addr, mod->module_core, mod->core_size)) { 
     1946            spin_lock_irq(&mod->threads_lock); 
    19451947            //Now find an availalbe one 
    19461948            while (i < (NR_DRIVERTHREADS-1+use_reserved)) { 
    19471949                if (mod->worker_threads[i]->available) { 
     1950                    mod->worker_threads[i]->available=0; 
    19481951                    tsk=mod->worker_threads[i];  
     1952                    spin_unlock_irq(&mod->threads_lock); 
    19491953                    goto out; 
    19501954                } 
  • kernel/sched.c

    r21 r22  
    21812181} 
    21822182 
     2183int wake_up_sync(task_t *p) { 
     2184    return try_to_wake_up(p, TASK_UNINTERRUPTIBLE | TASK_INTERRUPTIBLE, 1); 
     2185} 
     2186 
    21832187/* 
    21842188 * schedule() is the main scheduler function. 
     
    23602364{ 
    23612365        task_t *p = curr->task; 
     2366  if (!p) BUG(); 
    23622367        return try_to_wake_up(p, mode, sync); 
    23632368} 
     
    40624067 
    40634068int 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  
    457457      if ((unsigned long) fn > PAGE_OFFSET) 
    458458                          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      } 
    461463                        spin_lock_irq(&base->lock); 
    462464                        goto repeat; 
  • .version

    r21 r22  
    1 23
     126