Skip to contentSkip to conversation

x86-64 next sync for 2.5.9

PATCH In review Andi Kleen 2 participants 2 messages Apr 23, 2002 – Apr 24, 2002

lore
Share & tools
lore

Andi Kleen

author
#0 lore raw

PATCH 1/1 x86-64 next sync for 2.5.9

This patch fixes up some lose ends left over from the last x86-64 jumbo merge.

- make it compile again. ia32_ioctl was referencing IDE ioctls that got remove in a merge race.
- implement early_printk properly as an registered console. this requires an addition to init/main.c to disable the early console before the real console is initialized. Also add early serial console support while I was at it.
- Use the memset/FXRSTOR way to initialize the FPU, as discussed.
- Fix semctl/shmctl ABI (thanks to Andreas Schwab)
- Other minor fixes.

For 2.5.9.

arch/x86_64/config.in renamed from ../v2.5/linux/arch/x86_64/config.in +2 -4
diff -x *-o -burpN -X ../../KDIFX ../../v2.5/linux/arch/x86_64/config.in linux-2.5.9/arch/x86_64/config.in
@@ -15,6 +15,8 @@ define_bool CONFIG_RWSEM_GENERIC_SPINLOC
 define_bool CONFIG_RWSEM_XCHGADD_ALGORITHM n
 define_bool CONFIG_X86_CMPXCHG y
 
+define_bool CONFIG_EARLY_PRINTK y
+
 source init/Config.in
 
 mainmenu_option next_comment
@@ -210,12 +212,8 @@ if [ "$CONFIG_DEBUG_KERNEL" != "n" ]; th
 #   bool '  Memory mapped I/O debugging' CONFIG_DEBUG_IOVIRT
    bool '  Magic SysRq key' CONFIG_MAGIC_SYSRQ
    bool '  Spinlock debugging' CONFIG_DEBUG_SPINLOCK
-   bool '  Early printk' CONFIG_EARLY_PRINTK
    bool '  Additional run-time checks' CONFIG_CHECKING
    bool '  Debug __init statements' CONFIG_INIT_DEBUG
-#if [ "$CONFIG_SERIAL_CONSOLE" = "y" ]; then
-#  bool 'Early serial console (ttyS0)' CONFIG_EARLY_SERIAL_CONSOLE
-#fi
 fi
 endmenu
 
arch/x86_64/defconfig renamed from ../v2.5/linux/arch/x86_64/defconfig +3 -2
diff -x *-o -burpN -X ../../KDIFX ../../v2.5/linux/arch/x86_64/defconfig linux-2.5.9/arch/x86_64/defconfig
@@ -9,6 +9,7 @@ CONFIG_UID16=y
 CONFIG_RWSEM_GENERIC_SPINLOCK=y
 # CONFIG_RWSEM_XCHGADD_ALGORITHM is not set
 CONFIG_X86_CMPXCHG=y
+CONFIG_EARLY_PRINTK=y
 
 #
 # Code maturity level options
@@ -282,7 +283,7 @@ CONFIG_IDEDMA_AUTO=y
 #
 # ISDN subsystem
 #
-# CONFIG_ISDN is not set
+# CONFIG_ISDN_BOOL is not set
 
 #
 # Old CD-ROM drivers (not SCSI, not IDE)
@@ -430,6 +431,7 @@ CONFIG_EXT2_FS=y
 # CONFIG_NFSD_TCP is not set
 # CONFIG_SUNRPC is not set
 # CONFIG_LOCKD is not set
+# CONFIG_EXPORTFS is not set
 # CONFIG_SMB_FS is not set
 # CONFIG_NCP_FS is not set
 # CONFIG_NCPFS_PACKET_SIGNING is not set
@@ -484,7 +486,6 @@ CONFIG_DEBUG_KERNEL=y
 # CONFIG_DEBUG_SLAB is not set
 # CONFIG_MAGIC_SYSRQ is not set
 # CONFIG_DEBUG_SPINLOCK is not set
-# CONFIG_EARLY_PRINTK is not set
 # CONFIG_CHECKING is not set
 # CONFIG_INIT_DEBUG is not set
 
arch/x86_64/ia32/ia32_ioctl.c renamed from ../v2.5/linux/arch/x86_64/ia32/ia32_ioctl.c +0 -2
diff -x *-o -burpN -X ../../KDIFX ../../v2.5/linux/arch/x86_64/ia32/ia32_ioctl.c linux-2.5.9/arch/x86_64/ia32/ia32_ioctl.c
@@ -3182,7 +3182,6 @@ COMPATIBLE_IOCTL(FIGETBSZ)
  */
 COMPATIBLE_IOCTL(HDIO_GET_IDENTITY)
 COMPATIBLE_IOCTL(HDIO_SET_DMA)
-COMPATIBLE_IOCTL(HDIO_SET_KEEPSETTINGS)
 COMPATIBLE_IOCTL(HDIO_SET_UNMASKINTR)
 COMPATIBLE_IOCTL(HDIO_SET_NOWERR)
 COMPATIBLE_IOCTL(HDIO_SET_32BIT)
@@ -3742,7 +3741,6 @@ HANDLE_IOCTL(BLKSECTGET, w_long)
 HANDLE_IOCTL(BLKPG, blkpg_ioctl_trans)
 HANDLE_IOCTL(FBIOGETCMAP, fb_ioctl_trans)
 HANDLE_IOCTL(FBIOPUTCMAP, fb_ioctl_trans)
