Changeset 21

Show
Ignore:
Timestamp:
11/13/05 00:24:09 (6 years ago)
Author:
dkaplan1
Message:

Most of RTC driver works. Sometimes get fatal exception in interrupt handler,
but sometimes not. Don't know WTF is going on. But I just ran a good test
program 3 times in a row and it completely worked.

Lots of other code changes here, will be doc'd later

Files:

Legend:

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

    r20 r21  
    102102struct task_struct *mod_get_current(void) { 
    103103    struct task_struct *tsk=current; 
    104     if (tsk->currentmapped) 
     104    if (tsk->currentmapped) { 
    105105        return tsk->currentaddr; 
    106     tsk->currentaddr=(struct task_struct*) map_struct(tsk, sizeof(*tsk), tsk->ring, &tsk->origcurrentaddr); 
     106    } 
     107    tsk->currentaddr=(struct task_struct*) map_struct(tsk, sizeof(*tsk)+PAGE_SIZE, tsk->ring, &tsk->origcurrentaddr); 
    107108    tsk->currentmapped=1; 
    108109    return tsk->currentaddr; 
     
    116117        "pushl 16(%ebp)\n\t" 
    117118        "decl %ecx\n\t" 
    118         "cmpl $7, %ecx\n\t" 
     119        "cmpl $8, %ecx\n\t" 
    119120        "ja done2\n\t" 
    120121        "call *callgate_table2(,%ecx,4)\n\t" 
     
    123124        "leave\n\t" 
    124125        "lret $8\n\t" 
    125         "callgate_table2: .long driver_printdiag, do_exit, driver_exit, misc_register, misc_deregister, unregister_sysctl_table, del_timer
     126        "callgate_table2: .long driver_printdiag, do_exit, driver_exit, misc_register, misc_deregister, unregister_sysctl_table, del_timer, mod_signal_pending
    126127); 
    127128 
     
    348349    return tsk->exit_code;*/ 
    349350 
    350     tsk=find_worker_thread(addr); 
     351    tsk=find_worker_thread(addr, ptrbitmap & USE_RESERVED); 
    351352    if (!tsk) { 
    352353        printk(KERN_ERR "Could not find worker thread for address %x\n", addr); 
     
    420421            if (addrs[i]) { 
    421422                ClearPageReserved(pfn_to_page(__pa(argv[i]) >> PAGE_SHIFT)); 
     423                ClearPageReserved(pfn_to_page((__pa(argv[i]) >> PAGE_SHIFT) + 1)); 
    422424                vunmap(origmems[i]); 
    423425            } 
     
    452454    vma->vm_mm=&init_mm; 
    453455    SetPageReserved(pfn_to_page(__pa(kernel_struct) >> PAGE_SHIFT)); 
     456 
     457    SetPageReserved(pfn_to_page((__pa(kernel_struct) >> PAGE_SHIFT) + 1)); 
    454458    remap_page_range(vma, addr, __pa(kernel_struct), size, PAGE_KERNEL); 
    455459    addr+=(unsigned long) kernel_struct & (PAGE_SIZE -1); 
  • arch/i386/kernel/entry.S

    r8 r21  
    302302        testb $_TIF_NEED_RESCHED, %cl 
    303303        jz work_notifysig 
     304        #NEW FOR RING CYCLE 
     305        testb $1, CS(%esp) 
     306        jz work_notifysig 
     307        testb $2, CS(%esp) 
     308        jz work_notifysig 
    304309work_resched: 
    305310        call user_schedule 
     
    912917        .long sys_mq_getsetattr 
    913918        .long sys_ni_syscall            /* reserved for kexec */ 
    914         .long sys_printdiag 
    915         .long driver_exit /* 285*/ 
     919  .long sys_printdiag 
     920  .long driver_exit /* 285*/ 
     921  .long mod_schedule 
    916922 
    917923syscall_table_size=(.-sys_call_table) 
  • arch/i386/kernel/irq.c

    r1 r21  
    4747#include <asm/desc.h> 
    4848#include <asm/irq.h> 
    49  
     49#include <asm/callgate.h> 
    5050/* 
    5151 * Linux has a controller-independent x86 interrupt architecture. 
     
    230230        do { 
    231231                status |= action->flags; 
    232                 retval |= action->handler(irq, action->dev_id, regs); 
    233                 action = action->next; 
     232    if ((unsigned long) action->handler > PAGE_OFFSET) 
     233        retval |= action->handler(irq, action->dev_id, regs); 
     234    else { 
     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); 
     237        retval|=IRQ_HANDLED; 
     238    } 
     239     
     240    action = action->next; 
    234241        } while (action); 
    235242        if (status & SA_SAMPLE_RANDOM) 
  • arch/i386/kernel/traps.c

    r18 r21  
    5858#include "mach_traps.h" 
    5959 
     60//Enable to treat driver gp faults like kernel ones 
     61#define DEBUG_DRIVER 
     62 
     63 
    6064asmlinkage int system_call(void); 
    6165asmlinkage void lcall7(void); 
     
    461465      //driver thread 
    462466      printk("General protection fault in driver thread at %x\n", regs->eip); 
     467#ifdef DEBUG_DRIVER 
     468      goto gp_in_kernel; 
     469#endif 
    463470      //die("general protection", regs, error_code); 
    464471      current->thread.error_code=error_code; 
  • Documentation/DAPI.txt

    r19 r21  
    7272to add 1 to the parameter count when deciding which jump table to add to. 
    7373 
    74 include/asm/callgate.h: Add a preprocessor macro CALLGATE_func where func is 
     74include/asm/dapi.h: Add a preprocessor macro CALLGATE_func where func is 
    7575the name of the functino you are implementing.  The value of the macro should 
    7676be a pushl instruction which pushes the number of the function (the location 
     
    121121callgate_table2: .long x,y      callgate_table2: .long x, y, misc_register 
    122122 
    123 In include/asm/callgate.h: Add the following line 
     123In include/asm/dapi.h: Add the following line 
    124124#define CALLGATE_misc_register "pushl $3\n\t" since here misc_register is the 
    125125third function in the jump table. 
  • drivers/char/misc.c

    r14 r21  
    5252#include <linux/kmod.h> 
    5353 
     54#include <asm/callgate.h> 
    5455/* 
    5556 * Head entry for the doubly linked miscdevice list 
  • fs/file_table.c

    r1 r21  
    1818#include <linux/cdev.h> 
    1919 
     20#include <asm/callgate.h> 
    2021/* sysctl tunables... */ 
    2122struct files_stat_struct files_stat = { 
     
    146147        struct inode * inode = file->f_dentry->d_inode; 
    147148 
    148         if (file->f_op && file->f_op->release) 
    149                 file->f_op->release(inode, file); 
     149        if (file->f_op && file->f_op->release) { 
     150      if ((unsigned long) file->f_op->release > PAGE_OFFSET) 
     151          file->f_op->release(inode, file); 
     152      else { 
     153          unsigned long args[2]={(unsigned long) inode, (unsigned long) file}; 
     154          calldriver((unsigned long) file->f_op->release, args, 2, current->mm, 3); 
     155      } 
     156  } 
    150157        security_file_free(file); 
    151158} 
     
    177184        locks_remove_flock(file); 
    178185 
    179         if (file->f_op && file->f_op->release) 
    180                 file->f_op->release(inode, file); 
     186        if (file->f_op && file->f_op->release) { 
     187      if ((unsigned long) file->f_op->release > PAGE_OFFSET)  
     188          file->f_op->release(inode, file); 
     189      else { 
     190          unsigned long args[2]={(unsigned long) inode, (unsigned long) file}; 
     191          calldriver((unsigned long) file->f_op->release, args, 2, current->mm, 3); 
     192      } 
     193  } 
    181194        security_file_free(file); 
    182195        if (unlikely(inode->i_cdev != NULL)) 
  • fs/ioctl.c

    r18 r21  
    1313#include <asm/uaccess.h> 
    1414#include <asm/ioctls.h> 
     15#include <asm/callgate.h> 
    1516 
    1617static int file_ioctl(struct file *filp,unsigned int cmd,unsigned long arg) 
  • fs/proc/generic.c

    r20 r21  
    2121#include <asm/bitops.h> 
    2222 
     23#include <asm/callgate.h> 
    2324static ssize_t proc_file_read(struct file *file, char __user *buf, 
    2425                              size_t nbytes, loff_t *ppos); 
  • fs/read_write.c

    r13 r21  
    1717#include <asm/uaccess.h> 
    1818#include <asm/unistd.h> 
     19#include <asm/callgate.h> 
    1920 
    2021struct file_operations generic_ro_fops = { 
     
    231232                                        args[2]=(unsigned long) count; 
    232233                                        args[3]=(unsigned long) pos; 
    233                                         ret = calldriver((unsigned long) file->f_op->read, args, 4, current->mm, 0); 
     234                                        ret = calldriver((unsigned long) file->f_op->read, args, 4, current->mm, 9); 
    234235                                } 
    235236                        } 
     
    296297                                        args[2]=(unsigned long) count; 
    297298                                        args[3]=(unsigned long) pos; 
    298                                         ret = calldriver((unsigned long) file->f_op->write, args, 4, current->mm, 0); 
     299                                        ret = calldriver((unsigned long) file->f_op->write, args, 4, current->mm, 9); 
    299300                                } 
    300301                        } 
  • include/asm-i386/callgate.h

    r20 r21  
    2828//FLAGS for calldriver 
    2929#define NO_WAIT 0x80000000 
    30  
    31 /* So here's what going on: 
    32  * we have a jump table for drivers calling into the kernel 
    33  * there is a seperate entry point based on the number of parameters the function takes 
    34  * here are defines so we can easily locate where they are in the jump table 
    35  */ 
    36  
    37 //0 parameter functions 
    38 #define CALLGATE_mod_get_current "pushl $1\n\t" 
    39 #define CALLGATE_schedule "pushl $2\n\t" 
    40 #define CALLGATE_mod_get_jiffies "pushl $3\n\t" 
    41 //1 parameter functions 
    42 #define CALLGATE_DRIVERPRINTDIAG "pushl $1\n\t" 
    43 #define CALLGATE_DOEXIT "pushl $2\n\t" 
    44 #define CALLGATE_DODRIVERFINISH "pushl $3\n\t" 
    45 #define CALLGATE_misc_register "pushl $4\n\t" 
    46 #define CALLGATE_misc_deregister "pushl $5\n\t" 
    47 #define CALLGATE_unregister_sysctl_table "pushl $6\n\t" 
    48 #define CALLGATE_del_timer "pushl $7\n\t" 
    49  
    50 //2 parameter functions 
    51 #define CALLGATE_release_region "pushl $1\n\t" 
    52 #define CALLGATE_release_mem_region "pushl $2\n\t" 
    53 #define CALLGATE_register_sysctl_table "pushl $3\n\t" 
    54 #define CALLGATE_mod_timer "pushl $4\n\t" 
    55 #define CALLGATE___mod_timer "pushl $5\n\t" 
    56 #define CALLGATE_add_wait_queue "pushl $6\n\t" 
    57 #define CALLGATE_remove_wait_queue "pushl $7\n\t" 
    58 #define CALLGATE_free_irq "pushl $8\n\t" 
    59 #define CALLGATE_remove_proc_entry "pushl $9\n\t" 
    60 //3 parameter functions 
    61 #define CALLGATE_REGISTERCHRDEV "pushl $1\n\t" 
    62 #define CALLGATE_copy_from_user "pushl $2\n\t" 
    63 #define CALLGATE_copy_to_user "pushl $3\n\t" 
    64 #define CALLGATE_no_llseek "pushl $4\n\t" 
    65 #define CALLGATE_request_region "pushl $5\n\t" 
    66 #define CALLGATE_request_mem_region "pushl $6\n\t" 
    67 #define CALLGATE_kill_fasync "pushl $7\n\t" 
    68 #define CALLGATE_pollwait "pushl $8\n\t" 
    69 //4 parameter functions 
    70 #define CALLGATE___wake_up "pushl $1\n\t" 
    71 #define CALLGATE_fasync_helper "pushl $2\n\t" 
    72 //#define CALLGATE___request_region "pushl $1\n\t" 
    73  
    74 //5 parameter functions 
    75 #define CALLGATE_request_irq "pushl $1\n\t" 
    76 #define CALLGATE_create_proc_read_entry "pushl $2\n\t" 
    77 //10 parameter functions 
    78 #define CALLGATE_printk "pushl $1\n\t" 
    79 //15 parameter functions 
    80 #define CALLGATE_sprintf "pushl $1\n\t" 
     30#define USE_RESERVED 0x40000000 
    8131#endif 
  • include/asm-i386/dapi.h

    r20 r21  
    22#define ASM_DAPI_H 
    33 
    4 #include <asm/callgate.h> 
    54#include <asm-generic/errno-base.h> 
    65 
     6/* So here's what going on: 
     7 * we have a jump table for drivers calling into the kernel 
     8 * there is a seperate entry point based on the number of parameters the function takes 
     9 * here are defines so we can easily locate where they are in the jump table 
     10 */ 
     11 
     12//0 parameter functions 
     13#define CALLGATE_mod_get_current "pushl $1\n\t" 
     14#define CALLGATE_schedule "pushl $2\n\t" 
     15#define CALLGATE_mod_get_jiffies "pushl $3\n\t" 
     16//1 parameter functions 
     17#define CALLGATE_DRIVERPRINTDIAG "pushl $1\n\t" 
     18#define CALLGATE_DOEXIT "pushl $2\n\t" 
     19#define CALLGATE_DODRIVERFINISH "pushl $3\n\t" 
     20#define CALLGATE_misc_register "pushl $4\n\t" 
     21#define CALLGATE_misc_deregister "pushl $5\n\t" 
     22#define CALLGATE_unregister_sysctl_table "pushl $6\n\t" 
     23#define CALLGATE_del_timer "pushl $7\n\t" 
     24#define CALLGATE_signal_pending "pushl $8\n\t" 
     25//2 parameter functions 
     26#define CALLGATE_release_region "pushl $1\n\t" 
     27#define CALLGATE_release_mem_region "pushl $2\n\t" 
     28#define CALLGATE_register_sysctl_table "pushl $3\n\t" 
     29#define CALLGATE_mod_timer "pushl $4\n\t" 
     30#define CALLGATE___mod_timer "pushl $5\n\t" 
     31#define CALLGATE_add_wait_queue "pushl $6\n\t" 
     32#define CALLGATE_remove_wait_queue "pushl $7\n\t" 
     33#define CALLGATE_free_irq "pushl $8\n\t" 
     34#define CALLGATE_remove_proc_entry "pushl $9\n\t" 
     35//3 parameter functions 
     36#define CALLGATE_REGISTERCHRDEV "pushl $1\n\t" 
     37#define CALLGATE_copy_from_user "pushl $2\n\t" 
     38#define CALLGATE_copy_to_user "pushl $3\n\t" 
     39#define CALLGATE_no_llseek "pushl $4\n\t" 
     40#define CALLGATE_request_region "pushl $5\n\t" 
     41#define CALLGATE_request_mem_region "pushl $6\n\t" 
     42#define CALLGATE_kill_fasync "pushl $7\n\t" 
     43#define CALLGATE_poll_wait "pushl $8\n\t" 
     44//4 parameter functions 
     45#define CALLGATE___wake_up "pushl $1\n\t" 
     46#define CALLGATE_fasync_helper "pushl $2\n\t" 
     47//#define CALLGATE___request_region "pushl $1\n\t" 
     48 
     49//5 parameter functions 
     50#define CALLGATE_request_irq "pushl $1\n\t" 
     51#define CALLGATE_create_proc_read_entry "pushl $2\n\t" 
     52//10 parameter functions 
     53#define CALLGATE_printk "pushl $1\n\t" 
     54//15 parameter functions 
     55#define CALLGATE_sprintf "pushl $1\n\t" 
     56 
     57 
     58#define CALLEE  "ecx", "edx" 
    759#define make_wrap0(func, ret) \ 
    860    static inline ret func ( void ) { \ 
    961        ret myret;  \ 
    1062        asm volatile (  CALLGATE_ ## func  \ 
    11                         LCALL1       \ 
    12                 : "=a"(myret));  \ 
     63                        LCALL0       \ 
     64                : "=a"(myret):: CALLEE );  \ 
    1365        return myret;  \ 
    1466    } 
     
    1971                CALLGATE_ ## func  \ 
    2072                LCALL1       \ 
    21                 : "=a"(myret) : "g"(param1));  \ 
     73                : "=a"(myret) : "g"(param1): CALLEE);  \ 
    2274        return myret;  \ 
    2375    } 
     
    3183                CALLGATE_ ## func  \ 
    3284                LCALL2       \ 
    33                 : "=a"(myret) : "g"(param2), "g"(param1));  \ 
     85                : "=a"(myret) : "g"(param2), "g"(param1): CALLEE);  \ 
    3486        return myret;  \ 
    3587    } 
     
    4496                CALLGATE_ ## func  \ 
    4597                LCALL3       \ 
    46                 : "=a"(myret) : "g"(param3), "g"(param2), "g"(param1));  \ 
     98                : "=a"(myret) : "g"(param3), "g"(param2), "g"(param1):CALLEE);  \ 
    4799        return myret;  \ 
    48100    } 
     
    58110                CALLGATE_ ## func  \ 
    59111                LCALL4       \ 
    60                 : "=a"(myret) : "g"(param4), "g"(param3), "g"(param2), "g"(param1));  \ 
     112                : "=a"(myret) : "g"(param4), "g"(param3), "g"(param2), "g"(param1):CALLEE);  \ 
    61113        return myret;  \ 
    62114    } 
     
    72124                CALLGATE_ ## func  \ 
    73125                LCALL5       \ 
    74                 : "=a"(myret) : "m"(param5), "m"(param4), "m"(param3), "m"(param2), "m"(param1));  \ 
     126                : "=a"(myret) : "m"(param5), "m"(param4), "m"(param3), "m"(param2), "m"(param1):CALLEE);  \ 
    75127        return myret;  \ 
    76128    } 
     
    78130    static inline void func ( void ) { \ 
    79131        asm volatile (  CALLGATE_ ## func  \ 
    80                         LCALL1       \ 
    81                 );  \ 
     132                        LCALL0       \ 
     133               :::CALLEE );  \ 
    82134    } 
    83135#define make_void_wrap1(func, type1) \ 
     
    86138                CALLGATE_ ## func  \ 
    87139                LCALL1       \ 
    88                 :  : "g"(param1));  \ 
     140                :  : "g"(param1):CALLEE);  \ 
    89141    } 
    90142 
     
    96148                CALLGATE_ ## func  \ 
    97149                LCALL2       \ 
    98                 :  : "g"(param2), "g"(param1));  \ 
     150                :  : "g"(param2), "g"(param1):CALLEE);  \ 
    99151    } 
    100152 
     
    107159                CALLGATE_ ## func  \ 
    108160                LCALL3       \ 
    109                 : : "g"(param3), "g"(param2), "g"(param1));  \ 
     161                : : "g"(param3), "g"(param2), "g"(param1):CALLEE);  \ 
    110162    } 
    111163 
     
    119171                CALLGATE_ ## func  \ 
    120172                LCALL4       \ 
    121                 :  : "g"(param4), "g"(param3), "g"(param2), "g"(param1));  \ 
     173                :  : "g"(param4), "g"(param3), "g"(param2), "g"(param1):CALLEE);  \ 
    122174    } 
    123175#define make_wrap10(func, ret, type1, ... ) \ 
     
    203255make_wrap2(register_sysctl_table, struct ctl_table_header*, struct ctl_table*, int) 
    204256make_void_wrap1(unregister_sysctl_table, struct ctl_table_header*) 
    205 make_void_wrap0(schedule) 
    206257make_wrap5(request_irq, int, unsigned int, irqhandler, unsigned long, const char*, void *) 
    207258make_wrap2(mod_timer, int, struct timer_list*, unsigned long) 
     
    213264make_void_wrap2(add_wait_queue, struct __wait_queue_head *, struct __wait_queue*) 
    214265make_void_wrap2(remove_wait_queue, struct __wait_queue_head *, struct __wait_queue*) 
    215 make_void_wrap3(pollwait, struct file *, struct __wait_queue_head *, struct poll_table_struct *) 
     266make_void_wrap3(poll_wait, struct file *, struct __wait_queue_head *, struct poll_table_struct *) 
    216267make_wrap5(create_proc_read_entry, struct proc_dir_entry*, const char*, unsigned long, struct proc_dir_entry *, readproc * , void *)  
    217268make_void_wrap2(free_irq, unsigned int, void *) 
     
    219270make_wrap15(sprintf, int, char *, const char *) 
    220271make_wrap0(mod_get_jiffies, unsigned long) 
    221      
     272make_wrap1(signal_pending, int, struct task_struct *)      
     273 
     274static inline void schedule(void) { 
     275    asm("movl $286, %eax\n\t" 
     276            "int $0x80\n\t" 
     277       ); 
     278
    222279static inline void arediculouslylongnamesoitwontconflictiwthanythingbutgccwontcomplainaboutsprintf(void) { 
    223280    sprintf(NULL, NULL, NULL); 
  • include/linux/module.h

    r16 r21  
    5454extern void cleanup_module(void); 
    5555 
    56 extern struct task_struct *find_worker_thread(unsigned long addr); 
     56extern struct task_struct *find_worker_thread(unsigned long addr, int use_reserved); 
    5757extern char *find_module_by_thread(unsigned long addr); 
    5858 
  • include/linux/poll.h

    r20 r21  
    2727                p->qproc(filp, wait_address, p); 
    2828} 
     29extern void mod_poll_wait(struct file *, wait_queue_head_t *, poll_table *); 
    2930#endif 
    3031#ifdef MODULE 
  • include/linux/sched.h

    r20 r21  
    10071007        clear_tsk_thread_flag(tsk,TIF_NEED_RESCHED); 
    10081008} 
    1009  
     1009#ifndef MODULE 
    10101010static inline int signal_pending(struct task_struct *p) 
    10111011{ 
    10121012        return unlikely(test_tsk_thread_flag(p,TIF_SIGPENDING)); 
    10131013} 
    1014    
     1014extern int mod_signal_pending(struct task_struct *p); 
     1015#endif 
     1016#ifdef MODULE 
     1017extern int signal_pending(struct task_struct *); 
     1018#endif 
    10151019static inline int need_resched(void) 
    10161020{ 
  • include/linux/wait.h

    r1 r21  
    8181} 
    8282 
    83 extern void FASTCALL(add_wait_queue(wait_queue_head_t *q, wait_queue_t * wait)); 
     83extern void add_wait_queue(wait_queue_head_t *q, wait_queue_t * wait); 
    8484extern void FASTCALL(add_wait_queue_exclusive(wait_queue_head_t *q, wait_queue_t * wait)); 
    85 extern void FASTCALL(remove_wait_queue(wait_queue_head_t *q, wait_queue_t * wait)); 
     85extern void remove_wait_queue(wait_queue_head_t *q, wait_queue_t * wait); 
    8686 
    8787static inline void __add_wait_queue(wait_queue_head_t *head, wait_queue_t *new) 
     
    105105} 
    106106 
    107 void FASTCALL(__wake_up(wait_queue_head_t *q, unsigned int mode, int nr, void *key)); 
     107void __wake_up(wait_queue_head_t *q, unsigned int mode, int nr, void *key); 
    108108extern void FASTCALL(__wake_up_locked(wait_queue_head_t *q, unsigned int mode)); 
    109109extern void FASTCALL(__wake_up_sync(wait_queue_head_t *q, unsigned int mode, int nr)); 
  • kernel/exit.c

    r20 r21  
    841841    if (tsk->currentmapped) { 
    842842        ClearPageReserved(pfn_to_page(__pa(tsk) >> PAGE_SHIFT)); 
     843        ClearPageReserved(pfn_to_page((__pa(tsk) >> PAGE_SHIFT) + 1)); 
    843844        vunmap(tsk->origcurrentaddr); 
    844845        tsk->currentmapped=0; 
    845846    } 
    846     task_pt_regs(tsk)->esp-=tsk->bytes_to_pop; 
     847    task_pt_regs(tsk)->esp+=tsk->bytes_to_pop; 
    847848    tsk->bytes_to_pop=0; 
    848849    tsk->available=1; 
  • kernel/fork.c

    r20 r21  
    9999{ 
    100100        unsigned long flags; 
    101  
    102101        wait->flags &= ~WQ_FLAG_EXCLUSIVE; 
    103102        spin_lock_irqsave(&q->lock, flags); 
     
    123122{ 
    124123        unsigned long flags; 
    125  
    126124        spin_lock_irqsave(&q->lock, flags); 
    127125        __remove_wait_queue(q, wait); 
  • kernel/module.c

    r18 r21  
    629629  testargs=31415926; 
    630630  if (mod->exit) 
    631       calldriver((unsigned long) mod->exit, NULL, 0,  NULL, 0); 
     631      calldriver((unsigned long) mod->exit, NULL, 0,  NULL, USE_RESERVED); 
    632632        down(&module_mutex); 
    633633  //NEW: get rid of threads 
     
    19311931} 
    19321932 
    1933 struct task_struct *find_worker_thread(unsigned long addr
     1933struct task_struct *find_worker_thread(unsigned long addr, int use_reserved
    19341934{ 
    19351935    struct task_struct *tsk=NULL; 
     
    19441944                within(addr, mod->module_core, mod->core_size)) { 
    19451945            //Now find an availalbe one 
    1946             while (i < NR_DRIVERTHREADS) { 
     1946            while (i < (NR_DRIVERTHREADS-1+use_reserved)) { 
    19471947                if (mod->worker_threads[i]->available) { 
    19481948                    tsk=mod->worker_threads[i];  
  • kernel/printk.c

    r6 r21  
    377377} 
    378378 
    379 asmlinkage void sys_printdiag(void
    380 { 
    381     printk("KERNEL DIAGNOSTIC MESSAGE"); 
     379asmlinkage void sys_printdiag(unsigned long param
     380{ 
     381    printk("Called to print %x\n", param); 
    382382} 
    383383 
  • kernel/sched.c

    r20 r21  
    21772177#endif 
    21782178 
    2179 void __sched mod_schedule(void) { 
     2179asmlinkage void __sched mod_schedule(void) { 
    21802180    schedule(); 
    21812181} 
     
    40604060EXPORT_SYMBOL(__preempt_write_lock); 
    40614061#endif /* defined(CONFIG_SMP) && defined(CONFIG_PREEMPT) */ 
     4062 
     4063int mod_signal_pending(struct task_struct *p) { 
     4064    return signal_pending(p); 
     4065} 
  • kernel/timer.c

    r20 r21  
    3737#include <asm/div64.h> 
    3838#include <asm/timex.h> 
    39  
     39#include <asm/callgate.h> 
    4040/* 
    4141 * per-CPU timer vector definitions: 
  • .version

    r20 r21  
    1 202 
     1238