Skip to contentSkip to conversation

2.6.8.1-mm3 - Make UML build and run

PATCH New Jeff Dike 1 participant 1 message Aug 20, 2004 User-mode Linux (UML)

lore
Share & tools
lore

Jeff Dike

author
#0 lore raw

PATCH 1/1 2.6.8.1-mm3 - Make UML build and run

This patch includes the following -
updated defconfig
move uml.lds.S and main.c from arch/um to arch/um/kernel per Sam's
suggestions
steal bitops.c from arch/i386
convert all calls to open_private_file to dentry_open

Jeff

arch/um/Makefile +2 -11
Index: 2.6.8.1-mm3/arch/um/Makefile
===================================================================
@@ -86,8 +86,6 @@
 
 LDFLAGS_vmlinux = -r
 
-vmlinux: $(ARCH_DIR)/main.o 
-
 # These aren't in Makefile-tt because they are needed in the !CONFIG_MODE_TT +
 # CONFIG_MODE_SKAS + CONFIG_STATIC_LINK case.
 
@@ -120,14 +118,11 @@
 
 export CPPFLAGS_$(LD_SCRIPT-y) = $(CPPFLAGS_vmlinux.lds) -P -C -Uum
 
-LD_SCRIPT-y := $(ARCH_DIR)/$(LD_SCRIPT-y)
-
-#$(LD_SCRIPT-y) : $(LD_SCRIPT-y:.s=.S) scripts FORCE
-#	$(call if_changed_dep,as_s_S)
+LD_SCRIPT-y := $(ARCH_DIR)/kernel/$(LD_SCRIPT-y)
 
 linux: vmlinux $(LD_SCRIPT-y)
 	$(CC) -Wl,-T,$(LD_SCRIPT-y) $(LINK-y) $(LINK_WRAPS) \
-		-o linux $(ARCH_DIR)/main.o vmlinux -L/usr/lib -lutil
+		-o linux vmlinux -L/usr/lib -lutil
 
 USER_CFLAGS := $(patsubst -I%,,$(CFLAGS))
 USER_CFLAGS := $(patsubst -Derrno=kernel_errno,,$(USER_CFLAGS))
@@ -162,10 +157,6 @@
 MRPROPER_FILES += $(SYMLINK_HEADERS) $(ARCH_SYMLINKS) \
 	$(addprefix $(ARCH_DIR)/kernel/,$(KERN_SYMLINKS))
 
-$(ARCH_DIR)/main.o: $(ARCH_DIR)/main.c sys_prepare
-	@ echo '  MAIN    $@'
-	@ $(CC) $(USER_CFLAGS) $(EXTRA_CFLAGS) -c -o $@ $<
-
 archmrproper:
 	@:
 
arch/um/defconfig +6 -3
Index: 2.6.8.1-mm3/arch/um/defconfig
===================================================================
@@ -1,7 +1,7 @@
 #
 # Automatically generated make config: don't edit
-# Linux kernel version: 2.6.8.1-mm1
-# Mon Aug 16 22:34:07 2004
+# Linux kernel version: 2.6.8.1-mm3
+# Fri Aug 20 13:03:03 2004
 #
 CONFIG_USERMODE=y
 CONFIG_MMU=y
@@ -43,7 +43,6 @@
 # CONFIG_POSIX_MQUEUE is not set
 CONFIG_BSD_PROCESS_ACCT=y
 # CONFIG_BSD_PROCESS_ACCT_V3 is not set
-# CONFIG_PAGG is not set
 CONFIG_SYSCTL=y
 # CONFIG_AUDIT is not set
 CONFIG_LOG_BUF_SHIFT=14
@@ -55,6 +54,7 @@
 # CONFIG_KALLSYMS_EXTRA_PASS is not set
 CONFIG_FUTEX=y
 CONFIG_EPOLL=y
