eclair and crash: clean up architecture dependent codes and comply with Linux page_offset_base
Change-Id: Ie14ceb8bc9d816a9201dddd4020e2c21d6cfd686 Fujitsu: POSTK_DEBUG_ARCH_DEP_34
This commit is contained in:
committed by
Masamichi Takagi
parent
1526237bc6
commit
d5de68e97b
@@ -50,7 +50,6 @@ int print_kregs(char *rbp, size_t rbp_size, const struct arch_kregs *kregs)
|
||||
return total;
|
||||
}
|
||||
|
||||
#ifdef POSTK_DEBUG_ARCH_DEP_34
|
||||
uintptr_t virt_to_phys(uintptr_t va)
|
||||
{
|
||||
extern uintptr_t kernel_base;
|
||||
@@ -65,5 +64,9 @@ uintptr_t virt_to_phys(uintptr_t va)
|
||||
|
||||
return NOPHYS;
|
||||
} /* virt_to_phys() */
|
||||
#endif /* POSTK_DEBUG_ARCH_DEP_34 */
|
||||
|
||||
int arch_setup_constants(void)
|
||||
{
|
||||
/* Nothing here */
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -61,8 +61,4 @@ struct arch_kregs {
|
||||
unsigned long fp, sp, pc;
|
||||
};
|
||||
|
||||
#ifdef POSTK_DEBUG_ARCH_DEP_34
|
||||
uintptr_t virt_to_phys(uintptr_t va);
|
||||
#endif /* POSTK_DEBUG_ARCH_DEP_34 */
|
||||
|
||||
#endif /* HEADER_USER_ARM64_ECLAIR_H */
|
||||
|
||||
@@ -3,6 +3,8 @@
|
||||
#include <stdio.h>
|
||||
#include <arch-eclair.h>
|
||||
|
||||
unsigned long linux_page_offset = 0xffff880000000000UL;
|
||||
|
||||
int print_kregs(char *rbp, size_t rbp_size, const struct arch_kregs *kregs)
|
||||
{
|
||||
int i, ret, total = 0;
|
||||
@@ -100,16 +102,15 @@ int print_kregs(char *rbp, size_t rbp_size, const struct arch_kregs *kregs)
|
||||
return total;
|
||||
}
|
||||
|
||||
#ifdef POSTK_DEBUG_ARCH_DEP_34
|
||||
static uintptr_t virt_to_phys(uintptr_t va)
|
||||
uintptr_t virt_to_phys(uintptr_t va)
|
||||
{
|
||||
extern uintptr_t kernel_base;
|
||||
|
||||
if (va >= MAP_KERNEL_START) {
|
||||
return va - MAP_KERNEL_START + kernel_base;
|
||||
}
|
||||
else if (va >= LINUX_PAGE_OFFSET) {
|
||||
return va - LINUX_PAGE_OFFSET;
|
||||
else if (va >= linux_page_offset) {
|
||||
return va - linux_page_offset;
|
||||
}
|
||||
else if (va >= MAP_FIXED_START) {
|
||||
return va - MAP_FIXED_START;
|
||||
@@ -120,5 +121,16 @@ static uintptr_t virt_to_phys(uintptr_t va)
|
||||
|
||||
return NOPHYS;
|
||||
} /* virt_to_phys() */
|
||||
#endif /* POSTK_DEBUG_ARCH_DEP_34 */
|
||||
|
||||
int arch_setup_constants(void)
|
||||
{
|
||||
if (read_symbol_64("linux_page_offset_base",
|
||||
&linux_page_offset) != 0) {
|
||||
fprintf(stderr, "error: obtaining Linux page offset\n");
|
||||
return 1;
|
||||
}
|
||||
|
||||
printf("x86 linux_page_offset: 0x%lx\n", linux_page_offset);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
@@ -2,19 +2,10 @@
|
||||
#ifndef HEADER_USER_X86_ECLAIR_H
|
||||
#define HEADER_USER_X86_ECLAIR_H
|
||||
|
||||
#ifndef POSTK_DEBUG_ARCH_DEP_34
|
||||
#define MAP_ST_START 0xffff800000000000UL
|
||||
#define MAP_VMAP_START 0xffff850000000000UL
|
||||
#define MAP_FIXED_START 0xffff860000000000UL
|
||||
#define LINUX_PAGE_OFFSET 0xffff880000000000UL
|
||||
#define MAP_KERNEL_START 0xFFFFFFFFFE800000UL
|
||||
#endif /* POSTK_DEBUG_ARCH_DEP_34 */
|
||||
|
||||
/* TODO: these should be updated when McKernel changes */
|
||||
#define MCKERNEL_ELF_START "0xFFFFFFFFFE801000"
|
||||
#define MCKERNEL_ELF_LEN "0x0000000000100000"
|
||||
|
||||
|
||||
extern unsigned long linux_page_offset;
|
||||
#define ARCH_CLV_SPAN "x86_cpu_local_variables_span"
|
||||
|
||||
#define ARCH "i386:x86-64"
|
||||
@@ -31,8 +22,4 @@ struct arch_kregs {
|
||||
uintptr_t r15, rflags, rsp0;
|
||||
};
|
||||
|
||||
#ifdef POSTK_DEBUG_ARCH_DEP_34
|
||||
uintptr_t virt_to_phys(uintptr_t va);
|
||||
#endif /* POSTK_DEBUG_ARCH_DEP_34 */
|
||||
|
||||
#endif /* HEADER_USER_x86_ECLAIR_H */
|
||||
|
||||
Reference in New Issue
Block a user