newlib-cygwin/newlib/libc/machine/arm
Victor L. Do Nascimento 9d6b00511e newlib: libc: define M-profile PACBTI-enablement macros
Augment the arm_asm.h header file to simplify function prologues and
epilogues whilst adding support for PACBTI enablement via macros for
hand-written assembly functions.  For PACBTI, both prologues/epilogues
as well as cfi-related directives are automatically amended
accordingly, depending on the compile-time mbranch-protection argument
values.

It defines the following preprocessor macros:
   * HAVE_PAC_LEAF: Indicates whether pac-signing has been requested for
   leaf functions.
   * PAC_LEAF_PUSH_IP: Whether leaf functions should push the pac code
   to the stack irrespective of whether the ip register is clobbered in
   the function or not.
   * STACK_ALIGN_ENFORCE: Whether a dummy register should be added to
   the push list as necessary in the prologue to ensure stack
   alignment preservation at the start of assembly function.  The
   epilogue behavior is likewise affected by this flag, ensuring any
   pushed dummy registers also get popped on function return.

It also defines the following assembler macros:
   * prologue: In addition to pushing any callee-saved registers onto
   the stack, it generates any requested pacbti instructions.
   Pushed registers are specified via the optional `first', `last',
   `push_ip' and `push_lr' macro argument parameters.
   when a single register number is provided, it pushes that
   register.  When two register numbers are provided, they specify a
   rage to save.  If push_ip and/or push_lr are non-zero, the
   respective registers are also saved.  Stack alignment is requested
   via the `align` argument, which defaults to the value of
   STACK_ALIGN_ENFORCE, unless manually overridden.

   For example:

       prologue push_ip=1 -> push {ip}
       prologue push_ip=1, align8=1 -> push {r2, ip}
       prologue push_ip=1, push_lr=1 -> push {ip, lr}
       prologue 1 -> push {r1}
       prologue 1, align8=1 -> push {r0, r1}
       prologue 1 push_ip=1 -> push {r1, ip}
       prologue 1 4 -> push {r1-r4}
       prologue 1 4 push_ip=1 -> push {r1-r4, ip}

   * epilogue: pops registers off the stack and emits pac key signing
   instruction, if requested. The `first', `last', `push_ip',
   `push_lr' and `align' function as per the prologue macro,
   generating pop instead of push instructions.

   Stack alignment is enforced via the following helper macro
   call-chain:

	{prologue|epilogue} ->_align8 -> _preprocess_reglist ->
	  _preprocess_reglist1 -> {_prologue|_epilogue}

   Finally, the necessary cfi directives for adding debug information
   to prologue and epilogue are generated via the following macros:

   * cfisavelist - prologue macro helper function, generating
   necessary .cfi_offset directives associated with push instruction.
   Therefore, the net effect of calling `prologue 1 2 push_ip=1' is
   to generate the following:

       push {r1-r2, ip}
       .cfi_adjust_cfa_offset 12
       .cfi_offset 143, -4
       .cfi_offset 2, -8
       .cfi_offset 1, -12

   * cfirestorelist - epilogue macro helper function, emitting
   .cfi_restore instructions prior to resetting the cfa offset.  As
   such, calling `epilogue 1 2 push_ip=1' will produce:

        pop {r1-r2, ip}
	.cfi_register 143, 12
	.cfi_restore 2
	.cfi_restore 1
	.cfi_def_cfa_offset 0
