From e3fe9444136685c78a1200f288e541fd8dc0a210 Mon Sep 17 00:00:00 2001 From: "David S. Miller" Date: Mon, 3 Jun 2002 23:44:18 -0700 Subject: Bonding driver: Merge 2.4.x driver updates into 2.5. --- include/linux/if_bonding.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'include/linux') diff --git a/include/linux/if_bonding.h b/include/linux/if_bonding.h index 97d490fd8dd8..a263da6bd01c 100644 --- a/include/linux/if_bonding.h +++ b/include/linux/if_bonding.h @@ -51,7 +51,7 @@ #define BOND_STATE_ACTIVE 0 /* link is active */ #define BOND_STATE_BACKUP 1 /* link is backup */ -#define MAX_BONDS 1 /* Maximum number of devices to support */ +#define BOND_DEFAULT_MAX_BONDS 1 /* Default maximum number of devices to support */ typedef struct ifbond { __s32 bond_mode; @@ -76,6 +76,7 @@ typedef struct slave { short delay; char link; /* one of BOND_LINK_XXXX */ char state; /* one of BOND_STATE_XXXX */ + unsigned short original_flags; u32 link_failure_count; } slave_t; @@ -104,6 +105,8 @@ typedef struct bonding { #endif /* CONFIG_PROC_FS */ struct bonding *next_bond; struct net_device *device; + struct dev_mc_list *mc_list; + unsigned short flags; } bonding_t; #endif /* __KERNEL__ */ -- cgit v1.2.3 From 7f9efd7d0fc6d0fc8caff52872629e36e212fb3c Mon Sep 17 00:00:00 2001 From: Pavel Machek Date: Tue, 4 Jun 2002 23:42:40 -0700 Subject: [PATCH] 2.5.20 swsusp: stop abusing headers with non-inlined functions swsusp kind-of abused include/asm-i386/suspend.h for stuff that belonged to arch/i386/kernel/suspend.c. This moves code where it belongs. Pavel --- arch/i386/kernel/suspend.c | 256 ++++++++++++++++++++++++++++++++++++++++++++ include/asm-i386/suspend.h | 258 +-------------------------------------------- include/linux/suspend.h | 4 + kernel/suspend.c | 12 +-- 4 files changed, 269 insertions(+), 261 deletions(-) (limited to 'include/linux') diff --git a/arch/i386/kernel/suspend.c b/arch/i386/kernel/suspend.c index 07f966251209..be913bbd16f6 100644 --- a/arch/i386/kernel/suspend.c +++ b/arch/i386/kernel/suspend.c @@ -24,8 +24,156 @@ #include #include #include +#include +static struct saved_context saved_context; + +/* + * save_processor_context + * + * Save the state of the processor before we go to sleep. + * + * return_stack is the value of the stack pointer (%esp) as the caller sees it. + * A good way could not be found to obtain it from here (don't want to make _too_ + * many assumptions about the layout of the stack this far down.) Also, the + * handy little __builtin_frame_pointer(level) where level > 0, is blatantly + * buggy - it returns the value of the stack at the proper location, not the + * location, like it should (as of gcc 2.91.66) + * + * Note that the context and timing of this function is pretty critical. + * With a minimal amount of things going on in the caller and in here, gcc + * does a good job of being just a dumb compiler. Watch the assembly output + * if anything changes, though, and make sure everything is going in the right + * place. + */ +static inline void save_processor_context (void) +{ + kernel_fpu_begin(); + + /* + * descriptor tables + */ + asm volatile ("sgdt (%0)" : "=m" (saved_context.gdt_limit)); + asm volatile ("sidt (%0)" : "=m" (saved_context.idt_limit)); + asm volatile ("sldt (%0)" : "=m" (saved_context.ldt)); + asm volatile ("str (%0)" : "=m" (saved_context.tr)); + + /* + * save the general registers. + * note that gcc has constructs to specify output of certain registers, + * but they're not used here, because it assumes that you want to modify + * those registers, so it tries to be smart and save them beforehand. + * It's really not necessary, and kinda fishy (check the assembly output), + * so it's avoided. + */ + asm volatile ("movl %%esp, (%0)" : "=m" (saved_context.esp)); + asm volatile ("movl %%eax, (%0)" : "=m" (saved_context.eax)); + asm volatile ("movl %%ebx, (%0)" : "=m" (saved_context.ebx)); + asm volatile ("movl %%ecx, (%0)" : "=m" (saved_context.ecx)); + asm volatile ("movl %%edx, (%0)" : "=m" (saved_context.edx)); + asm volatile ("movl %%ebp, (%0)" : "=m" (saved_context.ebp)); + asm volatile ("movl %%esi, (%0)" : "=m" (saved_context.esi)); + asm volatile ("movl %%edi, (%0)" : "=m" (saved_context.edi)); + + /* + * segment registers + */ + asm volatile ("movw %%es, %0" : "=r" (saved_context.es)); + asm volatile ("movw %%fs, %0" : "=r" (saved_context.fs)); + asm volatile ("movw %%gs, %0" : "=r" (saved_context.gs)); + asm volatile ("movw %%ss, %0" : "=r" (saved_context.ss)); + + /* + * control registers + */ + asm volatile ("movl %%cr0, %0" : "=r" (saved_context.cr0)); + asm volatile ("movl %%cr2, %0" : "=r" (saved_context.cr2)); + asm volatile ("movl %%cr3, %0" : "=r" (saved_context.cr3)); + asm volatile ("movl %%cr4, %0" : "=r" (saved_context.cr4)); + + /* + * eflags + */ + asm volatile ("pushfl ; popl (%0)" : "=m" (saved_context.eflags)); +} + +/* + * restore_processor_context + * + * Restore the processor context as it was before we went to sleep + * - descriptor tables + * - control registers + * - segment registers + * - flags + * + * Note that it is critical that this function is declared inline. + * It was separated out from restore_state to make that function + * a little clearer, but it needs to be inlined because we won't have a + * stack when we get here (so we can't push a return address). + */ +static inline void restore_processor_context (void) +{ + /* + * first restore %ds, so we can access our data properly + */ + asm volatile (".align 4"); + asm volatile ("movw %0, %%ds" :: "r" ((u16)__KERNEL_DS)); + + + /* + * control registers + */ + asm volatile ("movl %0, %%cr4" :: "r" (saved_context.cr4)); + asm volatile ("movl %0, %%cr3" :: "r" (saved_context.cr3)); + asm volatile ("movl %0, %%cr2" :: "r" (saved_context.cr2)); + asm volatile ("movl %0, %%cr0" :: "r" (saved_context.cr0)); + + /* + * segment registers + */ + asm volatile ("movw %0, %%es" :: "r" (saved_context.es)); + asm volatile ("movw %0, %%fs" :: "r" (saved_context.fs)); + asm volatile ("movw %0, %%gs" :: "r" (saved_context.gs)); + asm volatile ("movw %0, %%ss" :: "r" (saved_context.ss)); + + /* + * the other general registers + * + * note that even though gcc has constructs to specify memory + * input into certain registers, it will try to be too smart + * and save them at the beginning of the function. This is esp. + * bad since we don't have a stack set up when we enter, and we + * want to preserve the values on exit. So, we set them manually. + */ + asm volatile ("movl %0, %%esp" :: "m" (saved_context.esp)); + asm volatile ("movl %0, %%ebp" :: "m" (saved_context.ebp)); + asm volatile ("movl %0, %%eax" :: "m" (saved_context.eax)); + asm volatile ("movl %0, %%ebx" :: "m" (saved_context.ebx)); + asm volatile ("movl %0, %%ecx" :: "m" (saved_context.ecx)); + asm volatile ("movl %0, %%edx" :: "m" (saved_context.edx)); + asm volatile ("movl %0, %%esi" :: "m" (saved_context.esi)); + asm volatile ("movl %0, %%edi" :: "m" (saved_context.edi)); + + /* + * now restore the descriptor tables to their proper values + * ltr is done i fix_processor_context(). + */ + asm volatile ("lgdt (%0)" :: "m" (saved_context.gdt_limit)); + asm volatile ("lidt (%0)" :: "m" (saved_context.idt_limit)); + asm volatile ("lldt (%0)" :: "m" (saved_context.ldt)); + + fix_processor_context(); + + /* + * the flags + */ + asm volatile ("pushl %0 ; popfl" :: "m" (saved_context.eflags)); + + do_fpu_end(); +} + +#ifdef CONFIG_ACPI_SLEEP void do_suspend_lowlevel(int resume) { /* @@ -44,3 +192,111 @@ acpi_sleep_done: acpi_restore_register_state(); restore_processor_context(); } +#endif + +void fix_processor_context(void) +{ + int nr = smp_processor_id(); + struct tss_struct * t = &init_tss[nr]; + + set_tss_desc(nr,t); /* This just modifies memory; should not be neccessary. But... This is neccessary, because 386 hardware has concept of busy tsc or some similar stupidity. */ + gdt_table[__TSS(nr)].b &= 0xfffffdff; + + load_TR(nr); /* This does ltr */ + + load_LDT(¤t->mm->context); /* This does lldt */ + + /* + * Now maybe reload the debug registers + */ + if (current->thread.debugreg[7]){ + loaddebug(¤t->thread, 0); + loaddebug(¤t->thread, 1); + loaddebug(¤t->thread, 2); + loaddebug(¤t->thread, 3); + /* no 4 and 5 */ + loaddebug(¤t->thread, 6); + loaddebug(¤t->thread, 7); + } + +} + +static void +do_fpu_end(void) +{ + /* restore FPU regs if necessary */ + /* Do it out of line so that gcc does not move cr0 load to some stupid place */ + kernel_fpu_end(); +} + +/* Local variables for do_magic */ +static int loop __nosavedata = 0; +static int loop2 __nosavedata = 0; + +/* + * (KG): Since we affect stack here, we make this function as flat and easy + * as possible in order to not provoke gcc to use local variables on the stack. + * Note that on resume, all (expect nosave) variables will have the state from + * the time of writing (suspend_save_image) and the registers (including the + * stack pointer, but excluding the instruction pointer) will be loaded with + * the values saved at save_processor_context() time. + */ +void do_magic(int resume) +{ + /* DANGER WILL ROBINSON! + * + * If this function is too difficult for gcc to optimize, it will crash and burn! + * see above. + * + * DO NOT TOUCH. + */ + + if (!resume) { + do_magic_suspend_1(); + save_processor_context(); /* We need to capture registers and memory at "same time" */ + do_magic_suspend_2(); /* If everything goes okay, this function does not return */ + return; + } + + /* We want to run from swapper_pg_dir, since swapper_pg_dir is stored in constant + * place in memory + */ + + __asm__( "movl %%ecx,%%cr3\n" ::"c"(__pa(swapper_pg_dir))); + +/* + * Final function for resuming: after copying the pages to their original + * position, it restores the register state. + * + * What about page tables? Writing data pages may toggle + * accessed/dirty bits in our page tables. That should be no problems + * with 4MB page tables. That's why we require have_pse. + * + * This loops destroys stack from under itself, so it better should + * not use any stack space, itself. When this function is entered at + * resume time, we move stack to _old_ place. This is means that this + * function must use no stack and no local variables in registers, + * until calling restore_processor_context(); + * + * Critical section here: noone should touch saved memory after + * do_magic_resume_1; copying works, because nr_copy_pages, + * pagedir_nosave, loop and loop2 are nosavedata. + */ + do_magic_resume_1(); + + for (loop=0; loop < nr_copy_pages; loop++) { + /* You may not call something (like copy_page) here: see above */ + for (loop2=0; loop2 < PAGE_SIZE; loop2++) { + *(((char *)((pagedir_nosave+loop)->orig_address))+loop2) = + *(((char *)((pagedir_nosave+loop)->address))+loop2); + __flush_tlb(); + } + } + + restore_processor_context(); + +/* Ahah, we now run with our old stack, and with registers copied from + suspend time */ + + do_magic_resume_2(); +} diff --git a/include/asm-i386/suspend.h b/include/asm-i386/suspend.h index b41d88f45928..7d73c89da525 100644 --- a/include/asm-i386/suspend.h +++ b/include/asm-i386/suspend.h @@ -33,266 +33,14 @@ struct saved_context { u32 eflags; } __attribute__((packed)); -static struct saved_context saved_context; - #define loaddebug(thread,register) \ __asm__("movl %0,%%db" #register \ : /* no output */ \ :"r" ((thread)->debugreg[register])) - -/* - * save_processor_context - * - * Save the state of the processor before we go to sleep. - * - * return_stack is the value of the stack pointer (%esp) as the caller sees it. - * A good way could not be found to obtain it from here (don't want to make _too_ - * many assumptions about the layout of the stack this far down.) Also, the - * handy little __builtin_frame_pointer(level) where level > 0, is blatantly - * buggy - it returns the value of the stack at the proper location, not the - * location, like it should (as of gcc 2.91.66) - * - * Note that the context and timing of this function is pretty critical. - * With a minimal amount of things going on in the caller and in here, gcc - * does a good job of being just a dumb compiler. Watch the assembly output - * if anything changes, though, and make sure everything is going in the right - * place. - */ -static inline void save_processor_context (void) -{ - kernel_fpu_begin(); - - /* - * descriptor tables - */ - asm volatile ("sgdt (%0)" : "=m" (saved_context.gdt_limit)); - asm volatile ("sidt (%0)" : "=m" (saved_context.idt_limit)); - asm volatile ("sldt (%0)" : "=m" (saved_context.ldt)); - asm volatile ("str (%0)" : "=m" (saved_context.tr)); - - /* - * save the general registers. - * note that gcc has constructs to specify output of certain registers, - * but they're not used here, because it assumes that you want to modify - * those registers, so it tries to be smart and save them beforehand. - * It's really not necessary, and kinda fishy (check the assembly output), - * so it's avoided. - */ - asm volatile ("movl %%esp, (%0)" : "=m" (saved_context.esp)); - asm volatile ("movl %%eax, (%0)" : "=m" (saved_context.eax)); - asm volatile ("movl %%ebx, (%0)" : "=m" (saved_context.ebx)); - asm volatile ("movl %%ecx, (%0)" : "=m" (saved_context.ecx)); - asm volatile ("movl %%edx, (%0)" : "=m" (saved_context.edx)); - asm volatile ("movl %%ebp, (%0)" : "=m" (saved_context.ebp)); - asm volatile ("movl %%esi, (%0)" : "=m" (saved_context.esi)); - asm volatile ("movl %%edi, (%0)" : "=m" (saved_context.edi)); - - /* - * segment registers - */ - asm volatile ("movw %%es, %0" : "=r" (saved_context.es)); - asm volatile ("movw %%fs, %0" : "=r" (saved_context.fs)); - asm volatile ("movw %%gs, %0" : "=r" (saved_context.gs)); - asm volatile ("movw %%ss, %0" : "=r" (saved_context.ss)); - - /* - * control registers - */ - asm volatile ("movl %%cr0, %0" : "=r" (saved_context.cr0)); - asm volatile ("movl %%cr2, %0" : "=r" (saved_context.cr2)); - asm volatile ("movl %%cr3, %0" : "=r" (saved_context.cr3)); - asm volatile ("movl %%cr4, %0" : "=r" (saved_context.cr4)); - - /* - * eflags - */ - asm volatile ("pushfl ; popl (%0)" : "=m" (saved_context.eflags)); -} - -static void fix_processor_context(void) -{ - int nr = smp_processor_id(); - struct tss_struct * t = &init_tss[nr]; - - set_tss_desc(nr,t); /* This just modifies memory; should not be neccessary. But... This is neccessary, because 386 hardware has concept of busy tsc or some similar stupidity. */ - gdt_table[__TSS(nr)].b &= 0xfffffdff; - - load_TR(nr); /* This does ltr */ - - load_LDT(¤t->mm->context); /* This does lldt */ - - /* - * Now maybe reload the debug registers - */ - if (current->thread.debugreg[7]){ - loaddebug(¤t->thread, 0); - loaddebug(¤t->thread, 1); - loaddebug(¤t->thread, 2); - loaddebug(¤t->thread, 3); - /* no 4 and 5 */ - loaddebug(¤t->thread, 6); - loaddebug(¤t->thread, 7); - } - -} - -static void -do_fpu_end(void) -{ - /* restore FPU regs if necessary */ - /* Do it out of line so that gcc does not move cr0 load to some stupid place */ - kernel_fpu_end(); -} - -/* - * restore_processor_context - * - * Restore the processor context as it was before we went to sleep - * - descriptor tables - * - control registers - * - segment registers - * - flags - * - * Note that it is critical that this function is declared inline. - * It was separated out from restore_state to make that function - * a little clearer, but it needs to be inlined because we won't have a - * stack when we get here (so we can't push a return address). - */ -static inline void restore_processor_context (void) -{ - /* - * first restore %ds, so we can access our data properly - */ - asm volatile (".align 4"); - asm volatile ("movw %0, %%ds" :: "r" ((u16)__KERNEL_DS)); - - - /* - * control registers - */ - asm volatile ("movl %0, %%cr4" :: "r" (saved_context.cr4)); - asm volatile ("movl %0, %%cr3" :: "r" (saved_context.cr3)); - asm volatile ("movl %0, %%cr2" :: "r" (saved_context.cr2)); - asm volatile ("movl %0, %%cr0" :: "r" (saved_context.cr0)); - - /* - * segment registers - */ - asm volatile ("movw %0, %%es" :: "r" (saved_context.es)); - asm volatile ("movw %0, %%fs" :: "r" (saved_context.fs)); - asm volatile ("movw %0, %%gs" :: "r" (saved_context.gs)); - asm volatile ("movw %0, %%ss" :: "r" (saved_context.ss)); - - /* - * the other general registers - * - * note that even though gcc has constructs to specify memory - * input into certain registers, it will try to be too smart - * and save them at the beginning of the function. This is esp. - * bad since we don't have a stack set up when we enter, and we - * want to preserve the values on exit. So, we set them manually. - */ - asm volatile ("movl %0, %%esp" :: "m" (saved_context.esp)); - asm volatile ("movl %0, %%ebp" :: "m" (saved_context.ebp)); - asm volatile ("movl %0, %%eax" :: "m" (saved_context.eax)); - asm volatile ("movl %0, %%ebx" :: "m" (saved_context.ebx)); - asm volatile ("movl %0, %%ecx" :: "m" (saved_context.ecx)); - asm volatile ("movl %0, %%edx" :: "m" (saved_context.edx)); - asm volatile ("movl %0, %%esi" :: "m" (saved_context.esi)); - asm volatile ("movl %0, %%edi" :: "m" (saved_context.edi)); - - /* - * now restore the descriptor tables to their proper values - * ltr is done i fix_processor_context(). - */ - asm volatile ("lgdt (%0)" :: "m" (saved_context.gdt_limit)); - asm volatile ("lidt (%0)" :: "m" (saved_context.idt_limit)); - asm volatile ("lldt (%0)" :: "m" (saved_context.ldt)); - - fix_processor_context(); - - /* - * the flags - */ - asm volatile ("pushl %0 ; popfl" :: "m" (saved_context.eflags)); - - do_fpu_end(); -} - -#ifdef SUSPEND_C -/* Local variables for do_magic */ -static int loop __nosavedata = 0; -static int loop2 __nosavedata = 0; - -/* - * (KG): Since we affect stack here, we make this function as flat and easy - * as possible in order to not provoke gcc to use local variables on the stack. - * Note that on resume, all (expect nosave) variables will have the state from - * the time of writing (suspend_save_image) and the registers (including the - * stack pointer, but excluding the instruction pointer) will be loaded with - * the values saved at save_processor_context() time. - */ -static void do_magic(int resume) -{ - /* DANGER WILL ROBINSON! - * - * If this function is too difficult for gcc to optimize, it will crash and burn! - * see above. - * - * DO NOT TOUCH. - */ - - if (!resume) { - do_magic_suspend_1(); - save_processor_context(); /* We need to capture registers and memory at "same time" */ - do_magic_suspend_2(); /* If everything goes okay, this function does not return */ - return; - } - - /* We want to run from swapper_pg_dir, since swapper_pg_dir is stored in constant - * place in memory - */ - - __asm__( "movl %%ecx,%%cr3\n" ::"c"(__pa(swapper_pg_dir))); - -/* - * Final function for resuming: after copying the pages to their original - * position, it restores the register state. - * - * What about page tables? Writing data pages may toggle - * accessed/dirty bits in our page tables. That should be no problems - * with 4MB page tables. That's why we require have_pse. - * - * This loops destroys stack from under itself, so it better should - * not use any stack space, itself. When this function is entered at - * resume time, we move stack to _old_ place. This is means that this - * function must use no stack and no local variables in registers, - * until calling restore_processor_context(); - * - * Critical section here: noone should touch saved memory after - * do_magic_resume_1; copying works, because nr_copy_pages, - * pagedir_nosave, loop and loop2 are nosavedata. - */ - do_magic_resume_1(); - - for (loop=0; loop < nr_copy_pages; loop++) { - /* You may not call something (like copy_page) here: see above */ - for (loop2=0; loop2 < PAGE_SIZE; loop2++) { - *(((char *)((pagedir_nosave+loop)->orig_address))+loop2) = - *(((char *)((pagedir_nosave+loop)->address))+loop2); - __flush_tlb(); - } - } - - restore_processor_context(); - -/* Ahah, we now run with our old stack, and with registers copied from - suspend time */ - - do_magic_resume_2(); -} -#endif +extern void do_fpu_end(void); +extern void fix_processor_context(void); +extern void do_magic(int resume); #ifdef CONFIG_ACPI_SLEEP extern unsigned long saved_eip; diff --git a/include/linux/suspend.h b/include/linux/suspend.h index 88abb25a67de..c73dc5655a24 100644 --- a/include/linux/suspend.h +++ b/include/linux/suspend.h @@ -55,6 +55,10 @@ extern int register_suspend_notifier(struct notifier_block *); extern int unregister_suspend_notifier(struct notifier_block *); extern void refrigerator(unsigned long); +extern unsigned int nr_copy_pages __nosavedata; +extern suspend_pagedir_t *pagedir_nosave __nosavedata; + + #else #define software_suspend() do { } while(0) #define software_resume() do { } while(0) diff --git a/kernel/suspend.c b/kernel/suspend.c index 887311b73eed..b791f3ff449e 100644 --- a/kernel/suspend.c +++ b/kernel/suspend.c @@ -106,7 +106,7 @@ static int resume_status = 0; static char resume_file[256] = ""; /* For resume= kernel option */ static kdev_t resume_device; /* Local variables that should not be affected by save */ -static unsigned int nr_copy_pages __nosavedata = 0; +unsigned int nr_copy_pages __nosavedata = 0; static int pm_suspend_state = 0; @@ -119,7 +119,7 @@ static int pm_suspend_state = 0; allocated at time of resume, that travels through memory not to collide with anything. */ -static suspend_pagedir_t *pagedir_nosave __nosavedata = NULL; +suspend_pagedir_t *pagedir_nosave __nosavedata = NULL; static suspend_pagedir_t *pagedir_save; static int pagedir_order __nosavedata = 0; @@ -783,7 +783,7 @@ void suspend_power_down(void) * Magic happens here */ -static void do_magic_resume_1(void) +void do_magic_resume_1(void) { barrier(); mb(); @@ -795,7 +795,7 @@ static void do_magic_resume_1(void) driver scheduled DMA, we have good chance for DMA to finish ;-). */ } -static void do_magic_resume_2(void) +void do_magic_resume_2(void) { if (nr_copy_pages_check != nr_copy_pages) panic("nr_copy_pages changed?!"); @@ -817,14 +817,14 @@ static void do_magic_resume_2(void) #endif } -static void do_magic_suspend_1(void) +void do_magic_suspend_1(void) { mb(); barrier(); spin_lock_irq(&suspend_pagedir_lock); } -static void do_magic_suspend_2(void) +void do_magic_suspend_2(void) { read_swapfiles(); if (!suspend_save_image()) -- cgit v1.2.3 From fe91ab5e76a725c8be3cfb22f343327a53437359 Mon Sep 17 00:00:00 2001 From: "David S. Miller" Date: Wed, 5 Jun 2002 13:22:35 -0700 Subject: Fix generic device layer init sequence. Generic BUS objects have to be registered before devices assosciated with them are probed. Therefore subsys_initcall is inappropriate for such setups. It does not work to use core_initcall for this because the generic device layer bits need to be setup first too. So we rename unused_initcall to postcore_initcall and use this new initcall level for generic BUS object init. This fixes bootup on Alpha, and Sparc64. X86 was working by what looks to be luck in link order. --- drivers/base/sys.c | 2 +- drivers/pci/pci-driver.c | 2 +- include/linux/init.h | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) (limited to 'include/linux') diff --git a/drivers/base/sys.c b/drivers/base/sys.c index 32c30d77ca27..9098ef7e906b 100644 --- a/drivers/base/sys.c +++ b/drivers/base/sys.c @@ -44,6 +44,6 @@ static int sys_bus_init(void) return device_register(&system_bus); } -subsys_initcall(sys_bus_init); +postcore_initcall(sys_bus_init); EXPORT_SYMBOL(register_sys_device); EXPORT_SYMBOL(unregister_sys_device); diff --git a/drivers/pci/pci-driver.c b/drivers/pci/pci-driver.c index e5bad37436f9..7bfbbab8087f 100644 --- a/drivers/pci/pci-driver.c +++ b/drivers/pci/pci-driver.c @@ -204,7 +204,7 @@ static int __init pci_driver_init(void) return bus_register(&pci_bus_type); } -subsys_initcall(pci_driver_init); +postcore_initcall(pci_driver_init); EXPORT_SYMBOL(pci_match_device); EXPORT_SYMBOL(pci_register_driver); diff --git a/include/linux/init.h b/include/linux/init.h index ca7e75f37883..b45b95c5e640 100644 --- a/include/linux/init.h +++ b/include/linux/init.h @@ -61,7 +61,7 @@ extern initcall_t __initcall_start, __initcall_end; static initcall_t __initcall_##fn __attribute__ ((unused,__section__ (".initcall" level ".init"))) = fn #define core_initcall(fn) __define_initcall("1",fn) -#define unused_initcall(fn) __define_initcall("2",fn) +#define postcore_initcall(fn) __define_initcall("2",fn) #define arch_initcall(fn) __define_initcall("3",fn) #define subsys_initcall(fn) __define_initcall("4",fn) #define fs_initcall(fn) __define_initcall("5",fn) @@ -160,7 +160,7 @@ typedef void (*__cleanup_module_func_t)(void); #define __setup(str,func) /* nothing */ #define core_initcall(fn) module_init(fn) -#define unused_initcall(fn) module_init(fn) +#define postcore_initcall(fn) module_init(fn) #define arch_initcall(fn) module_init(fn) #define subsys_initcall(fn) module_init(fn) #define fs_initcall(fn) module_init(fn) -- cgit v1.2.3 From aea1cbc18f0bb33b0c492888c65e5d820c2da5a8 Mon Sep 17 00:00:00 2001 From: "David S. Miller" Date: Wed, 5 Jun 2002 13:23:56 -0700 Subject: SunRPC: Fix size_t vs. unsigned int arg descrepancy. --- include/linux/sunrpc/xdr.h | 7 +++---- net/sunrpc/xdr.c | 4 ++-- 2 files changed, 5 insertions(+), 6 deletions(-) (limited to 'include/linux') diff --git a/include/linux/sunrpc/xdr.h b/include/linux/sunrpc/xdr.h index 821c2e0704df..3875f87e938b 100644 --- a/include/linux/sunrpc/xdr.h +++ b/include/linux/sunrpc/xdr.h @@ -137,10 +137,9 @@ void xdr_zero_iovec(struct iovec *, int, size_t); /* * XDR buffer helper functions */ -extern int xdr_kmap(struct iovec *, struct xdr_buf *, unsigned int); -extern void xdr_kunmap(struct xdr_buf *, unsigned int); -extern void xdr_shift_buf(struct xdr_buf *, unsigned int); -extern void xdr_zero_buf(struct xdr_buf *, unsigned int); +extern int xdr_kmap(struct iovec *, struct xdr_buf *, size_t); +extern void xdr_kunmap(struct xdr_buf *, size_t); +extern void xdr_shift_buf(struct xdr_buf *, size_t); /* * Helper structure for copying from an sk_buff. diff --git a/net/sunrpc/xdr.c b/net/sunrpc/xdr.c index ad9d45174d4b..1533e0076eca 100644 --- a/net/sunrpc/xdr.c +++ b/net/sunrpc/xdr.c @@ -176,7 +176,7 @@ void xdr_shift_iovec(struct iovec *iov, int nr, size_t len) /* * Map a struct xdr_buf into an iovec array. */ -int xdr_kmap(struct iovec *iov_base, struct xdr_buf *xdr, unsigned int base) +int xdr_kmap(struct iovec *iov_base, struct xdr_buf *xdr, size_t base) { struct iovec *iov = iov_base; struct page **ppage = xdr->pages; @@ -226,7 +226,7 @@ map_tail: return (iov - iov_base); } -void xdr_kunmap(struct xdr_buf *xdr, unsigned int base) +void xdr_kunmap(struct xdr_buf *xdr, size_t base) { struct page **ppage = xdr->pages; unsigned int pglen = xdr->page_len; -- cgit v1.2.3 From 1e8f2d8cf89006edec3fba65d984ac81ce892a5a Mon Sep 17 00:00:00 2001 From: David Woodhouse Date: Wed, 5 Jun 2002 19:25:16 -0700 Subject: [PATCH] Shared zlib include fix for 2.5 and 2.4-ac. This switches linux/zlib.h to include zconf.h as instead of just "zconf.h". --- include/linux/zlib.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'include/linux') diff --git a/include/linux/zlib.h b/include/linux/zlib.h index 43b32c613d76..4582d5343c89 100644 --- a/include/linux/zlib.h +++ b/include/linux/zlib.h @@ -31,7 +31,7 @@ #ifndef _ZLIB_H #define _ZLIB_H -#include "zconf.h" +#include #ifdef __cplusplus extern "C" { -- cgit v1.2.3