svn commit: r368354 - in head: lib/libc/powerpc lib/libc/powerpc64 lib/libc/powerpc64/sys lib/libthr/arch/i386/i386 lib/msun/i387 libexec/rtld-elf/aarch64 libexec/rtld-elf/powerpc libexec/rtld-elf/...
Conrad Meyer
cem at FreeBSD.org
Sat Dec 5 00:33:36 UTC 2020
Author: cem
Date: Sat Dec 5 00:33:28 2020
New Revision: 368354
URL: https://svnweb.freebsd.org/changeset/base/368354
Log:
Add CFI start/end proc directives to arm64, i386, and ppc
Follow-up to r353959 and r368070: do the same for other architectures.
arm32 already seems to use its own .fnstart/.fnend directives, which
appear to be ARM-specific variants of the same thing. Likewise, MIPS
uses .frame directives.
Reviewed by: arichardson
Differential Revision: https://reviews.freebsd.org/D27387
Modified:
head/lib/libc/powerpc/SYS.h
head/lib/libc/powerpc64/SYS.h
head/lib/libc/powerpc64/sys/cerror.S
head/lib/libthr/arch/i386/i386/_umtx_op_err.S
head/lib/msun/i387/e_logf.S
head/lib/msun/i387/e_remainderl.S
head/lib/msun/i387/e_sqrtl.S
head/lib/msun/i387/s_llrintl.S
head/lib/msun/i387/s_logbl.S
head/lib/msun/i387/s_lrintl.S
head/lib/msun/i387/s_remquol.S
head/lib/msun/i387/s_rintl.S
head/libexec/rtld-elf/aarch64/rtld_start.S
head/libexec/rtld-elf/powerpc/rtld_start.S
head/libexec/rtld-elf/powerpc64/rtld_start.S
head/stand/libsa/powerpc/_setjmp.S
head/stand/powerpc/kboot/host_syscall.S
head/stand/powerpc/uboot/start.S
head/sys/arm64/include/asm.h
head/sys/arm64/linux/linux_locore.asm
head/sys/arm64/linux/linux_support.s
head/sys/crypto/des/arch/i386/des_enc.S
head/sys/i386/bios/smapi_bios.S
head/sys/i386/include/asm.h
head/sys/powerpc/aim/locore.S
head/sys/powerpc/aim/locore64.S
head/sys/powerpc/aim/trap_subr64.S
head/sys/powerpc/booke/locore.S
head/sys/powerpc/booke/trap_subr.S
head/sys/powerpc/include/asm.h
head/sys/powerpc/mambo/mambocall.S
head/sys/powerpc/ofw/ofwcall32.S
head/sys/powerpc/ofw/ofwcall64.S
head/sys/powerpc/powernv/opalcall.S
head/sys/powerpc/powerpc/cpu_subr64.S
head/sys/powerpc/powerpc/setjmp.S
head/sys/powerpc/powerpc/support.S
head/sys/powerpc/powerpc/swtch32.S
head/sys/powerpc/powerpc/swtch64.S
head/sys/powerpc/ps3/ps3-hvcall.S
head/sys/powerpc/pseries/phyp-hvcall.S
Modified: head/lib/libc/powerpc/SYS.h
==============================================================================
--- head/lib/libc/powerpc/SYS.h Fri Dec 4 21:51:47 2020 (r368353)
+++ head/lib/libc/powerpc/SYS.h Sat Dec 5 00:33:28 2020 (r368354)
@@ -58,7 +58,8 @@ ENTRY(__sys_##name); \
WEAK_REFERENCE(__sys_##name, _##name); \
_SYSCALL(name); \
bnslr; \
- b CNAME(HIDENAME(cerror))
+ b CNAME(HIDENAME(cerror)); \
+END(__sys_##name)
#define RSYSCALL(name) \
.text; \
@@ -68,4 +69,5 @@ ENTRY(__sys_##name); \
WEAK_REFERENCE(__sys_##name, _##name); \
_SYSCALL(name); \
bnslr; \
- b CNAME(HIDENAME(cerror))
+ b CNAME(HIDENAME(cerror)); \
+END(__sys_##name)
Modified: head/lib/libc/powerpc64/SYS.h
==============================================================================
--- head/lib/libc/powerpc64/SYS.h Fri Dec 4 21:51:47 2020 (r368353)
+++ head/lib/libc/powerpc64/SYS.h Sat Dec 5 00:33:28 2020 (r368354)
@@ -74,7 +74,8 @@ ENTRY(__sys_##name); \
addi %r1,%r1,48; \
ld %r0,16(%r1); \
mtlr %r0; \
- blr;
+ blr; \
+END(__sys_##name)
#define RSYSCALL(name) \
.text; \
@@ -93,4 +94,5 @@ ENTRY(__sys_##name); \
addi %r1,%r1,48; \
ld %r0,16(%r1); \
mtlr %r0; \
- blr;
+ blr; \
+END(__sys_##name)
Modified: head/lib/libc/powerpc64/sys/cerror.S
==============================================================================
--- head/lib/libc/powerpc64/sys/cerror.S Fri Dec 4 21:51:47 2020 (r368353)
+++ head/lib/libc/powerpc64/sys/cerror.S Sat Dec 5 00:33:28 2020 (r368354)
@@ -56,5 +56,6 @@ ENTRY_NOPROF(HIDENAME(cerror))
li %r3,-1
li %r4,-1
blr
+END(HIDENAME(cerror))
.section .note.GNU-stack,"",%progbits
Modified: head/lib/libthr/arch/i386/i386/_umtx_op_err.S
==============================================================================
--- head/lib/libthr/arch/i386/i386/_umtx_op_err.S Fri Dec 4 21:51:47 2020 (r368353)
+++ head/lib/libthr/arch/i386/i386/_umtx_op_err.S Sat Dec 5 00:33:28 2020 (r368354)
@@ -31,7 +31,10 @@
#define SYSCALL_ERR(x) \
ENTRY(__CONCAT(x, _err)); \
- mov __CONCAT($SYS_,x),%eax; int $0x80; ret
+ mov __CONCAT($SYS_,x),%eax; \
+ int $0x80; \
+ ret; \
+ END(__CONCAT(x, _err))
SYSCALL_ERR(_umtx_op)
Modified: head/lib/msun/i387/e_logf.S
==============================================================================
--- head/lib/msun/i387/e_logf.S Fri Dec 4 21:51:47 2020 (r368353)
+++ head/lib/msun/i387/e_logf.S Sat Dec 5 00:33:28 2020 (r368354)
@@ -13,5 +13,6 @@ ENTRY(logf)
flds 4(%esp)
fyl2x
ret
+END(logf)
.section .note.GNU-stack,"",%progbits
Modified: head/lib/msun/i387/e_remainderl.S
==============================================================================
--- head/lib/msun/i387/e_remainderl.S Fri Dec 4 21:51:47 2020 (r368353)
+++ head/lib/msun/i387/e_remainderl.S Sat Dec 5 00:33:28 2020 (r368354)
@@ -46,5 +46,6 @@ ENTRY(remainderl)
jp 1b
fstp %st(1)
ret
+END(remainderl)
.section .note.GNU-stack,"",%progbits
Modified: head/lib/msun/i387/e_sqrtl.S
==============================================================================
--- head/lib/msun/i387/e_sqrtl.S Fri Dec 4 21:51:47 2020 (r368353)
+++ head/lib/msun/i387/e_sqrtl.S Sat Dec 5 00:33:28 2020 (r368354)
@@ -40,5 +40,6 @@ ENTRY(sqrtl)
fldt 4(%esp)
fsqrt
ret
+END(sqrtl)
.section .note.GNU-stack,"",%progbits
Modified: head/lib/msun/i387/s_llrintl.S
==============================================================================
--- head/lib/msun/i387/s_llrintl.S Fri Dec 4 21:51:47 2020 (r368353)
+++ head/lib/msun/i387/s_llrintl.S Sat Dec 5 00:33:28 2020 (r368354)
@@ -34,5 +34,6 @@ ENTRY(llrintl)
popl %eax
popl %edx
ret
+END(llrintl)
.section .note.GNU-stack,"",%progbits
Modified: head/lib/msun/i387/s_logbl.S
==============================================================================
--- head/lib/msun/i387/s_logbl.S Fri Dec 4 21:51:47 2020 (r368353)
+++ head/lib/msun/i387/s_logbl.S Sat Dec 5 00:33:28 2020 (r368354)
@@ -41,5 +41,6 @@ ENTRY(logbl)
fxtract
fstp %st
ret
+END(logbl)
.section .note.GNU-stack,"",%progbits
Modified: head/lib/msun/i387/s_lrintl.S
==============================================================================
--- head/lib/msun/i387/s_lrintl.S Fri Dec 4 21:51:47 2020 (r368353)
+++ head/lib/msun/i387/s_lrintl.S Sat Dec 5 00:33:28 2020 (r368354)
@@ -33,5 +33,6 @@ ENTRY(lrintl)
fistpl (%esp)
popl %eax
ret
+END(lrintl)
.section .note.GNU-stack,"",%progbits
Modified: head/lib/msun/i387/s_remquol.S
==============================================================================
--- head/lib/msun/i387/s_remquol.S Fri Dec 4 21:51:47 2020 (r368353)
+++ head/lib/msun/i387/s_remquol.S Sat Dec 5 00:33:28 2020 (r368354)
@@ -61,5 +61,6 @@ ENTRY(remquol)
movl 28(%esp),%ecx
movl %eax,(%ecx)
ret
+END(remquol)
.section .note.GNU-stack,"",%progbits
Modified: head/lib/msun/i387/s_rintl.S
==============================================================================
--- head/lib/msun/i387/s_rintl.S Fri Dec 4 21:51:47 2020 (r368353)
+++ head/lib/msun/i387/s_rintl.S Sat Dec 5 00:33:28 2020 (r368354)
@@ -40,5 +40,6 @@ ENTRY(rintl)
fldt 4(%esp)
frndint
ret
+END(rintl)
.section .note.GNU-stack,"",%progbits
Modified: head/libexec/rtld-elf/aarch64/rtld_start.S
==============================================================================
--- head/libexec/rtld-elf/aarch64/rtld_start.S Fri Dec 4 21:51:47 2020 (r368353)
+++ head/libexec/rtld-elf/aarch64/rtld_start.S Sat Dec 5 00:33:28 2020 (r368354)
@@ -55,7 +55,6 @@ END(.rtld_start)
* x17 = &_rtld_bind_start
*/
ENTRY(_rtld_bind_start)
- .cfi_startproc
mov x17, sp
/* Save frame pointer and SP */
@@ -114,7 +113,6 @@ ENTRY(_rtld_bind_start)
/* Call into the correct function */
br x16
- .cfi_endproc
END(_rtld_bind_start)
/*
@@ -128,10 +126,8 @@ END(_rtld_bind_start)
* Resolver function for TLS symbols resolved at load time
*/
ENTRY(_rtld_tlsdesc_static)
- .cfi_startproc
ldr x0, [x0, #8]
ret
- .cfi_endproc
END(_rtld_tlsdesc_static)
/*
@@ -140,7 +136,6 @@ END(_rtld_tlsdesc_static)
* Resolver function for weak and undefined TLS symbols
*/
ENTRY(_rtld_tlsdesc_undef)
- .cfi_startproc
str x1, [sp, #-16]!
.cfi_adjust_cfa_offset 16
@@ -150,7 +145,6 @@ ENTRY(_rtld_tlsdesc_undef)
ldr x1, [sp], #16
.cfi_adjust_cfa_offset -16
- .cfi_endproc
ret
END(_rtld_tlsdesc_undef)
@@ -160,8 +154,6 @@ END(_rtld_tlsdesc_undef)
* Resolver function for TLS symbols from dlopen()
*/
ENTRY(_rtld_tlsdesc_dynamic)
- .cfi_startproc
-
/* Save registers used in fast path */
stp x1, x2, [sp, #(-2 * 16)]!
stp x3, x4, [sp, #(1 * 16)]
@@ -257,6 +249,5 @@ ENTRY(_rtld_tlsdesc_dynamic)
ldp x3, x4, [sp, #16]
ldp x1, x2, [sp], #(2 * 16)
.cfi_adjust_cfa_offset -2 * 16
- .cfi_endproc
ret
END(_rtld_tlsdesc_dynamic)
Modified: head/libexec/rtld-elf/powerpc/rtld_start.S
==============================================================================
--- head/libexec/rtld-elf/powerpc/rtld_start.S Fri Dec 4 21:51:47 2020 (r368353)
+++ head/libexec/rtld-elf/powerpc/rtld_start.S Sat Dec 5 00:33:28 2020 (r368354)
@@ -101,6 +101,7 @@ _ENTRY(.rtld_start)
li %r0,1 /* _exit() */
sc
+_END(.rtld_start)
#ifdef __SPE__
/* stack space for 30 GPRs + SPEFSCR/ACC/lr/cr */
@@ -142,6 +143,7 @@ _ENTRY(_rtld_bind_secureplt_start)
ori %r11,%r11,0x15555556 at l
mulhwu %r11,%r11,%r0 # get high half of multiplication
b 1f
+_END(_rtld_bind_secureplt_start)
/*
* _rtld_bind_start()
@@ -264,6 +266,7 @@ _ENTRY(_rtld_bind_start)
addi %r1,%r1,STACK_SIZE # restore stack
bctr # jump to target
+_END(_rtld_bind_start)
/*
@@ -284,6 +287,7 @@ _ENTRY(_rtld_powerpc_pltlongresolve)
subf %r11,%r12,%r11 # reloff
li %r12,2
srw %r11,%r11,%r12 # index = reloff/sizeof(Elf_Addr)
+_END(_rtld_powerpc_pltlongresolve)
_ENTRY(_rtld_powerpc_pltresolve)
lis %r12,0 # lis 12,_rtld_bind_start at ha
addi %r12,%r12,0 # addi 12,12,_rtld_bind_start at l
@@ -291,6 +295,7 @@ _ENTRY(_rtld_powerpc_pltresolve)
lis %r12,0 # lis 12,obj at ha
addi %r12,%r12,0 # addi 12,12,obj at l
bctr
+_END(_rtld_powerpc_pltresolve)
/*
* _rtld_powerpc_pltcall()
@@ -311,5 +316,6 @@ _ENTRY(_rtld_powerpc_pltcall)
lwz %r11,0(%r11) # lwz 11,jmptab at l(11)
mtctr %r11
bctr # (*jmptab[index])()
+_END(_rtld_powerpc_pltcall)
.section .note.GNU-stack,"",%progbits
Modified: head/libexec/rtld-elf/powerpc64/rtld_start.S
==============================================================================
--- head/libexec/rtld-elf/powerpc64/rtld_start.S Fri Dec 4 21:51:47 2020 (r368353)
+++ head/libexec/rtld-elf/powerpc64/rtld_start.S Sat Dec 5 00:33:28 2020 (r368354)
@@ -113,6 +113,7 @@ _ENTRY(_rtld_start)
li %r0,1 /* _exit() */
sc
+_END(_rtld_start)
/*
* _rtld_bind_start()
@@ -175,5 +176,6 @@ _ENTRY(_rtld_bind_start)
mtlr %r0
bctr # jump to target
+_END(_rtld_bind_start)
.section .note.GNU-stack,"",%progbits
Modified: head/stand/libsa/powerpc/_setjmp.S
==============================================================================
--- head/stand/libsa/powerpc/_setjmp.S Fri Dec 4 21:51:47 2020 (r368353)
+++ head/stand/libsa/powerpc/_setjmp.S Sat Dec 5 00:33:28 2020 (r368354)
@@ -76,6 +76,7 @@ ASENTRY_NOPROF(_setjmp)
/* f14-f31, fpscr */
li 3, 0
blr
+ASEND(_setjmp)
.extern sigsetmask
@@ -113,3 +114,4 @@ ASENTRY_NOPROF(_longjmp)
/* f14-f31, fpscr */
mr 3, 4
blr
+ASEND(_longjmp)
Modified: head/stand/powerpc/kboot/host_syscall.S
==============================================================================
--- head/stand/powerpc/kboot/host_syscall.S Fri Dec 4 21:51:47 2020 (r368353)
+++ head/stand/powerpc/kboot/host_syscall.S Sat Dec 5 00:33:28 2020 (r368354)
@@ -13,11 +13,13 @@ ENTRY(host_read)
1:
li %r3, 0
blr
+END(host_read)
ENTRY(host_write)
li %r0, 4 # SYS_write
sc
blr
+END(host_write)
ENTRY(host_seek)
mr %r4,%r5
@@ -26,11 +28,13 @@ ENTRY(host_seek)
li %r0, 140 # SYS_llseek
sc
blr
+END(host_seek)
ENTRY(host_llseek)
li %r0, 140 # SYS_llseek
sc
blr
+END(host_llseek)
ENTRY(host_open)
li %r0, 5 # SYS_open
@@ -40,45 +44,54 @@ ENTRY(host_open)
1:
li %r3, 0
blr
+END(host_open)
ENTRY(host_close)
li %r0, 6 # SYS_close
sc
blr
+END(host_close)
ENTRY(host_mmap)
li %r0, 90 # SYS_mmap
sc
blr
+END(host_mmap)
ENTRY(host_uname)
li %r0, 122 # SYS_uname
sc
blr
+END(host_uname)
ENTRY(host_gettimeofday)
li %r0, 78 # SYS_gettimeofday
sc
blr
+END(host_gettimeofday)
ENTRY(host_select)
li %r0, 142 # SYS_select
sc
blr
+END(host_select)
ENTRY(kexec_load)
lis %r6,21 # KEXEC_ARCH_PPC64
li %r0,268 # __NR_kexec_load
sc
blr
+END(kexec_load)
ENTRY(host_reboot)
li %r0,88 # SYS_reboot
sc
blr
+END(host_reboot)
ENTRY(host_getdents)
li %r0,141 # SYS_getdents
sc
blr
+END(host_getdents)
Modified: head/stand/powerpc/uboot/start.S
==============================================================================
--- head/stand/powerpc/uboot/start.S Fri Dec 4 21:51:47 2020 (r368353)
+++ head/stand/powerpc/uboot/start.S Sat Dec 5 00:33:28 2020 (r368354)
@@ -85,6 +85,7 @@ ENTRY(syscall)
lwz %r30, 12(%r1)
mr %r1, %r11
blr
+END(syscall)
/*
* Data section
Modified: head/sys/arm64/include/asm.h
==============================================================================
--- head/sys/arm64/include/asm.h Fri Dec 4 21:51:47 2020 (r368353)
+++ head/sys/arm64/include/asm.h Sat Dec 5 00:33:28 2020 (r368354)
@@ -39,10 +39,11 @@
#define _C_LABEL(x) x
#define ENTRY(sym) \
- .text; .globl sym; .align 2; .type sym,#function; sym:
+ .text; .globl sym; .align 2; .type sym,#function; sym: \
+ .cfi_startproc
#define EENTRY(sym) \
.globl sym; sym:
-#define END(sym) .size sym, . - sym
+#define END(sym) .cfi_endproc; .size sym, . - sym
#define EEND(sym)
#define WEAK_REFERENCE(sym, alias) \
Modified: head/sys/arm64/linux/linux_locore.asm
==============================================================================
--- head/sys/arm64/linux/linux_locore.asm Fri Dec 4 21:51:47 2020 (r368353)
+++ head/sys/arm64/linux/linux_locore.asm Sat Dec 5 00:33:28 2020 (r368354)
@@ -47,17 +47,21 @@ linux_platform:
ENTRY(__kernel_rt_sigreturn)
brk #0 /* LINUXTODO: implement __kernel_rt_sigreturn */
ret
+END(__kernel_rt_sigreturn)
ENTRY(__kernel_gettimeofday)
ldr x8, =LINUX_SYS_gettimeofday
svc #0
ret
+END(__kernel_gettimeofday)
ENTRY(__kernel_clock_gettime)
ldr x8, =LINUX_SYS_linux_clock_gettime
svc #0
ret
+END(__kernel_clock_gettime)
ENTRY(__kernel_clock_getres)
brk #0 /* LINUXTODO: implement __kernel_clock_getres */
ret
+END(__kernel_clock_getres)
Modified: head/sys/arm64/linux/linux_support.s
==============================================================================
--- head/sys/arm64/linux/linux_support.s Fri Dec 4 21:51:47 2020 (r368353)
+++ head/sys/arm64/linux/linux_support.s Sat Dec 5 00:33:28 2020 (r368354)
@@ -39,19 +39,24 @@
ENTRY(futex_xchgl)
brk #0
ret
+END(futex_xchgl)
ENTRY(futex_addl)
brk #0
ret
+END(futex_addl)
ENTRY(futex_orl)
brk #0
ret
+END(futex_orl)
ENTRY(futex_andl)
brk #0
ret
+END(futex_andl)
ENTRY(futex_xorl)
brk #0
ret
+END(futex_xorl)
Modified: head/sys/crypto/des/arch/i386/des_enc.S
==============================================================================
--- head/sys/crypto/des/arch/i386/des_enc.S Fri Dec 4 21:51:47 2020 (r368353)
+++ head/sys/crypto/des/arch/i386/des_enc.S Sat Dec 5 00:33:28 2020 (r368354)
@@ -1354,8 +1354,7 @@ ENTRY(des_encrypt1)
popl %edi
popl %esi
ret
-.L_des_encrypt1_end:
- .size _C_LABEL(des_encrypt1),.L_des_encrypt1_end-_C_LABEL(des_encrypt1)
+END(des_encrypt1)
ENTRY(des_encrypt2)
pushl %esi
@@ -2573,8 +2572,7 @@ ENTRY(des_encrypt2)
popl %edi
popl %esi
ret
-.L_des_encrypt2_end:
- .size _C_LABEL(des_encrypt2),.L_des_encrypt2_end-_C_LABEL(des_encrypt2)
+END(des_encrypt2)
ENTRY(des_encrypt3)
pushl %ebx
@@ -2692,8 +2690,7 @@ ENTRY(des_encrypt3)
popl %ebp
popl %ebx
ret
-.L_des_encrypt3_end:
- .size _C_LABEL(des_encrypt3),.L_des_encrypt3_end-_C_LABEL(des_encrypt3)
+END(des_encrypt3)
ENTRY(des_decrypt3)
pushl %ebx
@@ -2811,5 +2808,4 @@ ENTRY(des_decrypt3)
popl %ebp
popl %ebx
ret
-.L_des_decrypt3_end:
- .size _C_LABEL(des_decrypt3),.L_des_decrypt3_end-_C_LABEL(des_decrypt3)
+END(des_decrypt3)
Modified: head/sys/i386/bios/smapi_bios.S
==============================================================================
--- head/sys/i386/bios/smapi_bios.S Fri Dec 4 21:51:47 2020 (r368353)
+++ head/sys/i386/bios/smapi_bios.S Sat Dec 5 00:33:28 2020 (r368354)
@@ -38,3 +38,4 @@ ENTRY(smapi32)
leave
ret
+END(smapi32)
Modified: head/sys/i386/include/asm.h
==============================================================================
--- head/sys/i386/include/asm.h Fri Dec 4 21:51:47 2020 (r368353)
+++ head/sys/i386/include/asm.h Sat Dec 5 00:33:28 2020 (r368354)
@@ -73,19 +73,30 @@
#define _START_ENTRY .text; .p2align 2,0x90
#define _ENTRY(x) _START_ENTRY; \
- .globl CNAME(x); .type CNAME(x), at function; CNAME(x):
-#define END(x) .size x, . - x
+ .globl CNAME(x); .type CNAME(x), at function; CNAME(x): \
+ .cfi_startproc
+#define END(x) .cfi_endproc; .size x, . - x
#ifdef PROF
#define ALTENTRY(x) _ENTRY(x); \
- pushl %ebp; movl %esp,%ebp; \
+ pushl %ebp; \
+ .cfi_def_cfa_offset 8; \
+ .cfi_offset %ebp, -8; \
+ movl %esp,%ebp; \
call PIC_PLT(HIDENAME(mcount)); \
popl %ebp; \
+ .cfi_restore %ebp; \
+ .cfi_def_cfa_offset 4; \
jmp 9f
#define ENTRY(x) _ENTRY(x); \
- pushl %ebp; movl %esp,%ebp; \
+ pushl %ebp; \
+ .cfi_def_cfa_offset 8; \
+ .cfi_offset %ebp, -8; \
+ movl %esp,%ebp; \
call PIC_PLT(HIDENAME(mcount)); \
popl %ebp; \
+ .cfi_restore %ebp; \
+ .cfi_def_cfa_offset 4; \
9:
#else
#define ALTENTRY(x) _ENTRY(x)
Modified: head/sys/powerpc/aim/locore.S
==============================================================================
--- head/sys/powerpc/aim/locore.S Fri Dec 4 21:51:47 2020 (r368353)
+++ head/sys/powerpc/aim/locore.S Sat Dec 5 00:33:28 2020 (r368354)
@@ -13,3 +13,4 @@
ENTRY(get_spr)
mfspr %r3, 0
blr
+END(get_spr)
Modified: head/sys/powerpc/aim/locore64.S
==============================================================================
--- head/sys/powerpc/aim/locore64.S Fri Dec 4 21:51:47 2020 (r368353)
+++ head/sys/powerpc/aim/locore64.S Sat Dec 5 00:33:28 2020 (r368354)
@@ -203,6 +203,7 @@ _NAKED_ENTRY(__start)
/* Unreachable */
b .
+_END(__start)
ASENTRY_NOPROF(__restartkernel_virtual)
/*
@@ -254,6 +255,7 @@ ASENTRY_NOPROF(__restartkernel_virtual)
addi %r14, %r14, 1
cmpdi %r14, 16
blt 1b
+ASEND(__restartkernel_virtual)
ASENTRY_NOPROF(__restartkernel)
/*
@@ -270,5 +272,6 @@ ASENTRY_NOPROF(__restartkernel)
rfid
2: bl __start
nop
+ASEND(__restartkernel)
#include <powerpc/aim/trap_subr64.S>
Modified: head/sys/powerpc/aim/trap_subr64.S
==============================================================================
--- head/sys/powerpc/aim/trap_subr64.S Fri Dec 4 21:51:47 2020 (r368353)
+++ head/sys/powerpc/aim/trap_subr64.S Sat Dec 5 00:33:28 2020 (r368354)
@@ -957,6 +957,7 @@ dbtrap:
dbleave:
FRAME_LEAVE(PC_DBSAVE)
rfid
+ASEND(breakpoint)
/*
* In case of KDB we want a separate trap catcher for it
Modified: head/sys/powerpc/booke/locore.S
==============================================================================
--- head/sys/powerpc/booke/locore.S Fri Dec 4 21:51:47 2020 (r368353)
+++ head/sys/powerpc/booke/locore.S Sat Dec 5 00:33:28 2020 (r368354)
@@ -834,6 +834,7 @@ ENTRY(dcache_inval)
andi. %r3, %r3, L1CSR0_DCFI
bne 1b
blr
+END(dcache_inval)
ENTRY(dcache_disable)
/* Disable d-cache */
@@ -846,6 +847,7 @@ ENTRY(dcache_disable)
mtspr SPR_L1CSR0, %r3
isync
blr
+END(dcache_disable)
ENTRY(dcache_enable)
/* Enable d-cache */
@@ -857,6 +859,7 @@ ENTRY(dcache_enable)
mtspr SPR_L1CSR0, %r3
isync
blr
+END(dcache_enable)
ENTRY(icache_inval)
/* Invalidate i-cache */
@@ -869,6 +872,7 @@ ENTRY(icache_inval)
andi. %r3, %r3, L1CSR1_ICFI
bne 1b
blr
+END(icache_inval)
ENTRY(icache_disable)
/* Disable i-cache */
@@ -880,6 +884,7 @@ ENTRY(icache_disable)
mtspr SPR_L1CSR1, %r3
isync
blr
+END(icache_disable)
ENTRY(icache_enable)
/* Enable i-cache */
@@ -890,6 +895,7 @@ ENTRY(icache_enable)
mtspr SPR_L1CSR1, %r3
isync
blr
+END(icache_enable)
/*
* L2 cache disable/enable/inval sequences for E500mc.
@@ -906,6 +912,7 @@ ENTRY(l2cache_inval)
andis. %r3, %r3, L2CSR0_L2FI at h
bne 1b
blr
+END(l2cache_inval)
ENTRY(l2cache_enable)
mfspr %r3, SPR_L2CSR0
@@ -914,6 +921,7 @@ ENTRY(l2cache_enable)
mtspr SPR_L2CSR0, %r3
isync
blr
+END(l2cache_enable)
/*
* Branch predictor setup.
@@ -929,6 +937,7 @@ ENTRY(bpred_enable)
mtspr SPR_BUCSR, %r3
isync
blr
+END(bpred_enable)
/*
* XXX: This should be moved to a shared AIM/booke asm file, if one ever is
@@ -938,6 +947,7 @@ ENTRY(get_spr)
/* Note: The spr number is patched at runtime */
mfspr %r3, 0
blr
+END(get_spr)
/************************************************************************/
/* Data section */
Modified: head/sys/powerpc/booke/trap_subr.S
==============================================================================
--- head/sys/powerpc/booke/trap_subr.S Fri Dec 4 21:51:47 2020 (r368353)
+++ head/sys/powerpc/booke/trap_subr.S Sat Dec 5 00:33:28 2020 (r368354)
@@ -1097,6 +1097,7 @@ dbtrap:
dbleave:
FRAME_LEAVE(SPR_SRR0, SPR_SRR1)
rfi
+ASEND(breakpoint)
#endif /* KDB */
#ifdef SMP
@@ -1111,6 +1112,7 @@ ENTRY(tlb_lock)
isync
msync
blr
+END(tlb_lock)
ENTRY(tlb_unlock)
isync
@@ -1120,6 +1122,7 @@ ENTRY(tlb_unlock)
isync
msync
blr
+END(tlb_unlock)
/*
* TLB miss spin locks. For each CPU we have a reservation granule (32 bytes);
Modified: head/sys/powerpc/include/asm.h
==============================================================================
--- head/sys/powerpc/include/asm.h Fri Dec 4 21:51:47 2020 (r368353)
+++ head/sys/powerpc/include/asm.h Sat Dec 5 00:33:28 2020 (r368354)
@@ -108,12 +108,13 @@
.globl name; \
.section ".opd","aw"; \
.p2align 3; \
- name: \
+name: \
.quad DOT_LABEL(name),.TOC. at tocbase,0; \
.previous; \
.p2align 4; \
TYPE_ENTRY(name) \
-DOT_LABEL(name):
+DOT_LABEL(name): \
+ .cfi_startproc
#define _NAKED_ENTRY(name) _ENTRY(name)
#else
#define _ENTRY(name) \
@@ -122,6 +123,7 @@ DOT_LABEL(name):
.globl name; \
.type name, at function; \
name: \
+ .cfi_startproc; \
addis %r2, %r12, (.TOC.-name)@ha; \
addi %r2, %r2, (.TOC.-name)@l; \
.localentry name, .-name;
@@ -133,10 +135,12 @@ name: \
.globl name; \
.type name, at function; \
name: \
+ .cfi_startproc; \
.localentry name, .-name;
#endif
#define _END(name) \
+ .cfi_endproc; \
.long 0; \
.byte 0,0,0,0,0,0,0,0; \
END_SIZE(name)
@@ -153,8 +157,11 @@ name: \
.p2align 4; \
.globl name; \
.type name, at function; \
- name:
-#define _END(name)
+name: \
+ .cfi_startproc
+#define _END(name) \
+ .cfi_endproc; \
+ .size name, . - name
#define _NAKED_ENTRY(name) _ENTRY(name)
@@ -186,6 +193,7 @@ name: \
# define _PROF_PROLOGUE
#endif
+#define ASEND(y) _END(ASMNAME(y))
#define ASENTRY(y) _ENTRY(ASMNAME(y)); _PROF_PROLOGUE
#define END(y) _END(CNAME(y))
#define ENTRY(y) _ENTRY(CNAME(y)); _PROF_PROLOGUE
Modified: head/sys/powerpc/mambo/mambocall.S
==============================================================================
--- head/sys/powerpc/mambo/mambocall.S Fri Dec 4 21:51:47 2020 (r368353)
+++ head/sys/powerpc/mambo/mambocall.S Sat Dec 5 00:33:28 2020 (r368354)
@@ -36,4 +36,4 @@ ASENTRY(mambocall)
*/
.long 0x000EAEB0
blr
-
+ASEND(mambocall)
Modified: head/sys/powerpc/ofw/ofwcall32.S
==============================================================================
--- head/sys/powerpc/ofw/ofwcall32.S Fri Dec 4 21:51:47 2020 (r368353)
+++ head/sys/powerpc/ofw/ofwcall32.S Sat Dec 5 00:33:28 2020 (r368354)
@@ -120,6 +120,7 @@ ASENTRY(ofwcall)
lwz %r0,4(%r1)
mtlr %r0
blr
+ASEND(ofwcall)
/*
* RTAS Entry Point. Similar to the OF one, but simpler (no separate stack)
@@ -174,4 +175,4 @@ ASENTRY(rtascall)
lwz %r0,4(%r1)
mtlr %r0
blr
-
+ASEND(rtascall)
Modified: head/sys/powerpc/ofw/ofwcall64.S
==============================================================================
--- head/sys/powerpc/ofw/ofwcall64.S Fri Dec 4 21:51:47 2020 (r368353)
+++ head/sys/powerpc/ofw/ofwcall64.S Sat Dec 5 00:33:28 2020 (r368354)
@@ -216,6 +216,7 @@ ASENTRY_NOPROF(ofwcall)
ld %r0,16(%r1)
mtlr %r0
blr
+ASEND(ofwcall)
/*
* RTAS 32-bit Entry Point. Similar to the OF one, but simpler (no separate
@@ -380,4 +381,4 @@ ASENTRY_NOPROF(rtascall)
ld %r0,16(%r1)
mtlr %r0
blr
-
+ASEND(rtascall)
Modified: head/sys/powerpc/powernv/opalcall.S
==============================================================================
--- head/sys/powerpc/powernv/opalcall.S Fri Dec 4 21:51:47 2020 (r368353)
+++ head/sys/powerpc/powernv/opalcall.S Sat Dec 5 00:33:28 2020 (r368354)
@@ -129,4 +129,4 @@ ASENTRY(opal_call)
/* And return */
blr
-
+ASEND(opal_call)
Modified: head/sys/powerpc/powerpc/cpu_subr64.S
==============================================================================
--- head/sys/powerpc/powerpc/cpu_subr64.S Fri Dec 4 21:51:47 2020 (r368353)
+++ head/sys/powerpc/powerpc/cpu_subr64.S Sat Dec 5 00:33:28 2020 (r368354)
@@ -96,3 +96,4 @@ power_save_sequence:
bne 2b
nap
b .
+END(enter_idle_powerx)
Modified: head/sys/powerpc/powerpc/setjmp.S
==============================================================================
--- head/sys/powerpc/powerpc/setjmp.S Fri Dec 4 21:51:47 2020 (r368353)
+++ head/sys/powerpc/powerpc/setjmp.S Sat Dec 5 00:33:28 2020 (r368354)
@@ -75,6 +75,7 @@ ASENTRY_NOPROF(setjmp)
/* f14-f31, fpscr */
li 3, 0
blr
+ASEND(setjmp)
.extern sigsetmask
@@ -112,3 +113,4 @@ ASENTRY_NOPROF(longjmp)
/* f14-f31, fpscr */
mr 3, 4
blr
+ASEND(longjmp)
Modified: head/sys/powerpc/powerpc/support.S
==============================================================================
--- head/sys/powerpc/powerpc/support.S Fri Dec 4 21:51:47 2020 (r368353)
+++ head/sys/powerpc/powerpc/support.S Sat Dec 5 00:33:28 2020 (r368354)
@@ -73,9 +73,11 @@
#endif
#ifdef AIM
-#define ENTRY_DIRECT(x) ENTRY(x ## _direct)
+#define ENTRY_DIRECT(x) ENTRY(x ## _direct)
+#define END_DIRECT(x) END(x ## _direct)
#else
#define ENTRY_DIRECT(x) ENTRY(x)
+#define END_DIRECT(x) END(x)
#endif
#ifdef __powerpc64__
@@ -320,6 +322,7 @@ ENTRY(bcopy_generic)
/* done */
.Lend:
blr
+END(bcopy_generic)
/*
* copyout(from_kernel, to_user, len)
@@ -332,6 +335,7 @@ ENTRY_DIRECT(copyout)
nop
CLEAR_FAULT(%r7)
EPILOGUE
+END_DIRECT(copyout)
/*
* copyin(from_user, to_kernel, len)
@@ -344,6 +348,8 @@ ENTRY_DIRECT(copyin)
nop
CLEAR_FAULT(%r7)
EPILOGUE
+END_DIRECT(copyin)
+
/*
* copyinstr(const void *udaddr, void *kaddr, size_t len, size_t *done)
* %r3 %r4 %r5 %r6
@@ -379,6 +385,7 @@ ENTRY_DIRECT(copyinstr)
3:
CLEAR_FAULT_NO_CLOBBER(%r7)
EPILOGUE
+END_DIRECT(copyinstr)
ENTRY_DIRECT(subyte)
PROLOGUE
@@ -386,6 +393,7 @@ ENTRY_DIRECT(subyte)
stb %r4, 0(%r3)
CLEAR_FAULT(%r7)
EPILOGUE
+END_DIRECT(subyte)
#ifndef __powerpc64__
ENTRY_DIRECT(suword)
@@ -394,6 +402,7 @@ ENTRY_DIRECT(suword)
stw %r4, 0(%r3)
CLEAR_FAULT(%r7)
EPILOGUE
+END_DIRECT(suword)
#endif
ENTRY_DIRECT(suword32)
@@ -402,6 +411,7 @@ ENTRY_DIRECT(suword32)
stw %r4, 0(%r3)
CLEAR_FAULT(%r7)
EPILOGUE
+END_DIRECT(suword32)
#ifdef __powerpc64__
ENTRY_DIRECT(suword64)
@@ -410,12 +420,15 @@ ENTRY_DIRECT(suword64)
std %r4, 0(%r3)
CLEAR_FAULT(%r7)
EPILOGUE
+END_DIRECT(suword64)
+
ENTRY_DIRECT(suword)
PROLOGUE
SET_FUSUFAULT(%r3, %r7)
std %r4, 0(%r3)
CLEAR_FAULT(%r7)
EPILOGUE
+END_DIRECT(suword)
#endif
ENTRY_DIRECT(fubyte)
@@ -424,6 +437,7 @@ ENTRY_DIRECT(fubyte)
lbz %r3, 0(%r3)
CLEAR_FAULT_NO_CLOBBER(%r7)
EPILOGUE
+END_DIRECT(fubyte)
ENTRY_DIRECT(fuword16)
PROLOGUE
@@ -431,6 +445,7 @@ ENTRY_DIRECT(fuword16)
lhz %r3, 0(%r3)
CLEAR_FAULT_NO_CLOBBER(%r7)
EPILOGUE
+END_DIRECT(fuword16)
#ifndef __powerpc64__
ENTRY_DIRECT(fueword)
@@ -440,6 +455,7 @@ ENTRY_DIRECT(fueword)
stw %r0, 0(%r4)
CLEAR_FAULT(%r7)
EPILOGUE
+END_DIRECT(fueword)
#endif
ENTRY_DIRECT(fueword32)
PROLOGUE
@@ -448,6 +464,7 @@ ENTRY_DIRECT(fueword32)
stw %r0, 0(%r4)
CLEAR_FAULT(%r7)
EPILOGUE
+END_DIRECT(fueword32)
#ifdef __powerpc64__
ENTRY_DIRECT(fueword)
@@ -457,6 +474,7 @@ ENTRY_DIRECT(fueword)
std %r0, 0(%r4)
CLEAR_FAULT(%r7)
EPILOGUE
+END_DIRECT(fueword)
ENTRY_DIRECT(fueword64)
PROLOGUE
@@ -465,6 +483,7 @@ ENTRY_DIRECT(fueword64)
std %r0, 0(%r4)
CLEAR_FAULT(%r7)
EPILOGUE
+END_DIRECT(fueword64)
#endif
/*
@@ -495,6 +514,7 @@ ENTRY_DIRECT(fueword64)
ENTRY_DIRECT(casueword32)
CASUEWORD32(%r3, %r7)
+END_DIRECT(casueword32)
#ifdef __powerpc64__
#define CASUEWORD64(raddr, rpcb) ;\
@@ -520,20 +540,25 @@ ENTRY_DIRECT(casueword32)
ENTRY_DIRECT(casueword)
CASUEWORD64(%r3, %r7)
+END_DIRECT(casueword)
ENTRY_DIRECT(casueword64)
CASUEWORD64(%r3, %r7)
+END_DIRECT(casueword64)
#else
ENTRY_DIRECT(casueword)
CASUEWORD32(%r3, %r7)
+END_DIRECT(casueword)
#endif
_NAKED_ENTRY(fusufault)
CLEAR_FAULT_NO_CLOBBER(%r7)
li %r3, -1
EPILOGUE
+_END(fusufault)
_NAKED_ENTRY(copy_fault)
CLEAR_FAULT_NO_CLOBBER(%r7)
li %r3, EFAULT
EPILOGUE
+_END(copy_fault)
Modified: head/sys/powerpc/powerpc/swtch32.S
==============================================================================
--- head/sys/powerpc/powerpc/swtch32.S Fri Dec 4 21:51:47 2020 (r368353)
+++ head/sys/powerpc/powerpc/swtch32.S Sat Dec 5 00:33:28 2020 (r368354)
@@ -74,6 +74,7 @@ ENTRY(cpu_throw)
li %r14,0 /* Tell cpu_switchin not to release a thread */
b cpu_switchin
+END(cpu_throw)
/*
* void cpu_switch(struct thread *old,
@@ -193,6 +194,7 @@ blocked_loop:
*/
stwcx. %r1, 0, %r3
blr
+END(cpu_switch)
/*
* savectx(pcb)
@@ -206,6 +208,7 @@ ENTRY(savectx)
mflr %r4 /* Save the link register */
stw %r4,PCB_LR(%r3)
blr
+END(savectx)
/*
* fork_trampoline()
@@ -225,3 +228,4 @@ ENTRY(fork_trampoline)
mtspr SPR_SPEFSCR, %r3
#endif
*** DIFF OUTPUT TRUNCATED AT 1000 LINES ***
More information about the svn-src-head
mailing list