+# CONFIG_CPUSETS is not set
 CONFIG_IOSCHED_NOOP=y
 CONFIG_IOSCHED_AS=y
 CONFIG_IOSCHED_DEADLINE=y
@@ -236,6 +236,9 @@
 # CONFIG_EXT2_FS_XATTR is not set
 # CONFIG_EXT3_FS is not set
 # CONFIG_JBD is not set
+CONFIG_REISER4_FS=y
+CONFIG_REISER4_LARGE_KEY=y
+# CONFIG_REISER4_CHECK is not set
 CONFIG_REISERFS_FS=y
 # CONFIG_REISERFS_CHECK is not set
 # CONFIG_REISERFS_PROC_INFO is not set
arch/um/kernel/Makefile +3 -3
Index: 2.6.8.1-mm3/arch/um/kernel/Makefile
===================================================================
@@ -3,10 +3,10 @@
 # Licensed under the GPL
 #
 
-extra-y := vmlinux.lds
+extra-y := vmlinux.lds uml.lds
 
 obj-y = checksum.o config.o exec_kern.o exitcode.o frame_kern.o frame.o \
-	helper.o init_task.o irq.o irq_user.o ksyms.o mem.o mem_user.o \
+	helper.o init_task.o irq.o irq_user.o ksyms.o main.o mem.o mem_user.o \
 	physmem.o process.o process_kern.o ptrace.o reboot.o resource.o \
 	sigio_user.o sigio_kern.o signal_kern.o signal_user.o smp.o \
 	syscall_kern.o syscall_user.o sysrq.o sys_call_table.o tempfile.o \
@@ -24,7 +24,7 @@
 user-objs-$(CONFIG_TTY_LOG) += tty_log.o
 
 USER_OBJS := $(filter %_user.o,$(obj-y))  $(user-objs-y) config.o helper.o \
-	process.o tempfile.o time.o tty_log.o umid.o user_util.o
+	main.o process.o tempfile.o time.o tty_log.o umid.o user_util.o
 USER_OBJS := $(foreach file,$(USER_OBJS),$(obj)/$(file))
 
 CFLAGS_frame.o := $(patsubst -fomit-frame-pointer,,$(USER_CFLAGS))
arch/um/kernel/main.c +230 -0

230 lines not on this page · raw message

arch/um/kernel/uml.lds.S +96 -0

96 lines not on this page · raw message

arch/um/main.c +0 -230

230 lines not on this page · raw message

arch/um/sys-i386/Makefile +4 -3
Index: 2.6.8.1-mm3/arch/um/sys-i386/Makefile
===================================================================
@@ -1,5 +1,5 @@
-obj-y = bugs.o checksum.o fault.o ksyms.o ldt.o ptrace.o ptrace_user.o \
-	semaphore.o sigcontext.o syscalls.o sysrq.o time.o
+obj-y = bitops.o bugs.o checksum.o fault.o ksyms.o ldt.o ptrace.o \
+	ptrace_user.o semaphore.o sigcontext.o syscalls.o sysrq.o time.o
 
 obj-$(CONFIG_HIGHMEM) += highmem.o
 obj-$(CONFIG_MODULES) += module.o
@@ -7,11 +7,12 @@
 USER_OBJS := bugs.o ptrace_user.o sigcontext.o fault.o
 USER_OBJS := $(foreach file,$(USER_OBJS),$(obj)/$(file))
 
-SYMLINKS = semaphore.c highmem.c module.c
+SYMLINKS = bitops.c semaphore.c highmem.c module.c
 SYMLINKS := $(foreach f,$(SYMLINKS),$(src)/$f)
 
 clean-files := $(SYMLINKS)
 
+bitops.c-dir = lib
 semaphore.c-dir = kernel
 highmem.c-dir = mm
 module.c-dir = kernel
arch/um/uml.lds.S +0 -96

96 lines not on this page · raw message

