Commit 20723083 authored by Jeff Dike's avatar Jeff Dike

Updates to make UML build as 2.5.41.

Applied Oleg Drokin's task --> work patch.
Fixed the Makefiles to accomodate the fact the kbuild doesn't cd
into subdirectories any more.
Got rid of some compile warnings.
parent 26c9952a
...@@ -34,7 +34,7 @@ core-y += $(ARCH_DIR)/kernel/ \ ...@@ -34,7 +34,7 @@ core-y += $(ARCH_DIR)/kernel/ \
$(ARCH_DIR)/drivers/ \ $(ARCH_DIR)/drivers/ \
$(ARCH_DIR)/sys-$(SUBARCH)/ $(ARCH_DIR)/sys-$(SUBARCH)/
libs-$(CONFIG_PT_PROXY) += $(ARCH_DIR)/ptproxy/ core-$(CONFIG_PT_PROXY) += $(ARCH_DIR)/ptproxy/
ARCH_INCLUDE = $(TOPDIR)/$(ARCH_DIR)/include ARCH_INCLUDE = $(TOPDIR)/$(ARCH_DIR)/include
......
...@@ -39,8 +39,9 @@ obj-y += stdio_console.o $(CHAN_OBJS) ...@@ -39,8 +39,9 @@ obj-y += stdio_console.o $(CHAN_OBJS)
USER_SINGLE_OBJS = $(foreach f,$(patsubst %.o,%,$(obj-y) $(obj-m)),$($(f)-objs)) USER_SINGLE_OBJS = $(foreach f,$(patsubst %.o,%,$(obj-y) $(obj-m)),$($(f)-objs))
USER_OBJS = $(filter %_user.o,$(obj-y) $(obj-m) $(USER_SINGLE_OBJS)) fd.o \ USER_OBJS := $(filter %_user.o,$(obj-y) $(obj-m) $(USER_SINGLE_OBJS)) fd.o \
null.o pty.o tty.o xterm.o null.o pty.o tty.o xterm.o
USER_OBJS := $(foreach file,$(USER_OBJS),arch/um/drivers/$(file))
include $(TOPDIR)/Rules.make include $(TOPDIR)/Rules.make
......
...@@ -395,7 +395,7 @@ int chan_out_fd(struct list_head *chans) ...@@ -395,7 +395,7 @@ int chan_out_fd(struct list_head *chans)
return(-1); return(-1);
} }
void chan_interrupt(struct list_head *chans, struct tq_struct *task, void chan_interrupt(struct list_head *chans, struct work_struct *task,
struct tty_struct *tty, int irq, void *dev) struct tty_struct *tty, int irq, void *dev)
{ {
struct list_head *ele, *next; struct list_head *ele, *next;
...@@ -409,7 +409,7 @@ void chan_interrupt(struct list_head *chans, struct tq_struct *task, ...@@ -409,7 +409,7 @@ void chan_interrupt(struct list_head *chans, struct tq_struct *task,
do { do {
if((tty != NULL) && if((tty != NULL) &&
(tty->flip.count >= TTY_FLIPBUF_SIZE)){ (tty->flip.count >= TTY_FLIPBUF_SIZE)){
schedule_task(task); schedule_work(task);
goto out; goto out;
} }
err = chan->ops->read(chan->fd, &c, chan->data); err = chan->ops->read(chan->fd, &c, chan->data);
......
...@@ -215,7 +215,7 @@ int line_open(struct line *lines, struct tty_struct *tty, ...@@ -215,7 +215,7 @@ int line_open(struct line *lines, struct tty_struct *tty,
if(err) goto out; if(err) goto out;
} }
enable_chan(&line->chan_list, line); enable_chan(&line->chan_list, line);
INIT_TQUEUE(&line->task, line_timer_cb, line); INIT_WORK(&line->task, line_timer_cb, line);
} }
if(!line->sigio){ if(!line->sigio){
......
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
#include "linux/ctype.h" #include "linux/ctype.h"
#include "linux/interrupt.h" #include "linux/interrupt.h"
#include "linux/sysrq.h" #include "linux/sysrq.h"
#include "linux/tqueue.h" #include "linux/workqueue.h"
#include "linux/module.h" #include "linux/module.h"
#include "linux/proc_fs.h" #include "linux/proc_fs.h"
#include "asm/irq.h" #include "asm/irq.h"
...@@ -42,7 +42,7 @@ static struct notifier_block reboot_notifier = { ...@@ -42,7 +42,7 @@ static struct notifier_block reboot_notifier = {
LIST_HEAD(mc_requests); LIST_HEAD(mc_requests);
void mc_task_proc(void *unused) void mc_work_proc(void *unused)
{ {
struct mconsole_entry *req; struct mconsole_entry *req;
unsigned long flags; unsigned long flags;
...@@ -60,10 +60,7 @@ void mc_task_proc(void *unused) ...@@ -60,10 +60,7 @@ void mc_task_proc(void *unused)
} while(!done); } while(!done);
} }
struct tq_struct mconsole_task = { DECLARE_WORK(mconsole_work, mc_work_proc, NULL);
routine: mc_task_proc,
data: NULL
};
void mconsole_interrupt(int irq, void *dev_id, struct pt_regs *regs) void mconsole_interrupt(int irq, void *dev_id, struct pt_regs *regs)
{ {
...@@ -84,7 +81,7 @@ void mconsole_interrupt(int irq, void *dev_id, struct pt_regs *regs) ...@@ -84,7 +81,7 @@ void mconsole_interrupt(int irq, void *dev_id, struct pt_regs *regs)
} }
} }
} }
if(!list_empty(&mc_requests)) schedule_task(&mconsole_task); if(!list_empty(&mc_requests)) schedule_work(&mconsole_work);
reactivate_fd(fd, MCONSOLE_IRQ); reactivate_fd(fd, MCONSOLE_IRQ);
} }
......
...@@ -398,7 +398,7 @@ static int ubd_add(int n) ...@@ -398,7 +398,7 @@ static int ubd_add(int n)
devfs_handle_t real, fake; devfs_handle_t real, fake;
char name[sizeof("nnnnnn\0")]; char name[sizeof("nnnnnn\0")];
struct ubd *dev = &ubd_dev[n]; struct ubd *dev = &ubd_dev[n];
struct gendisk *disk, *fake_disk; struct gendisk *disk, *fake_disk = NULL;
u64 size; u64 size;
if (!dev->file) if (!dev->file)
...@@ -410,7 +410,7 @@ static int ubd_add(int n) ...@@ -410,7 +410,7 @@ static int ubd_add(int n)
disk->major = MAJOR_NR; disk->major = MAJOR_NR;
disk->first_minor = n << UBD_SHIFT; disk->first_minor = n << UBD_SHIFT;
disk->minor_shift = UBD_SHIFT; disk->minor_shift = UBD_SHIFT;
disk->fops = &ubd_fops; disk->fops = &ubd_blops;
if (fakehd_set) if (fakehd_set)
sprintf(disk->disk_name, "hd%c", n + 'a'); sprintf(disk->disk_name, "hd%c", n + 'a');
else else
...@@ -425,7 +425,7 @@ static int ubd_add(int n) ...@@ -425,7 +425,7 @@ static int ubd_add(int n)
fake_disk->major = fake_major; fake_disk->major = fake_major;
fake_disk->first_minor = n << UBD_SHIFT; fake_disk->first_minor = n << UBD_SHIFT;
fake_disk->minor_shift = UBD_SHIFT; fake_disk->minor_shift = UBD_SHIFT;
fake_disk->fops = &ubd_fops; fake_disk->fops = &ubd_blops;
sprintf(fake_disk->disk_name, "ubd%d", n); sprintf(fake_disk->disk_name, "ubd%d", n);
fake_gendisk[n] = fake_disk; fake_gendisk[n] = fake_disk;
} }
...@@ -434,7 +434,8 @@ static int ubd_add(int n) ...@@ -434,7 +434,8 @@ static int ubd_add(int n)
if (!dev->is_dir && ubd_file_size(dev, &size) == 0) { if (!dev->is_dir && ubd_file_size(dev, &size) == 0) {
set_capacity(disk, size/512); set_capacity(disk, size/512);
set_capacity(fake_disk, size/512); if (fake_major)
set_capacity(fake_disk, size/512);
} }
sprintf(name, "%d", n); sprintf(name, "%d", n);
...@@ -541,7 +542,7 @@ int ubd_init(void) ...@@ -541,7 +542,7 @@ int ubd_init(void)
} }
ubd_queue = BLK_DEFAULT_QUEUE(MAJOR_NR); ubd_queue = BLK_DEFAULT_QUEUE(MAJOR_NR);
INIT_QUEUE(ubd_queue, do_ubd_request, &ubd_lock); INIT_QUEUE(ubd_queue, do_ubd_request, &ubd_lock);
INIT_ELV(ubd_queue, &ubd_queue->elevator); elevator_init(ubd_queue, &elevator_noop);
if(fake_major != 0){ if(fake_major != 0){
char name[sizeof("ubd_nnn\0")]; char name[sizeof("ubd_nnn\0")];
......
...@@ -22,9 +22,6 @@ ...@@ -22,9 +22,6 @@
#define INIT_QUEUE(queue, request, lock) blk_init_queue(queue, request, lock) #define INIT_QUEUE(queue, request, lock) blk_init_queue(queue, request, lock)
#define ELV_NOOP elevator_noop
#define INIT_ELV(queue, elv) elevator_init(queue, elv, ELV_NOOP)
#define INIT_HARDSECT(arr, maj, sizes) #define INIT_HARDSECT(arr, maj, sizes)
#define SET_PRI(task) do ; while(0) #define SET_PRI(task) do ; while(0)
......
...@@ -22,7 +22,7 @@ struct chan { ...@@ -22,7 +22,7 @@ struct chan {
void *data; void *data;
}; };
extern void chan_interrupt(struct list_head *chans, struct tq_struct *task, extern void chan_interrupt(struct list_head *chans, struct work_struct *task,
struct tty_struct *tty, int irq, void *dev); struct tty_struct *tty, int irq, void *dev);
extern int parse_chan_pair(char *str, struct list_head *chans, int pri, extern int parse_chan_pair(char *str, struct list_head *chans, int pri,
int device, struct chan_opts *opts); int device, struct chan_opts *opts);
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
#define __LINE_H__ #define __LINE_H__
#include "linux/list.h" #include "linux/list.h"
#include "linux/tqueue.h" #include "linux/workqueue.h"
#include "linux/tty.h" #include "linux/tty.h"
#include "asm/semaphore.h" #include "asm/semaphore.h"
#include "chan_user.h" #include "chan_user.h"
...@@ -39,7 +39,7 @@ struct line { ...@@ -39,7 +39,7 @@ struct line {
char *head; char *head;
char *tail; char *tail;
int sigio; int sigio;
struct tq_struct task; struct work_struct task;
struct line_driver *driver; struct line_driver *driver;
int have_irq; int have_irq;
}; };
......
...@@ -14,8 +14,9 @@ obj-$(CONFIG_BLK_DEV_INITRD) += initrd_kern.o initrd_user.o ...@@ -14,8 +14,9 @@ obj-$(CONFIG_BLK_DEV_INITRD) += initrd_kern.o initrd_user.o
# user_syms.o not included here because Rules.make has its own ideas about # user_syms.o not included here because Rules.make has its own ideas about
# building anything in export-objs # building anything in export-objs
USER_OBJS = $(filter %_user.o,$(obj-y)) config.o process.o time.o umid.o \ USER_OBJS := $(filter %_user.o,$(obj-y)) config.o frame.o helper.o process.o \
user_util.o user_syms.o helper.o tty_log.o time.o tty_log.o umid.o user_util.o user_syms.o
USER_OBJS := $(foreach file,$(USER_OBJS),arch/um/kernel/$(file))
export-objs := ksyms.o process_kern.o signal_kern.o gprof_syms.o gmon_syms.o export-objs := ksyms.o process_kern.o signal_kern.o gprof_syms.o gmon_syms.o
...@@ -44,19 +45,18 @@ include $(TOPDIR)/Rules.make ...@@ -44,19 +45,18 @@ include $(TOPDIR)/Rules.make
$(USER_OBJS) : %.o: %.c $(USER_OBJS) : %.o: %.c
$(CC) $(CFLAGS_$@) $(USER_CFLAGS) -c -o $@ $< $(CC) $(CFLAGS_$@) $(USER_CFLAGS) -c -o $@ $<
unmap.o: unmap.c arch/um/kernel/unmap.o: arch/um/kernel/unmap.c
$(CC) $(UNMAP_CFLAGS) -c -o $@ $< $(CC) $(UNMAP_CFLAGS) -c -o $@ $<
frame.o: frame.c arch/um/kernel/unmap_fin.o : arch/um/kernel/unmap.o
$(CC) $(CFLAGS_$@) -c -o $@ $<
unmap_fin.o : unmap.o
ld -r -o $@ $< -lc -L/usr/lib ld -r -o $@ $< -lc -L/usr/lib
QUOTE = 'my $$config=`cat $(TOPDIR)/.config`; $$config =~ s/"/\\"/g ; while(<STDIN>) { $$_ =~ s/CONFIG/$$config/; print $$_ }' QUOTE = 'my $$config=`cat $(TOPDIR)/.config`; $$config =~ s/"/\\"/g ; while(<STDIN>) { $$_ =~ s/CONFIG/$$config/; print $$_ }'
config.c : config.c.in $(TOPDIR)/.config arch/um/kernel/config.c : arch/um/kernel/config.c.in $(TOPDIR)/.config
$(PERL) -e $(QUOTE) < config.c.in > $@ $(PERL) -e $(QUOTE) < arch/um/kernel/config.c.in > $@
arch/um/kernel/config.o : config.c
clean: clean:
rm -f config.c rm -f config.c
......
...@@ -6,9 +6,9 @@ ...@@ -6,9 +6,9 @@
#include "linux/sched.h" #include "linux/sched.h"
#include "linux/slab.h" #include "linux/slab.h"
#include "linux/bootmem.h" #include "linux/bootmem.h"
#include "asm/pgalloc.h"
#include "asm-generic/tlb.h" #include "asm-generic/tlb.h"
#include "asm/pgtable.h" #include "asm/pgtable.h"
#include "asm/pgalloc.h"
#include "asm/a.out.h" #include "asm/a.out.h"
#include "asm/processor.h" #include "asm/processor.h"
#include "asm/mmu_context.h" #include "asm/mmu_context.h"
......
LIB = lib.a obj-y = proxy.o ptrace.o sysdep.o wait.o
OBJS = proxy.o ptrace.o sysdep.o wait.o USER_OBJS := $(foreach file,$(obj-y),arch/um/ptproxy/$(file))
all: $(LIB) include $(TOPDIR)/Rules.make
$(LIB): $(OBJS)
rm -f $@
ar cr $@ $^
proxy.o: proxy.c
$(CC) $(USER_CFLAGS) $(EXTRA_CFLAGS) -c -o $@ $<
ptrace.o: ptrace.c
$(CC) $(USER_CFLAGS) $(EXTRA_CFLAGS) -c -o $@ $<
sysdep.o: sysdep.c
$(CC) $(USER_CFLAGS) $(EXTRA_CFLAGS) -c -o $@ $<
wait.o: wait.c $(USER_OBJS) : %.o: %.c
$(CC) $(USER_CFLAGS) $(EXTRA_CFLAGS) -c -o $@ $< $(CC) $(CFLAGS_$@) $(USER_CFLAGS) -c -o $@ $<
clean: clean:
rm -f *.o core child ptproxy rm -f *.o core child ptproxy
include $(TOPDIR)/Rules.make
obj-y = bugs.o checksum.o extable.o fault.o ksyms.o ldt.o old-checksum.o \ obj-y = bugs.o checksum.o extable.o fault.o ksyms.o ldt.o old-checksum.o \
ptrace.o ptrace_user.o semaphore.o sigcontext.o syscalls.o sysrq.o ptrace.o ptrace_user.o semaphore.o sigcontext.o syscalls.o sysrq.o
export-objs = ksyms.o export-objs = ksyms.o
USER_OBJS = bugs.o ptrace_user.o sigcontext.o fault.o USER_OBJS := bugs.o ptrace_user.o sigcontext.o fault.o
USER_OBJS := $(foreach file,$(USER_OBJS),arch/um/sys-i386/$(file))
SYMLINKS = semaphore.c old-checksum.c checksum.S extable.c SYMLINKS = semaphore.c old-checksum.c checksum.S extable.c
...@@ -13,17 +13,17 @@ include $(TOPDIR)/Rules.make ...@@ -13,17 +13,17 @@ include $(TOPDIR)/Rules.make
$(USER_OBJS) : %.o: %.c $(USER_OBJS) : %.o: %.c
$(CC) $(CFLAGS_$@) $(USER_CFLAGS) -c -o $@ $< $(CC) $(CFLAGS_$@) $(USER_CFLAGS) -c -o $@ $<
checksum.S old-checksum.c: arch/um/sys-i386/checksum.S arch/um/sys-i386/old-checksum.c:
-rm -f $@ -rm -f $@
-ln -s $(TOPDIR)/arch/i386/lib/$@ $@ -ln -s $(TOPDIR)/arch/i386/lib/$(notdir $@) $@
semaphore.c: arch/um/sys-i386/semaphore.c:
-rm -f $@ -rm -f $@
-ln -s $(TOPDIR)/arch/i386/kernel/$@ $@ -ln -s $(TOPDIR)/arch/i386/kernel/$(notdir $@) $@
extable.c: arch/um/sys-i386/extable.c:
-rm -f $@ -rm -f $@
-ln -s $(TOPDIR)/arch/i386/mm/$@ $@ -ln -s $(TOPDIR)/arch/i386/mm/$(notdir $@) $@
clean: clean:
$(MAKE) -C util clean $(MAKE) -C util clean
......
include $(TOPDIR)/Rules.make
all : mk_task all : mk_task
mk_task : mk_task_user.o mk_task_kern.o mk_task : mk_task_user.o mk_task_kern.o
...@@ -6,9 +8,6 @@ mk_task : mk_task_user.o mk_task_kern.o ...@@ -6,9 +8,6 @@ mk_task : mk_task_user.o mk_task_kern.o
mk_task_user.o : mk_task_user.c mk_task_user.o : mk_task_user.c
$(CC) -c $< $(CC) -c $<
mk_task_kern.o : mk_task_kern.c
$(CC) $(CFLAGS) -c $<
clean : clean :
$(RM) mk_task *.o *~ $(RM) mk_task *.o *~
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment