e2k: Add e2k32 linux user files.
Signed-off-by: Denis Drakhnya <numas13@gmail.com>
This commit is contained in:
parent
e440ebc3db
commit
d3e84e57e5
3
configs/targets/e2k32-linux-user.mak
Normal file
3
configs/targets/e2k32-linux-user.mak
Normal file
@ -0,0 +1,3 @@
|
||||
TARGET_ARCH=e2k32
|
||||
TARGET_BASE_ARCH=e2k
|
||||
TARGET_ABI32=y
|
1
linux-user/e2k32/cpu_loop.c
Normal file
1
linux-user/e2k32/cpu_loop.c
Normal file
@ -0,0 +1 @@
|
||||
#include "../e2k/cpu_loop.c"
|
1
linux-user/e2k32/signal.c
Normal file
1
linux-user/e2k32/signal.c
Normal file
@ -0,0 +1 @@
|
||||
#include "../e2k/signal.c"
|
1
linux-user/e2k32/sockbits.h
Normal file
1
linux-user/e2k32/sockbits.h
Normal file
@ -0,0 +1 @@
|
||||
#include "../generic/sockbits.h"
|
1
linux-user/e2k32/syscall_nr.h
Normal file
1
linux-user/e2k32/syscall_nr.h
Normal file
@ -0,0 +1 @@
|
||||
#include "../e2k/syscall_nr.h"
|
1
linux-user/e2k32/target_cpu.h
Normal file
1
linux-user/e2k32/target_cpu.h
Normal file
@ -0,0 +1 @@
|
||||
#include "../e2k/target_cpu.h"
|
1
linux-user/e2k32/target_elf.h
Normal file
1
linux-user/e2k32/target_elf.h
Normal file
@ -0,0 +1 @@
|
||||
#include "../e2k/target_elf.h"
|
4
linux-user/e2k32/target_fcntl.h
Normal file
4
linux-user/e2k32/target_fcntl.h
Normal file
@ -0,0 +1,4 @@
|
||||
#ifndef E2K32_TARGET_FCNTL_H
|
||||
#define E2K32_TARGET_FCNTL_H
|
||||
#include "../generic/fcntl.h"
|
||||
#endif
|
26
linux-user/e2k32/target_signal.h
Normal file
26
linux-user/e2k32/target_signal.h
Normal file
@ -0,0 +1,26 @@
|
||||
#ifndef E2K32_TARGET_SIGNAL_H
|
||||
#define E2K32_TARGET_SIGNAL_H
|
||||
|
||||
/*
|
||||
* sigaltstack controls
|
||||
*/
|
||||
#define TARGET_SS_ONSTACK 1
|
||||
#define TARGET_SS_DISABLE 2
|
||||
|
||||
#define TARGET_MINSIGSTKSZ 4096
|
||||
#define TARGET_SIGSTKSZ 8192
|
||||
#define TARGET_MCL_CURRENT 1
|
||||
#define TARGET_MCL_FUTURE 2
|
||||
#define TARGET_MCL_ONFAULT 4
|
||||
|
||||
#define TARGET_ARCH_HAS_SETUP_FRAME
|
||||
|
||||
typedef struct target_sigaltstack {
|
||||
abi_ulong ss_sp;
|
||||
abi_int ss_flags;
|
||||
abi_ulong ss_size;
|
||||
} target_stack_t;
|
||||
|
||||
#include "../generic/signal.h"
|
||||
|
||||
#endif /* E2K32_TARGET_SIGNAL_H */
|
1
linux-user/e2k32/target_structs.h
Normal file
1
linux-user/e2k32/target_structs.h
Normal file
@ -0,0 +1 @@
|
||||
#include "../e2k/target_structs.h"
|
1
linux-user/e2k32/target_syscall.h
Normal file
1
linux-user/e2k32/target_syscall.h
Normal file
@ -0,0 +1 @@
|
||||
#include "../e2k/target_syscall.h"
|
6
linux-user/e2k32/termbits.h
Normal file
6
linux-user/e2k32/termbits.h
Normal file
@ -0,0 +1,6 @@
|
||||
#ifndef _E2K_TERMBITS_H_
|
||||
#define _E2K_TERMBITS_H_
|
||||
|
||||
#include "../generic/termbits.h"
|
||||
|
||||
#endif /* _E2K_TERMBITS_H_ */
|
@ -7089,6 +7089,47 @@ static abi_long do_e2k_longjmp2(CPUE2KState *env, struct target_jmp_info *jmp_in
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static abi_long do_e2k_access_hw_stacks(CPUState *cpu, abi_ulong arg2,
|
||||
abi_ulong arg3, abi_ulong arg4, abi_ulong arg5, abi_ulong arg6)
|
||||
{
|
||||
E2KCPU *e2k_cpu = E2K_CPU(cpu);
|
||||
CPUE2KState *env = &e2k_cpu->env;
|
||||
int ret = 0;
|
||||
abi_ulong mode = arg2;
|
||||
abi_ulong frame_addr = arg3; // __user (abi_ullong *)
|
||||
// abi_ulong buf_addr = arg4; // __user (char *)
|
||||
// abi_ulong buf_size = arg5;
|
||||
abi_ulong size_addr = arg6; // __user (void *)
|
||||
|
||||
switch (mode) {
|
||||
case GET_PROCEDURE_STACK_SIZE:
|
||||
ret = put_user(env->psp.index, size_addr, target_ulong);
|
||||
break;
|
||||
case GET_CHAIN_STACK_SIZE:
|
||||
ret = put_user(env->pcsp.index, size_addr, target_ulong);
|
||||
break;
|
||||
case GET_CHAIN_STACK_OFFSET:
|
||||
ret = -TARGET_ENOSYS;
|
||||
break;
|
||||
case READ_CHAIN_STACK_EX:
|
||||
{
|
||||
abi_ullong frame = 0;
|
||||
copy_user();
|
||||
|
||||
break;
|
||||
}
|
||||
case READ_CHAIN_STACK:
|
||||
case READ_PROCEDURE_STACK:
|
||||
case WRITE_PROCEDURE_STACK:
|
||||
case READ_PROCEDURE_STACK_EX:
|
||||
case WRITE_PROCEDURE_STACK_EX:
|
||||
case WRITE_CHAIN_STACK_EX:
|
||||
return -TARGET_ENOSYS;
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
#endif /* end of TARGET_E2K */
|
||||
|
||||
static abi_long do_fcntl(int fd, int cmd, abi_ulong arg)
|
||||
@ -11999,24 +12040,16 @@ static abi_long do_syscall1(CPUArchState *cpu_env, int num, abi_long arg1,
|
||||
if (ret) {
|
||||
break;
|
||||
}
|
||||
do_e2k_longjmp2(env, &ji);
|
||||
ret = do_e2k_longjmp2(env, &ji);
|
||||
if (ret) {
|
||||
break;
|
||||
}
|
||||
return arg2;
|
||||
}
|
||||
#endif
|
||||
#ifdef TARGET_NR_access_hw_stacks
|
||||
case TARGET_NR_access_hw_stacks:
|
||||
{
|
||||
#if 0
|
||||
abi_ulong mode = arg2;
|
||||
abi_ulong frame_ptr = arg3; // __user (abi_ullong *)
|
||||
abi_ulong buf = arg4; // __user (char *)
|
||||
abi_ulong buf_size = arg5;
|
||||
abi_ulong real_size = arg6; // __user (void *)
|
||||
#endif
|
||||
|
||||
// TODO: e2k_sys_access_hw_stacks
|
||||
return -TARGET_ENOSYS;
|
||||
}
|
||||
return do_e2k_access_hw_stacks(cpu, arg1, arg2, arg3, arg4, arg5);
|
||||
#endif
|
||||
#ifdef CONFIG_ATTR
|
||||
#ifdef TARGET_NR_setxattr
|
||||
|
37
target/e2k/helper-tcg.h
Normal file
37
target/e2k/helper-tcg.h
Normal file
@ -0,0 +1,37 @@
|
||||
/*
|
||||
* e2k TCG specific prototypes for helpers
|
||||
*
|
||||
* Copyright (c) 2020-2021 Denis Drakhnya, Alibek Omarov
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in
|
||||
* all copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
||||
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
* THE SOFTWARE.
|
||||
*/
|
||||
|
||||
#ifndef E2K_HELPER_TCG_H
|
||||
#define E2K_HELPER_TCG_H
|
||||
|
||||
#include "qemu/osdep.h"
|
||||
#include "cpu.h"
|
||||
#include "exec/exec-all.h"
|
||||
|
||||
/* helper.c */
|
||||
void G_NORETURN raise_exception(CPUE2KState *env, int exception_index);
|
||||
void G_NORETURN raise_exception_ra(CPUE2KState *env, int exception_index,
|
||||
uintptr_t retaddr);
|
||||
|
||||
#endif /* E2K_HELPER_TCG_H */
|
Loading…
Reference in New Issue
Block a user