fs/hppfs/hppfs_kern.c +21 -17
Index: 2.6.8.1-mm3/fs/hppfs/hppfs_kern.c
===================================================================
@@ -24,7 +24,7 @@
 };
 
 struct hppfs_private {
-	struct file proc_file;
+	struct file *proc_file;
 	int host_fd;
 	loff_t len;
 	struct hppfs_data *contents;
@@ -307,7 +307,7 @@
 		if(count > 0)
 			*ppos += count;
 	}
-	else count = read_proc(&hppfs->proc_file, buf, count, ppos, 1);
+	else count = read_proc(hppfs->proc_file, buf, count, ppos, 1);
 
 	return(count);
 }
@@ -316,7 +316,7 @@
 			   loff_t *ppos)
 {
 	struct hppfs_private *data = file->private_data;
-	struct file *proc_file = &data->proc_file;
+	struct file *proc_file = data->proc_file;
 	ssize_t (*write)(struct file *, const char *, size_t, loff_t *);
 	int err;
 
@@ -471,9 +471,10 @@
 	proc_dentry = HPPFS_I(inode)->proc_dentry;
 
 	/* XXX This isn't closed anywhere */
-	err = open_private_file(&data->proc_file, proc_dentry,
-				file_mode(file->f_mode));
-	if(err)
+	data->proc_file = dentry_open(dget(proc_dentry), NULL, 
+				      file_mode(file->f_mode));
+	err = PTR_ERR(data->proc_file);
+	if(IS_ERR(data->proc_file))
 		goto out_free1;
 
 	type = os_file_type(host_file);
@@ -524,9 +525,10 @@
 		goto out;
 
 	proc_dentry = HPPFS_I(inode)->proc_dentry;
-	err = open_private_file(&data->proc_file, proc_dentry,
-				file_mode(file->f_mode));
-	if(err)
+	data->proc_file = dentry_open(dget(proc_dentry), NULL, 
+				      file_mode(file->f_mode));
+	err = PTR_ERR(data->proc_file);
+	if(IS_ERR(data->proc_file))
 		goto out_free;
 
 	file->private_data = data;
@@ -657,40 +659,42 @@
 
 static int hppfs_readlink(struct dentry *dentry, char *buffer, int buflen)
 {
-	struct file proc_file;
+	struct file *proc_file;
 	struct dentry *proc_dentry;
 	int (*readlink)(struct dentry *, char *, int);
 	int err, n;
 
 	proc_dentry = HPPFS_I(dentry->d_inode)->proc_dentry;
-	err = open_private_file(&proc_file, proc_dentry, O_RDONLY);
-	if(err)
+	proc_file = dentry_open(dget(proc_dentry), NULL, O_RDONLY);
+	err = PTR_ERR(proc_dentry);
+	if(IS_ERR(proc_dentry))
 		return(err);
 
 	readlink = proc_dentry->d_inode->i_op->readlink;
 	n = (*readlink)(proc_dentry, buffer, buflen);
 
-	close_private_file(&proc_file);
+	fput(proc_file);
 
 	return(n);
 }
 
 static int hppfs_follow_link(struct dentry *dentry, struct nameidata *nd)
 {
-	struct file proc_file;
+	struct file *proc_file;
 	struct dentry *proc_dentry;
 	int (*follow_link)(struct dentry *, struct nameidata *);
 	int err, n;
 
 	proc_dentry = HPPFS_I(dentry->d_inode)->proc_dentry;
-	err = open_private_file(&proc_file, proc_dentry, O_RDONLY);
-	if(err)
+	proc_file = dentry_open(dget(proc_dentry), NULL, O_RDONLY);
+	err = PTR_ERR(proc_dentry);
+	if(IS_ERR(proc_dentry))
 		return(err);
 
 	follow_link = proc_dentry->d_inode->i_op->follow_link;
 	n = (*follow_link)(proc_dentry, nd);
 
-	close_private_file(&proc_file);
+	fput(proc_file);
 
 	return(n);
 }