diff options
author | Ralf Baechle <ralf@linux-mips.org> | 1997-07-20 14:56:40 +0000 |
---|---|---|
committer | Ralf Baechle <ralf@linux-mips.org> | 1997-07-20 14:56:40 +0000 |
commit | e308faf24f68e262d92d294a01ddca7a17e76762 (patch) | |
tree | 22c47cb315811834861f013067878ff664e95abd /arch/sparc | |
parent | 30c6397ce63178fcb3e7963ac247f0a03132aca9 (diff) |
Sync with Linux 2.1.46.
Diffstat (limited to 'arch/sparc')
-rw-r--r-- | arch/sparc/Makefile | 5 | ||||
-rw-r--r-- | arch/sparc/boot/Makefile | 15 | ||||
-rw-r--r-- | arch/sparc/boot/piggyback.c | 100 | ||||
-rw-r--r-- | arch/sparc/config.in | 2 | ||||
-rw-r--r-- | arch/sparc/defconfig | 4 | ||||
-rw-r--r-- | arch/sparc/kernel/cpu.c | 1 | ||||
-rw-r--r-- | arch/sparc/kernel/process.c | 7 | ||||
-rw-r--r-- | arch/sparc/kernel/sparc_ksyms.c | 5 | ||||
-rw-r--r-- | arch/sparc/kernel/sys_sunos.c | 67 | ||||
-rw-r--r-- | arch/sparc/mm/Makefile | 11 | ||||
-rw-r--r-- | arch/sparc/mm/srmmu.c | 100 | ||||
-rw-r--r-- | arch/sparc/mm/turbosparc.S | 46 | ||||
-rw-r--r-- | arch/sparc/prom/bootstr.c | 11 | ||||
-rw-r--r-- | arch/sparc/prom/tree.c | 8 |
14 files changed, 343 insertions, 39 deletions
diff --git a/arch/sparc/Makefile b/arch/sparc/Makefile index 92c73de32..7a8d46a07 100644 --- a/arch/sparc/Makefile +++ b/arch/sparc/Makefile @@ -1,4 +1,4 @@ -# $Id: Makefile,v 1.28 1997/05/01 01:41:21 davem Exp $ +# $Id: Makefile,v 1.29 1997/07/11 11:05:23 jj Exp $ # sparc/Makefile # # Makefile for the architecture dependent flags and dependencies on the @@ -45,3 +45,6 @@ archdep: check_asm: $(MAKE) -C arch/sparc/kernel check_asm + +tftpboot.img: + $(MAKE) -C arch/sparc/boot tftpboot.img diff --git a/arch/sparc/boot/Makefile b/arch/sparc/boot/Makefile index b9d54e652..af462db3a 100644 --- a/arch/sparc/boot/Makefile +++ b/arch/sparc/boot/Makefile @@ -1,12 +1,23 @@ -# $Id: Makefile,v 1.3 1996/08/04 08:40:58 ecd Exp $ -# Makefile for the Sparc low level /boot module. +# $Id: Makefile,v 1.4 1997/07/11 11:05:18 jj Exp $ +# Makefile for the Sparc boot stuff. # # Copyright (C) 1995 David S. Miller (davem@caip.rutgers.edu) +# Copyright (C) 1997 Jakub Jelinek (jj@sunsite.mff.cuni.cz) + +ROOT_IMG =/usr/src/root.img +ELFTOAOUT =elftoaout all: boot boot: @echo "Nothing special to be done for 'boot' on Linux/SPARC." +tftpboot.img: piggyback + $(ELFTOAOUT) $(TOPDIR)/vmlinux -o tftpboot.img + ./piggyback tftpboot.img $(TOPDIR)/System.map $(ROOT_IMG) + +piggyback: piggyback.c + $(HOSTCC) $(HOSTCFLAGS) -o piggyback piggyback.c + dep: diff --git a/arch/sparc/boot/piggyback.c b/arch/sparc/boot/piggyback.c new file mode 100644 index 000000000..21a32932a --- /dev/null +++ b/arch/sparc/boot/piggyback.c @@ -0,0 +1,100 @@ +/* $Id: piggyback.c,v 1.1 1997/07/18 06:26:14 ralf Exp $ + Simple utility to make a single-image install kernel with initial ramdisk + for Sparc tftpbooting without need to set up nfs. + + Copyright (C) 1996 Jakub Jelinek (jj@sunsite.mff.cuni.cz) + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ + +#include <stdio.h> +#include <string.h> +#include <ctype.h> +#include <errno.h> +#include <fcntl.h> +#include <dirent.h> +#include <unistd.h> +#include <stdlib.h> +#include <sys/types.h> +#include <sys/stat.h> + +/* Note: run this on an a.out kernel (use elftoaout for it), as PROM looks for a.out image onlly + usage: piggyback vmlinux System.map tail, where tail is gzipped fs of the initial ramdisk */ + +void die(char *str) +{ + perror (str); + exit(1); +} + +int main(int argc,char **argv) +{ + char buffer [1024], *q, *r; + unsigned int i, j, k, start, end, offset; + FILE *map; + struct stat s; + int image, tail; + + if (stat (argv[3], &s) < 0) die (argv[3]); + map = fopen (argv[2], "r"); + if (!map) die(argv[2]); + while (fgets (buffer, 1024, map)) { + if (!strcmp (buffer + 11, "start\n")) + start = strtoul (buffer, NULL, 16); + else if (!strcmp (buffer + 11, "end\n")) + end = strtoul (buffer, NULL, 16); + } + fclose (map); + if ((image = open(argv[1],O_RDWR)) < 0) die(argv[1]); + if (read(image,buffer,512) != 512) die(argv[1]); + if (!memcmp (buffer, "\177ELF", 4)) { + unsigned int *p = (unsigned int *)(buffer + *(unsigned int *)(buffer + 28)); + + i = p[1] + *(unsigned int *)(buffer + 24) - p[2]; + if (lseek(image,i,0) < 0) die("lseek"); + if (read(image,buffer,512) != 512) die(argv[1]); + j = 0; + } else if (*(unsigned int *)buffer == 0x01030107) { + i = j = 32; + } else { + fprintf (stderr, "Not ELF nor a.out. Don't blame me.\n"); + exit(1); + } + k = i; + i += ((*(unsigned short *)(buffer + j + 2))<<2) - 512; + if (lseek(image,i,0) < 0) die("lseek"); + if (read(image,buffer,1024) != 1024) die(argv[1]); + for (q = buffer, r = q + 512; q < r; q += 4) { + if (*q == 'H' && q[1] == 'd' && q[2] == 'r' && q[3] == 'S') + break; + } + if (q == r) { + fprintf (stderr, "Couldn't find headers signature in the kernel.\n"); + exit(1); + } + offset = i + (q - buffer) + 10; + if (lseek(image, offset, 0) < 0) die ("lseek"); + *(unsigned *)buffer = 0; + *(unsigned *)(buffer + 4) = 0x01000000; + *(unsigned *)(buffer + 8) = ((end + 32 + 4095) & ~4095); + *(unsigned *)(buffer + 12) = s.st_size; + if (write(image,buffer+2,14) != 14) die (argv[1]); + if (lseek(image, k - start + ((end + 32 + 4095) & ~4095), 0) < 0) die ("lseek"); + if ((tail = open(argv[3],O_RDONLY)) < 0) die(argv[3]); + while ((i = read (tail,buffer,1024)) > 0) + if (write(image,buffer,i) != i) die (argv[1]); + if (close(image) < 0) die("close"); + if (close(tail) < 0) die("close"); + return 0; +} diff --git a/arch/sparc/config.in b/arch/sparc/config.in index 85566667f..69ed62422 100644 --- a/arch/sparc/config.in +++ b/arch/sparc/config.in @@ -1,4 +1,4 @@ -# $Id: config.in,v 1.35 1997/04/07 06:54:09 davem Exp $ +# $Id: config.in,v 1.36 1997/06/17 03:54:47 davem Exp $ # For a description of the syntax of this configuration file, # see the Configure script. # diff --git a/arch/sparc/defconfig b/arch/sparc/defconfig index a6df2dcc0..9d64ee85d 100644 --- a/arch/sparc/defconfig +++ b/arch/sparc/defconfig @@ -42,7 +42,7 @@ SUN_FB_CGFOURTEEN=y SUN_FB_BWTWO=y SUN_FB_LEO=y TADPOLE_FB_WEITEK=y -SUN_FB_CREATOR=y +#SUN_FB_CREATOR is not set # # Misc Linux/SPARC drivers @@ -64,6 +64,7 @@ CONFIG_SYSVIPC=y CONFIG_SYSCTL=y CONFIG_BINFMT_AOUT=y CONFIG_BINFMT_ELF=y +CONFIG_BINFMT_MISC=y CONFIG_BINFMT_JAVA=m # @@ -103,6 +104,7 @@ CONFIG_IP_MASQUERADE=y # CONFIG_IP_MROUTE is not set CONFIG_IP_ALIAS=m # CONFIG_ARPD is not set +# CONFIG_SYN_COOKIES is not set # # (it is safe to leave these untouched) diff --git a/arch/sparc/kernel/cpu.c b/arch/sparc/kernel/cpu.c index f94ef8b91..aeb5a46c8 100644 --- a/arch/sparc/kernel/cpu.c +++ b/arch/sparc/kernel/cpu.c @@ -76,6 +76,7 @@ struct cpu_iu_info linux_sparc_chips[] = { { 0, 0, "Fujitsu MB86900/1A or LSI L64831 SparcKIT-40"}, /* borned STP1012PGA */ { 0, 4, "Fujitsu MB86904"}, + { 0, 5, "Fujitsu TurboSparc MB86907"}, /* SparcStation2, SparcServer 490 & 690 */ { 1, 0, "LSI Logic Corporation - L64811"}, /* SparcStation2 */ diff --git a/arch/sparc/kernel/process.c b/arch/sparc/kernel/process.c index 1adc9e817..95eed6287 100644 --- a/arch/sparc/kernel/process.c +++ b/arch/sparc/kernel/process.c @@ -1,4 +1,4 @@ -/* $Id: process.c,v 1.98 1997/05/14 20:44:54 davem Exp $ +/* $Id: process.c,v 1.99 1997/07/17 02:20:13 davem Exp $ * linux/arch/sparc/kernel/process.c * * Copyright (C) 1995 David S. Miller (davem@caip.rutgers.edu) @@ -594,8 +594,9 @@ asmlinkage int sparc_execve(struct pt_regs *regs) base = 1; lock_kernel(); - error = getname((char *) regs->u_regs[base + UREG_I0], &filename); - if(error) + filename = getname((char *)regs->u_regs[base + UREG_I0]); + error = PTR_ERR(filename); + if(IS_ERR(filename)) goto out; error = do_execve(filename, (char **) regs->u_regs[base + UREG_I1], (char **) regs->u_regs[base + UREG_I2], regs); diff --git a/arch/sparc/kernel/sparc_ksyms.c b/arch/sparc/kernel/sparc_ksyms.c index 38896ab22..cf4146c4a 100644 --- a/arch/sparc/kernel/sparc_ksyms.c +++ b/arch/sparc/kernel/sparc_ksyms.c @@ -1,4 +1,4 @@ -/* $Id: sparc_ksyms.c,v 1.59 1997/05/08 17:45:20 davem Exp $ +/* $Id: sparc_ksyms.c,v 1.60 1997/06/17 13:25:13 jj Exp $ * arch/sparc/kernel/ksyms.c: Sparc specific ksyms support. * * Copyright (C) 1996 David S. Miller (davem@caip.rutgers.edu) @@ -59,6 +59,7 @@ extern void *__memscan_zero(void *, size_t); extern void *__memscan_generic(void *, int, size_t); extern int __memcmp(const void *, const void *, __kernel_size_t); extern int __strncmp(const char *, const char *, __kernel_size_t); +extern char saved_command_line[]; extern void bcopy (const char *, char *, int); extern int __ashrdi3(int, int); @@ -200,7 +201,7 @@ EXPORT_SYMBOL(prom_getproplen); EXPORT_SYMBOL(prom_getproperty); EXPORT_SYMBOL(prom_node_has_property); EXPORT_SYMBOL(prom_setprop); -EXPORT_SYMBOL(prom_getbootargs); +EXPORT_SYMBOL(saved_command_line); EXPORT_SYMBOL(prom_apply_obio_ranges); EXPORT_SYMBOL(prom_getname); EXPORT_SYMBOL(prom_feval); diff --git a/arch/sparc/kernel/sys_sunos.c b/arch/sparc/kernel/sys_sunos.c index 3fafe7f9c..5d0ea0840 100644 --- a/arch/sparc/kernel/sys_sunos.c +++ b/arch/sparc/kernel/sys_sunos.c @@ -1,4 +1,4 @@ -/* $Id: sys_sunos.c,v 1.79 1997/04/23 23:01:15 ecd Exp $ +/* $Id: sys_sunos.c,v 1.80 1997/07/17 02:20:22 davem Exp $ * sys_sunos.c: SunOS specific syscall compatibility support. * * Copyright (C) 1995 David S. Miller (davem@caip.rutgers.edu) @@ -90,10 +90,12 @@ asmlinkage unsigned long sunos_mmap(unsigned long addr, unsigned long len, * of /dev/zero, transform it into an anonymous mapping. * SunOS is so stupid some times... hmph! */ - if(MAJOR(file->f_inode->i_rdev) == MEM_MAJOR && - MINOR(file->f_inode->i_rdev) == 5) { - flags |= MAP_ANONYMOUS; - file = 0; + if(file->f_dentry && file->f_dentry->d_inode) { + if(MAJOR(file->f_dentry->d_inode->i_rdev) == MEM_MAJOR && + MINOR(file->f_dentry->d_inode->i_rdev) == 5) { + flags |= MAP_ANONYMOUS; + file = 0; + } } if(!(flags & MAP_FIXED)) addr = 0; @@ -428,16 +430,32 @@ static int sunos_filldir(void * __buf, const char * name, int namlen, asmlinkage int sunos_getdents(unsigned int fd, void * dirent, int cnt) { struct file * file; + struct dentry * dentry; + struct inode * inode; struct sunos_dirent * lastdirent; struct sunos_dirent_callback buf; int error = -EBADF; lock_kernel(); - if (fd >= SUNOS_NR_OPEN || !(file = current->files->fd[fd])) + if(fd >= SUNOS_NR_OPEN) + goto out; + + file = current->files->fd[fd]; + if(!file) + goto out; + + dentry = file->f_dentry; + if(!dentry) goto out; + + inode = dentry->d_inode; + if(!inode) + goto out; + error = -ENOTDIR; if (!file->f_op || !file->f_op->readdir) goto out; + error = -EINVAL; if(cnt < (sizeof(struct sunos_dirent) + 255)) goto out; @@ -446,13 +464,12 @@ asmlinkage int sunos_getdents(unsigned int fd, void * dirent, int cnt) buf.previous = NULL; buf.count = cnt; buf.error = 0; - error = file->f_op->readdir(file->f_inode, file, &buf, sunos_filldir); + error = file->f_op->readdir(inode, file, &buf, sunos_filldir); if (error < 0) goto out; lastdirent = buf.previous; - if (!lastdirent) { - error = buf.error; - } else { + error = buf.error; + if (lastdirent) { put_user(file->f_pos, &lastdirent->d_off); error = cnt - buf.count; } @@ -503,16 +520,32 @@ static int sunos_filldirentry(void * __buf, const char * name, int namlen, asmlinkage int sunos_getdirentries(unsigned int fd, void * dirent, int cnt, unsigned int *basep) { struct file * file; + struct dentry * dentry; + struct inode * inode; struct sunos_direntry * lastdirent; struct sunos_direntry_callback buf; int error = -EBADF; lock_kernel(); - if (fd >= SUNOS_NR_OPEN || !(file = current->files->fd[fd])) + if(fd >= SUNOS_NR_OPEN) goto out; + + file = current->files->fd[fd]; + if(!file) + goto out; + + dentry = file->f_dentry; + if(!dentry) + goto out; + + inode = dentry->d_inode; + if(!inode) + goto out; + error = -ENOTDIR; if (!file->f_op || !file->f_op->readdir) goto out; + error = -EINVAL; if(cnt < (sizeof(struct sunos_direntry) + 255)) goto out; @@ -521,13 +554,12 @@ asmlinkage int sunos_getdirentries(unsigned int fd, void * dirent, int cnt, unsi buf.previous = NULL; buf.count = cnt; buf.error = 0; - error = file->f_op->readdir(file->f_inode, file, &buf, sunos_filldirentry); + error = file->f_op->readdir(inode, file, &buf, sunos_filldirentry); if (error < 0) goto out; lastdirent = buf.previous; - if (!lastdirent) { - error = buf.error; - } else { + error = buf.error; + if (lastdirent) { put_user(file->f_pos, basep); error = cnt - buf.count; } @@ -725,12 +757,13 @@ sunos_nfs_get_server_fd (int fd, struct sockaddr_in *addr) int try_port; int ret; struct socket *socket; + struct dentry *dentry; struct inode *inode; struct file *file; file = current->files->fd [fd]; - inode = file->f_inode; - if (!inode || !inode->i_sock) + dentry = file->f_dentry; + if(!dentry || !(inode = dentry->d_inode)) return 0; socket = &inode->u.socket_i; diff --git a/arch/sparc/mm/Makefile b/arch/sparc/mm/Makefile index f7b9b367c..84cd1d2e2 100644 --- a/arch/sparc/mm/Makefile +++ b/arch/sparc/mm/Makefile @@ -1,4 +1,4 @@ -# $Id: Makefile,v 1.25 1997/05/03 05:09:11 davem Exp $ +# $Id: Makefile,v 1.26 1997/06/24 15:48:06 jj Exp $ # Makefile for the linux Sparc-specific parts of the memory manager. # # Note! Dependencies are done automagically by 'make dep', which also @@ -9,7 +9,8 @@ O_TARGET := mm.o O_OBJS := fault.o init.o sun4c.o srmmu.o hypersparc.o viking.o \ - tsunami.o loadmmu.o generic.o asyncd.o extable.o + tsunami.o loadmmu.o generic.o asyncd.o extable.o \ + turbosparc.o include $(TOPDIR)/Rules.make @@ -18,6 +19,9 @@ ifdef SMP hypersparc.o: hypersparc.S $(CC) -D__ASSEMBLY__ $(AFLAGS) -ansi -c -o hypersparc.o hypersparc.S +turbosparc.o: turbosparc.S + $(CC) -D__ASSEMBLY__ $(AFLAGS) -ansi -c -o turbosparc.o turbosparc.S + viking.o: viking.S $(CC) -D__ASSEMBLY__ $(AFLAGS) -ansi -c -o viking.o viking.S @@ -29,6 +33,9 @@ else hypersparc.o: hypersparc.S $(CC) -D__ASSEMBLY__ -ansi -c -o hypersparc.o hypersparc.S +turbosparc.o: turbosparc.S + $(CC) -D__ASSEMBLY__ -ansi -c -o turbosparc.o turbosparc.S + viking.o: viking.S $(CC) -D__ASSEMBLY__ -ansi -c -o viking.o viking.S diff --git a/arch/sparc/mm/srmmu.c b/arch/sparc/mm/srmmu.c index 7420b98cb..3b9970551 100644 --- a/arch/sparc/mm/srmmu.c +++ b/arch/sparc/mm/srmmu.c @@ -1,9 +1,10 @@ -/* $Id: srmmu.c,v 1.147 1997/05/20 07:58:42 jj Exp $ +/* $Id: srmmu.c,v 1.148 1997/06/24 15:48:02 jj Exp $ * srmmu.c: SRMMU specific routines for memory management. * * Copyright (C) 1995 David S. Miller (davem@caip.rutgers.edu) * Copyright (C) 1995 Peter A. Zaitcev (zaitcev@ithil.mcst.ru) * Copyright (C) 1996 Eddie C. Dost (ecd@skynet.be) + * Copyright (C) 1997 Jakub Jelinek (jj@sunsite.mff.cuni.cz) */ #include <linux/config.h> @@ -36,6 +37,7 @@ #include <asm/ross.h> #include <asm/tsunami.h> #include <asm/swift.h> +#include <asm/turbosparc.h> enum mbus_module srmmu_modtype; unsigned int hwbug_bitmask; @@ -2595,6 +2597,78 @@ __initfunc(static void init_swift(void)) poke_srmmu = poke_swift; } +/* turbosparc.S */ +extern void turbosparc_flush_cache_all(); +extern void turbosparc_flush_sig_insns(struct mm_struct *mm, unsigned long insn_addr); + +static void poke_turbosparc(void) +{ + unsigned long mreg = srmmu_get_mmureg(); + unsigned long ccreg; + + /* Clear any crap from the cache or else... */ + turbosparc_flush_cache_all(); + mreg &= ~(TURBOSPARC_ICENABLE | TURBOSPARC_DCENABLE); /* Temporarily disable I & D caches */ + mreg &= ~(TURBOSPARC_PCENABLE); /* Don't check parity */ + srmmu_set_mmureg(mreg); + + ccreg = turbosparc_get_ccreg(); + +#ifdef TURBOSPARC_WRITEBACK + ccreg |= (TURBOSPARC_SNENABLE); /* Do DVMA snooping in Dcache */ + ccreg &= ~(TURBOSPARC_uS2 | TURBOSPARC_WTENABLE); + /* Write-back D-cache, emulate VLSI + * abortion number three, not number one */ +#else + /* For now let's play safe, optimize later */ + ccreg |= (TURBOSPARC_SNENABLE | TURBOSPARC_WTENABLE); + /* Do DVMA snooping in Dcache, Write-thru D-cache */ + ccreg &= ~(TURBOSPARC_uS2); + /* Emulate VLSI abortion number three, not number one */ +#endif + switch (ccreg & 7) { + case 0: /* No SE cache */ + case 7: /* Test mode */ + break; + default: + ccreg |= (TURBOSPARC_SCENABLE); + } + turbosparc_set_ccreg (ccreg); + + mreg |= (TURBOSPARC_ICENABLE | TURBOSPARC_DCENABLE); /* I & D caches on */ + mreg |= (TURBOSPARC_ICSNOOP); /* Icache snooping on */ + srmmu_set_mmureg(mreg); +} + +__initfunc(static void init_turbosparc(void)) +{ + srmmu_name = "Fujitsu TurboSparc"; + srmmu_modtype = TurboSparc; + + flush_cache_all = turbosparc_flush_cache_all; + flush_cache_mm = hypersparc_flush_cache_mm; + flush_cache_page = hypersparc_flush_cache_page; + flush_cache_range = hypersparc_flush_cache_range; + + flush_tlb_all = hypersparc_flush_tlb_all; + flush_tlb_mm = hypersparc_flush_tlb_mm; + flush_tlb_page = hypersparc_flush_tlb_page; + flush_tlb_range = hypersparc_flush_tlb_range; + +#ifdef TURBOSPARC_WRITEBACK + flush_page_to_ram = hypersparc_flush_page_to_ram; + flush_chunk = hypersparc_flush_chunk; +#else + flush_page_to_ram = swift_flush_page_to_ram; + flush_chunk = swift_flush_chunk; +#endif + + flush_sig_insns = turbosparc_flush_sig_insns; + flush_page_for_dma = hypersparc_flush_page_for_dma; + + poke_srmmu = poke_turbosparc; +} + static void poke_tsunami(void) { unsigned long mreg = srmmu_get_mmureg(); @@ -2785,9 +2859,33 @@ __initfunc(static void get_srmmu_type(void)) }; return; } + + /* Now Fujitsu TurboSparc. It might happen that it is + in Swift emulation mode, so we will check later... */ + if (psr_typ == 0 && psr_vers == 5) { + init_turbosparc(); + return; + } /* Next check for Fujitsu Swift. */ if(psr_typ == 0 && psr_vers == 4) { + int cpunode; + char node_str[128]; + + /* Look if it is not a TurboSparc emulating Swift... */ + cpunode = prom_getchild(prom_root_node); + while((cpunode = prom_getsibling(cpunode)) != 0) { + prom_getstring(cpunode, "device_type", node_str, sizeof(node_str)); + if(!strcmp(node_str, "cpu")) { + if (!prom_getintdefault(cpunode, "psr-implementation", 1) && + prom_getintdefault(cpunode, "psr-version", 1) == 5) { + init_turbosparc(); + return; + } + break; + } + } + init_swift(); return; } diff --git a/arch/sparc/mm/turbosparc.S b/arch/sparc/mm/turbosparc.S new file mode 100644 index 000000000..5660d4f84 --- /dev/null +++ b/arch/sparc/mm/turbosparc.S @@ -0,0 +1,46 @@ +/* $Id: turbosparc.S,v 1.1 1997/07/18 06:26:22 ralf Exp $ + * turbosparc.S: High speed Hypersparc mmu/cache operations. + * + * Copyright (C) 1997 David S. Miller (davem@caip.rutgers.edu) + * Copyright (C) 1997 Jakub Jelinek (jj@sunsite.mff.cuni.cz) + */ + +#include <asm/ptrace.h> +#include <asm/psr.h> +#include <asm/asi.h> +#include <asm/page.h> +#include <asm/pgtsrmmu.h> + +#define WINDOW_FLUSH(tmp1, tmp2) \ + mov 0, tmp1; \ +98: ld [%g6 + AOFF_task_tss + AOFF_thread_uwinmask], tmp2; \ + orcc %g0, tmp2, %g0; \ + add tmp1, 1, tmp1; \ + bne 98b; \ + save %sp, -64, %sp; \ +99: subcc tmp1, 1, tmp1; \ + bne 99b; \ + restore %g0, %g0, %g0; + + .text + .align 4 + + .globl turbosparc_flush_cache_all + .globl turbosparc_flush_sig_insns + +turbosparc_flush_cache_all: + WINDOW_FLUSH(%g4, %g5) + sethi %hi(vac_cache_size), %g4 + ld [%g4 + %lo(vac_cache_size)], %g5 + sethi %hi(vac_line_size), %g1 + ld [%g1 + %lo(vac_line_size)], %g2 +1: + subcc %g5, %g2, %g5 + bne 1b + sta %g0, [%g5] ASI_M_DATAC_TAG + retl + sta %g0, [%g0] ASI_M_IC_FLCLEAR + +turbosparc_flush_sig_insns: + retl + nop diff --git a/arch/sparc/prom/bootstr.c b/arch/sparc/prom/bootstr.c index 1722d9fdc..e7bd9b06d 100644 --- a/arch/sparc/prom/bootstr.c +++ b/arch/sparc/prom/bootstr.c @@ -1,4 +1,4 @@ -/* $Id: bootstr.c,v 1.12 1996/12/18 06:46:54 tridge Exp $ +/* $Id: bootstr.c,v 1.14 1997/06/19 16:28:49 jj Exp $ * bootstr.c: Boot string/argument acquisition from the PROM. * * Copyright(C) 1995 David S. Miller (davem@caip.rutgers.edu) @@ -7,13 +7,14 @@ #include <linux/config.h> #include <linux/string.h> #include <asm/oplib.h> +#include <linux/init.h> #define BARG_LEN 256 -static char barg_buf[BARG_LEN]; -static char fetched = 0; +static char barg_buf[BARG_LEN] __initdata = { 0 }; +static char fetched __initdata = 0; -char * -prom_getbootargs(void) +__initfunc(char * +prom_getbootargs(void)) { int iter; char *cp, *arg; diff --git a/arch/sparc/prom/tree.c b/arch/sparc/prom/tree.c index 251b2ee6a..295ce5355 100644 --- a/arch/sparc/prom/tree.c +++ b/arch/sparc/prom/tree.c @@ -1,4 +1,4 @@ -/* $Id: tree.c,v 1.18 1997/05/14 20:45:03 davem Exp $ +/* $Id: tree.c,v 1.19 1997/06/27 14:52:54 jj Exp $ * tree.c: Basic device tree traversal/scanning for the Linux * prom library. * @@ -231,7 +231,7 @@ int prom_getname (int node, char *buffer, int len) /* Return the first property type for node 'node'. */ -char * prom_firstprop(int node) +char * prom_firstprop(int node, char *buffer) { unsigned long flags; char *ret; @@ -248,7 +248,7 @@ char * prom_firstprop(int node) * at node 'node' . Returns NULL string if no more * property types for this node. */ -char * prom_nextprop(int node, char *oprop) +char * prom_nextprop(int node, char *oprop, char *buffer) { char *ret; unsigned long flags; @@ -293,7 +293,7 @@ int prom_node_has_property(int node, char *prop) char *current_property = ""; do { - current_property = prom_nextprop(node, current_property); + current_property = prom_nextprop(node, current_property, NULL); if(!strcmp(current_property, prop)) return 1; } while (*current_property); |