-HANDLE_IOCTL(HDIO_GET_KEEPSETTINGS, hdio_ioctl_trans)
 HANDLE_IOCTL(HDIO_GET_UNMASKINTR, hdio_ioctl_trans)
 HANDLE_IOCTL(HDIO_GET_DMA, hdio_ioctl_trans)
 HANDLE_IOCTL(HDIO_GET_32BIT, hdio_ioctl_trans)
arch/x86_64/kernel/early_printk.c renamed from ../v2.5/linux/arch/x86_64/kernel/early_printk.c +143 -33

208 lines not on this page · raw message

arch/x86_64/kernel/i387.c renamed from ../v2.5/linux/arch/x86_64/kernel/i387.c +5 -41

58 lines not on this page · raw message

arch/x86_64/kernel/sys_x86_64.c renamed from ../v2.5/linux/arch/x86_64/kernel/sys_x86_64.c +2 -13
diff -x *-o -burpN -X ../../KDIFX ../../v2.5/linux/arch/x86_64/kernel/sys_x86_64.c linux-2.5.9/arch/x86_64/kernel/sys_x86_64.c
@@ -114,19 +114,8 @@ asmlinkage long sys_pause(void)
 	return -ERESTARTNOHAND;
 }
 
-asmlinkage long wrap_sys_shmat(int shmid, char *shmaddr, int shmflg, 
-			       unsigned long *raddr_user)
+asmlinkage long wrap_sys_shmat(int shmid, char *shmaddr, int shmflg)
 {
 	unsigned long raddr;
-	return sys_shmat(shmid,shmaddr,shmflg,&raddr) ?: put_user(raddr,raddr_user);
-} 
-
-asmlinkage long wrap_sys_semctl(int semid, int semnum, int cmd, unsigned long *ptr)
-{	
-	unsigned long val; 
-	/* XXX: for cmd==SETVAL the manpage says ptr is the value directly. i386
-	   seems to always get it via a pointer. Follow i386 here. Check this. */
-	if (get_user(val, ptr))
-		return -EFAULT;
-	return sys_semctl(semid, semnum, cmd, (union semun)(void *)val);
+	return sys_shmat(shmid,shmaddr,shmflg,&raddr) ?: raddr;
 } 
arch/x86_64/kernel/traps.c renamed from ../v2.5/linux/arch/x86_64/kernel/traps.c +2 -4
diff -x *-o -burpN -X ../../KDIFX ../../v2.5/linux/arch/x86_64/kernel/traps.c linux-2.5.9/arch/x86_64/kernel/traps.c
@@ -736,11 +736,9 @@ asmlinkage void math_state_restore(void)
 	struct task_struct *me = current;
 	clts();			/* Allow maths ops (or we recurse) */
 
-	if (me->used_math) {
-		restore_fpu_checking(&me->thread.i387.fxsave);
-	} else {
+	if (!me->used_math)
 		init_fpu();
-	}
+	restore_fpu_checking(&me->thread.i387.fxsave);
 	set_thread_flag(TIF_USEDFPU); 
 }
 
arch/x86_64/mm/fault.c renamed from ../v2.5/linux/arch/x86_64/mm/fault.c +1 -1
diff -x *-o -burpN -X ../../KDIFX ../../v2.5/linux/arch/x86_64/mm/fault.c linux-2.5.9/arch/x86_64/mm/fault.c
@@ -85,7 +85,7 @@ void dump_pagetable(unsigned long addres
 }
 
 int page_fault_trace; 
-int exception_trace = 1;
+int exception_trace;
 
 /*
  * This routine handles page faults.  It determines the address,
include/asm-x86_64/unistd.h renamed from ../v2.5/linux/include/asm-x86_64/unistd.h +1 -1
diff -x *-o -burpN -X ../../KDIFX ../../v2.5/linux/include/asm-x86_64/unistd.h linux-2.5.9/include/asm-x86_64/unistd.h
@@ -153,7 +153,7 @@ __SYSCALL(__NR_semget, sys_semget)
 #define __NR_semop                              65
 __SYSCALL(__NR_semop, sys_semop)
 #define __NR_semctl                             66
-__SYSCALL(__NR_semctl, wrap_sys_semctl)
+__SYSCALL(__NR_semctl, sys_semctl)
 #define __NR_shmdt                              67
 __SYSCALL(__NR_shmdt, sys_shmdt)
 #define __NR_msgget                             68
init/main.c renamed from ../v2.5/linux/init/main.c +4 -0
diff -x *-o -burpN -X ../../KDIFX ../../v2.5/linux/init/main.c linux-2.5.9/init/main.c
@@ -260,6 +260,7 @@ static void __init parse_options(char *l
 
 extern void setup_arch(char **);
 extern void cpu_idle(void);
+extern void disable_early_printk(void);
 
 #ifndef CONFIG_SMP
 
@@ -361,6 +362,9 @@ asmlinkage void __init start_kernel(void
 	 * we've done PCI setups etc, and console_init() must be aware of
 	 * this. But we do want output early, in case something goes wrong.
 	 */
+#ifdef CONFIG_EARLY_PRINTK
+	disable_early_printk();
+#endif
 	console_init();
 #ifdef CONFIG_MODULES
 	init_modules();
#1 lore raw
Quoted 5 lines · Andi Kleen

- implement early_printk properly as an registered console. this requires an addition to init/main.c to disable the early console before the real console is initialized. Also add early serial console support while I was at it.

That init/main.c hackery needs to go away - this should all be totally internal to the console layer, and there is no reason why init/main.c should be involved at all.

Linus