Commit 3da9cf28 authored by Linus Torvalds's avatar Linus Torvalds

Merge penguin:v2.5/linux

into home.transmeta.com:/home/torvalds/v2.5/linux
parents 7f9efd7d 8a9b07a2
......@@ -2779,6 +2779,10 @@ N: Christopher Smith
E: x@xman.org
D: Tulip net driver hacker
N: Mark Smith
E: mark.smith@comdev.cc
D: Multicast support in bonding driver
N: Miquel van Smoorenburg
E: miquels@cistron.nl
D: Kernel and net hacker. Sysvinit, minicom. doing Debian stuff.
......
......@@ -22,8 +22,8 @@ extern void cpu_probe(void);
extern void clock_stop_probe(void); /* tadpole.c */
extern void sun4c_probe_memerr_reg(void);
unsigned long __init
device_scan(unsigned long mem_start)
void __init
device_scan(void)
{
char node_str[128];
int thismid;
......@@ -37,46 +37,45 @@ device_scan(unsigned long mem_start)
int scan;
scan = prom_getchild(prom_root_node);
/* One can look it up in PROM instead */
/* prom_printf("root child is %08lx\n", (unsigned long) scan); */
while((scan = prom_getsibling(scan)) != 0) {
prom_getstring(scan, "device_type", node_str, sizeof(node_str));
if(strcmp(node_str, "cpu") == 0) {
while ((scan = prom_getsibling(scan)) != 0) {
prom_getstring(scan, "device_type",
node_str, sizeof(node_str));
if (strcmp(node_str, "cpu") == 0) {
linux_cpus[linux_num_cpus].prom_node = scan;
prom_getproperty(scan, "mid", (char *) &thismid, sizeof(thismid));
prom_getproperty(scan, "mid",
(char *) &thismid, sizeof(thismid));
linux_cpus[linux_num_cpus].mid = thismid;
/* prom_printf("Found CPU %d <node=%08lx,mid=%d>\n", linux_num_cpus, (unsigned long) scan, thismid); */
printk("Found CPU %d <node=%08lx,mid=%d>\n", linux_num_cpus, (unsigned long) scan, thismid);
printk("Found CPU %d <node=%08lx,mid=%d>\n",
linux_num_cpus, (unsigned long) scan, thismid);
linux_num_cpus++;
}
}
if(linux_num_cpus == 0) {
if (sparc_cpu_model == sun4d) {
if (linux_num_cpus == 0 && sparc_cpu_model == sun4d) {
scan = prom_getchild(prom_root_node);
for (scan = prom_searchsiblings(scan, "cpu-unit"); scan;
scan = prom_searchsiblings(prom_getsibling(scan), "cpu-unit")) {
int node = prom_getchild(scan);
prom_getstring(node, "device_type", node_str, sizeof(node_str));
prom_getstring(node, "device_type",
node_str, sizeof(node_str));
if (strcmp(node_str, "cpu") == 0) {
prom_getproperty(node, "cpu-id", (char *) &thismid, sizeof(thismid));
prom_getproperty(node, "cpu-id",
(char *) &thismid, sizeof(thismid));
linux_cpus[linux_num_cpus].prom_node = node;
linux_cpus[linux_num_cpus].mid = thismid;
/* prom_printf("Found CPU %d <node=%08lx,mid=%d>\n",
linux_num_cpus, (unsigned long) node, thismid); */
printk("Found CPU %d <node=%08lx,mid=%d>\n",
linux_num_cpus, (unsigned long) node, thismid);
linux_num_cpus++;
}
}
}
}
if(linux_num_cpus == 0) {
if (linux_num_cpus == 0) {
printk("No CPU nodes found, cannot continue.\n");
/* Probably a sun4e, Sun is trying to trick us ;-) */
halt();
}
printk("Found %d CPU prom device tree node(s).\n", linux_num_cpus);
};
}
cpu_probe();
#ifdef CONFIG_SUN_AUXIO
......@@ -92,5 +91,5 @@ device_scan(unsigned long mem_start)
if (ARCH_SUN4C_SUN4)
sun4c_probe_memerr_reg();
return mem_start;
return;
}
This diff is collapsed.
......@@ -31,11 +31,6 @@ else
endif
endif
#
# This is just to get the dependencies...
#
binfmt_elf32.o: $(TOPDIR)/fs/binfmt_elf.c
ifneq ($(NEW_GCC),y)
CMODEL_CFLAG := -mmedlow
else
......
......@@ -2879,16 +2879,19 @@ do_execve32(char * filename, u32 * argv, u32 * envp, struct pt_regs * regs)
bprm.sh_bang = 0;
bprm.loader = 0;
bprm.exec = 0;
if ((bprm.argc = count32(argv, bprm.p / sizeof(u32))) < 0) {
allow_write_access(file);
fput(file);
return bprm.argc;
}
if ((bprm.envc = count32(envp, bprm.p / sizeof(u32))) < 0) {
allow_write_access(file);
fput(file);
return bprm.envc;
}
bprm.mm = mm_alloc();
retval = -ENOMEM;
if (!bprm.mm)
goto out_file;
bprm.argc = count32(argv, bprm.p / sizeof(u32));
if ((retval = bprm.argc) < 0)
goto out_mm;
bprm.envc = count32(envp, bprm.p / sizeof(u32));
if ((retval = bprm.envc) < 0)
goto out_mm;
retval = prepare_binprm(&bprm);
if (retval < 0)
......@@ -2914,14 +2917,20 @@ do_execve32(char * filename, u32 * argv, u32 * envp, struct pt_regs * regs)
out:
/* Something went wrong, return the inode and free the argument pages*/
allow_write_access(bprm.file);
if (bprm.file)
fput(bprm.file);
for (i = 0 ; i < MAX_ARG_PAGES ; i++) {
struct page * page = bprm.page[i];
if (page)
__free_page(page);
}
for (i=0 ; i<MAX_ARG_PAGES ; i++)
if (bprm.page[i])
__free_page(bprm.page[i]);
out_mm:
mmdrop(bprm.mm);
out_file:
if (bprm.file) {
allow_write_access(bprm.file);
fput(bprm.file);
}
return retval;
}
......
......@@ -17,20 +17,10 @@
static inline void forget_pte(pte_t page)
{
if (pte_none(page))
return;
if (pte_present(page)) {
unsigned long pfn = pte_pfn(page);
struct page *ptpage;
if (!pfn_valid(pfn))
return;
ptpage = pfn_to_page(page);
if (PageReserved(ptpage))
return;
page_cache_release(ptpage);
return;
if (!pte_none(page)) {
printk("forget_pte: old mapping existed!\n");
BUG();
}
swap_free(pte_to_swp_entry(page));
}
/* Remap IO memory, the same way as remap_page_range(), but use
......
......@@ -44,6 +44,6 @@ static int sys_bus_init(void)
return device_register(&system_bus);
}
subsys_initcall(sys_bus_init);
postcore_initcall(sys_bus_init);
EXPORT_SYMBOL(register_sys_device);
EXPORT_SYMBOL(unregister_sys_device);
......@@ -1069,7 +1069,9 @@ static void idedisk_setup(struct ata_device *drive)
}
#else
printk("%s: setmax_ext LBA %llu, native %llu\n",
drive->name, set_max_ext, capacity_2);
drive->name,
(long long) set_max_ext,
(long long) capacity_2);
#endif
}
drive->bios_cyl = drive->cyl;
......
......@@ -451,7 +451,7 @@ static void __init setup_pci_device(struct pci_dev *dev, struct ata_pci_device *
if (d->init_chipset)
d->init_chipset(dev);
#ifdef __sparc__
printk(KERN_INFO "ATA: 100%% native mode on irq\n", __irq_itoa(pciirq));
printk(KERN_INFO "ATA: 100%% native mode on irq %s\n", __irq_itoa(pciirq));
#else
printk(KERN_INFO "ATA: 100%% native mode on irq %d\n", pciirq);
#endif
......
......@@ -875,7 +875,8 @@ static void channel_probe(struct ata_channel *ch)
/* Register this hardware interface within the global device tree.
*/
sprintf(ch->dev.bus_id, "%04x", ch->io_ports[IDE_DATA_OFFSET]);
sprintf(ch->dev.bus_id, "%04lx",
(unsigned long) ch->io_ports[IDE_DATA_OFFSET]);
sprintf(ch->dev.name, "ide");
ch->dev.driver_data = ch;
#ifdef CONFIG_PCI
......
This diff is collapsed.
......@@ -204,7 +204,7 @@ static int __init pci_driver_init(void)
return bus_register(&pci_bus_type);
}
subsys_initcall(pci_driver_init);
postcore_initcall(pci_driver_init);
EXPORT_SYMBOL(pci_match_device);
EXPORT_SYMBOL(pci_register_driver);
......
......@@ -126,6 +126,10 @@
#include <asm/semaphore.h>
#include <asm/uaccess.h>
#define IS_POSIX(fl) (fl->fl_flags & FL_POSIX)
#define IS_FLOCK(fl) (fl->fl_flags & FL_FLOCK)
#define IS_LEASE(fl) (fl->fl_flags & FL_LEASE)
int leases_enable = 1;
int lease_break_time = 45;
......@@ -561,8 +565,7 @@ static int posix_locks_conflict(struct file_lock *caller_fl, struct file_lock *s
/* POSIX locks owned by the same process do not conflict with
* each other.
*/
if (!(sys_fl->fl_flags & FL_POSIX) ||
locks_same_owner(caller_fl, sys_fl))
if (!IS_POSIX(sys_fl) || locks_same_owner(caller_fl, sys_fl))
return (0);
/* Check whether they overlap */
......@@ -580,8 +583,7 @@ static int flock_locks_conflict(struct file_lock *caller_fl, struct file_lock *s
/* FLOCK locks referring to the same filp do not conflict with
* each other.
*/
if (!(sys_fl->fl_flags & FL_FLOCK) ||
(caller_fl->fl_file == sys_fl->fl_file))
if (!IS_FLOCK(sys_fl) || (caller_fl->fl_file == sys_fl->fl_file))
return (0);
#ifdef MSNFS
if ((caller_fl->fl_type & LOCK_MAND) || (sys_fl->fl_type & LOCK_MAND))
......@@ -634,7 +636,7 @@ posix_test_lock(struct file *filp, struct file_lock *fl)
lock_kernel();
for (cfl = filp->f_dentry->d_inode->i_flock; cfl; cfl = cfl->fl_next) {
if (!(cfl->fl_flags & FL_POSIX))
if (!IS_POSIX(cfl))
continue;
if (posix_locks_conflict(cfl, fl))
break;
......@@ -696,7 +698,7 @@ int locks_mandatory_locked(struct inode *inode)
*/
lock_kernel();
for (fl = inode->i_flock; fl != NULL; fl = fl->fl_next) {
if (!(fl->fl_flags & FL_POSIX))
if (!IS_POSIX(fl))
continue;
if (fl->fl_owner != owner)
break;
......@@ -732,7 +734,7 @@ int locks_mandatory_area(int read_write, struct inode *inode,
* the proposed read/write.
*/
for (fl = inode->i_flock; fl != NULL; fl = fl->fl_next) {
if (!(fl->fl_flags & FL_POSIX))
if (!IS_POSIX(fl))
continue;
if (fl->fl_start > new_fl->fl_end)
break;
......@@ -790,7 +792,7 @@ static int flock_lock_file(struct file *filp, unsigned int lock_type,
search:
change = 0;
before = &inode->i_flock;
while (((fl = *before) != NULL) && (fl->fl_flags & FL_FLOCK)) {
while (((fl = *before) != NULL) && IS_FLOCK(fl)) {
if (filp == fl->fl_file) {
if (lock_type == fl->fl_type)
goto out;
......@@ -815,7 +817,7 @@ static int flock_lock_file(struct file *filp, unsigned int lock_type,
goto out;
repeat:
for (fl = inode->i_flock; (fl != NULL) && (fl->fl_flags & FL_FLOCK);
for (fl = inode->i_flock; (fl != NULL) && IS_FLOCK(fl);
fl = fl->fl_next) {
if (!flock_locks_conflict(new_fl, fl))
continue;
......@@ -880,7 +882,7 @@ int posix_lock_file(struct file *filp, struct file_lock *caller,
if (caller->fl_type != F_UNLCK) {
repeat:
for (fl = inode->i_flock; fl != NULL; fl = fl->fl_next) {
if (!(fl->fl_flags & FL_POSIX))
if (!IS_POSIX(fl))
continue;
if (!posix_locks_conflict(caller, fl))
continue;
......@@ -909,7 +911,7 @@ int posix_lock_file(struct file *filp, struct file_lock *caller,
/* First skip locks owned by other processes.
*/
while ((fl = *before) && (!(fl->fl_flags & FL_POSIX) ||
while ((fl = *before) && (!IS_POSIX(fl) ||
!locks_same_owner(caller, fl))) {
before = &fl->fl_next;
}
......@@ -1085,7 +1087,7 @@ int __get_lease(struct inode *inode, unsigned int mode)
if (error != 0)
goto out;
flock = inode->i_flock;
if (!(flock && (flock->fl_flags & FL_LEASE)))
if (!(flock && IS_LEASE(flock)))
goto out;
} while (flock->fl_type & F_INPROGRESS);
}
......@@ -1110,7 +1112,7 @@ int __get_lease(struct inode *inode, unsigned int mode)
do {
fl->fl_type = future;
fl = fl->fl_next;
} while (fl != NULL && (fl->fl_flags & FL_LEASE));
} while (fl != NULL && IS_LEASE(fl));
kill_fasync(&flock->fl_fasync, SIGIO, POLL_MSG);
......@@ -1131,7 +1133,7 @@ int __get_lease(struct inode *inode, unsigned int mode)
printk(KERN_WARNING "lease timed out\n");
} else if (error > 0) {
flock = inode->i_flock;
if (flock && (flock->fl_flags & FL_LEASE))
if (flock && IS_LEASE(flock))
goto restart;
error = 0;
}
......@@ -1154,7 +1156,7 @@ int __get_lease(struct inode *inode, unsigned int mode)
time_t lease_get_mtime(struct inode *inode)
{
struct file_lock *flock = inode->i_flock;
if (flock && (flock->fl_flags & FL_LEASE) && (flock->fl_type & F_WRLCK))
if (flock && IS_LEASE(flock) && (flock->fl_type & F_WRLCK))
return CURRENT_TIME;
return inode->i_mtime;
}
......@@ -1177,7 +1179,7 @@ int fcntl_getlease(struct file *filp)
struct file_lock *fl;
fl = filp->f_dentry->d_inode->i_flock;
if ((fl == NULL) || ((fl->fl_flags & FL_LEASE) == 0))
if ((fl == NULL) || !IS_LEASE(fl))
return F_UNLCK;
return fl->fl_type & ~F_INPROGRESS;
}
......@@ -1243,7 +1245,7 @@ int fcntl_setlease(unsigned int fd, struct file *filp, long arg)
lock_kernel();
while ((fl = *before) != NULL) {
if (fl->fl_flags != FL_LEASE)
if (!IS_LEASE(fl))
break;
if (fl->fl_file == filp)
my_before = before;
......@@ -1646,7 +1648,7 @@ void locks_remove_posix(struct file *filp, fl_owner_t owner)
lock_kernel();
before = &inode->i_flock;
while ((fl = *before) != NULL) {
if ((fl->fl_flags & FL_POSIX) && fl->fl_owner == owner) {
if (IS_POSIX(fl) && fl->fl_owner == owner) {
locks_unlock_delete(before);
before = &inode->i_flock;
continue;
......@@ -1672,8 +1674,7 @@ void locks_remove_flock(struct file *filp)
before = &inode->i_flock;
while ((fl = *before) != NULL) {
if ((fl->fl_flags & (FL_FLOCK|FL_LEASE))
&& (fl->fl_file == filp)) {
if ((IS_FLOCK(fl) || IS_LEASE(fl)) && (fl->fl_file == filp)) {
locks_delete_lock(before, 0);
continue;
}
......@@ -1716,21 +1717,21 @@ static void lock_get_status(char* out, struct file_lock *fl, int id, char *pfx)
inode = fl->fl_file->f_dentry->d_inode;
out += sprintf(out, "%d:%s ", id, pfx);
if (fl->fl_flags & FL_POSIX) {
if (IS_POSIX(fl)) {
out += sprintf(out, "%6s %s ",
(fl->fl_flags & FL_ACCESS) ? "ACCESS" : "POSIX ",
(inode == NULL) ? "*NOINODE*" :
(IS_MANDLOCK(inode) &&
(inode->i_mode & (S_IXGRP | S_ISGID)) == S_ISGID) ?
"MANDATORY" : "ADVISORY ");
} else if (fl->fl_flags & FL_FLOCK) {
} else if (IS_FLOCK(fl)) {
#ifdef MSNFS
if (fl->fl_type & LOCK_MAND) {
out += sprintf(out, "FLOCK MSNFS ");
} else
#endif
out += sprintf(out, "FLOCK ADVISORY ");
} else if (fl->fl_flags & FL_LEASE) {
} else if (IS_LEASE(fl)) {
out += sprintf(out, "LEASE MANDATORY ");
} else {
out += sprintf(out, "UNKNOWN UNKNOWN ");
......@@ -1844,12 +1845,12 @@ int lock_may_read(struct inode *inode, loff_t start, unsigned long len)
int result = 1;
lock_kernel();
for (fl = inode->i_flock; fl != NULL; fl = fl->fl_next) {
if (fl->fl_flags == FL_POSIX) {
if (IS_POSIX(fl)) {
if (fl->fl_type == F_RDLCK)
continue;
if ((fl->fl_end < start) || (fl->fl_start > (start + len)))
continue;
} else if (fl->fl_flags == FL_FLOCK) {
} else if (IS_FLOCK(fl)) {
if (!(fl->fl_type & LOCK_MAND))
continue;
if (fl->fl_type & LOCK_READ)
......@@ -1882,10 +1883,10 @@ int lock_may_write(struct inode *inode, loff_t start, unsigned long len)
int result = 1;
lock_kernel();
for (fl = inode->i_flock; fl != NULL; fl = fl->fl_next) {
if (fl->fl_flags == FL_POSIX) {
if (IS_POSIX(fl)) {
if ((fl->fl_end < start) || (fl->fl_start > (start + len)))
continue;
} else if (fl->fl_flags == FL_FLOCK) {
} else if (IS_FLOCK(fl)) {
if (!(fl->fl_type & LOCK_MAND))
continue;
if (fl->fl_type & LOCK_WRITE)
......
......@@ -232,6 +232,8 @@ typedef struct sigevent {
#ifdef __KERNEL__
struct siginfo;
#ifndef HAVE_ARCH_COPY_SIGINFO
#include <linux/string.h>
......
......@@ -16,7 +16,22 @@ extern unsigned int ___illegal_use_of_BTFIXUP_SIMM13_in_module(void);
extern unsigned int ___illegal_use_of_BTFIXUP_SETHI_in_module(void);
extern unsigned int ___illegal_use_of_BTFIXUP_HALF_in_module(void);
extern unsigned int ___illegal_use_of_BTFIXUP_INT_in_module(void);
#endif
#define BTFIXUP_SIMM13(__name) ___illegal_use_of_BTFIXUP_SIMM13_in_module()
#define BTFIXUP_HALF(__name) ___illegal_use_of_BTFIXUP_HALF_in_module()
#define BTFIXUP_SETHI(__name) ___illegal_use_of_BTFIXUP_SETHI_in_module()
#define BTFIXUP_INT(__name) ___illegal_use_of_BTFIXUP_INT_in_module()
#define BTFIXUP_BLACKBOX(__name) ___illegal_use_of_BTFIXUP_BLACKBOX_in_module
#else
#define BTFIXUP_SIMM13(__name) ___sf_##__name()
#define BTFIXUP_HALF(__name) ___af_##__name()
#define BTFIXUP_SETHI(__name) ___hf_##__name()
#define BTFIXUP_INT(__name) ((unsigned int)&___i_##__name)
/* This must be written in assembly and present in a sethi */
#define BTFIXUP_BLACKBOX(__name) ___b_##__name
#endif /* MODULE */
/* Fixup call xx */
......@@ -30,12 +45,6 @@ extern unsigned int ___illegal_use_of_BTFIXUP_INT_in_module(void);
#define BTFIXUPDEF_BLACKBOX(__name) \
extern unsigned ___bs_##__name[2];
#ifdef MODULE
#define BTFIXUP_BLACKBOX(__name) ___illegal_use_of_BTFIXUP_BLACKBOX_in_module
#else
/* This must be written in assembly and present in a sethi */
#define BTFIXUP_BLACKBOX(__name) ___b_##__name
#endif
/* Put bottom 13bits into some register variable */
......@@ -55,11 +64,6 @@ extern unsigned int ___illegal_use_of_BTFIXUP_INT_in_module(void);
__asm__ ("or %%g0, ___s_" #__name "__btset_" #__val ", %0" : "=r"(ret));\
return ret; \
}
#ifdef MODULE
#define BTFIXUP_SIMM13(__name) ___illegal_use_of_BTFIXUP_SIMM13_in_module()
#else
#define BTFIXUP_SIMM13(__name) ___sf_##__name()
#endif
/* Put either bottom 13 bits, or upper 22 bits into some register variable
* (depending on the value, this will lead into sethi FIX, reg; or
......@@ -82,11 +86,6 @@ extern unsigned int ___illegal_use_of_BTFIXUP_INT_in_module(void);
__asm__ ("or %%g0, ___a_" #__name "__btset_" #__val ", %0" : "=r"(ret));\
return ret; \
}
#ifdef MODULE
#define BTFIXUP_HALF(__name) ___illegal_use_of_BTFIXUP_HALF_in_module()
#else
#define BTFIXUP_HALF(__name) ___af_##__name()
#endif
/* Put upper 22 bits into some register variable */
......@@ -107,22 +106,12 @@ extern unsigned int ___illegal_use_of_BTFIXUP_INT_in_module(void);
"=r"(ret)); \
return ret; \
}
#ifdef MODULE
#define BTFIXUP_SETHI(__name) ___illegal_use_of_BTFIXUP_SETHI_in_module()
#else
#define BTFIXUP_SETHI(__name) ___hf_##__name()
#endif
/* Put a full 32bit integer into some register variable */
#define BTFIXUPDEF_INT(__name) \
extern unsigned char ___i_##__name; \
extern unsigned ___is_##__name[2];
#ifdef MODULE
#define BTFIXUP_INT(__name) ___illegal_use_of_BTFIXUP_INT_in_module()
#else
#define BTFIXUP_INT(__name) ((unsigned int)&___i_##__name)
#endif
#define BTFIXUPCALL_NORM 0x00000000 /* Always call */
#define BTFIXUPCALL_NOP 0x01000000 /* Possibly optimize to nop */
......
......@@ -54,8 +54,8 @@
#define clear_page(page) memset((void *)(page), 0, PAGE_SIZE)
#define copy_page(to,from) memcpy((void *)(to), (void *)(from), PAGE_SIZE)
#define clear_user_page(page, vaddr) clear_page(page)
#define copy_user_page(to, from, vaddr) copy_page(to, from)
#define clear_user_page(addr, vaddr, page) clear_page(addr)
#define copy_user_page(to, from, vaddr, page) copy_page(to, from)
/* The following structure is used to hold the physical
* memory configuration of the machine. This is filled in
......
/* $Id: ultra.h,v 1.2 1995/11/25 02:33:10 davem Exp $
* ultra.h: Definitions and defines for the TI V9 UltraSparc.
*
* Copyright (C) 1995 David S. Miller (davem@caip.rutgers.edu)
*/
#ifndef _SPARC_ULTRA_H
#define _SPARC_ULTRA_H
/* Spitfire MMU control register:
*
* ----------------------------------------------------------
* | | IMPL | VERS | | MID | |
* ----------------------------------------------------------
* 64 31-28 27-24 23-22 21-17 16 0
*
* IMPL: Implementation of this Spitfire.
* VERS: Version of this Spitfire.
* MID: Module ID of this processor.
*/
#define SPITFIRE_MIDMASK 0x00000000003e0000
/* Spitfire Load Store Unit control register:
*
* ---------------------------------------------------------------------
* | RSV | PWR | PWW | VWR | VWW | RSV | PMASK | DME | IME | DCE | ICE |
* ---------------------------------------------------------------------
* 63-25 24 23 22 21 20 19-4 3 2 1 0
*
* PWR: Physical Watchpoint Read enable: 0=off 1=on
* PWW: Physical Watchpoint Write enable: 0=off 1=on
* VWR: Virtual Watchpoint Read enable: 0=off 1=on
* VWW: Virtual Watchpoint Write enable: 0=off 1=on
* PMASK: Parity MASK ???
* DME: Data MMU Enable: 0=off 1=on
* IME: Instruction MMU Enable: 0=off 1=on
* DCE: Data Cache Enable: 0=off 1=on
* ICE: Instruction Cache Enable: 0=off 1=on
*/
#define SPITFIRE_LSU_PWR 0x01000000
#define SPITFIRE_LSU_PWW 0x00800000
#define SPITFIRE_LSU_VWR 0x00400000
#define SPITFIRE_LSU_VWW 0x00200000
#define SPITFIRE_LSU_PMASK 0x000ffff0
#define SPITFIRE_LSU_DME 0x00000008
#define SPITFIRE_LSU_IME 0x00000004
#define SPITFIRE_LSU_DCE 0x00000002
#define SPITFIRE_LSU_ICE 0x00000001
#endif /* !(_SPARC_ULTRA_H) */
......@@ -107,8 +107,6 @@ struct sun4c_vac_props {
extern struct sun4c_vac_props sun4c_vacinfo;
extern void sun4c_flush_all(void);
/* sun4c_enable_vac() enables the sun4c virtual address cache. */
extern __inline__ void sun4c_enable_vac(void)
{
......
......@@ -35,8 +35,9 @@ extern void do_BUG(const char *file, int line);
extern void _clear_page(void *page);
#define clear_page(X) _clear_page((void *)(X))
extern void clear_user_page(void *page, unsigned long vaddr);
extern void copy_user_page(void *to, void *from, unsigned long vaddr);
struct page;
extern void clear_user_page(void *addr, unsigned long vaddr, struct page *page);
extern void copy_user_page(void *to, void *from, unsigned long vaddr, struct page *topage);
/* GROSS, defining this makes gcc pass these types as aggregates,
* and thus on the stack, turn this crap off... -DaveM
......
......@@ -51,7 +51,7 @@
#define BOND_STATE_ACTIVE 0 /* link is active */
#define BOND_STATE_BACKUP 1 /* link is backup */
#define MAX_BONDS 1 /* Maximum number of devices to support */
#define BOND_DEFAULT_MAX_BONDS 1 /* Default maximum number of devices to support */
typedef struct ifbond {
__s32 bond_mode;
......@@ -76,6 +76,7 @@ typedef struct slave {
short delay;
char link; /* one of BOND_LINK_XXXX */
char state; /* one of BOND_STATE_XXXX */
unsigned short original_flags;
u32 link_failure_count;
} slave_t;
......@@ -104,6 +105,8 @@ typedef struct bonding {
#endif /* CONFIG_PROC_FS */
struct bonding *next_bond;
struct net_device *device;
struct dev_mc_list *mc_list;
unsigned short flags;
} bonding_t;
#endif /* __KERNEL__ */
......
......@@ -61,7 +61,7 @@ extern initcall_t __initcall_start, __initcall_end;
static initcall_t __initcall_##fn __attribute__ ((unused,__section__ (".initcall" level ".init"))) = fn
#define core_initcall(fn) __define_initcall("1",fn)
#define unused_initcall(fn) __define_initcall("2",fn)
#define postcore_initcall(fn) __define_initcall("2",fn)
#define arch_initcall(fn) __define_initcall("3",fn)
#define subsys_initcall(fn) __define_initcall("4",fn)
#define fs_initcall(fn) __define_initcall("5",fn)
......@@ -160,7 +160,7 @@ typedef void (*__cleanup_module_func_t)(void);
#define __setup(str,func) /* nothing */
#define core_initcall(fn) module_init(fn)
#define unused_initcall(fn) module_init(fn)
#define postcore_initcall(fn) module_init(fn)
#define arch_initcall(fn) module_init(fn)
#define subsys_initcall(fn) module_init(fn)
#define fs_initcall(fn) module_init(fn)
......
......@@ -137,10 +137,9 @@ void xdr_zero_iovec(struct iovec *, int, size_t);
/*
* XDR buffer helper functions
*/
extern int xdr_kmap(struct iovec *, struct xdr_buf *, unsigned int);
extern void xdr_kunmap(struct xdr_buf *, unsigned int);
extern void xdr_shift_buf(struct xdr_buf *, unsigned int);
extern void xdr_zero_buf(struct xdr_buf *, unsigned int);
extern int xdr_kmap(struct iovec *, struct xdr_buf *, size_t);
extern void xdr_kunmap(struct xdr_buf *, size_t);
extern void xdr_shift_buf(struct xdr_buf *, size_t);
/*
* Helper structure for copying from an sk_buff.
......
......@@ -31,7 +31,7 @@
#ifndef _ZLIB_H
#define _ZLIB_H
#include "zconf.h"
#include <linux/zconf.h>
#ifdef __cplusplus
extern "C" {
......
......@@ -8,6 +8,7 @@
#define PSCHED_CLOCK_SOURCE PSCHED_JIFFIES
#include <linux/config.h>
#include <linux/types.h>
#include <linux/pkt_sched.h>
#include <net/pkt_cls.h>
......@@ -221,7 +222,7 @@ extern psched_time_t psched_time_base;
#define PSCHED_EXPORTLIST_2
#if ~0UL == 0xFFFFFFFF
#if BITS_PER_LONG <= 32
#define PSCHED_WATCHER unsigned long
......
......@@ -51,7 +51,7 @@
* To avoid associated bogus bug reports, we flatly refuse to compile
* with a gcc that is known to be too old from the very beginning.
*/
#if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 95)
#if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 91)
#error Sorry, your GCC is too old. It builds incorrect kernels.
#endif
......
......@@ -33,14 +33,10 @@
#include <linux/futex.h>
#include <linux/highmem.h>
#include <linux/time.h>
#include <linux/pagemap.h>
#include <asm/uaccess.h>
/* These mutexes are a very simple counter: the winner is the one who
decrements from 1 to 0. The counter starts at 1 when the lock is
free. A value other than 0 or 1 means someone may be sleeping.
This is simple enough to work on all architectures, but has the
problem that if we never "up" the semaphore it could eventually
wrap around. */
/* Simple "sleep if unchanged" interface. */
/* FIXME: This may be way too small. --RR */
#define FUTEX_HASHBITS 6
......@@ -49,7 +45,7 @@
the relevent ones (hashed queues may be shared) */
struct futex_q {
struct list_head list;
struct task_struct *task;
wait_queue_head_t waiters;
/* Page struct and offset within it. */
struct page *page;
unsigned int offset;
......@@ -69,6 +65,11 @@ static inline struct list_head *hash_futex(struct page *page,
return &futex_queues[hash_long(h, FUTEX_HASHBITS)];
}
static inline void tell_waiter(struct futex_q *q)
{
wake_up_all(&q->waiters);
}
static int futex_wake(struct list_head *head,
struct page *page,
unsigned int offset,
......@@ -83,7 +84,7 @@ static int futex_wake(struct list_head *head,
if (this->page == page && this->offset == offset) {
list_del_init(i);
wake_up_process(this->task);
tell_waiter(this);
num_woken++;
if (num_woken >= num) break;
}
......@@ -94,11 +95,12 @@ static int futex_wake(struct list_head *head,
/* Add at end to avoid starvation */
static inline void queue_me(struct list_head *head,
wait_queue_t *wait,
struct futex_q *q,
struct page *page,
unsigned int offset)
{
q->task = current;
add_wait_queue(&q->waiters, wait);
q->page = page;
q->offset = offset;
......@@ -150,18 +152,20 @@ static int futex_wait(struct list_head *head,
{
int curval;
struct futex_q q;
DECLARE_WAITQUEUE(wait, current);
int ret = 0;
set_current_state(TASK_INTERRUPTIBLE);
queue_me(head, &q, page, offset);
queue_me(head, &wait, &q, page, offset);
/* Page is pinned, can't fail */
if (get_user(curval, uaddr) != 0)
BUG();
/* Page is pinned, but may no longer be in this address space. */
if (get_user(curval, uaddr) != 0) {
ret = -EFAULT;
goto out;
}
if (curval != val) {
ret = -EWOULDBLOCK;
set_current_state(TASK_RUNNING);
goto out;
}
time = schedule_timeout(time);
......@@ -174,6 +178,7 @@ static int futex_wait(struct list_head *head,
goto out;
}
out:
set_current_state(TASK_RUNNING);
/* Were we woken up anyway? */
if (!unqueue_me(&q))
return 0;
......@@ -218,7 +223,7 @@ asmlinkage int sys_futex(void *uaddr, int op, int val, struct timespec *utime)
default:
ret = -EINVAL;
}
put_page(page);
page_cache_release(page);
return ret;
}
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
......@@ -11,6 +11,7 @@
*
* Fixes:
* Hideaki YOSHIFUJI : sin6_scope_id support
* YOSHIFUJI,H.@USAGI : raw checksum (RFC2292(bis) compliance)
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
......@@ -487,11 +488,18 @@ static int rawv6_frag_cksum(const void *data, struct in6_addr *addr,
hdr->cksum = csum_ipv6_magic(addr, daddr, hdr->len,
hdr->proto, hdr->cksum);
if (opt->offset < len) {
if (opt->offset + 1 < len) {
__u16 *csum;
csum = (__u16 *) (buff + opt->offset);
if (*csum) {
/* in case cksum was not initialized */
__u32 sum = hdr->cksum;
sum += *csum;
*csum = hdr->cksum = (sum + (sum>>16));
} else {
*csum = hdr->cksum;
}
} else {
if (net_ratelimit())
printk(KERN_DEBUG "icmp: cksum offset too big\n");
......@@ -720,6 +728,10 @@ static int rawv6_setsockopt(struct sock *sk, int level, int optname,
switch (optname) {
case IPV6_CHECKSUM:
/* You may get strange result with a positive odd offset;
RFC2292bis agrees with me. */
if (val > 0 && (val&1))
return(-EINVAL);
if (val < 0) {
opt->checksum = 0;
} else {
......@@ -817,6 +829,11 @@ static void rawv6_close(struct sock *sk, long timeout)
static int rawv6_init_sk(struct sock *sk)
{
if (inet_sk(sk)->num == IPPROTO_ICMPV6) {
struct raw6_opt *opt = raw6_sk(sk);
opt->checksum = 1;
opt->offset = 2;
}
return(0);
}
......
......@@ -1117,7 +1117,7 @@ static void psched_tick(unsigned long dummy)
psched_timer.expires = jiffies + 1*HZ;
#else
unsigned long now = jiffies;
psched_time_base = ((u64)now)<<PSCHED_JSCALE;
psched_time_base += ((u64)(now-psched_time_mark))<<PSCHED_JSCALE;
psched_time_mark = now;
psched_timer.expires = now + 60*60*HZ;
#endif
......
......@@ -176,7 +176,7 @@ void xdr_shift_iovec(struct iovec *iov, int nr, size_t len)
/*
* Map a struct xdr_buf into an iovec array.
*/
int xdr_kmap(struct iovec *iov_base, struct xdr_buf *xdr, unsigned int base)
int xdr_kmap(struct iovec *iov_base, struct xdr_buf *xdr, size_t base)
{
struct iovec *iov = iov_base;
struct page **ppage = xdr->pages;
......@@ -226,7 +226,7 @@ int xdr_kmap(struct iovec *iov_base, struct xdr_buf *xdr, unsigned int base)
return (iov - iov_base);
}
void xdr_kunmap(struct xdr_buf *xdr, unsigned int base)
void xdr_kunmap(struct xdr_buf *xdr, size_t base)
{
struct page **ppage = xdr->pages;
unsigned int pglen = xdr->page_len;
......
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