From 90b9165f242618a83040965f3b0688d31b505439 Mon Sep 17 00:00:00 2001 From: Linus Torvalds Date: Fri, 23 Nov 2007 15:16:38 -0500 Subject: [PATCH] 2.1.122pre1 This may or may not fix the APM problems, and the INITRD ones. The INITRD one in particular was a case of a fairly inexplicable test that shouldn't have been there in the first place breaking when something completely unrelated was cleaned up.. The APM breakage was simply due to it being in the wrong place. The patch looks bigger than it really is - it really only moves the file to the proper directory, and makes sure that it should compile with the standard assembler.. Linus --- Makefile | 2 +- arch/i386/config.in | 10 +++++++ arch/i386/kernel/Makefile | 4 +++ .../char/apm_bios.c => arch/i386/kernel/apm.c | 28 +++++++++---------- drivers/char/Config.in | 9 ------ drivers/char/Makefile | 7 ++--- fs/namei.c | 20 +++++++------ fs/super.c | 15 ++-------- kernel/ksyms.c | 3 ++ 9 files changed, 48 insertions(+), 50 deletions(-) rename drivers/char/apm_bios.c => arch/i386/kernel/apm.c (98%) diff --git a/Makefile b/Makefile index 7e62ade9ff8a..440f4751d32b 100644 --- a/Makefile +++ b/Makefile @@ -1,6 +1,6 @@ VERSION = 2 PATCHLEVEL = 1 -SUBLEVEL = 121 +SUBLEVEL = 122 ARCH := $(shell uname -m | sed -e s/i.86/i386/ -e s/sun4u/sparc64/ -e s/arm.*/arm/ -e s/sa110/arm/) diff --git a/arch/i386/config.in b/arch/i386/config.in index ff8450ca81a3..b82052b8b478 100644 --- a/arch/i386/config.in +++ b/arch/i386/config.in @@ -64,6 +64,16 @@ if [ "$CONFIG_PARPORT" != "n" ]; then fi fi +bool 'Advanced Power Management BIOS support' CONFIG_APM +if [ "$CONFIG_APM" = "y" ]; then + bool ' Ignore USER SUSPEND' CONFIG_APM_IGNORE_USER_SUSPEND + bool ' Enable PM at boot time' CONFIG_APM_DO_ENABLE + bool ' Make CPU Idle calls when idle' CONFIG_APM_CPU_IDLE + bool ' Enable console blanking using APM' CONFIG_APM_DISPLAY_BLANK + bool ' Power off on shutdown' CONFIG_APM_POWER_OFF + bool ' Ignore multiple suspend' CONFIG_APM_IGNORE_MULTIPLE_SUSPEND +fi + endmenu source drivers/pnp/Config.in diff --git a/arch/i386/kernel/Makefile b/arch/i386/kernel/Makefile index 917e7abdfe7b..b8a94af18db4 100644 --- a/arch/i386/kernel/Makefile +++ b/arch/i386/kernel/Makefile @@ -34,6 +34,10 @@ else endif endif +ifdef CONFIG_APM +OX_OBJS += apm.o +endif + ifdef SMP O_OBJS += io_apic.o smp.o trampoline.o endif diff --git a/drivers/char/apm_bios.c b/arch/i386/kernel/apm.c similarity index 98% rename from drivers/char/apm_bios.c rename to arch/i386/kernel/apm.c index 08b3a78a2135..65b26ffc4930 100644 --- a/drivers/char/apm_bios.c +++ b/arch/i386/kernel/apm.c @@ -96,6 +96,8 @@ #include #include +#include "desc.h" + EXPORT_SYMBOL(apm_register_callback); EXPORT_SYMBOL(apm_unregister_callback); @@ -213,7 +215,7 @@ extern unsigned long get_cmos_time(void); /* * Save a segment register away */ -#define savesegment(seg, where) __asm__ __volatile__("movw %%" #seg ", %0\n" : "=m" (where)) +#define savesegment(seg, where) __asm__ __volatile__("movl %%" #seg ",%0" : "=m" (where)) /* * Forward declarations @@ -354,8 +356,7 @@ static const lookup_t error_table[] = { static inline int apm_bios_call(u32 eax_in, u32 ebx_in, u32 ecx_in, u32 *eax, u32 *ebx, u32 *ecx, u32 *edx, u32 *esi) { - u16 old_fs; - u16 old_gs; + unsigned int old_fs, old_gs; int error; #ifdef APM_ZERO_SEGS @@ -370,10 +371,10 @@ static inline int apm_bios_call(u32 eax_in, u32 ebx_in, u32 ecx_in, #ifdef APM_ZERO_SEGS "pushl %%ds\n\t" "pushl %%es\n\t" - "movw %9, %%ds\n\t" - "movw %9, %%es\n\t" - "movw %9, %%fs\n\t" - "movw %9, %%gs\n\t" + "movl %w9,%%ds\n\t" + "movl %w9,%%es\n\t" + "movl %w9,%%fs\n\t" + "movl %w9,%%gs\n\t" #endif "lcall %%cs:" SYMBOL_NAME_STR(apm_bios_entry) "\n\t" "movl $0, %%edi\n\t" @@ -402,8 +403,7 @@ static inline int apm_bios_call(u32 eax_in, u32 ebx_in, u32 ecx_in, static inline int apm_bios_call_simple(u32 eax_in, u32 ebx_in, u32 ecx_in, u32 *eax) { - u16 old_fs; - u16 old_gs; + unsigned int old_fs, old_gs; int error; #ifdef APM_ZERO_SEGS @@ -418,10 +418,10 @@ static inline int apm_bios_call_simple(u32 eax_in, u32 ebx_in, u32 ecx_in, u32 * #ifdef APM_ZERO_SEGS "pushl %%ds\n\t" "pushl %%es\n\t" - "movw %5, %%ds\n\t" - "movw %5, %%es\n\t" - "movw %5, %%fs\n\t" - "movw %5, %%gs\n\t" + "movl %w5,%%ds\n\t" + "movl %w5,%%es\n\t" + "movl %w5,%%fs\n\t" + "movl %w5,%%gs\n\t" #endif "lcall %%cs:" SYMBOL_NAME_STR(apm_bios_entry) "\n\t" "movl $0, %%edi\n\t" @@ -1176,7 +1176,7 @@ int apm_get_info(char *buf, char **start, off_t fpos, int length, int dummy) } #endif -__initfunc(void apm_bios_init(void)) +void __init apm_bios_init(void) { unsigned short bx; unsigned short cx; diff --git a/drivers/char/Config.in b/drivers/char/Config.in index 8ee33b612b73..5c5ea7b1b442 100644 --- a/drivers/char/Config.in +++ b/drivers/char/Config.in @@ -79,15 +79,6 @@ if [ "$CONFIG_QIC02_TAPE" != "n" ]; then fi fi -bool 'Advanced Power Management BIOS support' CONFIG_APM -if [ "$CONFIG_APM" = "y" ]; then - bool ' Ignore USER SUSPEND' CONFIG_APM_IGNORE_USER_SUSPEND - bool ' Enable PM at boot time' CONFIG_APM_DO_ENABLE - bool ' Make CPU Idle calls when idle' CONFIG_APM_CPU_IDLE - bool ' Enable console blanking using APM' CONFIG_APM_DISPLAY_BLANK - bool ' Power off on shutdown' CONFIG_APM_POWER_OFF - bool ' Ignore multiple suspend' CONFIG_APM_IGNORE_MULTIPLE_SUSPEND -fi bool 'Watchdog Timer Support' CONFIG_WATCHDOG if [ "$CONFIG_WATCHDOG" != "n" ]; then bool ' Disable watchdog shutdown on close' CONFIG_WATCHDOG_NOWAYOUT diff --git a/drivers/char/Makefile b/drivers/char/Makefile index e8424737f162..b064782d207f 100644 --- a/drivers/char/Makefile +++ b/drivers/char/Makefile @@ -435,13 +435,12 @@ else endif endif -ifdef CONFIG_APM -LX_OBJS += apm_bios.o +ifdef CONFIG_H8 +LX_OBJS += h8.o M = y endif -ifdef CONFIG_H8 -LX_OBJS += h8.o +ifdef CONFIG_APM M = y endif diff --git a/fs/namei.c b/fs/namei.c index 6d1ed898f702..45094a251e11 100644 --- a/fs/namei.c +++ b/fs/namei.c @@ -84,6 +84,8 @@ /* [16-Dec-97 Kevin Buhr] For security reasons, we change some symlink * semantics. See the comments in "open_namei" and "do_link" below. + * + * [10-Sep-98 Alan Modra] Another symlink change. */ static inline char * get_page(void) @@ -992,20 +994,20 @@ static inline int do_link(const char * oldname, const char * newname) struct inode *inode; int error; - old_dentry = lookup_dentry(oldname, NULL, 1); - error = PTR_ERR(old_dentry); - if (IS_ERR(old_dentry)) - goto exit; - /* * Hardlinks are often used in delicate situations. We avoid * security-related surprises by not following symlinks on the - * newname. We *do* follow them on the oldname. This is - * the same as Digital Unix 4.0, for example. + * newname. --KAB * - * Solaris 2.5.1 is similar, but for a laugh try linking from - * a dangling symlink. --KAB + * We don't follow them on the oldname either to be compatible + * with linux 2.0, and to avoid hard-linking to directories + * and other special files. --ADM */ + old_dentry = lookup_dentry(oldname, NULL, 0); + error = PTR_ERR(old_dentry); + if (IS_ERR(old_dentry)) + goto exit; + new_dentry = lookup_dentry(newname, NULL, 0); error = PTR_ERR(new_dentry); if (IS_ERR(new_dentry)) diff --git a/fs/super.c b/fs/super.c index 843464421796..2dfcfb1ec6c5 100644 --- a/fs/super.c +++ b/fs/super.c @@ -1226,9 +1226,7 @@ void __init mount_root(void) #ifdef CONFIG_BLK_DEV_INITRD -extern int initmem_freed; - -static int __init do_change_root(kdev_t new_root_dev,const char *put_old) +int __init change_root(kdev_t new_root_dev,const char *put_old) { kdev_t old_root_dev; struct vfsmount *vfsmnt; @@ -1248,7 +1246,7 @@ static int __init do_change_root(kdev_t new_root_dev,const char *put_old) dput(old_pwd); #if 1 shrink_dcache(); - printk("do_change_root: old root has d_count=%d\n", old_root->d_count); + printk("change_root: old root has d_count=%d\n", old_root->d_count); #endif /* * Get the new mount directory @@ -1293,13 +1291,4 @@ static int __init do_change_root(kdev_t new_root_dev,const char *put_old) return -ENOMEM; } -int change_root(kdev_t new_root_dev,const char *put_old) -{ - if (initmem_freed) { - printk (KERN_CRIT "Initmem has been already freed. Staying in initrd\n"); - return -EBUSY; - } - return do_change_root(new_root_dev, put_old); -} - #endif diff --git a/kernel/ksyms.c b/kernel/ksyms.c index e9cb2ea7046f..9f4014ae9ce3 100644 --- a/kernel/ksyms.c +++ b/kernel/ksyms.c @@ -401,3 +401,6 @@ EXPORT_SYMBOL(unregister_console); /* time */ EXPORT_SYMBOL(get_fast_time); + +/* library functions */ +EXPORT_SYMBOL(strnicmp); -- 2.39.5