diff options
author | jhibbits <jhibbits@FreeBSD.org> | 2017-04-01 19:27:06 +0000 |
---|---|---|
committer | jhibbits <jhibbits@FreeBSD.org> | 2017-04-01 19:27:06 +0000 |
commit | 0f139c1ee40c96df29a9a8531aeb56704117439e (patch) | |
tree | b73199a18264d2aa63323464755fbd84d25d7c21 /sys/powerpc | |
parent | 16386726ac0fa090573e9c120df08d1001eabbd8 (diff) | |
download | FreeBSD-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
Diffstat (limited to 'sys/powerpc')
-rw-r--r-- | sys/powerpc/aim/trap_subr32.S | 2 | ||||
-rw-r--r-- | sys/powerpc/include/asm.h | 5 | ||||
-rw-r--r-- | sys/powerpc/include/frame.h | 2 | ||||
-rw-r--r-- | sys/powerpc/powerpc/db_trace.c | 8 | ||||
-rw-r--r-- | sys/powerpc/powerpc/intr_machdep.c | 6 | ||||
-rw-r--r-- | sys/powerpc/powerpc/trap.c | 5 |
6 files changed, 17 insertions, 11 deletions
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; |