summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjhibbits <jhibbits@FreeBSD.org>2017-04-01 19:27:06 +0000
committerjhibbits <jhibbits@FreeBSD.org>2017-04-01 19:27:06 +0000
commit0f139c1ee40c96df29a9a8531aeb56704117439e (patch)
treeb73199a18264d2aa63323464755fbd84d25d7c21
parent16386726ac0fa090573e9c120df08d1001eabbd8 (diff)
downloadFreeBSD-src-0f139c1ee40c96df29a9a8531aeb56704117439e.zip
FreeBSD-src-0f139c1ee40c96df29a9a8531aeb56704117439e.tar.gz
MFC r310146,r311912,r312369,r312617,r312614,r312659,r312974,r312977,r313005,r314826:
A series of Clang-related powerpc commits r310146: Use the right bitwise OR operation for clearing single-step at trap time. r311912: Force all TOC references in asm to include '@toc' r312369: Use the explicit expanded form of cmp. r312617: Hide the 'MOREARGS' macro, it conflicts with contrib code, and is only used in one file. r312614: Don't pass -Wa,-many through clang, the integrated as doesn't support it. r312659: Avoid using non-zero argument for __builtin_frame_address(). r312974: Add a INTR_TRIG_INVALID, and use it in the powerpc interrupt code. r312977: Force the setting of bit 7 in the sysmouse packet byte 1 to be unsigned. r313005: Update CFLAGS for clang compatibility r314826: Clang in base now supports -mlongcall, so remove this hack
-rw-r--r--lib/csu/powerpc64/Makefile10
-rw-r--r--sys/conf/Makefile.powerpc3
-rw-r--r--sys/conf/kern.mk4
-rw-r--r--sys/dev/adb/adb_mouse.c2
-rw-r--r--sys/modules/zfs/Makefile2
-rw-r--r--sys/powerpc/aim/trap_subr32.S2
-rw-r--r--sys/powerpc/include/asm.h5
-rw-r--r--sys/powerpc/include/frame.h2
-rw-r--r--sys/powerpc/powerpc/db_trace.c8
-rw-r--r--sys/powerpc/powerpc/intr_machdep.c6
-rw-r--r--sys/powerpc/powerpc/trap.c5
-rw-r--r--sys/sys/bus.h1
12 files changed, 23 insertions, 27 deletions
diff --git a/lib/csu/powerpc64/Makefile b/lib/csu/powerpc64/Makefile
index 104ab20..c560a2f 100644
--- a/lib/csu/powerpc64/Makefile
+++ b/lib/csu/powerpc64/Makefile
@@ -9,16 +9,6 @@ CFLAGS+= -I${.CURDIR:H}/common \
-I${SRCTOP}/lib/libc/include \
-mlongcall
-# XXX: See the log for r232932 as to why the above -mlongcall is needed. Since
-# clang doesn't support -mlongcall, and testing shows a clang linked with a
-# clang-built csu segfaults, this must currently be compiled with gcc. Once
-# clang supports -mlongcall, or we get a fixed ld, this can be revisited.
-.include <bsd.compiler.mk>
-.if ${COMPILER_TYPE} != "gcc"
-CC:= gcc
-COMPILER_TYPE:= gcc
-.endif
-
FILES= ${OBJS}
FILESMODE= ${LIBMODE}
FILESOWN= ${LIBOWN}
diff --git a/sys/conf/Makefile.powerpc b/sys/conf/Makefile.powerpc
index 769b068..0a1718b 100644
--- a/sys/conf/Makefile.powerpc
+++ b/sys/conf/Makefile.powerpc
@@ -35,7 +35,8 @@ LDSCRIPT_NAME?= ldscript.${MACHINE_ARCH}
INCLUDES+= -I$S/contrib/libfdt
-CFLAGS+= -msoft-float -Wa,-many
+CFLAGS+= -msoft-float
+CFLAGS.gcc+= -Wa,-many
# Build position-independent kernel
CFLAGS+= -fPIC
diff --git a/sys/conf/kern.mk b/sys/conf/kern.mk
index f561f8a..82e06eb 100644
--- a/sys/conf/kern.mk
+++ b/sys/conf/kern.mk
@@ -147,9 +147,7 @@ INLINE_LIMIT?= 8000
# Also explicitly disable Altivec instructions inside the kernel.
#
.if ${MACHINE_CPUARCH} == "powerpc"
-CFLAGS+= -mno-altivec
-CFLAGS.clang+= -mllvm -disable-ppc-float-in-variadic=true
-CFLAGS.gcc+= -msoft-float
+CFLAGS+= -mno-altivec -msoft-float
INLINE_LIMIT?= 15000
.endif
diff --git a/sys/dev/adb/adb_mouse.c b/sys/dev/adb/adb_mouse.c
index eb7cf33..9f9d81f 100644
--- a/sys/dev/adb/adb_mouse.c
+++ b/sys/dev/adb/adb_mouse.c
@@ -520,7 +520,7 @@ ams_read(struct cdev *dev, struct uio *uio, int flag)
}
}
- sc->packet[0] = 1 << 7;
+ sc->packet[0] = 1U << 7;
sc->packet[0] |= (!(sc->buttons & 1)) << 2;
sc->packet[0] |= (!(sc->buttons & 4)) << 1;
sc->packet[0] |= (!(sc->buttons & 2));
diff --git a/sys/modules/zfs/Makefile b/sys/modules/zfs/Makefile
index bb912e5..b02254d 100644
--- a/sys/modules/zfs/Makefile
+++ b/sys/modules/zfs/Makefile
@@ -93,7 +93,7 @@ CFLAGS+=-I${SUNW}/common
CFLAGS+=-DBUILDING_ZFS
.if ${MACHINE_ARCH} == "powerpc64"
-CFLAGS+=-mminimal-toc
+CFLAGS.gcc+=-mminimal-toc
.endif
.ifdef ZFS_DEBUG
diff --git a/sys/powerpc/aim/trap_subr32.S b/sys/powerpc/aim/trap_subr32.S
index 056c073..4f691e7 100644
--- a/sys/powerpc/aim/trap_subr32.S
+++ b/sys/powerpc/aim/trap_subr32.S
@@ -406,7 +406,7 @@ im0:
mtctr %r1 /* load counter */
im1:
lwzu %r1, 8(%r2) /* get next pte */
- cmp 0, %r1, %r3 /* see if found pte */
+ cmp 0, 0, %r1, %r3 /* see if found pte */
bdnzf 2, im1 /* dec count br if cmp ne and if
* count not zero */
bne instr_sec_hash /* if not found set up second hash
diff --git a/sys/powerpc/include/asm.h b/sys/powerpc/include/asm.h
index 3aec5d3..08aab98 100644
--- a/sys/powerpc/include/asm.h
+++ b/sys/powerpc/include/asm.h
@@ -89,10 +89,11 @@
name:
#ifdef __powerpc64__
-#define TOC_REF(name) __CONCAT(.L,name)
+#define TOC_NAME_FOR_REF(name) __CONCAT(.L,name)
+#define TOC_REF(name) TOC_NAME_FOR_REF(name)@toc
#define TOC_ENTRY(name) \
.section ".toc","aw"; \
- TOC_REF(name): \
+ TOC_NAME_FOR_REF(name): \
.tc name[TC],name
#endif
diff --git a/sys/powerpc/include/frame.h b/sys/powerpc/include/frame.h
index e6fb103..667b58c 100644
--- a/sys/powerpc/include/frame.h
+++ b/sys/powerpc/include/frame.h
@@ -109,7 +109,5 @@ struct callframe {
/* Definitions for syscalls */
#define FIRSTARG 3 /* first arg in reg 3 */
#define NARGREG 8 /* 8 args in regs */
-#define MOREARGS(sp) ((caddr_t)((uintptr_t)(sp) + \
- sizeof(struct callframe) - 3*sizeof(register_t))) /* more args go here */
#endif /* _MACHINE_FRAME_H_ */
diff --git a/sys/powerpc/powerpc/db_trace.c b/sys/powerpc/powerpc/db_trace.c
index 3576955..ceecacf 100644
--- a/sys/powerpc/powerpc/db_trace.c
+++ b/sys/powerpc/powerpc/db_trace.c
@@ -296,8 +296,12 @@ db_trace_self(void)
{
db_addr_t addr;
- addr = (db_addr_t)__builtin_frame_address(1);
- db_backtrace(curthread, addr, -1);
+ addr = (db_addr_t)__builtin_frame_address(0);
+ if (addr == 0) {
+ db_printf("Null frame address\n");
+ return;
+ }
+ db_backtrace(curthread, *(db_addr_t *)addr, -1);
}
int
diff --git a/sys/powerpc/powerpc/intr_machdep.c b/sys/powerpc/powerpc/intr_machdep.c
index 74dc4f5..743c8a6 100644
--- a/sys/powerpc/powerpc/intr_machdep.c
+++ b/sys/powerpc/powerpc/intr_machdep.c
@@ -451,7 +451,7 @@ powerpc_enable_intr(void)
if (error)
continue;
- if (i->trig == -1)
+ if (i->trig == INTR_TRIGGER_INVALID)
PIC_TRANSLATE_CODE(i->pic, i->intline, i->fwcode,
&i->trig, &i->pol);
if (i->trig != INTR_TRIGGER_CONFORM ||
@@ -497,7 +497,7 @@ powerpc_setup_intr(const char *name, u_int irq, driver_filter_t filter,
error = powerpc_map_irq(i);
if (!error) {
- if (i->trig == -1)
+ if (i->trig == INTR_TRIGGER_INVALID)
PIC_TRANSLATE_CODE(i->pic, i->intline,
i->fwcode, &i->trig, &i->pol);
@@ -545,7 +545,7 @@ powerpc_fw_config_intr(int irq, int sense_code)
if (i == NULL)
return (ENOMEM);
- i->trig = -1;
+ i->trig = INTR_TRIGGER_INVALID;
i->pol = INTR_POLARITY_CONFORM;
i->fwcode = sense_code;
diff --git a/sys/powerpc/powerpc/trap.c b/sys/powerpc/powerpc/trap.c
index d186051..4464dd8 100644
--- a/sys/powerpc/powerpc/trap.c
+++ b/sys/powerpc/powerpc/trap.c
@@ -80,6 +80,9 @@ __FBSDID("$FreeBSD$");
#define FAULTBUF_CR 22
#define FAULTBUF_R14 3
+#define MOREARGS(sp) ((caddr_t)((uintptr_t)(sp) + \
+ sizeof(struct callframe) - 3*sizeof(register_t))) /* more args go here */
+
static void trap_fatal(struct trapframe *frame);
static void printtrap(u_int vector, struct trapframe *frame, int isfatal,
int user);
@@ -280,7 +283,7 @@ trap(struct trapframe *frame)
case EXC_DEBUG: /* Single stepping */
mtspr(SPR_DBSR, mfspr(SPR_DBSR));
frame->srr1 &= ~PSL_DE;
- frame->cpu.booke.dbcr0 &= ~(DBCR0_IDM || DBCR0_IC);
+ frame->cpu.booke.dbcr0 &= ~(DBCR0_IDM | DBCR0_IC);
sig = SIGTRAP;
ucode = TRAP_TRACE;
break;
diff --git a/sys/sys/bus.h b/sys/sys/bus.h
index 9139eda..d2573cd 100644
--- a/sys/sys/bus.h
+++ b/sys/sys/bus.h
@@ -265,6 +265,7 @@ enum intr_type {
};
enum intr_trigger {
+ INTR_TRIGGER_INVALID = -1,
INTR_TRIGGER_CONFORM = 0,
INTR_TRIGGER_EDGE = 1,
INTR_TRIGGER_LEVEL = 2
OpenPOWER on IntegriCloud