-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
JIRA: RTOS-875
- Loading branch information
Showing
10 changed files
with
403 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
# | ||
# Makefile for libphoenix/arch/arm/v8r | ||
# | ||
# Copyright 2024 Phoenix Systems | ||
# | ||
# %LICENSE% | ||
# | ||
|
||
OBJS += $(addprefix $(PREFIX_O)arch/arm/v8r/, syscalls.o reboot.o) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
/* | ||
* Phoenix-RTOS | ||
* | ||
* libphoenix | ||
* | ||
* reboot.c | ||
* | ||
* Copyright 2024 Phoenix Systems | ||
* Author: Lukasz Leczkowski | ||
* | ||
* This file is part of Phoenix-RTOS. | ||
* | ||
* %LICENSE% | ||
*/ | ||
|
||
#include <sys/reboot.h> | ||
#include <sys/platform.h> | ||
#if defined(__CPU_MPS3AN536) | ||
#include <phoenix/arch/armv8r/mps3an536/mps3an536.h> | ||
#else | ||
#error "Unsupported TARGET" | ||
#endif | ||
|
||
|
||
int reboot(int magic) | ||
{ | ||
platformctl_t pctl = { | ||
.action = pctl_set, | ||
.type = pctl_reboot, | ||
.task.reboot.magic = magic | ||
}; | ||
|
||
return platformctl(&pctl); | ||
} | ||
|
||
|
||
int reboot_reason(uint32_t *val) | ||
{ | ||
*val = 0u; | ||
|
||
return 0; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
/* | ||
* Phoenix-RTOS | ||
* | ||
* libphoenix | ||
* | ||
* syscalls (armv8r) | ||
* | ||
* Copyright 2017, 2018, 2024 Phoenix Systems | ||
* Author; Pawel Pisarczyk, Aleksander Kaminski | ||
* | ||
* This file is part of Phoenix-RTOS. | ||
* | ||
* %LICENSE% | ||
*/ | ||
|
||
#define __ASSEMBLY__ | ||
#include <phoenix/syscalls.h> | ||
|
||
.text | ||
|
||
|
||
#define SYSCALLDEF(sym, sn) \ | ||
.globl sym; \ | ||
.type sym, %function; \ | ||
sym: \ | ||
.cfi_startproc; \ | ||
push {r0-r3}; \ | ||
.cfi_adjust_cfa_offset 16; \ | ||
.cfi_rel_offset r0, 0; \ | ||
.cfi_rel_offset r1, 4; \ | ||
.cfi_rel_offset r2, 8; \ | ||
.cfi_rel_offset r3, 12; \ | ||
svc $sn; \ | ||
add sp, #16; \ | ||
.cfi_adjust_cfa_offset -16; \ | ||
bx lr; \ | ||
.cfi_endproc; \ | ||
.size sym, .-sym | ||
|
||
|
||
.globl vfork; | ||
.type vfork, %function; | ||
vfork: | ||
b vforksvc | ||
.size vfork, .-vfork | ||
|
||
|
||
#define SYSCALLS_LIBC(name) \ | ||
SYSCALLDEF(name, __COUNTER__); | ||
|
||
|
||
SYSCALLS(SYSCALLS_LIBC) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
/* | ||
* Phoenix-RTOS | ||
* | ||
* libphoenix | ||
* | ||
* Architecture dependent part (arch/armv8r) | ||
* | ||
* Copyright 2017, 2024 Phoenix Systems | ||
* Author: Pawel Pisarczyk, Lukasz Leczkowski | ||
* | ||
* This file is part of Phoenix-RTOS. | ||
* | ||
* %LICENSE% | ||
*/ | ||
|
||
#ifndef _LIBPHOENIX_ARCH_ARMV8R_ARCH_H_ | ||
#define _LIBPHOENIX_ARCH_ARMV8R_ARCH_H_ | ||
|
||
#define __ARCH_STDINT <arch/armv8r/stdint.h> | ||
#define __ARCH_LIMITS <arch/armv8r/limits.h> | ||
|
||
#define __MEMCPY | ||
#define __MEMCMP | ||
#define __MEMSET | ||
#define __STRLEN | ||
#define __STRNLEN | ||
#define __STRCMP | ||
#define __STRNCMP | ||
#define __STRCPY | ||
#define __STRNCPY | ||
#define __MEMMOVE | ||
|
||
#if __ARM_PCS_VFP || (__VFP_FP__ && !__SOFTFP__) | ||
#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 */ | ||
|
||
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 */ | ||
|
||
return x; | ||
} | ||
#endif | ||
|
||
#define _PAGE_SIZE 0x200 | ||
#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 | ||
|
||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
/* | ||
* Phoenix-RTOS | ||
* | ||
* libphoenix | ||
* | ||
* Architecture dependent part of limits (arch/armv8r) | ||
* | ||
* Copyright 2017-2019, 2024 Phoenix Systems | ||
* Author: Pawel Pisarczyk, Aleksander Kaminski, Andrzej Glowinski, Marek Bialowas | ||
* | ||
* This file is part of Phoenix-RTOS. | ||
* | ||
* %LICENSE% | ||
*/ | ||
|
||
#ifndef _LIBPHOENIX_ARCH_ARMV8R_LIMITS_H_ | ||
#define _LIBPHOENIX_ARCH_ARMV8R_LIMITS_H_ | ||
|
||
#include "arch.h" | ||
|
||
#define SCHAR_MIN -128 | ||
#define SCHAR_MAX 127 | ||
#define UCHAR_MAX 255 | ||
|
||
#define CHAR_MIN 0 | ||
#define CHAR_MAX UCHAR_MAX | ||
#define CHAR_BIT 8 | ||
|
||
#define MB_LEN_MAX 4 | ||
|
||
#define SHRT_MIN -32768 | ||
#define SHRT_MAX 32767 | ||
#define USHRT_MAX 65535 | ||
|
||
#define INT_MIN -2147483648 | ||
#define INT_MAX 0x7fffffff | ||
#define UINT_MAX 0xffffffff | ||
|
||
#define LONG_MIN INT_MIN | ||
#define LONG_MAX INT_MAX | ||
#define ULONG_MAX UINT_MAX | ||
|
||
#define LONG_LONG_MIN 0x8000000000000000LL | ||
#define LONG_LONG_MAX 0x7fffffffffffffffLL | ||
#define ULONG_LONG_MAX 0xffffffffffffffffLL | ||
#define LLONG_MIN LONG_LONG_MIN | ||
#define LLONG_MAX LONG_LONG_MAX | ||
#define ULLONG_MAX ULONG_LONG_MAX | ||
|
||
#define SSIZE_MAX INT_MAX | ||
|
||
#define PAGE_SIZE _PAGE_SIZE | ||
#define PAGESIZE _PAGE_SIZE | ||
|
||
#define PTHREAD_STACK_MIN 256 | ||
|
||
/*** POSIX-required defines ***/ | ||
|
||
#define PATH_MAX 256 /* Maximum number of bytes the implementation will store as a pathname in a user-supplied buffer of unspecified size, including the terminating null character. MIN: 256 */ | ||
#define NAME_MAX 64 /* Maximum number of bytes in a filename (not including the terminating null of a filename string). MIN: 14 */ | ||
#define ARG_MAX 1500 /* Maximum length of argument to the exec functions including environment data. MIN: 4096 */ | ||
#define SYMLOOP_MAX 8 /* Maximum number of symbolic links that can be reliably traversed in the resolution of a pathname in the absence of a loop. MIN: 8 */ | ||
|
||
#define _POSIX2_RE_DUP_MAX 255 | ||
|
||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
/* | ||
* Phoenix-RTOS | ||
* | ||
* libphoenix | ||
* | ||
* arch-dependent part of setjmp.h | ||
* | ||
* Copyright 2024 Phoenix Systems | ||
* Author: Lukasz Leczkowski | ||
* | ||
* This file is part of Phoenix-RTOS. | ||
* | ||
* %LICENSE% | ||
*/ | ||
|
||
#ifndef _LIBPHOENIX_ARCH_ARMV8R_SETJMP_H_ | ||
#define _LIBPHOENIX_ARCH_ARMV8R_SETJMP_H_ | ||
|
||
|
||
#include <phoenix/arch/armv8r/stdtypes.h> | ||
|
||
|
||
struct __jmp_buf { | ||
__u32 sigFlg; | ||
__u32 sigMsk; | ||
__u32 sp; | ||
__u32 r[8]; | ||
__u32 lr; | ||
|
||
#ifndef __SOFTFP__ | ||
__u64 d[8]; | ||
__u32 fpscr; | ||
#endif | ||
} __attribute__((packed, aligned(8))); | ||
|
||
|
||
#endif |
Oops, something went wrong.