switch context: Move to arch-dependent (arch_switch_context())

Fujitsu: POSTK_DEBUG_ARCH_DEP_22
Change-Id: I6faf8d9daa1e639350c2cd83db9bb27b9d37ba01
This commit is contained in:
Ken Sato
2018-08-29 11:17:51 +09:00
committed by Masamichi Takagi
parent 895a8c4099
commit 0fdeb254b3
3 changed files with 3 additions and 50 deletions

View File

@ -1281,7 +1281,6 @@ int ihk_mc_interrupt_cpu(int cpu, int vector)
return 0;
}
#ifdef POSTK_DEBUG_ARCH_DEP_22
/*
* @ref.impl linux-linaro/arch/arm64/kernel/process.c::tls_thread_switch()
*/
@ -1357,7 +1356,6 @@ struct thread *arch_switch_context(struct thread *prev, struct thread *next)
return last;
}
#endif /* POSTK_DEBUG_ARCH_DEP_22 */
/*@
@ requires \valid(thread);

View File

@ -94,6 +94,8 @@ int gettime_local_support = 0;
extern int ihk_mc_pt_print_pte(struct page_table *pt, void *virt);
extern int kprintf(const char *format, ...);
extern int interrupt_from_user(void *);
extern void perf_start(struct mc_perf_event *event);
extern void perf_reset(struct mc_perf_event *event);
static struct idt_entry{
uint32_t desc[4];
@ -1642,9 +1644,6 @@ int ihk_mc_interrupt_cpu(int cpu, int vector)
return 0;
}
#ifdef POSTK_DEBUG_ARCH_DEP_22
extern void perf_start(struct mc_perf_event *event);
extern void perf_reset(struct mc_perf_event *event);
struct thread *arch_switch_context(struct thread *prev, struct thread *next)
{
struct thread *last;
@ -1666,7 +1665,7 @@ struct thread *arch_switch_context(struct thread *prev, struct thread *next)
}
#ifdef PROFILE_ENABLE
if (prev->profile && prev->profile_start_ts != 0) {
if (prev && prev->profile && prev->profile_start_ts != 0) {
prev->profile_elapsed_ts +=
(rdtsc() - prev->profile_start_ts);
prev->profile_start_ts = 0;
@ -1685,7 +1684,6 @@ struct thread *arch_switch_context(struct thread *prev, struct thread *next)
}
return last;
}
#endif
/*@
@ requires \valid(thread);