Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit bf90e1ea authored by Vineet Gupta's avatar Vineet Gupta
Browse files

ARC: Process-creation/scheduling/idle-loop



Signed-off-by: default avatarVineet Gupta <vgupta@synopsys.com>
Cc: Al Viro <viro@ZenIV.linux.org.uk>
Cc: Thomas Gleixner <tglx@linutronix.de>
parent 4adeefe1
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -17,6 +17,8 @@ config ARC
	select GENERIC_FIND_FIRST_BIT
	# for now, we don't need GENERIC_IRQ_PROBE, CONFIG_GENERIC_IRQ_CHIP
	select GENERIC_IRQ_SHOW
	select GENERIC_KERNEL_EXECVE
	select GENERIC_KERNEL_THREAD
	select GENERIC_PENDING_IRQ if SMP
	select GENERIC_SMP_IDLE_THREAD
	select HAVE_GENERIC_HARDIRQS
+20 −0
Original line number Diff line number Diff line
@@ -47,6 +47,17 @@
#define AUX_ITRIGGER		0x40d
#define AUX_IPULSE		0x415

/*
 * Floating Pt Registers
 * Status regs are read-only (build-time) so need not be saved/restored
 */
#define ARC_AUX_FP_STAT         0x300
#define ARC_AUX_DPFP_1L         0x301
#define ARC_AUX_DPFP_1H         0x302
#define ARC_AUX_DPFP_2L         0x303
#define ARC_AUX_DPFP_2H         0x304
#define ARC_AUX_DPFP_STAT       0x305

#ifndef __ASSEMBLY__

/*
@@ -110,6 +121,15 @@

#endif

#ifdef CONFIG_ARC_FPU_SAVE_RESTORE
/* These DPFP regs need to be saved/restored across ctx-sw */
struct arc_fpu {
	struct {
		unsigned int l, h;
	} aux_dpfp[2];
};
#endif

#endif /* __ASEMBLY__ */

#endif /* __KERNEL__ */
+3 −6
Original line number Diff line number Diff line
@@ -29,6 +29,9 @@ struct thread_struct {
	unsigned long callee_reg;	/* pointer to callee regs */
	unsigned long fault_address;	/* dbls as brkpt holder as well */
	unsigned long cause_code;	/* Exception Cause Code (ECR) */
#ifdef CONFIG_ARC_FPU_SAVE_RESTORE
	struct arc_fpu fpu;
#endif
};

#define INIT_THREAD  {                          \
@@ -54,12 +57,6 @@ unsigned long thread_saved_pc(struct task_struct *t);

#define cpu_relax()	do { } while (0)

/*
 * Create a new kernel thread
 */

extern int kernel_thread(int (*fn) (void *), void *arg, unsigned long flags);

#define copy_segments(tsk, mm)      do { } while (0)
#define release_segments(mm)        do { } while (0)

+8 −0
Original line number Diff line number Diff line
@@ -91,6 +91,14 @@ struct callee_regs {
#define in_syscall(regs) (((regs->orig_r8) >= 0 && \
			   (regs->orig_r8 <= NR_syscalls)) ? 1 : 0)

#define current_pt_regs()					\
({								\
	/* open-coded current_thread_info() */			\
	register unsigned long sp asm ("sp");			\
	unsigned long pg_start = (sp & ~(THREAD_SIZE - 1));	\
	(struct pt_regs *)(pg_start + THREAD_SIZE - 4) - 1;	\
})

#endif /* !__ASSEMBLY__ */

#endif /* __KERNEL__ */
+41 −0
Original line number Diff line number Diff line
/*
 * Copyright (C) 2004, 2007-2010, 2011-2012 Synopsys, Inc. (www.synopsys.com)
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License version 2 as
 * published by the Free Software Foundation.
 */

#ifndef _ASM_ARC_SWITCH_TO_H
#define _ASM_ARC_SWITCH_TO_H

#ifndef __ASSEMBLY__

#include <linux/sched.h>

#ifdef CONFIG_ARC_FPU_SAVE_RESTORE

extern void fpu_save_restore(struct task_struct *p, struct task_struct *n);
#define ARC_FPU_PREV(p, n)	fpu_save_restore(p, n)
#define ARC_FPU_NEXT(t)

#else

#define ARC_FPU_PREV(p, n)
#define ARC_FPU_NEXT(n)

#endif /* !CONFIG_ARC_FPU_SAVE_RESTORE */

struct task_struct *__switch_to(struct task_struct *p, struct task_struct *n);

#define switch_to(prev, next, last)	\
do {					\
	ARC_FPU_PREV(prev, next);	\
	last = __switch_to(prev, next);\
	ARC_FPU_NEXT(next);		\
	mb();				\
} while (0)

#endif

#endif
Loading