diff options
author | Vineet Gupta <vgupta@synopsys.com> | 2014-07-09 05:29:47 -0400 |
---|---|---|
committer | Vineet Gupta <vgupta@synopsys.com> | 2014-07-23 02:00:24 -0400 |
commit | af5abf1b0437300c38d1aa92d7c7aa3deec6b266 (patch) | |
tree | 36075bce0a873f6d04256e849355ae78a4f43b4a /arch | |
parent | 1b1a22b13352f6798935e01a32c18aaad4090e0a (diff) |
ARC: help gcc elide icache helper for !SMP
Signed-off-by: Vineet Gupta <vgupta@synopsys.com>
Diffstat (limited to 'arch')
-rw-r--r-- | arch/arc/mm/cache_arc700.c | 39 |
1 files changed, 28 insertions, 11 deletions
diff --git a/arch/arc/mm/cache_arc700.c b/arch/arc/mm/cache_arc700.c index 1e6766cf9650..4670afc3b971 100644 --- a/arch/arc/mm/cache_arc700.c +++ b/arch/arc/mm/cache_arc700.c | |||
@@ -396,8 +396,16 @@ static inline void __dc_line_op(unsigned long paddr, unsigned long vaddr, | |||
396 | /*********************************************************** | 396 | /*********************************************************** |
397 | * Machine specific helper for per line I-Cache invalidate. | 397 | * Machine specific helper for per line I-Cache invalidate. |
398 | */ | 398 | */ |
399 | static void __ic_line_inv_vaddr_local(unsigned long paddr, unsigned long vaddr, | 399 | |
400 | unsigned long sz) | 400 | static inline void __ic_entire_inv(void) |
401 | { | ||
402 | write_aux_reg(ARC_REG_IC_IVIC, 1); | ||
403 | read_aux_reg(ARC_REG_IC_CTRL); /* blocks */ | ||
404 | } | ||
405 | |||
406 | static inline void | ||
407 | __ic_line_inv_vaddr_local(unsigned long paddr, unsigned long vaddr, | ||
408 | unsigned long sz) | ||
401 | { | 409 | { |
402 | unsigned long flags; | 410 | unsigned long flags; |
403 | 411 | ||
@@ -406,30 +414,39 @@ static void __ic_line_inv_vaddr_local(unsigned long paddr, unsigned long vaddr, | |||
406 | local_irq_restore(flags); | 414 | local_irq_restore(flags); |
407 | } | 415 | } |
408 | 416 | ||
409 | static inline void __ic_entire_inv(void) | 417 | #ifndef CONFIG_SMP |
410 | { | 418 | |
411 | write_aux_reg(ARC_REG_IC_IVIC, 1); | 419 | #define __ic_line_inv_vaddr(p, v, s) __ic_line_inv_vaddr_local(p, v, s) |
412 | read_aux_reg(ARC_REG_IC_CTRL); /* blocks */ | 420 | |
413 | } | 421 | #else |
414 | 422 | ||
415 | struct ic_line_inv_vaddr_ipi { | 423 | struct ic_inv_args { |
416 | unsigned long paddr, vaddr; | 424 | unsigned long paddr, vaddr; |
417 | int sz; | 425 | int sz; |
418 | }; | 426 | }; |
419 | 427 | ||
420 | static void __ic_line_inv_vaddr_helper(void *info) | 428 | static void __ic_line_inv_vaddr_helper(void *info) |
421 | { | 429 | { |
422 | struct ic_line_inv_vaddr_ipi *ic_inv = (struct ic_line_inv_vaddr_ipi*) info; | 430 | struct ic_inv *ic_inv_args = (struct ic_inv_args *) info; |
431 | |||
423 | __ic_line_inv_vaddr_local(ic_inv->paddr, ic_inv->vaddr, ic_inv->sz); | 432 | __ic_line_inv_vaddr_local(ic_inv->paddr, ic_inv->vaddr, ic_inv->sz); |
424 | } | 433 | } |
425 | 434 | ||
426 | static void __ic_line_inv_vaddr(unsigned long paddr, unsigned long vaddr, | 435 | static void __ic_line_inv_vaddr(unsigned long paddr, unsigned long vaddr, |
427 | unsigned long sz) | 436 | unsigned long sz) |
428 | { | 437 | { |
429 | struct ic_line_inv_vaddr_ipi ic_inv = { paddr, vaddr , sz}; | 438 | struct ic_inv_args ic_inv = { |
439 | .paddr = paddr, | ||
440 | .vaddr = vaddr, | ||
441 | .sz = sz | ||
442 | }; | ||
443 | |||
430 | on_each_cpu(__ic_line_inv_vaddr_helper, &ic_inv, 1); | 444 | on_each_cpu(__ic_line_inv_vaddr_helper, &ic_inv, 1); |
431 | } | 445 | } |
432 | #else | 446 | |
447 | #endif /* CONFIG_SMP */ | ||
448 | |||
449 | #else /* !CONFIG_ARC_HAS_ICACHE */ | ||
433 | 450 | ||
434 | #define __ic_entire_inv() | 451 | #define __ic_entire_inv() |
435 | #define __ic_line_inv_vaddr(pstart, vstart, sz) | 452 | #define __ic_line_inv_vaddr(pstart, vstart, sz) |