Skip to content

Commit

Permalink
DBG
Browse files Browse the repository at this point in the history
  • Loading branch information
badochov committed Sep 6, 2024
1 parent de1b790 commit 0bf6d7d
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 17 deletions.
25 changes: 25 additions & 0 deletions arch/arm/v7a/reboot.c
Original file line number Diff line number Diff line change
Expand Up @@ -52,3 +52,28 @@ int reboot_reason(uint32_t *val)
*val = pctl.reboot.reason;
return 0;
}


#include <arch.h>

#ifdef __IEEE754_SQRT
double __ieee754_sqrt(double x)
{
/* clang-format off */
__asm__ volatile ("vsqrt.f64 %P0, %P1" : "=w"(x) : "w"(x));
/* clang-format on */

return x;
}
#endif

#ifdef __IEEE754_SQRTF
float __ieee754_sqrtf(float x)
{
/* clang-format off */
__asm__ volatile ("vsqrt.f32 %0, %1" : "=t"(x) : "t"(x));
/* clang-format on */

return x;
}
#endif
18 changes: 4 additions & 14 deletions include/arch/armv7a/arch.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,31 +35,21 @@
#if __ARM_FP & 8
#define __IEEE754_SQRT

static inline double __ieee754_sqrt(double x)
{
/* clang-format off */
__asm__ volatile ("vsqrt.f64 %P0, %P1" : "=w"(x) : "w"(x));
/* clang-format on */
double __ieee754_sqrt(double x);

return x;
}
#endif

#define __IEEE754_SQRTF

static inline float __ieee754_sqrtf(float x)
{
/* clang-format off */
__asm__ volatile ("vsqrt.f32 %0, %1" : "=t"(x) : "t"(x));
/* clang-format on */
float __ieee754_sqrtf(float x);


return x;
}
#endif

#define _PAGE_SIZE 0x1000
#define SIZE_PAGE _Pragma("GCC warning \"'SIZE_PAGE' is deprecated. Use _PAGE_SIZE from arch.h or PAGE_SIZE from limits.h (POSIX only)\"") _PAGE_SIZE

#define __LIBPHOENIX_ARCH_TLS_SUPPORTED
#define __LIBPHOENIX_ARCH_HAVE__TLS_GET_ADDR

#endif
9 changes: 6 additions & 3 deletions rtld/stubs.c
Original file line number Diff line number Diff line change
Expand Up @@ -57,9 +57,10 @@ __attribute__((weak)) void __rtld_atfork(int pre) {
}


/* Stub __tls_get_addr implementations.
* They can be overriden on platforms requiring __tls_get_addr in PIC compiled platforms(eg. RISC-V, ARM).
* The override work due to linking order. */
/* Allow override on platforms requiring __tls_get_addr in PIC compiled libraries(eg. RISC-V, ARM). */
#ifndef __LIBPHOENIX_ARCH_HAVE__TLS_GET_ADDR

/* Stub __tls_get_addr implementations. */
__attribute__((weak)) void *__tls_get_addr(void *d)
{
abort();
Expand All @@ -70,3 +71,5 @@ __attribute__((weak)) void *___tls_get_addr(void *d)
{
abort();
}

#endif

0 comments on commit 0bf6d7d

Please sign in to comment.