summaryrefslogtreecommitdiffstats
path: root/arch/frv/include/asm/switch_to.h
diff options
context:
space:
mode:
authorDavid Howells <dhowells@redhat.com>2012-03-28 18:30:02 +0100
committerDavid Howells <dhowells@redhat.com>2012-03-28 18:30:02 +0100
commit40ab3317493609c9a8199492588ae7bf88eb12d6 (patch)
tree5758d163e818debc0ac63506be16b858db85a1e8 /arch/frv/include/asm/switch_to.h
parentb1a154dbf9ddbf396578642299ce75aa73d01763 (diff)
downloadop-kernel-dev-40ab3317493609c9a8199492588ae7bf88eb12d6.zip
op-kernel-dev-40ab3317493609c9a8199492588ae7bf88eb12d6.tar.gz
Disintegrate asm/system.h for FRV
Disintegrate asm/system.h for FRV. Signed-off-by: David Howells <dhowells@redhat.com>
Diffstat (limited to 'arch/frv/include/asm/switch_to.h')
-rw-r--r--arch/frv/include/asm/switch_to.h35
1 files changed, 35 insertions, 0 deletions
diff --git a/arch/frv/include/asm/switch_to.h b/arch/frv/include/asm/switch_to.h
new file mode 100644
index 0000000..2cf0f6a
--- /dev/null
+++ b/arch/frv/include/asm/switch_to.h
@@ -0,0 +1,35 @@
+/* FR-V CPU basic task switching
+ *
+ * Copyright (C) 2003 Red Hat, Inc. All Rights Reserved.
+ * Written by David Howells (dhowells@redhat.com)
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version
+ * 2 of the License, or (at your option) any later version.
+ */
+
+#ifndef _ASM_SWITCH_TO_H
+#define _ASM_SWITCH_TO_H
+
+#include <linux/thread_info.h>
+
+/*
+ * switch_to(prev, next) should switch from task `prev' to `next'
+ * `prev' will never be the same as `next'.
+ * The `mb' is to tell GCC not to cache `current' across this call.
+ */
+extern asmlinkage
+struct task_struct *__switch_to(struct thread_struct *prev_thread,
+ struct thread_struct *next_thread,
+ struct task_struct *prev);
+
+#define switch_to(prev, next, last) \
+do { \
+ (prev)->thread.sched_lr = \
+ (unsigned long) __builtin_return_address(0); \
+ (last) = __switch_to(&(prev)->thread, &(next)->thread, (prev)); \
+ mb(); \
+} while(0)
+
+#endif /* _ASM_SWITCH_TO_H */
OpenPOWER on IntegriCloud