-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Disintegrate asm/system.h for IA64. Signed-off-by: David Howells <dhowells@redhat.com> Acked-by: Tony Luck <tony.luck@intel.com> cc: linux-ia64@vger.kernel.org
- Loading branch information
David Howells
committed
Mar 28, 2012
1 parent
8335896
commit c140d87
Showing
61 changed files
with
233 additions
and
249 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
/* | ||
* Memory barrier definitions. This is based on information published | ||
* in the Processor Abstraction Layer and the System Abstraction Layer | ||
* manual. | ||
* | ||
* Copyright (C) 1998-2003 Hewlett-Packard Co | ||
* David Mosberger-Tang <davidm@hpl.hp.com> | ||
* Copyright (C) 1999 Asit Mallick <asit.k.mallick@intel.com> | ||
* Copyright (C) 1999 Don Dugger <don.dugger@intel.com> | ||
*/ | ||
#ifndef _ASM_IA64_BARRIER_H | ||
#define _ASM_IA64_BARRIER_H | ||
|
||
#include <linux/compiler.h> | ||
|
||
/* | ||
* Macros to force memory ordering. In these descriptions, "previous" | ||
* and "subsequent" refer to program order; "visible" means that all | ||
* architecturally visible effects of a memory access have occurred | ||
* (at a minimum, this means the memory has been read or written). | ||
* | ||
* wmb(): Guarantees that all preceding stores to memory- | ||
* like regions are visible before any subsequent | ||
* stores and that all following stores will be | ||
* visible only after all previous stores. | ||
* rmb(): Like wmb(), but for reads. | ||
* mb(): wmb()/rmb() combo, i.e., all previous memory | ||
* accesses are visible before all subsequent | ||
* accesses and vice versa. This is also known as | ||
* a "fence." | ||
* | ||
* Note: "mb()" and its variants cannot be used as a fence to order | ||
* accesses to memory mapped I/O registers. For that, mf.a needs to | ||
* be used. However, we don't want to always use mf.a because (a) | ||
* it's (presumably) much slower than mf and (b) mf.a is supported for | ||
* sequential memory pages only. | ||
*/ | ||
#define mb() ia64_mf() | ||
#define rmb() mb() | ||
#define wmb() mb() | ||
#define read_barrier_depends() do { } while(0) | ||
|
||
#ifdef CONFIG_SMP | ||
# define smp_mb() mb() | ||
# define smp_rmb() rmb() | ||
# define smp_wmb() wmb() | ||
# define smp_read_barrier_depends() read_barrier_depends() | ||
#else | ||
# define smp_mb() barrier() | ||
# define smp_rmb() barrier() | ||
# define smp_wmb() barrier() | ||
# define smp_read_barrier_depends() do { } while(0) | ||
#endif | ||
|
||
/* | ||
* XXX check on this ---I suspect what Linus really wants here is | ||
* acquire vs release semantics but we can't discuss this stuff with | ||
* Linus just yet. Grrr... | ||
*/ | ||
#define set_mb(var, value) do { (var) = (value); mb(); } while (0) | ||
|
||
/* | ||
* The group barrier in front of the rsm & ssm are necessary to ensure | ||
* that none of the previous instructions in the same group are | ||
* affected by the rsm/ssm. | ||
*/ | ||
|
||
#endif /* _ASM_IA64_BARRIER_H */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
/* | ||
* Process execution defines. | ||
* | ||
* Copyright (C) 1998-2003 Hewlett-Packard Co | ||
* David Mosberger-Tang <davidm@hpl.hp.com> | ||
* Copyright (C) 1999 Asit Mallick <asit.k.mallick@intel.com> | ||
* Copyright (C) 1999 Don Dugger <don.dugger@intel.com> | ||
*/ | ||
#ifndef _ASM_IA64_EXEC_H | ||
#define _ASM_IA64_EXEC_H | ||
|
||
#define arch_align_stack(x) (x) | ||
|
||
#endif /* _ASM_IA64_EXEC_H */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,7 +10,6 @@ | |
|
||
#include <linux/cache.h> | ||
#include <asm/percpu.h> | ||
#include <asm/system.h> | ||
|
||
|
||
/* | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,87 @@ | ||
/* | ||
* Low-level task switching. This is based on information published in | ||
* the Processor Abstraction Layer and the System Abstraction Layer | ||
* manual. | ||
* | ||
* Copyright (C) 1998-2003 Hewlett-Packard Co | ||
* David Mosberger-Tang <davidm@hpl.hp.com> | ||
* Copyright (C) 1999 Asit Mallick <asit.k.mallick@intel.com> | ||
* Copyright (C) 1999 Don Dugger <don.dugger@intel.com> | ||
*/ | ||
#ifndef _ASM_IA64_SWITCH_TO_H | ||
#define _ASM_IA64_SWITCH_TO_H | ||
|
||
#include <linux/percpu.h> | ||
|
||
struct task_struct; | ||
|
||
/* | ||
* Context switch from one thread to another. If the two threads have | ||
* different address spaces, schedule() has already taken care of | ||
* switching to the new address space by calling switch_mm(). | ||
* | ||
* Disabling access to the fph partition and the debug-register | ||
* context switch MUST be done before calling ia64_switch_to() since a | ||
* newly created thread returns directly to | ||
* ia64_ret_from_syscall_clear_r8. | ||
*/ | ||
extern struct task_struct *ia64_switch_to (void *next_task); | ||
|
||
extern void ia64_save_extra (struct task_struct *task); | ||
extern void ia64_load_extra (struct task_struct *task); | ||
|
||
#ifdef CONFIG_VIRT_CPU_ACCOUNTING | ||
extern void ia64_account_on_switch (struct task_struct *prev, struct task_struct *next); | ||
# define IA64_ACCOUNT_ON_SWITCH(p,n) ia64_account_on_switch(p,n) | ||
#else | ||
# define IA64_ACCOUNT_ON_SWITCH(p,n) | ||
#endif | ||
|
||
#ifdef CONFIG_PERFMON | ||
DECLARE_PER_CPU(unsigned long, pfm_syst_info); | ||
# define PERFMON_IS_SYSWIDE() (__get_cpu_var(pfm_syst_info) & 0x1) | ||
#else | ||
# define PERFMON_IS_SYSWIDE() (0) | ||
#endif | ||
|
||
#define IA64_HAS_EXTRA_STATE(t) \ | ||
((t)->thread.flags & (IA64_THREAD_DBG_VALID|IA64_THREAD_PM_VALID) \ | ||
|| PERFMON_IS_SYSWIDE()) | ||
|
||
#define __switch_to(prev,next,last) do { \ | ||
IA64_ACCOUNT_ON_SWITCH(prev, next); \ | ||
if (IA64_HAS_EXTRA_STATE(prev)) \ | ||
ia64_save_extra(prev); \ | ||
if (IA64_HAS_EXTRA_STATE(next)) \ | ||
ia64_load_extra(next); \ | ||
ia64_psr(task_pt_regs(next))->dfh = !ia64_is_local_fpu_owner(next); \ | ||
(last) = ia64_switch_to((next)); \ | ||
} while (0) | ||
|
||
#ifdef CONFIG_SMP | ||
/* | ||
* In the SMP case, we save the fph state when context-switching away from a thread that | ||
* modified fph. This way, when the thread gets scheduled on another CPU, the CPU can | ||
* pick up the state from task->thread.fph, avoiding the complication of having to fetch | ||
* the latest fph state from another CPU. In other words: eager save, lazy restore. | ||
*/ | ||
# define switch_to(prev,next,last) do { \ | ||
if (ia64_psr(task_pt_regs(prev))->mfh && ia64_is_local_fpu_owner(prev)) { \ | ||
ia64_psr(task_pt_regs(prev))->mfh = 0; \ | ||
(prev)->thread.flags |= IA64_THREAD_FPH_VALID; \ | ||
__ia64_save_fpu((prev)->thread.fph); \ | ||
} \ | ||
__switch_to(prev, next, last); \ | ||
/* "next" in old context is "current" in new context */ \ | ||
if (unlikely((current->thread.flags & IA64_THREAD_MIGRATION) && \ | ||
(task_cpu(current) != \ | ||
task_thread_info(current)->last_cpu))) { \ | ||
platform_migrate(current); \ | ||
task_thread_info(current)->last_cpu = task_cpu(current); \ | ||
} \ | ||
} while (0) | ||
#else | ||
# define switch_to(prev,next,last) __switch_to(prev, next, last) | ||
#endif | ||
|
||
#endif /* _ASM_IA64_SWITCH_TO_H */ |
Oops, something went wrong.