add arm64 support
- add arm64 dependent codes with GICv3 and SVE support - fix bugs based on architecture separation requests
This commit is contained in:
23
executer/user/arch/arm64/Makefile.in
Normal file
23
executer/user/arch/arm64/Makefile.in
Normal file
@@ -0,0 +1,23 @@
|
||||
CC=@CC@
|
||||
AR=ar
|
||||
BINDIR=@BINDIR@
|
||||
KDIR ?= @KDIR@
|
||||
CFLAGS=-Wall -O -I.
|
||||
VPATH=@abs_srcdir@
|
||||
TARGET=../../libmcexec.a
|
||||
LIBS=@LIBS@
|
||||
|
||||
all: $(TARGET)
|
||||
|
||||
../../libmcexec.a: archdep.o
|
||||
$(AR) cr ../../libmcexec.a archdep.o
|
||||
|
||||
archdep.o: archdep.S
|
||||
$(CC) -c -I${KDIR} $(CFLAGS) $(EXTRA_CFLAGS) -fPIE -pie -pthread $<
|
||||
|
||||
clean:
|
||||
$(RM) $(TARGET) *.o
|
||||
|
||||
.PHONY: all clean install
|
||||
|
||||
install:
|
||||
51
executer/user/arch/arm64/arch-eclair.c
Normal file
51
executer/user/arch/arm64/arch-eclair.c
Normal file
@@ -0,0 +1,51 @@
|
||||
/* arch-eclair.c COPYRIGHT FUJITSU LIMITED 2016 */
|
||||
#include <stdio.h>
|
||||
#include <eclair.h>
|
||||
#include <arch-eclair.h>
|
||||
|
||||
int print_kregs(char *rbp, size_t rbp_size, const struct arch_kregs *kregs)
|
||||
{
|
||||
int i, ret, total = 0;
|
||||
const unsigned long *regs[] = {&kregs->x19, &kregs->x20, &kregs->x21,
|
||||
&kregs->x22, &kregs->x23, &kregs->x24,
|
||||
&kregs->x25, &kregs->x26, &kregs->x27,
|
||||
&kregs->x28};
|
||||
|
||||
for (i = 0; i < 18; i++) /* x0-x18 */{
|
||||
ret = snprintf(rbp, rbp_size, "xxxxxxxxxxxxxxxx");
|
||||
if (ret < 0) {
|
||||
return ret;
|
||||
}
|
||||
rbp += ret;
|
||||
total += ret;
|
||||
rbp_size -= ret;
|
||||
}
|
||||
|
||||
for (i = 0; i < sizeof(regs)/sizeof(regs[0]); i++) { /* x19-x28 */
|
||||
ret = print_bin(rbp, rbp_size, (void *)regs[i], sizeof(*regs[0]));
|
||||
if (ret < 0) {
|
||||
return ret;
|
||||
}
|
||||
rbp += ret;
|
||||
total += ret;
|
||||
rbp_size -= ret;
|
||||
}
|
||||
|
||||
for (i = 0; i < 2; i++) { /* x29-x30 */
|
||||
ret = snprintf(rbp, rbp_size, "xxxxxxxxxxxxxxxx");
|
||||
if (ret < 0) {
|
||||
return ret;
|
||||
}
|
||||
rbp += ret;
|
||||
total += ret;
|
||||
rbp_size -= ret;
|
||||
}
|
||||
|
||||
ret += print_bin(rbp, rbp_size, (void *)&kregs->sp, sizeof(kregs->sp));
|
||||
if (ret < 0) {
|
||||
return ret;
|
||||
}
|
||||
total += ret;
|
||||
|
||||
return total;
|
||||
}
|
||||
126
executer/user/arch/arm64/arch_args.h
Normal file
126
executer/user/arch/arm64/arch_args.h
Normal file
@@ -0,0 +1,126 @@
|
||||
/* arch_args.h COPYRIGHT FUJITSU LIMITED 2017 */
|
||||
#ifndef ARCH_ARGS_H
|
||||
#define ARCH_ARGS_H
|
||||
|
||||
#include <asm/ptrace.h>
|
||||
|
||||
typedef struct user_pt_regs syscall_args;
|
||||
|
||||
static inline int
|
||||
get_syscall_args(int pid, syscall_args *args)
|
||||
{
|
||||
/* TODO: skeleton for UTI */
|
||||
return -1;
|
||||
}
|
||||
|
||||
static inline int
|
||||
set_syscall_args(int pid, syscall_args *args)
|
||||
{
|
||||
/* TODO: skeleton for UTI */
|
||||
return -1;
|
||||
}
|
||||
|
||||
static inline unsigned long
|
||||
get_syscall_number(syscall_args *args)
|
||||
{
|
||||
/* TODO: skeleton for UTI */
|
||||
return 0;
|
||||
}
|
||||
|
||||
static inline unsigned long
|
||||
get_syscall_return(syscall_args *args)
|
||||
{
|
||||
/* TODO: skeleton for UTI */
|
||||
return 0;
|
||||
}
|
||||
|
||||
static inline unsigned long
|
||||
get_syscall_arg1(syscall_args *args)
|
||||
{
|
||||
/* TODO: skeleton for UTI */
|
||||
return 0;
|
||||
}
|
||||
|
||||
static inline unsigned long
|
||||
get_syscall_arg2(syscall_args *args)
|
||||
{
|
||||
/* TODO: skeleton for UTI */
|
||||
return 0;
|
||||
}
|
||||
|
||||
static inline unsigned long
|
||||
get_syscall_arg3(syscall_args *args)
|
||||
{
|
||||
/* TODO: skeleton for UTI */
|
||||
return 0;
|
||||
}
|
||||
|
||||
static inline unsigned long
|
||||
get_syscall_arg4(syscall_args *args)
|
||||
{
|
||||
/* TODO: skeleton for UTI */
|
||||
return 0;
|
||||
}
|
||||
|
||||
static inline unsigned long
|
||||
get_syscall_arg5(syscall_args *args)
|
||||
{
|
||||
/* TODO: skeleton for UTI */
|
||||
return 0;
|
||||
}
|
||||
|
||||
static inline unsigned long
|
||||
get_syscall_arg6(syscall_args *args)
|
||||
{
|
||||
/* TODO: skeleton for UTI */
|
||||
return 0;
|
||||
}
|
||||
|
||||
static inline void
|
||||
set_syscall_number(syscall_args *args, unsigned long value)
|
||||
{
|
||||
/* TODO: skeleton for UTI */
|
||||
}
|
||||
|
||||
static inline void
|
||||
set_syscall_return(syscall_args *args, unsigned long value)
|
||||
{
|
||||
/* TODO: skeleton for UTI */
|
||||
}
|
||||
|
||||
static inline void
|
||||
set_syscall_arg1(syscall_args *args, unsigned long value)
|
||||
{
|
||||
/* TODO: skeleton for UTI */
|
||||
}
|
||||
|
||||
static inline void
|
||||
set_syscall_arg2(syscall_args *args, unsigned long value)
|
||||
{
|
||||
/* TODO: skeleton for UTI */
|
||||
}
|
||||
|
||||
static inline void
|
||||
set_syscall_arg3(syscall_args *args, unsigned long value)
|
||||
{
|
||||
/* TODO: skeleton for UTI */
|
||||
}
|
||||
|
||||
static inline void
|
||||
set_syscall_arg4(syscall_args *args, unsigned long value)
|
||||
{
|
||||
/* TODO: skeleton for UTI */
|
||||
}
|
||||
|
||||
static inline void
|
||||
set_syscall_arg5(syscall_args *args, unsigned long value)
|
||||
{
|
||||
/* TODO: skeleton for UTI */
|
||||
}
|
||||
|
||||
static inline void
|
||||
set_syscall_arg6(syscall_args *args, unsigned long value)
|
||||
{
|
||||
/* TODO: skeleton for UTI */
|
||||
}
|
||||
#endif /* !ARCH_ARGS_H */
|
||||
16
executer/user/arch/arm64/archdep.S
Normal file
16
executer/user/arch/arm64/archdep.S
Normal file
@@ -0,0 +1,16 @@
|
||||
/* archdep.S COPYRIGHT FUJITSU LIMITED 2017 */
|
||||
/* TODO: skeleton for UTI */
|
||||
.global switch_ctx
|
||||
switch_ctx:
|
||||
ret
|
||||
|
||||
/* TODO: skeleton for UTI */
|
||||
.global compare_and_swap
|
||||
compare_and_swap:
|
||||
ret
|
||||
|
||||
/* TODO: skeleton for UTI */
|
||||
.global compare_and_swap_int
|
||||
compare_and_swap_int:
|
||||
ret
|
||||
|
||||
24
executer/user/arch/arm64/include/arch-eclair.h
Normal file
24
executer/user/arch/arm64/include/arch-eclair.h
Normal file
@@ -0,0 +1,24 @@
|
||||
/* arch-eclair.h COPYRIGHT FUJITSU LIMITED 2016 */
|
||||
#ifndef HEADER_USER_ARM64_ECLAIR_H
|
||||
#define HEADER_USER_ARM64_ECLAIR_H
|
||||
|
||||
/* VA_BITS=48, 4K_PAGE address */
|
||||
#define MAP_KERNEL 0xffffffffff800000
|
||||
#define MAP_ST 0xffff800000000000
|
||||
#define MAP_KERNEL_TEXT "0xffffffffff800000"
|
||||
|
||||
#define ARCH_CLV_SPAN "arm64_cpu_local_variables_span"
|
||||
|
||||
#define ARCH "aarch64"
|
||||
|
||||
#define ARCH_REGS 34
|
||||
|
||||
#define PANIC_REGS_OFFSET 144
|
||||
|
||||
struct arch_kregs {
|
||||
unsigned long x19, x20, x21, x22, x23;
|
||||
unsigned long x24, x25, x26, x27, x28;
|
||||
unsigned long fp, sp, pc;
|
||||
};
|
||||
|
||||
#endif /* HEADER_USER_ARM64_ECLAIR_H */
|
||||
Reference in New Issue
Block a user