From 0eb78f0b1a0f61b292380028b0debd5af7b3838a Mon Sep 17 00:00:00 2001 From: "David S. Miller" Date: Sat, 26 Apr 2008 03:35:02 -0700 Subject: sparc64: Kill ISA_FLOPPY_WORKS code. This never was enabled, I could never get it working, and if anyone wants to try and get it's very easy to reference this code in the history. It's the only thing referencing the silly ISA device layer in the sparc64 tree. OF device layer infrastructure is what should be used for these things. Signed-off-by: David S. Miller --- include/asm-sparc64/floppy.h | 83 +------------------------------------------- 1 file changed, 1 insertion(+), 82 deletions(-) (limited to 'include') diff --git a/include/asm-sparc64/floppy.h b/include/asm-sparc64/floppy.h index c47f58d6c15..040d7962c5a 100644 --- a/include/asm-sparc64/floppy.h +++ b/include/asm-sparc64/floppy.h @@ -558,82 +558,6 @@ static int __init ebus_fdthree_p(struct linux_ebus_device *edev) } #endif -#ifdef CONFIG_PCI -#undef ISA_FLOPPY_WORKS - -#ifdef ISA_FLOPPY_WORKS -static unsigned long __init isa_floppy_init(void) -{ - struct sparc_isa_bridge *isa_br; - struct sparc_isa_device *isa_dev = NULL; - - for_each_isa(isa_br) { - for_each_isadev(isa_dev, isa_br) { - if (!strcmp(isa_dev->prom_node->name, "dma")) { - struct sparc_isa_device *child = - isa_dev->child; - - while (child) { - if (!strcmp(child->prom_node->name, - "floppy")) { - isa_dev = child; - goto isa_done; - } - child = child->next; - } - } - } - } -isa_done: - if (!isa_dev) - return 0; - - /* We could use DMA on devices behind the ISA bridge, but... - * - * There is a slight problem. Normally on x86 kit the x86 processor - * delays I/O port instructions when the ISA bus "dma in progress" - * signal is active. Well, sparc64 systems do not monitor this - * signal thus we would need to block all I/O port accesses in software - * when a dma transfer is active for some device. - */ - - sun_fdc = (struct sun_flpy_controller *)isa_dev->resource.start; - FLOPPY_IRQ = isa_dev->irq; - - sun_fdops.fd_inb = sun_pci_fd_inb; - sun_fdops.fd_outb = sun_pci_fd_outb; - - can_use_virtual_dma = use_virtual_dma = 1; - sun_fdops.fd_enable_dma = sun_fd_enable_dma; - sun_fdops.fd_disable_dma = sun_fd_disable_dma; - sun_fdops.fd_set_dma_mode = sun_fd_set_dma_mode; - sun_fdops.fd_set_dma_addr = sun_fd_set_dma_addr; - sun_fdops.fd_set_dma_count = sun_fd_set_dma_count; - sun_fdops.get_dma_residue = sun_get_dma_residue; - - sun_fdops.fd_request_irq = sun_fd_request_irq; - sun_fdops.fd_free_irq = sun_fd_free_irq; - - /* Floppy eject is manual. Actually, could determine this - * via presence of 'manual' property in OBP node. - */ - sun_fdops.fd_eject = sun_pci_fd_eject; - - fdc_status = (unsigned long) &sun_fdc->status_82077; - - allowed_drive_mask = 0; - sun_floppy_types[0] = 0; - sun_floppy_types[1] = 4; - - sun_pci_broken_drive = 1; - sun_fdops.fd_outb = sun_pci_fd_broken_outb; - - return sun_floppy_types[0]; -} -#endif /* ISA_FLOPPY_WORKS */ - -#endif - static unsigned long __init sun_floppy_init(void) { char state[128]; @@ -667,13 +591,8 @@ static unsigned long __init sun_floppy_init(void) } } ebus_done: - if (!edev) { -#ifdef ISA_FLOPPY_WORKS - return isa_floppy_init(); -#else + if (!edev) return 0; -#endif - } state_prop = of_get_property(edev->prom_node, "status", NULL); if (state_prop && !strncmp(state_prop, "disabled", 8)) -- cgit v1.2.3 From 5da496e4b90626784a82803682e186a8e67222a0 Mon Sep 17 00:00:00 2001 From: "David S. Miller" Date: Sat, 26 Apr 2008 21:07:35 -0700 Subject: sparc64: Kill unused local ISA bus layer. No more drivers use this, and therefore it can die. Signed-off-by: David S. Miller --- include/asm-sparc64/floppy.h | 1 - include/asm-sparc64/isa.h | 47 -------------------------------------------- 2 files changed, 48 deletions(-) delete mode 100644 include/asm-sparc64/isa.h (limited to 'include') diff --git a/include/asm-sparc64/floppy.h b/include/asm-sparc64/floppy.h index 040d7962c5a..ca19f80a9b7 100644 --- a/include/asm-sparc64/floppy.h +++ b/include/asm-sparc64/floppy.h @@ -293,7 +293,6 @@ static int sun_fd_eject(int drive) #ifdef CONFIG_PCI #include -#include #include static struct ebus_dma_info sun_pci_fd_ebus_dma; diff --git a/include/asm-sparc64/isa.h b/include/asm-sparc64/isa.h deleted file mode 100644 index ecd9290f78d..00000000000 --- a/include/asm-sparc64/isa.h +++ /dev/null @@ -1,47 +0,0 @@ -/* $Id: isa.h,v 1.1 2001/05/11 04:31:55 davem Exp $ - * isa.h: Sparc64 layer for PCI to ISA bridge devices. - * - * Copyright (C) 2001 David S. Miller (davem@redhat.com) - */ - -#ifndef __SPARC64_ISA_H -#define __SPARC64_ISA_H - -#include -#include -#include - -struct sparc_isa_bridge; - -struct sparc_isa_device { - struct of_device ofdev; - struct sparc_isa_device *next; - struct sparc_isa_device *child; - struct sparc_isa_bridge *bus; - struct device_node *prom_node; - struct resource resource; - unsigned int irq; -}; -#define to_isa_device(d) container_of(d, struct sparc_isa_device, ofdev.dev) - -struct sparc_isa_bridge { - struct of_device ofdev; - struct sparc_isa_bridge *next; - struct sparc_isa_device *devices; - struct pci_dev *self; - int index; - struct device_node *prom_node; -}; -#define to_isa_bridge(d) container_of(d, struct sparc_isa_bridge, ofdev.dev) - -extern struct sparc_isa_bridge *isa_chain; - -extern void isa_init(void); - -#define for_each_isa(bus) \ - for((bus) = isa_chain; (bus); (bus) = (bus)->next) - -#define for_each_isadev(dev, bus) \ - for((dev) = (bus)->devices; (dev); (dev) = (dev)->next) - -#endif /* !(__SPARC64_ISA_H) */ -- cgit v1.2.3 From 5526b7e4513c66bc1c91f661dcd518d5199f8934 Mon Sep 17 00:00:00 2001 From: "David S. Miller" Date: Sun, 27 Apr 2008 02:26:36 -0700 Subject: sparc: Remove old style signal frame support. Back around the same time we were bootstrapping the first 32-bit sparc Linux kernel with a SunOS userland, we made the signal frame match that of SunOS. By the time we even started putting together a native Linux userland for 32-bit Sparc we realized this layout wasn't sufficient for Linux's needs. Therefore we changed the layout, yet kept support for the old style signal frame layout in there. The detection mechanism is that we had sys_sigaction() start passing in a negative signal number to indicate "new style signal frames please". Anyways, no binaries exist in the world that use the old stuff. In fact, I bet Jakub Jelinek and myself are the only two people who ever had such binaries to be honest. So let's get rid of this stuff. I added an assertion using WARN_ON_ONCE() that makes sure 32-bit applications are passing in that negative signal number still. Signed-off-by: David S. Miller --- include/asm-sparc/processor.h | 4 +--- include/asm-sparc64/thread_info.h | 6 ++---- 2 files changed, 3 insertions(+), 7 deletions(-) (limited to 'include') diff --git a/include/asm-sparc/processor.h b/include/asm-sparc/processor.h index e3006979709..8898efbbbe0 100644 --- a/include/asm-sparc/processor.h +++ b/include/asm-sparc/processor.h @@ -1,5 +1,4 @@ -/* $Id: processor.h,v 1.83 2001/10/08 09:32:13 davem Exp $ - * include/asm-sparc/processor.h +/* include/asm-sparc/processor.h * * Copyright (C) 1994 David S. Miller (davem@caip.rutgers.edu) */ @@ -65,7 +64,6 @@ struct thread_struct { struct fpq fpqueue[16]; unsigned long flags; mm_segment_t current_ds; - int new_signal; }; #define SPARC_FLAG_KTHREAD 0x1 /* task is a kernel thread */ diff --git a/include/asm-sparc64/thread_info.h b/include/asm-sparc64/thread_info.h index 98252cd44dd..71e42d1a80d 100644 --- a/include/asm-sparc64/thread_info.h +++ b/include/asm-sparc64/thread_info.h @@ -1,5 +1,4 @@ -/* $Id: thread_info.h,v 1.1 2002/02/10 00:00:58 davem Exp $ - * thread_info.h: sparc64 low-level thread information +/* thread_info.h: sparc64 low-level thread information * * Copyright (C) 2002 David S. Miller (davem@redhat.com) */ @@ -223,7 +222,7 @@ register struct thread_info *current_thread_info_reg asm("g6"); #define TIF_NEED_RESCHED 3 /* rescheduling necessary */ #define TIF_PERFCTR 4 /* performance counters active */ #define TIF_UNALIGNED 5 /* allowed to do unaligned accesses */ -#define TIF_NEWSIGNALS 6 /* wants new-style signals */ +/* flag bit 6 is available */ #define TIF_32BIT 7 /* 32-bit binary */ /* flag bit 8 is available */ #define TIF_SECCOMP 9 /* secure computing */ @@ -242,7 +241,6 @@ register struct thread_info *current_thread_info_reg asm("g6"); #define _TIF_NEED_RESCHED (1< Date: Sun, 27 Apr 2008 14:52:51 -0700 Subject: sparc64: Clean up handling of pt_regs trap type encoding. If we use this from more than one place, it's better to have helpers instead of twiddling magic constants all over. Add pt_regs_trap_type(), pt_regs_clear_trap_type(), and pt_regs_is_syscall(). Use them in do_signal(). Signed-off-by: David S. Miller --- include/asm-sparc64/ptrace.h | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) (limited to 'include') diff --git a/include/asm-sparc64/ptrace.h b/include/asm-sparc64/ptrace.h index b4b951d570b..714b81956f3 100644 --- a/include/asm-sparc64/ptrace.h +++ b/include/asm-sparc64/ptrace.h @@ -1,4 +1,3 @@ -/* $Id: ptrace.h,v 1.14 2002/02/09 19:49:32 davem Exp $ */ #ifndef _SPARC64_PTRACE_H #define _SPARC64_PTRACE_H @@ -8,10 +7,15 @@ * stack during a system call and basically all traps. */ +/* This magic value must have the low 9 bits clear, + * as that is where we encode the %tt value, see below. + */ #define PT_REGS_MAGIC 0x57ac6c00 #ifndef __ASSEMBLY__ +#include + struct pt_regs { unsigned long u_regs[16]; /* globals and ins */ unsigned long tstate; @@ -33,6 +37,23 @@ struct pt_regs { unsigned int magic; }; +static inline int pt_regs_trap_type(struct pt_regs *regs) +{ + return regs->magic & 0x1ff; +} + +static inline int pt_regs_clear_trap_type(struct pt_regs *regs) +{ + return regs->magic &= ~0x1ff; +} + +static inline bool pt_regs_is_syscall(struct pt_regs *regs) +{ + int tt = pt_regs_trap_type(regs); + + return (tt == 0x110 || tt == 0x111 || tt == 0x16d); +} + struct pt_regs32 { unsigned int psr; unsigned int pc; -- cgit v1.2.3