Changeset 28

Show
Ignore:
Timestamp:
06/06/06 11:44:35 (6 years ago)
Author:
dkaplan1
Message:

Commented files

Files:

Legend:

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

    r27 r28  
    33 * 
    44 *  Copyright (C) 2005  David Kaplan 
     5 *  Please read thesis and Documentation/DAPI.txt for details 
    56 * 
     7 *  This file implements calldriver() and various helper routines 
     8 *  for dealing with driver threads 
    69 */ 
    710 
     
    110113unsigned long map_pages(void *virt_addr, unsigned long count, int ring, void **origmem); 
    111114 
     115 
     116//Data structions used 
     117//This structure tracks a usage of a mapping 
    112118struct driver_usage { 
    113         void *driver_id; 
    114         struct driver_usage *next; 
     119        void *driver_id; //Mod pointer of the module using this mapping 
     120        struct driver_usage *next; //Next usage 
    115121}; 
    116122 
     123//This structure tracks an actual mapping 
    117124struct ring_page_map { 
    118125        unsigned long pa; //Physical address of page (page aligned) 
    119        int num_pages; //Number of consecutive pages in this mapping 
    120        unsigned long vaddr; //Virtual address of page in driver space 
    121        void *origaddr; //Virtual address for vunmap 
    122   struct driver_usage *refs; //Head of linked list of drivers using this mapping      
    123        struct ring_page_map *next; //Next mapping 
     126  int num_pages; //Number of consecutive pages in this mapping 
     127  unsigned long vaddr; //Virtual address of page in driver space 
     128  void *origaddr; //Virtual address for vunmap 
     129  struct driver_usage *refs; //Head of linked list of drivers using this mapping       
     130  struct ring_page_map *next; //Next mapping 
    124131}; 
    125132 
     133///Head pointers 
    126134struct ring_page_map *ring1_head; 
    127135struct ring_page_map *ring2_head; 
    128136 
    129  
     137//New way to get current 
     138//Notice that the mapping is cahces, so it must only go through map_struct once 
    130139struct task_struct *mod_get_current(void) { 
    131140    struct task_struct *tsk=current; 
     
    135144    if (!tsk->ring) 
    136145        return current; 
    137     tsk->currentaddr=(struct task_struct*) map_struct(tsk, sizeof(*tsk), tsk->ring, 1, tsk->driver_id); 
     146    tsk->currentaddr=(struct task_struct*) map_struct((unsigned long) tsk, sizeof(*tsk), tsk->ring, 1, tsk->driver_id); 
    138147    tsk->currentmapped=1; 
    139148    return tsk->currentaddr; 
    140149} 
     150 
     151//Call this when a module is being unloaded, and its mappings are no longer needed 
     152//Simply goes through the list and removes this driver from any usage lists 
     153//If usage lists are now empty, free the mapping 
     154void put_module(void *id) { 
     155    struct ring_page_map *ptr, **lptr; 
     156    if ((unsigned long) id & (1 << 29)) //Clever test for ring 1 vs 2 
     157        lptr=&ring1_head;  
     158    else 
     159        lptr=&ring2_head; 
     160    ptr=*lptr; 
     161    while (ptr) { 
     162        struct driver_usage *driverptr, **lastptr; 
     163        lastptr=&ptr->refs; 
     164        driverptr=ptr->refs; 
     165        while (driverptr) { 
     166            if (driverptr->driver_id == id) { 
     167                *lastptr=driverptr->next; 
     168                kfree(driverptr); 
     169                break; 
     170            } 
     171            lastptr=&driverptr->next; 
     172            driverptr=driverptr->next; 
     173        } 
     174        if (!ptr->refs) { 
     175            //Last one, so remove mapping 
     176            vunmap(ptr->origaddr);             
     177            *lptr=ptr->next; 
     178            kfree(ptr); 
     179        } else 
     180            lptr=&ptr->next; 
     181         
     182        ptr=*lptr; 
     183         
     184    } 
     185} 
     186 
     187/* CALLGATE ENTRY ROUTINES 
     188 * 
     189 * These are all jump tables 
     190 * Notice the saving/restoring of segment registers, and lret at the end 
     191 */ 
    141192 
    142193__asm__("callgate_entry2:" 
     
    310361extern void driver_thread_helper(void); 
    311362extern void end_of_driver_thread_helper(void); 
     363//Wrapper routine for calling driver specific function, then returning exit code 
    312364__asm__ (".section .text\n" 
    313365        ".align 4\n" 
     
    328380__asm__("ring_nop : ret \n\t" 
    329381        "end_of_nop:ud2\n\t"); 
     382 
     383//Copies helpers into address space of rings and creates callgates 
    330384void create_driver_helpers(void) 
    331385{ 
     
    356410} 
    357411 
     412 
    358413//Cannot call from no context (ie interrupt handler) 
     414//See thesis for details 
     415//Parameters: 
     416//  addr -- Address of driver function to call 
     417//  argv -- Pointer to array of arguments to pass 
     418//  sizes -- Pointer to array of sizes of each argument 
     419//  argc -- Number of arguments 
     420//  mm -- mm_struct to use (usually current) 
     421//  ptrbitmap -- Bitmask of which arguments are kernel pointers 
     422//  flags -- Extra flags (such as NO_WAIT) 
     423//Returns the return value of the driver 
     424//This function WILL SLEEP unless the NO_WAIT flag is passed 
    359425int calldriver(unsigned long addr, void **argv, unsigned int *sizes, int argc, struct mm_struct *mm, unsigned long ptrbitmap, unsigned long flags) 
    360426{ 
     
    429495        if (ptrbitmap & (1 << (argc))) { 
    430496            //this is a ptr, so map it in 
    431             addrs[argc]=map_struct((unsigned long) argv[argc], sizes[argc], tsk->ring, 0, NULL); 
     497            addrs[argc]=map_struct((unsigned long) argv[argc], sizes[argc], tsk->ring, 1, tsk->driver_id); 
    432498//            addrs[argc]=0; 
    433499            *(unsigned long*)(regs->esp)=addrs[argc]; 
     
    447513        for (i=0; i<argc; i++) { 
    448514            if (addrs[i]) { 
     515 
    449516//                ClearPageReserved(pfn_to_page(__pa(argv[i]) >> PAGE_SHIFT)); 
    450517//                ClearPageReserved(pfn_to_page((__pa(argv[i]) >> PAGE_SHIFT) + 1)); 
     
    461528} 
    462529 
     530/* The name for this is a bit of a misnomer since it does not always create a mapping 
     531 * Parameters: 
     532 *   kernel_struct -- Pointer to kernel structure to map/get mapping for 
     533 *   size -- size of structure 
     534 *   ring -- ring the structure must be mapped into 
     535 *   update_reg -- boolean of whether to update reference lists 
     536 *   driver_id -- ID of driver to put in reference lists 
     537 * Returns the pointer to pass to driver thread so it can access the structure 
     538 */ 
    463539unsigned long map_struct(unsigned long kernel_struct, unsigned long size, int ring, int update_ref, void *driver_id) 
    464540{ 
     
    488564                                } 
    489565                        } 
     566      //If we found the page, just compute the offset and return 
    490567                        return (ptr->vaddr + (kernel_struct - PAGE_OF(kernel_struct))); 
    491568                } 
     
    493570        } 
    494571        //Not found 
     572  //Create a new mapping for either 1 page or 2 pages if the structure spans the page boundary 
    495573        ptr=(struct ring_page_map*) kmalloc(sizeof(struct ring_page_map), GFP_KERNEL); 
    496574        ptr->pa=__pa(PAGE_OF(kernel_struct)); 
     
    552630     
    553631    vma->vm_mm=&init_mm; 
     632 
     633    //The reason for this mess is that remap_page_range silently fails if the pages 
     634    //are not marked as reserved 
    554635    res1=PageReserved(pfn_to_page(__pa(virt_addr) >> PAGE_SHIFT)); 
    555636    res2=PageReserved(pfn_to_page(__pa(virt_addr) >> PAGE_SHIFT)+1); 
     
    572653asm("lcall_nop:lret"); 
    573654 
     655//Used for some benchmarking 
    574656void do_benchmark(unsigned long lo, unsigned long hi) { 
    575657    unsigned long long endval, startval; 
  • arch/i386/kernel/cpu/common.c

    r6 r28  
    582582        mxcsr_feature_mask_init(); 
    583583} 
    584  
     584/* NEW for RingCycle 
     585 * This function creates a callgate at the next availalbe entry in the GDT 
     586 * Parameters: 
     587 *  addr -- Address function starts at 
     588 *  dpl -- DPL to be used for gate (probably 2) 
     589 *  params -- Number of 4-byte parameters the function takes 
     590 */ 
    585591void create_callgate(unsigned long addr, unsigned int dpl, unsigned int params) 
    586592{ 
     
    594600        BUG(); 
    595601    memset(&cpu_gdt_table[cpu][(call_gates_used + GDT_CALLGATE_START)], 0, 8); 
     602    //See Intel/AMD manual for format specification 
    596603    cpu_gdt_table[cpu][(call_gates_used + GDT_CALLGATE_START)].a=__KERNEL_CS << 16 | (addr & 0xffff); 
    597604    cpu_gdt_table[cpu][(call_gates_used + GDT_CALLGATE_START)].b=(addr & 0xffff0000) | 1 << 15 | dpl << 13 | 3 << 10 | params; 
  • arch/i386/kernel/process.c

    r24 r28  
    351351extern void *ring1_nop; 
    352352extern void *ring2_nop; 
     353 
     354/* NEW for RingCycle 
     355 * 
     356 * Creates a new driver thread for use at the specified ring 
     357 */ 
    353358int create_driver_thread(unsigned long flags, int ring) 
    354359{ 
     
    362367//      regs.edx = (unsigned long) arg; 
    363368 
     369  //Helpers are little wrappers that call driver_exit when done 
    364370  if (!ring1_driver_helper) 
    365371      create_driver_helpers(); 
     372  //Create a stack and set segment registers 
    366373  if (ring == 1) 
    367374  { 
     
    401408        tsk->available=0; 
    402409        tsk->currentmapped=0; 
     410    //Mark as high priority 
    403411        set_user_nice(tsk, -20);         
    404412  return pid; 
  • arch/i386/kernel/traps.c

    r24 r28  
    5959 
    6060//Enable to treat driver gp faults like kernel ones 
    61 #define DEBUG_DRIVER 
     61//If this is turned on, stack traces are given for driver faults 
     62//#define DEBUG_DRIVER 
    6263 
    6364 
     
    443444DO_ERROR(12, SIGBUS,  "stack segment", stack_segment) 
    444445DO_ERROR_INFO(17, SIGBUS, "alignment check", alignment_check, BUS_ADRALN, get_cr2()) 
     446//This routine unloads a module 
     447//Must be seperate because it is run throuhg keventd 
    445448void do_unload_module(void *myaddr) { 
    446449    char *name; 
     
    463466                goto gp_in_kernel; 
    464467 
    465         printk("data at 67: %x\n%x\n", *(((unsigned long*)idt_table)+2*67),*(((unsigned long*)idt_table)+2*67+1)); 
    466         set_system_gate(67, &benchmark_handler); 
     468        //printk("data at 67: %x\n%x\n", *(((unsigned long*)idt_table)+2*67),*(((unsigned long*)idt_table)+2*67+1)); 
     469        //set_system_gate(67, &benchmark_handler); 
    467470  if ((regs->xcs & 3)!=3) { 
    468471      //driver thread 
  • .config

    r24 r28  
    471471# Tulip family network device support 
    472472# 
    473 # CONFIG_NET_TULIP is not set 
     473CONFIG_NET_TULIP=y 
     474# CONFIG_DE2104X is not set 
     475# CONFIG_TULIP is not set 
     476# CONFIG_DE4X5 is not set 
     477# CONFIG_WINBOND_840 is not set 
     478# CONFIG_DM9102 is not set 
    474479# CONFIG_HP100 is not set 
    475480CONFIG_NET_PCI=y 
  • .config.old

    r24 r28  
    506506# CONFIG_R8169 is not set 
    507507# CONFIG_SK98LIN is not set 
    508 # CONFIG_TIGON3 is not set 
     508CONFIG_TIGON3=y 
    509509 
    510510# 
  • fs/open.c

    r27 r28  
    996996{ 
    997997        int retval; 
    998  
     998    struct task_struct *tsk; 
    999999        /* Report and clear outstanding errors */ 
    10001000        retval = filp->f_error; 
     
    10081008 
    10091009        if (filp->f_op && filp->f_op->flush) { 
    1010                 int err = filp->f_op->flush(filp); 
     1010      int err; 
     1011      if ((unsigned long) filp->f_op->flush > PAGE_OFFSET)  
     1012                    err = filp->f_op->flush(filp); 
     1013      else { 
     1014          unsigned int size=sizeof(*filp); 
     1015          void *args[1]={filp}; 
     1016          err=calldriver((unsigned long) filp->f_op->flush, args, &size, 1, current->mm, 1, 0);    
     1017      } 
    10111018                if (!retval) 
    10121019                        retval = err; 
    10131020        } 
     1021  if (filp->f_op && (unsigned long) filp->f_op < PAGE_OFFSET) { 
     1022      tsk=find_worker_thread((unsigned long) filp->f_op, 0); 
     1023      tsk->available=1; 
     1024      put_module(tsk->driver_id); 
     1025  } 
    10141026 
    10151027        dnotify_flush(filp, id); 
  • fs/read_write.c

    r27 r28  
    227227                                else { 
    228228                                        CALLDRIVER_PREP4(read, file, buf, count, pos) 
     229              read_sizes[0]=sizeof(*file); 
     230          read_sizes[3]=sizeof(*pos); 
    229231                                        ret = calldriver((unsigned long) file->f_op->read, read_args, read_sizes, 4, current->mm, 9, 0); 
    230232                                } 
  • include/asm-i386/callgate.h

    r27 r28  
     1/* include/asm-i386/callgate.h 
     2 * NEW for RingCycle 
     3 * 
     4 * Defines macros and flags used in arch/i386/kernel/callgate.c 
     5 * 
     6 * Written by David Kaplan, 2006 */ 
    17#ifndef CALLGATE_H 
    28#define CALLGATE_H 
     
    2632 
    2733extern unsigned long map_struct(unsigned long kernel_struct, unsigned long size, int ring, int update_ref, void *driver_id); 
     34extern void put_module(void *id);  
    2835//Macros for helping create structures for calldriver 
    2936#define CALLDRIVER_PREP2(name, param1, param2) \ 
     
    4754#define NO_WAIT 0x00000001 
    4855#define USE_RESERVED 0x00000002 
     56#define NOUNMAP_PARAM1 0x20000000 
     57#define NOUNMAP_PARAM2 0x10000000 
    4958#endif 
  • include/asm-i386/dapi.h

    r24 r28  
     1/* include/asm-i386/dapi.h 
     2 * NEW for RingCycle 
     3 * 
     4 * Defines the Driver API that drivers must be compiled against 
     5 * to use the new callgates defined in the RingCycle 
     6 * 
     7 * This is a bunch of nested macros, so please read comments carefully 
     8 * Also see Documentation/DAPI.txt for details on how to add stuff 
     9 * 
     10 * Written by David Kaplan, 2006 
     11 */ 
    112#ifndef ASM_DAPI_H 
    213#define ASM_DAPI_H 
     
    5667#define CALLGATE_sprintf "pushl $1\n\t" 
    5768 
    58  
     69//Callee saved registers (eax is implied since used for return value) 
    5970#define CALLEE  "ecx", "edx" 
     71 
     72 
    6073#define make_wrap0(func, ret) \ 
    6174    static inline ret func ( void ) { \ 
     
    174187                :  : "g"(param4), "g"(param3), "g"(param2), "g"(param1):CALLEE);  \ 
    175188    } 
     189 
     190//Notice not inline anymore 
    176191#define make_wrap10(func, ret, type1, ... ) \ 
    177192    static ret func (type1 param1, ... ) { \ 
     
    228243#define LCALL5 "lcall $0x130,$0\n\t" 
    229244#define LCALL15 "lcall $0x138,$0\n\t" 
    230 #define LCALL_NOP "lcall $0x140,$0\n\t" 
     245#define LCALL_NOP "lcall $0x140,$0\n\t" //Used for benchmarking 
    231246#ifdef MODULE 
    232247//forward declarations 
     
    274289make_void_wrap2(do_benchmark, unsigned long, unsigned long); 
    275290     
     291//this must be done using the old method 
     292//It's complicated, but basically so the registers are where they should be  
     293//on the stack 
    276294static inline void schedule(void) { 
    277295    asm("movl $286, %eax\n\t" 
     
    279297       ); 
    280298} 
     299 
     300//Self-documenting 
    281301static inline void arediculouslylongnamesoitwontconflictiwthanythingbutgccwontcomplainaboutsprintf(void) { 
    282302    sprintf(NULL, NULL, NULL); 
  • include/asm-i386/processor.h

    r14 r28  
    115115#define X86_EFLAGS_OF   0x00000800 /* Overflow Flag */ 
    116116#define X86_EFLAGS_IOPL 0x00003000 /* IOPL mask */ 
    117 #define X86_EFLAGS_IOPL1 0x00001000 
    118 #define X86_EFLAGS_IOPL2 0x00002000 
     117#define X86_EFLAGS_IOPL1 0x00001000 /* IOPL=1*/ 
     118#define X86_EFLAGS_IOPL2 0x00002000 /*IOPL=2*/ 
    119119#define X86_EFLAGS_NT   0x00004000 /* Nested Task */ 
    120120#define X86_EFLAGS_RF   0x00010000 /* Resume Flag */ 
     
    299299 */ 
    300300//#define TASK_SIZE     (PAGE_OFFSET) 
     301//For RingCycle, userspace is 2GB 
    301302#define TASK_SIZE (0x80000000) 
    302303 
  • include/asm-i386/uaccess.h

    r20 r28  
    2727 
    2828#define KERNEL_DS       MAKE_MM_SEG(0xFFFFFFFFUL) 
     29//Changed.  This was PAGE_OFFSET which is just wrong 
    2930#define USER_DS         MAKE_MM_SEG(TASK_SIZE) 
    3031 
  • include/config/net/tulip.h

    r1 r28  
    1 #undef CONFIG_NET_TULIP 
     1#define CONFIG_NET_TULIP 1 
  • include/linux/autoconf.h

    r24 r28  
    472472 * Tulip family network device support 
    473473 */ 
    474 #undef CONFIG_NET_TULIP 
     474#define CONFIG_NET_TULIP 1 
     475#undef CONFIG_DE2104X 
     476#undef CONFIG_TULIP 
     477#undef CONFIG_DE4X5 
     478#undef CONFIG_WINBOND_840 
     479#undef CONFIG_DM9102 
    475480#undef CONFIG_HP100 
    476481#define CONFIG_NET_PCI 1 
  • kernel/exit.c

    r22 r28  
    833833EXPORT_SYMBOL(complete_and_exit); 
    834834 
     835/* RingCycle 
     836 * This function is called when a driver thread routine finishes 
     837 * It pops parameters off the stack if needed 
     838 * It marks the thread as available 
     839 * It wakes up people sleeping on this thread 
     840 * At the end it calls schedule() to run a different thread 
     841 * 
     842 * Freeing of page tables used by the thread should be added here 
     843 * Will need testing to make sure the tables won't be needed again 
     844 * if the driver thread is used in a place where the context is not valid 
     845 * 
     846 */ 
    835847asmlinkage void driver_exit(long exit_code) 
    836848{ 
     
    838850    struct task_struct *tsk=current; 
    839851    int irq; 
     852 
     853    //Copy exit code 
    840854    tsk->exit_code=exit_code; 
     855 
     856    //Mark thread as not runnable 
    841857    tsk->state=TASK_UNINTERRUPTIBLE; 
     858 
     859    //Freeing of current mapping is not done here anymore 
     860    //It should be done somewhere, probably when the module is unloaded 
    842861    /*if (tsk->currentmapped) { 
    843862        ClearPageReserved(pfn_to_page(__pa(tsk) >> PAGE_SHIFT)); 
     
    846865        tsk->currentmapped=0; 
    847866    }*/ 
     867 
     868    //Pop bytes off stack 
    848869    irq=tsk->bytes_to_pop; 
    849870    task_pt_regs(tsk)->esp+=tsk->bytes_to_pop; 
    850871    tsk->bytes_to_pop=0; 
     872    tsk->currentmapped=0; 
     873 
     874    //Mark as availalbe and wake up 
    851875    tsk->available=1; 
    852876    wake_up(&tsk->wait_driverfinish); 
    853877    schedule(); 
    854     //BUG(); 
    855     //for (;;) ; 
    856878     
    857879} 
  • kernel/fork.c

    r22 r28  
    945945        INIT_LIST_HEAD(&p->sibling); 
    946946        init_waitqueue_head(&p->wait_chldexit); 
     947 
     948  /* Added for RingCycle 
     949   * Initialize wait queue that is used when this is a driver thread 
     950   */ 
    947951  init_waitqueue_head(&p->wait_driverfinish); 
    948952  p->caller=p; 
     
    11661170 * It copies the process, and if successful kick-starts 
    11671171 * it and waits for it to finish using the VM if required. 
     1172 * 
     1173 * RingCycle Note: CLONE_STOPPED is broken, do not use it 
    11681174 */ 
    11691175long do_fork(unsigned long clone_flags, 
  • kernel/module.c

    r27 r28  
    628628//      mod->exit(); 
    629629  testargs=31415926; 
     630 
     631  //If this module is running in ring 1 or 2, call the exit routine using the reserved thread 
    630632if (mod->ring) { 
    631633  if (mod->exit) 
     
    633635        down(&module_mutex); 
    634636  //NEW: get rid of threads 
     637  //Get rid of threads by sending them a SIGKILL 
    635638  for (i=0; i<NR_DRIVERTHREADS; i++) { 
    636639      //zap_other_threads(mod->worker_threads[i]); 
     
    648651 
    649652        free_module(mod); 
    650   print_modules(); 
     653  //print_modules(); 
    651654        down(&notify_mutex); 
    652655        notifier_call_chain(&module_notify_list, MODULE_STATE_GONE, 
     
    18901893  printk("Driver thread finished with code %d", ret);*/ 
    18911894  //FIXME: Figure out what ring to load module in (how?) 
     1895 
     1896 
     1897  /* Ring the ring argument to determine which ring to load this in*/ 
    18921898  mod->ring=find_ring_arg(mod->args); 
    1893 printk("Ring we got was %d\n", mod->ring); 
     1899//printk("Ring we got was %d\n", mod->ring); 
    18941900  if (mod->ring < 0 || mod->ring > 2) 
    18951901  { 
     
    18991905if (mod->ring!=0) {   
    19001906spin_lock_init(&mod->threads_lock); 
     1907 
     1908    //Create driver threads 
    19011909  for (i=0; i<NR_DRIVERTHREADS; i++) { 
    19021910      pid=create_driver_thread(0, mod->ring); 
     
    19151923  } 
    19161924  schedule(); 
    1917   printk("mod pointer is %x, per cpu is %d\n", mod, mod->percpu); 
    1918   printk("Invoking init method...\n"); 
     1925  
     1926  //Call the init method on one of the threads 
    19191927  ret=calldriver((unsigned long) mod->init, NULL, NULL, 0, NULL, 0, 0); 
    19201928} else { 
     
    19611969} 
    19621970 
     1971/* New for RingCycle 
     1972 * 
     1973 * Finds a worker thread for the module that uses the given address 
     1974 * If use_reserved is true, it may use the reserved thread if necessary 
     1975 */ 
    19631976struct task_struct *find_worker_thread(unsigned long addr, int use_reserved) 
    19641977{ 
     
    19771990            while (i < (NR_DRIVERTHREADS-1+use_reserved)) { 
    19781991                if (mod->worker_threads[i]->available) { 
     1992                    //If we find one, mark as unavilable and return it 
    19791993                    mod->worker_threads[i]->available=0; 
    19801994                    tsk=mod->worker_threads[i];  
     
    19922006} 
    19932007 
     2008//Returns the name of the module that uses the given address 
    19942009char *find_module_by_thread(unsigned long addr) 
    19952010{ 
  • kernel/params.c

    r24 r28  
    6060                } 
    6161        } 
     62 
     63  //New for RingCycle, this allows loading the specified module 
     64  //into a ring of choice (0, 1, or 2) 
    6265        if (parameq(param, "ring")) { 
    6366                ring=val; 
  • kernel/sched.c

    r24 r28  
    40694069#endif /* defined(CONFIG_SMP) && defined(CONFIG_PREEMPT) */ 
    40704070 
     4071/* Ringcycle 
     4072 * This function needs to be fixed 
     4073 * It should return true if either the caller or the current thread 
     4074 * has a signal pending. 
     4075 * That code is here, but has not been tested yet 
     4076 */ 
    40714077int mod_signal_pending(struct task_struct *p) { 
     4078    //return (signal_pending(p->caller) | signal_pending(p)); 
    40724079    return signal_pending(p->caller); 
    4073 
     4080     
     4081
  • kernel/signal.c

    r15 r28  
    18681868                 * Death signals, no core dump. 
    18691869                 */ 
     1870    //For RingCycle driver threads 
    18701871    if ((regs->xcs & 3)==1 || (regs->xcs & 3)==2) { 
    18711872        do_exit(-ENODEV); 
  • kernel/timer.c

    r27 r28  
    455455                        timer->base = NULL; 
    456456                        spin_unlock_irq(&base->lock); 
     457      //If this is a driver thread, use calldriver 
    457458      if ((unsigned long) fn > PAGE_OFFSET) 
    458459                          fn(data); 
  • mm/vmalloc.c

    r14 r28  
    245245struct vm_struct *get_vm_area(unsigned long size, unsigned long flags) 
    246246{ 
     247    //If this is a request for driver addresses, we start and end using the appropriate constants 
     248    //Constants are defined in include/asm-i386/pgtable.h 
    247249    if (flags & VMALLOC_RING1) 
    248250        return __get_vm_area(size, flags, VMALLOC_START_RING1, VMALLOC_END_RING1); 
     
    391393 *      @gfp_mask:      flags for the page level allocator 
    392394 *      @prot:          protection mask for the allocated pages 
     395 *      @flags: NEW FOR RINGCYCLe, specifies region to get vaddress is 
    393396 * 
    394397 *      Allocate enough pages to cover @size from the page level