From: Sascha Wildner Date: Sat, 19 Nov 2016 09:34:53 +0000 (+0100) Subject: Remove some old architecture handling. X-Git-Tag: v4.8.0rc~534 X-Git-Url: https://gitweb.dragonflybsd.org/dragonfly.git/commitdiff_plain/8e691ff8ab257ae18d645790a51ffa978b85d71f Remove some old architecture handling. Affected #ifdefs: __arm__ hp300 __ia64__ __mips__ __powerpc__ __sparc64__ --- diff --git a/lib/libc/gmon/gmon.c b/lib/libc/gmon/gmon.c index 47b92154de..4a7293cc39 100644 --- a/lib/libc/gmon/gmon.c +++ b/lib/libc/gmon/gmon.c @@ -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); diff --git a/libexec/rtld-elf/rtld.c b/libexec/rtld-elf/rtld.c index a8fe6233a9..a892f3e88a 100644 --- a/libexec/rtld-elf/rtld.c +++ b/libexec/rtld-elf/rtld.c @@ -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; diff --git a/sys/boot/common/load_elf.c b/sys/boot/common/load_elf.c index 829daf8896..89bb54c320 100644 --- a/sys/boot/common/load_elf.c +++ b/sys/boot/common/load_elf.c @@ -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 diff --git a/sys/bus/u4b/usb_dragonfly.h b/sys/bus/u4b/usb_dragonfly.h index b955f761c1..65084fad8e 100644 --- a/sys/bus/u4b/usb_dragonfly.h +++ b/sys/bus/u4b/usb_dragonfly.h @@ -60,12 +60,8 @@ #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." diff --git a/sys/dev/disk/isp/isp_pci.c b/sys/dev/disk/isp/isp_pci.c index 576e2d7a24..7795bb29fb 100644 --- a/sys/dev/disk/isp/isp_pci.c +++ b/sys/dev/disk/isp/isp_pci.c @@ -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)) { diff --git a/sys/dev/disk/sbp/sbp.c b/sys/dev/disk/sbp/sbp.c index 9220f39b10..c0394ee17c 100644 --- a/sys/dev/disk/sbp/sbp.c +++ b/sys/dev/disk/sbp/sbp.c @@ -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; diff --git a/sys/dev/disk/sym/sym_hipd.c b/sys/dev/disk/sym/sym_hipd.c index dc05033ee6..d36a562af8 100644 --- a/sys/dev/disk/sym/sym_hipd.c +++ b/sys/dev/disk/sym/sym_hipd.c @@ -84,11 +84,6 @@ #include #include -#ifdef __sparc64__ -#include -#include -#endif - #include #include @@ -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?). diff --git a/sys/dev/raid/amr/amrio.h b/sys/dev/raid/amr/amrio.h index 2a00ea2f48..df338b3b49 100644 --- a/sys/dev/raid/amr/amrio.h +++ b/sys/dev/raid/amr/amrio.h @@ -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 */ diff --git a/sys/dev/sound/pci/t4dwave.c b/sys/dev/sound/pci/t4dwave.c index d4a3276b74..30b1214cec 100644 --- a/sys/dev/sound/pci/t4dwave.c +++ b/sys/dev/sound/pci/t4dwave.c @@ -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 { diff --git a/sys/sys/link_elf.h b/sys/sys/link_elf.h index 86a1425617..d8c7c44db7 100644 --- a/sys/sys/link_elf.h +++ b/sys/sys/link_elf.h @@ -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 */ diff --git a/usr.sbin/pppd/main.c b/usr.sbin/pppd/main.c index fe322903f1..2446bcc66e 100644 --- a/usr.sbin/pppd/main.c +++ b/usr.sbin/pppd/main.c @@ -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;