Remove some old architecture handling.
authorSascha Wildner <saw@online.de>
Sat, 19 Nov 2016 09:34:53 +0000 (10:34 +0100)
committerSascha Wildner <saw@online.de>
Sat, 19 Nov 2016 09:42:16 +0000 (10:42 +0100)
Affected #ifdefs:

__arm__
hp300
__ia64__
__mips__
__powerpc__
__sparc64__

lib/libc/gmon/gmon.c
libexec/rtld-elf/rtld.c
sys/boot/common/load_elf.c
sys/bus/u4b/usb_dragonfly.h
sys/dev/disk/isp/isp_pci.c
sys/dev/disk/sbp/sbp.c
sys/dev/disk/sym/sym_hipd.c
sys/dev/raid/amr/amrio.h
sys/dev/sound/pci/t4dwave.c
sys/sys/link_elf.h
usr.sbin/pppd/main.c

index 47b9215..4a7293c 100644 (file)
@@ -46,7 +46,7 @@
 
 #include "libc_private.h"
 
-#if defined(__i386__) || defined(__sparc64__) || defined(__x86_64__) || defined(__powerpc__)
+#if defined(__i386__) || defined(__x86_64__)
 extern char *minbrk __asm (".minbrk");
 #else
 extern char *minbrk __asm ("minbrk");
@@ -105,22 +105,9 @@ monstartup(u_long lowpc, u_long highpc)
        p->tos[0].link = 0;
 
        o = p->highpc - p->lowpc;
-       if (p->kcountsize < o) {
-#ifndef hp300
+       if (p->kcountsize < o)
                s_scale = ((float)p->kcountsize / o ) * SCALE_1_TO_1;
-#else /* avoid floating point */
-               int quot = o / p->kcountsize;
-
-               if (quot >= 0x10000)
-                       s_scale = 1;
-               else if (quot >= 0x100)
-                       s_scale = 0x10000 / quot;
-               else if (o >= 0x800000)
-                       s_scale = 0x1000000 / (o / (p->kcountsize >> 8));
-               else
-                       s_scale = 0x1000000 / ((o << 8) / p->kcountsize);
-#endif
-       } else
+       else
                s_scale = SCALE_1_TO_1;
 
        moncontrol(1);
index a8fe623..a892f3e 100644 (file)
@@ -3593,10 +3593,6 @@ linkmap_add(Obj_Entry *obj)
     obj->linkmap.l_name = obj->path;
     obj->linkmap.l_addr = obj->mapbase;
     obj->linkmap.l_ld = obj->dynamic;
