Commit c4884595 authored by Linus Torvalds's avatar Linus Torvalds

Merge http://jdike.stearns.org:5000/updates-2.5

into home.transmeta.com:/home/torvalds/v2.5/linux
parents 828915fc 08983405
......@@ -36,9 +36,8 @@ ARCH_SUBDIRS = $(ARCH_DIR)/drivers $(ARCH_DIR)/kernel \
SUBDIRS += $(ARCH_SUBDIRS)
core-y += $(ARCH_DIR)/kernel/ \
+= $(ARCH_DIR)/drivers/ \
+= $(ARCH_DIR)/sys-$(SUBARCH)/ \
+= $(ARCH_DIR)/os-$(OS)/
$(ARCH_DIR)/drivers/ \
$(ARCH_DIR)/sys-$(SUBARCH)/
libs-$(CONFIG_PT_PROXY) += $(ARCH_DIR)/ptproxy/
......@@ -53,15 +52,17 @@ CFLAGS += $(DEBUG) $(PROFILE) $(ARCH_CFLAGS) -D__arch_um__ \
-DSUBARCH=\"$(SUBARCH)\" -D_LARGEFILE64_SOURCE -I$(ARCH_INCLUDE) \
-Derrno=kernel_errno
LDFLAGS += -r
LINK_WRAPS = -Wl,--wrap,malloc -Wl,--wrap,free -Wl,--wrap,calloc
SIZE = (($(CONFIG_NEST_LEVEL) + $(CONFIG_KERNEL_HALF_GIGS)) * 0x20000000)
$(ARCH_DIR)/link.ld: $(ARCH_DIR)/link.ld.in
m4 -DSTART=$$(($(TOP_ADDR) - $(SIZE))) -DELF_ARCH=$(ELF_ARCH) \
-DELF_FORMAT=$(ELF_FORMAT) $< > $@
$(ARCH_DIR)/uml.lds.s : $(ARCH_DIR)/uml.lds.S
$(call if_changed_dep,as_s_S)
AFLAGS_uml.lds.o = -U$(SUBARCH) -DSTART=$$(($(TOP_ADDR) - $(SIZE))) \
-DELF_ARCH=$(ELF_ARCH) -DELF_FORMAT=\"$(ELF_FORMAT)\" -P -C -Uum
LDFLAGS_vmlinux = -r $(ARCH_DIR)/main.o
SYMLINK_HEADERS = include/asm-um/archparam.h include/asm-um/system.h \
include/asm-um/sigcontext.h include/asm-um/processor.h \
......@@ -72,11 +73,13 @@ ARCH_SYMLINKS = include/asm-um/arch arch/um/include/sysdep arch/um/os \
GEN_HEADERS = $(ARCH_DIR)/include/task.h
linux: scripts $(ARCH_SYMLINKS) $(SYS_HEADERS) $(GEN_HEADERS) $(ARCH_DIR)/main.o \
vmlinux $(ARCH_DIR)/link.ld
mv vmlinux vmlinux.o
$(CC) -Wl,-T,$(ARCH_DIR)/link.ld $(LINK_PROFILE) $(LINK_WRAPS) \
-o linux -static $(ARCH_DIR)/main.o vmlinux.o -L/usr/lib -lutil
$(ARCH_DIR)/vmlinux.lds.S :
touch $@
linux: scripts $(ARCH_SYMLINKS) $(SYS_HEADERS) $(GEN_HEADERS) \
arch/um/uml.lds.s $(ARCH_DIR)/main.o vmlinux
$(CC) -Wl,-T,arch/um/uml.lds.s -o $@ $(LINK_PROFILE) \
$(LINK_WRAPS) -static vmlinux -L/usr/lib -lutil
USER_CFLAGS := $(patsubst -I%,,$(CFLAGS))
USER_CFLAGS := $(patsubst -Derrno=kernel_errno,,$(USER_CFLAGS))
......
......@@ -3,5 +3,4 @@
# Licensed under the GPL
#
SUBDIRS += $(ARCH_DIR)/os-$(OS)/drivers
LIBS += $(ARCH_DIR)/os-$(OS)/drivers/drivers.o
core-y += $(ARCH_DIR)/os-$(OS)/
......@@ -206,6 +206,9 @@ CONFIG_EXT2_FS=y
# CONFIG_UDF_RW is not set
# CONFIG_UFS_FS is not set
# CONFIG_UFS_FS_WRITE is not set
# CONFIG_XFS_FS is not set
# CONFIG_XFS_RT is not set
# CONFIG_XFS_QUOTA is not set
#
# Network File Systems
......
......@@ -15,7 +15,6 @@
#include "linux/blk.h"
#include "linux/blkdev.h"
#include "linux/hdreg.h"
#include "linux/ide.h"
#include "linux/init.h"
#include "linux/devfs_fs_kernel.h"
#include "linux/cdrom.h"
......@@ -66,29 +65,44 @@ static struct block_device_operations ubd_blops = {
revalidate: ubd_revalidate,
};
static struct hd_struct ubd_part[MAX_MINOR] =
{ [ 0 ... MAX_MINOR - 1 ] = { 0, 0, 0 } };
static request_queue_t *ubd_queue;
static int fake_major = 0;
#define INIT_GENDISK(maj, name, parts, shift, blops) \
#define INIT_GENDISK(maj, index) \
{ \
major : maj, \
major_name : name, \
minor_shift : shift, \
part : parts, \
next : NULL, \
fops : blops, \
flags : 0 \
}
static struct gendisk ubd_gendisk = INIT_GENDISK(MAJOR_NR, "ubd", ubd_part,
UBD_SHIFT, &ubd_blops);
static struct gendisk fake_gendisk = INIT_GENDISK(0, "ubd", ubd_part,
UBD_SHIFT, &ubd_blops);
.major = maj, \
.major_name = "ubd", \
.minor_shift = UBD_SHIFT, \
.first_minor = index << UBD_SHIFT, \
.part = NULL, \
.next = NULL, \
.fops = &ubd_blops, \
.flags = GENHD_FL_DRIVERFS \
}
static struct gendisk ubd_gendisk[MAX_DEV] = {
INIT_GENDISK(MAJOR_NR, 0),
INIT_GENDISK(MAJOR_NR, 1),
INIT_GENDISK(MAJOR_NR, 2),
INIT_GENDISK(MAJOR_NR, 3),
INIT_GENDISK(MAJOR_NR, 4),
INIT_GENDISK(MAJOR_NR, 5),
INIT_GENDISK(MAJOR_NR, 6),
INIT_GENDISK(MAJOR_NR, 7)
};
static struct gendisk fake_gendisk[MAX_DEV] = {
INIT_GENDISK(0, 0),
INIT_GENDISK(0, 1),
INIT_GENDISK(0, 2),
INIT_GENDISK(0, 3),
INIT_GENDISK(0, 4),
INIT_GENDISK(0, 5),
INIT_GENDISK(0, 6),
INIT_GENDISK(0, 7)
};
#ifdef CONFIG_BLK_DEV_UBD_SYNC
#define OPEN_FLAGS ((struct openflags) { r : 1, w : 1, s : 1, c : 0 })
#else
......@@ -220,11 +234,12 @@ static int ubd_setup_common(char *str, int *index_out)
{
struct openflags flags = global_openflags;
char *backing_file;
int n;
int i, n;
if(index_out) *index_out = -1;
n = *str++;
if(n == '='){
static int fake_major_allowed = 1;
char *end;
int major;
......@@ -238,8 +253,17 @@ static int ubd_setup_common(char *str, int *index_out)
"ubd_setup : didn't parse major number\n");
return(1);
}
fake_gendisk.major = major;
if(!fake_major_allowed){
printk(KERN_ERR "Can't assign a fake major twice\n");
return(1);
}
for(i = 0; i < MAX_DEV; i++)
fake_gendisk[i].major = major;
fake_major = major;
fake_major_allowed = 0;
printk(KERN_INFO "Setting extra ubd major number to %d\n",
major);
return(0);
......@@ -315,9 +339,14 @@ __uml_help(ubd_setup,
static int fakehd(char *str)
{
int i;
printk(KERN_INFO
"fakehd : Changing ubd_gendisk.major_name to \"hd\".\n");
ubd_gendisk.major_name = "hd";
for(i = 0; i < MAX_DEV; i++)
ubd_gendisk[i].major_name = "hd";
return(1);
}
......@@ -401,14 +430,9 @@ static int ubd_add(int n)
{
devfs_handle_t real, fake;
char name[sizeof("nnnnnn\0")], dev_name[sizeof("ubd0x")];
int err;
if(ubd_dev[n].file == NULL) return(-1);
err = ubd_revalidate(mk_kdev(MAJOR_NR, n << UBD_SHIFT));
if(err)
return(err);
sprintf(name, "%d", n);
real = devfs_register(ubd_dir_handle, name, DEVFS_FL_REMOVABLE,
MAJOR_NR, n << UBD_SHIFT,
......@@ -427,9 +451,9 @@ static int ubd_add(int n)
if(real == NULL) return(-1);
ubd_dev[n].real = real;
if(!strcmp(ubd_gendisk.major_name, "ubd"))
sprintf(dev_name, "%s%d", ubd_gendisk.major_name, n);
else sprintf(dev_name, "%s%c", ubd_gendisk.major_name,
if(!strcmp(ubd_gendisk[n].major_name, "ubd"))
sprintf(dev_name, "%s%d", ubd_gendisk[n].major_name, n);
else sprintf(dev_name, "%s%c", ubd_gendisk[n].major_name,
n + 'a');
make_ide_entries(dev_name);
......@@ -510,7 +534,8 @@ int ubd_init(void)
INIT_QUEUE(ubd_queue, do_ubd_request, &ubd_lock);
INIT_ELV(ubd_queue, &ubd_queue->elevator);
INIT_HARDSECT(hardsect_size, MAJOR_NR, hardsect_sizes);
add_gendisk(&ubd_gendisk);
for(i = 0; i < MAX_DEV; i++)
add_disk(&ubd_gendisk[i]);
if(fake_major != 0){
char name[sizeof("ubd_nnn\0")];
......@@ -523,9 +548,11 @@ int ubd_init(void)
}
blk_dev[fake_major].queue = ubd_get_queue;
INIT_HARDSECT(hardsect_size, fake_major, hardsect_sizes);
add_gendisk(&fake_gendisk);
for(i = 0; i < MAX_DEV; i++)
add_disk(&fake_gendisk[i]);
}
for(i=0;i<MAX_DEV;i++) ubd_add(i);
for(i = 0; i < MAX_DEV; i++)
ubd_add(i);
return(0);
}
......@@ -647,9 +674,8 @@ static int ubd_open(struct inode *inode, struct file *filp)
"errno = %d\n", n, dev->file, -err);
return(err);
}
err = ubd_file_size(dev, &dev->size);
err = ubd_revalidate(inode->i_rdev);
if(err) return(err);
ubd_part[offset].nr_sects = dev->size / hardsect_sizes[offset];
}
dev->count++;
if((filp->f_mode & FMODE_WRITE) && !dev->openflags.w){
......@@ -667,10 +693,14 @@ static int ubd_release(struct inode * inode, struct file * file)
offset = n << UBD_SHIFT;
if(n > MAX_DEV)
return -ENODEV;
if(--ubd_dev[n].count == 0){
ubd_close(&ubd_dev[n]);
ubd_part[offset].nr_sects = 0;
del_gendisk(&ubd_gendisk[n]);
if(fake_major != 0)
del_gendisk(&fake_gendisk[n]);
}
return(0);
}
......@@ -741,7 +771,6 @@ static int prepare_request(struct request *req, struct io_thread_req *io_req)
return(1);
}
req->sector += ubd_part[min].start_sect;
block = req->sector;
nsect = req->current_nr_sectors;
......@@ -816,15 +845,6 @@ static int ubd_ioctl(struct inode * inode, struct file * file,
g.cylinders = dev->size / (128 * 32 * hardsect_sizes[min]);
g.start = 2;
return(copy_to_user(loc, &g, sizeof(g)) ? -EFAULT : 0);
case BLKGETSIZE: /* Return device size */
if(!arg) return(-EINVAL);
err = verify_area(VERIFY_WRITE, (long *) arg, sizeof(long));
if(err)
return(err);
put_user(ubd_part[min].nr_sects, (long *) arg);
return(0);
case BLKRRPART: /* Re-read partition tables */
return(ubd_revalidate(inode->i_rdev));
case HDIO_SET_UNMASKINTR:
if(!capable(CAP_SYS_ADMIN)) return(-EACCES);
......@@ -877,9 +897,9 @@ static int ubd_ioctl(struct inode * inode, struct file * file,
static int ubd_revalidate(kdev_t rdev)
{
int i, n, offset, err, pcount = 1 << UBD_SHIFT;
__u64 size;
int n, offset, err;
struct ubd *dev;
struct hd_struct *part;
n = minor(rdev) >> UBD_SHIFT;
offset = n << UBD_SHIFT;
......@@ -887,45 +907,20 @@ static int ubd_revalidate(kdev_t rdev)
if(dev->is_dir)
return(0);
part = &ubd_part[offset];
/* clear all old partition counts */
for(i = 1; i < pcount; i++) {
part[i].start_sect = 0;
part[i].nr_sects = 0;
}
/* If it already has been opened we can check the partitions
* directly
*/
if(dev->count){
part->start_sect = 0;
register_disk(&ubd_gendisk, mk_kdev(MAJOR_NR, offset), pcount,
&ubd_blops, part->nr_sects);
}
else if(dev->file){
err = ubd_open_dev(dev);
if(err){
printk(KERN_ERR "unable to open %s for validation\n",
dev->file);
return(err);
}
/* have to recompute sizes since we opened it */
err = ubd_file_size(dev, &dev->size);
if(err) {
ubd_close(dev);
return(err);
}
part->start_sect = 0;
part->nr_sects = dev->size / hardsect_sizes[offset];
register_disk(&ubd_gendisk, mk_kdev(MAJOR_NR, offset), pcount,
&ubd_blops, part->nr_sects);
/* we are done so close it */
err = ubd_file_size(dev, &size);
if(err) {
ubd_close(dev);
}
else return(-ENODEV);
return(err);
}
if(size != dev->size){
set_capacity(&ubd_gendisk[n], size / hardsect_sizes[offset]);
if(fake_major != 0)
set_capacity(&fake_gendisk[n],
size / hardsect_sizes[offset]);
dev->size = size;
}
return(0);
}
......
......@@ -10,7 +10,6 @@ obj-y = config.o exec_kern.o exec_user.o exitcode.o frame_kern.o frame.o \
umid.o user_util.o
obj-$(CONFIG_BLK_DEV_INITRD) += initrd_kern.o initrd_user.o
endif
# user_syms.o not included here because Rules.make has its own ideas about
# building anything in export-objs
......
......@@ -233,7 +233,7 @@ struct page *arch_validate(struct page *page, int mask, int order)
addr += PAGE_SIZE;
}
if(i == (1 << order)) return(page);
page = _alloc_pages(mask, order);
page = alloc_pages(mask, order);
goto again;
}
......
......@@ -48,7 +48,7 @@ struct task_struct *get_task(int pid, int require)
ret = NULL;
read_lock(&tasklist_lock);
for_each_task(task){
for_each_process(task){
if(task->pid == pid){
ret = task;
break;
......@@ -64,7 +64,7 @@ int is_valid_pid(int pid)
struct task_struct *task;
read_lock(&tasklist_lock);
for_each_task(task){
for_each_process(task){
if(task->thread.extern_pid == pid){
read_unlock(&tasklist_lock);
return(1);
......
......@@ -15,7 +15,7 @@ static void kill_off_processes(void)
int me;
me = os_getpid();
for_each_task(p){
for_each_process(p){
if(p->thread.extern_pid != me)
os_kill_process(p->thread.extern_pid);
}
......
......@@ -223,6 +223,12 @@ extern syscall_handler_t sys_sendfile64;
extern syscall_handler_t sys_futex;
extern syscall_handler_t sys_sched_setaffinity;
extern syscall_handler_t sys_sched_getaffinity;
extern syscall_handler_t sys_io_setup;
extern syscall_handler_t sys_io_destroy;
extern syscall_handler_t sys_io_getevents;
extern syscall_handler_t sys_io_submit;
extern syscall_handler_t sys_io_cancel;
extern syscall_handler_t sys_exit_group;
#if CONFIG_NFSD
#define NFSSERVCTL sys_nfsserctl
......@@ -234,7 +240,7 @@ extern syscall_handler_t um_mount;
extern syscall_handler_t um_time;
extern syscall_handler_t um_stime;
#define LAST_GENERIC_SYSCALL __NR_sched_getaffinity
#define LAST_GENERIC_SYSCALL __NR_exit_group
#if LAST_GENERIC_SYSCALL > LAST_ARCH_SYSCALL
#define LAST_SYSCALL LAST_GENERIC_SYSCALL
......@@ -465,6 +471,14 @@ syscall_handler_t *sys_call_table[] = {
[ __NR_futex ] = sys_futex,
[ __NR_sched_setaffinity ] = sys_sched_setaffinity,
[ __NR_sched_getaffinity ] = sys_sched_getaffinity,
[ __NR_io_setup ] = sys_io_setup,
[ __NR_io_destroy ] = sys_io_destroy,
[ __NR_io_getevents ] = sys_io_getevents,
[ __NR_io_submit ] = sys_io_submit,
[ __NR_io_cancel ] = sys_io_cancel,
[ __NR_alloc_hugepages ] = sys_ni_syscall,
[ __NR_free_hugepages ] = sys_ni_syscall,
[ __NR_exit_group ] = sys_exit_group,
ARCH_SYSCALLS
[ LAST_SYSCALL + 1 ... NR_syscalls ] =
......
OUTPUT_FORMAT("ELF_FORMAT")
OUTPUT_FORMAT(ELF_FORMAT)
OUTPUT_ARCH(ELF_ARCH)
ENTRY(_start)
jiffies = jiffies_64;
SECTIONS
{
. = START() + SIZEOF_HEADERS;
. = START + SIZEOF_HEADERS;
. = ALIGN(4096);
__binary_start = .;
......
......@@ -6,7 +6,6 @@
*/
struct task_struct;
#include "asm/arch/irq.h"
#include "asm/ptrace.h"
#undef NR_IRQS
......
#ifndef __UM_CACHEFLUSH_H
#define __UM_CACHEFLUSH_H
#ifndef __UM_PERCPU_H
#define __UM_PERCPU_H
#include "asm/arch/percpu.h"
......
......@@ -358,6 +358,18 @@ static inline pmd_t * pmd_offset(pgd_t * dir, unsigned long address)
#define pte_unmap(pte) kunmap_atomic(pte, KM_PTE0)
#define pte_unmap_nested(pte) kunmap_atomic(pte, KM_PTE1)
#if defined(CONFIG_HIGHPTE) && defined(CONFIG_HIGHMEM4G)
typedef u32 pte_addr_t;
#endif
#if defined(CONFIG_HIGHPTE) && defined(CONFIG_HIGHMEM64G)
typedef u64 pte_addr_t;
#endif
#if !defined(CONFIG_HIGHPTE)
typedef pte_t *pte_addr_t;
#endif
#define update_mmu_cache(vma,address,pte) do ; while (0)
/* Encode and de-code a swap entry */
......
......@@ -3,4 +3,35 @@
#include "asm/system-generic.h"
static inline unsigned long __cmpxchg(volatile void *ptr, unsigned long old,
unsigned long new, int size)
{
unsigned long prev;
switch (size) {
case 1:
__asm__ __volatile__(LOCK_PREFIX "cmpxchgb %b1,%2"
: "=a"(prev)
: "q"(new), "m"(*__xg(ptr)), "0"(old)
: "memory");
return prev;
case 2:
__asm__ __volatile__(LOCK_PREFIX "cmpxchgw %w1,%2"
: "=a"(prev)
: "q"(new), "m"(*__xg(ptr)), "0"(old)
: "memory");
return prev;
case 4:
__asm__ __volatile__(LOCK_PREFIX "cmpxchgl %1,%2"
: "=a"(prev)
: "q"(new), "m"(*__xg(ptr)), "0"(old)
: "memory");
return prev;
}
return old;
}
#define cmpxchg(ptr,o,n)\
((__typeof__(*(ptr)))__cmpxchg((ptr),(unsigned long)(o),\
(unsigned long)(n),sizeof(*(ptr))))
#endif
......@@ -12,4 +12,6 @@ static inline cycles_t get_cycles (void)
return 0;
}
#define CLOCK_TICK_RATE (HZ)
#endif
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