add arm64 support
- add arm64 dependent codes with GICv3 and SVE support - fix bugs based on architecture separation requests
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
/* bitops.c COPYRIGHT FUJITSU LIMITED 2014 */
|
||||
/* bitops.c COPYRIGHT FUJITSU LIMITED 2015-2016 */
|
||||
#include <bitops.h>
|
||||
|
||||
#define BITOP_WORD(nr) ((nr) / BITS_PER_LONG)
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/* bitops-__ffs.h COPYRIGHT FUJITSU LIMITED 2014 */
|
||||
/* bitops-__ffs.h COPYRIGHT FUJITSU LIMITED 2015-2016 */
|
||||
#ifndef INCLUDE_BITOPS___FFS_H
|
||||
#define INCLUDE_BITOPS___FFS_H
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/* bitops-clear_bit.h COPYRIGHT FUJITSU LIMITED 2014 */
|
||||
/* bitops-clear_bit.h COPYRIGHT FUJITSU LIMITED 2015-2016 */
|
||||
#ifndef INCLUDE_BITOPS_CLEAR_BIT_H
|
||||
#define INCLUDE_BITOPS_CLEAR_BIT_H
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/* bitops-ffz.h COPYRIGHT FUJITSU LIMITED 2014 */
|
||||
/* bitops-ffz.h COPYRIGHT FUJITSU LIMITED 2015-2016 */
|
||||
#ifndef INCLUDE_BITOPS_FFZ_H
|
||||
#define INCLUDE_BITOPS_FFZ_H
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/* bitops-fls.h COPYRIGHT FUJITSU LIMITED 2014 */
|
||||
/* bitops-fls.h COPYRIGHT FUJITSU LIMITED 2015-2016 */
|
||||
#ifndef INCLUDE_BITOPS_FLS_H
|
||||
#define INCLUDE_BITOPS_FLS_H
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/* bitops-set_bit.h COPYRIGHT FUJITSU LIMITED 2014 */
|
||||
/* bitops-set_bit.h COPYRIGHT FUJITSU LIMITED 2015-2016 */
|
||||
#ifndef INCLUDE_BITOPS_SET_BIT_H
|
||||
#define INCLUDE_BITOPS_SET_BIT_H
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/* bitops.h COPYRIGHT FUJITSU LIMITED 2014 */
|
||||
/* bitops.h COPYRIGHT FUJITSU LIMITED 2015-2016 */
|
||||
#ifndef INCLUDE_BITOPS_H
|
||||
#define INCLUDE_BITOPS_H
|
||||
|
||||
|
||||
@@ -9,6 +9,7 @@
|
||||
/*
|
||||
* HISTORY
|
||||
*/
|
||||
/* cpu.h COPYRIGHT FUJITSU LIMITED 2015-2016 */
|
||||
|
||||
#ifndef IHK_CPU_H
|
||||
#define IHK_CPU_H
|
||||
@@ -88,11 +89,21 @@ void ihk_mc_init_user_process(ihk_mc_kernel_context_t *ctx,
|
||||
void ihk_mc_init_user_tlsbase(ihk_mc_user_context_t *ctx,
|
||||
unsigned long tls_base_addr);
|
||||
|
||||
#ifdef POSTK_DEBUG_ARCH_DEP_42 /* /proc/cpuinfo support added. */
|
||||
long ihk_mc_show_cpuinfo(char *buf, size_t buf_size, unsigned long read_off, int *eofp);
|
||||
#endif /* POSTK_DEBUG_ARCH_DEP_42 */
|
||||
|
||||
enum ihk_mc_user_context_regtype {
|
||||
IHK_UCR_STACK_POINTER = 1,
|
||||
IHK_UCR_PROGRAM_COUNTER = 2,
|
||||
};
|
||||
|
||||
#ifdef POSTK_DEBUG_ARCH_DEP_23 /* add arch dep. clone_process() function */
|
||||
struct thread;
|
||||
void arch_clone_thread(struct thread *othread, unsigned long pc,
|
||||
unsigned long sp, struct thread *nthread);
|
||||
#endif /* POSTK_DEBUG_ARCH_DEP_23 */
|
||||
|
||||
void ihk_mc_modify_user_context(ihk_mc_user_context_t *uctx,
|
||||
enum ihk_mc_user_context_regtype reg,
|
||||
unsigned long value);
|
||||
@@ -104,15 +115,19 @@ enum ihk_asr_type {
|
||||
IHK_ASR_X86_GS,
|
||||
};
|
||||
|
||||
#ifndef POSTK_DEBUG_ARCH_DEP_75 /* x86 depend hide */
|
||||
/* Local IRQ vectors */
|
||||
#define LOCAL_TIMER_VECTOR 0xef
|
||||
#define LOCAL_PERF_VECTOR 0xf0
|
||||
#endif /* !POSTK_DEBUG_ARCH_DEP_75 */
|
||||
|
||||
#define IHK_TLB_FLUSH_IRQ_VECTOR_START 68
|
||||
#define IHK_TLB_FLUSH_IRQ_VECTOR_SIZE 64
|
||||
#define IHK_TLB_FLUSH_IRQ_VECTOR_END (IHK_TLB_FLUSH_IRQ_VECTOR_START + IHK_TLB_FLUSH_IRQ_VECTOR_SIZE)
|
||||
|
||||
#ifndef POSTK_DEBUG_ARCH_DEP_75 /* x86 depend hide */
|
||||
#define LOCAL_SMP_FUNC_CALL_VECTOR 0xf1
|
||||
#endif /* !POSTK_DEBUG_ARCH_DEP_75 */
|
||||
|
||||
int ihk_mc_arch_set_special_register(enum ihk_asr_type, unsigned long value);
|
||||
int ihk_mc_arch_get_special_register(enum ihk_asr_type, unsigned long *value);
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
/* debug.h COPYRIGHT FUJITSU LIMITED 2015-2016 */
|
||||
/**
|
||||
* \file debug.h
|
||||
* License details are found in the file LICENSE.
|
||||
@@ -17,6 +18,21 @@
|
||||
#include <ihk/memconst.h>
|
||||
#include <ihk/kmsg.h>
|
||||
|
||||
#ifdef POSTK_DEBUG_ARCH_DEP_9 /* want to add a static assertion */
|
||||
|
||||
/* Force a compilation error if condition is false */
|
||||
#define STATIC_ASSERT(cond) _STATIC_ASSERT(cond, __LINE__)
|
||||
#define _STATIC_ASSERT(cond, line) __STATIC_ASSERT(cond, line)
|
||||
#define __STATIC_ASSERT(cond, line) \
|
||||
static void __static_assert_ ## line (void) { \
|
||||
STATIC_ASSERT_LOCAL(cond); \
|
||||
}
|
||||
|
||||
/* Force a compilation error if condition is false */
|
||||
#define STATIC_ASSERT_LOCAL(cond) ((void)sizeof(struct { int:-!!!(cond); }))
|
||||
|
||||
#endif /* POSTK_DEBUG_ARCH_DEP_9 */
|
||||
|
||||
struct ihk_kmsg_buf {
|
||||
int tail;
|
||||
int len;
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
/* perfctr.h COPYRIGHT FUJITSU LIMITED 2015-2016 */
|
||||
/**
|
||||
* \file perfctr.h
|
||||
* License details are found in the file LICENSE.
|
||||
@@ -13,6 +14,10 @@
|
||||
#ifndef HEADER_GENERIC_IHK_PERFCTR_H
|
||||
#define HEADER_GENERIC_IHK_PERFCTR_H
|
||||
|
||||
#ifdef POSTK_DEBUG_TEMP_FIX_29
|
||||
#include <types.h>
|
||||
#endif /*POSTK_DEBUG_TEMP_FIX_29*/
|
||||
|
||||
#define PERFCTR_USER_MODE 0x01
|
||||
#define PERFCTR_KERNEL_MODE 0x02
|
||||
|
||||
@@ -48,10 +53,20 @@ enum ihk_perfctr_type {
|
||||
PERFCTR_MAX_TYPE,
|
||||
};
|
||||
|
||||
#ifdef POSTK_DEBUG_TEMP_FIX_29
|
||||
int ihk_mc_perfctr_init(int counter, uint64_t config, int mode);
|
||||
int ihk_mc_perfctr_init_raw(int counter, uint64_t config, int mode);
|
||||
#else
|
||||
int ihk_mc_perfctr_init(int counter, enum ihk_perfctr_type type, int mode);
|
||||
int ihk_mc_perfctr_init_raw(int counter, unsigned int code, int mode);
|
||||
#endif/*POSTK_DEBUG_TEMP_FIX_29*/
|
||||
#ifdef POSTK_DEBUG_TEMP_FIX_30
|
||||
int ihk_mc_perfctr_start(int counter);
|
||||
int ihk_mc_perfctr_stop(int counter);
|
||||
#else
|
||||
int ihk_mc_perfctr_start(unsigned long counter_mask);
|
||||
int ihk_mc_perfctr_stop(unsigned long counter_mask);
|
||||
#endif/*POSTK_DEBUG_TEMP_FIX_30*/
|
||||
int ihk_mc_perfctr_fixed_init(int counter, int mode);
|
||||
int ihk_mc_perfctr_reset(int counter);
|
||||
int ihk_mc_perfctr_set(int counter, long value);
|
||||
|
||||
@@ -1,6 +1,10 @@
|
||||
/* mc_perf_event.h COPYRIGHT FUJITSU LIMITED 2016 */
|
||||
#ifndef MC_PERF_EVNET_H
|
||||
#define MC_PERF_EVENT_H
|
||||
|
||||
#ifdef POSTK_DEBUG_TEMP_FIX_32
|
||||
#include <list.h>
|
||||
#endif /*POSTK_DEBUG_TEMP_FIX_32*/
|
||||
#include <march.h>
|
||||
|
||||
struct perf_event_attr;
|
||||
|
||||
@@ -9,6 +9,7 @@
|
||||
/*
|
||||
* HISTORY
|
||||
*/
|
||||
/* memory.h COPYRIGHT FUJITSU LIMITED 2015-2016 */
|
||||
|
||||
#ifndef __HEADER_GENERIC_MEMORY_H
|
||||
#define __HEADER_GENERIC_MEMORY_H
|
||||
@@ -45,6 +46,15 @@ int setlong_user(long *dst, long data);
|
||||
int setint_user(int *dst, int data);
|
||||
int write_process_vm(struct process_vm *vm, void *udst, const void *ksrc, size_t siz);
|
||||
int patch_process_vm(struct process_vm *vm, void *udst, const void *ksrc, size_t siz);
|
||||
#ifdef POSTK_DEBUG_ARCH_DEP_27
|
||||
struct thread;
|
||||
int search_free_space(struct thread *thread, size_t len, intptr_t hint,
|
||||
int pgshift, intptr_t *addrp);
|
||||
#endif /* POSTK_DEBUG_ARCH_DEP_27 */
|
||||
|
||||
#ifdef POSTK_DEBUG_TEMP_FIX_52 /* supports NUMA for memory area determination */
|
||||
int is_mckernel_memory(unsigned long phys);
|
||||
#endif /* POSTK_DEBUG_TEMP_FIX_52 */
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
@@ -9,6 +9,7 @@
|
||||
/*
|
||||
* HISTORY
|
||||
*/
|
||||
/* types.h COPYRIGHT FUJITSU LIMITED 2015-2016 */
|
||||
|
||||
#ifndef TYPES_H
|
||||
#define TYPES_H
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
/* vsprintf.c COPYRIGHT FUJITSU LIMITED 2015-2016 */
|
||||
/*
|
||||
* linux/lib/vsprintf.c
|
||||
*
|
||||
@@ -904,12 +905,19 @@ int vsnprintf(char *buf, size_t size, const char *fmt, va_list args)
|
||||
char *str, *end, c;
|
||||
int read;
|
||||
struct printf_spec spec = {0};
|
||||
#ifdef POSTK_DEBUG_TEMP_FIX_28 /* vsnprintf size excess return value fix. */
|
||||
int ret = 0;
|
||||
#endif /* POSTK_DEBUG_TEMP_FIX_28 */
|
||||
|
||||
/* Reject out-of-range values early. Large positive sizes are
|
||||
used for unknown buffer sizes. */
|
||||
if (unlikely((int) size < 0)) {
|
||||
/* There can be only one.. */
|
||||
#ifdef POSTK_DEBUG_TEMP_FIX_28 /* vsnprintf size excess return value fix. */
|
||||
return ret;
|
||||
#else /* POSTK_DEBUG_TEMP_FIX_28 */
|
||||
return 0;
|
||||
#endif /* POSTK_DEBUG_TEMP_FIX_28 */
|
||||
}
|
||||
|
||||
str = buf;
|
||||
@@ -1057,14 +1065,29 @@ int vsnprintf(char *buf, size_t size, const char *fmt, va_list args)
|
||||
}
|
||||
|
||||
if (size > 0) {
|
||||
#ifdef POSTK_DEBUG_TEMP_FIX_28 /* vsnprintf size excess return value fix. */
|
||||
if (str < end) {
|
||||
*str = '\0';
|
||||
ret = str - buf;
|
||||
}
|
||||
else {
|
||||
end[-1] = '\0';
|
||||
ret = end - buf - 1;
|
||||
}
|
||||
#else /* POSTK_DEBUG_TEMP_FIX_28 */
|
||||
if (str < end)
|
||||
*str = '\0';
|
||||
else
|
||||
end[-1] = '\0';
|
||||
#endif /* POSTK_DEBUG_TEMP_FIX_28 */
|
||||
}
|
||||
|
||||
/* the trailing null byte doesn't count towards the total */
|
||||
#ifdef POSTK_DEBUG_TEMP_FIX_28 /* vsnprintf size excess return value fix. */
|
||||
return ret;
|
||||
#else /* POSTK_DEBUG_TEMP_FIX_28 */
|
||||
return str-buf;
|
||||
#endif /* POSTK_DEBUG_TEMP_FIX_28 */
|
||||
|
||||
}
|
||||
EXPORT_SYMBOL(vsnprintf);
|
||||
|
||||
Reference in New Issue
Block a user