-#ifdef __mips__
-    /* GDB needs load offset on MIPS to use the symbols */
-    obj->linkmap.l_offs = obj->relocbase;
-#endif
 
     if (r_debug.r_map == NULL) {
        r_debug.r_map = l;
index 829daf8..89bb54c 100644 (file)
@@ -300,15 +300,6 @@ __elfN(loadimage)(struct preloaded_file *fp, elf_file_t ef, u_int64_t off)
 #else
        off = - (off & 0xff000000u);    /* i386 relocates after locore */
 #endif
-#elif defined(__arm__)
-       if (off & 0xf0000000u) {
-           off = -(off & 0xf0000000u);
-           ehdr->e_entry += off;
-#ifdef ELF_VERBOSE
-           printf("Converted entry 0x%08x\n", ehdr->e_entry);
-#endif
-       } else
-           off = 0;
 #else
        off = 0;                /* other archs use direct mapped kernels */
 #endif
index b955f76..65084fa 100644 (file)
 #if (!defined(USB_HOST_ALIGN)) || (USB_HOST_ALIGN <= 0)
 /* Use default value. */
 #undef USB_HOST_ALIGN
-#if defined(__arm__) || defined(__mips__) || defined(__powerpc__)
-#define USB_HOST_ALIGN 32              /* Arm and MIPS need at least this much, if not more */
-#else
 #define        USB_HOST_ALIGN    8             /* bytes, must be power of two */
 #endif
-#endif
 /* Sanity check for USB_HOST_ALIGN: Verify power of two. */
 #if ((-USB_HOST_ALIGN) & USB_HOST_ALIGN) != USB_HOST_ALIGN
 #error "USB_HOST_ALIGN is not power of two."
index 576e2d7..7795bb2 100644 (file)
@@ -530,11 +530,7 @@ isp_get_specific_options(device_t dev, int chan, ispsoftc_t *isp)
                if (IS_FC(isp)) {
                        ISP_FC_PC(isp, chan)->default_id = 109 - chan;
                } else {
-#ifdef __sparc64__
-                       ISP_SPI_PC(isp, chan)->iid = OF_getscsinitid(dev);
-#else
                        ISP_SPI_PC(isp, chan)->iid = 7;
-#endif
                }
        } else {
                if (IS_FC(isp)) {
index 9220f39..c0394ee 100644 (file)
@@ -136,11 +136,8 @@ TUNABLE_INT("hw.firewire.sbp.tags", &sbp_tags);
 #define NEED_RESPONSE 0
 
 #define SBP_SEG_MAX rounddown(0xffff, PAGE_SIZE)
-#ifdef __sparc64__ /* iommu */
-#define SBP_IND_MAX howmany(SBP_MAXPHYS, SBP_SEG_MAX)
-#else
 #define SBP_IND_MAX howmany(SBP_MAXPHYS, PAGE_SIZE)
-#endif
+
 struct sbp_ocb {
        STAILQ_ENTRY(sbp_ocb)   ocb;
        union ccb       *ccb;
index dc05033..d36a562 100644 (file)
 #include <bus/pci/pcireg.h>
 #include <bus/pci/pcivar.h>
 
-#ifdef __sparc64__
-#include <dev/ofw/openfirm.h>
-#include <machine/ofw_machdep.h>
-#endif
-
 #include <sys/rman.h>
 
 #include <bus/cam/cam.h>
@@ -127,12 +122,6 @@ typedef    u_int32_t u32;
 
 #if    defined __x86_64__
 #define MEMORY_BARRIER()       do { ; } while(0)
-#elif  defined __powerpc__
-#define MEMORY_BARRIER()       __asm__ volatile("eieio; sync" : : : "memory")
-#elif  defined __ia64__
-#define MEMORY_BARRIER()       __asm__ volatile("mf.a; mf" : : : "memory")
-#elif  defined __sparc64__
-#define MEMORY_BARRIER()       __asm__ volatile("membar #Sync" : : : "memory")
 #else
 #error "Not supported platform"
 #endif
@@ -2678,9 +2667,6 @@ static int sym_prepare_setting(hcb_p np, struct sym_nvram *nvram)
         */
        np->myaddr = 255;
        sym_nvram_setup_host (np, nvram);
-#ifdef __sparc64__
-       np->myaddr = OF_getscsinitid(np->device);
-#endif
 
        /*
         *  Get SCSI addr of host adapter (set by bios?).
index 2a00ea2..df338b3 100644 (file)
@@ -108,7 +108,7 @@ struct amr_user_ioctl {
 
 #define AMR_IO_COMMAND _IOWR('A', 0x201, struct amr_user_ioctl)
 
-#if defined(__x86_64__) || defined(__ia64__)
+#if defined(__x86_64__)
 
 struct amr_user_ioctl32 {
     unsigned char      au_cmd[32];     /* command text from userspace */
index d4a3276..30b1214 100644 (file)
@@ -832,11 +832,6 @@ tr_pci_attach(device_t dev)
        bus_addr_t      lowaddr;
        int             i, dacn;
        char            status[SND_STATUSLEN];
-#ifdef __sparc64__
-       device_t        *children;
-       int             nchildren;
-       u_int32_t       data;
-#endif
 
        tr = kmalloc(sizeof(*tr), M_DEVBUF, M_WAITOK | M_ZERO);
        tr->type = pci_get_devid(dev);
@@ -903,34 +898,9 @@ tr_pci_attach(device_t dev)
                 * using a low address of BUS_SPACE_MAXADDR_32BIT for both
                 * we might end up with the play buffer being in the 32-bit
                 * range while the record buffer isn't or vice versa. So we
-                * limit enabling the 31st bit to sparc64, where the IOMMU
-                * guarantees that we're using a 32-bit address (and in turn
-                * requires it).
+                * do not enable the 31st bit.
                 */
                lowaddr = ALI_MAXADDR;
-#ifdef __sparc64__
-               if (device_get_children(device_get_parent(dev), &children,
-                   &nchildren) == 0) {
-                       for (i = 0; i < nchildren; i++) {
-                               if (pci_get_devid(children[i]) == 0x153310b9) {
-                                       lowaddr = BUS_SPACE_MAXADDR_32BIT;
-                                       data = pci_read_config(children[i],
-                                           0x7e, 1);
-                                       if (bootverbose)
-                                               device_printf(dev,
-                                                   "M1533 0x7e: 0x%x -> ",
-                                                   data);
-                                       data |= 0x1;
-                                       if (bootverbose)
-                                               kprintf("0x%x\n", data);
-                                       pci_write_config(children[i], 0x7e,
-                                           data, 1);
-                                       break;
-                               }
-                       }
-               }
-               kfree(children, M_TEMP);
-#endif
                tr->hwchns = ALI_MAXHWCH;
                tr->bufsz = ALI_BUFSZ;
        } else {
index 86a1425..d8c7c44 100644 (file)
@@ -56,9 +56,6 @@
 
 typedef struct link_map {
        caddr_t         l_addr;                 /* Base Address of library */
-#ifdef __mips__
-       caddr_t         l_offs;                 /* Load Offset of library */
-#endif
        const char      *l_name;                /* Absolute Path to Library */
        const void      *l_ld;                  /* Pointer to .dynamic in memory */
        struct link_map *l_next, *l_prev;       /* linked list of of mapped libs */
index fe32290..2446bcc 100644 (file)
@@ -1490,12 +1490,7 @@ vfmtmsg(char *buf, int buflen, char *fmt, va_list args)
            break;
        case 'r':
            f = va_arg(args, char *);
-#if !defined(__powerpc__) && !defined(__x86_64__)
-           n = vfmtmsg(buf, buflen + 1, f, va_arg(args, va_list));
-#else
-           /* On the powerpc, a va_list is an array of 1 structure */
            n = vfmtmsg(buf, buflen + 1, f, va_arg(args, void *));
-#endif
            buf += n;
            buflen -= n;
            continue;