summaryrefslogtreecommitdiff
path: root/include/asm-sparc64
diff options
context:
space:
mode:
Diffstat (limited to 'include/asm-sparc64')
-rw-r--r--include/asm-sparc64/Kbuild1
-rw-r--r--include/asm-sparc64/a.out-core.h31
-rw-r--r--include/asm-sparc64/a.out.h1
-rw-r--r--include/asm-sparc64/bitops.h1
-rw-r--r--include/asm-sparc64/floppy.h84
-rw-r--r--include/asm-sparc64/futex.h2
-rw-r--r--include/asm-sparc64/hugetlb.h84
-rw-r--r--include/asm-sparc64/ide.h2
-rw-r--r--include/asm-sparc64/ioctls.h2
-rw-r--r--include/asm-sparc64/iommu.h3
-rw-r--r--include/asm-sparc64/isa.h47
-rw-r--r--include/asm-sparc64/kgdb.h1
-rw-r--r--include/asm-sparc64/lmb.h10
-rw-r--r--include/asm-sparc64/mman.h13
-rw-r--r--include/asm-sparc64/mmzone.h17
-rw-r--r--include/asm-sparc64/namei.h15
-rw-r--r--include/asm-sparc64/numnodes.h6
-rw-r--r--include/asm-sparc64/page.h2
-rw-r--r--include/asm-sparc64/pconf.h25
-rw-r--r--include/asm-sparc64/pgtable.h10
-rw-r--r--include/asm-sparc64/pil.h7
-rw-r--r--include/asm-sparc64/ptrace.h41
-rw-r--r--include/asm-sparc64/semaphore.h54
-rw-r--r--include/asm-sparc64/socket.h3
-rw-r--r--include/asm-sparc64/solerrno.h132
-rw-r--r--include/asm-sparc64/sparsemem.h2
-rw-r--r--include/asm-sparc64/svr4.h120
-rw-r--r--include/asm-sparc64/system.h5
-rw-r--r--include/asm-sparc64/termios.h5
-rw-r--r--include/asm-sparc64/thread_info.h6
-rw-r--r--include/asm-sparc64/topology.h73
-rw-r--r--include/asm-sparc64/ttable.h38
-rw-r--r--include/asm-sparc64/types.h30
-rw-r--r--include/asm-sparc64/unaligned.h10
-rw-r--r--include/asm-sparc64/unistd.h10
-rw-r--r--include/asm-sparc64/user.h61
36 files changed, 266 insertions, 688 deletions
diff --git a/include/asm-sparc64/Kbuild b/include/asm-sparc64/Kbuild
index a90dc82129d1..dce1cf9a9313 100644
--- a/include/asm-sparc64/Kbuild
+++ b/include/asm-sparc64/Kbuild
@@ -12,7 +12,6 @@ header-y += display7seg.h
header-y += envctrl.h
header-y += openprom.h
header-y += openpromio.h
-header-y += pconf.h
header-y += psrcompat.h
header-y += pstate.h
header-y += reg.h
diff --git a/include/asm-sparc64/a.out-core.h b/include/asm-sparc64/a.out-core.h
deleted file mode 100644
index 3499b3c425ca..000000000000
--- a/include/asm-sparc64/a.out-core.h
+++ /dev/null
@@ -1,31 +0,0 @@
-/* a.out coredump register dumper
- *
- * Copyright (C) 2007 Red Hat, Inc. All Rights Reserved.
- * Written by David Howells (dhowells@redhat.com)
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public Licence
- * as published by the Free Software Foundation; either version
- * 2 of the Licence, or (at your option) any later version.
- */
-
-#ifndef _ASM_A_OUT_CORE_H
-#define _ASM_A_OUT_CORE_H
-
-#ifdef __KERNEL__
-
-#include <linux/user.h>
-
-/*
- * fill in the user structure for an a.out core dump
- */
-static inline void aout_dump_thread(struct pt_regs *regs, struct user *dump)
-{
- /* Only should be used for SunOS and ancient a.out
- * SparcLinux binaries... Not worth implementing.
- */
- memset(dump, 0, sizeof(struct user));
-}
-
-#endif /* __KERNEL__ */
-#endif /* _ASM_A_OUT_CORE_H */
diff --git a/include/asm-sparc64/a.out.h b/include/asm-sparc64/a.out.h
deleted file mode 100644
index 44208c2a188e..000000000000
--- a/include/asm-sparc64/a.out.h
+++ /dev/null
@@ -1 +0,0 @@
-#include <asm-sparc/a.out.h>
diff --git a/include/asm-sparc64/bitops.h b/include/asm-sparc64/bitops.h
index 982ce8992b91..11f9d8146cdf 100644
--- a/include/asm-sparc64/bitops.h
+++ b/include/asm-sparc64/bitops.h
@@ -34,6 +34,7 @@ extern void change_bit(unsigned long nr, volatile unsigned long *addr);
#include <asm-generic/bitops/ffz.h>
#include <asm-generic/bitops/__ffs.h>
#include <asm-generic/bitops/fls.h>
+#include <asm-generic/bitops/__fls.h>
#include <asm-generic/bitops/fls64.h>
#ifdef __KERNEL__
diff --git a/include/asm-sparc64/floppy.h b/include/asm-sparc64/floppy.h
index c47f58d6c15c..ca19f80a9b7d 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 <asm/ebus.h>
-#include <asm/isa.h>
#include <asm/ns87303.h>
static struct ebus_dma_info sun_pci_fd_ebus_dma;
@@ -558,82 +557,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 +590,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))
diff --git a/include/asm-sparc64/futex.h b/include/asm-sparc64/futex.h
index df1097d6ffbe..d8378935ae90 100644
--- a/include/asm-sparc64/futex.h
+++ b/include/asm-sparc64/futex.h
@@ -2,9 +2,9 @@
#define _SPARC64_FUTEX_H
#include <linux/futex.h>
+#include <linux/uaccess.h>
#include <asm/errno.h>
#include <asm/system.h>
-#include <asm/uaccess.h>
#define __futex_cas_op(insn, ret, oldval, uaddr, oparg) \
__asm__ __volatile__( \
diff --git a/include/asm-sparc64/hugetlb.h b/include/asm-sparc64/hugetlb.h
new file mode 100644
index 000000000000..412af58926a0
--- /dev/null
+++ b/include/asm-sparc64/hugetlb.h
@@ -0,0 +1,84 @@
+#ifndef _ASM_SPARC64_HUGETLB_H
+#define _ASM_SPARC64_HUGETLB_H
+
+#include <asm/page.h>
+
+
+void set_huge_pte_at(struct mm_struct *mm, unsigned long addr,
+ pte_t *ptep, pte_t pte);
+
+pte_t huge_ptep_get_and_clear(struct mm_struct *mm, unsigned long addr,
+ pte_t *ptep);
+
+void hugetlb_prefault_arch_hook(struct mm_struct *mm);
+
+static inline int is_hugepage_only_range(struct mm_struct *mm,
+ unsigned long addr,
+ unsigned long len) {
+ return 0;
+}
+
+/*
+ * If the arch doesn't supply something else, assume that hugepage
+ * size aligned regions are ok without further preparation.
+ */
+static inline int prepare_hugepage_range(unsigned long addr, unsigned long len)
+{
+ if (len & ~HPAGE_MASK)
+ return -EINVAL;
+ if (addr & ~HPAGE_MASK)
+ return -EINVAL;
+ return 0;
+}
+
+static inline void hugetlb_free_pgd_range(struct mmu_gather **tlb,
+ unsigned long addr, unsigned long end,
+ unsigned long floor,
+ unsigned long ceiling)
+{
+ free_pgd_range(tlb, addr, end, floor, ceiling);
+}
+
+static inline void huge_ptep_clear_flush(struct vm_area_struct *vma,
+ unsigned long addr, pte_t *ptep)
+{
+}
+
+static inline int huge_pte_none(pte_t pte)
+{
+ return pte_none(pte);
+}
+
+static inline pte_t huge_pte_wrprotect(pte_t pte)
+{
+ return pte_wrprotect(pte);
+}
+
+static inline void huge_ptep_set_wrprotect(struct mm_struct *mm,
+ unsigned long addr, pte_t *ptep)
+{
+ ptep_set_wrprotect(mm, addr, ptep);
+}
+
+static inline int huge_ptep_set_access_flags(struct vm_area_struct *vma,
+ unsigned long addr, pte_t *ptep,
+ pte_t pte, int dirty)
+{
+ return ptep_set_access_flags(vma, addr, ptep, pte, dirty);
+}
+
+static inline pte_t huge_ptep_get(pte_t *ptep)
+{
+ return *ptep;
+}
+
+static inline int arch_prepare_hugepage(struct page *page)
+{
+ return 0;
+}
+
+static inline void arch_release_hugepage(struct page *page)
+{
+}
+
+#endif /* _ASM_SPARC64_HUGETLB_H */
diff --git a/include/asm-sparc64/ide.h b/include/asm-sparc64/ide.h
index ac7eb210b941..c5fdabe0b42d 100644
--- a/include/asm-sparc64/ide.h
+++ b/include/asm-sparc64/ide.h
@@ -24,8 +24,6 @@
# endif
#endif
-#define ide_default_io_ctl(base) ((base) + 0x206) /* obsolete */
-
#define __ide_insl(data_reg, buffer, wcount) \
__ide_insw(data_reg, buffer, (wcount)<<1)
#define __ide_outsl(data_reg, buffer, wcount) \
diff --git a/include/asm-sparc64/ioctls.h b/include/asm-sparc64/ioctls.h
index 083c9a0f37de..c1be40647c99 100644
--- a/include/asm-sparc64/ioctls.h
+++ b/include/asm-sparc64/ioctls.h
@@ -44,8 +44,6 @@
#define __TIOCSETX _IOW('t', 34, int) /* SunOS Specific */
#define __TIOCGETX _IOR('t', 35, int) /* SunOS Specific */
#define TIOCCONS _IO('t', 36)
-#define __TIOCSSIZE _IOW('t', 37, struct sunos_ttysize) /* SunOS Specific */
-#define __TIOCGSIZE _IOR('t', 38, struct sunos_ttysize) /* SunOS Specific */
#define TIOCGSOFTCAR _IOR('t', 100, int)
#define TIOCSSOFTCAR _IOW('t', 101, int)
#define __TIOCUCNTL _IOW('t', 102, int) /* SunOS Specific */
diff --git a/include/asm-sparc64/iommu.h b/include/asm-sparc64/iommu.h
index 46325ddee23b..d7b9afcba08b 100644
--- a/include/asm-sparc64/iommu.h
+++ b/include/asm-sparc64/iommu.h
@@ -56,6 +56,7 @@ struct strbuf {
};
extern int iommu_table_init(struct iommu *iommu, int tsbsize,
- u32 dma_offset, u32 dma_addr_mask);
+ u32 dma_offset, u32 dma_addr_mask,
+ int numa_node);
#endif /* !(_SPARC64_IOMMU_H) */
diff --git a/include/asm-sparc64/isa.h b/include/asm-sparc64/isa.h
deleted file mode 100644
index ecd9290f78d4..000000000000
--- 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 <asm/oplib.h>
-#include <asm/prom.h>
-#include <asm/of_device.h>
-
-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) */
diff --git a/include/asm-sparc64/kgdb.h b/include/asm-sparc64/kgdb.h
new file mode 100644
index 000000000000..aa6532fd3a13
--- /dev/null
+++ b/include/asm-sparc64/kgdb.h
@@ -0,0 +1 @@
+#include <asm-sparc/kgdb.h>
diff --git a/include/asm-sparc64/lmb.h b/include/asm-sparc64/lmb.h
new file mode 100644
index 000000000000..6a352cbcf520
--- /dev/null
+++ b/include/asm-sparc64/lmb.h
@@ -0,0 +1,10 @@
+#ifndef _SPARC64_LMB_H
+#define _SPARC64_LMB_H
+
+#include <asm/oplib.h>
+
+#define LMB_DBG(fmt...) prom_printf(fmt)
+
+#define LMB_REAL_LIMIT 0
+
+#endif /* !(_SPARC64_LMB_H) */
diff --git a/include/asm-sparc64/mman.h b/include/asm-sparc64/mman.h
index 8cc1860be630..e584563b56eb 100644
--- a/include/asm-sparc64/mman.h
+++ b/include/asm-sparc64/mman.h
@@ -22,19 +22,6 @@
#define MAP_POPULATE 0x8000 /* populate (prefault) pagetables */
#define MAP_NONBLOCK 0x10000 /* do not block on IO */
-/* XXX Need to add flags to SunOS's mctl, mlockall, and madvise system
- * XXX calls.
- */
-
-/* SunOS sys_mctl() stuff... */
-#define MC_SYNC 1 /* Sync pages in memory with storage (usu. a file) */
-#define MC_LOCK 2 /* Lock pages into core ram, do not allow swapping of them */
-#define MC_UNLOCK 3 /* Unlock pages locked via previous mctl() with MC_LOCK arg */
-#define MC_LOCKAS 5 /* Lock an entire address space of the calling process */
-#define MC_UNLOCKAS 6 /* Unlock entire address space of calling process */
-
-#define MADV_FREE 0x5 /* (Solaris) contents can be freed */
-
#ifdef __KERNEL__
#ifndef __ASSEMBLY__
#define arch_mmap_check sparc64_mmap_check
diff --git a/include/asm-sparc64/mmzone.h b/include/asm-sparc64/mmzone.h
new file mode 100644
index 000000000000..ebf5986c12ed
--- /dev/null
+++ b/include/asm-sparc64/mmzone.h
@@ -0,0 +1,17 @@
+#ifndef _SPARC64_MMZONE_H
+#define _SPARC64_MMZONE_H
+
+#ifdef CONFIG_NEED_MULTIPLE_NODES
+
+extern struct pglist_data *node_data[];
+
+#define NODE_DATA(nid) (node_data[nid])
+#define node_start_pfn(nid) (NODE_DATA(nid)->node_start_pfn)
+#define node_end_pfn(nid) (NODE_DATA(nid)->node_end_pfn)
+
+extern int numa_cpu_lookup_table[];
+extern cpumask_t numa_cpumask_lookup_table[];
+
+#endif /* CONFIG_NEED_MULTIPLE_NODES */
+
+#endif /* _SPARC64_MMZONE_H */
diff --git a/include/asm-sparc64/namei.h b/include/asm-sparc64/namei.h
index ccda19e28695..275161f21213 100644
--- a/include/asm-sparc64/namei.h
+++ b/include/asm-sparc64/namei.h
@@ -8,19 +8,6 @@
#ifndef __SPARC64_NAMEI_H
#define __SPARC64_NAMEI_H
-#define SPARC_BSD_EMUL "/usr/gnemul/sunos/"
-#define SPARC_SOL_EMUL "/usr/gnemul/solaris/"
-
-static inline char * __emul_prefix(void)
-{
- switch (current->personality) {
- case PER_SUNOS:
- return SPARC_BSD_EMUL;
- case PER_SVR4:
- return SPARC_SOL_EMUL;
- default:
- return NULL;
- }
-}
+#define __emul_prefix() NULL
#endif /* __SPARC64_NAMEI_H */
diff --git a/include/asm-sparc64/numnodes.h b/include/asm-sparc64/numnodes.h
deleted file mode 100644
index 017e7e74f5e7..000000000000
--- a/include/asm-sparc64/numnodes.h
+++ /dev/null
@@ -1,6 +0,0 @@
-#ifndef _SPARC64_NUMNODES_H
-#define _SPARC64_NUMNODES_H
-
-#define NODES_SHIFT 0
-
-#endif /* !(_SPARC64_NUMNODES_H) */
diff --git a/include/asm-sparc64/page.h b/include/asm-sparc64/page.h
index e93a482aa24a..618117def0dc 100644
--- a/include/asm-sparc64/page.h
+++ b/include/asm-sparc64/page.h
@@ -39,8 +39,6 @@
#define HPAGE_SIZE (_AC(1,UL) << HPAGE_SHIFT)
#define HPAGE_MASK (~(HPAGE_SIZE - 1UL))
#define HUGETLB_PAGE_ORDER (HPAGE_SHIFT - PAGE_SHIFT)
-#define ARCH_HAS_SETCLEAR_HUGE_PTE
-#define ARCH_HAS_HUGETLB_PREFAULT_HOOK
#define HAVE_ARCH_HUGETLB_UNMAPPED_AREA
#endif
diff --git a/include/asm-sparc64/pconf.h b/include/asm-sparc64/pconf.h
deleted file mode 100644
index aad106a70908..000000000000
--- a/include/asm-sparc64/pconf.h
+++ /dev/null
@@ -1,25 +0,0 @@
-/* $Id: pconf.h,v 1.1 1996/12/02 00:09:10 davem Exp $
- * pconf.h: pathconf() and fpathconf() defines for SunOS
- * system call compatibility.
- *
- * Copyright (C) 1995, 1996 David S. Miller (davem@caip.rutgers.edu)
- */
-
-#ifndef _SPARC64_PCONF_H
-#define _SPARC64_PCONF_H
-
-#include <linux/fs.h>
-#include <linux/limits.h>
-
-#define _PCONF_LINK 1 /* Max number of links to an object */
-#define _PCONF_CANON 2 /* TTY input buffer line size */
-#define _PCONF_INPUT 3 /* Biggest packet a tty can imbibe at once */
-#define _PCONF_NAME 4 /* Filename length max */
-#define _PCONF_PATH 5 /* Max size of a pathname */
-#define _PCONF_PIPE 6 /* Buffer size for a pipe */
-#define _PCONF_CHRESTRICT 7 /* Can only root chown files? */
-#define _PCONF_NOTRUNC 8 /* Are pathnames truncated if too big? */
-#define _PCONF_VDISABLE 9 /* Magic char to disable special tty chars */
-#define _PCONF_MAXPCONF 9
-
-#endif /* !(_SPARC64_PCONF_H) */
diff --git a/include/asm-sparc64/pgtable.h b/include/asm-sparc64/pgtable.h
index 549e45266b68..0e200e7acec7 100644
--- a/include/asm-sparc64/pgtable.h
+++ b/include/asm-sparc64/pgtable.h
@@ -506,6 +506,11 @@ static inline pte_t pte_mkyoung(pte_t pte)
return __pte(pte_val(pte) | mask);
}
+static inline pte_t pte_mkspecial(pte_t pte)
+{
+ return pte;
+}
+
static inline unsigned long pte_young(pte_t pte)
{
unsigned long mask;
@@ -608,6 +613,11 @@ static inline unsigned long pte_present(pte_t pte)
return val;
}
+static inline int pte_special(pte_t pte)
+{
+ return 0;
+}
+
#define pmd_set(pmdp, ptep) \
(pmd_val(*(pmdp)) = (__pa((unsigned long) (ptep)) >> 11UL))
#define pud_set(pudp, pmdp) \
diff --git a/include/asm-sparc64/pil.h b/include/asm-sparc64/pil.h
index 72927749aebf..2f5d126f7163 100644
--- a/include/asm-sparc64/pil.h
+++ b/include/asm-sparc64/pil.h
@@ -19,11 +19,4 @@
#define PIL_SMP_CTX_NEW_VERSION 4
#define PIL_DEVICE_IRQ 5
-#ifndef __ASSEMBLY__
-#define PIL_RESERVED(PIL) ((PIL) == PIL_SMP_CALL_FUNC || \
- (PIL) == PIL_SMP_RECEIVE_SIGNAL || \
- (PIL) == PIL_SMP_CAPTURE || \
- (PIL) == PIL_SMP_CTX_NEW_VERSION)
-#endif
-
#endif /* !(_SPARC64_PIL_H) */
diff --git a/include/asm-sparc64/ptrace.h b/include/asm-sparc64/ptrace.h
index 6da197803efc..714b81956f32 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,17 +7,53 @@
* 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 <linux/types.h>
+
struct pt_regs {
unsigned long u_regs[16]; /* globals and ins */
unsigned long tstate;
unsigned long tpc;
unsigned long tnpc;
unsigned int y;
- unsigned int fprs;
+
+ /* We encode a magic number, PT_REGS_MAGIC, along
+ * with the %tt (trap type) register value at trap
+ * entry time. The magic number allows us to identify
+ * accurately a trap stack frame in the stack
+ * unwinder, and the %tt value allows us to test
+ * things like "in a system call" etc. for an arbitray
+ * process.
+ *
+ * The PT_REGS_MAGIC is choosen such that it can be
+ * loaded completely using just a sethi instruction.
+ */
+ 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;
@@ -147,7 +182,7 @@ extern void __show_regs(struct pt_regs *);
#define PT_V9_TPC 0x88
#define PT_V9_TNPC 0x90
#define PT_V9_Y 0x98
-#define PT_V9_FPRS 0x9c
+#define PT_V9_MAGIC 0x9c
#define PT_TSTATE PT_V9_TSTATE
#define PT_TPC PT_V9_TPC
#define PT_TNPC PT_V9_TNPC
diff --git a/include/asm-sparc64/semaphore.h b/include/asm-sparc64/semaphore.h
index 7f7c0c4e024f..d9b2034ed1d2 100644
--- a/include/asm-sparc64/semaphore.h
+++ b/include/asm-sparc64/semaphore.h
@@ -1,53 +1 @@
-#ifndef _SPARC64_SEMAPHORE_H
-#define _SPARC64_SEMAPHORE_H
-
-/* These are actually reasonable on the V9.
- *
- * See asm-ppc/semaphore.h for implementation commentary,
- * only sparc64 specific issues are commented here.
- */
-#ifdef __KERNEL__
-
-#include <asm/atomic.h>
-#include <asm/system.h>
-#include <linux/wait.h>
-#include <linux/rwsem.h>
-
-struct semaphore {
- atomic_t count;
- wait_queue_head_t wait;
-};
-
-#define __SEMAPHORE_INITIALIZER(name, count) \
- { ATOMIC_INIT(count), \
- __WAIT_QUEUE_HEAD_INITIALIZER((name).wait) }
-
-#define __DECLARE_SEMAPHORE_GENERIC(name, count) \
- struct semaphore name = __SEMAPHORE_INITIALIZER(name,count)
-
-#define DECLARE_MUTEX(name) __DECLARE_SEMAPHORE_GENERIC(name, 1)
-
-static inline void sema_init (struct semaphore *sem, int val)
-{
- atomic_set(&sem->count, val);
- init_waitqueue_head(&sem->wait);
-}
-
-static inline void init_MUTEX (struct semaphore *sem)
-{
- sema_init(sem, 1);
-}
-
-static inline void init_MUTEX_LOCKED (struct semaphore *sem)
-{
- sema_init(sem, 0);
-}
-
-extern void up(struct semaphore *sem);
-extern void down(struct semaphore *sem);
-extern int down_trylock(struct semaphore *sem);
-extern int down_interruptible(struct semaphore *sem);
-
-#endif /* __KERNEL__ */
-
-#endif /* !(_SPARC64_SEMAPHORE_H) */
+#include <linux/semaphore.h>
diff --git a/include/asm-sparc64/socket.h b/include/asm-sparc64/socket.h
index 44a625af6e31..8cf071fae3eb 100644
--- a/include/asm-sparc64/socket.h
+++ b/include/asm-sparc64/socket.h
@@ -24,9 +24,6 @@
#define SO_SNDTIMEO 0x4000
#define SO_ACCEPTCONN 0x8000
-/* wha!??? */
-#define SO_DONTLINGER (~SO_LINGER) /* Older SunOS compat. hack */
-
#define SO_SNDBUF 0x1001
#define SO_RCVBUF 0x1002
#define SO_SNDBUFFORCE 0x100a
diff --git a/include/asm-sparc64/solerrno.h b/include/asm-sparc64/solerrno.h
deleted file mode 100644
index a2ea6fcf3446..000000000000
--- a/include/asm-sparc64/solerrno.h
+++ /dev/null
@@ -1,132 +0,0 @@
-/* $Id: solerrno.h,v 1.1 1996/12/26 14:22:40 davem Exp $
- * solerrno.h: Solaris error return codes for compatibility.
- *
- * Copyright (C) 1996 David S. Miller (davem@caip.rutgers.edu)
- */
-
-#ifndef _SPARC64_SOLERRNO_H
-#define _SPARC64_SOLERRNO_H
-
-#define SOL_EPERM 1 /* Required superuser access perms */
-#define SOL_ENOENT 2 /* File or directory does not exist */
-#define SOL_ESRCH 3 /* Process did not exist */
-#define SOL_EINTR 4 /* System call was interrupted */
-#define SOL_EIO 5 /* An i/o error occurred */
-#define SOL_ENXIO 6 /* Device or Address does not exist */
-#define SOL_E2BIG 7 /* Too many arguments were given */
-#define SOL_ENOEXEC 8 /* Header of executable was munged */
-#define SOL_EBADF 9 /* Bogus file number */
-#define SOL_ECHILD 10 /* No children of process exist */
-#define SOL_EAGAIN 11 /* beep beep, "try again later" */
-#define SOL_ENOMEM 12 /* No memory available */
-#define SOL_EACCES 13 /* Access not allowed */
-#define SOL_EFAULT 14 /* Address passed was invalid */
-#define SOL_ENOTBLK 15 /* blkdev op on non-block device */
-#define SOL_EBUSY 16 /* Mounted device was busy */
-#define SOL_EEXIST 17 /* File specified already exists */
-#define SOL_EXDEV 18 /* Link request across diff devices */
-#define SOL_ENODEV 19 /* Device does not exist on system */
-#define SOL_ENOTDIR 20 /* Dir operation on non-directory */
-#define SOL_EISDIR 21 /* File was of directory type */
-#define SOL_EINVAL 22 /* Argument passed was invalid */
-#define SOL_ENFILE 23 /* No more room in file table */
-#define SOL_EMFILE 24 /* Proc has too many files open */
-#define SOL_ENOTTY 25 /* Ioctl was invalid for req device */
-#define SOL_ETXTBSY 26 /* Text file in busy state */
-#define SOL_EFBIG 27 /* Too big of a file for operation */
-#define SOL_ENOSPC 28 /* Disk is full */
-#define SOL_ESPIPE 29 /* Seek attempted on non-seeking dev*/
-#define SOL_EROFS 30 /* Write attempted on read-only fs */
-#define SOL_EMLINK 31 /* Too many links in file search */
-#define SOL_EPIPE 32 /* Call a plumber */
-#define SOL_EDOM 33 /* Argument was out of fct domain */
-#define SOL_ERANGE 34 /* Could not represent math result */
-#define SOL_ENOMSG 35 /* Message of req type doesn't exist */
-#define SOL_EIDRM 36 /* Identifier has been removed */
-#define SOL_ECHRNG 37 /* Req channel number out of range */
-#define SOL_EL2NSYNC 38 /* Could not sync at run level 2 */
-#define SOL_EL3HLT 39 /* Halted at run level 3 */
-#define SOL_EL3RST 40 /* Reset at run level 3 */
-#define SOL_ELNRNG 41 /* Out of range link number */
-#define SOL_EUNATCH 42 /* Driver for protocol not attached */
-#define SOL_ENOCSI 43 /* CSI structure not around */
-#define SOL_EL2HLT 44 /* Halted at run level 2 */
-#define SOL_EDEADLK 45 /* Deadlock condition detected */
-#define SOL_ENOLCK 46 /* Record locks unavailable */
-#define SOL_ECANCELED 47 /* Cancellation of oper. happened */
-#define SOL_ENOTSUP 48 /* Attempt of unsupported operation */
-#define SOL_EDQUOT 49 /* Users disk quota exceeded */
-#define SOL_EBADE 50 /* Invalid exchange */
-#define SOL_EBADR 51 /* Request descriptor was invalid */
-#define SOL_EXFULL 52 /* Full exchange */
-#define SOL_ENOANO 53 /* ano does not exist */
-#define SOL_EBADRQC 54 /* Req code was invalid */
-#define SOL_EBADSLT 55 /* Bad slot number */
-#define SOL_EDEADLOCK 56 /* Deadlock in fs error */
-#define SOL_EBFONT 57 /* Font file format invalid */
-/* YOW, I LOVE SYSV STREAMS!!!! */
-#define SOL_ENOSTR 60 /* Stream-op on non-stream dev */
-#define SOL_ENODATA 61 /* No data avail at this time */
-#define SOL_ETIME 62 /* Expiration of time occurred */
-#define SOL_ENOSR 63 /* Streams resources exhausted */
-#define SOL_ENONET 64 /* No network connected */
-#define SOL_ENOPKG 65 /* Non-installed package */
-#define SOL_EREMOTE 66 /* Object was on remote machine */
-#define SOL_ENOLINK 67 /* Cut link */
-#define SOL_EADV 68 /* Error in advertise */
-#define SOL_ESRMNT 69 /* Some magic srmount problem */
-#define SOL_ECOMM 70 /* During send, comm error occurred */
-#define SOL_EPROTO 71 /* Protocol botch */
-#define SOL_EMULTIHOP 74 /* Multihop attempted */
-#define SOL_EBADMSG 77 /* Message was unreadable */
-#define SOL_ENAMETOOLONG 78 /* Too long of a path name */
-#define SOL_EOVERFLOW 79 /* Data type too small for datum */
-#define SOL_ENOTUNIQ 80 /* Logical name was not unique */
-#define SOL_EBADFD 81 /* Op cannot be performed on fd */
-#define SOL_EREMCHG 82 /* Remote address is now different */
-#define SOL_ELIBACC 83 /* Shared lib could not be accessed */
-#define SOL_ELIBBAD 84 /* ShLib is corrupted in some way */
-#define SOL_ELIBSCN 85 /* A.out ShLib problems */
-#define SOL_ELIBMAX 86 /* Exceeded ShLib linkage limit */
-#define SOL_ELIBEXEC 87 /* Execution of ShLib attempted */
-#define SOL_EILSEQ 88 /* Bad byte sequence found */
-#define SOL_ENOSYS 89 /* Invalid filesystem operation */
-#define SOL_ELOOP 90 /* Detected loop in symbolic links */
-#define SOL_ERESTART 91 /* System call is restartable */
-#define SOL_ESTRPIPE 92 /* Do not sleep in head of stream */
-#define SOL_ENOTEMPTY 93 /* Rmdir of non-empty directory */
-#define SOL_EUSERS 94 /* Over abundance of users for ufs */
-#define SOL_ENOTSOCK 95 /* Sock-op on non-sock */
-#define SOL_EDESTADDRREQ 96 /* No dest addr given, but needed */
-#define SOL_EMSGSIZE 97 /* Msg too big */
-#define SOL_EPROTOTYPE 98 /* Bad socket protocol */
-#define SOL_ENOPROTOOPT 99 /* Unavailable protocol */
-#define SOL_EPROTONOSUPPORT 120 /* Unsupported protocol */
-#define SOL_ESOCKTNOSUPPORT 121 /* Unsupported socket type */
-#define SOL_EOPNOTSUPP 122 /* Unsupported sock-op */
-#define SOL_EPFNOSUPPORT 123 /* Unsupported protocol family */
-#define SOL_EAFNOSUPPORT 124 /* Unsup addr family for protocol */
-#define SOL_EADDRINUSE 125 /* Req addr is already in use */
-#define SOL_EADDRNOTAVAIL 126 /* Req addr not available right now */
-#define SOL_ENETDOWN 127 /* Your subnet is on fire */
-#define SOL_ENETUNREACH 128 /* Someone playing with gateway and */
- /* did not tell you he was going to */
-#define SOL_ENETRESET 129 /* Buy less-buggy ethernet cards */
-#define SOL_ECONNABORTED 130 /* Aborted connection due to sw */
-#define SOL_ECONNRESET 131 /* Your peers reset your connection */
-#define SOL_ENOBUFS 132 /* No buffer space available */
-#define SOL_EISCONN 133 /* Connect on already connected */
- /* socket attempted */
-#define SOL_ENOTCONN 134 /* Comm on non-connected socket */
-#define SOL_ESHUTDOWN 143 /* Op attempted after sock-shutdown */
-#define SOL_ETOOMANYREFS 144 /* Reference limit exceeded */
-#define SOL_ETIMEDOUT 145 /* Timed out connection */
-#define SOL_ECONNREFUSED 146 /* Connection refused by remote host*/
-#define SOL_EHOSTDOWN 147 /* Remote host is up in flames */
-#define SOL_EHOSTUNREACH 148 /* Make a left at Easton Ave..... */
-#define SOL_EWOULDBLOCK EAGAIN /* Just an alias */
-#define SOL_EALREADY 149 /* Operation is already occurring */
-#define SOL_EINPROGRESS 150 /* Operation is happening now */
-#define SOL_ESTALE 151 /* Fungus growth on NFS file handle */
-
-#endif /* !(_SPARC64_SOLERRNO_H) */
diff --git a/include/asm-sparc64/sparsemem.h b/include/asm-sparc64/sparsemem.h
index 77bcd2bfa53c..b99d4e4b6d28 100644
--- a/include/asm-sparc64/sparsemem.h
+++ b/include/asm-sparc64/sparsemem.h
@@ -3,7 +3,7 @@
#ifdef __KERNEL__
-#define SECTION_SIZE_BITS 31
+#define SECTION_SIZE_BITS 30
#define MAX_PHYSADDR_BITS 42
#define MAX_PHYSMEM_BITS 42
diff --git a/include/asm-sparc64/svr4.h b/include/asm-sparc64/svr4.h
deleted file mode 100644
index c96d5f116e1c..000000000000
--- a/include/asm-sparc64/svr4.h
+++ /dev/null
@@ -1,120 +0,0 @@
-/* Solaris/SPARC constants and definitions --
- * (C) 1996 Miguel de Icaza
- *
- * This file is not meant to be included by user level applications
- * but the solaris syscall emulator
- */
-
-#ifndef _SPARC64_SVR4_H
-#define _SPARC64_SVR4_H
-
-/* Signals as used by svr4 */
-typedef struct { /* signal set type */
- uint sigbits[4];
-} svr4_sigset_t;
-
-/* Values for siginfo.code */
-#define SVR4_SINOINFO 32767
-/* Siginfo, sucker expects bunch of information on those parameters */
-typedef union {
- char total_size [128];
- struct {
- int signo;
- int code;
- int error;
- union {
- } data;
- } siginfo;
-} svr4_siginfo_t;
-
-/* Context definition */
-
-/* Location of the user stored registers into a greg_t */
-enum {
- SVR4_PSR, SVR4_PC, SVR4_NPC, SVR4_Y,
- SVR4_G1, SVR4_G2, SVR4_G3, SVR4_G4,
- SVR4_G5, SVR4_G6, SVR4_G7, SVR4_O0,
- SVR4_O1, SVR4_O2, SVR4_O3, SVR4_O4,
- SVR4_O5, SVR4_O6, SVR4_O7
-};
-
-/* sizeof (regs) / sizeof (greg_t), defined in the ABI */
-#define SVR4_NREGS 19
-#define SVR4_MAXWIN 31
-
-typedef struct {
- u32 rwin_lo[8];
- u32 rwin_in[8];
-} svr4_rwindow_t;
-
-typedef struct {
- int count;
- u32 winptr [SVR4_MAXWIN]; /* pointer to the windows */
-
- svr4_rwindow_t win[SVR4_MAXWIN]; /* the windows */
-} svr4_gwindows_t;
-
-typedef int svr4_gregset_t[SVR4_NREGS];
-
-typedef struct {
- u64 fpu_regs[32];
- u32 fp_q;
- u32 fp_fsr;
- u_char fp_nqel;
- u_char fp_nqsize;
- u_char inuse; /* if fpu is in use */
-} svr4_fregset_t;
-
-typedef struct {
- u32 id; /* if this holds "xrs" string => ptr is valid */
- u32 ptr;
-} svr4_xrs_t;
-
-/* Machine dependent context */
-typedef struct {
- svr4_gregset_t greg; /* registers 0..19 (see top) */
- u32 gwin; /* may point to register windows */
- svr4_fregset_t freg; /* floating point registers */
- svr4_xrs_t xrs; /* mhm? */
- int pad[19];
-} svr4_mcontext_t;
-
-/* flags for stack_t.flags */
-enum svr4_stack_flags {
- SVR4_SS_ONSTACK,
- SVR4_SS_DISABLE,
-};
-
-/* signal stack execution place, unsupported */
-typedef struct svr4_stack_t {
- u32 sp;
- int size;
- int flags;
-} svr4_stack_t;
-
-/* Context used by getcontext and setcontext */
-typedef struct svr4_ucontext_t {
- u32 flags; /* context flags, indicate what is loaded */
- u32 link;
- svr4_sigset_t sigmask;
- svr4_stack_t stack;
- svr4_mcontext_t mcontext;
- int pad[23];
-} svr4_ucontext_t;
-
-/* windows hold the windows as they were at signal time,
- * ucontext->mcontext holds a pointer to them.
- * addresses for uc and si are passed as parameters to svr4 signal
- * handler
- */
-
-/* This is the signal frame that is passed to the signal handler */
-typedef struct {
- svr4_gwindows_t gw; /* windows */
- svr4_ucontext_t uc; /* machine context */
- svr4_siginfo_t si; /* siginfo */
-} svr4_signal_frame_t;
-
-#define SVR4_SF_ALIGNED (((sizeof (svr4_signal_frame_t) + 7) & (~7)))
-
-#endif /* include control */
diff --git a/include/asm-sparc64/system.h b/include/asm-sparc64/system.h
index 53eae091a171..6897ac31be41 100644
--- a/include/asm-sparc64/system.h
+++ b/include/asm-sparc64/system.h
@@ -180,12 +180,13 @@ do { if (test_thread_flag(TIF_PERFCTR)) { \
"ldx [%%sp + 2047 + 0x70], %%i6\n\t" \
"ldx [%%sp + 2047 + 0x78], %%i7\n\t" \
"ldx [%%g6 + %9], %%g4\n\t" \
- "brz,pt %%o7, 1f\n\t" \
+ "brz,pt %%o7, switch_to_pc\n\t" \
" mov %%g7, %0\n\t" \
"sethi %%hi(ret_from_syscall), %%g1\n\t" \
"jmpl %%g1 + %%lo(ret_from_syscall), %%g0\n\t" \
" nop\n\t" \
- "1:\n\t" \
+ ".globl switch_to_pc\n\t" \
+ "switch_to_pc:\n\t" \
: "=&r" (last), "=r" (current), "=r" (current_thread_info_reg), \
"=r" (__local_per_cpu_offset) \
: "0" (task_thread_info(next)), \
diff --git a/include/asm-sparc64/termios.h b/include/asm-sparc64/termios.h
index ef527211f8a8..cacbea171ad7 100644
--- a/include/asm-sparc64/termios.h
+++ b/include/asm-sparc64/termios.h
@@ -33,11 +33,6 @@ struct ltchars {
};
#endif /* __KERNEL__ */
-struct sunos_ttysize {
- int st_lines; /* Lines on the terminal */
- int st_columns; /* Columns on the terminal */
-};
-
struct winsize {
unsigned short ws_row;
unsigned short ws_col;
diff --git a/include/asm-sparc64/thread_info.h b/include/asm-sparc64/thread_info.h
index 98252cd44dd6..71e42d1a80d9 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<<TIF_NEED_RESCHED)
#define _TIF_PERFCTR (1<<TIF_PERFCTR)
#define _TIF_UNALIGNED (1<<TIF_UNALIGNED)
-#define _TIF_NEWSIGNALS (1<<TIF_NEWSIGNALS)
#define _TIF_32BIT (1<<TIF_32BIT)
#define _TIF_SECCOMP (1<<TIF_SECCOMP)
#define _TIF_SYSCALL_AUDIT (1<<TIF_SYSCALL_AUDIT)
diff --git a/include/asm-sparc64/topology.h b/include/asm-sparc64/topology.h
index c6b557034f68..001c04027c82 100644
--- a/include/asm-sparc64/topology.h
+++ b/include/asm-sparc64/topology.h
@@ -1,6 +1,77 @@
#ifndef _ASM_SPARC64_TOPOLOGY_H
#define _ASM_SPARC64_TOPOLOGY_H
+#ifdef CONFIG_NUMA
+
+#include <asm/mmzone.h>
+
+static inline int cpu_to_node(int cpu)
+{
+ return numa_cpu_lookup_table[cpu];
+}
+
+#define parent_node(node) (node)
+
+static inline cpumask_t node_to_cpumask(int node)
+{
+ return numa_cpumask_lookup_table[node];
+}
+
+/* Returns a pointer to the cpumask of CPUs on Node 'node'. */
+#define node_to_cpumask_ptr(v, node) \
+ cpumask_t *v = &(numa_cpumask_lookup_table[node])
+
+#define node_to_cpumask_ptr_next(v, node) \
+ v = &(numa_cpumask_lookup_table[node])
+
+static inline int node_to_first_cpu(int node)
+{
+ cpumask_t tmp;
+ tmp = node_to_cpumask(node);
+ return first_cpu(tmp);
+}
+
+struct pci_bus;
+#ifdef CONFIG_PCI
+extern int pcibus_to_node(struct pci_bus *pbus);
+#else
+static inline int pcibus_to_node(struct pci_bus *pbus)
+{
+ return -1;
+}
+#endif
+
+#define pcibus_to_cpumask(bus) \
+ (pcibus_to_node(bus) == -1 ? \
+ CPU_MASK_ALL : \
+ node_to_cpumask(pcibus_to_node(bus)))
+
+#define SD_NODE_INIT (struct sched_domain) { \
+ .min_interval = 8, \
+ .max_interval = 32, \
+ .busy_factor = 32, \
+ .imbalance_pct = 125, \
+ .cache_nice_tries = 2, \
+ .busy_idx = 3, \
+ .idle_idx = 2, \
+ .newidle_idx = 0, \
+ .wake_idx = 1, \
+ .forkexec_idx = 1, \
+ .flags = SD_LOAD_BALANCE \
+ | SD_BALANCE_FORK \
+ | SD_BALANCE_EXEC \
+ | SD_SERIALIZE \
+ | SD_WAKE_BALANCE, \
+ .last_balance = jiffies, \
+ .balance_interval = 1, \
+}
+
+#else /* CONFIG_NUMA */
+
+#include <asm-generic/topology.h>
+
+#endif /* !(CONFIG_NUMA) */
+
#ifdef CONFIG_SMP
#define topology_physical_package_id(cpu) (cpu_data(cpu).proc_id)
#define topology_core_id(cpu) (cpu_data(cpu).core_id)
@@ -10,8 +81,6 @@
#define smt_capable() (sparc64_multi_core)
#endif /* CONFIG_SMP */
-#include <asm-generic/topology.h>
-
#define cpu_coregroup_map(cpu) (cpu_core_map[cpu])
#endif /* _ASM_SPARC64_TOPOLOGY_H */
diff --git a/include/asm-sparc64/ttable.h b/include/asm-sparc64/ttable.h
index bbb9c8f13d61..1b55538b944f 100644
--- a/include/asm-sparc64/ttable.h
+++ b/include/asm-sparc64/ttable.h
@@ -28,7 +28,7 @@
call routine; \
add %sp, PTREGS_OFF, %o0; \
ba,pt %xcc, rtrap; \
- clr %l6; \
+ nop; \
nop;
#define TRAP_7INSNS(routine) \
@@ -38,7 +38,7 @@
call routine; \
add %sp, PTREGS_OFF, %o0; \
ba,pt %xcc, rtrap; \
- clr %l6;
+ nop;
#define TRAP_SAVEFPU(routine) \
sethi %hi(109f), %g7; \
@@ -47,7 +47,7 @@
call routine; \
add %sp, PTREGS_OFF, %o0; \
ba,pt %xcc, rtrap; \
- clr %l6; \
+ nop; \
nop;
#define TRAP_NOSAVE(routine) \
@@ -67,7 +67,7 @@
call routine; \
add %sp, PTREGS_OFF, %o0; \
ba,pt %xcc, rtrap; \
- clr %l6; \
+ nop; \
nop;
#define TRAP_ARG(routine, arg) \
@@ -78,7 +78,7 @@
call routine; \
mov arg, %o1; \
ba,pt %xcc, rtrap; \
- clr %l6;
+ nop;
#define TRAPTL1_ARG(routine, arg) \
sethi %hi(109f), %g7; \
@@ -88,7 +88,7 @@
call routine; \
mov arg, %o1; \
ba,pt %xcc, rtrap; \
- clr %l6;
+ nop;
#define SYSCALL_TRAP(routine, systbl) \
sethi %hi(109f), %g7; \
@@ -99,14 +99,6 @@
or %l7, %lo(systbl), %l7; \
nop; nop;
-#define INDIRECT_SOLARIS_SYSCALL(num) \
- sethi %hi(109f), %g7; \
- ba,pt %xcc, etrap; \
-109: or %g7, %lo(109b), %g7; \
- ba,pt %xcc, tl0_solaris + 0xc; \
- mov num, %g1; \
- nop;nop;nop;
-
#define TRAP_UTRAP(handler,lvl) \
mov handler, %g3; \
ba,pt %xcc, utrap_trap; \
@@ -117,11 +109,6 @@
nop; \
nop;
-#ifdef CONFIG_SUNOS_EMUL
-#define SUNOS_SYSCALL_TRAP SYSCALL_TRAP(linux_sparc_syscall32, sunos_sys_table)
-#else
-#define SUNOS_SYSCALL_TRAP TRAP(sunos_syscall)
-#endif
#ifdef CONFIG_COMPAT
#define LINUX_32BIT_SYSCALL_TRAP SYSCALL_TRAP(linux_sparc_syscall32, sys_call_table32)
#else
@@ -130,11 +117,6 @@
#define LINUX_64BIT_SYSCALL_TRAP SYSCALL_TRAP(linux_sparc_syscall, sys_call_table64)
#define GETCC_TRAP TRAP(getcc)
#define SETCC_TRAP TRAP(setcc)
-#ifdef CONFIG_SOLARIS_EMUL
-#define SOLARIS_SYSCALL_TRAP TRAP(solaris_sparc_syscall)
-#else
-#define SOLARIS_SYSCALL_TRAP TRAP(solaris_syscall)
-#endif
#define BREAKPOINT_TRAP TRAP(breakpoint_trap)
#ifdef CONFIG_TRACE_IRQFLAGS
@@ -184,7 +166,7 @@
ldx [%sp + PTREGS_OFF + PT_V9_TNPC], %l1; \
add %l1, 4, %l2; \
stx %l1, [%sp + PTREGS_OFF + PT_V9_TPC]; \
- ba,pt %xcc, rtrap_clr_l6; \
+ ba,pt %xcc, rtrap; \
stx %l2, [%sp + PTREGS_OFF + PT_V9_TNPC];
#ifdef CONFIG_KPROBES
@@ -193,6 +175,12 @@
#define KPROBES_TRAP(lvl) TRAP_ARG(bad_trap, lvl)
#endif
+#ifdef CONFIG_KGDB
+#define KGDB_TRAP(lvl) TRAP_IRQ(kgdb_trap, lvl)
+#else
+#define KGDB_TRAP(lvl) TRAP_ARG(bad_trap, lvl)
+#endif
+
#define SUN4V_ITSB_MISS \
ldxa [%g0] ASI_SCRATCHPAD, %g2; \
ldx [%g2 + HV_FAULT_I_ADDR_OFFSET], %g4; \
diff --git a/include/asm-sparc64/types.h b/include/asm-sparc64/types.h
index d0ee7f105838..5dbe04f4044a 100644
--- a/include/asm-sparc64/types.h
+++ b/include/asm-sparc64/types.h
@@ -9,28 +9,12 @@
* not a major issue. However, for interoperability, libraries still
* need to be careful to avoid a name clashes.
*/
+#include <asm-generic/int-l64.h>
#ifndef __ASSEMBLY__
typedef unsigned short umode_t;
-/*
- * _xx is ok: it doesn't pollute the POSIX namespace. Use these in the
- * header files exported to user space.
- */
-
-typedef __signed__ char __s8;
-typedef unsigned char __u8;
-
-typedef __signed__ short __s16;
-typedef unsigned short __u16;
-
-typedef __signed__ int __s32;
-typedef unsigned int __u32;
-
-typedef __signed__ long __s64;
-typedef unsigned long __u64;
-
#endif /* __ASSEMBLY__ */
#ifdef __KERNEL__
@@ -39,18 +23,6 @@ typedef unsigned long __u64;
#ifndef __ASSEMBLY__
-typedef __signed__ char s8;
-typedef unsigned char u8;
-
-typedef __signed__ short s16;
-typedef unsigned short u16;
-
-typedef __signed__ int s32;
-typedef unsigned int u32;
-
-typedef __signed__ long s64;
-typedef unsigned long u64;
-
/* Dma addresses come in generic and 64-bit flavours. */
typedef u32 dma_addr_t;
diff --git a/include/asm-sparc64/unaligned.h b/include/asm-sparc64/unaligned.h
index 1ed3ba537772..edcebb09441e 100644
--- a/include/asm-sparc64/unaligned.h
+++ b/include/asm-sparc64/unaligned.h
@@ -1,6 +1,10 @@
-#ifndef _ASM_SPARC64_UNALIGNED_H_
-#define _ASM_SPARC64_UNALIGNED_H_
+#ifndef _ASM_SPARC64_UNALIGNED_H
+#define _ASM_SPARC64_UNALIGNED_H
-#include <asm-generic/unaligned.h>
+#include <linux/unaligned/be_struct.h>
+#include <linux/unaligned/le_byteshift.h>
+#include <linux/unaligned/generic.h>
+#define get_unaligned __get_unaligned_be
+#define put_unaligned __put_unaligned_be
#endif /* _ASM_SPARC64_UNALIGNED_H */
diff --git a/include/asm-sparc64/unistd.h b/include/asm-sparc64/unistd.h
index 77559da0ea3f..13be4453a1f0 100644
--- a/include/asm-sparc64/unistd.h
+++ b/include/asm-sparc64/unistd.h
@@ -338,16 +338,6 @@
#define NR_SYSCALLS 317
#ifdef __KERNEL__
-/* sysconf options, for SunOS compatibility */
-#define _SC_ARG_MAX 1
-#define _SC_CHILD_MAX 2
-#define _SC_CLK_TCK 3
-#define _SC_NGROUPS_MAX 4
-#define _SC_OPEN_MAX 5
-#define _SC_JOB_CONTROL 6
-#define _SC_SAVED_IDS 7
-#define _SC_VERSION 8
-
#define __ARCH_WANT_IPC_PARSE_VERSION
#define __ARCH_WANT_OLD_READDIR
#define __ARCH_WANT_STAT64
diff --git a/include/asm-sparc64/user.h b/include/asm-sparc64/user.h
index 02b138943837..29fc6e906c29 100644
--- a/include/asm-sparc64/user.h
+++ b/include/asm-sparc64/user.h
@@ -1,60 +1 @@
-/* $Id: user.h,v 1.1 1996/12/26 14:22:44 davem Exp $
- * asm-sparc64/user.h: Core file definitions for the Sparc.
- *
- * Keep in sync with reg.h. Actually, we could get rid of this
- * one, since we won't a.out core dump that much anyways - miguel.
- * Copyright (C) 1995 (davem@caip.rutgers.edu)
- */
-#ifndef _SPARC64_USER_H
-#define _SPARC64_USER_H
-
-#include <linux/a.out.h>
-struct sunos_regs {
- unsigned int psr, pc, npc, y;
- unsigned int regs[15];
-};
-
-struct sunos_fpqueue {
- unsigned int *addr;
- unsigned int inst;
-};
-
-struct sunos_fp {
- union {
- unsigned int regs[32];
- double reg_dbls[16];
- } fregs;
- unsigned int fsr;
- unsigned int flags;
- unsigned int extra;
- unsigned int fpq_count;
- struct sunos_fpqueue fpq[16];
-};
-
-struct sunos_fpu {
- struct sunos_fp fpstatus;
-};
-
-/* The SunOS core file header layout. */
-struct user {
- unsigned int magic;
- unsigned int len;
- struct sunos_regs regs;
- struct exec uexec;
- int signal;
- size_t u_tsize; /* all of these in bytes! */
- size_t u_dsize;
- size_t u_ssize;
- char u_comm[17];
- struct sunos_fpu fpu;
- unsigned int sigcode; /* Special sigcontext subcode, if any */
-};
-
-#define NBPG PAGE_SIZE /* XXX 4096 maybe? */
-#define UPAGES 1
-#define HOST_TEXT_START_ADDR (u.start_code)
-#define HOST_DATA_START_ADDR (u.start_data)
-#define HOST_STACK_END_ADDR (u.start_stack + u.u_ssize * NBPG)
-#define SUNOS_CORE_MAGIC 0x080456
-
-#endif /* !(_SPARC64_USER_H) */
+#include <asm-sparc/user.h>