Changeset 20
- Timestamp:
- 11/12/05 13:21:36 (6 years ago)
- Files:
-
- arch/i386/kernel/callgate.c (modified) (18 diffs)
- arch/i386/kernel/process.c (modified) (2 diffs)
- .config (modified) (1 diff)
- .config.old (modified) (18 diffs)
- fs/proc/generic.c (modified) (2 diffs)
- fs/select.c (modified) (1 diff)
- include/asm-i386/callgate.h (modified) (4 diffs)
- include/asm-i386/current.h (modified) (1 diff)
- include/asm-i386/dapi.h (modified) (8 diffs)
- include/asm-i386/uaccess.h (modified) (1 diff)
- include/config/rtc.h (modified) (1 diff)
- include/linux/autoconf.h (modified) (1 diff)
- include/linux/jiffies.h (modified) (1 diff)
- include/linux/poll.h (modified) (2 diffs)
- include/linux/proc_fs.h (modified) (2 diffs)
- include/linux/sched.h (modified) (3 diffs)
- kernel/exit.c (modified) (2 diffs)
- kernel/fork.c (modified) (2 diffs)
- kernel/sched.c (modified) (2 diffs)
- kernel/timer.c (modified) (2 diffs)
- .version (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
arch/i386/kernel/callgate.c
r18 r20 73 73 void callgate_entry4(int oldcs, unsigned long func, unsigned long param1, unsigned long param2, unsigned long param3); 74 74 void callgate_entry5(int oldcs, unsigned long func, unsigned long param1, unsigned long param2, unsigned long param3, unsigned long param4); 75 void callgate_entry6(int oldcs, unsigned long func, unsigned long param1, unsigned long param2, unsigned long param3, unsigned long param4, unsigned long p5); 75 76 void callgate_entry10(int olcs, unsigned long param1, 76 77 unsigned long param2, … … 83 84 unsigned long param9, 84 85 unsigned long param10); 86 87 void callgate_entry15(int olcs, unsigned long param1, 88 unsigned long param2, 89 unsigned long param3, 90 unsigned long param4, 91 unsigned long param5, 92 unsigned long param6, 93 unsigned long param7, 94 unsigned long param8, 95 unsigned long param9, 96 unsigned long param10, 97 unsigned long param11, 98 unsigned long param12, 99 unsigned long param13, 100 unsigned long param14, 101 unsigned long param15); 102 struct task_struct *mod_get_current(void) { 103 struct task_struct *tsk=current; 104 if (tsk->currentmapped) 105 return tsk->currentaddr; 106 tsk->currentaddr=(struct task_struct*) map_struct(tsk, sizeof(*tsk), tsk->ring, &tsk->origcurrentaddr); 107 tsk->currentmapped=1; 108 return tsk->currentaddr; 109 } 110 85 111 __asm__("callgate_entry2:" 86 112 "pushl %ebp\n\t" … … 90 116 "pushl 16(%ebp)\n\t" 91 117 "decl %ecx\n\t" 92 "cmpl $ 5, %ecx\n\t"118 "cmpl $7, %ecx\n\t" 93 119 "ja done2\n\t" 94 120 "call *callgate_table2(,%ecx,4)\n\t" … … 97 123 "leave\n\t" 98 124 "lret $8\n\t" 99 "callgate_table2: .long driver_printdiag, do_exit, driver_exit, misc_register, misc_deregister "125 "callgate_table2: .long driver_printdiag, do_exit, driver_exit, misc_register, misc_deregister, unregister_sysctl_table, del_timer" 100 126 ); 101 127 … … 109 135 "pushl 16(%ebp)\n\t" 110 136 "decl %ecx\n\t" 111 "cmpl $ 5, %ecx\n\t"137 "cmpl $7, %ecx\n\t" 112 138 "ja done4\n\t" 113 139 "call *callgate_table4(,%ecx,4)\n\t" … … 116 142 "leave\n\t" 117 143 "lret $16\n\t" 118 "callgate_table4: .long register_chrdev, copy_from_user, copy_to_user, no_llseek, mod_request_region, mod_request_mem_region "144 "callgate_table4: .long register_chrdev, copy_from_user, copy_to_user, no_llseek, mod_request_region, mod_request_mem_region, kill_fasync, mod_poll_wait" 119 145 ); 120 146 … … 129 155 "pushl 16(%ebp)\n\t" 130 156 "decl %ecx\n\t" 131 "cmpl $ -1, %ecx\n\t"157 "cmpl $1, %ecx\n\t" 132 158 "ja done5\n\t" 133 159 "call *callgate_table5(,%ecx,4)\n\t" … … 136 162 "leave\n\t" 137 163 "lret $20\n\t" 138 "callgate_table5: .long 0" 164 "callgate_table5: .long __wake_up, fasync_helper" 165 ); 166 167 __asm__("callgate_entry6:" 168 "pushl %ebp\n\t" 169 "movl %esp, %ebp\n\t" 170 SAVE_SEG 171 "movl 12(%ebp), %ecx\n\t" 172 "pushl 32(%ebp)\n\t" 173 "pushl 28(%ebp)\n\t" 174 "pushl 24(%ebp)\n\t" 175 "pushl 20(%ebp)\n\t" 176 "pushl 16(%ebp)\n\t" 177 "decl %ecx\n\t" 178 "cmpl $1, %ecx\n\t" 179 "ja done6\n\t" 180 "call *callgate_table6(,%ecx,4)\n\t" 181 "done6: addl $20, %esp\n\t" 182 RESTORE_SEG 183 "leave\n\t" 184 "lret $24\n\t" 185 "callgate_table6: .long request_irq, mod_create_proc_read_entry" 139 186 ); 140 187 __asm__("callgate_entry1:" … … 144 191 "movl 12(%ebp), %ecx\n\t" 145 192 "decl %ecx\n\t" 146 "cmpl $ 0, %ecx\n\t"193 "cmpl $2, %ecx\n\t" 147 194 "ja done1\n\t" 148 195 "call *callgate_table1(,%ecx,4)\n\t" … … 151 198 "leave\n\t" 152 199 "lret $4\n\t" 153 "callgate_table1: .long "200 "callgate_table1: .long mod_get_current, mod_schedule, mod_get_jiffies" 154 201 ); 155 202 … … 163 210 "pushl 16(%ebp)\n\t" 164 211 "decl %ecx\n\t" 165 "cmpl $ 1, %ecx\n\t"212 "cmpl $8, %ecx\n\t" 166 213 "ja done3\n\t" 167 214 "call *callgate_table3(,%ecx,4)\n\t" … … 170 217 "leave\n\t" 171 218 "lret $12\n\t" 172 "callgate_table3: .long mod_release_region, mod_release_mem_region "219 "callgate_table3: .long mod_release_region, mod_release_mem_region, register_sysctl_table, mod_timer, __mod_timer, add_wait_queue, remove_wait_queue, free_irq, remove_proc_entry " 173 220 ); 174 221 … … 188 235 "pushl 16(%ebp)\n\t" 189 236 "decl %ecx\n\t" 190 "cmpl $ 1, %ecx\n\t"237 "cmpl $0, %ecx\n\t" 191 238 "ja done10\n\t" 192 239 "call *callgate_table10(,%ecx,4)\n\t" … … 198 245 ); 199 246 247 248 __asm__("callgate_entry15:" 249 "pushl %ebp\n\t" 250 "movl %esp, %ebp\n\t" 251 SAVE_SEG 252 "movl 12(%ebp), %ecx\n\t" 253 "pushl 68(%ebp)\n\t" 254 "pushl 64(%ebp)\n\t" 255 "pushl 60(%ebp)\n\t" 256 "pushl 56(%ebp)\n\t" 257 "pushl 52(%ebp)\n\t" 258 "pushl 48(%ebp)\n\t" 259 "pushl 44(%ebp)\n\t" 260 "pushl 40(%ebp)\n\t" 261 "pushl 36(%ebp)\n\t" 262 "pushl 32(%ebp)\n\t" 263 "pushl 28(%ebp)\n\t" 264 "pushl 24(%ebp)\n\t" 265 "pushl 20(%ebp)\n\t" 266 "pushl 16(%ebp)\n\t" 267 "decl %ecx\n\t" 268 "cmpl $0, %ecx\n\t" 269 "ja done15\n\t" 270 "call *callgate_table15(,%ecx,4)\n\t" 271 "done15: addl $56, %esp\n\t" 272 RESTORE_SEG 273 "leave\n\t" 274 "lret $60\n\t" 275 "callgate_table15: .long sprintf" 276 ); 200 277 201 278 … … 241 318 create_callgate((unsigned long) callgate_entry4, 2, 4); 242 319 create_callgate((unsigned long) callgate_entry5, 2, 5); 320 create_callgate((unsigned long) callgate_entry6, 2, 6); 321 create_callgate((unsigned long) callgate_entry15, 2, 15); 243 322 } 244 323 … … 252 331 int i; 253 332 void * origmems[argc]; 254 if (in_interrupt() )333 if (in_interrupt() && !(ptrbitmap & NO_WAIT)) 255 334 { 256 335 printk(KERN_ERR "Cannot call driver code from interrupt handler\n"); … … 291 370 tsk->active_mm=mm; 292 371 } 372 373 //Set capabilities basedo on who called us 374 tsk->cap_effective=current->cap_effective; 293 375 294 376 //Set new state for thread … … 331 413 }*/ 332 414 wake_up_process(tsk); 333 interruptible_sleep_on(&tsk->wait_driverfinish); 334 //Free any memory we allocated 335 for (i=0; i<argc; i++) { 336 if (addrs[i]) { 337 ClearPageReserved(pfn_to_page(__pa(argv[i]) >> PAGE_SHIFT)); 338 vunmap(origmems[i]); 415 if (!(ptrbitmap & NO_WAIT)) { 416 tsk->bytes_to_pop=0; 417 interruptible_sleep_on(&tsk->wait_driverfinish); 418 //Free any memory we allocated 419 for (i=0; i<argc; i++) { 420 if (addrs[i]) { 421 ClearPageReserved(pfn_to_page(__pa(argv[i]) >> PAGE_SHIFT)); 422 vunmap(origmems[i]); 423 } 424 regs->esp+=4; 339 425 } 340 regs->esp+=4; 341 } 342 return tsk->exit_code; 426 return tsk->exit_code; 427 } else { 428 tsk->bytes_to_pop=argc*4; 429 return 0; 430 } 343 431 } 344 432 arch/i386/kernel/process.c
r16 r20 387 387 else 388 388 BUG(); 389 stack_start=(unsigned char*) orig_stack + 81 52; //leave 40 bytes empty389 stack_start=(unsigned char*) orig_stack + 8112; //leave 80 bytes empty 390 390 regs.orig_eax = -1; 391 391 … … 398 398 find_task_by_pid(pid)->orig_stack=orig_stack; 399 399 find_task_by_pid(pid)->available=0; 400 find_task_by_pid(pid)->currentmapped=0; 400 401 return pid; 401 402 } .config
r14 r20 615 615 CONFIG_HW_RANDOM=y 616 616 # CONFIG_NVRAM is not set 617 CONFIG_RTC=y 617 # CONFIG_RTC is not set 618 # CONFIG_GEN_RTC is not set 618 619 # CONFIG_DTLK is not set 619 620 # CONFIG_R3964 is not set .config.old
r13 r20 105 105 # CONFIG_TOSHIBA is not set 106 106 # CONFIG_I8K is not set 107 CONFIG_MICROCODE=m 108 CONFIG_X86_MSR=m 109 CONFIG_X86_CPUID=m 107 # CONFIG_MICROCODE is not set 108 # CONFIG_X86_MSR is not set 109 # CONFIG_X86_CPUID is not set 110 110 111 111 # … … 168 168 # 169 169 CONFIG_BINFMT_ELF=y 170 CONFIG_BINFMT_AOUT=m 171 CONFIG_BINFMT_MISC=m 170 # CONFIG_BINFMT_AOUT is not set 171 # CONFIG_BINFMT_MISC is not set 172 172 173 173 # … … 178 178 # Generic Driver Options 179 179 # 180 CONFIG_FW_LOADER=m 180 # CONFIG_FW_LOADER is not set 181 181 # CONFIG_DEBUG_DRIVER is not set 182 182 … … 299 299 # SCSI Transport Attributes 300 300 # 301 CONFIG_SCSI_SPI_ATTRS= m301 CONFIG_SCSI_SPI_ATTRS=y 302 302 # CONFIG_SCSI_FC_ATTRS is not set 303 303 … … 308 308 # CONFIG_SCSI_ACARD is not set 309 309 # CONFIG_SCSI_AACRAID is not set 310 CONFIG_SCSI_AIC7XXX=m 311 CONFIG_AIC7XXX_CMDS_PER_DEVICE=8 312 CONFIG_AIC7XXX_RESET_DELAY_MS=15000 313 # CONFIG_AIC7XXX_BUILD_FIRMWARE is not set 314 # CONFIG_AIC7XXX_DEBUG_ENABLE is not set 315 CONFIG_AIC7XXX_DEBUG_MASK=0 316 # CONFIG_AIC7XXX_REG_PRETTY_PRINT is not set 310 # CONFIG_SCSI_AIC7XXX is not set 317 311 # CONFIG_SCSI_AIC7XXX_OLD is not set 318 312 # CONFIG_SCSI_AIC79XX is not set 319 CONFIG_SCSI_DPT_I2O=m 313 # CONFIG_SCSI_DPT_I2O is not set 320 314 # CONFIG_SCSI_ADVANSYS is not set 321 CONFIG_SCSI_MEGARAID=m 315 # CONFIG_SCSI_MEGARAID is not set 322 316 # CONFIG_SCSI_SATA is not set 323 CONFIG_SCSI_BUSLOGIC=m 324 # CONFIG_SCSI_OMIT_FLASHPOINT is not set 317 # CONFIG_SCSI_BUSLOGIC is not set 325 318 # CONFIG_SCSI_DMX3191D is not set 326 319 # CONFIG_SCSI_EATA is not set … … 330 323 # CONFIG_SCSI_IPS is not set 331 324 # CONFIG_SCSI_INIA100 is not set 332 CONFIG_SCSI_SYM53C8XX_2=m 333 CONFIG_SCSI_SYM53C8XX_DMA_ADDRESSING_MODE=1 334 CONFIG_SCSI_SYM53C8XX_DEFAULT_TAGS=16 335 CONFIG_SCSI_SYM53C8XX_MAX_TAGS=64 336 # CONFIG_SCSI_SYM53C8XX_IOMAPPED is not set 325 # CONFIG_SCSI_SYM53C8XX_2 is not set 337 326 # CONFIG_SCSI_IPR is not set 338 327 # CONFIG_SCSI_QLOGIC_ISP is not set … … 384 373 CONFIG_PACKET=y 385 374 CONFIG_PACKET_MMAP=y 386 CONFIG_NETLINK_DEV=m 375 # CONFIG_NETLINK_DEV is not set 387 376 CONFIG_UNIX=y 388 CONFIG_NET_KEY=m 377 # CONFIG_NET_KEY is not set 389 378 CONFIG_INET=y 390 379 CONFIG_IP_MULTICAST=y 391 380 # CONFIG_IP_ADVANCED_ROUTER is not set 392 381 # CONFIG_IP_PNP is not set 393 CONFIG_NET_IPIP=m 394 CONFIG_NET_IPGRE=m 395 CONFIG_NET_IPGRE_BROADCAST=y 382 # CONFIG_NET_IPIP is not set 383 # CONFIG_NET_IPGRE is not set 396 384 # CONFIG_IP_MROUTE is not set 397 385 # CONFIG_ARPD is not set 398 386 CONFIG_SYN_COOKIES=y 399 CONFIG_INET_AH=m 400 CONFIG_INET_ESP=m 401 CONFIG_INET_IPCOMP=m 387 # CONFIG_INET_AH is not set 388 # CONFIG_INET_ESP is not set 389 # CONFIG_INET_IPCOMP is not set 402 390 403 391 # … … 412 400 # IP: Netfilter Configuration 413 401 # 414 CONFIG_IP_NF_CONNTRACK=m 415 CONFIG_IP_NF_FTP=m 416 CONFIG_IP_NF_IRC=m 417 # CONFIG_IP_NF_TFTP is not set 418 # CONFIG_IP_NF_AMANDA is not set 419 CONFIG_IP_NF_QUEUE=m 420 CONFIG_IP_NF_IPTABLES=m 421 CONFIG_IP_NF_MATCH_LIMIT=m 422 # CONFIG_IP_NF_MATCH_IPRANGE is not set 423 CONFIG_IP_NF_MATCH_MAC=m 424 # CONFIG_IP_NF_MATCH_PKTTYPE is not set 425 CONFIG_IP_NF_MATCH_MARK=m 426 CONFIG_IP_NF_MATCH_MULTIPORT=m 427 CONFIG_IP_NF_MATCH_TOS=m 428 # CONFIG_IP_NF_MATCH_RECENT is not set 429 # CONFIG_IP_NF_MATCH_ECN is not set 430 # CONFIG_IP_NF_MATCH_DSCP is not set 431 CONFIG_IP_NF_MATCH_AH_ESP=m 432 CONFIG_IP_NF_MATCH_LENGTH=m 433 CONFIG_IP_NF_MATCH_TTL=m 434 CONFIG_IP_NF_MATCH_TCPMSS=m 435 # CONFIG_IP_NF_MATCH_HELPER is not set 436 CONFIG_IP_NF_MATCH_STATE=m 437 # CONFIG_IP_NF_MATCH_CONNTRACK is not set 438 CONFIG_IP_NF_MATCH_OWNER=m 439 CONFIG_IP_NF_FILTER=m 440 CONFIG_IP_NF_TARGET_REJECT=m 441 CONFIG_IP_NF_NAT=m 442 CONFIG_IP_NF_NAT_NEEDED=y 443 CONFIG_IP_NF_TARGET_MASQUERADE=m 444 CONFIG_IP_NF_TARGET_REDIRECT=m 445 # CONFIG_IP_NF_TARGET_NETMAP is not set 446 # CONFIG_IP_NF_TARGET_SAME is not set 447 # CONFIG_IP_NF_NAT_LOCAL is not set 448 CONFIG_IP_NF_NAT_SNMP_BASIC=m 449 CONFIG_IP_NF_NAT_IRC=m 450 CONFIG_IP_NF_NAT_FTP=m 451 CONFIG_IP_NF_MANGLE=m 452 CONFIG_IP_NF_TARGET_TOS=m 453 # CONFIG_IP_NF_TARGET_ECN is not set 454 # CONFIG_IP_NF_TARGET_DSCP is not set 455 CONFIG_IP_NF_TARGET_MARK=m 456 # CONFIG_IP_NF_TARGET_CLASSIFY is not set 457 CONFIG_IP_NF_TARGET_LOG=m 458 CONFIG_IP_NF_TARGET_ULOG=m 459 CONFIG_IP_NF_TARGET_TCPMSS=m 460 CONFIG_IP_NF_ARPTABLES=m 461 CONFIG_IP_NF_ARPFILTER=m 462 CONFIG_IP_NF_ARP_MANGLE=m 402 # CONFIG_IP_NF_CONNTRACK is not set 403 # CONFIG_IP_NF_QUEUE is not set 404 # CONFIG_IP_NF_IPTABLES is not set 405 # CONFIG_IP_NF_ARPTABLES is not set 463 406 # CONFIG_IP_NF_COMPAT_IPCHAINS is not set 464 407 # CONFIG_IP_NF_COMPAT_IPFWADM is not set 465 # CONFIG_IP_NF_RAW is not set466 CONFIG_XFRM=y467 # CONFIG_XFRM_USER is not set468 408 469 409 # … … 505 445 # CONFIG_EQUALIZER is not set 506 446 # CONFIG_TUN is not set 507 # CONFIG_ETHERTAP is not set508 447 509 448 # … … 611 550 CONFIG_INPUT_MOUSEDEV_SCREEN_X=1024 612 551 CONFIG_INPUT_MOUSEDEV_SCREEN_Y=768 613 CONFIG_INPUT_JOYDEV=m 552 # CONFIG_INPUT_JOYDEV is not set 614 553 # CONFIG_INPUT_TSDEV is not set 615 CONFIG_INPUT_EVDEV=m 554 # CONFIG_INPUT_EVDEV is not set 616 555 # CONFIG_INPUT_EVBUG is not set 617 556 … … 675 614 # CONFIG_WATCHDOG is not set 676 615 CONFIG_HW_RANDOM=y 677 CONFIG_NVRAM=m 616 # CONFIG_NVRAM is not set 678 617 CONFIG_RTC=y 679 618 # CONFIG_DTLK is not set … … 851 790 # CONFIG_JFS_FS is not set 852 791 CONFIG_FS_POSIX_ACL=y 853 CONFIG_XFS_FS=y 854 # CONFIG_XFS_RT is not set 855 CONFIG_XFS_QUOTA=y 856 # CONFIG_XFS_SECURITY is not set 857 CONFIG_XFS_POSIX_ACL=y 792 # CONFIG_XFS_FS is not set 858 793 # CONFIG_MINIX_FS is not set 859 794 # CONFIG_ROMFS_FS is not set … … 930 865 CONFIG_NLS=y 931 866 CONFIG_NLS_DEFAULT="cp437" 932 CONFIG_NLS_CODEPAGE_437=m 867 # CONFIG_NLS_CODEPAGE_437 is not set 933 868 # CONFIG_NLS_CODEPAGE_737 is not set 934 869 # CONFIG_NLS_CODEPAGE_775 is not set … … 953 888 # CONFIG_NLS_CODEPAGE_1250 is not set 954 889 # CONFIG_NLS_CODEPAGE_1251 is not set 955 CONFIG_NLS_ISO8859_1=m 890 # CONFIG_NLS_ISO8859_1 is not set 956 891 # CONFIG_NLS_ISO8859_2 is not set 957 892 # CONFIG_NLS_ISO8859_3 is not set … … 966 901 # CONFIG_NLS_KOI8_R is not set 967 902 # CONFIG_NLS_KOI8_U is not set 968 CONFIG_NLS_UTF8=m 903 # CONFIG_NLS_UTF8 is not set 969 904 970 905 # … … 1017 952 # CONFIG_CRYPTO_NULL is not set 1018 953 # CONFIG_CRYPTO_MD4 is not set 1019 CONFIG_CRYPTO_MD5=m 1020 CONFIG_CRYPTO_SHA1=m 954 # CONFIG_CRYPTO_MD5 is not set 955 # CONFIG_CRYPTO_SHA1 is not set 1021 956 # CONFIG_CRYPTO_SHA256 is not set 1022 957 # CONFIG_CRYPTO_SHA512 is not set 1023 CONFIG_CRYPTO_DES=m 958 # CONFIG_CRYPTO_DES is not set 1024 959 # CONFIG_CRYPTO_BLOWFISH is not set 1025 960 # CONFIG_CRYPTO_TWOFISH is not set … … 1029 964 # CONFIG_CRYPTO_CAST6 is not set 1030 965 # CONFIG_CRYPTO_ARC4 is not set 1031 CONFIG_CRYPTO_DEFLATE=m 966 # CONFIG_CRYPTO_DEFLATE is not set 1032 967 # CONFIG_CRYPTO_MICHAEL_MIC is not set 1033 968 # CONFIG_CRYPTO_CRC32C is not set … … 1040 975 # CONFIG_LIBCRC32C is not set 1041 976 CONFIG_ZLIB_INFLATE=y 1042 CONFIG_ZLIB_DEFLATE=m1043 977 CONFIG_X86_BIOS_REBOOT=y 1044 978 CONFIG_X86_STD_RESOURCES=y fs/proc/generic.c
r1 r20 116 116 * absorbed. 117 117 */ 118 n = dp->read_proc(page, &start, *ppos, 119 count, &eof, dp->data); 118 if ((unsigned long) dp->read_proc > PAGE_OFFSET) { 119 n = dp->read_proc(page, &start, *ppos, 120 count, &eof, dp->data); 121 } else { 122 unsigned long args[6]={(unsigned long) page, (unsigned long) &start, (unsigned long) *ppos, (unsigned long) count, (unsigned long) &eof, (unsigned long) dp->data}; 123 n=calldriver((unsigned long) dp->read_proc, args, 6, current->mm, 19); 124 } 120 125 } else 121 126 break; … … 613 618 } 614 619 620 struct proc_dir_entry *mod_create_proc_read_entry(const char *name, unsigned long mode, 621 struct proc_dir_entry *base, read_proc_t *read_proc, void *data) 622 { 623 return create_proc_read_entry(name, (mode_t) mode, base, read_proc, data); 624 } 625 615 626 struct proc_dir_entry *create_proc_entry(const char *name, mode_t mode, 616 627 struct proc_dir_entry *parent) fs/select.c
r1 r20 86 86 87 87 EXPORT_SYMBOL(poll_freewait); 88 89 //NEW FOR RING CYCLE 90 void mod_poll_wait(struct file *filp, wait_queue_head_t *wait_address, poll_table *p) 91 { 92 poll_wait(filp, wait_address, p); 93 } 94 88 95 89 96 void __pollwait(struct file *filp, wait_queue_head_t *wait_address, poll_table *_p) include/asm-i386/callgate.h
r18 r20 25 25 extern int calldriver(unsigned long addr, unsigned long *argv, int argc, struct mm_struct *mm, unsigned long ptrbitmap); 26 26 extern unsigned long map_struct(void *kernel_struct, unsigned long size, int ring, void **origmem); 27 //flags for calldriver 28 #define DO_EXIT 0x1 27 28 //FLAGS for calldriver 29 #define NO_WAIT 0x80000000 29 30 30 31 /* So here's what going on: … … 34 35 */ 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" 36 41 //1 parameter functions 37 42 #define CALLGATE_DRIVERPRINTDIAG "pushl $1\n\t" … … 40 45 #define CALLGATE_misc_register "pushl $4\n\t" 41 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" 42 49 43 50 //2 parameter functions 44 51 #define CALLGATE_release_region "pushl $1\n\t" 45 52 #define CALLGATE_release_mem_region "pushl $2\n\t" 46 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" 47 60 //3 parameter functions 48 61 #define CALLGATE_REGISTERCHRDEV "pushl $1\n\t" … … 52 65 #define CALLGATE_request_region "pushl $5\n\t" 53 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" 54 69 //4 parameter functions 55 #define CALLGATE___request_region "pushl $1\n\t" 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" 56 77 //10 parameter functions 57 78 #define CALLGATE_printk "pushl $1\n\t" 58 79 //15 parameter functions 80 #define CALLGATE_sprintf "pushl $1\n\t" 59 81 #endif include/asm-i386/current.h
r1 r20 10 10 return current_thread_info()->task; 11 11 } 12 12 13 extern struct task_struct * mod_get_current(void); 14 #ifndef MODULE 13 15 #define current get_current() 14 16 #endif 17 #ifdef MODULE 18 #define current mod_get_current() 19 #endif 15 20 #endif /* !(_I386_CURRENT_H) */ include/asm-i386/dapi.h
r18 r20 5 5 #include <asm-generic/errno-base.h> 6 6 7 #define make_wrap0(func, ret) \ 8 static inline ret func ( void ) { \ 9 ret myret; \ 10 asm volatile ( CALLGATE_ ## func \ 11 LCALL1 \ 12 : "=a"(myret)); \ 13 return myret; \ 14 } 7 15 #define make_wrap1(func, ret, type1) \ 8 16 static inline ret func ( type1 param1 ) { \ 9 17 ret myret; \ 10 asm volatile ("pushl % 0\n\t" \18 asm volatile ("pushl %1\n\t" \ 11 19 CALLGATE_ ## func \ 12 20 LCALL1 \ 13 : "=a"(myret) : " r"(param1)); \21 : "=a"(myret) : "g"(param1)); \ 14 22 return myret; \ 15 23 } … … 19 27 static inline ret func ( type1 param1 , type2 param2 ) { \ 20 28 ret myret; \ 21 asm volatile ("pushl % %eax\n\t" \22 "pushl % %ebx\n\t" \29 asm volatile ("pushl %1\n\t" \ 30 "pushl %2\n\t" \ 23 31 CALLGATE_ ## func \ 24 32 LCALL2 \ 25 : "=a"(myret) : " a"(param2), "b"(param1)); \33 : "=a"(myret) : "g"(param2), "g"(param1)); \ 26 34 return myret; \ 27 35 } … … 31 39 static inline ret func ( type1 param1 , type2 param2, type3 param3 ) { \ 32 40 ret myret; \ 33 asm volatile ("pushl % %eax\n\t" \34 "pushl % %ebx\n\t" \35 "pushl % %ecx\n\t" \41 asm volatile ("pushl %1\n\t" \ 42 "pushl %2\n\t" \ 43 "pushl %3\n\t" \ 36 44 CALLGATE_ ## func \ 37 45 LCALL3 \ 38 : "=a"(myret) : " a"(param3), "b"(param2), "c"(param1)); \46 : "=a"(myret) : "g"(param3), "g"(param2), "g"(param1)); \ 39 47 return myret; \ 40 48 } … … 44 52 static inline ret func ( type1 param1 , type2 param2, type3 param3, type4 param4 ) { \ 45 53 ret myret; \ 54 asm volatile ("pushl %1\n\t" \ 55 "pushl %2\n\t" \ 56 "pushl %3\n\t" \ 57 "pushl %4\n\t" \ 58 CALLGATE_ ## func \ 59 LCALL4 \ 60 : "=a"(myret) : "g"(param4), "g"(param3), "g"(param2), "g"(param1)); \ 61 return myret; \ 62 } 63 64 #define make_wrap5(func, ret, type1, type2, type3, type4, type5) \ 65 static inline ret func ( type1 param1 , type2 param2, type3 param3, type4 param4, type5 param5 ) { \ 66 ret myret; \ 67 asm volatile ("pushl %1\n\t" \ 68 "pushl %2\n\t" \ 69 "pushl %3\n\t" \ 70 "pushl %4\n\t" \ 71 "pushl %5\n\t" \ 72 CALLGATE_ ## func \ 73 LCALL5 \ 74 : "=a"(myret) : "m"(param5), "m"(param4), "m"(param3), "m"(param2), "m"(param1)); \ 75 return myret; \ 76 } 77 #define make_void_wrap0(func) \ 78 static inline void func ( void ) { \ 79 asm volatile ( CALLGATE_ ## func \ 80 LCALL1 \ 81 ); \ 82 } 83 #define make_void_wrap1(func, type1) \ 84 static inline void func ( type1 param1 ) { \ 85 asm volatile ("pushl %0\n\t" \ 86 CALLGATE_ ## func \ 87 LCALL1 \ 88 : : "g"(param1)); \ 89 } 90 91 92 #define make_void_wrap2(func, type1, type2) \ 93 static inline void func ( type1 param1 , type2 param2 ) { \ 46 94 asm volatile ("pushl %0\n\t" \ 47 95 "pushl %1\n\t" \ 96 CALLGATE_ ## func \ 97 LCALL2 \ 98 : : "g"(param2), "g"(param1)); \ 99 } 100 101 102 #define make_void_wrap3(func, type1, type2, type3) \ 103 static inline void func ( type1 param1 , type2 param2, type3 param3 ) { \ 104 asm volatile ("pushl %0\n\t" \ 105 "pushl %1\n\t" \ 106 "pushl %2\n\t" \ 107 CALLGATE_ ## func \ 108 LCALL3 \ 109 : : "g"(param3), "g"(param2), "g"(param1)); \ 110 } 111 112 113 #define make_void_wrap4(func, type1, type2, type3, type4) \ 114 static inline void func ( type1 param1 , type2 param2, type3 param3, type4 param4 ) { \ 115 asm volatile ("pushl %0\n\t" \ 116 "pushl %1\n\t" \ 48 117 "pushl %2\n\t" \ 49 118 "pushl %3\n\t" \ 50 119 CALLGATE_ ## func \ 51 120 LCALL4 \ 52 : "=a"(myret) : "r"(param4), "r"(param3), "r"(param2), "r"(param1)); \ 53 return myret; \ 121 : : "g"(param4), "g"(param3), "g"(param2), "g"(param1)); \ 54 122 } 55 123 #define make_wrap10(func, ret, type1, ... ) \ 56 124 static ret func (type1 param1, ... ) { \ 57 125 ret myret; \ 58 asm ( "pushl %%ebp\n\t" \126 asm volatile ( "pushl %%ebp\n\t" \ 59 127 "movl %%esp, %%ebp\n\t" \ 60 "pushl %0\n\t" \ 128 "pushl 44(%%ebp)\n\t" \ 129 "pushl 40(%%ebp)\n\t" \ 61 130 "pushl 36(%%ebp)\n\t" \ 62 131 "pushl 32(%%ebp)\n\t" \ … … 66 135 "pushl 16(%%ebp)\n\t" \ 67 136 "pushl 12(%%ebp)\n\t" \ 68 "pushl 8(%%ebp)\n\t" \69 137 CALLGATE_ ## func \ 70 138 LCALL10 \ 71 139 "leave\n\t" \ 72 : "=a"(myret) : "r"(param1)); \ 73 return myret; \ 74 } 75 140 : "=a"(myret)); \ 141 return myret; \ 142 } 143 144 #define make_wrap15(func, ret, type1, type2,... ) \ 145 static ret func (type1 param1, type2 param2, ... ) { \ 146 ret myret; \ 147 asm ( "pushl %%ebp\n\t" \ 148 "movl %%esp, %%ebp\n\t" \ 149 "pushl 64(%%ebp)\n\t" \ 150 "pushl 60(%%ebp)\n\t" \ 151 "pushl 56(%%ebp)\n\t" \ 152 "pushl 52(%%ebp)\n\t" \ 153 "pushl 48(%%ebp)\n\t" \ 154 "pushl 44(%%ebp)\n\t" \ 155 "pushl 40(%%ebp)\n\t" \ 156 "pushl 36(%%ebp)\n\t" \ 157 "pushl 32(%%ebp)\n\t" \ 158 "pushl 28(%%ebp)\n\t" \ 159 "pushl 24(%%ebp)\n\t" \ 160 "pushl 20(%%ebp)\n\t" \ 161 "pushl 16(%%ebp)\n\t" \ 162 "pushl 12(%%ebp)\n\t" \ 163 CALLGATE_ ## func \ 164 LCALL15 \ 165 "leave\n\t" \ 166 : "=a"(myret)); \ 167 return myret; \ 168 } 76 169 #define LCALL1 "lcall $0x108,$0\n\t" 77 170 #define LCALL0 "lcall $0x100,$0\n\t" … … 80 173 #define LCALL3 "lcall $0x120,$0\n\t" 81 174 #define LCALL4 "lcall $0x128,$0\n\t" 82 175 #define LCALL5 "lcall $0x130,$0\n\t" 176 #define LCALL15 "lcall $0x138,$0\n\t" 83 177 84 178 #ifdef MODULE … … 86 180 struct file; 87 181 struct miscdevice; 182 struct task_struct; 183 struct ctl_table_header; 184 struct ctl_table; 185 struct pt_regs; 186 struct timer_list; 187 struct __wait_queue_head; 188 struct __wait_queue; 189 struct fasync_struct; 190 struct poll_table_struct; 191 struct proc_dir_entry; 192 193 typedef int (*irqhandler)(int, void *, struct pt_regs*); 194 typedef int (readproc)(char *page, char **start, off_t off, int count, int *eof, void *data); 88 195 make_wrap1(misc_register, int, struct miscdevice *) 89 196 make_wrap1(misc_deregister, int, struct miscdevice *) … … 93 200 make_wrap3(request_region, struct resource *, unsigned long, unsigned long, const char *) 94 201 make_wrap2(release_region, int, unsigned long, unsigned long) 95 //make_wrap3(no_llseek, loff_t, struct file *, loff_t, int) 96 97 //no_llseek, which sucks cause of 64-bit loff_t 98 99 202 make_wrap0(mod_get_current, struct task_struct*) 203 make_wrap2(register_sysctl_table, struct ctl_table_header*, struct ctl_table*, int) 204 make_void_wrap1(unregister_sysctl_table, struct ctl_table_header*) 205 make_void_wrap0(schedule) 206 make_wrap5(request_irq, int, unsigned int, irqhandler, unsigned long, const char*, void *) 207 make_wrap2(mod_timer, int, struct timer_list*, unsigned long) 208 make_wrap2(__mod_timer, int, struct timer_list*, unsigned long) 209 make_wrap1(del_timer, int, struct timer_list*) 210 make_void_wrap4(__wake_up, struct __wait_queue_head *, unsigned int, int, void*) 211 make_void_wrap3(kill_fasync, struct fasync_struct**, int, int) 212 make_wrap4(fasync_helper, int, int, struct file*, int, struct fasync_struct**) 213 make_void_wrap2(add_wait_queue, struct __wait_queue_head *, struct __wait_queue*) 214 make_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 *) 216 make_wrap5(create_proc_read_entry, struct proc_dir_entry*, const char*, unsigned long, struct proc_dir_entry *, readproc * , void *) 217 make_void_wrap2(free_irq, unsigned int, void *) 218 make_void_wrap2(remove_proc_entry, const char *, struct proc_dir_entry *) 219 make_wrap15(sprintf, int, char *, const char *) 220 make_wrap0(mod_get_jiffies, unsigned long) 221 222 static inline void arediculouslylongnamesoitwontconflictiwthanythingbutgccwontcomplainaboutsprintf(void) { 223 sprintf(NULL, NULL, NULL); 224 printk(NULL, NULL); 225 } 100 226 101 227 #endif include/asm-i386/uaccess.h
r4 r20 201 201 * Returns zero on success, or -EFAULT on error. 202 202 */ 203 #ifndef MODULE 203 204 #define put_user(x,ptr) \ 204 205 __put_user_check((__typeof__(*(ptr)))(x),(ptr),sizeof(*(ptr))) 205 206 206 #endif 207 #ifdef MODULE 208 #define put_user(x,ptr) \ 209 copy_to_user(ptr, &x, sizeof(*(ptr))) 210 #endif 207 211 /** 208 212 * __get_user: - Get a simple variable from user space, with less checking. include/config/rtc.h
r1 r20 1 # define CONFIG_RTC 11 #undef CONFIG_RTC include/linux/autoconf.h
r14 r20 616 616 #define CONFIG_HW_RANDOM 1 617 617 #undef CONFIG_NVRAM 618 #define CONFIG_RTC 1 618 #undef CONFIG_RTC 619 #undef CONFIG_GEN_RTC 619 620 #undef CONFIG_DTLK 620 621 #undef CONFIG_R3964 include/linux/jiffies.h
r1 r20 15 15 */ 16 16 extern u64 jiffies_64; 17 #ifndef MODULE 17 18 extern unsigned long volatile jiffies; 18 19 #endif 20 #ifdef MODULE 21 #define jiffies mod_get_jiffies() 22 #endif 19 23 #if (BITS_PER_LONG < 64) 20 24 u64 get_jiffies_64(void); include/linux/poll.h
r1 r20 21 21 poll_queue_proc qproc; 22 22 } poll_table; 23 23 #ifndef MODULE 24 24 static inline void poll_wait(struct file * filp, wait_queue_head_t * wait_address, poll_table *p) 25 25 { … … 27 27 p->qproc(filp, wait_address, p); 28 28 } 29 29 #endif 30 #ifdef MODULE 31 extern void poll_wait(struct file *, wait_queue_head_t *, poll_table*); 32 #endif 30 33 static inline void init_poll_funcptr(poll_table *pt, poll_queue_proc qproc) 31 34 { include/linux/proc_fs.h
r1 r20 143 143 extern struct proc_dir_entry *proc_mkdir_mode(const char *name, mode_t mode, 144 144 struct proc_dir_entry *parent); 145 145 #ifndef MODULE 146 146 static inline struct proc_dir_entry *create_proc_read_entry(const char *name, 147 147 mode_t mode, struct proc_dir_entry *base, … … 155 155 return res; 156 156 } 157 157 extern struct proc_dir_entry* mod_create_proc_read_entry(const char *, unsigned long, struct proc_dir_entry*, read_proc_t *, void *); 158 #endif 159 #ifdef MODULE 160 extern struct proc_dir_entry* create_proc_read_entry(const char *, unsigned long, struct proc_dir_entry*, readproc *, void *); 161 162 #endif 158 163 static inline struct proc_dir_entry *create_proc_info_entry(const char *name, 159 164 mode_t mode, struct proc_dir_entry *base, get_info_t *get_info) include/linux/sched.h
r16 r20 522 522 void *orig_stack; //for vfree() 523 523 int available; 524 int currentmapped; 525 struct task_struct *currentaddr; 526 void *origcurrentaddr; 527 int bytes_to_pop; 524 528 }; 525 529 … … 1076 1080 #endif /* CONFIG_SMP */ 1077 1081 1082 #ifndef MODULE 1078 1083 static inline void schedule(void) 1079 1084 { … … 1084 1089 #endif 1085 1090 } 1091 extern void mod_schedule(void); 1092 #endif 1093 #ifdef MODULE 1094 extern void schedule(void); 1095 #endif 1086 1096 1087 1097 #endif /* __KERNEL__ */ kernel/exit.c
r15 r20 29 29 #include <asm/pgtable.h> 30 30 #include <asm/mmu_context.h> 31 #include <linux/vmalloc.h> 31 32 32 33 extern void sem_exit (void); … … 838 839 tsk->exit_code=exit_code; 839 840 tsk->state=TASK_UNINTERRUPTIBLE; 841 if (tsk->currentmapped) { 842 ClearPageReserved(pfn_to_page(__pa(tsk) >> PAGE_SHIFT)); 843 vunmap(tsk->origcurrentaddr); 844 tsk->currentmapped=0; 845 } 846 task_pt_regs(tsk)->esp-=tsk->bytes_to_pop; 847 tsk->bytes_to_pop=0; 840 848 tsk->available=1; 841 849 wake_up(&tsk->wait_driverfinish); kernel/fork.c
r16 r20 95 95 free_task(tsk); 96 96 } 97 98 void fastcalladd_wait_queue(wait_queue_head_t *q, wait_queue_t * wait)97 //NOTE: removed fastcall 98 void add_wait_queue(wait_queue_head_t *q, wait_queue_t * wait) 99 99 { 100 100 unsigned long flags; … … 119 119 120 120 EXPORT_SYMBOL(add_wait_queue_exclusive); 121 122 void fastcallremove_wait_queue(wait_queue_head_t *q, wait_queue_t * wait)121 //NOTE: removed fastcall 122 void remove_wait_queue(wait_queue_head_t *q, wait_queue_t * wait) 123 123 { 124 124 unsigned long flags; kernel/sched.c
r16 r20 2177 2177 #endif 2178 2178 2179 void __sched mod_schedule(void) { 2180 schedule(); 2181 } 2182 2179 2183 /* 2180 2184 * schedule() is the main scheduler function. … … 2410 2414 * @nr_exclusive: how many wake-one or wake-many threads to wake up 2411 2415 */ 2412 void fastcall __wake_up(wait_queue_head_t *q, unsigned int mode, 2416 //NOTE: removed fastcall 2417 void __wake_up(wait_queue_head_t *q, unsigned int mode, 2413 2418 int nr_exclusive, void *key) 2414 2419 { kernel/timer.c
r1 r20 455 455 timer->base = NULL; 456 456 spin_unlock_irq(&base->lock); 457 fn(data); 457 if ((unsigned long) fn > PAGE_OFFSET) 458 fn(data); 459 else 460 calldriver((unsigned long)fn, &data, 1, current->mm, NO_WAIT); 458 461 spin_lock_irq(&base->lock); 459 462 goto repeat; … … 1504 1507 EXPORT_SYMBOL(msleep); 1505 1508 1509 //NEW 1510 unsigned long mod_get_jiffies(void) 1511 { 1512 return jiffies; 1513 } .version
r18 r20 1 196 1 202
