svn commit: r316369 - in stable/11: lib/csu/powerpc64 sys/conf sys/dev/adb sys/modules/zfs sys/powerpc/aim sys/powerpc/include sys/powerpc/powerpc sys/sys
Justin Hibbits
jhibbits at FreeBSD.org
Sat Apr 1 19:27:08 UTC 2017
Author: jhibbits
Date: Sat Apr 1 19:27:06 2017
New Revision: 316369
URL: https://svnweb.freebsd.org/changeset/base/316369
Log:
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
Modified:
stable/11/lib/csu/powerpc64/Makefile
stable/11/sys/conf/Makefile.powerpc
stable/11/sys/conf/kern.mk
stable/11/sys/dev/adb/adb_mouse.c
stable/11/sys/modules/zfs/Makefile
stable/11/sys/powerpc/aim/trap_subr32.S
stable/11/sys/powerpc/include/asm.h
stable/11/sys/powerpc/include/frame.h
stable/11/sys/powerpc/powerpc/db_trace.c
stable/11/sys/powerpc/powerpc/intr_machdep.c
stable/11/sys/powerpc/powerpc/trap.c
stable/11/sys/sys/bus.h
Directory Properties:
stable/11/ (props changed)
Modified: stable/11/lib/csu/powerpc64/Makefile
==============================================================================
--- stable/11/lib/csu/powerpc64/Makefile Sat Apr 1 19:08:22 2017 (r316368)
+++ stable/11/lib/csu/powerpc64/Makefile Sat Apr 1 19:27:06 2017 (r316369)
@@ -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}
Modified: stable/11/sys/conf/Makefile.powerpc
==============================================================================
--- stable/11/sys/conf/Makefile.powerpc Sat Apr 1 19:08:22 2017 (r316368)
+++ stable/11/sys/conf/Makefile.powerpc Sat Apr 1 19:27:06 2017 (r316369)
@@ -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
Modified: stable/11/sys/conf/kern.mk
==============================================================================
--- stable/11/sys/conf/kern.mk Sat Apr 1 19:08:22 2017 (r316368)
+++ stable/11/sys/conf/kern.mk Sat Apr 1 19:27:06 2017 (r316369)
@@ -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
Modified: stable/11/sys/dev/adb/adb_mouse.c
==============================================================================
--- stable/11/sys/dev/adb/adb_mouse.c Sat Apr 1 19:08:22 2017 (r316368)
+++ stable/11/sys/dev/adb/adb_mouse.c Sat Apr 1 19:27:06 2017 (r316369)
@@ -520,7 +520,7 @@ ams_read(struct cdev *dev, struct uio *u
}
}
- 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));
Modified: stable/11/sys/modules/zfs/Makefile
==============================================================================
--- stable/11/sys/modules/zfs/Makefile Sat Apr 1 19:08:22 2017 (r316368)
+++ stable/11/sys/modules/zfs/Makefile Sat Apr 1 19:27:06 2017 (r316369)
@@ -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
Modified: stable/11/sys/powerpc/aim/trap_subr32.S
==============================================================================
--- stable/11/sys/powerpc/aim/trap_subr32.S Sat Apr 1 19:08:22 2017 (r316368)
+++ stable/11/sys/powerpc/aim/trap_subr32.S Sat Apr 1 19:27:06 2017 (r316369)
@@ -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
Modified: stable/11/sys/powerpc/include/asm.h
==============================================================================
--- stable/11/sys/powerpc/include/asm.h Sat Apr 1 19:08:22 2017 (r316368)
+++ stable/11/sys/powerpc/include/asm.h Sat Apr 1 19:27:06 2017 (r316369)
@@ -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
Modified: stable/11/sys/powerpc/include/frame.h
==============================================================================
--- stable/11/sys/powerpc/include/frame.h Sat Apr 1 19:08:22 2017 (r316368)
+++ stable/11/sys/powerpc/include/frame.h Sat Apr 1 19:27:06 2017 (r316369)
@@ -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_ */
Modified: stable/11/sys/powerpc/powerpc/db_trace.c
==============================================================================
--- stable/11/sys/powerpc/powerpc/db_trace.c Sat Apr 1 19:08:22 2017 (r316368)
+++ stable/11/sys/powerpc/powerpc/db_trace.c Sat Apr 1 19:27:06 2017 (r316369)
@@ -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
Modified: stable/11/sys/powerpc/powerpc/intr_machdep.c
==============================================================================
--- stable/11/sys/powerpc/powerpc/intr_machdep.c Sat Apr 1 19:08:22 2017 (r316368)
+++ stable/11/sys/powerpc/powerpc/intr_machdep.c Sat Apr 1 19:27:06 2017 (r316369)
@@ -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_i
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 sens
if (i == NULL)
return (ENOMEM);
- i->trig = -1;
+ i->trig = INTR_TRIGGER_INVALID;
i->pol = INTR_POLARITY_CONFORM;
i->fwcode = sense_code;
Modified: stable/11/sys/powerpc/powerpc/trap.c
==============================================================================
--- stable/11/sys/powerpc/powerpc/trap.c Sat Apr 1 19:08:22 2017 (r316368)
+++ stable/11/sys/powerpc/powerpc/trap.c Sat Apr 1 19:27:06 2017 (r316369)
@@ -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;
Modified: stable/11/sys/sys/bus.h
==============================================================================
--- stable/11/sys/sys/bus.h Sat Apr 1 19:08:22 2017 (r316368)
+++ stable/11/sys/sys/bus.h Sat Apr 1 19:27:06 2017 (r316369)
@@ -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
More information about the svn-src-all
mailing list