2023-01-10 14:16:05 +00:00
..
machine arm: Fix fenv support 2020-07-29 06:58:17 +02:00
sys arm: Fix fenv support 2020-07-29 06:58:17 +02:00
Makefile.inc newlib: libc: merge build up a directory 2022-03-16 21:18:25 -04:00
acle-compat.h * libc/machine/arm/acle-compat.h: New file. 2014-03-27 13:26:39 +00:00
aeabi_memclr.c * libc/machine/arm/aeabi_memclr.c: New file to support 2015-02-17 09:26:54 +00:00
aeabi_memcpy-armv7a.S Remove unneeded references to arm_asm.h 2017-01-25 13:32:09 +01:00
aeabi_memcpy.c Add missing libc/machine/arm/aeabi_memcpy.c file 2014-09-05 08:42:45 +00:00
aeabi_memmove-arm.S Use .syntax unified instead of .syntax divided. 2017-03-30 17:18:12 +02:00
aeabi_memmove-soft.S Remove unneeded references to arm_asm.h 2017-01-25 13:32:09 +01:00
aeabi_memmove-thumb.S Optimize epilogue sequence for architectures with POP interworking. 2019-10-07 14:38:14 +01:00
aeabi_memmove-thumb2.S Update the assembler code to support old ARM architectures. 2015-06-01 12:49:37 +02:00
aeabi_memmove.c * libc/machine/arm/aeabi_memmove.c: New file to support 2015-02-17 09:06:51 +00:00
aeabi_memset-arm.S Use .syntax unified instead of .syntax divided. 2017-03-30 17:18:12 +02:00
aeabi_memset-soft.S Remove unneeded references to arm_asm.h 2017-01-25 13:32:09 +01:00
aeabi_memset-thumb.S Optimize epilogue sequence for architectures with POP interworking. 2019-10-07 14:38:14 +01:00
aeabi_memset-thumb2.S Update the assembler code to support old ARM architectures. 2015-06-01 12:49:37 +02:00
aeabi_memset.c * libc/machine/arm/aeabi_memclr.c: New file to support 2015-02-17 09:26:54 +00:00
arm_asm.h newlib: libc: define M-profile PACBTI-enablement macros 2023-01-10 14:16:05 +00:00
memchr-stub.c Optimise memchr for NEON-enabled processors 2017-04-06 18:19:20 +02:00
memchr.S arm: Fix memchr() for Armv8-R 2020-12-14 16:10:30 -05:00
memcpy-armv7a.S memcpy-armv7a.S: Improve performance with misaligned buffers. 2013-07-01 09:58:34 +00:00
memcpy-armv7m.S Big-endian fix for memcpy-armv7m.S 2016-12-12 11:23:45 +01:00
memcpy-stub.c Make macro checks ARMv8-M baseline proof 2016-01-28 11:26:37 +01:00
memcpy.S Make macro checks ARMv8-M baseline proof 2016-01-28 11:26:37 +01:00
setjmp.S libc: arm: setjmp.S code cleanup 2022-12-19 11:22:11 +00:00
strcmp-arm-tiny.S arm: Remove RETURN macro 2017-01-25 13:32:09 +01:00
strcmp-armv4.S arm: Remove RETURN macro 2017-01-25 13:32:09 +01:00
strcmp-armv4t.S Avoid .eh_frame in ARM newlib. 2015-11-12 12:09:24 +00:00
strcmp-armv6.S Avoid .eh_frame in ARM newlib. 2015-11-12 12:09:24 +00:00
strcmp-armv6m.S Avoid .eh_frame in ARM newlib. 2015-11-12 12:09:24 +00:00
strcmp-armv7.S Avoid .eh_frame in ARM newlib. 2015-11-12 12:09:24 +00:00
strcmp-armv7m.S arm: Remove RETURN macro 2017-01-25 13:32:09 +01:00
strcmp.S Remove unneeded references to arm_asm.h 2017-01-25 13:32:09 +01:00
strcpy.c [arm] Fix strcpy for unified syntax on ARMv4t thumb. 2017-07-21 11:23:27 +01:00
strlen-armv7.S Remove unneeded references to arm_asm.h 2017-01-25 13:32:09 +01:00
strlen-stub.c arm: Fix addressing in optpld macro 2017-01-26 16:29:36 +01:00
strlen-thumb1-Os.S [ARM] Factor out the thumb1 -Os implementation. 2015-11-13 11:54:28 +00:00
strlen-thumb2-Os.S [ARM] Factor out the thumb2 -Os implementation. 2015-11-23 15:21:47 +00:00
strlen.S Fix strlen using Thumb-2 with -Os -marm 2016-05-11 17:18:48 -04:00