stack: add hwcap auxval

Fix the AUXV_LEN to account for hwcap and remove the ifdefs

Change-Id: I303fc2c5fa4c8cea7ec9823f8580b8a66de2f58f
Fujitsu: POSTK_DEBUG_ARCH_DEP_65
This commit is contained in:
Dominique Martinet
2019-01-30 13:37:03 +09:00
parent 206df33658
commit f299fff266
6 changed files with 5 additions and 17 deletions

View File

@ -31,9 +31,7 @@
#include <sysreg.h>
#include <cpufeature.h>
#include <debug.h>
#ifdef POSTK_DEBUG_ARCH_DEP_65
#include <hwcap.h>
#endif /* POSTK_DEBUG_ARCH_DEP_65 */
//#define DEBUG_PRINT_CPU

View File

@ -10,9 +10,7 @@
#include <ptrace.h>
#include <hwcap.h>
#ifdef POSTK_DEBUG_ARCH_DEP_65
unsigned long elf_hwcap;
#endif /* POSTK_DEBUG_ARCH_DEP_65 */
/* @ref.impl arch/arm64/kernel/cpufeature.c */
#define __ARM64_FTR_BITS(SIGNED, VISIBLE, STRICT, TYPE, SHIFT, WIDTH, SAFE_VAL) \
@ -997,9 +995,7 @@ void setup_cpu_features(void)
setup_elf_hwcaps(arm64_elf_hwcaps);
}
#ifdef POSTK_DEBUG_ARCH_DEP_65
unsigned long arch_get_hwcap(void)
{
return elf_hwcap;
}
#endif /* POSTK_DEBUG_ARCH_DEP_65 */

View File

@ -1,5 +1,4 @@
/* hwcap.h COPYRIGHT FUJITSU LIMITED 2017 */
#ifdef POSTK_DEBUG_ARCH_DEP_65
#ifndef _UAPI__ASM_HWCAP_H
#define _UAPI__ASM_HWCAP_H
@ -25,4 +24,3 @@ unsigned long arch_get_hwcap(void);
extern unsigned long elf_hwcap;
#endif /* _UAPI__ASM_HWCAP_H */
#endif /* POSTK_DEBUG_ARCH_DEP_65 */

View File

@ -1,5 +1,4 @@
/* hwcap.h COPYRIGHT FUJITSU LIMITED 2017 */
#ifdef POSTK_DEBUG_ARCH_DEP_65
#ifndef _UAPI__ASM_HWCAP_H
#define _UAPI__ASM_HWCAP_H
@ -9,4 +8,3 @@ static unsigned long arch_get_hwcap(void)
}
#endif /* _UAPI__ASM_HWCAP_H */
#endif /* POSTK_DEBUG_ARCH_DEP_65 */

View File

@ -381,7 +381,7 @@ struct user
unsigned long int u_debugreg [8];
};
#define AUXV_LEN 18
#define AUXV_LEN 20
struct vm_range {
struct rb_node vm_rb_node;

View File

@ -30,9 +30,7 @@
#include <page.h>
#include <cpulocal.h>
#include <auxvec.h>
#ifdef POSTK_DEBUG_ARCH_DEP_65
#include <hwcap.h>
#endif /* POSTK_DEBUG_ARCH_DEP_65 */
#include <timer.h>
#include <mman.h>
#include <xpmem.h>
@ -2231,6 +2229,7 @@ int init_process_stack(struct thread *thread, struct program_load_desc *pn,
unsigned long at_rand;
struct process *proc = thread->proc;
unsigned long ap_flag;
unsigned long ap_hwcap;
struct vm_range *range;
int stack_populated_size = 0;
int stack_align_padding = 0;
@ -2332,10 +2331,9 @@ int init_process_stack(struct thread *thread, struct program_load_desc *pn,
AUXV_LEN in include/process.h. */
p[s_ind--] = 0; /* AT_NULL */
p[s_ind--] = 0;
#ifdef POSTK_DEBUG_ARCH_DEP_65
p[s_ind--] = arch_get_hwcap(); /* AT_HWCAP */
p[s_ind--] = AT_HWCAP;
#endif /* POSTK_DEBUG_ARCH_DEP_65 */
ap_hwcap = arch_get_hwcap();
p[s_ind--] = ap_hwcap; /* AT_HWCAP */
p[s_ind--] = ap_hwcap ? AT_HWCAP : AT_IGNORE;
p[s_ind--] = pn->at_entry; /* AT_ENTRY */
p[s_ind--] = AT_ENTRY;
p[s_ind--] = pn->at_phnum; /* AT_PHNUM */