summaryrefslogtreecommitdiffstats
path: root/arch/sparc64
diff options
context:
space:
mode:
authorRalf Baechle <ralf@linux-mips.org>1999-07-05 23:09:37 +0000
committerRalf Baechle <ralf@linux-mips.org>1999-07-05 23:09:37 +0000
commitaba344fdfed81b2c03d6114c54cfd73a486aa10b (patch)
treed032d8430bf1234c3ecc6f6330d6de6e887e5963 /arch/sparc64
parent40c138bfc6d37dbff5339f84575db1e3cec6e34e (diff)
Merge with Linux 2.3.9.
Diffstat (limited to 'arch/sparc64')
-rw-r--r--arch/sparc64/config.in7
-rw-r--r--arch/sparc64/defconfig3
-rw-r--r--arch/sparc64/kernel/binfmt_aout32.c11
-rw-r--r--arch/sparc64/kernel/process.c2
-rw-r--r--arch/sparc64/kernel/sparc64_ksyms.c1
-rw-r--r--arch/sparc64/kernel/sys_sparc32.c26
-rw-r--r--arch/sparc64/kernel/sys_sunos32.c2
-rw-r--r--arch/sparc64/mm/init.c19
-rw-r--r--arch/sparc64/solaris/misc.c2
9 files changed, 39 insertions, 34 deletions
diff --git a/arch/sparc64/config.in b/arch/sparc64/config.in
index 58ac24500..c501884ed 100644
--- a/arch/sparc64/config.in
+++ b/arch/sparc64/config.in
@@ -62,10 +62,7 @@ if [ "$CONFIG_SPARC32_COMPAT" != "n" ]; then
tristate 'Kernel support for 32-bit ELF binaries' CONFIG_BINFMT_ELF32
bool 'Kernel support for 32-bit (ie. SunOS) a.out binaries' CONFIG_BINFMT_AOUT32
fi
-if [ "$CONFIG_EXPERIMENTAL" = "y" ]; then
- tristate 'Kernel support for MISC binaries' CONFIG_BINFMT_MISC
- tristate 'Kernel support for JAVA binaries (obsolete)' CONFIG_BINFMT_JAVA
-fi
+tristate 'Kernel support for MISC binaries' CONFIG_BINFMT_MISC
if [ "$CONFIG_EXPERIMENTAL" = "y" ]; then
tristate 'Solaris binary emulation' CONFIG_SOLARIS_EMUL
fi
@@ -120,7 +117,7 @@ if [ "$CONFIG_PCI" = "y" ]; then
dep_tristate ' SCSI emulation support' CONFIG_BLK_DEV_IDESCSI $CONFIG_BLK_DEV_IDE
define_bool CONFIG_BLK_DEV_IDEPCI y
define_bool CONFIG_BLK_DEV_IDEDMA y
- define_bool CONFIG_IDEDMA_AUTO y
+ define_bool CONFIG_IDEDMA_PCI_AUTO y
define_bool CONFIG_BLK_DEV_NS87415 y
define_bool CONFIG_BLK_DEV_CMD646 y
fi
diff --git a/arch/sparc64/defconfig b/arch/sparc64/defconfig
index 86eb05819..8e3402e2c 100644
--- a/arch/sparc64/defconfig
+++ b/arch/sparc64/defconfig
@@ -91,7 +91,6 @@ CONFIG_BINFMT_ELF=y
CONFIG_BINFMT_ELF32=y
# CONFIG_BINFMT_AOUT32 is not set
CONFIG_BINFMT_MISC=m
-CONFIG_BINFMT_JAVA=m
CONFIG_SOLARIS_EMUL=m
CONFIG_PARPORT=m
CONFIG_PARPORT_AX=m
@@ -122,7 +121,7 @@ CONFIG_BLK_DEV_IDEFLOPPY=m
# CONFIG_BLK_DEV_IDESCSI is not set
CONFIG_BLK_DEV_IDEPCI=y
CONFIG_BLK_DEV_IDEDMA=y
-CONFIG_IDEDMA_AUTO=y
+CONFIG_IDEDMA_PCI_AUTO=y
CONFIG_BLK_DEV_NS87415=y
CONFIG_BLK_DEV_CMD646=y
diff --git a/arch/sparc64/kernel/binfmt_aout32.c b/arch/sparc64/kernel/binfmt_aout32.c
index e852ca8f8..7d638c5da 100644
--- a/arch/sparc64/kernel/binfmt_aout32.c
+++ b/arch/sparc64/kernel/binfmt_aout32.c
@@ -55,8 +55,15 @@ static void set_brk(unsigned long start, unsigned long end)
* These are the only things you should do on a core-file: use only these
* macros to write out all the necessary info.
*/
-#define DUMP_WRITE(addr,nr) \
-while (file->f_op->write(file,(char *)(addr),(nr),&file->f_pos) != (nr)) goto close_coredump
+
+static int dump_write(struct file *file, const void *addr, int nr)
+{
+ return file->f_op->write(file, addr, nr, &file->f_pos) == nr;
+}
+
+#define DUMP_WRITE(addr, nr) \
+ if (!dump_write(file, (void *)(addr), (nr))) \
+ goto close_coredump;
#define DUMP_SEEK(offset) \
if (file->f_op->llseek) { \
diff --git a/arch/sparc64/kernel/process.c b/arch/sparc64/kernel/process.c
index 1abe767e9..ace0c1dc0 100644
--- a/arch/sparc64/kernel/process.c
+++ b/arch/sparc64/kernel/process.c
@@ -392,7 +392,7 @@ void show_thread(struct thread_struct *tss)
}
printk("flags: 0x%08x\n", tss->flags);
- printk("current_ds: 0x%016lx\n", tss->current_ds.seg);
+ printk("current_ds: 0x%x\n", tss->current_ds.seg);
}
/* Free current thread data structures etc.. */
diff --git a/arch/sparc64/kernel/sparc64_ksyms.c b/arch/sparc64/kernel/sparc64_ksyms.c
index 305f37ad8..6d6043617 100644
--- a/arch/sparc64/kernel/sparc64_ksyms.c
+++ b/arch/sparc64/kernel/sparc64_ksyms.c
@@ -206,6 +206,7 @@ EXPORT_SYMBOL(die_if_kernel);
/* Kernel thread creation. */
EXPORT_SYMBOL(kernel_thread);
+EXPORT_SYMBOL(init_mm);
/* prom symbols */
EXPORT_SYMBOL(idprom);
diff --git a/arch/sparc64/kernel/sys_sparc32.c b/arch/sparc64/kernel/sys_sparc32.c
index 79ce3db45..77d2ddc6c 100644
--- a/arch/sparc64/kernel/sys_sparc32.c
+++ b/arch/sparc64/kernel/sys_sparc32.c
@@ -855,17 +855,15 @@ asmlinkage long sys32_readv(int fd, struct iovec32 *vector, u32 count)
long ret = -EBADF;
lock_kernel();
+
file = fget(fd);
if(!file)
goto bad_file;
- if(!(file->f_mode & 1))
- goto out;
-
- ret = do_readv_writev32(VERIFY_WRITE, file,
- vector, count);
-out:
+ if (file->f_op && file->f_op->read && (file->f_mode & FMODE_READ))
+ ret = do_readv_writev32(VERIFY_WRITE, file, vector, count);
fput(file);
+
bad_file:
unlock_kernel();
return ret;
@@ -877,19 +875,14 @@ asmlinkage long sys32_writev(int fd, struct iovec32 *vector, u32 count)
int ret = -EBADF;
lock_kernel();
+
file = fget(fd);
if(!file)
goto bad_file;
-
- if(!(file->f_mode & 2))
- goto out;
-
- down(&file->f_dentry->d_inode->i_sem);
- ret = do_readv_writev32(VERIFY_READ, file,
- vector, count);
- up(&file->f_dentry->d_inode->i_sem);
-out:
+ if (file->f_op && file->f_op->write && (file->f_mode & FMODE_WRITE))
+ ret = do_readv_writev32(VERIFY_READ, file, vector, count);
fput(file);
+
bad_file:
unlock_kernel();
return ret;
@@ -2335,7 +2328,7 @@ static void scm_detach_fds32(struct msghdr *kmsg, struct scm_cookie *scm)
break;
}
/* Bump the usage count and install the file. */
- fp[i]->f_count++;
+ atomic_inc(&fp[i]->f_count);
current->files->fd[new_fd] = fp[i];
}
@@ -2841,7 +2834,6 @@ do_execve32(char * filename, u32 * argv, u32 * envp, struct pt_regs * regs)
bprm.dentry = dentry;
bprm.filename = filename;
bprm.sh_bang = 0;
- bprm.java = 0;
bprm.loader = 0;
bprm.exec = 0;
if ((bprm.argc = count32(argv)) < 0) {
diff --git a/arch/sparc64/kernel/sys_sunos32.c b/arch/sparc64/kernel/sys_sunos32.c
index d375dc26b..9ea1ffcc2 100644
--- a/arch/sparc64/kernel/sys_sunos32.c
+++ b/arch/sparc64/kernel/sys_sunos32.c
@@ -163,7 +163,7 @@ asmlinkage int sunos_brk(u32 baddr)
* simple, it hopefully works in most obvious cases.. Easy to
* fool it, but this should catch most mistakes.
*/
- freepages = buffermem >> PAGE_SHIFT;
+ freepages = atomic_read(&buffermem) >> PAGE_SHIFT;
freepages += atomic_read(&page_cache_size);
freepages >>= 1;
freepages += nr_free_pages;
diff --git a/arch/sparc64/mm/init.c b/arch/sparc64/mm/init.c
index 6f3232d1d..8f176e885 100644
--- a/arch/sparc64/mm/init.c
+++ b/arch/sparc64/mm/init.c
@@ -147,7 +147,6 @@ void show_mem(void)
#ifndef __SMP__
printk("%d entries in page dir cache\n",pgd_cache_size);
#endif
- show_buffers();
#ifdef CONFIG_NET
show_net_buffers();
#endif
@@ -419,10 +418,12 @@ __u32 mmu_get_scsi_one(char *vaddr, unsigned long len, struct linux_sbus *sbus)
}
if (iommu->strbuf_enabled) {
+ volatile u64 *sbuf_pflush = (volatile u64 *) &sregs->sbuf_pflush;
+
spin_lock_irqsave(&iommu->iommu_lock, flags);
iommu->flushflag = 0;
while(start < end) {
- sregs->sbuf_pflush = start;
+ *sbuf_pflush = start;
start += PAGE_SIZE;
}
sregs->sbuf_fsync = __pa(&(iommu->flushflag));
@@ -447,6 +448,8 @@ void mmu_release_scsi_one(u32 vaddr, unsigned long len, struct linux_sbus *sbus)
start &= PAGE_MASK;
if (iommu->strbuf_enabled) {
+ volatile u64 *sbuf_pflush = (volatile u64 *) &sregs->sbuf_pflush;
+
spin_lock_irqsave(&iommu->iommu_lock, flags);
/* 1) Clear the flush flag word */
@@ -456,7 +459,7 @@ void mmu_release_scsi_one(u32 vaddr, unsigned long len, struct linux_sbus *sbus)
* we want flushed.
*/
while(start < end) {
- sregs->sbuf_pflush = start;
+ *sbuf_pflush = start;
start += PAGE_SIZE;
}
@@ -484,6 +487,8 @@ void mmu_get_scsi_sgl(struct mmu_sglist *sg, int sz, struct linux_sbus *sbus)
volatile u64 *sbctrl = (volatile u64 *) &sregs->sbus_control;
if (iommu->strbuf_enabled) {
+ volatile u64 *sbuf_pflush = (volatile u64 *) &sregs->sbuf_pflush;
+
spin_lock_irqsave(&iommu->iommu_lock, flags);
iommu->flushflag = 0;
@@ -500,7 +505,7 @@ void mmu_get_scsi_sgl(struct mmu_sglist *sg, int sz, struct linux_sbus *sbus)
sg[sz--].dvma_addr = sbus_dvma_addr(start);
start &= PAGE_MASK;
while(start < end) {
- sregs->sbuf_pflush = start;
+ *sbuf_pflush = start;
start += PAGE_SIZE;
}
}
@@ -535,6 +540,8 @@ void mmu_release_scsi_sgl(struct mmu_sglist *sg, int sz, struct linux_sbus *sbus
unsigned long flags, tmp;
if (iommu->strbuf_enabled) {
+ volatile u64 *sbuf_pflush = (volatile u64 *) &sregs->sbuf_pflush;
+
spin_lock_irqsave(&iommu->iommu_lock, flags);
/* 1) Clear the flush flag word */
@@ -549,7 +556,7 @@ void mmu_release_scsi_sgl(struct mmu_sglist *sg, int sz, struct linux_sbus *sbus
start &= PAGE_MASK;
while(start < end) {
- sregs->sbuf_pflush = start;
+ *sbuf_pflush = start;
start += PAGE_SIZE;
}
sz--;
@@ -1448,7 +1455,7 @@ void si_meminfo(struct sysinfo *val)
val->totalram = 0;
val->sharedram = 0;
val->freeram = ((unsigned long)nr_free_pages) << PAGE_SHIFT;
- val->bufferram = buffermem;
+ val->bufferram = atomic_read(&buffermem);
for (page = mem_map, end = mem_map + max_mapnr;
page < end; page++) {
if (PageSkip(page)) {
diff --git a/arch/sparc64/solaris/misc.c b/arch/sparc64/solaris/misc.c
index c29b79f68..4b3a1ce5d 100644
--- a/arch/sparc64/solaris/misc.c
+++ b/arch/sparc64/solaris/misc.c
@@ -83,6 +83,7 @@ static u32 do_solaris_mmap(u32 addr, u32 len, u32 prot, u32 flags, u32 fd, u64 o
}
}
+ down(&current->mm->mmap_sem);
retval = -ENOMEM;
if(!(flags & MAP_FIXED) && !addr) {
unsigned long attempt = get_unmapped_area(addr, len);
@@ -102,6 +103,7 @@ static u32 do_solaris_mmap(u32 addr, u32 len, u32 prot, u32 flags, u32 fd, u64 o
if(!ret_type)
retval = ((retval < 0xf0000000) ? 0 : retval);
out_putf:
+ up(&current->mm->mmap_sem);
if (file)
fput(file);
out: